Skip to content

Instantly share code, notes, and snippets.

@SteveGilham
Created April 26, 2015 14:01
Show Gist options
  • Save SteveGilham/4acbf564c4a7f1f7118d to your computer and use it in GitHub Desktop.
Save SteveGilham/4acbf564c4a7f1f7118d to your computer and use it in GitHub Desktop.
I/O monad operations
let ReturnIO x = IO (fun () -> x)
let FailIO = IO (fun () -> raise IOFailure)
let (>>=) m f = IO (fun () -> RunIO(f(RunIO m)));;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment