cond<L, R> static method

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

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

Implementation

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