Interface IResultMonad<T, TError>
Represents the common interface for Result monad.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public interface IResultMonad<T, out TError> : IOptionMonad<T>, ISupplier<object?>, IFunctional<Func<object?>> where TError : notnull
Type Parameters
| Name | Description |
|---|---|
| T | The type of the result. |
| TError | The type that represents an error. |
Properties
| Edit this page View SourceError
Gets the error.
Declaration
TError? Error { get; }
Property Value
| Type | Description |
|---|---|
| TError |
Methods
| Edit this page View SourceOrInvoke(Func<TError, T>)
Returns the value if present; otherwise invoke delegate.
Declaration
T OrInvoke(Func<out TError, T> defaultFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TError, T> | defaultFunc | A delegate to be invoked if value is not present. |
Returns
| Type | Description |
|---|---|
| T | The value, if present, otherwise returned from delegate. |