Right<L, R> class
- Inheritance
- Available extensions
Constructors
- Right(R _value)
-
const
Properties
Methods
-
all(
bool predicate(R a)) → bool -
Return the result of
predicateapplied to the value of Right. If the Either is Left, returnstrue.inherited -
alt(
covariant Either< L, R> orElse()) → Either<L, R> -
Return the current Either if it is a Right, otherwise return the result of
orElse.override -
andThen<
R2> (covariant Either< L, R2> then()) → Either<L, R2> -
If this Either is a Right, then return the result of calling
then. Otherwise return Left.inherited -
any(
bool predicate(R a)) → bool -
Return the result of
predicateapplied to the value of Right. If the Either is Left, returnsfalse.inherited -
ap<
C> (covariant Either< L, C Function(R r)> a) → Either<L, C> -
Apply the function contained inside
ato change the value on the Right from typeRto a value of typeC.inherited -
bimap<
C, D> (C mLeft(L l), D mRight(R b)) → Either< C, D> -
Define two functions to change both the Left and Right value of the
Either.
inherited
-
bind<
R2> (Either< L, R2> f(R r)) → Either<L, R2> -
Used to chain multiple functions that return a Either.
inherited
-
bindFuture<
R2> (Future< Either< f(R r)) → TaskEither<L, R2> >L, R2> -
Used to chain multiple functions that return a
Future<Either>.override -
call<
B> (covariant Either< L, B> chain) → Either<L, B> -
Chain multiple functions having the same left type
L.inherited -
chainFirst<
C> (covariant Either< L, C> chain(R b)) → Either<L, R> -
Chain a request that returns another Either, execute it, ignore
the result, and return the same value as the current Either.
inherited
-
concatenate(
Monoid< R> monoid) → R -
Use
monoidto combine the value of Right.inherited -
duplicate(
) → Either< L, Either< L, R> > -
Wrap this Either inside another Either.
inherited
-
elem(
R r, Eq< R> eq) → bool -
Return
truewhen value ofris equal to the value inside this Either. If this Either is Left, then returnfalse.override -
exists(
bool predicate(R r)) → bool -
Return the result of calliing
predicatewith the value of Either if it is a Right. Otherwise returnfalse.override -
extend<
Z> (Z f(Either< L, R> t)) → Either<L, Z> -
Change the value of Either from type
Rto typeZbased on the value ofEither<L, R>using functionf.override -
filterOrElse(
bool f(R r), L onFalse(R r)) → Either< L, R> -
If
fapplied on this Either as Right returnstrue, then return this Either. If it returnsfalse, return the result ofonFalsein a Left.inherited -
flatMap<
C> (covariant Either< L, C> f(R a)) → Either<L, C> -
Used to chain multiple functions that return a Either.
override
-
fold<
C> (C onLeft(L l), C onRight(R r)) → C -
Execute
onLeftwhen value is Left, otherwise executeonRight.inherited -
foldLeft<
C> (C b, C f(C acc, R b)) → C -
This method folds the value from left to right.
inherited
-
foldLeftWithIndex<
C> (C c, C f(int i, C acc, R b)) → C -
Return the result of
fcalled withband the value of Right. If this Either is Left, returnb.inherited -
foldMap<
C> (Monoid< C> monoid, C f(R b)) → C -
Use
monoidto combine the value of Right applied tof.inherited -
foldRight<
C> (C b, C f(C acc, R a)) → C -
This method folds the value from right to left.
override
-
foldRightWithIndex<
C> (C c, C f(int i, C acc, R b)) → C -
Return the result of
fcalled withband the value of Right. If this Either is Left, returnb.inherited -
getLeft(
) → Option< L> -
Extract the value from Left in a
Option.override -
getOrElse(
R orElse(L l)) → R -
Return the value inside this Either if it is a Right.
Otherwise return result of
onElse.override -
getRight(
) → Option< R> -
Extract the value from Right in a
Option.inherited -
isLeft(
) → bool -
Return
truewhen this Either is Left.override -
isRight(
) → bool -
Return
truewhen this Either is Right.override -
left(
) → L -
Available on Either<
Returns the value of Left if available. Otherwise, a StateError is thrown.L, R> , provided by the EitherExtension extension -
leftOrNull(
) → L? -
Available on Either<
Returns the value of Left if available. Otherwise,L, R> , provided by the EitherExtension extensionnullis returned. -
length(
) → int -
Returns
1when Either is Right,0otherwise.inherited -
map<
C> (C f(R a)) → Either< L, C> -
If the Either is Right, then change its value from type
Rto typeCusing functionf.override -
map2<
C, D> (covariant Either< L, C> m1, D f(R b, C c)) → Either<L, D> -
Change type of this Either based on its value of type
Rand the value of typeCof another Either.override -
map3<
C, D, E> (covariant Either< L, C> m1, covariant Either<L, D> m2, E f(R b, C c, D d)) → Either<L, E> -
Change type of this Either based on its value of type
R, the value of typeCof a second Either, and the value of typeDof a third Either.override -
mapLeft<
C> (C f(L a)) → Either< C, R> -
If the Either is Left, then change its value from type
Lto typeCusing functionf.override -
match<
C> (C onLeft(L l), C onRight(R r)) → C -
Execute
onLeftwhen value is Left, otherwise executeonRight.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
orElse<
L1> (Either< L1, R> onLeft(L l)) → Either<L1, R> -
If this Either is Left, return the result of
onLeft.override -
pure<
C> (C c) → Either< L, C> -
Return a Right containing the value
c.inherited -
right(
) → R -
Available on Either<
Returns the value of Right if available. Otherwise, a StateError is thrown.L, R> , provided by the EitherExtension extension -
rightOrNull(
) → R? -
Available on Either<
Returns the value of Right if available. Otherwise,L, R> , provided by the EitherExtension extensionnullis returned. -
swap(
) → Either< R, L> -
Swap the values contained inside the Left and Right of this Either.
override
-
toIOEither(
) → IOEither< L, R> -
Convert this Either to a
IOEither.override -
toNullable(
) → R? -
Convert Either to nullable
R?.override -
toOption(
) → Option< R> -
Convert this Either to a
Option:override -
toString(
) → String -
A string representation of this object.
override
-
toTaskEither(
) → TaskEither< L, R> -
Convert this Either to a
TaskEither.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override