Workspace.cut: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/ws/workspace.bend as Workspace Lines 42-52 of ezx@1.11.0.0/src/ws/workspace.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/ws/workspace.bend&start_line=42&end_line=52 import Base # the segments before the last, when the last is the word: `libs/*` cut at # `*` is `libs`, and `cli/ez.toml` cut at `ez.toml` is `cli`. A path whose last # segment is another word cuts to nothing. def cut(ss: List<&2, String>, +word: String) -> Maybe<&2, List<&2, String>>: match ss: case []: None{} case +hd <> []: cut.last(String.eq(hd, word)) case +hd <> tl: cut.cons(hd, cut(tl, word)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/workspace.bend&name=cut.cons https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/workspace.bend&name=cut.last