Result<A> Struct

Represents the result of an operation:

A | Exception


DECLARATION
public struct Result<A> : IEquatable<Result<A>>
NAMESPACE
LanguageExt

Constructors

Result(A)
SUMMARY

Constructor of a concrete value

PARAMETERS
value
A
DECLARATION
[Pure]
public ctor Result(A value)
Result(Exception)
SUMMARY

Constructor of an error value

PARAMETERS
e
Exception
DECLARATION
[Pure]
public ctor Result(Exception e)

Fields

Bottom
DECLARATION
public static readonly Result<A> Bottom
None
DECLARATION
public static readonly Result<A> None

Properties

IsBottom
SUMMARY

True if the struct is in an invalid state

DECLARATION
[Pure]
public bool IsBottom { get; }
RETURNS
bool
IsFaulted
SUMMARY

True if the result is faulted

DECLARATION
[Pure]
public bool IsFaulted { get; }
RETURNS
bool

Methods

Equals(Result<A>)
SUMMARY

Equality check

PARAMETERS
other
Result<A>
DECLARATION
[Pure]
public bool Equals(Result<A> other)
RETURNS
bool
Equals(object)
SUMMARY

Equality check

PARAMETERS
obj
object
DECLARATION
[Pure]
public override bool Equals(object obj)
RETURNS
bool
GetHashCode()
SUMMARY

Get hash code for bound value

DECLARATION
[Pure]
public override int GetHashCode()
RETURNS
int
IfFail(A)
PARAMETERS
defaultValue
A
DECLARATION
[Pure]
public A IfFail(A defaultValue)
RETURNS
A
IfFail(Func<Exception, A>)
PARAMETERS
f
Func<Exception, A>
DECLARATION
[Pure]
public A IfFail(Func<Exception, A> f)
RETURNS
A
IfFail(Action<Exception>)
PARAMETERS
f
Action<Exception>
DECLARATION
public Unit IfFail(Action<Exception> f)
IfSucc(Action<A>)
PARAMETERS
f
Action<A>
DECLARATION
public Unit IfSucc(Action<A> f)
Map<B>(Func<A, B>)
PARAMETERS
f
Func<A, B>
DECLARATION
[Pure]
public Result<B> Map<B>(Func<A, B> f)
RETURNS
Result<B>
MapAsync<B>(Func<A, Task<B>>)
PARAMETERS
f
Func<A, Task<B>>
DECLARATION
[Pure]
public async Task<Result<B>> MapAsync<B>(Func<A, Task<B>> f)
RETURNS
Task<Result<B>>
Match<R>(Func<A, R>, Func<Exception, R>)
PARAMETERS
Succ
Func<A, R>
Fail
Func<Exception, R>
DECLARATION
[Pure]
public R Match<R>(Func<A, R> Succ, Func<Exception, R> Fail)
RETURNS
R
ToString()
SUMMARY

Convert the value to a showable string

DECLARATION
[Pure]
public override string ToString()
RETURNS
string