Class Maybe
- Namespace
- LfrlAnvil.Functional
- Assembly
- LfrlAnvil.Functional.dll
Creates instances of Maybe<T> type.
public static class Maybe
- Inheritance
-
Maybe
- Inherited Members
Fields
None
Represents a lack of value.
public static readonly Nil None
Field Value
Methods
GetUnderlyingType(Type?)
Attempts to extract the underlying type from the provided Maybe<T>type
.
[Pure]
public static Type? GetUnderlyingType(Type? type)
Parameters
type
TypeType to extract the underlying type from.
Returns
Some<T>(T?)
Creates a new Maybe<T> instance with a value.
[Pure]
public static Maybe<T> Some<T>(T? value) where T : notnull
Parameters
value
TUnderlying value.
Returns
Type Parameters
T
Value type.
Exceptions
- ArgumentNullException
When
value
is null.