hashed-storage-0.6: Hashed file storage support code.Source codeContentsIndex
Storage.Hashed.Utils
Description
Mostly internal utilities for use by the rest of the library. Subject to removal without further notice.
Synopsis
type FileSegment = (Absolute, Maybe (Int64, Int))
readSegment :: FileSegment -> IO ByteString
withCurrentDirectory :: AbsRel x => Path x -> IO a -> IO a
unsafePokeBS :: ByteString -> ByteString -> IO ()
align :: Integral a => a -> a -> a
xlate32 :: Bits a => a -> a
xlate64 :: Bits a => a -> a
mfixFrom :: (Eq a, Functor m, Monad m) => (a -> m a) -> a -> m a
fixFrom :: Eq a => (a -> a) -> a -> a
reachable :: forall monad key value. (Functor monad, Monad monad, Ord key, Eq value) => (value -> monad [key]) -> (key -> monad (Maybe (key, value))) -> Set key -> monad (Map key value)
Documentation
type FileSegment = (Absolute, Maybe (Int64, Int))Source
Pointer to a filesystem, possibly with start/end offsets. Supposed to be fed to (uncurry mmapFileByteString) or similar.
readSegment :: FileSegment -> IO ByteStringSource
Read in a FileSegment into a Lazy ByteString. Implemented using mmap.
withCurrentDirectory :: AbsRel x => Path x -> IO a -> IO aSource
Run an IO action with path as a working directory. Does neccessary bracketing.
unsafePokeBS :: ByteString -> ByteString -> IO ()Source
align :: Integral a => a -> a -> aSource
xlate32 :: Bits a => a -> aSource
xlate64 :: Bits a => a -> aSource
mfixFrom :: (Eq a, Functor m, Monad m) => (a -> m a) -> a -> m aSource
Find a monadic fixed point of f that is the least above i. (Will happily diverge if there is none.)
fixFrom :: Eq a => (a -> a) -> a -> aSource
Find a fixed point of f that is the least above i. (Will happily diverge if there is none.)
reachable :: forall monad key value. (Functor monad, Monad monad, Ord key, Eq value) => (value -> monad [key]) -> (key -> monad (Maybe (key, value))) -> Set key -> monad (Map key value)Source
For a refs function, a map (key -> value) and a rootSet, find a submap of map such that all items in map are reachable, through refs from rootSet.
Produced by Haddock version 2.6.0