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