/** * Construct `Either` from `Maybe` constructing `E` with `onNone`. * * @tsplus static Either.Ops fromMaybe */ export function fromMaybe(maybe: Maybe, onNone: LazyArg): Either { return maybe.isNone() ? Either.left(onNone()) : Either.right(maybe.value) }