File: .lake/packages/lean4/src/lean/Init/Data/ByteArray/Basic.lean

full_name: ByteArray
code: structure ByteArray where
  data : Array UInt8
goal: Type

full_name: ByteArray.data
code: structure ByteArray where
  data : Array UInt8
goal: Array UInt8

full_name: ByteArray.mkEmpty
code: @[extern "lean_mk_empty_byte_array"]
def mkEmpty (c : @& Nat) : ByteArray 
goal: ByteArray

full_name: ByteArray.empty
code: def empty : ByteArray 
goal: ByteArray

full_name: ByteArray.instInhabited
code: instance : Inhabited ByteArray 
goal: Inhabited ByteArray

full_name: ByteArray.instEmptyCollection
code: instance : EmptyCollection ByteArray 
goal: EmptyCollection ByteArray

full_name: ByteArray.push
code: @[extern "lean_byte_array_push"]
def push : ByteArray → UInt8 → ByteArray
  
goal: ByteArray → UInt8 → ByteArray

full_name: ByteArray.size
code: @[extern "lean_byte_array_size"]
def size : (@& ByteArray) → Nat
  
goal: ByteArray → Nat

full_name: ByteArray.uget
code: @[extern "lean_byte_array_uget"]
def uget : (a : @& ByteArray) → (i : USize) → i.toNat < a.size → UInt8
  
goal: i.toNat < a.size → UInt8

full_name: ByteArray.get!
code: @[extern "lean_byte_array_get"]
def get! : (@& ByteArray) → (@& Nat) → UInt8
  
goal: ByteArray → Nat → UInt8

full_name: ByteArray.get
code: @[extern "lean_byte_array_fget"]
def get : (a : @& ByteArray) → (@& Fin a.size) → UInt8
  
goal: Fin a.size → UInt8

full_name: ByteArray.instGetElemNatUInt8LtSize
code: instance : GetElem ByteArray Nat UInt8 fun xs i => i < xs.size 
goal: GetElem ByteArray Nat UInt8 fun xs i => i < xs.size

full_name: ByteArray.instGetElemUSizeUInt8LtNatValValSize
code: instance : GetElem ByteArray USize UInt8 fun xs i => i.val < xs.size 
goal: GetElem ByteArray USize UInt8 fun xs i => ↑i.val < xs.size

full_name: ByteArray.set!
code: @[extern "lean_byte_array_set"]
def set! : ByteArray → (@& Nat) → UInt8 → ByteArray
  
goal: ByteArray → Nat → UInt8 → ByteArray

full_name: ByteArray.set
code: @[extern "lean_byte_array_fset"]
def set : (a : ByteArray) → (@& Fin a.size) → UInt8 → ByteArray
  
goal: Fin a.size → UInt8 → ByteArray

full_name: ByteArray.uset
code: @[extern "lean_byte_array_uset"]
def uset : (a : ByteArray) → (i : USize) → UInt8 → i.toNat < a.size → ByteArray
  
goal: UInt8 → i.toNat < a.size → ByteArray

full_name: ByteArray.hash
code: @[extern "lean_byte_array_hash"]
protected opaque hash (a : @& ByteArray) : UInt64
goal: UInt64

full_name: ByteArray.instHashable
code: instance : Hashable ByteArray 
goal: Hashable ByteArray

full_name: ByteArray.isEmpty
code: def isEmpty (s : ByteArray) : Bool 
goal: Bool

full_name: ByteArray.copySlice
code: /--
  Copy the slice at `[srcOff, srcOff + len)` in `src` to `[destOff, destOff + len)` in `dest`, growing `dest` if necessary.
  If `exact` is `false`, the capacity will be doubled when grown. -/
@[extern "lean_byte_array_copy_slice"]
def copySlice (src : @& ByteArray) (srcOff : Nat) (dest : ByteArray) (destOff len : Nat) (exact : Bool := true) : ByteArray 
goal: ByteArray

full_name: ByteArray.extract
code: def extract (a : ByteArray) (b e : Nat) : ByteArray 
goal: ByteArray

full_name: ByteArray.append
code: protected def append (a : ByteArray) (b : ByteArray) : ByteArray 
goal: ByteArray

full_name: ByteArray.instAppend
code: instance : Append ByteArray 
goal: Append ByteArray

full_name: ByteArray.toList.loop
code: partial def toList (bs : ByteArray) : List UInt8 
goal: List UInt8

full_name: ByteArray.toList
code: partial def toList (bs : ByteArray) : List UInt8 
goal: List UInt8

full_name: ByteArray.findIdx?.loop
code: @[inline] partial def findIdx? (a : ByteArray) (p : UInt8 → Bool) (start := 0) : Option Nat 
goal: Option Nat

