{
  "id": "@typed/fx/Fx#result",
  "canonicalId": "@typed/fx/Fx#result",
  "symbol": {
    "id": "@typed/fx/Fx#result",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "result",
    "kind": "constant",
    "signatures": [
      "export declare const result: <A, E, R>(fx: Fx<A, E, R>) => Fx<Result.Result<A, Cause.Cause<E>>, never, R>;"
    ],
    "summary": "Materializes success and failure of an Fx as `Result` values.\n\n- **Success**: each emitted value is wrapped as `Result.succeed(value)`.\n- **Failure**: any failure (including typed error, defect, and interrupt) is\n  materialized as `Result.fail(cause)`. The output error type is `Cause<E>`,\n  so defects and interrupts are explicitly represented in the `Result` and\n  the resulting Fx has error type `never`.\n\nThe resulting Fx never fails at the stream level; all outcomes are emitted as\n`Result<A, Cause<E>>`. Consumers can use `Result.match` or `Result.isSuccess` /\n`Result.isFailure` to handle success vs failure (including defect/interrupt).",
    "sections": {
      "Why": "`Result` is convenient when success and failure should travel through one\ndata channel, while retaining the complete Cause rather than flattening it\ninto the typed error alone.",
      "Ownership and lifetime": "Each source value emits one successful Result in order. A terminal cause\nemits one failed Result and ends normally. The source is subscribed once;\nno resource is acquired and an interrupt reported by the source becomes\ndata, although interrupting the outer running fiber still stops the run."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { result } from \"@typed/fx/Fx\"\nimport { fail } from \"@typed/fx/Fx\"\n\nconst outcomes = result(fail(\"offline\"))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/result.ts",
      "line": 46
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#result",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "result",
    "qualifiedName": "result",
    "declarationKey": "declaration:10b8c8266b195097cce8220f",
    "family": "variable",
    "signatures": [
      "export declare const result: <A, E, R>(fx: Fx<A, E, R>) => Fx<Result.Result<A, Cause.Cause<E>>, never, R>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/result.ts",
        "start": {
          "line": 46,
          "column": 14
        },
        "end": {
          "line": 52,
          "column": 4
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.result"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:10b8c8266b195097cce8220f",
    "name": "result",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const result: <A, E, R>(fx: Fx<A, E, R>) => Fx<Result.Result<A, Cause.Cause<E>>, never, R>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/result.ts",
            "start": {
              "line": 46,
              "column": 14
            },
            "end": {
              "line": 52,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const result: <A, E, R>(fx: Fx<A, E, R>) => Fx<Result.Result<A, Cause.Cause<E>>, never, R>;"
    ],
    "typeParameters": [],
    "summary": "Materializes success and failure of an Fx as `Result` values.\n\n- **Success**: each emitted value is wrapped as `Result.succeed(value)`.\n- **Failure**: any failure (including typed error, defect, and interrupt) is\n  materialized as `Result.fail(cause)`. The output error type is `Cause<E>`,\n  so defects and interrupts are explicitly represented in the `Result` and\n  the resulting Fx has error type `never`.\n\nThe resulting Fx never fails at the stream level; all outcomes are emitted as\n`Result<A, Cause<E>>`. Consumers can use `Result.match` or `Result.isSuccess` /\n`Result.isFailure` to handle success vs failure (including defect/interrupt).",
    "sections": {
      "Why": "`Result` is convenient when success and failure should travel through one\ndata channel, while retaining the complete Cause rather than flattening it\ninto the typed error alone.",
      "Ownership and lifetime": "Each source value emits one successful Result in order. A terminal cause\nemits one failed Result and ends normally. The source is subscribed once;\nno resource is acquired and an interrupt reported by the source becomes\ndata, although interrupting the outer running fiber still stops the run."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { result } from \"@typed/fx/Fx\"\nimport { fail } from \"@typed/fx/Fx\"\n\nconst outcomes = result(fail(\"offline\"))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/result.ts",
        "start": {
          "line": 46,
          "column": 14
        },
        "end": {
          "line": 52,
          "column": 4
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
