Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module exposes the base class used to power multimap functionality. You should not need to be aware of it unless you are interested in adding a new specific multimap type.
Documentation
class Foldable c => Collection c where Source #
A lower bound for multimap values. By creating an instance of this class, you can use multimap
operations with a custom type. An alternative could have been to use Applicative
but that would
have precluded common implementations like Set
.
singleton :: v -> c v Source #
Creates a singleton collection.
singleton :: Applicative c => v -> c v Source #
Creates a singleton collection.
filter :: (v -> Bool) -> c v -> c v Source #
Returns the size of the collection. The default implementation folds over the entire structure and is O(n).
Checks whether the collection is empty. The default implementation lazily folds over the structure.
Instances
Collection [] Source # | |
Collection Seq Source # | |
Collection Set Source # | |