/** * Reduce a value `b` through an `Either`. * * @tsplus static Either.Aspects reduce * @tsplus pipeable Either reduce */ export function reduce(b: B, f: (b: B, a: A) => B) { return (self: Either): B => self.isLeft() ? b : f(b, self.right) }