{
  "id": "@typed/fx/Fx#loopCauseEffect",
  "canonicalId": "@typed/fx/Fx#loopCauseEffect",
  "symbol": {
    "id": "@typed/fx/Fx#loopCauseEffect",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "loopCauseEffect",
    "kind": "constant",
    "signatures": [
      "export declare const loopCauseEffect: {\n    <B, A, E, R2, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], R2>): <R>(self: Fx<A, E, R>) => Fx<A, C | E, R | R2>;\n    <A, E, R, B, R2, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], E, R2>): Fx<A, C, R | R2>;\n};"
    ],
    "summary": "Effectfully loops over the failure causes of an Fx with an accumulator.",
    "sections": {
      "Why": "`loopCauseEffect` allows cause transformation to consult services or perform Effects while\nretaining state between failures. It does not serialize concurrent failure deliveries, so\noverlapping callbacks can read the same seed and commit in completion order.",
      "Ownership and lifetime": "One mutable seed belongs to each run. Required services remain in the result; callback failure is\ndelivered to the Sink, and interruption follows each producer delivery without adding a lock."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst observed = Fx.fail(\"offline\").pipe(Fx.loopCauseEffect(0, (n, cause) => Effect.succeed([cause, n + 1])))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
      "line": 35
    },
    "since": "1.0.0",
    "category": "Stateful transforms"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#loopCauseEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "loopCauseEffect",
    "qualifiedName": "loopCauseEffect",
    "declarationKey": "declaration:62a45bb06f16e70d92e2492b",
    "family": "variable",
    "signatures": [
      "export declare const loopCauseEffect: {\n    <B, A, E, R2, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], R2>): <R>(self: Fx<A, E, R>) => Fx<A, C | E, R | R2>;\n    <A, E, R, B, R2, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], E, R2>): Fx<A, C, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
        "start": {
          "line": 35,
          "column": 14
        },
        "end": {
          "line": 54,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
        "start": {
          "line": 36,
          "column": 3
        },
        "end": {
          "line": 39,
          "column": 53
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 45,
          "column": 23
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.loopCauseEffect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:62a45bb06f16e70d92e2492b",
    "name": "loopCauseEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const loopCauseEffect: {\n    <B, A, E, R2, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], R2>): <R>(self: Fx<A, E, R>) => Fx<A, C | E, R | R2>;\n    <A, E, R, B, R2, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], E, R2>): Fx<A, C, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
            "start": {
              "line": 35,
              "column": 14
            },
            "end": {
              "line": 54,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, A, E, R2, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => Effect.Effect<readonly [\n    Cause.Cause<C>,\n    B\n], R2>): <R>(self: Fx<A, E, R>) => Fx<A, C | E, R | R2>;",
          "<A, E, R, B, R2, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => Effect.Effect<readonly [\n    Cause.Cause<C>,\n    B\n], E, R2>): Fx<A, C, R | R2>;"
        ],
        "typeParameters": [
          "B",
          "A",
          "E",
          "R2",
          "C",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
            "start": {
              "line": 36,
              "column": 3
            },
            "end": {
              "line": 39,
              "column": 53
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
            "start": {
              "line": 41,
              "column": 3
            },
            "end": {
              "line": 45,
              "column": 23
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const loopCauseEffect: {\n    <B, A, E, R2, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], R2>): <R>(self: Fx<A, E, R>) => Fx<A, C | E, R | R2>;\n    <A, E, R, B, R2, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => Effect.Effect<readonly [\n        Cause.Cause<C>,\n        B\n    ], E, R2>): Fx<A, C, R | R2>;\n};"
    ],
    "typeParameters": [
      "B",
      "A",
      "E",
      "R2",
      "C",
      "R"
    ],
    "summary": "Effectfully loops over the failure causes of an Fx with an accumulator.",
    "sections": {
      "Why": "`loopCauseEffect` allows cause transformation to consult services or perform Effects while\nretaining state between failures. It does not serialize concurrent failure deliveries, so\noverlapping callbacks can read the same seed and commit in completion order.",
      "Ownership and lifetime": "One mutable seed belongs to each run. Required services remain in the result; callback failure is\ndelivered to the Sink, and interruption follows each producer delivery without adding a lock."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst observed = Fx.fail(\"offline\").pipe(Fx.loopCauseEffect(0, (n, cause) => Effect.succeed([cause, n + 1])))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
        "start": {
          "line": 35,
          "column": 14
        },
        "end": {
          "line": 54,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
        "start": {
          "line": 36,
          "column": 3
        },
        "end": {
          "line": 39,
          "column": 53
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/loopCauseEffect.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 45,
          "column": 23
        }
      }
    ],
    "since": "1.0.0",
    "category": "Stateful transforms"
  }
}
