unthrown 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,20 @@
1
1
  //#region src/types.d.ts
2
+ /**
3
+ * Flatten an intersection into a single object literal so accumulated `bind` /
4
+ * `let` scopes display cleanly (`{ a; b }` rather than `{ a } & { b }`).
5
+ *
6
+ * @internal
7
+ */
8
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
9
+ /**
10
+ * The scope produced by a `bind` / `let` step: `T` with `K` added (as a readonly
11
+ * property of type `U`). `Omit<T, K>` first drops any existing `K`, so re-binding
12
+ * a name **overwrites** it — matching the runtime spread — rather than producing
13
+ * an unsound `T[K] & U` intersection.
14
+ *
15
+ * @internal
16
+ */
17
+ type Bound<T, K extends string, U> = Prettify<Omit<T, K> & { readonly [P in K]: U }>;
2
18
  /**
3
19
  * The method surface every {@link Result} variant carries. Factored out so the
4
20
  * three variants ({@link OkView}, {@link ErrView}, {@link DefectView}) can each
@@ -39,6 +55,58 @@ type ResultMethods<T, E> = {
39
55
  * @param f - the side effect (its return value is ignored).
40
56
  */
41
57
  tap(f: (value: T) => void): Result$1<T, E>;
58
+ /**
59
+ * Run a **failable** side effect on the success value, keeping the original
60
+ * value but threading the effect's error.
61
+ *
62
+ * @remarks
63
+ * This is to {@link ResultMethods.tap | tap} what
64
+ * {@link ResultMethods.flatMap | flatMap} is to {@link ResultMethods.map | map}:
65
+ * `f` returns a `Result`, but its **success value is discarded** — on success
66
+ * the original value flows through (`Result<T, E | E2>`), while an `Err` (or
67
+ * `Defect`) from `f` short-circuits. Runs only on `Ok`; `Err` and `Defect` pass
68
+ * through. If `f` throws, the throw becomes a `Defect`. Use it for a validation
69
+ * or write whose _result_ matters but whose _value_ you don't need.
70
+ *
71
+ * @typeParam E2 - the error type the effect may introduce.
72
+ * @param f - the failable side effect; its `Ok` value is ignored.
73
+ */
74
+ flatTap<E2>(f: (value: T) => Result$1<unknown, E2>): Result$1<T, E | E2>;
75
+ /**
76
+ * Do-notation: run `f` for a `Result` and **bind its value** under `name` in
77
+ * an accumulating object scope.
78
+ *
79
+ * @remarks
80
+ * Begin a chain with {@link Do} (an empty object scope) and grow it step by
81
+ * step. `f` receives the scope accumulated so far and returns a `Result`; on
82
+ * `Ok` the value is added as `{ ...scope, [name]: value }`, on `Err`/`Defect`
83
+ * the chain short-circuits. Errors union (`E | E2`). A throw becomes a
84
+ * `Defect` — as does calling `bind` on a non-object scope (e.g. `Ok(5).bind`),
85
+ * which is misuse: the scope is always an object inside a real `Do()` chain.
86
+ * (`let` is the pure-value counterpart.)
87
+ *
88
+ * @typeParam K - the key the bound value is stored under.
89
+ * @typeParam U - the bound value type.
90
+ * @typeParam E2 - the error type `f` may introduce.
91
+ * @param name - the scope key.
92
+ * @param f - produces a `Result` from the accumulated scope.
93
+ */
94
+ bind<K extends string, U, E2>(name: K, f: (scope: T) => Result$1<U, E2>): Result$1<Bound<T, K, U>, E | E2>;
95
+ /**
96
+ * Do-notation: run `f` for a **plain value** and bind it under `name` in the
97
+ * accumulating object scope. The pure-value counterpart of {@link ResultMethods.bind | bind}.
98
+ *
99
+ * @remarks
100
+ * `f` receives the scope and returns a value (not a `Result`); it is added as
101
+ * `{ ...scope, [name]: value }`. Runs only on `Ok`; `Err`/`Defect` pass
102
+ * through. A throw becomes a `Defect`.
103
+ *
104
+ * @typeParam K - the key the value is stored under.
105
+ * @typeParam U - the value type.
106
+ * @param name - the scope key.
107
+ * @param f - computes a value from the accumulated scope.
108
+ */
109
+ let<K extends string, U>(name: K, f: (scope: T) => U): Result$1<Bound<T, K, U>, E>;
42
110
  /**
43
111
  * Replace the success value with a constant `value`.
44
112
  *
@@ -96,12 +164,12 @@ type ResultMethods<T, E> = {
96
164
  * @remarks
97
165
  * Runs `f` only when a `Defect` is present, re-entering the modeled world by
98
166
  * returning a `Result` (an `Ok` or a fresh `Err`). `Ok` and `Err` pass
99
- * through. Recovering a defect should be rare: usually you let it bubble to
167
+ * through. Recovering a Defect should be rare: usually you let it bubble to
100
168
  * the edge. If `f` throws, the throw becomes a new `Defect`.
101
169
  *
102
170
  * @typeParam U - a success type the recovery may produce.
103
171
  * @typeParam E2 - an error type the recovery may produce.
104
- * @param f - maps the defect's unknown cause to a recovering `Result`.
172
+ * @param f - maps the Defect's unknown cause to a recovering `Result`.
105
173
  */
