uget/uset #
empty #
@[deprecated ByteArray.data_mkEmpty]
Alias of ByteArray.data_mkEmpty
.
@[deprecated ByteArray.data_empty]
Alias of ByteArray.data_empty
.
push #
@[simp]
@[deprecated ByteArray.data_push]
Alias of ByteArray.data_push
.
set #
@[deprecated ByteArray.data_set]
theorem
ByteArray.set_data
(a : ByteArray)
(i : Fin a.size)
(v : UInt8)
:
(a.set (↑i) v ⋯).data = a.data.set (↑i) v ⋯
Alias of ByteArray.data_set
.
copySlice #
@[deprecated ByteArray.data_copySlice]
theorem
ByteArray.copySlice_data
(a : ByteArray)
(i : Nat)
(b : ByteArray)
(j len : Nat)
(exact : Bool)
:
Alias of ByteArray.data_copySlice
.
append #
@[deprecated ByteArray.data_append]
Alias of ByteArray.data_append
.
extract #
@[simp]
theorem
ByteArray.data_extract
(a : ByteArray)
(start stop : Nat)
:
(a.extract start stop).data = a.data.extract start stop
@[deprecated ByteArray.data_extract]
theorem
ByteArray.extract_data
(a : ByteArray)
(start stop : Nat)
:
(a.extract start stop).data = a.data.extract start stop
Alias of ByteArray.data_extract
.
ofFn #
Equations
- ByteArray.ofFn f = { data := Array.ofFn f }
Instances For
@[simp]
@[deprecated ByteArray.data_ofFn]
Alias of ByteArray.data_ofFn
.
@[simp]
@[simp]
theorem
ByteArray.get_ofFn
{n : Nat}
(f : Fin n → UInt8)
(i : Fin (ByteArray.ofFn f).size)
:
(ByteArray.ofFn f).get ↑i ⋯ = f (Fin.cast ⋯ i)
@[simp]
theorem
ByteArray.getElem_ofFn
{n : Nat}
(f : Fin n → UInt8)
(i : Nat)
(h : i < (ByteArray.ofFn f).size)
:
(ByteArray.ofFn f)[i] = f ⟨i, ⋯⟩
map/mapM #
@[inline]
unsafe def
ByteArray.mapMUnsafe
{m : Type → Type u_1}
[Monad m]
(a : ByteArray)
(f : UInt8 → m UInt8)
:
Unsafe optimized implementation of mapM
.
This function is unsafe because it relies on the implementation limit that the size of an array is
always less than USize.size
.
Equations
- a.mapMUnsafe f = ByteArray.mapMUnsafe.loop f a 0 a.usize