mono-traversable-0.2.0.0: 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, MonoFoldable 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 
Ord 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 (MonoTraversable map, SetContainer map) => IsMap map whereSource

Associated Types

type MapValue map Source

Using just Element can lead to very confusing error messages.

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

Instances

Ord 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