{
  "id": "@typed/fx#Push.mapInputEffect",
  "canonicalId": "@typed/fx/Push#mapInputEffect",
  "symbol": {
    "id": "@typed/fx#Push.mapInputEffect",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Push.mapInputEffect",
    "kind": "constant",
    "signatures": [
      "export declare const mapInputEffect: {\n    <C, R3, E, A>(f: (c: C) => Effect.Effect<A, E, R3>): <R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<C, E, R | R3, B, E2, R2>;\n    <A, E, R, B, E2, R2, R3, C>(push: Push<A, E, R, B, E2, R2>, f: (c: C) => Effect.Effect<A, E, R3>): Push<C, E, R | R3, B, E2, R2>;\n};"
    ],
    "summary": "Effectfully transforms each successful input before sending it to the Sink.\n\nCalling `onSuccess(value)` invokes `f(value)` immediately to construct an\nEffect. Allocation and thrown exceptions therefore occur before an\nacknowledgment Effect is returned. Running that returned Effect later executes\nthe constructed Effect in the caller's fiber. On success its single `A` reaches\nthe Sink; typed failure, defect, or interruption sends its full Cause to the\nSink failure callback. Calls are not serialized, so the producer controls order\nand concurrency. Output values and order are unchanged.",
    "sections": {
      "Why": "Use this at an input boundary that must decode, validate, or load Effect\nservices before the existing consumer can accept a value.",
      "Ownership and lifetime": "Effect construction happens eagerly at `onSuccess`; only execution is deferred.\nThe fiber running the returned acknowledgment owns execution and interruption\nof the constructed Effect and downstream callback. `E` is handled by the Sink\nfailure channel, while `R3` joins the input service requirements."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Fx from \"@typed/fx/Fx\"\nimport * as Push from \"@typed/fx/Push\"\nimport * as Sink from \"@typed/fx/Sink\"\n\nconst numbers: Array<number> = []\nconst base = Push.make(\n  Sink.make(() => Effect.void, (n: number) => Effect.sync(() => numbers.push(n))),\n  Fx.empty\n)\nconst parsed = Push.mapInputEffect(base, (text: string) =>\n  text === \"\" ? Effect.fail(\"empty\" as const) : Effect.succeed(Number(text))\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Push/Push.ts",
      "line": 490
    },
    "since": "1.0.0",
    "category": "Transforming inputs"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Push.mapInputEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Push",
    "qualifiedName": "Push.mapInputEffect",
    "declarationKey": "declaration:e79a18202c40fa4d640e4aa8",
    "family": "variable",
    "signatures": [
      "export declare const mapInputEffect: {\n    <C, R3, E, A>(f: (c: C) => Effect.Effect<A, E, R3>): <R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<C, E, R | R3, B, E2, R2>;\n    <A, E, R, B, E2, R2, R3, C>(push: Push<A, E, R, B, E2, R2>, f: (c: C) => Effect.Effect<A, E, R3>): Push<C, E, R | R3, B, E2, R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 490,
          "column": 14
        },
        "end": {
          "line": 517,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 491,
          "column": 3
        },
        "end": {
          "line": 493,
          "column": 86
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 495,
          "column": 3
        },
        "end": {
          "line": 498,
          "column": 36
        }
      }
    ],
    "aliases": [
      "@typed/fx/Push#mapInputEffect"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Push",
    "static": false,
    "importedFrom": "declaration:e79a18202c40fa4d640e4aa8"
  },
  "declaration": {
    "declarationKey": "declaration:e79a18202c40fa4d640e4aa8",
    "name": "mapInputEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const mapInputEffect: {\n    <C, R3, E, A>(f: (c: C) => Effect.Effect<A, E, R3>): <R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<C, E, R | R3, B, E2, R2>;\n    <A, E, R, B, E2, R2, R3, C>(push: Push<A, E, R, B, E2, R2>, f: (c: C) => Effect.Effect<A, E, R3>): Push<C, E, R | R3, B, E2, R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 490,
              "column": 14
            },
            "end": {
              "line": 517,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<C, R3, E, A>(f: (c: C) => Effect.Effect<A, E, R3>): <R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<C, E, R | R3, B, E2, R2>;",
          "<A, E, R, B, E2, R2, R3, C>(push: Push<A, E, R, B, E2, R2>, f: (c: C) => Effect.Effect<A, E, R3>): Push<C, E, R | R3, B, E2, R2>;"
        ],
        "typeParameters": [
          "C",
          "R3",
          "E",
          "A",
          "R",
          "B",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 491,
              "column": 3
            },
            "end": {
              "line": 493,
              "column": 86
            }
          },
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 495,
              "column": 3
            },
            "end": {
              "line": 498,
              "column": 36
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const mapInputEffect: {\n    <C, R3, E, A>(f: (c: C) => Effect.Effect<A, E, R3>): <R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<C, E, R | R3, B, E2, R2>;\n    <A, E, R, B, E2, R2, R3, C>(push: Push<A, E, R, B, E2, R2>, f: (c: C) => Effect.Effect<A, E, R3>): Push<C, E, R | R3, B, E2, R2>;\n};"
    ],
    "typeParameters": [
      "C",
      "R3",
      "E",
      "A",
      "R",
      "B",
      "E2",
      "R2"
    ],
    "summary": "Effectfully transforms each successful input before sending it to the Sink.\n\nCalling `onSuccess(value)` invokes `f(value)` immediately to construct an\nEffect. Allocation and thrown exceptions therefore occur before an\nacknowledgment Effect is returned. Running that returned Effect later executes\nthe constructed Effect in the caller's fiber. On success its single `A` reaches\nthe Sink; typed failure, defect, or interruption sends its full Cause to the\nSink failure callback. Calls are not serialized, so the producer controls order\nand concurrency. Output values and order are unchanged.",
    "sections": {
      "Why": "Use this at an input boundary that must decode, validate, or load Effect\nservices before the existing consumer can accept a value.",
      "Ownership and lifetime": "Effect construction happens eagerly at `onSuccess`; only execution is deferred.\nThe fiber running the returned acknowledgment owns execution and interruption\nof the constructed Effect and downstream callback. `E` is handled by the Sink\nfailure channel, while `R3` joins the input service requirements."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Fx from \"@typed/fx/Fx\"\nimport * as Push from \"@typed/fx/Push\"\nimport * as Sink from \"@typed/fx/Sink\"\n\nconst numbers: Array<number> = []\nconst base = Push.make(\n  Sink.make(() => Effect.void, (n: number) => Effect.sync(() => numbers.push(n))),\n  Fx.empty\n)\nconst parsed = Push.mapInputEffect(base, (text: string) =>\n  text === \"\" ? Effect.fail(\"empty\" as const) : Effect.succeed(Number(text))\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 490,
          "column": 14
        },
        "end": {
          "line": 517,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 491,
          "column": 3
        },
        "end": {
          "line": 493,
          "column": 86
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 495,
          "column": 3
        },
        "end": {
          "line": 498,
          "column": 36
        }
      }
    ],
    "since": "1.0.0",
    "category": "Transforming inputs"
  }
}
