{
  "id": "@typed/fx#Fx.fn.Gen",
  "canonicalId": "@typed/fx/Fx#fn.Gen",
  "symbol": {
    "id": "@typed/fx#Fx.fn.Gen",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.fn.Gen",
    "kind": "type",
    "signatures": [
      "type Gen = {\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>): (...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>): (this: Self, ...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (...args: Args) => A;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (this: Self, ...args: Args) => A;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (...args: Args) => B;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (this: Self, ...args: Args) => B;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (...args: Args) => C;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (this: Self, ...args: Args) => C;\n};"
    ],
    "summary": "Contract for functions whose body yields Effects and returns an `Fx`.",
    "sections": {
      "Why": "`Gen` combines services and errors from yielded Effects with those of the returned\n`Fx`, while retaining the original arguments and `this` type. Optional pipeable\narguments transform the resulting `Fx` without hiding those channels.",
      "Ownership and lifetime": "Defining the function is inert. The body and yielded Effects execute once per run\nof the `Fx` returned by an invocation; that run owns acquisition and interruption."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst item = Fx.fn(function* (id: number) {\n  const prefix = yield* Effect.succeed(\"item\")\n  return Fx.succeed(`${prefix}:${id}`)\n})\nconst program = Fx.collectAll(item(1))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/constructors/fn.ts",
      "line": 55
    },
    "since": "1.0.0",
    "category": "Type contracts"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.fn.Gen",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.fn.Gen",
    "declarationKey": "declaration:169c69a0808b72a6c22276c3",
    "family": "type-alias",
    "signatures": [
      "type Gen = {\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>): (...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>): (this: Self, ...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (...args: Args) => A;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (this: Self, ...args: Args) => A;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (...args: Args) => B;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (this: Self, ...args: Args) => B;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (...args: Args) => C;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (this: Self, ...args: Args) => C;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 55,
          "column": 3
        },
        "end": {
          "line": 189,
          "column": 5
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 56,
          "column": 5
        },
        "end": {
          "line": 64,
          "column": 7
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 65,
          "column": 5
        },
        "end": {
          "line": 79,
          "column": 7
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 81,
          "column": 5
        },
        "end": {
          "line": 91,
          "column": 29
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 92,
          "column": 5
        },
        "end": {
          "line": 108,
          "column": 41
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 110,
          "column": 5
        },
        "end": {
          "line": 127,
          "column": 29
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 128,
          "column": 5
        },
        "end": {
          "line": 146,
          "column": 41
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 148,
          "column": 5
        },
        "end": {
          "line": 167,
          "column": 29
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 168,
          "column": 5
        },
        "end": {
          "line": 188,
          "column": 41
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#fn.Gen"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx.fn",
    "static": false,
    "importedFrom": "declaration:169c69a0808b72a6c22276c3"
  },
  "declaration": {
    "declarationKey": "declaration:169c69a0808b72a6c22276c3",
    "name": "Gen",
    "family": "type-alias",
    "facets": [
      {
        "family": "type-alias",
        "syntaxKind": "TypeAliasDeclaration",
        "signatures": [
          "type Gen = {\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>): (...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>): (this: Self, ...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (...args: Args) => A;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (this: Self, ...args: Args) => A;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (...args: Args) => B;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (this: Self, ...args: Args) => B;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (...args: Args) => C;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (this: Self, ...args: Args) => C;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 55,
              "column": 3
            },
            "end": {
              "line": 189,
              "column": 5
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>): (...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;",
          "<Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>): (this: Self, ...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;",
          "<Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (...args: Args) => A;",
          "<Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (this: Self, ...args: Args) => A;",
          "<Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (...args: Args) => B;",
          "<Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (this: Self, ...args: Args) => B;",
          "<Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (...args: Args) => C;",
          "<Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (this: Self, ...args: Args) => C;"
        ],
        "typeParameters": [
          "Eff extends Effect.Effect<any, any, any>",
          "ReturnFx extends Fx.Any",
          "Args extends Array<any>",
          "Self",
          "A",
          "B",
          "C"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 56,
              "column": 5
            },
            "end": {
              "line": 64,
              "column": 7
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 65,
              "column": 5
            },
            "end": {
              "line": 79,
              "column": 7
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 81,
              "column": 5
            },
            "end": {
              "line": 91,
              "column": 29
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 92,
              "column": 5
            },
            "end": {
              "line": 108,
              "column": 41
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 110,
              "column": 5
            },
            "end": {
              "line": 127,
              "column": 29
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 128,
              "column": 5
            },
            "end": {
              "line": 146,
              "column": 41
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 148,
              "column": 5
            },
            "end": {
              "line": 167,
              "column": 29
            }
          },
          {
            "file": "packages/fx/src/Fx/constructors/fn.ts",
            "start": {
              "line": 168,
              "column": 5
            },
            "end": {
              "line": 188,
              "column": 41
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "type Gen = {\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>): (...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>): (this: Self, ...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (...args: Args) => A;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A): (this: Self, ...args: Args) => A;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (...args: Args) => B;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B): (this: Self, ...args: Args) => B;\n    <Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (...args: Args) => C;\n    <Self, Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>, A, B, C>(body: (this: Self, ...args: Args) => Generator<Eff, ReturnFx>, a: (_: Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>, ...args: Args) => A, b: (_: A, ...args: Args) => B, c: (_: B, ...args: Args) => C): (this: Self, ...args: Args) => C;\n};"
    ],
    "typeParameters": [
      "Eff extends Effect.Effect<any, any, any>",
      "ReturnFx extends Fx.Any",
      "Args extends Array<any>",
      "Self",
      "A",
      "B",
      "C"
    ],
    "summary": "Contract for functions whose body yields Effects and returns an `Fx`.",
    "sections": {
      "Why": "`Gen` combines services and errors from yielded Effects with those of the returned\n`Fx`, while retaining the original arguments and `this` type. Optional pipeable\narguments transform the resulting `Fx` without hiding those channels.",
      "Ownership and lifetime": "Defining the function is inert. The body and yielded Effects execute once per run\nof the `Fx` returned by an invocation; that run owns acquisition and interruption."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst item = Fx.fn(function* (id: number) {\n  const prefix = yield* Effect.succeed(\"item\")\n  return Fx.succeed(`${prefix}:${id}`)\n})\nconst program = Fx.collectAll(item(1))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 55,
          "column": 3
        },
        "end": {
          "line": 189,
          "column": 5
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 56,
          "column": 5
        },
        "end": {
          "line": 64,
          "column": 7
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 65,
          "column": 5
        },
        "end": {
          "line": 79,
          "column": 7
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 81,
          "column": 5
        },
        "end": {
          "line": 91,
          "column": 29
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 92,
          "column": 5
        },
        "end": {
          "line": 108,
          "column": 41
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 110,
          "column": 5
        },
        "end": {
          "line": 127,
          "column": 29
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 128,
          "column": 5
        },
        "end": {
          "line": 146,
          "column": 41
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 148,
          "column": 5
        },
        "end": {
          "line": 167,
          "column": 29
        }
      },
      {
        "file": "packages/fx/src/Fx/constructors/fn.ts",
        "start": {
          "line": 168,
          "column": 5
        },
        "end": {
          "line": 188,
          "column": 41
        }
      }
    ],
    "since": "1.0.0",
    "category": "Type contracts"
  }
}
