EitherUnsafe<L, R> Struct

Either L R Holds one of two values 'Left' or 'Right'. Usually 'Left' is considered 'wrong' or 'in error', and 'Right' is, well, right. So when the Either is in a Left state, it cancels computations like bind or map, etc. So you can see Left as an 'early out, with a message'. Unlike Option that has None as its alternative value (i.e. it has an 'early out, but no message').

DECLARATION
[Serializable]
public struct EitherUnsafe<L, R> : IEnumerable<EitherData<L, R>>,
IEither,
IComparable<EitherUnsafe<L, R>>,
IComparable<R>,
IEquatable<EitherUnsafe<L, R>>,
IEquatable<R>,
ISerializable
NAMESPACE
LanguageExt
REMARKS
NOTE: If you use Filter or Where (or 'where' in a LINQ expression) with Either, then the Either will be put into a 'Bottom' state if the predicate returns false. When it's in this state it is neither Right nor Left. And any usage could trigger a BottomException. So be aware of the issue of filtering Either.

Also note, when the Either is in a Bottom state, some operations on it will continue to give valid results or return another Either in the Bottom state and not throw. This is so a filtered Either doesn't needlessly break expressions.

Constructors

EitherUnsafe(SerializationInfo, StreamingContext)
PARAMETERS
info
SerializationInfo
context
StreamingContext
DECLARATION
[Pure]
public ctor EitherUnsafe(SerializationInfo info, StreamingContext context)
EitherUnsafe(IEnumerable<EitherData<L, R>>)
SUMMARY

Ctor that facilitates serialisation

PARAMETERS
either
IEnumerable<EitherData<L, R>>
DECLARATION
[Pure]
public ctor EitherUnsafe(IEnumerable<EitherData<L, R>> either)

Fields

Bottom
DECLARATION
public static readonly EitherUnsafe<L, R> Bottom
State
SUMMARY

State of the EitherUnsafe You can also use:

IsRight
IsLeft
IsBottom

DECLARATION
public readonly EitherStatus State

Properties

IsBottom
SUMMARY

Is the EitherUnsafe in a Bottom state? When the EitherUnsafe is filtered, both Right and Left are meaningless.

If you use Filter or Where (or 'where' in a LINQ expression) with EitherUnsafe, then the EitherUnsafe will be put into a 'Bottom' state if the predicate returns false. When it's in this state it is neither Right nor Left. And any usage could trigger a BottomException. So be aware of the issue of filtering Either.

Also note, when the EitherUnsafe is in a Bottom state, some operations on it will continue to give valid results or return another EitherUnsafe in the Bottom state and not throw. This is so a filtered EitherUnsafe doesn't needlessly break expressions.

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

Is the EitherUnsafe in a Left state?

DECLARATION
[Pure]
public bool IsLeft { get; }
RETURNS
bool
IsRight
SUMMARY

Is the EitherUnsafe in a Right state?

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

Methods

BiBind<B>(Func<R, EitherUnsafe<L, B>>, Func<L, EitherUnsafe<L, B>>)
SUMMARY

Bi-bind. Allows mapping of both monad states

PARAMETERS
Right
Func<R, EitherUnsafe<L, B>>
Left
Func<L, EitherUnsafe<L, B>>
DECLARATION
[Pure]
public EitherUnsafe<L, B> BiBind<B>(Func<R, EitherUnsafe<L, B>> Right, Func<L, EitherUnsafe<L, B>> Left)
RETURNS
EitherUnsafe<L, B>
BiExists(Func<R, bool>, Func<L, bool>)
SUMMARY

Invokes a predicate on the value of the EitherUnsafe

PARAMETERS
Right
Func<R, bool>
Right predicate
Left
Func<L, bool>
Left predicate
DECLARATION
[Pure]
public bool BiExists(Func<R, bool> Right, Func<L, bool> Left)
RETURNS
bool
True if the predicate returns True. False otherwise or if the EitherUnsafe is in a bottom state.
BiFold<S>(S, Func<S, R, S>, Func<S, L, S>)
SUMMARY

EitherUnsafe types are like lists of 0 or 1 items, and therefore follow the same rules when folding.

In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

