XC2IMMSVT6OLWXL65BF4RRE2WUB74ETSTGGYQ6ZUZ5RO5YCJGUBAC
-- | Drop fronts after those accounting for the first n items.
quota :: Int -> Strata a -> Strata a
quota _ (Strata []) = Strata []
quota n (Strata (a:r))
| n > 0 = let
Strata r' = quota (n - length (getFront a)) (Strata r)
in Strata (a : r')
| otherwise = Strata []
-- | 'foldMap' each front separately with one function, then 'foldMap' the
-- results.
nestedFold :: (Monoid m, Monoid n) => (a -> m) -> (m -> n) -> Strata a -> n
nestedFold f g (Strata l) = foldMap (g . foldMap f) l