def load

bend-kit-runner@0.13.0.1 · runner.bend:325

import bend-kit-runner@0.13.0.1/runner.bend as Runner
import Base

325# Folds one record into the replayed state: a Snap replaces it, and an op steps it, as apply does.
326# A record that does not decode ends the replay with None.
327def load(~A: Data, ~R: Type, ~dec: R -> Maybe<&2, Rec<A>>, acc: Maybe<&2, State<A>>, r: R) -> Maybe<&2, State<A>>:
328  match acc:
329    case None{}:
330      None{}
331    case Some{s}:
332      load.rec(~A, dec(r), s)

Uses (4)

Used by (1)