def cands_of

cswap-bend-cli@0.1.0.0 · switch.bend:88

import cswap-bend-cli@0.1.0.0/switch.bend as Switch
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/swpick.bend as P

88def cands_of(+root: String, +seq: Json.Json, +usage: Json.Json, +models: List<&2, String>, +slots: List<&2, String>) -> Act.of(List<&2, P.Cand>):
89  match slots:
90    case Nil{}:
91      Act.pure(List<&2, P.Cand>, [])
92    case Con{s, t}:
93      do ActM<List<&2, P.Cand>>:
94        c : P.Cand <- cand_of(root, seq, usage, models, s)
95        rest : List<&2, P.Cand> <- cands_of(root, seq, usage, models, t)
96        return c <> rest

Uses (10)

Used by (3)