Dir.dir.insert.pick: def of ezsys@0.1.0.0 Import: import ezsys@0.1.0.0/src/dir.bend as Dir Lines 12-25 of ezsys@0.1.0.0/src/dir.bend: https://jend.leeeet.dev/read.txt?path=ezsys@0.1.0.0/src/dir.bend&start_line=12&end_line=25 import Base # name before next when it sorts first, else next and the rest with name put # in them def dir.insert.pick( first: Bool, +name: String, +next: String, +ys: List<&2, String>, rest: Unit -> List<&2, String> ) -> List<&2, String>: match first: case True{}: Con{name, Con{next, ys}} case False{}: Con{next, rest(Unit{})} Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit