import * as tsplus_module_1 from "@effect/core/io/Fiber/operations/failCause";
import * as tsplus_module_2 from "@effect/core/io/Exit/operations/fold";
import * as tsplus_module_3 from "@effect/core/io/Fiber/operations/await";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/map";
/**
 * Passes the success of this fiber to the specified callback, and continues
 * with the fiber that it returns.
 *
 * @tsplus fluent ets/Fiber mapFiber
 * @tsplus fluent ets/RuntimeFiber mapFiber
 */

export function mapFiber_(self, f, __tsplusTrace) {
  return tsplus_module_4.map_(tsplus_module_3._await(self, __tsplusTrace), exit => tsplus_module_2.fold_(exit, cause => tsplus_module_1.failCause(cause), a => f(a)), __tsplusTrace);
}
/**
 * Passes the success of this fiber to the specified callback, and continues
 * with the fiber that it returns.
 *
 * @tsplus static ets/Fiber/Aspects mapFiber
 */

export const mapFiber = (f, __tsplusTrace) => self => mapFiber_(self, f, __tsplusTrace);
//# sourceMappingURL=mapFiber.mjs.map