"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("../react_monad/core");
const combinators_1 = require("../react_monad/combinators");
exports.simple_workflow = function (workflow_name, steps, initial_model, initial_step) {
    return initial_model.then(`${workflow_name}_initial_binder`, m => combinators_1.repeat(`${workflow_name}_repeater`)(cd => steps.has(cd.step) ?
        steps.get(cd.step)(cd)
        :
            core_1.unit(cd).filter(_ => false))({ model: m, step: initial_step }).map(c => c.model));
};
//# sourceMappingURL=workflow.js.map