import * as tracing_1 from "../../../../Tracing"
const fileName_1 = "(@effect-ts/system): _src/Collections/Immutable/List/api/mapM.ts"
import * as core from "../../../../Effect/core"
import * as forEach from "../../../../Effect/excl-forEach"
import * as coreMap from "../../../../Effect/map"
import * as List from "../core"
/**
 * Effectfully maps the elements of this list.
 */

export function mapM_(self, f) {
  return core.suspend(() => {
    const builder = List.emptyPushable()
    return coreMap.map_(
      forEach.forEachUnit_(
        self,
        (a) =>
          coreMap.map_(
            f(a),
            (b) => {
              List.push_(builder, b)
            },
            fileName_1 + ":19:21"
          ),
        fileName_1 + ":18:27"
      ),
      () => builder,
      fileName_1 + ":17:24"
    )
  }, fileName_1 + ":14:22")
}
/**
 * Effectfully maps the elements of this list.
 *
 * @dataFirst mapM_
 */

export function mapM(f) {
  return (self) => mapM_(self, f)
}
//# sourceMappingURL=mapM.js.map
