HGraphStorage-0.0.3: Graph database stored on disk

Safe HaskellNone
LanguageHaskell98

Database.Graph.HGraphStorage.FreeList

Description

Free list management

Synopsis

Documentation

data FreeList a Source

Free List structure

Constructors

FreeList 

Fields

flSize :: Integer

Record size

flHandle :: Handle

File handle

flOnEmptyClose :: IO ()

What to do on close if no record

initFreeList :: (Binary a, MonadIO m) => Integer -> Handle -> IO () -> m (FreeList a) Source

position handle

closeFreeList :: (Binary a, MonadIO m) => FreeList a -> m Bool Source

Close underlying handle and return if we have still objects in the list

addToFreeList :: (Binary a, MonadIO m) => a -> FreeList a -> m () Source

Add object to list

getFromFreeList :: (Binary a, Eq a, Default a, MonadIO m) => FreeList a -> m (Maybe a) Source

get object to list if list is non empty