[Haskell-beginners] oddsFrom3 function

Kim-Ee Yeoh ky3 at atamo.com
Mon Aug 17 07:21:45 UTC 2015


On Mon, Aug 17, 2015 at 1:32 PM, Debdut Karmakar <debdutk at gnulinuxed.tk>
wrote:

> Sorry, I wrote a wrong function, the correct version is:
>
> oddsFrom3 :: [Integer]
> oddsFrom3 = 3 : map (+2) oddsFrom3
>

You can get some idea of lambda evaluation here:

http://chrisuehlinger.com/LambdaBubblePop/

(Alas it doesn't support let expressions much less let rec.)

Once you have a modicum of intuition, you're now ready to appreciate the
illustrated step-by-step evaluation of this infinite list:

http://stackoverflow.com/a/19749422

Based on the SO answer, you can now work out your function on your own.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150817/12c3c48b/attachment.html>


More information about the Beginners mailing list