condLazy<L, R> static method

Either<L, R> condLazy<L, R>(
  1. bool test,
  2. Lazy<L> leftValue,
  3. Lazy<R> rightValue
)

If the condition is true then return rightValue in Right else leftValue in Left

Implementation

static Either<L, R> condLazy<L, R>(
        bool test, Lazy<L> leftValue, Lazy<R> rightValue) =>
    test ? Right(rightValue()) : Left(leftValue());