Either<L, R> class abstract

Simple Either monad implementation

Implementers

Constructors

Either()

Properties

hashCode int
The hash code for this object.
no setterinherited
isLeft bool
Returns true if this is a Left, false otherwise.
no setter
isRight bool
Returns true if this is a right, false otherwise.
no setter
left LeftProjection<L, R>
Projects this Either as a Left
no setter
Projects this Either as a Right
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fold<Z>(Z onLeft(L), Z onRight(R)) → Z
Applies onLeft if this is a Left or onRight if this is a Right
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
swap() Either<R, L>
If this is a Left, then return the left value in Right or vice versa.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

cond<L, R>(bool test, R rightValue, L leftValue) Either<L, R>
If the condition is satify then return rightValue in Right else leftValue in Left