Skip to content

Instantly share code, notes, and snippets.

@chamook
Created June 15, 2016 19:11
Show Gist options
  • Select an option

  • Save chamook/0bf33e0735ade8b053f50a3f87f17b94 to your computer and use it in GitHub Desktop.

Select an option

Save chamook/0bf33e0735ade8b053f50a3f87f17b94 to your computer and use it in GitHub Desktop.
namespace Rop
type Result<'TSuccess, 'TFailure> =
| Success of 'TSuccess
| Failure of 'TFailure
module Result =
let map f x =
match x with
| Success s -> s |> f |> Success
| Failure y -> y |> Failure
let bind f x =
match x with
| Success s -> s |> f
| Failure y -> y |> Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment