{
  "id": "@typed/fx/Fx#catchTag",
  "canonicalId": "@typed/fx/Fx#catchTag",
  "symbol": {
    "id": "@typed/fx/Fx#catchTag",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "catchTag",
    "kind": "constant",
    "signatures": [
      "export declare const catchTag: {\n    <const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n    <A, E, R, const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, A2, E2, R2>(self: Fx<A, E, R>, k: K, f: (e: ExtractTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n};"
    ],
    "summary": "Recovers selected tagged typed failures by running a fallback Fx.",
    "sections": {
      "Why": "Tagged error unions are idiomatic Effect APIs. Selecting one or more tags\nnarrows the handler input and removes only those variants from the returned\nerror channel, preserving the rest for later composition.",
      "Ownership and lifetime": "The source owns the subscription until its Cause contains a Fail whose tag\nmatches. That first matching Fail starts one handler Fx and replaces the\nentire original Cause, including any defects or interrupts composed with it.\nA Cause with no Fail, or a first Fail with another tag, passes through intact.\nThe fallback is lazy and contributes its errors and services to the result."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { catchTag } from \"@typed/fx/Fx\"\nimport { fail, succeed } from \"@typed/fx/Fx\"\n\ntype Missing = { readonly _tag: \"Missing\"; readonly id: string }\nconst source = fail<Missing>({ _tag: \"Missing\", id: \"42\" })\nconst recovered = catchTag(source, \"Missing\", ({ id }) => succeed(`missing:${id}`))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/catch.ts",
      "line": 199
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#catchTag",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "catchTag",
    "qualifiedName": "catchTag",
    "declarationKey": "declaration:eb55a23e776e08a3221138c1",
    "family": "variable",
    "signatures": [
      "export declare const catchTag: {\n    <const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n    <A, E, R, const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, A2, E2, R2>(self: Fx<A, E, R>, k: K, f: (e: ExtractTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 199,
          "column": 14
        },
        "end": {
          "line": 264,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 200,
          "column": 3
        },
        "end": {
          "line": 211,
          "column": 5
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 213,
          "column": 3
        },
        "end": {
          "line": 223,
          "column": 5
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.catchTag"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:eb55a23e776e08a3221138c1",
    "name": "catchTag",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const catchTag: {\n    <const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n    <A, E, R, const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, A2, E2, R2>(self: Fx<A, E, R>, k: K, f: (e: ExtractTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 199,
              "column": 14
            },
            "end": {
              "line": 264,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;",
          "<A, E, R, const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, A2, E2, R2>(self: Fx<A, E, R>, k: K, f: (e: ExtractTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;"
        ],
        "typeParameters": [
          "const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>",
          "E",
          "A2",
          "E2",
          "R2",
          "A",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 200,
              "column": 3
            },
            "end": {
              "line": 211,
              "column": 5
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 213,
              "column": 3
            },
            "end": {
              "line": 223,
              "column": 5
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const catchTag: {\n    <const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n    <A, E, R, const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, A2, E2, R2>(self: Fx<A, E, R>, k: K, f: (e: ExtractTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;\n};"
    ],
    "typeParameters": [
      "const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>",
      "E",
      "A2",
      "E2",
      "R2",
      "A",
      "R"
    ],
    "summary": "Recovers selected tagged typed failures by running a fallback Fx.",
    "sections": {
      "Why": "Tagged error unions are idiomatic Effect APIs. Selecting one or more tags\nnarrows the handler input and removes only those variants from the returned\nerror channel, preserving the rest for later composition.",
      "Ownership and lifetime": "The source owns the subscription until its Cause contains a Fail whose tag\nmatches. That first matching Fail starts one handler Fx and replaces the\nentire original Cause, including any defects or interrupts composed with it.\nA Cause with no Fail, or a first Fail with another tag, passes through intact.\nThe fallback is lazy and contributes its errors and services to the result."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { catchTag } from \"@typed/fx/Fx\"\nimport { fail, succeed } from \"@typed/fx/Fx\"\n\ntype Missing = { readonly _tag: \"Missing\"; readonly id: string }\nconst source = fail<Missing>({ _tag: \"Missing\", id: \"42\" })\nconst recovered = catchTag(source, \"Missing\", ({ id }) => succeed(`missing:${id}`))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 199,
          "column": 14
        },
        "end": {
          "line": 264,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 200,
          "column": 3
        },
        "end": {
          "line": 211,
          "column": 5
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 213,
          "column": 3
        },
        "end": {
          "line": 223,
          "column": 5
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
