def sort.ins.put

ezx@1.11.0.0 · src/ez/sorted.bend:10

import ezx@1.11.0.0/src/ez/sorted.bend as Sorted
import 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

Uses (3)

Used by (1)