Skip to content

Instantly share code, notes, and snippets.

@weidagang
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weidagang/803e1f99c2cdf70286df to your computer and use it in GitHub Desktop.
Save weidagang/803e1f99c2cdf70286df to your computer and use it in GitHub Desktop.
Lazy Evaluation
Prelude> let ones = 1 : ones
Prelude> take 3 ones
[1,1,1]
Prelude> let lessThan x y = y < x
Prelude> takeWhile (lessThan 5) [1..]
[1,2,3,4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment