import * as C from "../core";
import * as ReadWith from "./readWith";
import * as ZipRight from "./zipRight";

const mapOutMReader = f => ReadWith.readWith(out => C.chain_(C.fromEffect(f(out)), _ => ZipRight.zipRight_(C.write(_), mapOutMReader(f))), e => C.fail(e), z => C.end(z));

export function mapOutEffect_(self, f) {
  return C.pipeTo_(self, mapOutMReader(f));
}
/**
 * @ets_data_first mapOutEffect_
 */

export function mapOutEffect(f) {
  return self => mapOutEffect_(self, f);
}
//# sourceMappingURL=mapOutEffect.js.map