// ets_tracing: off
import * as Tp from "../../../../Collections/Immutable/Tuple";
import * as T from "../../../../Effect";
import * as Concat from "./concat";
import * as MapAccumEffect from "./mapAccumEffect";
import * as Succeed from "./succeed";
/**
 * Statefully and effectfully maps over the elements of this stream to produce all
 * intermediate results of type `S` given an initial S.
 */

export function scanEffect_(self, s, f) {
  return Concat.concat_(Succeed.succeed(s), MapAccumEffect.mapAccumEffect_(self, s, (s, a) => T.map_(f(s, a), s => Tp.tuple(s, s))));
}
/**
 * Statefully and effectfully maps over the elements of this stream to produce all
 * intermediate results of type `S` given an initial S.
 *
 * @ets_data_first scanEffect_
 */

export function scanEffect(s, f) {
  return self => scanEffect_(self, s, f);
}
//# sourceMappingURL=scanEffect.js.map