Left<L, R> class

Represent the Left case of the Either monad, containing a value of type L.

Inheritance

Constructors

Left(L value)
const

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → L
final

Methods

combine<T>(Either<L, T> other, R combiner(R, T)) Either<L, R>
Returns combined version of the two Either objects
override
flatMap<T>(Either<L, T> f(R value)) Either<L, T>
Applies a function to the value in the Right case, and returns the result as a new Either instance.
override
fold<T>(T ifLeft(L left), T ifRight(R right)) → T
Applies a function to the value in the Right or Left case, and returns the result.
override
getOrElse(R defaultValue) → R
Returns the value inside the Right case or the provided default value.
override
map<T>(T f(R value)) Either<L, T>
Applies a function to the value in the Right case. Returns a new Either instance with the result of the function.
override
mapLeft<T>(T f(L value)) Either<T, R>
Applies a function to the value in the Left case.

Returns a new Either instance with the result of the function.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orElse(Either<L, R> other) Either<L, R>
Applies a function to the value in the Left case, and returns the result as a new Either instance.
override
toString() String
A string representation of this object.
override

Operators

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