PARAMETERS
state
S
Initial state
Right
Func<S, R, S>
Folder function, applied if EitherUnsafe is in a Right state
Left
Func<S, L, S>
Folder function, applied if EitherUnsafe is in a Left state
DECLARATION
[Pure]
public S BiFold<S>(S state, Func<S, R, S> Right, Func<S, L, S> Left)
RETURNS
S
The aggregate state
BiForAll(Func<R, bool>, Func<L, bool>)
SUMMARY

Invokes a predicate on the value of the EitherUnsafe if it's in the Right state

PARAMETERS
Right
Func<R, bool>
Predicate
Left
Func<L, bool>
Predicate
DECLARATION
[Pure]
public bool BiForAll(Func<R, bool> Right, Func<L, bool> Left)
RETURNS
bool
True if EitherUnsafe Predicate returns true
BiIter(Action<R>, Action<L>)
SUMMARY

Iterate the EitherUnsafe action is invoked if in the Right state

PARAMETERS
Right
Action<R>
Left
Action<L>
DECLARATION
public Unit BiIter(Action<R> Right, Action<L> Left)
BiMap<L2, R2>(Func<R, R2>, Func<L, L2>)
SUMMARY

Bi-maps the value in the EitherUnsafe if it's in a Right state

PARAMETERS
Right
Func<R, R2>
Right map function
Left
Func<L, L2>
Left map function
DECLARATION
[Pure]
public EitherUnsafe<L2, R2> BiMap<L2, R2>(Func<R, R2> Right, Func<L, L2> Left)
RETURNS
EitherUnsafe<L2, R2>
Mapped EitherUnsafe
BiMap<LRet, Ret>(Func<R, Ret>, Func<L, Ret>)
SUMMARY

Bi-maps the value in the EitherUnsafe if it's in a Right state

PARAMETERS
Right
Func<R, Ret>
Right map function
Left
Func<L, Ret>
Left map function
DECLARATION
[Pure]
public EitherUnsafe<L, Ret> BiMap<LRet, Ret>(Func<R, Ret> Right, Func<L, Ret> Left)
RETURNS
EitherUnsafe<L, Ret>
Mapped EitherUnsafe
Bind<Ret>(Func<R, EitherUnsafe<L, Ret>>)
SUMMARY

Monadic bind

PARAMETERS
binder
Func<R, EitherUnsafe<L, Ret>>
DECLARATION
[Pure]
public EitherUnsafe<L, Ret> Bind<Ret>(Func<R, EitherUnsafe<L, Ret>> binder)
RETURNS
EitherUnsafe<L, Ret>
Bound EitherUnsafe
CompareTo(EitherUnsafe<L, R>)
SUMMARY

CompareTo override

PARAMETERS
other
EitherUnsafe<L, R>
DECLARATION
[Pure]
public int CompareTo(EitherUnsafe<L, R> other)
RETURNS
int
CompareTo(R)
SUMMARY

CompareTo override

PARAMETERS
other
R
DECLARATION
[Pure]
public int CompareTo(R other)
RETURNS
int
CompareTo(L)
SUMMARY

CompareTo override

PARAMETERS
other
L
DECLARATION
[Pure]
public int CompareTo(L other)
RETURNS
int
Count()
SUMMARY

Counts the EitherUnsafe

DECLARATION
[Pure]
public int Count()
RETURNS
int
1 if the EitherUnsafe is in a Right state, 0 otherwise.
Equals(object)
SUMMARY

Equality check

PARAMETERS
obj
object
Object to test for equality
DECLARATION
[Pure]
public override bool Equals(object obj)
RETURNS
bool
True if equal
Equals(R)
SUMMARY

Equality override

PARAMETERS
other
R
DECLARATION
[Pure]
public bool Equals(R other)
RETURNS
bool
Equals(L)
SUMMARY

Equality override

PARAMETERS
other
L
DECLARATION
[Pure]
public bool Equals(L other)
RETURNS
bool
Equals(EitherUnsafe<L, R>)
SUMMARY

Equality override

PARAMETERS
other
EitherUnsafe<L, R>
DECLARATION
[Pure]
public bool Equals(EitherUnsafe<L, R> other)
RETURNS
bool
Exists(Func<R, bool>)
SUMMARY

Invokes a predicate on the value of the EitherUnsafe if it's in the Right state

PARAMETERS
pred
Func<R, bool>
Predicate
DECLARATION
[Pure]
public bool Exists(Func<R, bool> pred)
RETURNS
bool
True if the EitherUnsafe is in a Right state and the predicate returns True. False otherwise.
Filter(Func<R, bool>)
SUMMARY