full_name: ByteArray.findIdx?
code: @[inline] partial def findIdx? (a : ByteArray) (p : UInt8 → Bool) (start := 0) : Option Nat 
goal: Option Nat

full_name: ByteArray.forInUnsafe.loop
code: /--
  We claim this unsafe implementation is correct because an array cannot have more than `usizeSz` elements in our runtime.
  This is similar to the `Array` version.

  TODO: avoid code duplication in the future after we improve the compiler.
-/
@[inline] unsafe def forInUnsafe {β : Type v} {m : Type v → Type w} [Monad m] (as : ByteArray) (b : β) (f : UInt8 → β → m (ForInStep β)) : m β 
goal: m β

full_name: ByteArray.forInUnsafe
code: /--
  We claim this unsafe implementation is correct because an array cannot have more than `usizeSz` elements in our runtime.
  This is similar to the `Array` version.

  TODO: avoid code duplication in the future after we improve the compiler.
-/
@[inline] unsafe def forInUnsafe {β : Type v} {m : Type v → Type w} [Monad m] (as : ByteArray) (b : β) (f : UInt8 → β → m (ForInStep β)) : m β 
goal: m β

full_name: ByteArray.forIn.loop
code: /-- Reference implementation for `forIn` -/
@[implemented_by ByteArray.forInUnsafe]
protected def forIn {β : Type v} {m : Type v → Type w} [Monad m] (as : ByteArray) (b : β) (f : UInt8 → β → m (ForInStep β)) : m β 
goal: m β

full_name: ByteArray.forIn
code: /-- Reference implementation for `forIn` -/
@[implemented_by ByteArray.forInUnsafe]
protected def forIn {β : Type v} {m : Type v → Type w} [Monad m] (as : ByteArray) (b : β) (f : UInt8 → β → m (ForInStep β)) : m β 
goal: m β

full_name: ByteArray.instForInUInt8
code: instance : ForIn m ByteArray UInt8 
goal: ForIn m ByteArray UInt8

full_name: ByteArray.foldlMUnsafe.fold
code: /-- See comment at `forInUnsafe` -/
-- TODO: avoid code duplication.
@[inline]
unsafe def foldlMUnsafe {β : Type v} {m : Type v → Type w} [Monad m] (f : β → UInt8 → m β) (init : β) (as : ByteArray) (start := 0) (stop := as.size) : m β 
goal: m β

full_name: ByteArray.foldlMUnsafe
code: /-- See comment at `forInUnsafe` -/
-- TODO: avoid code duplication.
@[inline]
unsafe def foldlMUnsafe {β : Type v} {m : Type v → Type w} [Monad m] (f : β → UInt8 → m β) (init : β) (as : ByteArray) (start := 0) (stop := as.size) : m β 
goal: m β

full_name: ByteArray.foldlM
code: /-- Reference implementation for `foldlM` -/
@[implemented_by foldlMUnsafe]
def foldlM {β : Type v} {m : Type v → Type w} [Monad m] (f : β → UInt8 → m β) (init : β) (as : ByteArray) (start := 0) (stop := as.size) : m β 
goal: m β

full_name: ByteArray.foldlM.loop
code: /-- Reference implementation for `foldlM` -/
@[implemented_by foldlMUnsafe]
def foldlM {β : Type v} {m : Type v → Type w} [Monad m] (f : β → UInt8 → m β) (init : β) (as : ByteArray) (start := 0) (stop := as.size) : m β 
goal: m β

full_name: ByteArray.foldl
code: @[inline]
def foldl {β : Type v} (f : β → UInt8 → β) (init : β) (as : ByteArray) (start := 0) (stop := as.size) : β 
goal: β

full_name: List.toByteArray.loop
code: def List.toByteArray (bs : List UInt8) : ByteArray 
goal: List UInt8 → ByteArray → ByteArray

full_name: List.toByteArray
code: def List.toByteArray (bs : List UInt8) : ByteArray 
goal: ByteArray

full_name: instToStringByteArray
code: instance : ToString ByteArray 
goal: ToString ByteArray

full_name: ByteArray.toUInt64LE!
code: /-- Interpret a `ByteArray` of size 8 as a little-endian `UInt64`. -/
def ByteArray.toUInt64LE! (bs : ByteArray) : UInt64 
goal: UInt64

full_name: ByteArray.toUInt64BE!
code: /-- Interpret a `ByteArray` of size 8 as a big-endian `UInt64`. -/
def ByteArray.toUInt64BE! (bs : ByteArray) : UInt64 
goal: UInt64