def above_of

near-v-framework@0.4.0.0 · general/compound/ops.bend:41

import near-v-framework@0.4.0.0/general/compound/ops.bend as Ops
import Base
import near-v-framework@0.4.0.0/general/rose/ops.bend as RO

41# ---- lifting: an edge as seen when only some keys are visible ----
42# A key shows as itself when visible, else as its nearest visible ancestor, else not at all ("").
43def above_of(+k: String, ps: List<&2, RO.Place>) -> List<&2, String>:
44  match ps:
45    case []:
46      []
47    case p <> rest:
48      match p:
49        case RO.Place{pk, ab}:
50          Bool.pick(List<&2, String>, String.eq(k, pk), ab, above_of(k, rest))

Uses (5)

Used by (1)