fromEither<L, R> static method

IOOption<R> fromEither<L, R>(
  1. Either<L, R> either
)

Build a IOOption from either that returns None when either is Left, otherwise it returns Some.

Implementation

static IOOption<R> fromEither<L, R>(Either<L, R> either) =>
    IOOption(() => either.match((_) => const Option.none(), some));