Copyright | (C) 2016 Rev. Johnny Healey |
---|---|
License | LGPL-3 |
Maintainer | Rev. Johnny Healey <rev.null@gmail.com> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This is a Trie data type that can be used with FixFile
. It can be used
as a key-value store where the key is a ByteString
of arbitrary size.
- data Trie v a
- empty :: Fixed g => g (Trie v)
- freeze :: Fixed g => g (Trie v) -> g (Trie v)
- createTrieFile :: (Binary v, Typeable v) => FilePath -> IO (FixFile (Ref (Trie v)))
- openTrieFile :: (Binary v, Typeable v) => FilePath -> IO (FixFile (Ref (Trie v)))
- lookupTrie :: Fixed g => ByteString -> g (Trie v) -> Maybe v
- lookupTrieT :: Binary v => ByteString -> Transaction (Ref (Trie v)) s (Maybe v)
- insertTrie :: Fixed g => ByteString -> v -> g (Trie v) -> g (Trie v)
- insertTrieT :: Binary v => ByteString -> v -> Transaction (Ref (Trie v)) s ()
- deleteTrie :: Fixed g => ByteString -> g (Trie v) -> g (Trie v)
- deleteTrieT :: Binary v => ByteString -> Transaction (Ref (Trie v)) s ()
- iterateTrie :: Fixed g => ByteString -> g (Trie v) -> [(ByteString, v)]
- iterateTrieT :: Binary v => ByteString -> Transaction (Ref (Trie v)) s [(ByteString, v)]
Documentation
Functor (Trie v) Source # | |
Foldable (Trie v) Source # | |
Traversable (Trie v) Source # | |
FixedTraversable (Trie v) Source # | |
FixedFoldable (Trie v) Source # | |
FixedFunctor (Trie v) Source # | |
FixedSub (Trie v) Source # | |
FixedAlg (Trie v) Source # | |
(Read v, Read a) => Read (Trie v a) Source # | |
(Show v, Show a) => Show (Trie v a) Source # | |
Generic (Trie v a) Source # | |
(Binary v, Binary a) => Binary (Trie v a) Source # | |
type Alg (Trie v) Source # | |
type Sub (Trie v) v v' Source # | |
type Rep (Trie v a) Source # | |
lookupTrie :: Fixed g => ByteString -> g (Trie v) -> Maybe v Source #
Lookup a possible value stored in a trie for a given ByteString
key.
lookupTrieT :: Binary v => ByteString -> Transaction (Ref (Trie v)) s (Maybe v) Source #
Transaction
version of lookupTrie
.
insertTrie :: Fixed g => ByteString -> v -> g (Trie v) -> g (Trie v) Source #
Insert a value into a trie for the given ByteString
key.
insertTrieT :: Binary v => ByteString -> v -> Transaction (Ref (Trie v)) s () Source #
Transaction
version of insertTrie
.
deleteTrie :: Fixed g => ByteString -> g (Trie v) -> g (Trie v) Source #
Delete a value from a trie for a given ByteString
key.
deleteTrieT :: Binary v => ByteString -> Transaction (Ref (Trie v)) s () Source #
Transaction
version of deleteTrie
.
iterateTrie :: Fixed g => ByteString -> g (Trie v) -> [(ByteString, v)] Source #
Iterate over a Trie for all of the ByteString
and value tuples for a
given ByteString
prefix.
iterateTrieT :: Binary v => ByteString -> Transaction (Ref (Trie v)) s [(ByteString, v)] Source #
Transaction
version of iterateTrie
.