Arrays of UInt64: array operations #
Removing elements, search, building arrays, iteration, equality, hashing and printing.
Removing elements #
Whether a has no elements.
Instances For
Removes the last element of a, if any, in place when a is not shared.
Equations
Instances For
Removes the longest run of elements at the end of a that satisfy p, in place when a is not
shared.
Equations
Instances For
The elements of a from index start up to, but not including, min stop a.size, copied into a
new array.
Equations
- a.extract start stop = ScalarArray.UInt64Array.mk (a.toArray.extract start stop)
Instances For
Linearity #
Marks a as linear, a debugging aid: if a marked array is ever copied because it is shared when
it needs to be exclusive, as before an in-place write, the runtime panics. The mark goes on an
exclusive array, so if a is shared it is copied first and the copy is marked. Logically this is
the identity.
Equations
- a.markLinear = a
Instances For
Returns b, marked as linear if a is marked. Like markLinear, marking copies b first if it is
shared. Logically this is b.
Equations
- a.propagateMark b = b
Instances For
Search #
The index of the first element at or after start that satisfies p, with a proof that it is in
bounds.
Equations
- a.findFinIdx? p start = ScalarArray.UInt64Array.findFinIdx?.loop✝ a p start
Instances For
The index of the first element at or after start that satisfies p.
Equations
- a.findIdx? p start = ScalarArray.UInt64Array.findIdx?.loop✝ a p start
Instances For
Building arrays #
An array of n copies of v.
Equations
Instances For
The array #[f 0, …, f (n - 1)].
Equations
Instances For
The array with the elements of l.
Equations
Instances For
For internal use only.
Equations
Instances For
Iteration #
Folds a monadic function over the elements of a from index start up to, but not including,
stop, from first to last.
Equations
- ScalarArray.UInt64Array.foldlM f init a start stop = Array.foldlM f init a.toArray start stop
Instances For
For internal use only.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Folds a monadic function over the elements of a, from last to first.
Equations
- ScalarArray.UInt64Array.foldrM f init a = Array.foldrM f init a.toArray
Instances For
For internal use only.
Equations
- ScalarArray.UInt64Array.foldrMImpl f init a = if a.size < USize.size then ScalarArray.UInt64Array.foldrMImpl.loop✝ f a a.usize ⋯ init else ScalarArray.UInt64Array.foldrMSlow✝ f init a
Instances For
Folds a function over the elements of a from index start up to, but not including, stop, from
first to last.
Equations
- ScalarArray.UInt64Array.foldl f init a start stop = (ScalarArray.UInt64Array.foldlM (fun (x1 : β) (x2 : UInt64) => pure (f x1 x2)) init a start stop).run
Instances For
Folds a function over the elements of a, from last to first.
Equations
- ScalarArray.UInt64Array.foldr f init a = (ScalarArray.UInt64Array.foldrM (fun (x1 : UInt64) (x2 : β) => pure (f x1 x2)) init a).run
Instances For
Runs a monadic action on each element of a, from first to last.
Equations
- ScalarArray.UInt64Array.forM f a = ScalarArray.UInt64Array.foldlM (fun (x : PUnit) (x_1 : UInt64) => f x_1) PUnit.unit a
Instances For
For internal use only.
Equations
- a.forInImpl init f = if a.size < USize.size then ScalarArray.UInt64Array.forInImpl.loop✝ a f a.usize ⋯ 0 init else ScalarArray.UInt64Array.forInSlow✝ a init f
Instances For
Equations
- ScalarArray.UInt64Array.instForInUInt64OfMonad = { forIn := fun {β : Type ?u.2} (a : ScalarArray.UInt64Array) (b : β) (f : UInt64 → β → m (ForInStep β)) => a.forIn b f }
Equations
- ScalarArray.UInt64Array.instForMUInt64OfMonad = { forM := fun (a : ScalarArray.UInt64Array) (f : UInt64 → m PUnit) => ScalarArray.UInt64Array.forM f a }
Whether some element of a satisfies p.
Instances For
For internal use only.
Equations
- a.anyImpl p = if a.size < USize.size then ScalarArray.UInt64Array.anyImpl.loop✝ a p a.usize ⋯ 0 else ScalarArray.UInt64Array.anySlow✝ a p
Instances For
Whether every element of a satisfies p.
Instances For
For internal use only.
Equations
- a.allImpl p = if a.size < USize.size then ScalarArray.UInt64Array.allImpl.loop✝ a p a.usize ⋯ 0 else ScalarArray.UInt64Array.allSlow✝ a p
Instances For
Whether some element of a is == to v.
Instances For
x ∈ a when x is an element of a.
Equations
- ScalarArray.UInt64Array.instMembershipUInt64 = { mem := fun (a : ScalarArray.UInt64Array) (x : UInt64) => x ∈ a.toArray }
Equality and hashing #
Decides equality by comparing the two arrays' memory.
Instances For
The same hash as a.toArray.
Instances For
For internal use only.
Instances For
Equations
Conversion and printing #
The elements of a as a list.
Instances For
Prints ScalarArray.UInt64Array.mk #[...], which evaluates to an equal array.
Equations
- One or more equations did not get rendered due to their size.
Equations
- ScalarArray.UInt64Array.instToString = { toString := fun (a : ScalarArray.UInt64Array) => "UInt64Array.mk " ++ toString a.toArray }
The array with the elements of l.