/** * Get `A` or in case self is left return `onLeft` result. * * @tsplus static Either.Aspects getOrElse * @tsplus pipeable Either getOrElse */ export function getOrElse(onLeft: (e: E) => A) { return (self: Either): A | B => self.isLeft() ? onLeft(self.left) : self.right }