Safe Haskell | None |
---|
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
Documentation
class Interspersed t around between | t -> around, t -> between whereSource
A class of Bs insterspersed with Cs. It is used when converting the cabal dependencies to debian, where the around type is the binary package name and the between type is the version number.
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.
pairs :: t -> [(between, around)]Source
foldTriples :: (around -> between -> around -> r -> r) -> r -> t -> rSource
foldInverted :: (Maybe between -> around -> Maybe between -> r -> r) -> r -> t -> rSource
foldArounds :: (around -> around -> r -> r) -> r -> t -> rSource
foldBetweens :: (between -> r -> r) -> r -> t -> rSource