Package io.vavr

Class API.ForLazy2Either<L,T1,T2>

java.lang.Object
io.vavr.API.ForLazy2Either<L,T1,T2>
Type Parameters:
L - the common left-hand type of all Eithers
T1 - the component type of the 1st Either
T2 - the component type of the 2nd Either
Enclosing class:
API

public static class API.ForLazy2Either<L,T1,T2> extends Object
A lazily evaluated For-comprehension with two Eithers.

Constructed via For(...) and evaluated by calling yield(...). Construction is side-effect free; underlying Eithers are traversed only when yield(...) is invoked.

  • Field Details

  • Constructor Details

  • Method Details

    • yield

      public <R> Either<L,R> yield(@NonNull BiFunction<? super T1,? super T2,? extends R> f)
      Produces results by mapping the Cartesian product of all bound values.

      Evaluation is lazy and delegated to the underlying Eithers by composing flatMap and map chains.

      Type Parameters:
      R - the element type of the resulting Either
      Parameters:
      f - a function mapping a tuple of bound values to a result
      Returns:
      an Either containing mapped results
      Throws:
      NullPointerException - if f is null