FruityFoundation/FsBase/Extensions.fs
Kyle Ratti e12137b302
feat: move FSharp stuff into FsBase
This drops the FSharp.Core dependency on FruityFoundation.Base
2022-03-31 20:35:36 -04:00

16 lines
431 B
Forth

namespace FruityFoundation.FsBase
open System.Runtime.CompilerServices
open FruityFoundation.Base.Structures
[<Extension>]
type Extensions () =
[<Extension>]
static member ToMaybe (opt : 'a option) =
match opt with
| Some x -> x |> Maybe.Create
| None -> Maybe.Empty ()
[<Extension>]
static member ToFSharpOption (opt : 'a Maybe) =
if opt.HasValue then Some opt.Value else None