Show / Hide Table of Contents

Interface IResultMonad<T, TError, TSelf>

Represents the common interface for Result monad.

Inherited Members
IResultMonad<T, TError>.Error
IResultMonad<T, TError>.OrInvoke(Func<TError, T>)
IOptionMonad<T>.HasValue
IOptionMonad<T>.ValueOrDefault
IOptionMonad<T>.Or(T)
IOptionMonad<T>.OrInvoke(Func<T>)
IOptionMonad<T>.TryGet(out T)
ISupplier<object>.Invoke()
ISupplier<object>.NullOrDefault
IFunctional<Func<object>>.ToDelegate()
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 Source

FromError(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 Source

implicit 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.

  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