def dir.insert.pick

ezsys@0.1.0.0 · src/dir.bend:12

import ezsys@0.1.0.0/src/dir.bend as Dir
import Base

12# name before next when it sorts first, else next and the rest with name put
13# in them
14def dir.insert.pick(
15  first: Bool,
16  +name: String,
17  +next: String,
18  +ys: List<&2, String>,
19  rest: Unit -> List<&2, String>
20) -> List<&2, String>:
21  match first:
22    case True{}:
23      Con{name, Con{next, ys}}
24    case False{}:
25      Con{next, rest(Unit{})}

Uses (4)

Used by (1)