fromEither<L, R> function
Transforms an Either into an Option. Right becomes Some, and Left becomes None.
expect(E.right('hello').chain(fromEither), some('hello'));
expect(E.left('fail').chain(fromEither), none());
Implementation
Option<R> fromEither<L, R>(Either<L, R> either) =>
either.chain(E.fold((_) => kNone, some));