Defs.ends: def of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/defs.bend as Defs Lines 170-178 of lawful-fields@0.1.1.0/defs.bend: https://jend.leeeet.dev/read.txt?path=lawful-fields@0.1.1.0/defs.bend&start_line=170&end_line=178 import Base # The end offset of each piece, the first piece starting at from and each next # one just after the previous end. def ends(ps: List<&2, List<&2, U32>>, +from: Nat) -> List<&2, Nat>: match ps: case Nil{}: Nil{} case Con{p, t}: +e = Nat.add(from, List.length(&2, U32, p)) Con{e, ends(t, Nat.add(e, 1n))} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32