On Sat, May 10, 2014 at 1:49 PM, Alexander Berntsen <alexander@plaimi.net> wrote:
But if I chuck it in a source file and attempt to runhaskell or compile
it, this fails with a very nasty error. Oh, what fun! To make it work ni
a source file, you need a type signature in there somewhere. E.g.:

main = mapM_ (\n -> printf "%d %d" (n :: Int) (n^2)) [1..100]

This works fine. This is indeed interesting! Someone care to
additionally make it enlightening as well?

http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html#extended-default-rules

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net