Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data MutableBytes s
- takeWhile :: PrimMonad m => (Word8 -> m Bool) -> MutableBytes (PrimState m) -> m (MutableBytes (PrimState m))
- dropWhile :: PrimMonad m => (Word8 -> m Bool) -> MutableBytes (PrimState m) -> m (MutableBytes (PrimState m))
- unsafeTake :: Int -> MutableBytes s -> MutableBytes s
- unsafeDrop :: Int -> MutableBytes s -> MutableBytes s
- fromMutableByteArray :: PrimMonad m => MutableByteArray (PrimState m) -> m (MutableBytes (PrimState m))
Types
data MutableBytes s Source #
A slice of a MutableByteArray
.
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.