A class used while converting Cabal dependencies into Debian dependencies.
- class Interspersed t around between | t -> around, t -> between where
- leftmost :: t -> around
- pairs :: t -> [(between, around)]
- foldTriples :: (around -> between -> around -> r -> r) -> r -> t -> r
- foldInverted :: (Maybe between -> around -> Maybe between -> r -> r) -> r -> t -> r
- foldArounds :: (around -> around -> r -> r) -> r -> t -> r
- foldBetweens :: (between -> r -> r) -> r -> t -> r
Minimum implementation is a method to return the leftmost B, and another to return the following (C,B) pairs. Its unfortunate to require lists in the implementation, a fold function would be better (though I find implementing such folds to be a pain in the you-know-what.)
The class provides implementations of three folds, each of which exposes slightly different views of the data.