"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Do = Do;
exports.bind = bind;
exports.bindValue = bindValue;
exports.bind_ = exports.bindValue_ = void 0;

var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Effect/operations/map"));

var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Effect/operations/flatMap"));

var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Effect/operations/succeedNow"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

const fileName_1 = "(@effect/core) _src/io/Effect/operations/do.ts";
const bind_ = bind_1;
exports.bind_ = bind_;
const bindValue_ = bindValue_1;
/**
 * Binds an effectful value in a `do` scope
 *
 * @tsplus fluent ets/Effect bind
 */

exports.bindValue_ = bindValue_;

function bind_1(self, tag, f, __tsplusTrace) {
  return tsplus_module_2.flatMap_(self, k => tsplus_module_1.map_(f(k), a => ({ ...k,
    [tag]: a
  }), __tsplusTrace), __tsplusTrace);
}
/**
 * Binds an effectful value in a `do` scope
 *
 * @ets_data_first bind_
 */


function bind(tag, f, __tsplusTrace) {
  return self => bind_1(self, tag, f, __tsplusTrace);
}
/**
 * Like bind for values
 *
 * @tsplus fluent ets/Effect bindValue
 */


function bindValue_1(self, tag, f, __tsplusTrace) {
  return tsplus_module_1.map_(self, k => ({ ...k,
    [tag]: f(k)
  }), __tsplusTrace);
}
/**
 * Like bind for values
 *
 * @ets_data_first bindValue_
 */


function bindValue(tag, f, __tsplusTrace) {
  return self => bindValue_1(self, tag, f, __tsplusTrace);
}
/**
 * @tsplus static ets/Effect/Ops Do
 */


function Do() {
  return tsplus_module_3.succeedNow({}, fileName_1 + ":119:27");
}
//# sourceMappingURL=do.js.map