{
  "id": "@typed/fx#Sink.map",
  "canonicalId": "@typed/fx/Sink#map",
  "symbol": {
    "id": "@typed/fx#Sink.map",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Sink.map",
    "kind": "function",
    "signatures": [
      "export declare function map<A, E, R, B>(sink: Sink<A, E, R>, f: (b: B) => A): Sink<B, E, R>;"
    ],
    "summary": "Transforms values before they reach the sink using a pure function.",
    "sections": {
      "Why": "Contramapping adapts a consumer to a new input without changing the producer or allocating an\nintermediate Fx.",
      "Ownership and lifetime": "Mapping is synchronous, preserves one-for-one input order, and acquires no resources. Thrown\nexceptions are defects. The wrapped sink still owns its callback effects and service needs."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nimport { Fx } from \"@typed/fx\"\n\nconst program = Effect.gen(function* () {\n  const sink = Sink.make(\n    (cause) => Effect.void,\n    (value: number) => Effect.sync(() => console.log(\"Received:\", value))\n  )\n\n  // Map string inputs to numbers\n  const mapped = Sink.map(sink, (str: string) => parseInt(str))\n\n  // Run an Fx with the mapped sink\n  yield* Fx.fromIterable([\"1\", \"2\", \"3\"]).run(mapped)\n  // Output: \"Received: 1\", \"Received: 2\", \"Received: 3\"\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Sink/combinators.ts",
      "line": 82
    },
    "since": "1.0.0",
    "category": "Transforming inputs"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Sink.map",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Sink",
    "qualifiedName": "Sink.map",
    "declarationKey": "declaration:4ddeb01f2e0e84acbf02f712",
    "family": "function",
    "signatures": [
      "export declare function map<A, E, R, B>(sink: Sink<A, E, R>, f: (b: B) => A): Sink<B, E, R>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 82,
          "column": 1
        },
        "end": {
          "line": 84,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/Sink#map"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Sink",
    "static": false,
    "importedFrom": "declaration:4ddeb01f2e0e84acbf02f712"
  },
  "declaration": {
    "declarationKey": "declaration:4ddeb01f2e0e84acbf02f712",
    "name": "map",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function map<A, E, R, B>(sink: Sink<A, E, R>, f: (b: B) => A): Sink<B, E, R>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R",
          "B"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 82,
              "column": 1
            },
            "end": {
              "line": 84,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function map<A, E, R, B>(sink: Sink<A, E, R>, f: (b: B) => A): Sink<B, E, R>;"
    ],
    "typeParameters": [
      "A",
      "E",
      "R",
      "B"
    ],
    "summary": "Transforms values before they reach the sink using a pure function.",
    "sections": {
      "Why": "Contramapping adapts a consumer to a new input without changing the producer or allocating an\nintermediate Fx.",
      "Ownership and lifetime": "Mapping is synchronous, preserves one-for-one input order, and acquires no resources. Thrown\nexceptions are defects. The wrapped sink still owns its callback effects and service needs."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nimport { Fx } from \"@typed/fx\"\n\nconst program = Effect.gen(function* () {\n  const sink = Sink.make(\n    (cause) => Effect.void,\n    (value: number) => Effect.sync(() => console.log(\"Received:\", value))\n  )\n\n  // Map string inputs to numbers\n  const mapped = Sink.map(sink, (str: string) => parseInt(str))\n\n  // Run an Fx with the mapped sink\n  yield* Fx.fromIterable([\"1\", \"2\", \"3\"]).run(mapped)\n  // Output: \"Received: 1\", \"Received: 2\", \"Received: 3\"\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 82,
          "column": 1
        },
        "end": {
          "line": 84,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Transforming inputs"
  }
}
