Package com.jnape.palatable.lambda.adt
Class Either.Left<L,R>
- java.lang.Object
-
- com.jnape.palatable.lambda.adt.Either<L,R>
-
- com.jnape.palatable.lambda.adt.Either.Left<L,R>
-
- All Implemented Interfaces:
CoProduct2<L,R,Either<L,R>>
,Applicative<R,Either<L,?>>
,Bifunctor<L,R,Either<?,?>>
,BoundedBifunctor<L,R,java.lang.Object,java.lang.Object,Either<?,?>>
,Functor<R,Either<L,?>>
,Monad<R,Either<L,?>>
,MonadError<L,R,Either<L,?>>
,MonadRec<R,Either<L,?>>
,Traversable<R,Either<L,?>>
private static final class Either.Left<L,R> extends Either<L,R>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
hashCode()
<V> V
match(Fn1<? super L,? extends V> leftFn, Fn1<? super R,? extends V> rightFn)
Given two mapping functions (one from anL
to aV
, one from anR
to aV
), unwrap the value stored in thisEither
, apply the appropriate mapping function, and return the result.java.lang.String
toString()
-
Methods inherited from class com.jnape.palatable.lambda.adt.Either
biMap, biMapL, biMapR, catchError, discardL, discardR, diverge, filter, filter, flatMap, fmap, forfeit, fromMaybe, invert, lazyZip, left, merge, or, orThrow, peek, peek, pure, pureEither, recover, right, throwError, toMaybe, trampolineM, traverse, trying, trying, trying, trying, zip
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.adt.coproduct.CoProduct2
embed, project, projectA, projectB
-
-
-
-
Field Detail
-
l
private final L l
-
-
Constructor Detail
-
Left
private Left(L l)
-
-
Method Detail
-
match
public <V> V match(Fn1<? super L,? extends V> leftFn, Fn1<? super R,? extends V> rightFn)
Description copied from class:Either
Given two mapping functions (one from anL
to aV
, one from anR
to aV
), unwrap the value stored in thisEither
, apply the appropriate mapping function, and return the result.- Specified by:
match
in interfaceCoProduct2<L,R,Either<L,R>>
- Specified by:
match
in classEither<L,R>
- Type Parameters:
V
- the result type- Parameters:
leftFn
- the left value mapping functionrightFn
- the right value mapping function- Returns:
- the result of applying the appropriate mapping function to the wrapped value
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-