Filter the EitherUnsafe

PARAMETERS
pred
Func<R, bool>
Predicate function
REMARKS
This may give unpredictable results for a filtered value. The EitherUnsafe won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
DECLARATION
[Pure]
public EitherUnsafe<L, R> Filter(Func<R, bool> pred)
RETURNS
EitherUnsafe<L, R>
If the EitherUnsafe is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the EitherUnsafe is returned as-is. If the predicate returns False the EitherUnsafe is returned in a 'Bottom' state.
Fold<S>(S, Func<S, R, S>)
SUMMARY

EitherUnsafe types are like lists of 0 or 1 items, and therefore follow the same rules when folding.

In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

PARAMETERS
state
S
Initial state
Right
Func<S, R, S>
Folder function, applied if structure is in a Right state
DECLARATION
[Pure]
public S Fold<S>(S state, Func<S, R, S> Right)
RETURNS
S
The aggregate state
ForAll(Func<R, bool>)
SUMMARY

Invokes a predicate on the value of the EitherUnsafe if it's in the Right state

PARAMETERS
Right
Func<R, bool>
Predicate
DECLARATION
[Pure]
public bool ForAll(Func<R, bool> Right)
RETURNS
bool
True if the EitherUnsafe is in a Left state. True if the EitherUnsafe is in a Right state and the predicate returns True. False otherwise.
GetEnumerator()
DECLARATION
public IEnumerator<EitherData<L, R>> GetEnumerator()
RETURNS
IEnumerator<EitherData<L, R>>
GetHashCode()
SUMMARY

Returns a hash code of the wrapped value of the EitherUnsafe

DECLARATION
[Pure]
public override int GetHashCode()
RETURNS
int
Hash code
GetObjectData(SerializationInfo, StreamingContext)
PARAMETERS
info
SerializationInfo
context
StreamingContext
DECLARATION
public void GetObjectData(SerializationInfo info, StreamingContext context)
GetUnderlyingLeftType()
SUMMARY

Find out the underlying Left type

DECLARATION
[Pure]
public Type GetUnderlyingLeftType()
RETURNS
Type
GetUnderlyingRightType()
SUMMARY

Find out the underlying Right type

DECLARATION
[Pure]
public Type GetUnderlyingRightType()
RETURNS
Type
GetUnderlyingType()
DECLARATION
[Pure]
public Type GetUnderlyingType()
RETURNS
Type
IfLeftUnsafe(Func<R>)
SUMMARY

Executes the Left function if the EitherUnsafe is in a Left state. Returns the Right value if the EitherUnsafe is in a Right state.

PARAMETERS
Left
Func<R>
Function to generate a Right value if in the Left state
DECLARATION
[Pure]
public R IfLeftUnsafe(Func<R> Left)
RETURNS
R
Returns an unwrapped Right value
IfLeftUnsafe(Func<L, R>)
SUMMARY

Executes the leftMap function if the EitherUnsafe is in a Left state. Returns the Right value if the EitherUnsafe is in a Right state.

PARAMETERS
leftMap
Func<L, R>
Function to generate a Right value if in the Left state
DECLARATION
[Pure]
public R IfLeftUnsafe(Func<L, R> leftMap)
RETURNS
R
Returns an unwrapped Right value
IfLeftUnsafe(R)
SUMMARY

Returns the rightValue if the EitherUnsafe is in a Left state. Returns the Right value if the EitherUnsafe is in a Right state.

PARAMETERS
rightValue
R
Value to return if in the Left state
DECLARATION
[Pure]
public R IfLeftUnsafe(R rightValue)
RETURNS
R
Returns an unwrapped Right value
IfLeftUnsafe(Action<L>)
SUMMARY

Executes the Left action if the EitherUnsafe is in a Left state.

PARAMETERS
Left
Action<L>
Function to generate a Right value if in the Left state
DECLARATION
public Unit IfLeftUnsafe(Action<L> Left)
IfRightUnsafe(Action<R>)
SUMMARY

Invokes the Right action if the EitherUnsafe is in a Right state, otherwise does nothing

PARAMETERS
Right
Action<R>
Action to invoke
DECLARATION
public Unit IfRightUnsafe(Action<R> Right)
IfRightUnsafe(L)
SUMMARY

