FruityFoundation/Base/Extensions/FSharpExtensions.cs

12 lines
308 B
C#
Raw Normal View History

2021-11-19 00:12:02 -05:00
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();
}