def any.step

ezx@1.11.0.0 · src/lock/lock.bend:375

import ezx@1.11.0.0/src/lock/lock.bend as Lock
import Base

375# one step of a scan that is looking for one hit. Every scan in this file
376# wants it, so it is stated once here.
377#
378# `Bool.or` is an ordinary function and reduces both of its sides, so a scan
379# written with it reads the whole list even when the head answers. The rest of
380# the scan arrives as a thunk, which is a value, and only the arm that wants
381# it applies it; handed in as an ordinary argument it would be reduced before
382# this def could decline it.
383def any.step(here: Bool, rest: Unit -> Bool) -> Bool:
384  match here:
385    case True{}:
386      True{}
387    case False{}:
388      rest(Unit{})

Uses (2)

Used by (4)