{
  "id": "@typed/fx#Fx.gen",
  "canonicalId": "@typed/fx/Fx#gen",
  "symbol": {
    "id": "@typed/fx#Fx.gen",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.gen",
    "kind": "constant",
    "signatures": [
      "export declare const gen: <Yield extends Effect.Effect<any, any, any>, Return extends Fx.Any>(f: () => Generator<Yield, Return, any>) => Fx<Fx.Success<Return>, Fx.Error<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Error<Yield>), Fx.Services<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Services<Yield>)>;"
    ],
    "summary": "Builds an Fx by yielding Effects and returning the Fx to run afterward.",
    "sections": {
      "Why": "Setup logic often needs Effect services or failures before it can choose a\npush producer. Generator notation keeps that dependency-aware setup linear\nwhile preserving the returned Fx's success, error, and service channels.",
      "Ownership and lifetime": "The generator is lazy: it runs for each subscription. Yielded Effects run\nfirst; only their returned Fx is then subscribed. A setup failure prevents\nthe Fx from starting, and interruption cancels the active phase. Resources\nacquired by yielded Effects must not escape unless managed independently;\nuse {@link genScoped } when setup and the returned Fx share a Scope."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { gen } from \"@typed/fx/Fx\"\nimport { succeed } from \"@typed/fx/Fx\"\n\nconst greeting = gen(function* () {\n  const name = yield* Effect.succeed(\"Typed\")\n  return succeed(`Hello, ${name}`)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/gen.ts",
      "line": 40
    },
    "since": "1.0.0",
    "category": "Generator composition"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.gen",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.gen",
    "declarationKey": "declaration:b59b49b8169a0f05fe266832",
    "family": "variable",
    "signatures": [
      "export declare const gen: <Yield extends Effect.Effect<any, any, any>, Return extends Fx.Any>(f: () => Generator<Yield, Return, any>) => Fx<Fx.Success<Return>, Fx.Error<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Error<Yield>), Fx.Services<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Services<Yield>)>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/gen.ts",
        "start": {
          "line": 40,
          "column": 14
        },
        "end": {
          "line": 46,
          "column": 27
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#gen"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:b59b49b8169a0f05fe266832"
  },
  "declaration": {
    "declarationKey": "declaration:b59b49b8169a0f05fe266832",
    "name": "gen",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const gen: <Yield extends Effect.Effect<any, any, any>, Return extends Fx.Any>(f: () => Generator<Yield, Return, any>) => Fx<Fx.Success<Return>, Fx.Error<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Error<Yield>), Fx.Services<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Services<Yield>)>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/gen.ts",
            "start": {
              "line": 40,
              "column": 14
            },
            "end": {
              "line": 46,
              "column": 27
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const gen: <Yield extends Effect.Effect<any, any, any>, Return extends Fx.Any>(f: () => Generator<Yield, Return, any>) => Fx<Fx.Success<Return>, Fx.Error<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Error<Yield>), Fx.Services<Return> | ([\n    Yield\n] extends [\n    never\n] ? never : Effect.Services<Yield>)>;"
    ],
    "typeParameters": [],
    "summary": "Builds an Fx by yielding Effects and returning the Fx to run afterward.",
    "sections": {
      "Why": "Setup logic often needs Effect services or failures before it can choose a\npush producer. Generator notation keeps that dependency-aware setup linear\nwhile preserving the returned Fx's success, error, and service channels.",
      "Ownership and lifetime": "The generator is lazy: it runs for each subscription. Yielded Effects run\nfirst; only their returned Fx is then subscribed. A setup failure prevents\nthe Fx from starting, and interruption cancels the active phase. Resources\nacquired by yielded Effects must not escape unless managed independently;\nuse {@link genScoped } when setup and the returned Fx share a Scope."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { gen } from \"@typed/fx/Fx\"\nimport { succeed } from \"@typed/fx/Fx\"\n\nconst greeting = gen(function* () {\n  const name = yield* Effect.succeed(\"Typed\")\n  return succeed(`Hello, ${name}`)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/gen.ts",
        "start": {
          "line": 40,
          "column": 14
        },
        "end": {
          "line": 46,
          "column": 27
        }
      }
    ],
    "since": "1.0.0",
    "category": "Generator composition"
  }
}
