{
  "id": "@typed/fx/Sink#filterMapLoop",
  "canonicalId": "@typed/fx/Sink#filterMapLoop",
  "symbol": {
    "id": "@typed/fx/Sink#filterMapLoop",
    "packageName": "@typed/fx",
    "moduleName": "Sink",
    "exportName": "filterMapLoop",
    "kind": "constant",
    "signatures": [
      "export declare const filterMapLoop: {\n    <B, A, C>(seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): <E, R>(sink: Sink<C, E, R>) => Sink<A, E, R>;\n    <A, E, R, B, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): Sink<A, E, R>;\n};"
    ],
    "summary": "Threads pure state through successes and optionally forwards a derived value.",
    "sections": {
      "Why": "It combines consumer-side state, filtering, and mapping in one ordered transition.",
      "Ownership and lifetime": "Each adapted sink owns its seed. Every input updates state synchronously; `Some` emits once and\n`None` emits nothing. Failures pass through. Reusing the sink continues from its retained seed;\ncreate a new sink to reset. The adapter acquires no resources."
    },
    "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 everyOther = Sink.filterMapLoop(target, false, (skip, n: number) => [skip ? Option.none() : Option.some(n), !skip])"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Sink/combinators.ts",
      "line": 627
    },
    "since": "1.0.0",
    "category": "Stateful delivery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Sink#filterMapLoop",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Sink",
    "consumerSpecifier": "@typed/fx/Sink",
    "exportName": "filterMapLoop",
    "qualifiedName": "filterMapLoop",
    "declarationKey": "declaration:3af1660ebd51892856b97f75",
    "family": "variable",
    "signatures": [
      "export declare const filterMapLoop: {\n    <B, A, C>(seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): <E, R>(sink: Sink<C, E, R>) => Sink<A, E, R>;\n    <A, E, R, B, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): Sink<A, E, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 627,
          "column": 14
        },
        "end": {
          "line": 649,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 628,
          "column": 3
        },
        "end": {
          "line": 631,
          "column": 51
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 632,
          "column": 3
        },
        "end": {
          "line": 636,
          "column": 20
        }
      }
    ],
    "aliases": [
      "@typed/fx#Sink.filterMapLoop"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:3af1660ebd51892856b97f75",
    "name": "filterMapLoop",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const filterMapLoop: {\n    <B, A, C>(seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): <E, R>(sink: Sink<C, E, R>) => Sink<A, E, R>;\n    <A, E, R, B, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): Sink<A, E, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 627,
              "column": 14
            },
            "end": {
              "line": 649,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, A, C>(seed: B, f: (acc: B, a: A) => readonly [\n    Option.Option<C>,\n    B\n]): <E, R>(sink: Sink<C, E, R>) => Sink<A, E, R>;",
          "<A, E, R, B, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => readonly [\n    Option.Option<C>,\n    B\n]): Sink<A, E, R>;"
        ],
        "typeParameters": [
          "B",
          "A",
          "C",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 628,
              "column": 3
            },
            "end": {
              "line": 631,
              "column": 51
            }
          },
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 632,
              "column": 3
            },
            "end": {
              "line": 636,
              "column": 20
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const filterMapLoop: {\n    <B, A, C>(seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): <E, R>(sink: Sink<C, E, R>) => Sink<A, E, R>;\n    <A, E, R, B, C>(sink: Sink<C, E, R>, seed: B, f: (acc: B, a: A) => readonly [\n        Option.Option<C>,\n        B\n    ]): Sink<A, E, R>;\n};"
    ],
    "typeParameters": [
      "B",
      "A",
      "C",
      "E",
      "R"
    ],
    "summary": "Threads pure state through successes and optionally forwards a derived value.",
    "sections": {
      "Why": "It combines consumer-side state, filtering, and mapping in one ordered transition.",
      "Ownership and lifetime": "Each adapted sink owns its seed. Every input updates state synchronously; `Some` emits once and\n`None` emits nothing. Failures pass through. Reusing the sink continues from its retained seed;\ncreate a new sink to reset. The adapter acquires no resources."
    },
    "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 everyOther = Sink.filterMapLoop(target, false, (skip, n: number) => [skip ? Option.none() : Option.some(n), !skip])"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 627,
          "column": 14
        },
        "end": {
          "line": 649,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 628,
          "column": 3
        },
        "end": {
          "line": 631,
          "column": 51
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 632,
          "column": 3
        },
        "end": {
          "line": 636,
          "column": 20
        }
      }
    ],
    "since": "1.0.0",
    "category": "Stateful delivery"
  }
}
