def fold_next

bend-lint-pack@0.1.1.0 · vendor/lint.bend:111

import bend-lint-pack@0.1.1.0/vendor/lint.bend as Lint
import Base

111# One step of fold_facts: stop at None{}, else run step and go on.
112def fold_next(~A: Type, ~step: A -> @+f: Fact -> IO(A), m: Maybe<&2, Fact>, acc: A, again: A -> IO(A)) -> IO(A):
113  match m:
114    case None{}:
115      IO.pure(A, acc)
116    case Some{f}:
117      IO.bind(A, A, step(acc, f), again)

Uses (5)

Used by (1)