cond<A> static method

Option<A> cond<A>(
  1. bool test,
  2. A value
)

If the condition is satify then return value in Some else None

Implementation

static Option<A> cond<A>(bool test, A value) =>
    test ? Option.of(value) : _none();