Skip to content

Instantly share code, notes, and snippets.

@SteveGilham
Created April 26, 2015 13:58
Show Gist options
  • Save SteveGilham/c3a54b82b2cdccd92fa7 to your computer and use it in GitHub Desktop.
Save SteveGilham/c3a54b82b2cdccd92fa7 to your computer and use it in GitHub Desktop.
Option monad definition
type OptionBuilder() =
member self.Bind(input, operation) = Option.bind operation input
member self.Delay (operation:(unit -> 'a option)) = operation ()
member self.Return input = Some input
member self.ReturnFrom (input : 'a option) = input
let option = OptionBuilder();;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment