Defs.pieces: def of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/defs.bend as Defs Lines 94-101 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=94&end_line=101 import Base import lawful-bytes@0.1.1.0/defs.bend as D # The pieces of xs that end at each offset of es, the first starting at from # and each next one just after the previous end (where the separator was). def pieces(es: List<&2, U32>, +xs: List<&2, U32>, +from: Nat) -> List<&2, List<&2, U32>>: match es: case Nil{}: Nil{} case Con{+e, t}: Con{D.slice(xs, from, Nat.sub(U32.to_nat(e), from)), pieces(t, xs, Nat.add(U32.to_nat(e), 1n))} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List 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=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=slice