Left<a extends Object?, b extends Object?> class
- Inheritance
- Available extensions
Constructors
- Left(a _value)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
-
maybeLeft
→ Maybe<
a> -
Maybe return the Left value, returning None in case
this
is Rightno setterinherited -
maybeRight
→ Maybe<
b> -
Maybe return the Right value, returning None in case
this
is Leftno setterinherited - runtimeType → SumRuntimeType
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
apply(
Applicative< A> a) → Applicative<B> -
Available on Applicative<
Equivalent toB Function(A)> , provided by the ApplicativeApply extensionf <*> a
-
apply(
Either< E, T> arg) → Either<E, U> -
Available on Either<
Apply the argE, U Function(T)> , provided by the EitherApply extensionarg
tothis
Function only in case both the arg and Function are available. -
bimap<
A1, B1> ({required A1 a(a), required B1 b(b)}) → Either< A1, B1> -
Map the values
A
toA1
andB
toB1
with thea
andb
mappers, respectively.inherited -
bind<
B1> (covariant Either< a, B1> fn(b)) → Either<a, B1> -
Flat map the right value
B
into an Either<A, B1>, while keeping the left value untouched.inherited -
first<
A1> (A1 fn(a)) → Either< A1, b> -
Map the left
A
value into anA1
with thefn
mapper, while keeping the right value untouched.inherited -
fmap<
B1> (B1 fn(b p1)) → Either< a, B1> -
Map the right value
B
into an Either<A, B1>, while keeping the left value untouched.inherited -
getL(
a right(b)) → a -
Handle the right value with
right
and return the leftA
value.inherited -
getR(
b left(a)) → b -
Handle the left value with
left
and return the rightB
value.inherited -
lift<
A, B> (covariant Either< Exception, B Function(A)> fn, covariant Either<Exception, A> a) → Either<Exception, B> -
Perform the operation
fn
with the value ina
and wrap with Applicative<B> for pipelining.inherited -
liftEither<
A1, B1, E1> (Either< E1, B1 Function(A1)> fn, Either<E1, A1> a) → Either<E1, B1> -
Perform the operation
fn
with the valueA
ina
and wrap with Either<E1, B1> for pipelining.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pure<
T> (T value) → Either< a, T> -
Wraps the
value
inside a Applicative<T>inherited -
second<
B1> (B1 fn(b)) → Either< a, B1> -
Map the right
B
value into anB1
with thefn
mapper, while keeping the left value untouched.inherited -
swap(
) → Either< b, a> -
inherited
-
toMaybe(
) → Maybe< T> -
Available on Either<
Object, T> , provided by the EitherToMaybe extension -
toString(
) → String -
A string representation of this object.
override
-
unit<
T> (T value) → Either< a, T> -
Wraps the
value
with this Monad type.inherited -
visit<
R extends Object?> ({required R left(a _value), required R right(b _value)}) → R -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >>(
Applicative< A> a) → Applicative<B> -
Available on Applicative<
Equivalent toB Function(A)> , provided by the ApplicativeApply extensionf <*> a
-
operator >>(
Either< E, T> arg) → Either<E, U> -
Available on Either<
Apply the argE, U Function(T)> , provided by the EitherApply extensionarg
tothis
Function only in case both the arg and Function are available.