A slice of a MutableByteArray.
Modulebyteslice-0.2.15.0Haskell2010
Data.Bytes.Mutable
If you are interested in sub-arrays of MutableByteArrays (e.g. writing quicksort), it would be grossly inefficient to make a copy of the sub-array. On the other hand, it'd be really annoying to track limit indices by hand.
This module defines the MutableBytes type which exposes a standard array
interface for a sub-arrays without copying and without manual index
manipulation. For immutable arrays, see Data.Bytes.
Contents
Synopsis
- data MutableBytes
- value takeWhile
- value dropWhile
- value unsafeTake
- value unsafeDrop
- value fromMutableByteArray
- Packagebyteslice-0.2.15.0
- Exports6
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceMutable.hs
Types
Filtering
Take bytes while the predicate is true, aliasing the argument array.
Drop bytes while the predicate is true, aliasing the argument array.
Unsafe Slicing
Take the first n bytes from the argument, aliasing it.
Drop the first n bytes from the argument, aliasing it.
The new length will be len - n.
Conversion
Create a slice of MutableBytes that spans the entire argument array. This aliases the argument.