FruityFoundation/Base/Extensions/FSharpExtensions.cs
Kyle Ratti 18d2e1616b
v1.0
2022-02-13 11:59:47 -05:00

12 lines
308 B
C#

using CommonCore.Base.Structures;
using Microsoft.FSharp.Core;
namespace CommonCore.Base.Extensions;
public static class FSharpExtensions
{
public static Maybe<T> ToMaybe<T>(this FSharpOption<T> option) =>
FSharpOption<T>.get_IsSome(option)
? Maybe<T>.Create(option.Value)
: Maybe<T>.Empty();
}