Returns the leftValue if the EitherUnsafe is in a Right state. Returns the Left value if the EitherUnsafe is in a Left state.

PARAMETERS
leftValue
L
Value to return if in the Left state
DECLARATION
[Pure]
public L IfRightUnsafe(L leftValue)
RETURNS
L
Returns an unwrapped Left value
IfRightUnsafe(Func<L>)
SUMMARY

Returns the result of Right() if the EitherUnsafe is in a Right state. Returns the Left value if the EitherUnsafe is in a Left state.

PARAMETERS
Right
Func<L>
Function to generate a Left value if in the Right state
DECLARATION
[Pure]
public L IfRightUnsafe(Func<L> Right)
RETURNS
L
Returns an unwrapped Left value
IfRightUnsafe(Func<R, L>)
SUMMARY

Returns the result of rightMap if the EitherUnsafe is in a Right state. Returns the Left value if the EitherUnsafe is in a Left state.

PARAMETERS
rightMap
Func<R, L>
Function to generate a Left value if in the Right state
DECLARATION
[Pure]
public L IfRightUnsafe(Func<R, L> rightMap)
RETURNS
L
Returns an unwrapped Left value
Iter(Action<R>)
SUMMARY

Iterate the EitherUnsafe action is invoked if in the Right state

PARAMETERS
Right
Action<R>
DECLARATION
public Unit Iter(Action<R> Right)
Join<U, K, V>(EitherUnsafe<L, U>, Func<R, K>, Func<U, K>, Func<R, U, V>)
PARAMETERS
inner
EitherUnsafe<L, U>
outerKeyMap
Func<R, K>
innerKeyMap
Func<U, K>
project
Func<R, U, V>
DECLARATION
[Pure]
public EitherUnsafe<L, V> Join<U, K, V>(EitherUnsafe<L, U> inner, Func<R, K> outerKeyMap, Func<U, K> innerKeyMap, Func<R, U, V> project)
RETURNS
EitherUnsafe<L, V>
LeftAsEnumerable()
SUMMARY

Project the EitherUnsafe into a IEnumerable L

DECLARATION
[Pure]
public Seq<L> LeftAsEnumerable()
RETURNS
Seq<L>
If the EitherUnsafe is in a Left state, a IEnumerable of L with one item. A zero length IEnumerable L otherwise
LeftToArray()
SUMMARY

Project the EitherUnsafe into an ImmutableArray R

DECLARATION
[Pure]
public Arr<L> LeftToArray()
RETURNS
Arr<L>
If the EitherUnsafe is in a Right state, a ImmutableArray of R with one item. A zero length ImmutableArray of R otherwise
LeftToList()
SUMMARY

Project the EitherUnsafe into a Lst R

DECLARATION
[Pure]
public Lst<L> LeftToList()
RETURNS
Lst<L>
If the EitherUnsafe is in a Right state, a Lst of R with one item. A zero length Lst R otherwise
LeftToSeq()
SUMMARY

Convert either to sequence of 0 or 1 left values

DECLARATION
[Pure]
public Seq<L> LeftToSeq()
RETURNS
Seq<L>
Map<Ret>(Func<R, Ret>)
SUMMARY

Maps the value in the EitherUnsafe if it's in a Right state

PARAMETERS
mapper
Func<R, Ret>
Map function
DECLARATION
[Pure]
public EitherUnsafe<L, Ret> Map<Ret>(Func<R, Ret> mapper)
RETURNS
EitherUnsafe<L, Ret>
Mapped EitherUnsafe
MapLeft<Ret>(Func<L, Ret>)
SUMMARY

Maps the value in the EitherUnsafe if it's in a Left state

PARAMETERS
mapper
Func<L, Ret>
Map function
DECLARATION
[Pure]
public EitherUnsafe<Ret, R> MapLeft<Ret>(Func<L, Ret> mapper)
RETURNS
EitherUnsafe<Ret, R>
Mapped EitherUnsafe
MatchAsyncUnsafe<R2>(Func<R, Task<R2>>, Func<L, R2>)
SUMMARY

Match the two states of the EitherUnsafe and return a promise for a non-null R2.

