stringtable-atom-0.0.3: Memoize Strings as Atoms for fast comparison and sorting, with maps and setsSource codeContentsIndex
StringTable.AtomMap
Contents
Map type
Operators
Query
Construction
Insertion
Delete/Update
Combine
Union
Difference
Intersection
Traversal
Map
Fold
Conversion
Lists
Ordered lists
Filter
Submap
Min/Max
Debugging
Synopsis
newtype AtomMap a = MkAtomMap {
fromAtomMap :: IntMap a
}
type Key = Atom
(!) :: AtomMap a -> Key -> a
(\\) :: AtomMap a -> AtomMap b -> AtomMap a
size :: AtomMap a -> Int
member :: Atom -> AtomMap a -> Bool
notMember :: Key -> AtomMap a -> Bool
lookup :: Atom -> AtomMap a -> Maybe a
findWithDefault :: a -> Key -> AtomMap a -> a
empty :: AtomMap a
singleton :: Key -> a -> AtomMap a
insert :: Atom -> a -> AtomMap a -> AtomMap a
insertWith :: (a -> a -> a) -> Atom -> a -> AtomMap a -> AtomMap a
insertWithKey :: (Key -> a -> a -> a) -> Key -> a -> AtomMap a -> AtomMap a
insertLookupWithKey :: (Key -> a -> a -> a) -> Key -> a -> AtomMap a -> (Maybe a, AtomMap a)
delete :: Key -> AtomMap a -> AtomMap a
adjust :: (a -> a) -> Key -> AtomMap a -> AtomMap a
adjustWithKey :: (Key -> a -> a) -> Key -> AtomMap a -> AtomMap a
update :: (a -> Maybe a) -> Key -> AtomMap a -> AtomMap a
updateWithKey :: (Key -> a -> Maybe a) -> Key -> AtomMap a -> AtomMap a
updateLookupWithKey :: (Key -> a -> Maybe a) -> Key -> AtomMap a -> (Maybe a, AtomMap a)
alter :: (Maybe a -> Maybe a) -> Key -> AtomMap a -> AtomMap a
union :: AtomMap a -> AtomMap a -> AtomMap a
unionWith :: (a -> a -> a) -> AtomMap a -> AtomMap a -> AtomMap a
unionWithKey :: (Key -> a -> a -> a) -> AtomMap a -> AtomMap a -> AtomMap a
unions :: [AtomMap a] -> AtomMap a
unionsWith :: (a -> a -> a) -> [AtomMap a] -> AtomMap a
difference :: AtomMap a -> AtomMap b -> AtomMap a
differenceWith :: (a -> b -> Maybe a) -> AtomMap a -> AtomMap b -> AtomMap a
differenceWithKey :: (Key -> a -> b -> Maybe a) -> AtomMap a -> AtomMap b -> AtomMap a
intersection :: AtomMap a -> AtomMap b -> AtomMap a
intersectionWith :: (a -> b -> a) -> AtomMap a -> AtomMap b -> AtomMap a
intersectionWithKey :: (Key -> a -> b -> a) -> AtomMap a -> AtomMap b -> AtomMap a
mapWithKey :: (Atom -> a -> b) -> AtomMap a -> AtomMap b
mapAccum :: (a -> b -> (a, c)) -> a -> AtomMap b -> (a, AtomMap c)
mapAccumWithKey :: (a -> Key -> b -> (a, c)) -> a -> AtomMap b -> (a, AtomMap c)
fold :: (a -> b -> b) -> b -> AtomMap a -> b
foldWithKey :: (Key -> a -> b -> b) -> b -> AtomMap a -> b
elems :: AtomMap a -> [a]
keys :: AtomMap a -> [Atom]
keysSet :: AtomMap a -> AtomSet
assocs :: AtomMap a -> [(Key, a)]
toList :: AtomMap a -> [(Atom, a)]
fromList :: [(Atom, a)] -> AtomMap a
fromListWith :: (a -> a -> a) -> [(Atom, a)] -> AtomMap a
fromListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> AtomMap a
toAscList :: AtomMap a -> [(Key, a)]
fromAscList :: [(Key, a)] -> AtomMap a
fromAscListWith :: (a -> a -> a) -> [(Key, a)] -> AtomMap a
fromAscListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> AtomMap a
fromDistinctAscList :: [(Key, a)] -> AtomMap a
filter :: (a -> Bool) -> AtomMap a -> AtomMap a
filterWithKey :: (Key -> a -> Bool) -> AtomMap a -> AtomMap a
partition :: (a -> Bool) -> AtomMap a -> (AtomMap a, AtomMap a)
partitionWithKey :: (Key -> a -> Bool) -> AtomMap a -> (AtomMap a, AtomMap a)
mapMaybe :: (a -> Maybe b) -> AtomMap a -> AtomMap b
mapMaybeWithKey :: (Atom -> a -> Maybe b) -> AtomMap a -> AtomMap b
mapEither :: (a -> Either b c) -> AtomMap a -> (AtomMap b, AtomMap c)
mapEitherWithKey :: (Key -> a -> Either b c) -> AtomMap a -> (AtomMap b, AtomMap c)
split :: Key -> AtomMap a -> (AtomMap a, AtomMap a)
splitLookup :: Key -> AtomMap a -> (AtomMap a, Maybe a, AtomMap a)
isSubmapOf :: Eq a => AtomMap a -> AtomMap a -> Bool
isSubmapOfBy :: (a -> b -> Bool) -> AtomMap a -> AtomMap b -> Bool
isProperSubmapOf :: Eq a => AtomMap a -> AtomMap a -> Bool
isProperSubmapOfBy :: (a -> b -> Bool) -> AtomMap a -> AtomMap b -> Bool
maxView :: Monad m => AtomMap a -> m (a, AtomMap a)
minView :: Monad m => AtomMap a -> m (a, AtomMap a)
findMin :: AtomMap a -> a
findMax :: AtomMap a -> a
deleteMin :: AtomMap a -> AtomMap a
deleteMax :: AtomMap a -> AtomMap a
deleteFindMin :: AtomMap a -> (a, AtomMap a)
deleteFindMax :: AtomMap a -> (a, AtomMap a)
updateMin :: (a -> a) -> AtomMap a -> AtomMap a
updateMax :: (a -> a) -> AtomMap a -> AtomMap a
updateMinWithKey :: (Key -> a -> a) -> AtomMap a -> AtomMap a
updateMaxWithKey :: (Key -> a -> a) -> AtomMap a -> AtomMap a
minViewWithKey :: Monad m => AtomMap a -> m ((Key, a), AtomMap a)
maxViewWithKey :: Monad m => AtomMap a -> m ((Key, a), AtomMap a)
showTree :: Show a => AtomMap a -> String
showTreeWith :: Show a => Bool -> Bool -> AtomMap a -> String
Map type
newtype AtomMap a Source
Constructors
MkAtomMap
fromAtomMap :: IntMap a
show/hide Instances
type Key = AtomSource
Operators
(!) :: AtomMap a -> Key -> aSource
(\\) :: AtomMap a -> AtomMap b -> AtomMap aSource
Query
size :: AtomMap a -> IntSource
member :: Atom -> AtomMap a -> BoolSource
notMember :: Key -> AtomMap a -> BoolSource
lookup :: Atom -> AtomMap a -> Maybe aSource
findWithDefault :: a -> Key -> AtomMap a -> aSource
Construction
empty :: AtomMap aSource
singleton :: Key -> a -> AtomMap aSource
Insertion
insert :: Atom -> a -> AtomMap a -> AtomMap aSource
insertWith :: (a -> a -> a) -> Atom -> a -> AtomMap a -> AtomMap aSource
insertWithKey :: (Key -> a -> a -> a) -> Key -> a -> AtomMap a -> AtomMap aSource
insertLookupWithKey :: (Key -> a -> a -> a) -> Key -> a -> AtomMap a -> (Maybe a, AtomMap a)Source
Delete/Update
delete :: Key -> AtomMap a -> AtomMap aSource
adjust :: (a -> a) -> Key -> AtomMap a -> AtomMap aSource
adjustWithKey :: (Key -> a -> a) -> Key -> AtomMap a -> AtomMap aSource
update :: (a -> Maybe a) -> Key -> AtomMap a -> AtomMap aSource
updateWithKey :: (Key -> a -> Maybe a) -> Key -> AtomMap a -> AtomMap aSource
updateLookupWithKey :: (Key -> a -> Maybe a) -> Key -> AtomMap a -> (Maybe a, AtomMap a)Source
alter :: (Maybe a -> Maybe a) -> Key -> AtomMap a -> AtomMap aSource
Combine
Union
union :: AtomMap a -> AtomMap a -> AtomMap aSource
unionWith :: (a -> a -> a) -> AtomMap a -> AtomMap a -> AtomMap aSource
unionWithKey :: (Key -> a -> a -> a) -> AtomMap a -> AtomMap a -> AtomMap aSource
unions :: [AtomMap a] -> AtomMap aSource
unionsWith :: (a -> a -> a) -> [AtomMap a] -> AtomMap aSource
Difference
difference :: AtomMap a -> AtomMap b -> AtomMap aSource
differenceWith :: (a -> b -> Maybe a) -> AtomMap a -> AtomMap b -> AtomMap aSource
differenceWithKey :: (Key -> a -> b -> Maybe a) -> AtomMap a -> AtomMap b -> AtomMap aSource
Intersection
intersection :: AtomMap a -> AtomMap b -> AtomMap aSource
intersectionWith :: (a -> b -> a) -> AtomMap a -> AtomMap b -> AtomMap aSource
intersectionWithKey :: (Key -> a -> b -> a) -> AtomMap a -> AtomMap b -> AtomMap aSource
Traversal
Map
mapWithKey :: (Atom -> a -> b) -> AtomMap a -> AtomMap bSource
mapAccum :: (a -> b -> (a, c)) -> a -> AtomMap b -> (a, AtomMap c)Source
mapAccumWithKey :: (a -> Key -> b -> (a, c)) -> a -> AtomMap b -> (a, AtomMap c)Source
Fold
fold :: (a -> b -> b) -> b -> AtomMap a -> bSource
foldWithKey :: (Key -> a -> b -> b) -> b -> AtomMap a -> bSource
Conversion
elems :: AtomMap a -> [a]Source
keys :: AtomMap a -> [Atom]Source
keysSet :: AtomMap a -> AtomSetSource
assocs :: AtomMap a -> [(Key, a)]Source
Lists
toList :: AtomMap a -> [(Atom, a)]Source
fromList :: [(Atom, a)] -> AtomMap aSource
fromListWith :: (a -> a -> a) -> [(Atom, a)] -> AtomMap aSource
fromListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> AtomMap aSource
Ordered lists
toAscList :: AtomMap a -> [(Key, a)]Source
fromAscList :: [(Key, a)] -> AtomMap aSource
fromAscListWith :: (a -> a -> a) -> [(Key, a)] -> AtomMap aSource
fromAscListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> AtomMap aSource
fromDistinctAscList :: [(Key, a)] -> AtomMap aSource
Filter
filter :: (a -> Bool) -> AtomMap a -> AtomMap aSource
filterWithKey :: (Key -> a -> Bool) -> AtomMap a -> AtomMap aSource
partition :: (a -> Bool) -> AtomMap a -> (AtomMap a, AtomMap a)Source
partitionWithKey :: (Key -> a -> Bool) -> AtomMap a -> (AtomMap a, AtomMap a)Source
mapMaybe :: (a -> Maybe b) -> AtomMap a -> AtomMap bSource
mapMaybeWithKey :: (Atom -> a -> Maybe b) -> AtomMap a -> AtomMap bSource
mapEither :: (a -> Either b c) -> AtomMap a -> (AtomMap b, AtomMap c)Source
mapEitherWithKey :: (Key -> a -> Either b c) -> AtomMap a -> (AtomMap b, AtomMap c)Source
split :: Key -> AtomMap a -> (AtomMap a, AtomMap a)Source
splitLookup :: Key -> AtomMap a -> (AtomMap a, Maybe a, AtomMap a)Source
Submap
isSubmapOf :: Eq a => AtomMap a -> AtomMap a -> BoolSource
isSubmapOfBy :: (a -> b -> Bool) -> AtomMap a -> AtomMap b -> BoolSource
isProperSubmapOf :: Eq a => AtomMap a -> AtomMap a -> BoolSource
isProperSubmapOfBy :: (a -> b -> Bool) -> AtomMap a -> AtomMap b -> BoolSource
Min/Max
maxView :: Monad m => AtomMap a -> m (a, AtomMap a)Source
minView :: Monad m => AtomMap a -> m (a, AtomMap a)Source
findMin :: AtomMap a -> aSource
findMax :: AtomMap a -> aSource
deleteMin :: AtomMap a -> AtomMap aSource
deleteMax :: AtomMap a -> AtomMap aSource
deleteFindMin :: AtomMap a -> (a, AtomMap a)Source
deleteFindMax :: AtomMap a -> (a, AtomMap a)Source
updateMin :: (a -> a) -> AtomMap a -> AtomMap aSource
updateMax :: (a -> a) -> AtomMap a -> AtomMap aSource
updateMinWithKey :: (Key -> a -> a) -> AtomMap a -> AtomMap aSource
updateMaxWithKey :: (Key -> a -> a) -> AtomMap a -> AtomMap aSource
minViewWithKey :: Monad m => AtomMap a -> m ((Key, a), AtomMap a)Source
maxViewWithKey :: Monad m => AtomMap a -> m ((Key, a), AtomMap a)Source
Debugging
showTree :: Show a => AtomMap a -> StringSource
showTreeWith :: Show a => Bool -> Bool -> AtomMap a -> StringSource
Produced by Haddock version 2.3.0