law join_at

lawful-fields@0.1.1.0 · LAWS.bend:145

import lawful-fields@0.1.1.0/LAWS.bend as LAWS
import Base
import lawful-fields@0.1.1.0/defs.bend as F

145# Joining a list of pieces splits at piece k: the first k+1 pieces, the
146# separator, the rest.
147law join_at:
148  for ps: List<&2, List<&2, U32>>
149  for sep: U32
150  for k: Nat
151  for h: {Nat.is_lt(Nat.add(k, 1n), List.length(&2, List<&2, U32>, ps)) == True{} : Bool}
152  {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)

Used by (0)

No other definition uses this definition.