Rank.win.bind.step: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/policy/rank.bend as Rank Lines 100-106 of cswap-bend-cli@0.1.0.0/policy/rank.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/policy/rank.bend&start_line=100&end_line=106 import Base import cswap-bend-cli@0.1.0.0/policy/types.bend as T # The binding window: highest utilization, the first wins ties. def win.bind.step(+acc: Maybe<&2, T.Win>, +w: T.Win) -> Maybe<&2, T.Win>: match acc: case None{}: Some{w} case Some{b}: win.bind.pick(Nat.is_gt(win.pct(w), win.pct(b)), b, w) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_gt https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/rank.bend&name=win.bind.pick https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/rank.bend&name=win.pct https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/types.bend&name=Win