def top

cswap-bend-cli@0.1.0.0 · policy/pick.bend:189

import cswap-bend-cli@0.1.0.0/policy/pick.bend as Pick
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T
import cswap-bend-cli@0.1.0.0/policy/rank.bend as R

189# The most headroom any candidate offers (0 when there is none).
190def top(+as: List<&2, T.Account>, +s: R.Sel, +acc: Nat) -> Nat:
191  match as:
192    case Nil{}:
193      acc
194    case Con{a, t}:
195      top(t, s, top.step(R.cand(a, s), acc))

Uses (6)

Used by (1)