/** * Use `A => B` to transform `Either` to `Either`. * * @tsplus static Either.Aspects map * @tsplus pipeable Either map */ export function map(f: (a: A) => B) { return (self: Either): Either => self.isLeft() ? self : Either.right(f(self.right)) }