Skip to content

Instantly share code, notes, and snippets.

@forki
Created August 15, 2011 14:49
Show Gist options
  • Select an option

  • Save forki/1146903 to your computer and use it in GitHub Desktop.

Select an option

Save forki/1146903 to your computer and use it in GitHub Desktop.
Define the builder in order to allow syntactic sugar
// use a computation expression builder
// in order to allow syntactic sugar
type SafeOperationBuilder() =
member this.Bind (r, f) = bindF r f
member this.Return x = returnF x
// instanciate the monad
let safe = SafeOperationBuilder()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment