def join
import lawful-fields@0.1.1.0/defs.bend as Defsimport Base
133# The pieces joined with sep between them. join undoes split:
134# join(split(xs, sep), sep) == xs (the other way round fails when a piece holds
135# sep).
136def join(ps: List<&2, List<&2, U32>>, +sep: U32) -> List<&2, U32>:
137 match ps:
138 case Nil{}:
139 Nil{}
140 case Con{p, t}:
141 List.append(&2, U32, p, join.go(t, sep))