def current

bendtorch-core@0.1.0.0 · src/storage/api.bend:293

import bendtorch-core@0.1.0.0/src/storage/api.bend as Api
import Base

293def current(+history: List<&2, Effect>, +j: U32, +fill: F32) -> F32:
294  match history:
295    case Nil{}:
296      fill
297    case +effect <> +past:
298      match effect:
299        case Wrote{+i, +w}:
300          Bool.pick(F32, Nat.is_eq(U32.to_nat(i), U32.to_nat(j)), w, current(past, j, fill))
301        case Kept{i}:
302          current(past, j, fill)
303        case Left{}:
304          current(past, j, fill)
305        case Right{}:
306          current(past, j, fill)

Uses (7)

Used by (12)