Wasm.I64Array
- Package
- purescript-wasm-base
- Repository
- purs-wasm/purescript-wasm-base
WasmBase Wasm.I64Array (ADR 0026 sibling of Wasm.Array): a first-order,
packed native 64-bit mutable array. Unlike Array Int64 (the universal
$Vals, an (array (mut eqref)) whose every element is a boxed $Int64
struct), this is $I64Arr = (array (mut i64)): the lanes are raw i64, so a
read is one array.get of an i64 (no ref.cast/struct.get, no unbox) and a
write is one array.set (no struct.new, no allocation). The type is opaque so
it can never decay back into the boxed $Vals representation.
The foreign imports resolve to intrinsics on wasm (Intrinsics.qualifiedIntrinsic
— Wasm.I64Array.*); the accompanying Wasm/I64Array.js provides a
BigInt64Array-backed version for stock purs / purs-backend-es.
#I64Array Source
data I64ArrayA packed (array (mut i64)). Opaque: no Array a interface, so the boxed
array primitives and HOFs do not apply (and cannot reintroduce boxing).
#unsafeIndex Source
unsafeIndex :: I64Array -> Int -> Int64The raw i64 lane at index i, unchecked (out of range traps). On wasm:
I64ArrayIndex (array.get of an i64, no box).