mono-traversable-0.6.0.2: Type classes for mapping, folding, and traversing monomorphic containers

Safe HaskellNone

Data.Containers

Description

Warning: This module should be considered highly experimental.

Synopsis

Documentation

class (Monoid set, Semigroup set, MonoFoldable set, Eq (ContainerKey set), GrowingAppend set) => SetContainer set whereSource

Associated Types

type ContainerKey set Source

Methods

member :: ContainerKey set -> set -> BoolSource

notMember :: ContainerKey set -> set -> BoolSource

union :: set -> set -> setSource

difference :: set -> set -> setSource

intersection :: set -> set -> setSource

Instances

SetContainer IntSet 
Eq key => SetContainer [(key, value)] 
SetContainer (IntMap value) 
Ord element => SetContainer (Set element) 
(Eq element, Hashable element) => SetContainer (HashSet element) 
Ord k => SetContainer (Map k v) 
(Eq key, Hashable key) => SetContainer (HashMap key value) 

class PolyMap map whereSource

A guaranteed-polymorphic Map, which allows for more polymorphic versions of functions.

Methods

differenceMap :: map value1 -> map value2 -> map value1Source

intersectionMap :: map value1 -> map value2 -> map value1Source

intersectionWithMap :: (value1 -> value2 -> value3) -> map value1 -> map value2 -> map value3Source

Instances

PolyMap IntMap 
Ord key => PolyMap (Map key) 
(Eq key, Hashable key) => PolyMap (HashMap key) 

class (MonoTraversable map, SetContainer map) => IsMap map whereSource

Associated Types

type MapValue map Source

In some cases, MapValue and Element will be different, e.g., the IsMap instance of associated lists.

Methods

lookup :: ContainerKey map -> map -> Maybe (MapValue map)Source

insertMap :: ContainerKey map -> MapValue map -> map -> mapSource

deleteMap :: ContainerKey map -> map -> mapSource

singletonMap :: ContainerKey map -> MapValue map -> mapSource

mapFromList :: [(ContainerKey map, MapValue map)] -> mapSource

mapToList :: map -> [(ContainerKey map, MapValue map)]Source

findWithDefault :: MapValue map -> ContainerKey map -> map -> MapValue mapSource

insertWith :: (MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> mapSource

insertWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> mapSource

insertLookupWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> (Maybe (MapValue map), map)Source

adjustMap :: (MapValue map -> MapValue map) -> ContainerKey map -> map -> mapSource

adjustWithKey :: (ContainerKey map -> MapValue map -> MapValue map) -> ContainerKey map -> map -> mapSource

updateMap :: (MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> mapSource

updateWithKey :: (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> mapSource

updateLookupWithKey :: (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> (Maybe (MapValue map), map)Source

alterMap :: (Maybe (MapValue map) -> Maybe (MapValue map)) -> ContainerKey map -> map -> mapSource

unionWith :: (MapValue map -> MapValue map -> MapValue map) -> map -> map -> mapSource

unionWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> map -> map -> mapSource

unionsWith :: (MapValue map -> MapValue map -> MapValue map) -> [map] -> mapSource

mapWithKey :: (ContainerKey map -> MapValue map -> MapValue map) -> map -> mapSource

mapKeysWith :: (MapValue map -> MapValue map -> MapValue map) -> (ContainerKey map -> ContainerKey map) -> map -> mapSource

Instances

Eq key => IsMap [(key, value)] 
IsMap (IntMap value) 
Ord key => IsMap (Map key value) 
(Eq key, Hashable key) => IsMap (HashMap key value) 

class (SetContainer set, Element set ~ ContainerKey set) => IsSet set whereSource

Methods

insertSet :: Element set -> set -> setSource

deleteSet :: Element set -> set -> setSource

singletonSet :: Element set -> setSource

setFromList :: [Element set] -> setSource

setToList :: set -> [Element set]Source

Instances

IsSet IntSet 
Ord element => IsSet (Set element) 
(Eq element, Hashable element) => IsSet (HashSet element) 

class MonoFunctor mono => MonoZip mono whereSource

zip operations on MonoFunctors.

Methods

ozipWith :: (Element mono -> Element mono -> Element mono) -> mono -> mono -> monoSource

ozip :: mono -> mono -> [(Element mono, Element mono)]Source

ounzip :: [(Element mono, Element mono)] -> (mono, mono)Source