{
  "id": "@typed/fx#Fx.catchTags",
  "canonicalId": "@typed/fx/Fx#catchTags",
  "symbol": {
    "id": "@typed/fx#Fx.catchTags",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.catchTags",
    "kind": "constant",
    "signatures": [
      "export declare const catchTags: {\n    <E, Cases extends TaggedCase<E>>(cases: Cases): <A, R>(self: Fx<A, E, R>) => Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n    <A, E, R, Cases extends TaggedCase<E>>(self: Fx<A, E, R>, cases: Cases): Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n};"
    ],
    "summary": "Recovers several tagged typed-error variants with one handler table.",
    "sections": {
      "Why": "A handler table keeps multi-variant recovery exhaustive and preserves the\nprecise success, error, and service unions produced by each selected case.\nUnlisted variants remain visible in the returned error channel.",
      "Ownership and lifetime": "The first Fail found anywhere in the source Cause is inspected. A listed tag\nstarts exactly one handler Fx and replaces the entire original Cause,\nincluding any defects or interrupts composed with that Fail. An untagged or\nunlisted first Fail, or a Cause with no Fail, propagates intact. Handlers are\nlazy and contribute their individual errors and service requirements."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { catchTags } from \"@typed/fx/Fx\"\nimport { fail, succeed } from \"@typed/fx/Fx\"\n\ntype Failure =\n  | { readonly _tag: \"Missing\"; readonly id: string }\n  | { readonly _tag: \"Forbidden\" }\nconst source = fail<Failure>({ _tag: \"Missing\", id: \"42\" })\nconst recovered = catchTags(source, {\n  Missing: ({ id }) => succeed(`missing:${id}`),\n  Forbidden: () => succeed(\"forbidden\")\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/catch.ts",
      "line": 436
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.catchTags",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.catchTags",
    "declarationKey": "declaration:c4dbaab0f885b827fbf0eb25",
    "family": "variable",
    "signatures": [
      "export declare const catchTags: {\n    <E, Cases extends TaggedCase<E>>(cases: Cases): <A, R>(self: Fx<A, E, R>) => Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n    <A, E, R, Cases extends TaggedCase<E>>(self: Fx<A, E, R>, cases: Cases): Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 436,
          "column": 14
        },
        "end": {
          "line": 514,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 437,
          "column": 3
        },
        "end": {
          "line": 445,
          "column": 5
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 447,
          "column": 3
        },
        "end": {
          "line": 454,
          "column": 5
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#catchTags"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:c4dbaab0f885b827fbf0eb25"
  },
  "declaration": {
    "declarationKey": "declaration:c4dbaab0f885b827fbf0eb25",
    "name": "catchTags",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const catchTags: {\n    <E, Cases extends TaggedCase<E>>(cases: Cases): <A, R>(self: Fx<A, E, R>) => Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n    <A, E, R, Cases extends TaggedCase<E>>(self: Fx<A, E, R>, cases: Cases): Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 436,
              "column": 14
            },
            "end": {
              "line": 514,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<E, Cases extends TaggedCase<E>>(cases: Cases): <A, R>(self: Fx<A, E, R>) => Fx<A | {\n    [K in keyof Cases]: CaseSuccess<Cases[K]>;\n}[keyof Cases], Exclude<E, {\n    _tag: keyof Cases;\n}> | {\n    [K in keyof Cases]: CaseError<Cases[K]>;\n}[keyof Cases], R | {\n    [K in keyof Cases]: CaseServices<Cases[K]>;\n}[keyof Cases]>;",
          "<A, E, R, Cases extends TaggedCase<E>>(self: Fx<A, E, R>, cases: Cases): Fx<A | {\n    [K in keyof Cases]: CaseSuccess<Cases[K]>;\n}[keyof Cases], Exclude<E, {\n    _tag: keyof Cases;\n}> | {\n    [K in keyof Cases]: CaseError<Cases[K]>;\n}[keyof Cases], R | {\n    [K in keyof Cases]: CaseServices<Cases[K]>;\n}[keyof Cases]>;"
        ],
        "typeParameters": [
          "E",
          "Cases extends TaggedCase<E>",
          "A",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 437,
              "column": 3
            },
            "end": {
              "line": 445,
              "column": 5
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 447,
              "column": 3
            },
            "end": {
              "line": 454,
              "column": 5
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const catchTags: {\n    <E, Cases extends TaggedCase<E>>(cases: Cases): <A, R>(self: Fx<A, E, R>) => Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n    <A, E, R, Cases extends TaggedCase<E>>(self: Fx<A, E, R>, cases: Cases): Fx<A | {\n        [K in keyof Cases]: CaseSuccess<Cases[K]>;\n    }[keyof Cases], Exclude<E, {\n        _tag: keyof Cases;\n    }> | {\n        [K in keyof Cases]: CaseError<Cases[K]>;\n    }[keyof Cases], R | {\n        [K in keyof Cases]: CaseServices<Cases[K]>;\n    }[keyof Cases]>;\n};"
    ],
    "typeParameters": [
      "E",
      "Cases extends TaggedCase<E>",
      "A",
      "R"
    ],
    "summary": "Recovers several tagged typed-error variants with one handler table.",
    "sections": {
      "Why": "A handler table keeps multi-variant recovery exhaustive and preserves the\nprecise success, error, and service unions produced by each selected case.\nUnlisted variants remain visible in the returned error channel.",
      "Ownership and lifetime": "The first Fail found anywhere in the source Cause is inspected. A listed tag\nstarts exactly one handler Fx and replaces the entire original Cause,\nincluding any defects or interrupts composed with that Fail. An untagged or\nunlisted first Fail, or a Cause with no Fail, propagates intact. Handlers are\nlazy and contribute their individual errors and service requirements."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { catchTags } from \"@typed/fx/Fx\"\nimport { fail, succeed } from \"@typed/fx/Fx\"\n\ntype Failure =\n  | { readonly _tag: \"Missing\"; readonly id: string }\n  | { readonly _tag: \"Forbidden\" }\nconst source = fail<Failure>({ _tag: \"Missing\", id: \"42\" })\nconst recovered = catchTags(source, {\n  Missing: ({ id }) => succeed(`missing:${id}`),\n  Forbidden: () => succeed(\"forbidden\")\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 436,
          "column": 14
        },
        "end": {
          "line": 514,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 437,
          "column": 3
        },
        "end": {
          "line": 445,
          "column": 5
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 447,
          "column": 3
        },
        "end": {
          "line": 454,
          "column": 5
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
