Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Key = ByteString
- type Tag = Encoding
- data LisztHandle = LisztHandle {}
- openLiszt :: MonadIO m => FilePath -> m LisztHandle
- closeLiszt :: MonadIO m => LisztHandle -> m ()
- withLiszt :: (MonadIO m, MonadMask m) => FilePath -> (LisztHandle -> m a) -> m a
- clear :: Key -> Transaction ()
- insertRaw :: Key -> Tag -> Encoding -> Transaction ()
- commit :: MonadIO m => LisztHandle -> Transaction a -> m a
- type Transaction = StateT TransactionState IO
- data TransactionState
- availableKeys :: LisztHandle -> Frame RawPointer -> IO [Key]
- data Frame a
- decodeFrame :: ByteString -> Frame RawPointer
- forceSpine :: NFData a => Frame a -> IO (Frame a)
- class Fetchable a where
- data RawPointer = RP !Int !Int
- fetchRoot :: LisztHandle -> IO (Frame RawPointer)
- footerSize :: Int
- isFooter :: ByteString -> Bool
- lookupSpine :: Fetchable a => LisztHandle -> Key -> Frame a -> IO (Maybe (Spine a))
- type Spine a = [(Int, a)]
- spineLength :: Spine a -> Int
- type QueryResult = (Tag, RawPointer)
- takeSpine :: Fetchable a => LisztHandle -> Int -> Spine a -> [QueryResult] -> IO [QueryResult]
- dropSpine :: Fetchable a => LisztHandle -> Int -> Spine a -> IO (Spine a)
- takeSpineWhile :: Fetchable a => (Tag -> Bool) -> LisztHandle -> Spine a -> [QueryResult] -> IO [QueryResult]
- dropSpineWhile :: Fetchable a => (Tag -> Bool) -> LisztHandle -> Spine a -> IO (Maybe (Int, QueryResult, Spine a))
Documentation
type Key = ByteString Source #
Tag is an extra value attached to a payload. This can be used to perform a binary search.
closeLiszt :: MonadIO m => LisztHandle -> m () Source #
Writing
clear :: Key -> Transaction () Source #
Replace the specified key with an empty list.
commit :: MonadIO m => LisztHandle -> Transaction a -> m a Source #
type Transaction = StateT TransactionState IO Source #
data TransactionState Source #
Reading
availableKeys :: LisztHandle -> Frame RawPointer -> IO [Key] Source #
Frame
Empty | |
Leaf1 !KeyPointer !(Spine a) | |
Leaf2 !KeyPointer !(Spine a) !KeyPointer !(Spine a) | |
Node2 !a !KeyPointer !(Spine a) !a | |
Node3 !a !KeyPointer !(Spine a) !a !KeyPointer !(Spine a) !a | |
Tree !Tag !RawPointer !a !a | |
Leaf !Tag !RawPointer |
Instances
Functor Frame Source # | |
Foldable Frame Source # | |
Defined in Database.Liszt.Internal fold :: Monoid m => Frame m -> m # foldMap :: Monoid m => (a -> m) -> Frame a -> m # foldr :: (a -> b -> b) -> b -> Frame a -> b # foldr' :: (a -> b -> b) -> b -> Frame a -> b # foldl :: (b -> a -> b) -> b -> Frame a -> b # foldl' :: (b -> a -> b) -> b -> Frame a -> b # foldr1 :: (a -> a -> a) -> Frame a -> a # foldl1 :: (a -> a -> a) -> Frame a -> a # elem :: Eq a => a -> Frame a -> Bool # maximum :: Ord a => Frame a -> a # minimum :: Ord a => Frame a -> a # | |
Traversable Frame Source # | |
Eq a => Eq (Frame a) Source # | |
Show a => Show (Frame a) Source # | |
Generic (Frame a) Source # | |
Serialise a => Serialise (Frame a) Source # | |
Defined in Database.Liszt.Internal schemaVia :: Proxy (Frame a) -> [TypeRep] -> Schema # toEncoding :: Frame a -> Encoding # deserialiser :: Deserialiser (Frame a) # | |
type Rep (Frame a) Source # | |
Defined in Database.Liszt.Internal |
decodeFrame :: ByteString -> Frame RawPointer Source #
Fetching
class Fetchable a where Source #
fetchFrame :: LisztHandle -> a -> IO (Frame a) Source #
Instances
Fetchable RawPointer Source # | |
Defined in Database.Liszt.Internal fetchFrame :: LisztHandle -> RawPointer -> IO (Frame RawPointer) Source # |
data RawPointer Source #
Instances
Footer
fetchRoot :: LisztHandle -> IO (Frame RawPointer) Source #
footerSize :: Int Source #
isFooter :: ByteString -> Bool Source #
lookupSpine :: Fetchable a => LisztHandle -> Key -> Frame a -> IO (Maybe (Spine a)) Source #
Spine
spineLength :: Spine a -> Int Source #
type QueryResult = (Tag, RawPointer) Source #
takeSpine :: Fetchable a => LisztHandle -> Int -> Spine a -> [QueryResult] -> IO [QueryResult] Source #
takeSpineWhile :: Fetchable a => (Tag -> Bool) -> LisztHandle -> Spine a -> [QueryResult] -> IO [QueryResult] Source #
dropSpineWhile :: Fetchable a => (Tag -> Bool) -> LisztHandle -> Spine a -> IO (Maybe (Int, QueryResult, Spine a)) Source #