Monoids and foldable collections