Type class to emulate exactly the behaviour of ByteArray but with a known length at compile time
Instances1ByteArrayN
(KnownNat n, ByteArray ba) => ByteArrayN n (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.Sized
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11
Moduleram-0.22.1Haskell2010
Type class to emulate exactly the behaviour of ByteArray but with a known length at compile time
(KnownNat n, ByteArray ba) => ByteArrayN n (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.SizedWrapper around any collection type with the size as type parameter
(KnownNat n, ByteArray ba) => ByteArrayN n (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.SizedEq ba => Eq (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.SizedOrd ba => Ord (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.SizedShow ba => Show (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.SizedNFData ba => NFData (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.Sized(ByteArrayAccess ba, KnownNat n) => ByteArrayAccess (SizedByteArray n ba)Defined in ram-0.22.1 · Data.ByteArray.Sizedcreate a SizedByteArray from the given ByteArrayAccess if the size is the same as the target size.
just like the sizedByteArray function but throw an exception if the size is invalid.
Allocate a new bytearray of specific size, and run the initializer on this memory
Allocate a new bytearray of specific size, and run the initializer on this memory
similar to allocN but hide the allocation and initializer in a pure context
similar to createN but hide the allocation and initializer in a pure context
Create an empty byte array
Pack a list of bytes into a bytearray
Un-pack a bytearray into a list of bytes
prepend a single byte to a byte array
append a single byte to a byte array
Create a xor of bytes between a and b.
the returns byte array is the size of the smallest input.
return a specific byte indexed by a number from 0 in a bytearray
unsafe, no bound checking are done
Split a bytearray at a specific length in two bytearray
Take the first n byte of a bytearray
drop the first n byte of a bytearray
append one bytearray to the other
Duplicate a bytearray into another bytearray, and run an initializer on it
Similar to copy but also provide a way to return a value from the initializer
Similiar to copy but expect the resulting bytearray in a pure context
Create a bytearray of a specific size containing a repeated byte value
Create a bytearray of a specific size initialized to 0
Convert a bytearray to another type of bytearray
Convert a ByteArrayAccess to another type of bytearray
This function returns nothing if the size is not compatible
Convert a ByteArrayAccess to another type of bytearray