def stop

emerging-ezjson@1.3.0.0 · src/lazy.bend:4

import emerging-ezjson@1.3.0.0/src/lazy.bend as Lazy
import Base

4# `val` when `cond`, else what rest gives: the early exit of a search
5def stop(-A: Type, cond: Bool, val: A, rest: Unit -> A) -> A:
6  match cond:
7    case True{}:
8      val
9    case False{}:
10      rest(Unit{})

Uses (2)

Used by (3)