more-containers-0.2.1.2: A few more collections

Safe HaskellSafe
LanguageHaskell2010

Data.Multimap.Collection

Description

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.

Synopsis

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.

Minimal complete definition

filter

Methods

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 #

size :: c v -> Int Source #

Returns the size of the collection. The default implementation folds over the entire structure and is O(n).

null :: c v -> Bool Source #

Checks whether the collection is empty. The default implementation lazily folds over the structure.

Instances
Collection [] Source # 
Instance details

Defined in Data.Multimap.Collection

Methods

singleton :: v -> [v] Source #

filter :: (v -> Bool) -> [v] -> [v] Source #

size :: [v] -> Int Source #

null :: [v] -> Bool Source #

Collection Seq Source # 
Instance details

Defined in Data.Multimap.Collection

Methods

singleton :: v -> Seq v Source #

filter :: (v -> Bool) -> Seq v -> Seq v Source #

size :: Seq v -> Int Source #

null :: Seq v -> Bool Source #

Collection Set Source # 
Instance details

Defined in Data.Multimap.Collection

Methods

singleton :: v -> Set v Source #

filter :: (v -> Bool) -> Set v -> Set v Source #

size :: Set v -> Int Source #

null :: Set v -> Bool Source #