PARAMETERS
Right
Func<R, Task<R2>>
Left
Func<L, R2>
DECLARATION
public Task<R2> MatchAsyncUnsafe<R2>(Func<R, Task<R2>> Right, Func<L, R2> Left)
RETURNS
Task<R2>
A promise to return a non-null R2
MatchAsyncUnsafe<R2>(Func<R, Task<R2>>, Func<L, Task<R2>>)
SUMMARY

Match the two states of the EitherUnsafe and return a promise for a non-null R2.

PARAMETERS
Right
Func<R, Task<R2>>
Left
Func<L, Task<R2>>
DECLARATION
public Task<R2> MatchAsyncUnsafe<R2>(Func<R, Task<R2>> Right, Func<L, Task<R2>> Left)
RETURNS
Task<R2>
A promise to return a non-null R2
MatchObservableUnsafe<R2>(Func<R, IObservable<R2>>, Func<L, R2>)
SUMMARY

Match the two states of the EitherUnsafe and return an observable stream of non-null R2s.

PARAMETERS
Right
Func<R, IObservable<R2>>
Left
Func<L, R2>
DECLARATION
[Pure]
public IObservable<R2> MatchObservableUnsafe<R2>(Func<R, IObservable<R2>> Right, Func<L, R2> Left)
RETURNS
IObservable<R2>
MatchObservableUnsafe<R2>(Func<R, IObservable<R2>>, Func<L, IObservable<R2>>)
SUMMARY

Match the two states of the EitherUnsafe and return an observable stream of non-null R2s.

PARAMETERS
Right
Func<R, IObservable<R2>>
Left
Func<L, IObservable<R2>>
DECLARATION
[Pure]
public IObservable<R2> MatchObservableUnsafe<R2>(Func<R, IObservable<R2>> Right, Func<L, IObservable<R2>> Left)
RETURNS
IObservable<R2>
MatchUnsafe(Action<R>, Action<L>, Action)
SUMMARY

Invokes the Right or Left action depending on the state of the EitherUnsafe

PARAMETERS
Right
Action<R>
Action to invoke if in a Right state
Left
Action<L>
Action to invoke if in a Left state
Bottom
Action
DECLARATION
public Unit MatchUnsafe(Action<R> Right, Action<L> Left, Action Bottom = null)
EXCEPTIONS
BottomException
Thrown if matching on an EitherUnsafe in a bottom state
MatchUnsafe<Ret>(Func<R, Ret>, Func<L, Ret>, Func<Ret>)
SUMMARY

Invokes the Right or Left function depending on the state of the EitherUnsafe

PARAMETERS
Right
Func<R, Ret>
Function to invoke if in a Right state
Left
Func<L, Ret>
Function to invoke if in a Left state
Bottom
Func<Ret>
DECLARATION
[Pure]
public Ret MatchUnsafe<Ret>(Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null)
RETURNS
Ret
The return value of the invoked function
EXCEPTIONS
BottomException
Thrown if matching on an EitherUnsafe in a bottom state
MatchUntyped<R1>(Func<object, R1>, Func<R1>)
PARAMETERS
Some
Func<object, R1>
None
Func<R1>
DECLARATION
[Pure]
public R1 MatchUntyped<R1>(Func<object, R1> Some, Func<R1> None)
RETURNS
R1
MatchUntyped<TResult>(Func<object, TResult>, Func<object, TResult>)
SUMMARY

Match the Right and Left values but as objects. This can be useful to avoid reflection.

PARAMETERS
Right
Func<object, TResult>
Left
Func<object, TResult>
DECLARATION
[Pure]
public TResult MatchUntyped<TResult>(Func<object, TResult> Right, Func<object, TResult> Left)
RETURNS
TResult
Right(Action<R>)
SUMMARY

Match Right and return a context. You must follow this with .Left(...) to complete the match

PARAMETERS
right
Action<R>
Action to invoke if the EitherUnsafe is in a Right state
DECLARATION
[Pure]
public EitherUnsafeUnitContext<L, R> Right(Action<R> right)
RETURNS
EitherUnsafeUnitContext<L, R>
Context that must have Left() called upon it.
Right<Ret>(Func<R, Ret>)
SUMMARY

Match Right and return a context. You must follow this with .Left(...) to complete the match

PARAMETERS
right
Func<R, Ret>
Action to invoke if the EitherUnsafe is in a Right state
DECLARATION
[Pure]
public EitherUnsafeContext<L, R, Ret> Right<Ret>(Func<R, Ret> right)
RETURNS
EitherUnsafeContext<L, R, Ret>
Context that must have Left() called upon it.
RightAsEnumerable()
SUMMARY

