{
  "id": "@typed/fx/Fx#catchCauseIf",
  "canonicalId": "@typed/fx/Fx#catchCauseIf",
  "symbol": {
    "id": "@typed/fx/Fx#catchCauseIf",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "catchCauseIf",
    "kind": "constant",
    "signatures": [
      "export declare const catchCauseIf: {\n    <E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
    ],
    "summary": "Recovers a failure cause only when a predicate accepts the complete cause.",
    "sections": {
      "Why": "Cause-level predicates can distinguish defects, interruption, sequential or\nparallel cause structure that a typed-error predicate cannot observe.",
      "Ownership and lifetime": "The predicate receives the source cause unchanged. A match starts one lazy\nfallback in the same subscription; otherwise the original cause propagates.\nThe fallback's requirements and errors are added, prior source values stay\ndelivered, and interrupting the returned Fx interrupts its active run."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause } from \"effect\"\nimport { catchCauseIf } from \"@typed/fx/Fx\"\nimport { failCause, succeed } from \"@typed/fx/Fx\"\n\nconst recovered = catchCauseIf(\n  failCause(Cause.die(\"bad decoder\")),\n  Cause.hasDies,\n  () => succeed(\"reported\")\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/catch.ts",
      "line": 362
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#catchCauseIf",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "catchCauseIf",
    "qualifiedName": "catchCauseIf",
    "declarationKey": "declaration:6239db16e8d09d99f4efd38e",
    "family": "variable",
    "signatures": [
      "export declare const catchCauseIf: {\n    <E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 362,
          "column": 14
        },
        "end": {
          "line": 388,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 363,
          "column": 3
        },
        "end": {
          "line": 366,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 368,
          "column": 3
        },
        "end": {
          "line": 372,
          "column": 33
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.catchCauseIf"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:6239db16e8d09d99f4efd38e",
    "name": "catchCauseIf",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const catchCauseIf: {\n    <E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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": 362,
              "column": 14
            },
            "end": {
              "line": 388,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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": 363,
              "column": 3
            },
            "end": {
              "line": 366,
              "column": 62
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 368,
              "column": 3
            },
            "end": {
              "line": 372,
              "column": 33
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const catchCauseIf: {\n    <E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<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: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;\n};"
    ],
    "typeParameters": [
      "E",
      "A2",
      "E2",
      "R2",
      "A",
      "R"
    ],
    "summary": "Recovers a failure cause only when a predicate accepts the complete cause.",
    "sections": {
      "Why": "Cause-level predicates can distinguish defects, interruption, sequential or\nparallel cause structure that a typed-error predicate cannot observe.",
      "Ownership and lifetime": "The predicate receives the source cause unchanged. A match starts one lazy\nfallback in the same subscription; otherwise the original cause propagates.\nThe fallback's requirements and errors are added, prior source values stay\ndelivered, and interrupting the returned Fx interrupts its active run."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause } from \"effect\"\nimport { catchCauseIf } from \"@typed/fx/Fx\"\nimport { failCause, succeed } from \"@typed/fx/Fx\"\n\nconst recovered = catchCauseIf(\n  failCause(Cause.die(\"bad decoder\")),\n  Cause.hasDies,\n  () => succeed(\"reported\")\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 362,
          "column": 14
        },
        "end": {
          "line": 388,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 363,
          "column": 3
        },
        "end": {
          "line": 366,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 368,
          "column": 3
        },
        "end": {
          "line": 372,
          "column": 33
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
