Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Augment =
- type Microsoft.FSharp.Core.Option<'T> with
- static member filter (f : 'T -> bool) (x : option<'T>) =
- match x with
- | Some v when f(v) -> Some v
- | _ -> None
- static member getOrElse (fallback : 'T) (x : option<'T>) = defaultArg x fallback
- static member select (f : 'T -> bool) (x : 'T) =
- if f(x) then Some x
- else None
- static member nullable (x : 'a when 'a : null) : option<'a> =
- if x <> null then Some x
- else None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement