def pace_of
import cswap-bend-cli@0.1.0.0/view.bend as Viewimport Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/poll.bend as Poll
141# compute_pace for one weekly window; None when it cannot be told or is
142# inside the first day after a reset.
143def pace_of(+w: Json.Json, fetched: Maybe<&2, U32>) -> Maybe<&2, Pace>:
144 match fetched:
145 case None{}:
146 None{}
147 case Some{f}:
148 pace.reset(Poll.tenths.json(jv("pct", w)), Poll.win.reset(w), f)