
Good to know extension. And without it?
On Tue, Aug 13, 2013 at 4:59 PM, Brandon Allbery
On Tue, Aug 13, 2013 at 10:46 AM, Lukas Lehner
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@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners