/** * Extends this computation with another computation that depends on the * result of this computation by running the first computation, using its * result to generate a second computation, and running that computation. * * @tsplus static Either.Aspects flatMap * @tsplus pipeable Either flatMap */ export function flatMap(f: (a: A) => Either) { return (self: Either): Either => self.isLeft() ? self : f(self.right) }