Haskell Hierarchical Libraries (collections package)ContentsIndex
Data.Trie.String.List
Portabilityportable
Stabilityprovisional
Maintainerhttp://homepages.nildram.co.uk/~ahey/em.png
Contents
Converting StringMaps to Lists.
Association Pairs.
Values only.
Keys only.
Folds.
Association Pairs.
Values only.
Keys only.
Some analogues of common List functions.
Description
List related utilities for StringMaps.
Synopsis
assocs :: StringMap a -> [(String, a)]
assocsRev :: StringMap a -> [(String, a)]
values :: StringMap a -> [a]
keys :: StringMap a -> [String]
keysRev :: StringMap a -> [String]
foldrAssocs :: (String -> a -> b -> b) -> b -> StringMap a -> b
foldrAssocs' :: (String -> a -> b -> b) -> b -> StringMap a -> b
foldrAssocsRev :: (String -> a -> b -> b) -> b -> StringMap a -> b
foldrAssocsRev' :: (String -> a -> b -> b) -> b -> StringMap a -> b
foldrValues :: (a -> b -> b) -> b -> StringMap a -> b
foldrValues' :: (a -> b -> b) -> b -> StringMap a -> b
foldrKeys :: (String -> b -> b) -> b -> StringMap a -> b
foldrKeys' :: (String -> b -> b) -> b -> StringMap a -> b
foldrKeysRev :: (String -> b -> b) -> b -> StringMap a -> b
foldrKeysRev' :: (String -> b -> b) -> b -> StringMap a -> b
mapStringMap :: (a -> b) -> StringMap a -> StringMap b
mapStringMap' :: (a -> b) -> StringMap a -> StringMap b
Converting StringMaps to Lists.
Association Pairs.
assocs :: StringMap a -> [(String, a)]
Lazily extracts the list of (String,Value) association pairs contained by a StringMap in ascending alphabetical order.
assocsRev :: StringMap a -> [(String, a)]

Similar to assocs, but the Strings are reversed. This is faster and promotes sharing of sub-strings. It may also be useful if the strings were generated by a scanner/lexer that uses a reversed character stack to accumulate strings in the first place.

Note however that the ordering of associations is exactly the same as that of assocs (I.E. The reversed strings will not be listed in ascending alphabetical order).

Values only.
values :: StringMap a -> [a]
Similar to assocs, but only the values are extracted (in ascending alphabetical order of the corresponding keys).
Keys only.
keys :: StringMap a -> [String]
Similar to assocs, but only the keys are extracted (in ascending alphabetical order).
keysRev :: StringMap a -> [String]

Similar to keys, but the Strings are reversed. This is faster and promotes sharing of sub-strings. It may also be useful if the strings were generated by a scanner/lexer that uses a reversed character stack to accumulate strings in the first place.

Note however that the ordering of reversed strings is exactly the same as that of keys (I.E. The reversed strings will not be listed in ascending alphabetical order).

Folds.
These functions behave like their List namesakes operating on IntMap contents converted to a List in ascending key order.
Association Pairs.
foldrAssocs :: (String -> a -> b -> b) -> b -> StringMap a -> b

Lazily fold right on the list of (String,Value) association pairs contained by a StringMap in ascending alphabetical order.

Beware of stack overflows if the supplied function is strict in its third argument. Use foldrAssocs' if this is so.

foldrAssocs' :: (String -> a -> b -> b) -> b -> StringMap a -> b
This is the strict version of foldrAssocs. It should be used if the supplied function is strict in its third argument.
foldrAssocsRev :: (String -> a -> b -> b) -> b -> StringMap a -> b

Similar to foldrAssocs, but the Strings are reversed. This is faster and promotes sharing of sub-strings. It may also be useful if the strings were generated by a scanner/lexer that uses a reversed character stack to accumulate strings in the first place.

Note however that the ordering of associations is exactly the same as that of foldrAssocs (I.E. The reversed strings will not be supplied in ascending alphabetical order).

Beware of stack overflows if the supplied function is strict in its third argument. Use foldrAssocsRev' if this is so.

foldrAssocsRev' :: (String -> a -> b -> b) -> b -> StringMap a -> b
This is the strict version of foldrAssocsRev. It should be used if the supplied function is strict in its third argument.
Values only.
foldrValues :: (a -> b -> b) -> b -> StringMap a -> b

Lazily fold right, similar to foldrAssocs but on the list of Values only.

Beware of stack overflows if the supplied function is strict in its second argument. Use foldrValues' if this is so.

foldrValues' :: (a -> b -> b) -> b -> StringMap a -> b
This is the strict version of foldrValues. It should be used if the supplied function is strict in its second argument.
Keys only.
foldrKeys :: (String -> b -> b) -> b -> StringMap a -> b

Lazily fold right, similar to foldrAssocs but on the list of Keys (Strings) only.

Beware of stack overflows if the supplied function is strict in its second argument. Use foldrKeys' if this is so.

foldrKeys' :: (String -> b -> b) -> b -> StringMap a -> b
This is the strict version of foldrKeys. It should be used if the supplied function is strict in its second argument.
foldrKeysRev :: (String -> b -> b) -> b -> StringMap a -> b

Lazily fold right, similar to foldrKeys but on the list of reversed Keys (Strings) only. This is faster and promotes sharing of sub-strings. It may also be useful if the strings were generated by a scanner/lexer that uses a reversed character stack to accumulate strings in the first place.

Note however that the ordering of associations is exactly the same as that of foldrKeys (I.E. The reversed strings will not be supplied in ascending alphabetical order).

Beware of stack overflows if the supplied function is strict in its second argument. Use foldrKeysRev' if this is so.

foldrKeysRev' :: (String -> b -> b) -> b -> StringMap a -> b
This is the strict version of foldrKeysRev. It should be used if the supplied function is strict in its second argument.
Some analogues of common List functions.
mapStringMap :: (a -> b) -> StringMap a -> StringMap b
Lazily apply the supplied function to every value in a StringMap. See mapStringMap' for a strict version.
mapStringMap' :: (a -> b) -> StringMap a -> StringMap b
This is the strict version of mapStringMap.
Produced by Haddock version 0.7