MlbendPreprocess.replace_at_go: def of mlbend-preprocess@0.1.0.0 Import: import mlbend-preprocess@0.1.0.0/main.bend as MlbendPreprocess Lines 239-249 of mlbend-preprocess@0.1.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-preprocess@0.1.0.0/main.bend&start_line=239&end_line=249 import Base # A list with its nth element replaced, element by element. def replace_at_go(+xs: List<&2, F32>, +n: Nat, +v: F32, +acc: List<&2, F32>) -> List<&2, F32>: match xs: case Nil{}: acc case Con{h, +t}: match n: case 0n: List.append(&2, F32, acc, Con{v, t}) case _: replace_at_go(t, Nat.sub(n, 1n), v, List.append(&2, F32, acc, Con{h, Nil{}})) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub