def when

gralha-http-core@0.1.0.0 · http.bend:9

import gralha-http-core@0.1.0.0/http.bend as Http
import Base

9# One of two computations, run on c; only the chosen one runs.
10def when(-A: Type, c: Bool, yes: Unit -> A, no: Unit -> A) -> A:
11  match c:
12    case True{}:
13      yes(Unit{})
14    case False{}:
15      no(Unit{})

Uses (2)

Used by (14)