def win.soonest

cswap-bend-cli@0.1.0.0 · policy/usage.bend:139

import cswap-bend-cli@0.1.0.0/policy/usage.bend as Usage
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T

139# The soonest reset among the relevant windows (past ones included): once it
140# passes, that window is zeroed and the snapshot is obsolete.
141def win.soonest(+ws: List<&2, T.Win>, +acc: Maybe<&2, Nat>) -> Maybe<&2, Nat>:
142  match ws:
143    case Nil{}:
144      acc
145    case Con{w, t}:
146      win.soonest(t, soon.min(acc, win.reset(w)))

Uses (6)

Used by (2)