/** * Fold `Associative` through a `Collection`. * * @tsplus static Associative/Ops fold */ export function fold(S: Associative) { return (init: A) => (collection: Collection): A => collection.reduce(init, (x, y) => S.combine(x, y)) }