def maxh
import cswap-bend-cli@0.1.0.0/policy/pick.bend as Pickimport Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T
278# The most headroom among the family's candidates whose time is r0.
279def maxh(+as: List<&2, T.Account>, +rk: Rk, +f: Fam, +r0: Maybe<&2, Nat>, +acc: Nat) -> Nat:
280 match as:
281 case Nil{}:
282 acc
283 case Con{a, t}:
284 maxh(t, rk, f, r0, maxh.step(cdn(a, rk, f), r0, acc))