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