[Haskell-beginners] print []

Lukas Lehner lehner.lukas at gmail.com
Wed Aug 14 12:15:11 CEST 2013


That I understand. My question is that I have to enforce the type that
specific way (don't want to use ExtendedDefaultRules) or is there some more
generic way?


On Wed, Aug 14, 2013 at 12:08 PM, David Virebayre <
dav.vire+haskell at gmail.com> wrote:

> 2013/8/13 Lukas Lehner <lehner.lukas at gmail.com>:
> > Good to know extension. And without it?
>
> Someone correct me if I'm wrong, here's how I understand it:
>
> To execute print [], ghc has to find which instance of Show to call.
> How could it find an instance without knowing the type ?
> [] could be a list of anything, and while in theory we know that in
> all cases it should print "[]", in practice ghc can't call that code
> if it doesn't know the type of the list.
>
> David.
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130814/87b65be6/attachment.htm>


More information about the Beginners mailing list