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 booleanequals(java.lang.Object other)inthashCode()<V> Vmatch(Fn1<? super L,? extends V> leftFn, Fn1<? super R,? extends V> rightFn)Given two mapping functions (one from anLto aV, one from anRto aV), unwrap the value stored in thisEither, apply the appropriate mapping function, and return the result.java.lang.StringtoString()-
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:EitherGiven two mapping functions (one from anLto aV, one from anRto aV), unwrap the value stored in thisEither, apply the appropriate mapping function, and return the result.- Specified by:
matchin interfaceCoProduct2<L,R,Either<L,R>>- Specified by:
matchin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-