-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A hashed byte-vector based on algebraic hashes and finger trees -- @package hwsl2-bytevector @version 0.1.0.0 module Data.Hash.SL2.ByteVector data ByteVector -- | O(1) Creates a vector from a single chunk. singleton :: Chunk -> ByteVector -- | O(n) Creates a vector from a list of chunks. fromList :: [Chunk] -> ByteVector -- | O(1) The empty vector. Alias for mempty. empty :: ByteVector -- | O(n) Concatenates two vectors together. Alias for -- mappend. append :: ByteVector -> ByteVector -> ByteVector -- | O(1) Adds a chunk to the left end of the vector. cons :: Chunk -> ByteVector -> ByteVector -- | O(1) Adds a chunk to the right end of the vector. snoc :: ByteVector -> Chunk -> ByteVector -- | O(1) Is this the empty vector? null :: ByteVector -> Bool -- | O(1) Returns the hash of the vector. hash :: ByteVector -> Hash -- | O(1) Returns the number of bytes in the vector. length :: ByteVector -> Integer data ViewL EmptyL :: ViewL MostL :: Chunk -> ByteVector -> ViewL -- | O(1) Creates a view of the left end of the vector. viewl :: ByteVector -> ViewL -- | O(1) Creates a view of the left end of the vector. The single -- chunk is guaranteed to never be empty. viewl1 :: ByteVector -> ViewL data ViewR EmptyR :: ViewR MostR :: ByteVector -> Chunk -> ViewR -- | O(1) Creates a view of the right end of the vector. viewr :: ByteVector -> ViewR -- | O(1) Creates a view of the right end of the vector. The single -- chunk is guaranteed to never be empty. viewr1 :: ByteVector -> ViewR -- | O(log(min(i,n-i))) Splits the vector at the chunk where the -- accumulated length equals the provided integer i. The resulting -- left side has a length smaller i. splitBefore :: Integer -> ByteVector -> (ByteVector, ByteVector) -- | O(log(min(i,n-i))) Splits the vector at the byte where the -- accumulated length equals the provided integer i. The resulting -- left side has a length of min(i,n). -- -- This is potentially less efficient than splitBefore because it -- has to re-hash parts of the vector. splitAt :: Integer -> ByteVector -> (ByteVector, ByteVector) -- | O(n) Reverses the vector. reverse :: ByteVector -> ByteVector -- | O(n) Applies a function to every chunk in the vector. map :: (Chunk -> Chunk) -> ByteVector -> ByteVector -- | O(n) Folds the vector from left to right. foldl :: (a -> Chunk -> a) -> a -> ByteVector -> a -- | O(n) Folds the vector from right to left. foldr :: (Chunk -> a -> a) -> a -> ByteVector -> a -- | O(n) Folds the vector from left to right, with strict -- application. foldl' :: (a -> Chunk -> a) -> a -> ByteVector -> a -- | O(n) Folds the vector from right to left, with strict -- application. foldr' :: (Chunk -> a -> a) -> a -> ByteVector -> a instance Eq MeasuredChunk instance Ord MeasuredChunk instance Monoid ByteVector instance Eq ViewL instance Ord ViewL instance Eq ViewR instance Ord ViewR instance Ord ByteVector instance Eq ByteVector instance Measured Measure MeasuredChunk instance Monoid Measure