{
  "id": "@typed/fx#Fx.changesWithEffect",
  "canonicalId": "@typed/fx/Fx#changesWithEffect",
  "symbol": {
    "id": "@typed/fx#Fx.changesWithEffect",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.changesWithEffect",
    "kind": "constant",
    "signatures": [
      "export declare const changesWithEffect: {\n    <A, E2, R2>(f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(fx: Fx<A, E | E2, R>, f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
    ],
    "summary": "Drops consecutive elements that are considered equal by an effectful predicate.\nWhen the effect returns `true`, the element is skipped; when `false`, it is emitted.\n\nThis is the effectful variant of `skipRepeatsWith`: instead of a pure\n`Equivalence<A>`, you supply `(prev, next) => Effect<boolean>` where `true`\nmeans \"equal\" (skip) and `false` means \"changed\" (emit).",
    "sections": {
      "Why": "`changesWithEffect` supports service-backed or failing equivalence checks. The first value always\nemits; every later value is compared with the last emitted value and emits only when the effect\nreturns `false`, preserving source order.",
      "Ownership and lifetime": "One previous value and a semaphore are scoped to each run. Comparison effects are serialized,\ninterrupted with the run, and add their failures and services to the resulting Fx."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst changes = Fx.fromIterable([1, 1, 2]).pipe(\n  Fx.changesWithEffect((previous, next) => Effect.succeed(previous === next)),\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
      "line": 42
    },
    "since": "1.0.0",
    "category": "Selecting values"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.changesWithEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.changesWithEffect",
    "declarationKey": "declaration:71b14cedf214fd017bca05dc",
    "family": "variable",
    "signatures": [
      "export declare const changesWithEffect: {\n    <A, E2, R2>(f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(fx: Fx<A, E | E2, R>, f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
        "start": {
          "line": 42,
          "column": 14
        },
        "end": {
          "line": 86,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
        "start": {
          "line": 43,
          "column": 3
        },
        "end": {
          "line": 45,
          "column": 60
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
        "start": {
          "line": 47,
          "column": 3
        },
        "end": {
          "line": 50,
          "column": 28
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#changesWithEffect"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:71b14cedf214fd017bca05dc"
  },
  "declaration": {
    "declarationKey": "declaration:71b14cedf214fd017bca05dc",
    "name": "changesWithEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const changesWithEffect: {\n    <A, E2, R2>(f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(fx: Fx<A, E | E2, R>, f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
            "start": {
              "line": 42,
              "column": 14
            },
            "end": {
              "line": 86,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, E2, R2>(f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;",
          "<A, E, R, E2, R2>(fx: Fx<A, E | E2, R>, f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): Fx<A, E | E2, R | R2>;"
        ],
        "typeParameters": [
          "A",
          "E2",
          "R2",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
            "start": {
              "line": 43,
              "column": 3
            },
            "end": {
              "line": 45,
              "column": 60
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
            "start": {
              "line": 47,
              "column": 3
            },
            "end": {
              "line": 50,
              "column": 28
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const changesWithEffect: {\n    <A, E2, R2>(f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(fx: Fx<A, E | E2, R>, f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
    ],
    "typeParameters": [
      "A",
      "E2",
      "R2",
      "E",
      "R"
    ],
    "summary": "Drops consecutive elements that are considered equal by an effectful predicate.\nWhen the effect returns `true`, the element is skipped; when `false`, it is emitted.\n\nThis is the effectful variant of `skipRepeatsWith`: instead of a pure\n`Equivalence<A>`, you supply `(prev, next) => Effect<boolean>` where `true`\nmeans \"equal\" (skip) and `false` means \"changed\" (emit).",
    "sections": {
      "Why": "`changesWithEffect` supports service-backed or failing equivalence checks. The first value always\nemits; every later value is compared with the last emitted value and emits only when the effect\nreturns `false`, preserving source order.",
      "Ownership and lifetime": "One previous value and a semaphore are scoped to each run. Comparison effects are serialized,\ninterrupted with the run, and add their failures and services to the resulting Fx."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst changes = Fx.fromIterable([1, 1, 2]).pipe(\n  Fx.changesWithEffect((previous, next) => Effect.succeed(previous === next)),\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
        "start": {
          "line": 42,
          "column": 14
        },
        "end": {
          "line": 86,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
        "start": {
          "line": 43,
          "column": 3
        },
        "end": {
          "line": 45,
          "column": 60
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/changesWithEffect.ts",
        "start": {
          "line": 47,
          "column": 3
        },
        "end": {
          "line": 50,
          "column": 28
        }
      }
    ],
    "since": "1.0.0",
    "category": "Selecting values"
  }
}