106
174
  recoverDefect<U, E2>(f: (cause: unknown) => Result$1<U, E2>): Result$1<T | U, E | E2>;
107
175
  /**
@@ -115,9 +183,9 @@ type ResultMethods<T, E> = {
115
183
  * Exhaustively fold all three runtime states into a single value of type `R`.
116
184
  *
117
185
  * @remarks
118
- * Exactly one handler runs. Together with the throw-to-defect guarantee, this
186
+ * Exactly one handler runs. Together with the throw-to-Defect guarantee, this
119
187
  * is typically the single place a pipeline is handled at the edge — mapping
120
- * `ok`/`err`/`defect` to (for example) 2xx / 4xx / 5xx with no `try`/`catch`.
188
+ * `Ok`/`Err`/`Defect` to (for example) 2xx / 4xx / 5xx with no `try`/`catch`.
121
189
  * (For richer matching, a `Result` is also a discriminated union — branch on
122
190
  * its `tag` property, e.g. with `ts-pattern`.)
123
191
  *
@@ -135,7 +203,7 @@ type ResultMethods<T, E> = {
135
203
  * @returns the `Ok` value.
136
204
  * @throws On `Err`, an {@link UnwrapError} carrying the error. On a `Defect`,
137
205
  * re-throws the **original cause** with its original stack, so an unhandled
138
- * defect surfaces at the global handler as the real failure.
206
+ * Defect surfaces at the global handler as the real failure.
139
207
  */
140
208
  unwrap(): T;
141
209
  /**
@@ -150,7 +218,7 @@ type ResultMethods<T, E> = {
150
218
  * The success value, or `fallback` on `Err`.
151
219
  *
152
220
  * @param fallback - returned when the result is an `Err`.
153
- * @throws Re-throws on a `Defect` — a defect is a bug, not an absent value, so
221
+ * @throws Re-throws on a `Defect` — a Defect is a bug, not an absent value, so
154
222
  * it is never silently replaced.
155
223
  */
156
224
  unwrapOr(fallback: T): T;
