def when

yaml-for-bend@0.1.1.0 · scan.bend:124

import yaml-for-bend@0.1.1.0/scan.bend as Scan
import Base

124# +yes+ when +hit+, else +no+; only the one chosen runs.
125def when(-A: Type, hit: Bool, yes: Unit -> A, no: Unit -> A) -> A:
126  match hit:
127    case True{}:
128      yes(Unit{})
129    case False{}:
130      no(Unit{})

Uses (2)

Used by (30)