def Flat.to_list.go
import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensorsimport Base
1739# the cells in row-major order; i counts down from the last
1740def Flat.to_list.go(n: Nat, +i: U32, r: Array<F32> & F32, acc: List<&2, F32>) -> List<&2, F32>:
1741 match n:
1742 case 0n:
1743 (a, x) = r
1744 x <> acc
1745 case 1n+p:
1746 (a, x) = r
1747 Flat.to_list.go(p, (i - 1 : U32), Array.get(F32, a, (i - 1 : U32)), x <> acc)