lsm-tree-0.1.0.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.LSMTree.Internal.Vector

Synopsis

Documentation

mkPrimVector :: forall a. Prim a => Int -> Int -> ByteArray -> Vector a Source #

byteVectorFromPrim :: forall a. Prim a => a -> Vector Word8 Source #

noRetainedExtraMemory :: forall a. Prim a => Vector a -> Bool Source #

mapStrict :: forall a b. (a -> b) -> Vector a -> Vector b Source #

( O(n) ) Like map, but strict in the produced elements of type b.

mapMStrict :: Monad m => (a -> m b) -> Vector a -> m (Vector b) Source #

( O(n) ) Like mapM, but strict in the produced elements of type b.

imapMStrict :: Monad m => (Int -> a -> m b) -> Vector a -> m (Vector b) Source #

( O(n) ) Like imapM, but strict in the produced elements of type b.

forMStrict :: Monad m => Vector a -> (a -> m b) -> m (Vector b) Source #

( O(n) ) Like forM, but strict in the produced elements of type b.

zipWithStrict :: forall a b c. (a -> b -> c) -> Vector a -> Vector b -> Vector c Source #

( O(min(m,n)) ) Like zipWithM, but strict in the produced elements of type c.

binarySearchL :: Ord a => Vector a -> a -> Int Source #

Finds the lowest index in a given sorted vector at which the given element could be inserted while maintaining the sortedness.

This is a variant of binarySearchL for immutable vectors.

unsafeInsertWithMStrict Source #

Arguments

:: PrimMonad m 
=> MVector (PrimState m) (Maybe a) 
-> (a -> a -> a)

function f, called as f new old

-> Int 
-> a 
-> m () 

Insert (in a broad sense) an entry in a mutable vector at a given index, but if a Just entry already exists at that index, combine the two entries using f.

unfoldrNM' :: PrimMonad m => Int -> (b -> m (Maybe a, b)) -> b -> m (Vector a, b) Source #

A version of unfoldrNM that also returns the final state.

O(n) Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function also yields Just the next element or Nothing if there are no more elements.

The state as well as all elements of the result vector are forced to weak head normal form.