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,Object,Object,Either<?,?>>, Functor<R,Either<L,?>>, Monad<R,Either<L,?>>, MonadError<L,R,Either<L,?>>, MonadRec<R,Either<L,?>>, Traversable<R,Either<L,?>>
Enclosing class:
Either<L,R>

private static final class Either.Left<L,R> extends Either<L,R>
  • Field Details

    • l

      private final L l
  • Constructor Details

    • Left

      private Left(L l)
  • Method Details

    • 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 an L to a V, one from an R to a V), unwrap the value stored in this Either, apply the appropriate mapping function, and return the result.
      Specified by:
      match in interface CoProduct2<L,R,Either<L,R>>
      Specified by:
      match in class Either<L,R>
      Type Parameters:
      V - the result type
      Parameters:
      leftFn - the left value mapping function
      rightFn - the right value mapping function
      Returns:
      the result of applying the appropriate mapping function to the wrapped value
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object