{
  "id": "@typed/fx/Sink#filterMapLoopEffect",
  "canonicalId": "@typed/fx/Sink#filterMapLoopEffect",
  "symbol": {
    "id": "@typed/fx/Sink#filterMapLoopEffect",
    "packageName": "@typed/fx",
    "moduleName": "Sink",
    "exportName": "filterMapLoopEffect",
    "kind": "constant",
    "signatures": [
      "export declare const filterMapLoopEffect: {\n    <B, A, E2, R2, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E2, R2>): <E, R>(sink: Sink<C, E, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, B, R2, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E, R2>): Sink<A, E, R | R2>;\n};"
    ],
    "summary": "Threads state through an effectful success transition and optionally forwards its value.",
    "sections": {
      "Why": "One transition can perform service-backed work, update state, and decide whether the consumer\nshould observe a value.",
      "Ownership and lifetime": "Callback invocation constructs a transition Effect from the seed visible at that moment. The\nadapter does not serialize those Effects: overlapping callbacks can read the same seed, and\nsuccessful transitions commit in completion order. `Some` then invokes the wrapped sink once,\n`None` not at all, and failure invokes its failure callback without committing. The sink instance\nretains its seed across producer runs; construct a new one to reset it."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst target = Sink.make(Effect.logError, Effect.log)\nconst sink = Sink.filterMapLoopEffect(target, 0, (count, n: number) => Effect.succeed([Option.some(n), count + 1] as const))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Sink/combinators.ts",
      "line": 860
    },
    "since": "1.0.0",
    "category": "Stateful delivery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Sink#filterMapLoopEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Sink",
    "consumerSpecifier": "@typed/fx/Sink",
    "exportName": "filterMapLoopEffect",
    "qualifiedName": "filterMapLoopEffect",
    "declarationKey": "declaration:53592b1836720b72e71275e3",
    "family": "variable",
    "signatures": [
      "export declare const filterMapLoopEffect: {\n    <B, A, E2, R2, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E2, R2>): <E, R>(sink: Sink<C, E, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, B, R2, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E, R2>): Sink<A, E, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 860,
          "column": 14
        },
        "end": {
          "line": 883,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 861,
          "column": 3
        },
        "end": {
          "line": 864,
          "column": 61
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 865,
          "column": 3
        },
        "end": {
          "line": 869,
          "column": 25
        }
      }
    ],
    "aliases": [
      "@typed/fx#Sink.filterMapLoopEffect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:53592b1836720b72e71275e3",
    "name": "filterMapLoopEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const filterMapLoopEffect: {\n    <B, A, E2, R2, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E2, R2>): <E, R>(sink: Sink<C, E, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, B, R2, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E, R2>): Sink<A, E, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 860,
              "column": 14
            },
            "end": {
              "line": 883,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, A, E2, R2, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n    Option.Option<C>,\n    B\n], E2, R2>): <E, R>(sink: Sink<C, E, R>) => Sink<A, E | E2, R | R2>;",
          "<A, E, R, B, R2, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n    Option.Option<C>,\n    B\n], E, R2>): Sink<A, E, R | R2>;"
        ],
        "typeParameters": [
          "B",
          "A",
          "E2",
          "R2",
          "C",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 861,
              "column": 3
            },
            "end": {
              "line": 864,
              "column": 61
            }
          },
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 865,
              "column": 3
            },
            "end": {
              "line": 869,
              "column": 25
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const filterMapLoopEffect: {\n    <B, A, E2, R2, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E2, R2>): <E, R>(sink: Sink<C, E, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, B, R2, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => Effect.Effect<readonly [\n        Option.Option<C>,\n        B\n    ], E, R2>): Sink<A, E, R | R2>;\n};"
    ],
    "typeParameters": [
      "B",
      "A",
      "E2",
      "R2",
      "C",
      "E",
      "R"
    ],
    "summary": "Threads state through an effectful success transition and optionally forwards its value.",
    "sections": {
      "Why": "One transition can perform service-backed work, update state, and decide whether the consumer\nshould observe a value.",
      "Ownership and lifetime": "Callback invocation constructs a transition Effect from the seed visible at that moment. The\nadapter does not serialize those Effects: overlapping callbacks can read the same seed, and\nsuccessful transitions commit in completion order. `Some` then invokes the wrapped sink once,\n`None` not at all, and failure invokes its failure callback without committing. The sink instance\nretains its seed across producer runs; construct a new one to reset it."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst target = Sink.make(Effect.logError, Effect.log)\nconst sink = Sink.filterMapLoopEffect(target, 0, (count, n: number) => Effect.succeed([Option.some(n), count + 1] as const))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 860,
          "column": 14
        },
        "end": {
          "line": 883,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 861,
          "column": 3
        },
        "end": {
          "line": 864,
          "column": 61
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 865,
          "column": 3
        },
        "end": {
          "line": 869,
          "column": 25
        }
      }
    ],
    "since": "1.0.0",
    "category": "Stateful delivery"
  }
}
