def under

ezx@1.11.0.0 · src/ws/workspace.bend:157

import ezx@1.11.0.0/src/ws/workspace.bend as Workspace
import Base

157# whether a directory is directly under another: the other's segments, then
158# exactly one more
159def under(ps: List<&2, String>, ds: List<&2, String>) -> Bool:
160  match ps:
161    case []:
162      one(ds)
163    case +ph <> pt:
164      match ds:
165        case []:
166          False{}
167        case +dh <> dt:
168          rest = under(pt, dt)
169          Bool.and(String.eq(ph, dh), rest)

Uses (6)

Used by (1)