tries-0.0.2: Various trie implementations in Haskell

Safe HaskellNone
LanguageHaskell2010

Data.Trie.Class

Contents

Synopsis

Documentation

class Trie p s t | t -> p where Source

Class representing tries with single-threaded insertion, deletion, and lookup. forall ts ps a. isJust $ lookupPath ps (insertPath ps a ts) forall ts ps. isNothing $ lookupPath ps (deletePath ps ts)

Methods

lookup :: p s -> t s a -> Maybe a Source

insert :: p s -> a -> t s a -> t s a Source

delete :: p s -> t s a -> t s a Source

Instances

Trie Identity ByteString BSTrie Source 
Eq s => Trie NonEmpty s KnuthTrie Source 
Eq s => Trie NonEmpty s ListTrie Source 
Ord s => Trie NonEmpty s MapTrie Source 
(Ord p, Trie NonEmpty p c) => Trie NonEmpty p (MapStep c) Source

No insertion instance - requires children nodes to be a monoid. Use Data.Trie.Map.insert instead.

lookupWithDefault :: Trie p s t => a -> p s -> t s a -> a Source

member :: Trie p s t => p s -> t s a -> Bool Source

notMember :: Trie p s t => p s -> t s a -> Bool Source

Conversion

fromFoldable :: (Foldable f, Monoid (t s a), Trie p s t) => f (p s, a) -> t s a Source

ByteString-Trie

newtype BSTrie q a Source

Embeds an empty ByteString passed around for type inference.

Constructors

BSTrie 

Fields

unBSTrie :: (q, Trie a)