- data StringMap v
- insert :: String -> v -> StringMap v -> StringMap v
- singleton :: String -> v -> StringMap v
- member :: String -> StringMap v -> Bool
- size :: StringMap v -> Int
- fromList :: [(String, v)] -> StringMap v
- lookup :: String -> StringMap v -> Maybe v
- (!) :: StringMap v -> String -> Maybe v
- findWithDefault :: v -> String -> StringMap v -> v
- insertWith :: (v -> v -> v) -> String -> v -> StringMap v -> StringMap v
- insertWithKey :: (String -> v -> v -> v) -> String -> v -> StringMap v -> StringMap v
- keys :: StringMap v -> [String]
- assocs :: StringMap v -> [(String, v)]
- elems :: StringMap v -> [v]
- null :: StringMap v -> Bool
Documentation
StringMap v is ternary tree. It is commonly used for storing word lists like dictionaries.
insert :: String -> v -> StringMap v -> StringMap vSource
Inserts an entrie into a tree. Values with the same key will be replaced with the newer value.
singleton :: String -> v -> StringMap vSource
Quickly build a tree without an initial tree. This should be used to create an initial tree, using insert there after.
findWithDefault :: v -> String -> StringMap v -> vSource
insertWith :: (v -> v -> v) -> String -> v -> StringMap v -> StringMap vSource
Inserts a new value into the tree with a given function that combines the new value and the old value together to for a new entry.
insertWith f key newval (fromList [(notkey,val1),(key,oldval)]) == fromList [(notkey,val1),(key,f newval oldval)]
insertWithKey :: (String -> v -> v -> v) -> String -> v -> StringMap v -> StringMap vSource
Inserts a new value into the tree with a given function that combines the new value and the old value together to for a new entry.
insertWithKey f key newval (fromList [(notkey,val1),(key,oldval)]) == fromList [(notkey,val1),(key,f key newval oldval)]