Either<L, R> class
abstract
Simple Either monad implementation
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
-
right
→ RightProjection<
L, R> -
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 oronRight
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