Module

Data.Search.Trie

Package
purescript-search-trie
Repository
klntsky/purescript-search-trie

Re-exports from Data.Search.Trie.Internal

#Trie Source

data Trie k v

Instances

#values Source

values :: forall k v. Trie k v -> List v

#update Source

update :: forall k v. Ord k => (v -> v) -> List k -> Trie k v -> Trie k v

Update the entry at a given path.

#toUnfoldable Source

toUnfoldable :: forall f p k v. Unfoldable f => Unfoldable p => Trie k v -> f (Tuple (p k) v)

#subtrieWithPrefixes Source

subtrieWithPrefixes :: forall k v. Ord k => List k -> Trie k v -> Maybe (Trie k v)

A version of subtrie that does not cut the prefixes.

#subtrie Source

subtrie :: forall k v. Ord k => List k -> Trie k v -> Maybe (Trie k v)

Returns a subtrie containing all paths with given prefix. Path prefixes are not saved.

#size Source

size :: forall k v. Trie k v -> Int

Number of elements in a trie.

#queryValues Source

queryValues :: forall k v. Ord k => List k -> Trie k v -> List v

#query Source

query :: forall k v. Ord k => List k -> Trie k v -> List (Tuple (List k) v)

#lookup Source

lookup :: forall k v. Ord k => List k -> Trie k v -> Maybe v

#isEmpty Source

isEmpty :: forall k v. Trie k v -> Boolean

#insert Source

insert :: forall k v. Ord k => List k -> v -> Trie k v -> Trie k v

Insert an entry into a trie.

#fromList Source

fromList :: forall k v. Ord k => List (Tuple (List k) v) -> Trie k v

#fromFoldable Source

fromFoldable :: forall f p k v. Ord k => Foldable f => Foldable p => f (Tuple (p k) v) -> Trie k v

#entriesUnordered Source

entriesUnordered :: forall k v. Trie k v -> List (Tuple (List k) v)

A version of entries defined using Data.Map.toUnfoldableUnordered.

#entries Source

entries :: forall k v. Trie k v -> List (Tuple (List k) v)

Resulting List will be sorted.

#deleteByPrefix Source

deleteByPrefix :: forall k v. Ord k => List k -> Trie k v -> Trie k v

Delete all entries by a given path prefix.

#delete Source

delete :: forall k v. Ord k => List k -> Trie k v -> Trie k v

Delete the entry at a given path.

#alter Source

alter :: forall k v. Ord k => List k -> (Maybe v -> Maybe v) -> Trie k v -> Trie k v

Delete, insert or update the entry by a given path. It is recommended to use specialized functions for each case.