diff --git a/FsBase/Extensions.fs b/FsBase/Extensions.fs index b0a97f3..5d66624 100644 --- a/FsBase/Extensions.fs +++ b/FsBase/Extensions.fs @@ -1,16 +1,11 @@ namespace FruityFoundation.FsBase - -open System.Runtime.CompilerServices open FruityFoundation.Base.Structures -[] -type Extensions () = - [] - static member ToMaybe (opt : 'a option) = - match opt with +module Option = + let toMaybe : 'a option -> Maybe<'a> = function | Some x -> x |> Maybe.Create | None -> Maybe.Empty () - [] - static member ToFSharpOption (opt : 'a Maybe) = - if opt.HasValue then Some opt.Value else None \ No newline at end of file + let fromMaybe : Maybe<'a> -> 'a option = function + | x when x.HasValue -> Some x.Value + | _ -> None