Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created October 31, 2017 14:02
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 deque-blog/b77ab340690e394611150d765d0235ea to your computer and use it in GitHub Desktop.
Save deque-blog/b77ab340690e394611150d765d0235ea to your computer and use it in GitHub Desktop.
runPure $ -- Run the pipeline in the Identity Monad (pure)
iterating (+1) 0 -- Generate the integers from 0 to infinity
.| takingWhile (< 5) -- Take the ones below 5
.| fold (+) 0 -- And sum them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment