cond<L, R> static method

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

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

Implementation

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