Skip to content

Instantly share code, notes, and snippets.

@markhibberd
Created June 30, 2014 03:36
Show Gist options
  • Save markhibberd/7915b7dc2f56d6b57d4b to your computer and use it in GitHub Desktop.
Save markhibberd/7915b7dc2f56d6b57d4b to your computer and use it in GitHub Desktop.
> let x :: Int -> IO Int; x n = print n >> pure (1 + n)
> foldr (>=>) pure (replicate 5 x) 0
0
1
2
3
4
5
> foldl (>=>) pure (replicate 5 x) 0
0
1
2
3
4
5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment