Safe Haskell | None |
---|
Data.Containers
Description
Warning: This module should be considered highly experimental.
- class (Monoid set, Semigroup set, MonoFoldable set, Eq (ContainerKey set), GrowingAppend set) => SetContainer set where
- type ContainerKey set
- member :: ContainerKey set -> set -> Bool
- notMember :: ContainerKey set -> set -> Bool
- union :: set -> set -> set
- difference :: set -> set -> set
- intersection :: set -> set -> set
- class PolyMap map where
- differenceMap :: map value1 -> map value2 -> map value1
- intersectionMap :: map value1 -> map value2 -> map value1
- intersectionWithMap :: (value1 -> value2 -> value3) -> map value1 -> map value2 -> map value3
- class (MonoTraversable map, SetContainer map) => IsMap map where
- type MapValue map
- lookup :: ContainerKey map -> map -> Maybe (MapValue map)
- insertMap :: ContainerKey map -> MapValue map -> map -> map
- deleteMap :: ContainerKey map -> map -> map
- singletonMap :: ContainerKey map -> MapValue map -> map
- mapFromList :: [(ContainerKey map, MapValue map)] -> map
- mapToList :: map -> [(ContainerKey map, MapValue map)]
- findWithDefault :: MapValue map -> ContainerKey map -> map -> MapValue map
- insertWith :: (MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map
- insertWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map
- insertLookupWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> (Maybe (MapValue map), map)
- adjustMap :: (MapValue map -> MapValue map) -> ContainerKey map -> map -> map
- adjustWithKey :: (ContainerKey map -> MapValue map -> MapValue map) -> ContainerKey map -> map -> map
- updateMap :: (MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- updateWithKey :: (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- updateLookupWithKey :: (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> (Maybe (MapValue map), map)
- alterMap :: (Maybe (MapValue map) -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- unionWith :: (MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
- unionWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
- unionsWith :: (MapValue map -> MapValue map -> MapValue map) -> [map] -> map
- mapWithKey :: (ContainerKey map -> MapValue map -> MapValue map) -> map -> map
- mapKeysWith :: (MapValue map -> MapValue map -> MapValue map) -> (ContainerKey map -> ContainerKey map) -> map -> map
- class (SetContainer set, Element set ~ ContainerKey set) => IsSet set where
- insertSet :: Element set -> set -> set
- deleteSet :: Element set -> set -> set
- singletonSet :: Element set -> set
- setFromList :: [Element set] -> set
- setToList :: set -> [Element set]
- class MonoFunctor mono => MonoZip mono where
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) |
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
class (MonoTraversable map, SetContainer map) => IsMap map whereSource
Associated Types
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
class (SetContainer set, Element set ~ ContainerKey set) => IsSet set whereSource
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
Instances