[Haskell-beginners] print []

Lukas Lehner lehner.lukas at gmail.com
Tue Aug 13 17:08:45 CEST 2013


Good to know extension. And without it?


On Tue, Aug 13, 2013 at 4:59 PM, Brandon Allbery <allbery.b at gmail.com>wrote:

> On Tue, Aug 13, 2013 at 10:46 AM, Lukas Lehner <lehner.lukas at gmail.com>wrote:
>
>> That means ghc cannot infer the type.
>> Is there a way how to # print flatten (List []) ?
>> Or even more general, print [] without enforcing the type?
>>
>
> If you turn on the ExtendedDefaultRules extension ( `{-# LANGUAGE
> ExtendedDefaultRules #-}` pragma or `-X ExtendedDefaultRules` ghc option),
> ghc will infer () for the type just as ghci does. Note that this reduces
> type safety a bit, since ghc will now accept programs that have what
> otherwise would be type errors.
>
> --
> brandon s allbery kf8nh                               sine nomine
> associates
> allbery.b at gmail.com
> ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> _______________________________________________
> 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/20130813/f3c802b6/attachment.htm>


More information about the Beginners mailing list