FruityFoundation/FsBase/Extensions.fs

16 lines
456 B
Forth
Raw Normal View History

namespace FruityFoundation.FsBase
2023-09-03 22:06:54 -04:00
open System.Collections.Generic
open FruityFoundation.Base.Structures
2023-09-03 22:06:54 -04:00
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