TernaryTrees-0.2.0.2: Efficient pure ternary tree Sets and Maps
Data.Set.StringSet
Synopsis
data StringSet Source
StringSet is ternary tree. It is commonly used for storing word lists like dictionaries for spell checking etc.
Instances
A rather long Binary instance, that uses binary numbers to indicate where Ends are efficiently.
insert :: String -> StringSet -> StringSetSource
Inserts a new String element into a tree.
String
singleton :: String -> StringSetSource
Quickly build an initial tree.
member :: String -> StringSet -> BoolSource
Returns true if the string is in the StringSet
size :: StringSet -> IntSource
Counts how many entries there are in the tree.
fromList :: [String] -> StringSetSource
Creates a new tree from a list of Strings
Strings
null :: StringSet -> BoolSource
Returns true if the set is empty.
elems :: StringSet -> [String]Source
Returns a (sorted) list of all strings inserted into the set.
(elems . fromList) xs == (nub . sort) xs
empty :: StringSetSource
An empty set.