[Haskell-beginners] reverse [1..]

Alexander _ anotherworldofworld at gmail.com
Tue Dec 18 15:30:00 CET 2012


Hello,

Here you try to reverse infinite list. What do you expect to get?


2012/12/18 Emanuel Koczwara <poczta at emanuelkoczwara.pl>

> Hi,
>
>   When I run this code in ghci:
>
>     reverse [1..]
>
>   I get:
>
>     <interactive>: out of memory (requested 2097152 bytes)
>
>   Can anyone explain this behaviour?
>
> Emanuel
>
>
>
> _______________________________________________
> 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/20121218/4c005bee/attachment.htm>


More information about the Beginners mailing list