Created
January 10, 2010 12:34
-
-
Save mneedham/273473 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec nums = seq { yield 1 | |
for n in nums do yield n+1 } | |
How does this work? | |
When we call 'nums' on line 2 it recurses to the function again which means that on the first recursion the only value | |
in 'nums' is 1? So then we add the value 2 into the sequence presumably. Which means that if we recurse again then 1 | |
and 2 will both be in the sequence. Not convinced I understand this very well... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment