LAWS.join_at: law of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/LAWS.bend as LAWS Lines 145-152 of lawful-fields@0.1.1.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-fields@0.1.1.0/LAWS.bend&start_line=145&end_line=152 import Base import lawful-fields@0.1.1.0/defs.bend as F # Joining a list of pieces splits at piece k: the first k+1 pieces, the # separator, the rest. law join_at: for ps: List<&2, List<&2, U32>> for sep: U32 for k: Nat for h: {Nat.is_lt(Nat.add(k, 1n), List.length(&2, List<&2, U32>, ps)) == True{} : Bool} {F.join(ps, sep) == List.append(&2, U32, F.join(List.take(&2, List<&2, U32>, ps, Nat.add(k, 1n)), sep), Con{sep, F.join(List.drop(&2, List<&2, U32>, ps, Nat.add(k, 1n)), sep)}) : List<&2, U32>} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=List.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.take 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.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/defs.bend&name=join https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/proof_list.bend&name=join_at