
17 Aug
2015
17 Aug
'15
4:44 a.m.
I am a haskell beginner and wondering how the following function works (in procedure) : oddsFrom3 :: [Integer] oddsFrom3 = 3 : map (+2) oddsFrom3 Thanks for your help. -- A GNU [1] LINUX [2] Patron Links: ------ [1] http://gnu.org [2] http://www.linuxfoundation.org/

17 Aug
17 Aug
4:49 a.m.
New subject: [Haskell-cafe] oddsFrom3 function
Hi Debdut, On Mon, Aug 17, 2015 at 04:44:55AM -0400, Debdut Karmakar wrote:
I am a haskell beginner and wondering how the following function works (in procedure) :
oddsFrom3 :: [Integer] oddsFrom3 = 3 : map (+2) oddsFrom3
Thanks for your help.
Try to expand a few steps of the recursion by hand e.g.: 3 : (map (+2) (3 : map (+2) (3 : map (+2) ...))) As you can see, the deeper you go more 'map (+2)' are applied to '3'. Greetings, Daniel
3564
Age (days ago)
3564
Last active (days ago)
1 comments
2 participants
participants (2)
-
Daniel Trstenjak
-
Debdut Karmakar