Method Bind
Bind(Func<T, Maybe<T>>)
If this maybe is not empty, calls the specified function providing the value of this maybe and returns the result. If this maybe is nothing, returns an empty maybe.
Declaration
public Maybe<T> Bind(Func<T, Maybe<T>> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Maybe<T>> | func | The function to call if this maybe is not empty. |
Returns
Type | Description |
---|---|
Maybe<T> | A Maybe{T}. Will be an empty maybe if this maybe is empty. |
Bind<TResult>(Func<T, Maybe<TResult>>)
If this maybe is not empty, calls the specified function providing the value of this maybe and returns the result. If this maybe is nothing, returns an empty maybe.
Declaration
public Maybe<TResult> Bind<TResult>(Func<T, Maybe<TResult>> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Maybe<TResult>> | func | The function to call if this maybe is not empty. |
Returns
Type | Description |
---|---|
Maybe<TResult> | A Maybe{TResult}. Will be an empty maybe if this maybe is empty. |
Type Parameters
Name | Description |
---|---|
TResult | The type of value returned from the provided function. |