Created
August 15, 2011 14:49
-
-
Save forki/1146903 to your computer and use it in GitHub Desktop.
Define the builder in order to allow syntactic sugar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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