FruityFoundation/FsBase/Extensions.fs
Kyle Ratti 479b30b60a
BREAKING CHANGE: chore: rename Maybe.Just to Maybe.Create
This was a bad AI suggestion and I regret the decision.
2024-04-30 13:18:51 -04:00

16 lines
456 B
Forth

namespace FruityFoundation.FsBase
open System.Collections.Generic
open FruityFoundation.Base.Structures
module Array =
let toReadOnlyCollection (a : 'a array) = a :> 'a IReadOnlyCollection
module Option =
let toMaybe : 'a option -> Maybe<'a> = function
| Some x -> x |> Maybe.Create
| None -> Maybe.Empty ()
let fromMaybe : Maybe<'a> -> 'a option = function
| x when x.HasValue -> Some x.Value
| _ -> None