Project the EitherUnsafe into a IEnumerable R

DECLARATION
[Pure]
public Seq<R> RightAsEnumerable()
RETURNS
Seq<R>
If the EitherUnsafe is in a Right state, a IEnumerable of R with one item. A zero length IEnumerable R otherwise
RightToArray()
SUMMARY

Project the EitherUnsafe into an ImmutableArray R

DECLARATION
[Pure]
public Arr<R> RightToArray()
RETURNS
Arr<R>
If the EitherUnsafe is in a Right state, a ImmutableArray of R with one item. A zero length ImmutableArray of R otherwise
RightToList()
SUMMARY

Project the EitherUnsafe into a Lst R

DECLARATION
[Pure]
public Lst<R> RightToList()
RETURNS
Lst<R>
If the EitherUnsafe is in a Right state, a Lst of R with one item. A zero length Lst R otherwise
RightToSeq()
SUMMARY

Convert either to sequence of 0 or 1 right values

DECLARATION
[Pure]
public Seq<R> RightToSeq()
RETURNS
Seq<R>
Select<U>(Func<R, U>)
SUMMARY

Maps the value in the EitherUnsafe if it's in a Right state

PARAMETERS
map
Func<R, U>
Map function
DECLARATION
[Pure]
public EitherUnsafe<L, U> Select<U>(Func<R, U> map)
RETURNS
EitherUnsafe<L, U>
Mapped EitherUnsafe
SelectMany<U, V>(Func<R, EitherUnsafe<L, U>>, Func<R, U, V>)
SUMMARY

Monadic bind function

PARAMETERS
bind
Func<R, EitherUnsafe<L, U>>
project
Func<R, U, V>
DECLARATION
[Pure]
public EitherUnsafe<L, V> SelectMany<U, V>(Func<R, EitherUnsafe<L, U>> bind, Func<R, U, V> project)
RETURNS
EitherUnsafe<L, V>
Bound EitherUnsafe
ToArray()
SUMMARY

Project the EitherUnsafe into an ImmutableArray R

DECLARATION
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("ToArray has been deprecated. Please use RightToArray.")]
public Arr<R> ToArray()
RETURNS
Arr<R>
If the EitherUnsafe is in a Right state, a ImmutableArray of R with one item. A zero length ImmutableArray of R otherwise
ToEither()
SUMMARY

Convert the EitherUnsafe to an EitherUnsafeUnsafe

DECLARATION
[Pure]
public Either<L, R> ToEither()
RETURNS
Either<L, R>
EitherUnsafeUnsafe
ToList()
SUMMARY

Project the EitherUnsafe into a Lst R

DECLARATION
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("ToList has been deprecated. Please use RightToList.")]
public Lst<R> ToList()
RETURNS
Lst<R>
If the EitherUnsafe is in a Right state, a Lst of R with one item. A zero length Lst R otherwise
ToOption()
SUMMARY

Convert the EitherUnsafe to an Option

DECLARATION
[Pure]
public Option<R> ToOption()
RETURNS
Option<R>
Some(Right) or None
ToString()
SUMMARY

Return a string representation of the EitherUnsafe

DECLARATION
[Pure]
public override string ToString()
RETURNS
string
String representation of the EitherUnsafe
ToTryOption()
SUMMARY

Convert the EitherUnsafe to an TryOption

DECLARATION
[Pure]
public TryOption<R> ToTryOption()
RETURNS
TryOption<R>
Some(Right) or None
ToValidation()
DECLARATION
[Pure]
public Validation<L, R> ToValidation()
RETURNS
Validation<L, R>
Where(Func<R, bool>)
SUMMARY

Filter the EitherUnsafe

PARAMETERS
pred
Func<R, bool>
Predicate function
REMARKS
This may give unpredictable results for a filtered value. The EitherUnsafe won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
DECLARATION
[Pure]
[EditorBrowsable(EditorBrowsableState.Never)]
public EitherUnsafe<L, R> Where(Func<R, bool> pred)
RETURNS
EitherUnsafe<L, R>
If the EitherUnsafe is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the EitherUnsafe is returned as-is. If the predicate returns False the EitherUnsafe is returned in a 'Bottom' state. IsLeft will return True, but the value of Left = default(L)