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 BTree data type that can be used with FixFile
. It can be used
as a key-value store where the same key can correspond to multiple values.
It supports logarithmic insert, lookup, and delete operations.
- data BTree k v a
- createBTreeFile :: (Binary k, Typeable k, Binary v, Typeable v) => FilePath -> IO (FixFile (Ref (BTree k v)))
- openBTreeFile :: (Binary k, Typeable k, Binary v, Typeable v) => FilePath -> IO (FixFile (Ref (BTree k v)))
- empty :: Fixed g => g (BTree k v)
- insertBTree :: (Ord k, Fixed g) => k -> v -> g (BTree k v) -> g (BTree k v)
- insertBTreeT :: (Ord k, Binary k, Binary v) => k -> v -> Transaction (Ref (BTree k v)) s ()
- lookupBTree :: (Ord k, Fixed g) => k -> g (BTree k v) -> [v]
- lookupBTreeT :: (Ord k, Binary k, Binary v) => k -> Transaction (Ref (BTree k v)) s [v]
- filterBTree :: (Ord k, Fixed g) => k -> (v -> Bool) -> g (BTree k v) -> g (BTree k v)
- filterBTreeT :: (Ord k, Binary k, Binary v) => k -> (v -> Bool) -> Transaction (Ref (BTree k v)) s ()
- deleteBTree :: (Ord k, Fixed g) => k -> g (BTree k v) -> g (BTree k v)
- deleteBTreeT :: (Ord k, Binary k, Binary v) => k -> Transaction (Ref (BTree k v)) s ()
- toListBTree :: (Ord k, Fixed g) => g (BTree k v) -> [(k, v)]
- fromListBTree :: (Ord k, Fixed g) => [(k, v)] -> g (BTree k v)
Documentation
Functor (BTree k v) Source | |
Foldable (BTree k v) Source | |
Traversable (BTree k v) Source | |
(Read k, Read v, Read a) => Read (BTree k v a) Source | |
(Show k, Show v, Show a) => Show (BTree k v a) Source | |
Generic (BTree k v a) Source | |
(Binary k, Binary v, Binary a) => Binary (BTree k v a) Source | |
type Rep (BTree k v a) Source |
createBTreeFile :: (Binary k, Typeable k, Binary v, Typeable v) => FilePath -> IO (FixFile (Ref (BTree k v))) Source
openBTreeFile :: (Binary k, Typeable k, Binary v, Typeable v) => FilePath -> IO (FixFile (Ref (BTree k v))) Source
insertBTreeT :: (Ord k, Binary k, Binary v) => k -> v -> Transaction (Ref (BTree k v)) s () Source
Transaction
version of insertBTree
.
lookupBTree :: (Ord k, Fixed g) => k -> g (BTree k v) -> [v] Source
lookupBTreeT :: (Ord k, Binary k, Binary v) => k -> Transaction (Ref (BTree k v)) s [v] Source
Transaction
version of lookupBTree
.
filterBTreeT :: (Ord k, Binary k, Binary v) => k -> (v -> Bool) -> Transaction (Ref (BTree k v)) s () Source
Transaction
version of filterBTree
.
deleteBTreeT :: (Ord k, Binary k, Binary v) => k -> Transaction (Ref (BTree k v)) s () Source
Transaction
version of deleteBTree
.
toListBTree :: (Ord k, Fixed g) => g (BTree k v) -> [(k, v)] Source