12 lines
332 B
Forth
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
|