def tl_go

bend-collections@1.0.0.0 · src/containers/dynamic_array.bend:211

import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as DynamicArray
import Base

211# k slots are still to be read, the last of them first: the pair `r` is slot
212# k - 1, already read.
213def tl_go(k: Nat, -T: Data, acc: List<&2, T>, r: Array<Maybe<&2, T>> & Maybe<&2, T>) -> Array<Maybe<&2, T>> & List<&2, T>:
214  match k r:
215    case 0n Tuple{a, x}:
216      (a, acc)
217    case 1n+ +m Tuple{a, x}:
218      tl_go(m, T, cons_some(T, x, acc), Array.get(Maybe<&2, T>, a, U32.from_nat(dec1(m))))

Uses (10)

Used by (1)