The number of elements in the byte slice.
Equations
- ByteSliceT.size self = ByteArray.size self.arr - self.off
Index into a byte slice. The getOp
function allows the use of the buf[i]
notation.
Equations
- ByteSliceT.getOp self idx = ByteArray.get! self.arr (self.off + idx)
Convert a byte array into a terminal slice.
Equations
- ByteArray.toSliceT arr = { arr := arr, off := 0 }
Convert a byte slice into an array, by copying the data if necessary.
Equations
- ByteSlice.toArray x = match x with | { arr := arr, off := off, len := len } => ByteArray.extract arr off len
Index into a byte slice. The getOp
function allows the use of the buf[i]
notation.
Equations
- ByteSlice.getOp self idx = ByteArray.get! self.arr (self.off + idx)
The inner loop of the forIn
implementation for byte slices.
Equations
- One or more equations did not get rendered due to their size.
Convert a terminal byte slice into a regular byte slice.
Equations
- ByteSliceT.toSlice x = match x with | { arr := arr, off := off } => { arr := arr, off := off, len := ByteArray.size arr - off }
Convert a byte array into a byte slice.
Equations
- ByteArray.toSlice arr = { arr := arr, off := 0, len := ByteArray.size arr }
Convert a string of assumed-ASCII characters into a byte array. (If any characters are non-ASCII they will be reduced modulo 256.)
Equations
Equations
- One or more equations did not get rendered due to their size.
Convert a byte slice into a string. This does not handle non-ASCII characters correctly: every byte will become a unicode character with codepoint < 256.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.