[Haskell-cafe] loop problem

Brandon Allbery allbery.b at gmail.com
Sat May 10 17:59:14 UTC 2014


On Sat, May 10, 2014 at 1:49 PM, Alexander Berntsen <alexander at 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 at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140510/019cc632/attachment.html>


More information about the Haskell-Cafe mailing list