def sort.ins.put
import ezx@1.11.0.0/src/ez/sorted.bend as Sortedimport Base
10# where one string belongs in a list already sorted, once the rest of that list
11# has been placed. The recursion is done before the choice, because a def may
12# not call itself inside a branch.
13def sort.ins.put(
14 le: Bool,
15 +item: String,
16 head: String,
17 tail: List<&2, String>,
18 rest: List<&2, String>
19) -> List<&2, String>:
20 match le:
21 case True{}:
22 item <> (head <> tail)
23 case False{}:
24 head <> rest