{
  "id": "@typed/fx/Fx#loopCause",
  "canonicalId": "@typed/fx/Fx#loopCause",
  "symbol": {
    "id": "@typed/fx/Fx#loopCause",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "loopCause",
    "kind": "constant",
    "signatures": [
      "export declare const loopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        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        Cause.Cause<C>,\n        B\n    ]): Fx<A, C, R>;\n};"
    ],
    "summary": "Loops over the failure causes of an Fx with an accumulator.",
    "sections": {
      "Why": "`loopCause` is the stateful counterpart of error mapping over full Effect causes. Successful\nvalues pass unchanged; each cause is synchronously transformed and advances the error state.",
      "Ownership and lifetime": "A fresh state begins for each run and is discarded afterward. The callback owns no resources and\nsees typed failures, defects, and interruption represented by `Cause`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst numbered = Fx.fail(\"offline\").pipe(Fx.loopCause(0, (n, cause) => [Cause.map(cause, (e) => `${n}:${e}`), n + 1]))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/loopCause.ts",
      "line": 33
    },
    "since": "1.0.0",
    "category": "Stateful transforms"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#loopCause",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "loopCause",
    "qualifiedName": "loopCause",
    "declarationKey": "declaration:ec1185499edb3df731df6545",
    "family": "variable",
    "signatures": [
      "export declare const loopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        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        Cause.Cause<C>,\n        B\n    ]): Fx<A, C, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/loopCause.ts",
        "start": {
          "line": 33,
          "column": 14
        },
        "end": {
          "line": 51,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCause.ts",
        "start": {
          "line": 34,
          "column": 3
        },
        "end": {
          "line": 37,
          "column": 47
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCause.ts",
        "start": {
          "line": 39,
          "column": 3
        },
        "end": {
          "line": 43,
          "column": 18
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.loopCause"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:ec1185499edb3df731df6545",
    "name": "loopCause",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const loopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        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        Cause.Cause<C>,\n        B\n    ]): Fx<A, C, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/loopCause.ts",
            "start": {
              "line": 33,
              "column": 14
            },
            "end": {
              "line": 51,
              "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    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    Cause.Cause<C>,\n    B\n]): Fx<A, C, R>;"
        ],
        "typeParameters": [
          "B",
          "A",
          "C",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/loopCause.ts",
            "start": {
              "line": 34,
              "column": 3
            },
            "end": {
              "line": 37,
              "column": 47
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/loopCause.ts",
            "start": {
              "line": 39,
              "column": 3
            },
            "end": {
              "line": 43,
              "column": 18
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const loopCause: {\n    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [\n        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        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.",
    "sections": {
      "Why": "`loopCause` is the stateful counterpart of error mapping over full Effect causes. Successful\nvalues pass unchanged; each cause is synchronously transformed and advances the error state.",
      "Ownership and lifetime": "A fresh state begins for each run and is discarded afterward. The callback owns no resources and\nsees typed failures, defects, and interruption represented by `Cause`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst numbered = Fx.fail(\"offline\").pipe(Fx.loopCause(0, (n, cause) => [Cause.map(cause, (e) => `${n}:${e}`), n + 1]))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/loopCause.ts",
        "start": {
          "line": 33,
          "column": 14
        },
        "end": {
          "line": 51,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCause.ts",
        "start": {
          "line": 34,
          "column": 3
        },
        "end": {
          "line": 37,
          "column": 47
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCause.ts",
        "start": {
          "line": 39,
          "column": 3
        },
        "end": {
          "line": 43,
          "column": 18
        }
      }
    ],
    "since": "1.0.0",
    "category": "Stateful transforms"
  }
}
