{
  "id": "@typed/fx/Fx#filterMapLoopCause",
  "canonicalId": "@typed/fx/Fx#filterMapLoopCause",
  "symbol": {
    "id": "@typed/fx/Fx#filterMapLoopCause",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "filterMapLoopCause",
    "kind": "constant",
    "signatures": [
      "export declare const filterMapLoopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): <E, R>(self: Fx<A, E, R>) => Fx<A, C, R>;\n    <A, E, R, B, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): Fx<A, C, R>;\n};"
    ],
    "summary": "Loops over the failure causes of an Fx with an accumulator, potentially transforming or filtering them.\nThis allows for complex error handling logic that maintains state across failures.",
    "sections": {
      "Why": "`filterMapLoopCause` transforms, suppresses, or reclassifies successive failure causes with\nexplicit state. Successful values pass through; each observed cause advances the accumulator and\n`None` suppresses forwarding that cause.",
      "Ownership and lifetime": "Failure state is isolated to one run and discarded afterward. The pure callback acquires no\nresources; defects and interrupts are visible inside the full `Cause` supplied to it."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause, Option } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst firstFailureOnly = Fx.fail(\"offline\").pipe(\n  Fx.filterMapLoopCause(false, (seen, cause) => [seen ? Option.none() : Option.some(Cause.map(cause, String)), true]),\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
      "line": 38
    },
    "since": "1.0.0",
    "category": "Stateful transforms"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#filterMapLoopCause",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "filterMapLoopCause",
    "qualifiedName": "filterMapLoopCause",
    "declarationKey": "declaration:ef9c59cdd2921255b9109c34",
    "family": "variable",
    "signatures": [
      "export declare const filterMapLoopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): <E, R>(self: Fx<A, E, R>) => Fx<A, C, R>;\n    <A, E, R, B, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): Fx<A, C, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
        "start": {
          "line": 38,
          "column": 14
        },
        "end": {
          "line": 56,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
        "start": {
          "line": 39,
          "column": 3
        },
        "end": {
          "line": 42,
          "column": 47
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
        "start": {
          "line": 44,
          "column": 3
        },
        "end": {
          "line": 48,
          "column": 18
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.filterMapLoopCause"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:ef9c59cdd2921255b9109c34",
    "name": "filterMapLoopCause",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const filterMapLoopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): <E, R>(self: Fx<A, E, R>) => Fx<A, C, R>;\n    <A, E, R, B, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): Fx<A, C, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
            "start": {
              "line": 38,
              "column": 14
            },
            "end": {
              "line": 56,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n    Option.Option<Cause.Cause<C>>,\n    B\n]): <E, R>(self: Fx<A, E, R>) => Fx<A, C, R>;",
          "<A, E, R, B, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [\n    Option.Option<Cause.Cause<C>>,\n    B\n]): Fx<A, C, R>;"
        ],
        "typeParameters": [
          "B",
          "A",
          "C",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
            "start": {
              "line": 39,
              "column": 3
            },
            "end": {
              "line": 42,
              "column": 47
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
            "start": {
              "line": 44,
              "column": 3
            },
            "end": {
              "line": 48,
              "column": 18
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const filterMapLoopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): <E, R>(self: Fx<A, E, R>) => Fx<A, C, R>;\n    <A, E, R, B, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [\n        Option.Option<Cause.Cause<C>>,\n        B\n    ]): Fx<A, C, R>;\n};"
    ],
    "typeParameters": [
      "B",
      "A",
      "C",
      "E",
      "R"
    ],
    "summary": "Loops over the failure causes of an Fx with an accumulator, potentially transforming or filtering them.\nThis allows for complex error handling logic that maintains state across failures.",
    "sections": {
      "Why": "`filterMapLoopCause` transforms, suppresses, or reclassifies successive failure causes with\nexplicit state. Successful values pass through; each observed cause advances the accumulator and\n`None` suppresses forwarding that cause.",
      "Ownership and lifetime": "Failure state is isolated to one run and discarded afterward. The pure callback acquires no\nresources; defects and interrupts are visible inside the full `Cause` supplied to it."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause, Option } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst firstFailureOnly = Fx.fail(\"offline\").pipe(\n  Fx.filterMapLoopCause(false, (seen, cause) => [seen ? Option.none() : Option.some(Cause.map(cause, String)), true]),\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
        "start": {
          "line": 38,
          "column": 14
        },
        "end": {
          "line": 56,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
        "start": {
          "line": 39,
          "column": 3
        },
        "end": {
          "line": 42,
          "column": 47
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/filterMapLoopCause.ts",
        "start": {
          "line": 44,
          "column": 3
        },
        "end": {
          "line": 48,
          "column": 18
        }
      }
    ],
    "since": "1.0.0",
    "category": "Stateful transforms"
  }
}
