/** * @tsplus static Tree.Aspects foldMap * @tsplus pipeable Tree foldMap */ export function foldMap(M: AssociativeIdentity, f: (a: A) => M) { return (self: Tree): M => self.reduce(M.identity, (m, a) => M.combine(m, f(a))) }