Skip to content

Instantly share code, notes, and snippets.

@bartelink
Forked from horsdal/gist:8677391
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartelink/8720521 to your computer and use it in GitHub Desktop.
Save bartelink/8720521 to your computer and use it in GitHub Desktop.
public static TRes Match<T,TRes>(this FSharpOption<T> opt, Func<T,TRes> some, Func<TRes> none)
{
if (FSharpOption<T>.get_IsSome(opt))
return some.Invoke(opt.Value);
else
return none.Invoke();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment