separate<A, B> static method

Tuple2<Option<A>, Option<B>> separate<A, B>(
  1. Option<Either<A, B>> m
)

Return a Tuple2 of Option from a Option<Either<A, B>>.

The value on the left of the Either will be the first value of the tuple, while the right value of the Either will be the second of the tuple.

Implementation

static Tuple2<Option<A>, Option<B>> separate<A, B>(Option<Either<A, B>> m) =>
    m.match(
      () => Tuple2(const Option.none(), const Option.none()),
      (either) => Tuple2(either.getLeft(), either.getRight()),
    );