DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.8.0" />

.NET API 557,976 bytes

 IOptionMonad<T>

public interface IOptionMonad<T> : ISupplier<object>, IFunctional<Func<object>>
Represents common interface for all option monads.
bool HasValue { get; }

Indicates that this monad contains a value.

T Or(T defaultValue)

Returns the value if present; otherwise return default value.

If a value is present, returns the value, otherwise return default value.

T OrInvoke(Func<T> defaultFunc)

Returns the value if present; otherwise invoke delegate.

bool TryGet(out T value)

Attempts to extract value from container if it is present.