Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type M<'a> =
- | Error
- | ValidResult of 'a
- let (?>) m f =
- match m with
- | ValidResult (v) -> ValidResult (f v)
- | Error -> Error
- // Example:
- let add a b = a + b
- ValidResult 1
- ?> add 2
- ?> printfn "success %i"
- Error
- ?> add 2
- ?> printfn "this line will never be executed %i"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement