Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created November 5, 2017 13:50
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/02aa4b79720d8f5e657abc8788fee84b to your computer and use it in GitHub Desktop.
Save deque-blog/02aa4b79720d8f5e657abc8788fee84b to your computer and use it in GitHub Desktop.
implementation Monad IOSpec where
(>>=) ma f = recur ma where
recur (Pure a) = f a
recur (ReadLine cont) = ReadLine (recur . cont)
recur (WriteLine s next) = WriteLine s (recur next)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment