byteslice-0.2.3.0: Slicing managed and unmanaged memory

Safe HaskellNone
LanguageHaskell2010

Data.Bytes.Mutable

Contents

Synopsis

Types

Filtering

takeWhile :: PrimMonad m => (Word8 -> m Bool) -> MutableBytes (PrimState m) -> m (MutableBytes (PrimState m)) Source #

Take bytes while the predicate is true, aliasing the argument array.

dropWhile :: PrimMonad m => (Word8 -> m Bool) -> MutableBytes (PrimState m) -> m (MutableBytes (PrimState m)) Source #

Drop bytes while the predicate is true, aliasing the argument array.

Unsafe Slicing

unsafeTake :: Int -> MutableBytes s -> MutableBytes s Source #

Take the first n bytes from the argument, aliasing it.

unsafeDrop :: Int -> MutableBytes s -> MutableBytes s Source #

Drop the first n bytes from the argument, aliasing it. The new length will be len - n.

Conversion

fromMutableByteArray :: PrimMonad m => MutableByteArray (PrimState m) -> m (MutableBytes (PrimState m)) Source #

Create a slice of MutableBytes that spans the entire argument array. This aliases the argument.