@@ -203,7 +271,7 @@ type DefectView<T = never, E = never> = ResultMethods<T, E> & {
203
271
  *
204
272
  * - **`Ok`** — a success carrying a `value: T`.
205
273
  * - **`Err`** — a modeled, anticipated failure carrying an `error: E`.
206
- * - **`Defect`** — an *unmodeled* failure carrying an unknown `cause`. A defect
274
+ * - **`Defect`** — an *unmodeled* failure carrying an unknown `cause`. A Defect
207
275
  * never appears in `E`; it is the library's third, out-of-band channel.
208
276
  *
209
277
  * Because it is a real union, you can match it natively (a `switch` on `tag`, or
@@ -217,10 +285,10 @@ type DefectView<T = never, E = never> = ResultMethods<T, E> & {
217
285
  *
218
286
  * @example
219
287
  * ```ts
220
- * import { ok, err, type Result } from "unthrown";
288
+ * import { Ok, Err, type Result } from "unthrown";
221
289
  *
222
290
  * function half(n: number): Result<number, "odd"> {
223
- * return n % 2 === 0 ? ok(n / 2) : err("odd");
291
+ * return n % 2 === 0 ? Ok(n / 2) : Err("odd");
224
292
  * }
225
293
  *
226
294
  * const message = half(10).match({
@@ -258,7 +326,8 @@ type Awaitable<T> = {
258
326
  * {@link fromPromise} forces. To do further async work, re-enter through a
259
327
  * qualified boundary and compose it: `ar.flatMap((v) => fromPromise(work(v),
260
328
  * qualify))`. The eliminators (`unwrap`, …) return promises; the binds
261
- * (`flatMap`, `orElse`, `recoverDefect`) additionally accept an `AsyncResult`.
329
+ * (`flatMap`, `flatTap`, `orElse`, `recoverDefect`) additionally accept an
330
+ * `AsyncResult`.
262
331
  *
263
332
  * To pattern-match an `AsyncResult`, `await` it first: `match(await ar)`.
264
333
  *
@@ -272,7 +341,19 @@ type AsyncResult<T, E> = Awaitable<Result$1<T, E>> & {
272
341
  * (never a raw `Promise`); a throw becomes a `Defect`.
273
342
  */
274
343
  flatMap<U, E2>(f: (value: T) => Result$1<U, E2> | AsyncResult<U, E2>): AsyncResult<U, E | E2>; /** Asynchronous `tap`. `f` is synchronous; a throw becomes a `Defect`. */
275
- tap(f: (value: T) => void): AsyncResult<T, E>; /** Asynchronous `as`. */
344
+ tap(f: (value: T) => void): AsyncResult<T, E>;
345
+ /**
346
+ * Asynchronous `flatTap` — a failable tap that keeps the original value. `f`
347
+ * may return a `Result` **or** an `AsyncResult`; its `Ok` value is discarded,
348
+ * an `Err`/`Defect` short-circuits, and a throw becomes a `Defect`.
349
+ */
350
+ flatTap<E2>(f: (value: T) => Result$1<unknown, E2> | AsyncResult<unknown, E2>): AsyncResult<T, E | E2>;
351
+ /**
352
+ * Asynchronous `bind` (do-notation). `f` may return a `Result` **or** an
353
+ * `AsyncResult`; its value is bound under `name` in the accumulating scope.
354
+ */
355
+ bind<K extends string, U, E2>(name: K, f: (scope: T) => Result$1<U, E2> | AsyncResult<U, E2>): AsyncResult<Bound<T, K, U>, E | E2>; /** Asynchronous `let` (do-notation). `f` returns a plain value, bound under `name`. */
356
+ let<K extends string, U>(name: K, f: (scope: T) => U): AsyncResult<Bound<T, K, U>, E>; /** Asynchronous `as`. */
276
357
  as<U>(value: U): AsyncResult<U, E>; /** Asynchronous `mapErr`. `f` is synchronous; a throw becomes a `Defect`. */
277
358
  mapErr<E2>(f: (error: E) => E2): AsyncResult<T, E2>; /** Asynchronous `orElse`. `f` may return a `Result` or an `AsyncResult`. */
278
359
  orElse<U, E2>(f: (error: E) => Result$1<U, E2> | AsyncResult<U, E2>): AsyncResult<T | U, E2>; /** Asynchronous `recover`. `f` is synchronous; a throw becomes a `Defect`. */
@@ -332,11 +413,11 @@ type AsyncErrOf<R> = R extends AsyncResult<unknown, infer E> ? E : never;
332
413
  *
333
414
  * @example
334
415
  * ```ts
335
- * import { ok } from "unthrown";
336
- * ok(42).unwrap(); // 42
416
+ * import { Ok } from "unthrown";
417
+ * Ok(42).unwrap(); // 42
337
418
  * ```
338
419
  */
339
- declare function ok<T>(value: T): Result$1<T, never>;
420
+ declare function Ok<T>(value: T): Result$1<T, never>;
340
421
  /**
341
422
  * Construct a failed {@link Result} carrying a **modeled** error.
342
423
  *
@@ -345,11 +426,11 @@ declare function ok<T>(value: T): Result$1<T, never>;
345
426
  *
346
427
  * @example
347
428
  * ```ts
348
- * import { err } from "unthrown";
349
- * err("not_found").unwrapErr(); // "not_found"
429
+ * import { Err } from "unthrown";
430
+ * Err("not_found").unwrapErr(); // "not_found"
350
431
  * ```
351
432
  */
352
- declare function err<E>(error: E): Result$1<never, E>;
433
+ declare function Err<E>(error: E): Result$1<never, E>;
353
434
  /**
354
435
  * Type guard: narrow a {@link Result} to its `Ok` variant, exposing `.value`.
355
436
  *
@@ -405,7 +486,7 @@ declare const DEFECT: unique symbol;
405
486
  * @remarks
406
487
  * `qualify` (passed to {@link fromPromise} / {@link fromThrowable}) returns
407
488
  * `E | Defect`: either a modeled domain error, or a `Defect` produced by
408
- * {@link defect} to say "this failure is not modeled". A `Defect` is opaque —
489
+ * {@link Defect} to say "this failure is not modeled". A `Defect` is opaque —
409
490
  * it carries the original cause for the boundary to convert into the third
410
491
  * runtime state of a `Result`.
411
492
  */
@@ -418,18 +499,43 @@ type Defect = {
418
499
  * function when a failure is **not** a modeled domain error.
419
500
  *
420
501
  * @param cause - the original thrown/rejected value.
421
- * @returns an opaque defect marker carrying `cause`.
502
+ * @returns an opaque Defect marker carrying `cause`.
422
503
  *
423
504
  * @example
424
505
  * ```ts
425
- * import { fromPromise, defect } from "unthrown";
506
+ * import { fromPromise, Defect } from "unthrown";
426
507
  *
427
508
  * const user = fromPromise(fetchUser(id), (cause) =>
428
- * cause instanceof NotFoundError ? cause : defect(cause),
509
+ * cause instanceof NotFoundError ? cause : Defect(cause),
429
510
  * );
430
511
  * ```
431
512
  */
432
- declare function defect(cause: unknown): Defect;
513
+ declare function Defect(cause: unknown): Defect;
514
+ //#endregion
515
+ //#region src/do.d.ts
516
+ /**
517
+ * Start a do-notation chain with an empty object scope, grown step by step with
518
+ * `bind` (for `Result`-returning steps) and `let` (for pure values).
519
+ *
520
+ * @remarks
521
+ * Capitalised because `do` is a reserved word. Each step receives the scope
522
+ * accumulated so far; the error types union across `bind`s, and a throw in any
523
+ * step becomes a `Defect`. To go asynchronous, lift the chain with `toAsync()`
524
+ * (then a `bind` may return an `AsyncResult`).
525
+ *
526
+ * @example
527
+ * ```ts
528
+ * import { Do, Ok } from "unthrown";
529
+ *
530
+ * const result = Do()
531
+ * .bind("user", () => findUser(id)) // Result<User, NotFound>
532
+ * .bind("org", ({ user }) => findOrg(user.orgId)) // Result<Org, NotFound>
533
+ * .let("label", ({ user, org }) => `${user.name} @ ${org.name}`)
534
+ * .map(({ user, org, label }) => render(user, org, label));
535
+ * // Result<View, NotFound>
536
+ * ```
537
+ */
538
+ declare function Do(): Result$1<{}, never>;
433
539
  //#endregion
434
540
  //#region src/interop.d.ts
435
541
  /**
@@ -437,7 +543,7 @@ declare function defect(cause: unknown): Defect;
437
543
  * `Err`. The sanctioned alternative to an `Option` type.
438
544
  *
439
545
  * @remarks
440
- * `null` and `undefined` map to `err(onAbsent())`; any other value (including
546
+ * `null` and `undefined` map to `Err(onAbsent())`; any other value (including
441
547
  * falsy ones like `0`, `""`, `false`) maps to `Ok`.
442
548
  *
443
549
  * @typeParam T - the (nullable) value type.
@@ -458,14 +564,14 @@ declare function fromNullable<T, E>(value: T | null | undefined, onAbsent: () =>
458
564
  *
459
565
  * @remarks
460
566
  * `qualify` **must** triage every thrown cause into a modeled error `E` or a
461
- * {@link Defect} (via {@link defect}) — there is no path that leaves `unknown`
567
+ * {@link Defect} (via {@link Defect}) — there is no path that leaves `unknown`
462
568
  * in `E`. A throw inside `qualify` itself is treated as a `Defect`.
463
569
  *
464
570
  * The modeled error type is `Exclude<R, Defect>` — the `Defect` arm of
465
571
  * `qualify`'s return is **subtracted** from `E`, never inferred into it. So a
466
- * `qualify` that returns *only* `defect(cause)` yields `E = never` (a defect is
572
+ * `qualify` that returns *only* `Defect(cause)` yields `E = never` (a Defect is
467
573
  * out-of-band and must not pollute the error channel); reach for
468
- * {@link fromSafePromise} when every failure is a defect.
574
+ * {@link fromSafePromise} when every failure is a Defect.
469
575
  *
470
576
  * @typeParam A - the wrapped function's argument tuple.
471
577
  * @typeParam T - the wrapped function's return type.
@@ -477,8 +583,8 @@ declare function fromNullable<T, E>(value: T | null | undefined, onAbsent: () =>
477
583
  *
478
584
  * @example
479
585
  * ```ts
480
- * import { fromThrowable, defect } from "unthrown";
481
- * const parse = fromThrowable(JSON.parse, (cause) => defect(cause));
586
+ * import { fromThrowable, Defect } from "unthrown";
587
+ * const parse = fromThrowable(JSON.parse, (cause) => Defect(cause));
482
588
  * parse("{}").unwrap();
483
589
  * ```
484
590
  */
@@ -495,8 +601,8 @@ declare function fromThrowable<A extends unknown[], T, R>(fn: (...args: A) => T,
495
601
  *
496
602
  * The modeled error type is `Exclude<R, Defect>` — the `Defect` arm of
497
603
  * `qualify`'s return is **subtracted** from `E`, never inferred into it. So a
498
- * `qualify` that returns *only* `defect(cause)` yields `E = never`; when every
499
- * rejection is a defect, prefer {@link fromSafePromise}.
604
+ * `qualify` that returns *only* `Defect(cause)` yields `E = never`; when every
605
+ * rejection is a Defect, prefer {@link fromSafePromise}.
500
606
  *
501
607
  * @typeParam T - the resolved value type.
502
608
  * @typeParam R - `qualify`'s return type; the modeled error `E` is
@@ -506,9 +612,9 @@ declare function fromThrowable<A extends unknown[], T, R>(fn: (...args: A) => T,
506
612
  *
507
613
  * @example
508
614
  * ```ts
509
- * import { fromPromise, defect } from "unthrown";
615
+ * import { fromPromise, Defect } from "unthrown";
510
616
  * const user = await fromPromise(fetchUser(id), (cause) =>
511
- * cause instanceof NotFoundError ? ("not_found" as const) : defect(cause),
617
+ * cause instanceof NotFoundError ? ("not_found" as const) : Defect(cause),
512
618
  * );
513
619
  * ```
514
620
  */
@@ -544,81 +650,115 @@ declare function fromSafePromise<T>(promise: Promise<T> | (() => Promise<T>)): A
544
650
  * @internal
545
651
  */
546
652
  type AllOk<Rs extends readonly unknown[], Ts extends readonly unknown[]> = number extends Rs["length"] ? Ts[number][] : Ts;
653
+ /** A record of `Result`s — the input to {@link allFromDict}. */
654
+ type ResultRecord = Record<string, Result$1<unknown, unknown>>;
655
+ /** A record of `AsyncResult`s — the input to {@link allFromDictAsync}. */
656
+ type AsyncResultRecord = Record<string, AsyncResult<unknown, unknown>>;
547
657
  /**
548
- * Collect {@link Result}s into a single `Result` of all their success values.
658
+ * Collect a tuple/array of {@link Result}s into a single `Result` of all their
659
+ * success values.
549
660
  *
550
661
  * @remarks
551
662
  * Short-circuits on the **first** `Err` (later entries are not inspected for
552
663
  * their error); any `Defect` present **dominates**, winning even over an earlier
553
- * `Err`. A **fixed tuple** keeps its positional types — `all([ok(1), ok("a")])`
664
+ * `Err`. A **fixed tuple** keeps its positional types — `all([Ok(1), Ok("a")])`
554
665
  * is `Result<[number, string], …>` — while a **dynamic array** `Result<T, E>[]`
555
- * collapses to `Result<T[], E>` with no cast.
556
- *
557
- * @typeParam Rs - the tuple/array of input `Result` types.
558
- * @param results - the results to combine.
666
+ * collapses to `Result<T[], E>` with no cast. For a **record** keyed by name,
667
+ * use {@link allFromDict}.
559
668
  *
560
669
  * @example
561
670
  * ```ts
562
- * import { all, ok } from "unthrown";
563
- * all([ok(1), ok("a"), ok(true)]).unwrap(); // [1, "a", true] (typed [number, string, boolean])
564
- * all([ok(1), ok(2)] as Result<number, never>[]).unwrap(); // number[]
671
+ * import { all, Ok } from "unthrown";
672
+ * all([Ok(1), Ok("a"), Ok(true)]).unwrap(); // [1, "a", true] (typed [number, string, boolean])
673
+ * all([Ok(1), Ok(2)] as Result<number, never>[]).unwrap(); // number[]
565
674
  * ```
566
675
  */
567
676
  declare function all<Rs extends readonly Result$1<unknown, unknown>[]>(results: readonly [...Rs]): Result$1<AllOk<Rs, { [K in keyof Rs]: OkOf<Rs[K]> }>, ErrOf<Rs[number]>>;
568
677
  /**
569
- * The asynchronous counterpart of {@link all}: combine {@link AsyncResult}s into
570
- * one `AsyncResult` of all their success values.
678
+ * Collect a **record** of {@link Result}s into a single `Result` of a record of
679
+ * their success values — `allFromDict({ a: Result<A, E>, b: Result<B, E> })` is
680
+ * `Result<{ a: A; b: B }, E>`. The named counterpart of {@link all}, for
681
+ * parallel work you'd rather not tuple.
571
682
  *
572
683
  * @remarks
573
- * The inputs are resolved **concurrently** (their order is preserved); the
574
- * resolved `Result`s are then folded with the same rules as {@link all} —
575
- * first `Err` short-circuits, any `Defect` dominates. As ever, the returned
576
- * `AsyncResult`'s internal promise never rejects. A **fixed tuple** keeps its
577
- * positional types; a **dynamic array** `AsyncResult<T, E>[]` collapses to
578
- * `AsyncResult<T[], E>`.
684
+ * Same folding rules as {@link all}: first `Err` short-circuits, any `Defect`
685
+ * dominates. This is **not** error accumulation.
686
+ *
687
+ * @example
688
+ * ```ts
689
+ * import { allFromDict, Ok } from "unthrown";
690
+ * allFromDict({ id: Ok(1), name: Ok("ada") }).unwrap(); // { id: 1, name: "ada" }
691
+ * ```
692
+ */
693
+ declare function allFromDict<R extends ResultRecord>(results: R): Result$1<{ [K in keyof R]: OkOf<R[K]> }, ErrOf<R[keyof R]>>;
694
+ /**
695
+ * The asynchronous counterpart of {@link all}: combine a tuple/array of
696
+ * {@link AsyncResult}s into one `AsyncResult` of all their success values.
579
697
  *
580
- * @typeParam Rs - the tuple/array of input `AsyncResult` types.
581
- * @param results - the async results to combine.
698
+ * @remarks
699
+ * The inputs are resolved **concurrently** (order preserved); the resolved
700
+ * `Result`s are then folded with the same rules as {@link all} — first `Err`
701
+ * short-circuits, any `Defect` dominates. As ever, the returned `AsyncResult`'s
702
+ * internal promise never rejects. For a **record**, use {@link allFromDictAsync}.
582
703
  *
583
704
  * @example
584
705
  * ```ts
585
706
  * import { allAsync, fromSafePromise } from "unthrown";
586
- * const both = await allAsync([fromSafePromise(a()), fromSafePromise(b())]);
707
+ * await allAsync([fromSafePromise(a()), fromSafePromise(b())]);
587
708
  * ```
588
709
  */
589
710
  declare function allAsync<Rs extends readonly AsyncResult<unknown, unknown>[]>(results: readonly [...Rs]): AsyncResult<AllOk<Rs, { [K in keyof Rs]: AsyncOkOf<Rs[K]> }>, AsyncErrOf<Rs[number]>>;
711
+ /**
712
+ * The asynchronous counterpart of {@link allFromDict}: combine a record of
713
+ * {@link AsyncResult}s into one `AsyncResult` of a record of their values.
714
+ *
715
+ * @remarks
716
+ * Resolved concurrently (order preserved), folded with the {@link all} rules,
717
+ * and the internal promise never rejects.
718
+ *
719
+ * @example
720
+ * ```ts
721
+ * import { allFromDictAsync, fromSafePromise } from "unthrown";
722
+ * await allFromDictAsync({ a: fromSafePromise(a()), b: fromSafePromise(b()) });
723
+ * ```
724
+ */
725
+ declare function allFromDictAsync<R extends AsyncResultRecord>(results: R): AsyncResult<{ [K in keyof R]: AsyncOkOf<R[K]> }, AsyncErrOf<R[keyof R]>>;
590
726
  //#endregion
591
727
  //#region src/facade.d.ts
592
728
  /**
593
729
  * Companion object grouping the standalone entry points under a single,
594
- * discoverable namespace: {@link Result.ok}, {@link Result.err},
595
- * {@link Result.defect}, {@link Result.fromNullable}, {@link Result.fromThrowable},
730
+ * discoverable namespace: {@link Result.Ok}, {@link Result.Err},
731
+ * {@link Result.Defect}, {@link Result.fromNullable}, {@link Result.fromThrowable},
596
732
  * {@link Result.fromPromise}, {@link Result.fromSafePromise}, {@link Result.all},
597
- * {@link Result.allAsync}, {@link Result.isOk}, {@link Result.isErr},
733
+ * {@link Result.allAsync}, {@link Result.allFromDict},
734
+ * {@link Result.allFromDictAsync}, {@link Result.isOk}, {@link Result.isErr},
598
735
  * {@link Result.isDefect}.
599
736
  *
600
737
  * @remarks
601
738
  * Purely additive sugar — each member **is** the corresponding free function.
602
739
  * The free functions remain the primary, tree-shakeable API; importing only
603
- * `{ ok }` never pulls this object in. The value `Result` and the type
740
+ * `{ Ok }` never pulls this object in. The value `Result` and the type
604
741
  * {@link Result} share one name (the companion-object pattern).
605
742
  *
606
743
  * @example
607
744
  * ```ts
608
745
  * import { Result } from "unthrown";
609
- * Result.ok(1).flatMap((n) => Result.ok(n + 1)).unwrap(); // 2
746
+ * Result.Ok(1).flatMap((n) => Result.Ok(n + 1)).unwrap(); // 2
610
747
  * ```
611
748
  */
612
749
  declare const Result: {
613
- readonly ok: typeof ok;
614
- readonly err: typeof err;
615
- readonly defect: typeof defect;
750
+ readonly Ok: typeof Ok;
751
+ readonly Err: typeof Err;
752
+ readonly Defect: typeof Defect;
753
+ readonly Do: typeof Do;
616
754
  readonly fromNullable: typeof fromNullable;
617
755
  readonly fromThrowable: typeof fromThrowable;
618
756
  readonly fromPromise: typeof fromPromise;
619
757
  readonly fromSafePromise: typeof fromSafePromise;
620
758
  readonly all: typeof all;
621
759
  readonly allAsync: typeof allAsync;
760
+ readonly allFromDict: typeof allFromDict;
761
+ readonly allFromDictAsync: typeof allFromDictAsync;
622
762
  readonly isOk: typeof isOk;
623
763
  readonly isErr: typeof isErr;
624
764
  readonly isDefect: typeof isDefect;
@@ -747,5 +887,5 @@ declare function matchTags<T, E extends {
747
887
  _tag: string;
748
888
  }, R>(result: AsyncResult<T, E>, handlers: TagHandlers<T, E, R>): Promise<R>;
749
889
  //#endregion
750
- export { type AsyncErrOf, type AsyncOkOf, type AsyncResult, type Awaitable, type Defect, type DefectView, type ErrOf, type ErrView, type OkOf, type OkView, Result, type TagHandlers, TaggedError, type TaggedErrorConstructor, type TaggedErrorInstance, UnwrapError, all, allAsync, defect, err, fromNullable, fromPromise, fromSafePromise, fromThrowable, isDefect, isErr, isOk, matchTags, ok };
890
+ export { type AsyncErrOf, type AsyncOkOf, type AsyncResult, type Awaitable, Defect, type DefectView, Do, Err, type ErrOf, type ErrView, Ok, type OkOf, type OkView, Result, type TagHandlers, TaggedError, type TaggedErrorConstructor, type TaggedErrorInstance, UnwrapError, all, allAsync, allFromDict, allFromDictAsync, fromNullable, fromPromise, fromSafePromise, fromThrowable, isDefect, isErr, isOk, matchTags };
751
891
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/constructors.ts","../src/core.ts","../src/defect.ts","../src/interop.ts","../src/facade.ts","../src/tagged.ts"],"m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AA;EAClB,MAAA,GAAS,KAAA,cAAmB,CAAA;AAAA,YAClB,CAAA,YAAa,KAAA,EAAO,OAAA,CAAQ,CAAA;EAAK,IAAA,EAAM,CAAA;AAAA,OAAS,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgC5C,SAAA;EAAyB,IAAA;AAAA,MACvC,MAAA,EAAQ,QAAA,CAAO,CAAA,EAAG,CAAA,GAClB,QAAA,EAAU,WAAA,CAAY,CAAA,EAAG,CAAA,EAAG,CAAA,IAC3B,CAAA;AAAA,iBACa,SAAA;EAAyB,IAAA;AAAA,MACvC,MAAA,EAAQ,WAAA,CAAY,CAAA,EAAG,CAAA,GACvB,QAAA,EAAU,WAAA,CAAY,CAAA,EAAG,CAAA,EAAG,CAAA,IAC3B,OAAA,CAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/constructors.ts","../src/core.ts","../src/defect.ts","../src/do.ts","../src/interop.ts","../src/facade.ts","../src/tagged.ts"],"mappings":";;AAQA;;;;;KAAY,QAAA,oBAA4B,CAAA,GAAI,CAAA,CAAE,CAAA;;;;;;;AAAC;AAU/C;KAAY,KAAA,2BAAgC,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,qBAAsB,CAAA,GAAI,CAAA;;;;;;;;;;KAW3E,aAAA;EAXgC;;;;;;;;AAA4C;EAqBtF,GAAA,IAAO,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,CAAA,GAAI,QAAA,CAAO,CAAA,EAAG,CAAA;EAVf;;;;;;;;;;EAqBvB,OAAA,QAAe,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,QAAA,CAAO,CAAA,EAAG,EAAA,IAAM,QAAA,CAAO,CAAA,EAAG,CAAA,GAAI,EAAA;EAAP;;;;;;;;EASvD,GAAA,CAAI,CAAA,GAAI,KAAA,EAAO,CAAA,YAAa,QAAA,CAAO,CAAA,EAAG,CAAA;EAiBO;;;;;;;;;;;;;;;;E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