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

Safe HaskellNone
LanguageHaskell2010

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 where Source

Associated Types

type ContainerKey set Source

Methods

member :: ContainerKey set -> set -> Bool Source

notMember :: ContainerKey set -> set -> Bool Source

union :: set -> set -> set Source

difference :: set -> set -> set Source

intersection :: set -> set -> set Source

Instances

SetContainer IntSet 
Eq key => SetContainer [(key, value)] 
SetContainer (IntMap value)

This instance uses the functions from Data.IntMap.Strict.

Ord element => SetContainer (Set element) 
(Eq element, Hashable element) => SetContainer (HashSet element) 
Ord k => SetContainer (Map k v)

This instance uses the functions from Data.Map.Strict.

(Eq key, Hashable key) => SetContainer (HashMap key value)

This instance uses the functions from Data.HashMap.Strict.

class PolyMap map where Source

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

Methods

differenceMap :: map value1 -> map value2 -> map value1 Source

intersectionMap :: map value1 -> map value2 -> map value1 Source

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

Instances

PolyMap IntMap

This instance uses the functions from Data.IntMap.Strict.

Ord key => PolyMap (Map key)

This instance uses the functions from Data.Map.Strict.

(Eq key, Hashable key) => PolyMap (HashMap key)

This instance uses the functions from Data.HashMap.Strict.

class (MonoTraversable map, SetContainer map) => IsMap map where Source

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 -> map Source

deleteMap :: ContainerKey map -> map -> map Source

singletonMap :: ContainerKey map -> MapValue map -> map Source

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

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

findWithDefault :: MapValue map -> ContainerKey map -> map -> MapValue map Source

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

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

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 -> map Source

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

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

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

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 -> map Source

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

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

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

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

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

Instances

Eq key => IsMap [(key, value)] 
IsMap (IntMap value)

This instance uses the functions from Data.IntMap.Strict.

Ord key => IsMap (Map key value)

This instance uses the functions from Data.Map.Strict.

(Eq key, Hashable key) => IsMap (HashMap key value)

This instance uses the functions from Data.HashMap.Strict.

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

Methods

insertSet :: Element set -> set -> set Source

deleteSet :: Element set -> set -> set Source

singletonSet :: Element set -> set Source

setFromList :: [Element set] -> set Source

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 where Source

zip operations on MonoFunctors.

Methods

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

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

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