FruityFoundation/FsBase/Extensions.fs
Kyle Ratti 0e7e161327
1.3.0
2023-08-01 22:32:23 -04:00

12 lines
332 B
Forth

namespace FruityFoundation.FsBase
open FruityFoundation.Base.Structures
module Option =
let toMaybe : 'a option -> Maybe<'a> = function
| Some x -> x |> Maybe.Just
| None -> Maybe.Empty ()
let fromMaybe : Maybe<'a> -> 'a option = function
| x when x.HasValue -> Some x.Value
| _ -> None