{
  "id": "@typed/fx#Fx.mapEffect",
  "canonicalId": "@typed/fx/Fx#mapEffect",
  "symbol": {
    "id": "@typed/fx#Fx.mapEffect",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.mapEffect",
    "kind": "constant",
    "signatures": [
      "export declare const mapEffect: {\n    <A, B, E2, R2>(f: (a: A) => Effect.Effect<B, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(fx: Fx<A, E | E2, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Fx<B, E | E2, R | R2>;\n};"
    ],
    "summary": "Transforms the elements of an Fx using a provided Effectful function.",
    "sections": {
      "Why": "`mapEffect` performs one Effectful transformation for every input and emits once for each\nsuccessful callback. It does not serialize sink invocations: ordering and concurrency are owned\nby the producer, so overlapping callbacks may complete and emit out of input order.",
      "Ownership and lifetime": "Each callback Effect belongs to the producer delivery that invoked it. Failure is routed to the\nSink, services remain required, and interruption is local to that delivery. The combinator adds\nno queue, semaphore, result retention, or independent fiber."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst concurrent = Fx.make<number>((sink) =>\n  Effect.all([sink.onSuccess(1), sink.onSuccess(2)], { concurrency: \"unbounded\", discard: true })\n)\nconst program = Fx.collectAll(\n  concurrent.pipe(Fx.mapEffect((n) => Effect.sleep(n === 1 ? \"10 millis\" : \"0 millis\").pipe(Effect.as(n))))\n) // producer concurrency permits [2, 1]"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
      "line": 40
    },
    "since": "1.0.0",
    "category": "Transforming values"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.mapEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.mapEffect",
    "declarationKey": "declaration:3f0b2f41380733f923ae94af",
    "family": "variable",
    "signatures": [
      "export declare const mapEffect: {\n    <A, B, E2, R2>(f: (a: A) => Effect.Effect<B, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(fx: Fx<A, E | E2, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Fx<B, E | E2, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
        "start": {
          "line": 40,
          "column": 14
        },
        "end": {
          "line": 56,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 43,
          "column": 60
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
        "start": {
          "line": 45,
          "column": 3
        },
        "end": {
          "line": 48,
          "column": 28
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#mapEffect"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:3f0b2f41380733f923ae94af"
  },
  "declaration": {
    "declarationKey": "declaration:3f0b2f41380733f923ae94af",
    "name": "mapEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const mapEffect: {\n    <A, B, E2, R2>(f: (a: A) => Effect.Effect<B, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(fx: Fx<A, E | E2, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Fx<B, E | E2, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
            "start": {
              "line": 40,
              "column": 14
            },
            "end": {
              "line": 56,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, B, E2, R2>(f: (a: A) => Effect.Effect<B, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<B, E | E2, R | R2>;",
          "<A, E, R, B, E2, R2>(fx: Fx<A, E | E2, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Fx<B, E | E2, R | R2>;"
        ],
        "typeParameters": [
          "A",
          "B",
          "E2",
          "R2",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
            "start": {
              "line": 41,
              "column": 3
            },
            "end": {
              "line": 43,
              "column": 60
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
            "start": {
              "line": 45,
              "column": 3
            },
            "end": {
              "line": 48,
              "column": 28
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const mapEffect: {\n    <A, B, E2, R2>(f: (a: A) => Effect.Effect<B, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(fx: Fx<A, E | E2, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Fx<B, E | E2, R | R2>;\n};"
    ],
    "typeParameters": [
      "A",
      "B",
      "E2",
      "R2",
      "E",
      "R"
    ],
    "summary": "Transforms the elements of an Fx using a provided Effectful function.",
    "sections": {
      "Why": "`mapEffect` performs one Effectful transformation for every input and emits once for each\nsuccessful callback. It does not serialize sink invocations: ordering and concurrency are owned\nby the producer, so overlapping callbacks may complete and emit out of input order.",
      "Ownership and lifetime": "Each callback Effect belongs to the producer delivery that invoked it. Failure is routed to the\nSink, services remain required, and interruption is local to that delivery. The combinator adds\nno queue, semaphore, result retention, or independent fiber."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst concurrent = Fx.make<number>((sink) =>\n  Effect.all([sink.onSuccess(1), sink.onSuccess(2)], { concurrency: \"unbounded\", discard: true })\n)\nconst program = Fx.collectAll(\n  concurrent.pipe(Fx.mapEffect((n) => Effect.sleep(n === 1 ? \"10 millis\" : \"0 millis\").pipe(Effect.as(n))))\n) // producer concurrency permits [2, 1]"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
        "start": {
          "line": 40,
          "column": 14
        },
        "end": {
          "line": 56,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 43,
          "column": 60
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapEffect.ts",
        "start": {
          "line": 45,
          "column": 3
        },
        "end": {
          "line": 48,
          "column": 28
        }
      }
    ],
    "since": "1.0.0",
    "category": "Transforming values"
  }
}
