def above_of
import near-v-framework@0.4.0.0/general/compound/ops.bend as Opsimport 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))