{
  "id": "@typed/fx#Fx.catchIf",
  "canonicalId": "@typed/fx/Fx#catchIf",
  "symbol": {
    "id": "@typed/fx#Fx.catchIf",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.catchIf",
    "kind": "constant",
    "signatures": [
      "export declare const catchIf: {\n    <E, A2, E2, R2>(predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;\n    <A, E, R, A2, E2, R2>(self: Fx<A, E, R>, predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
    ],
    "summary": "Recovers a typed failure only when a predicate accepts it.",
    "sections": {
      "Why": "Some typed errors are distinguished by values rather than tags. Predicate\nrecovery handles that subset while retaining `E` in the result because a\nrejected error can still escape.",
      "Ownership and lifetime": "The predicate is evaluated on the first Fail found anywhere in the source\nCause. A match starts one lazy fallback and replaces that entire Cause,\nincluding any defects or interrupts composed with the Fail. A rejection, or\na Cause containing no Fail, forwards the original Cause unchanged. The\nfallback contributes its errors and services and shares the subscription."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { catchIf } from \"@typed/fx/Fx\"\nimport { fail, succeed } from \"@typed/fx/Fx\"\n\nconst recovered = catchIf(fail(404), (status) => status === 404, () => succeed(\"missing\"))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/catch.ts",
      "line": 295
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.catchIf",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.catchIf",
    "declarationKey": "declaration:9617182cc8b87030176b264a",
    "family": "variable",
    "signatures": [
      "export declare const catchIf: {\n    <E, A2, E2, R2>(predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;\n    <A, E, R, A2, E2, R2>(self: Fx<A, E, R>, predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 295,
          "column": 14
        },
        "end": {
          "line": 328,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 296,
          "column": 3
        },
        "end": {
          "line": 299,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 301,
          "column": 3
        },
        "end": {
          "line": 305,
          "column": 33
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#catchIf"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:9617182cc8b87030176b264a"
  },
  "declaration": {
    "declarationKey": "declaration:9617182cc8b87030176b264a",
    "name": "catchIf",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const catchIf: {\n    <E, A2, E2, R2>(predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;\n    <A, E, R, A2, E2, R2>(self: Fx<A, E, R>, predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 295,
              "column": 14
            },
            "end": {
              "line": 328,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<E, A2, E2, R2>(predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;",
          "<A, E, R, A2, E2, R2>(self: Fx<A, E, R>, predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;"
        ],
        "typeParameters": [
          "E",
          "A2",
          "E2",
          "R2",
          "A",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 296,
              "column": 3
            },
            "end": {
              "line": 299,
              "column": 62
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 301,
              "column": 3
            },
            "end": {
              "line": 305,
              "column": 33
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const catchIf: {\n    <E, A2, E2, R2>(predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;\n    <A, E, R, A2, E2, R2>(self: Fx<A, E, R>, predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
    ],
    "typeParameters": [
      "E",
      "A2",
      "E2",
      "R2",
      "A",
      "R"
    ],
    "summary": "Recovers a typed failure only when a predicate accepts it.",
    "sections": {
      "Why": "Some typed errors are distinguished by values rather than tags. Predicate\nrecovery handles that subset while retaining `E` in the result because a\nrejected error can still escape.",
      "Ownership and lifetime": "The predicate is evaluated on the first Fail found anywhere in the source\nCause. A match starts one lazy fallback and replaces that entire Cause,\nincluding any defects or interrupts composed with the Fail. A rejection, or\na Cause containing no Fail, forwards the original Cause unchanged. The\nfallback contributes its errors and services and shares the subscription."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { catchIf } from \"@typed/fx/Fx\"\nimport { fail, succeed } from \"@typed/fx/Fx\"\n\nconst recovered = catchIf(fail(404), (status) => status === 404, () => succeed(\"missing\"))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 295,
          "column": 14
        },
        "end": {
          "line": 328,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 296,
          "column": 3
        },
        "end": {
          "line": 299,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 301,
          "column": 3
        },
        "end": {
          "line": 305,
          "column": 33
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
