Method Or
Or<T>(Maybe<T>, Maybe<T>)
Coalesces this value with another. If this value is empty, other
is returned, otherwise this is returned.
Declaration
public static Maybe<T> Or<T>(this Maybe<T> source, Maybe<T> other)
Parameters
Type | Name | Description |
---|---|---|
Maybe<T> | source | A Maybe{T} instance to coalesce. |
Maybe<T> | other | A second Maybe{T} instance to coalesce. |
Returns
Type | Description |
---|---|
Maybe<T> | Either |
Type Parameters
Name | Description |
---|---|
T | The sub-type of the Maybe{T} instances. |
Remarks
Similar to the Coalesce<T>(Maybe<T>, IEnumerable<Maybe<T>>) method is lower allocation when using individual instances as no array or enumerale type needs to be created to pass the individual elements.