A subarray of a ByteArray
.
- array : ByteArray
O(1)
. Get data array of aByteSubarray
. - start : Nat
O(1)
. Get start index of aByteSubarray
. - stop : Nat
O(1)
. Get stop index of aByteSubarray
. Start index is before stop index.
Stop index is before end of data array.
Instances For
instance
Batteries.ByteSubarray.instGetElemNatUInt8LtSize :
GetElem ByteSubarray Nat UInt8 fun (self : ByteSubarray) (i : Nat) => i < self.size
Equations
@[inline]
def
Batteries.ByteSubarray.foldlM
{m : Type u_1 → Type u_2}
{β : Type u_1}
[Monad m]
(self : ByteSubarray)
(f : β → UInt8 → m β)
(init : β)
:
m β
Folds a monadic function over a ByteSubarray
from left to right.
Equations
Instances For
@[inline]
def
Batteries.ByteSubarray.foldl
{β : Type u_1}
(self : ByteSubarray)
(f : β → UInt8 → β)
(init : β)
:
β
Folds a function over a ByteSubarray
from left to right.
Equations
Instances For
@[specialize #[]]
def
Batteries.ByteSubarray.forIn
{m : Type u_1 → Type u_2}
{β : Type u_1}
[Monad m]
(self : ByteSubarray)
(init : β)
(f : UInt8 → β → m (ForInStep β))
:
m β
Implementation of forIn
for a ByteSubarray
.
Equations
Instances For
def
Batteries.ByteSubarray.forIn.loop
{m : Type u_1 → Type u_2}
{β : Type u_1}
[Monad m]
(self : ByteSubarray)
(f : UInt8 → β → m (ForInStep β))
(i : Nat)
(h : i ≤ self.size)
(b : β)
:
m β
Inner loop of the forIn
implementation for ByteSubarray
.
Equations
Instances For
Equations
O(1)
. Coerce a byte array into a byte slice.