Interface IResultMonad<T, TError, TSelf>
Represents common interface for Result monad.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public interface IResultMonad<T, TError, TSelf> : IResultMonad<T, TError>, IOptionMonad<T, TSelf>, IOptionMonad<T>, ISupplier<object?>, IFunctional<Func<object?>> where TError : notnull where TSelf : struct, IResultMonad<T, TError, TSelf>
Type Parameters
Name | Description |
---|---|
T | The type of the result. |
TError | The type that represents an error. |
TSelf | The implementing type. |
Methods
| Edit this page View SourceFromError(TError)
Creates unsuccessful result.
Declaration
public static abstract TSelf FromError(TError error)
Parameters
Type | Name | Description |
---|---|---|
TError | error | The error representing unsuccessful result. |
Returns
Type | Description |
---|---|
TSelf | The unsuccessful result. |
Operators
| Edit this page View Sourceimplicit operator Optional<T>(in TSelf)
Converts the result to Optional<T> monad.
Declaration
public static implicit operator Optional<T>(in TSelf result)
Parameters
Type | Name | Description |
---|---|---|
TSelf | result | The result to be converted. |
Returns
Type | Description |
---|---|
Optional<T> | The converted result. |