better-effect 0.10.0 → 0.11.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.
Files changed (48) hide show
  1. package/README.md +244 -5
  2. package/dist/adapters/iti.d.mts +3 -4
  3. package/dist/adapters/iti.d.mts.map +1 -1
  4. package/dist/adapters/iti.mjs +9 -4
  5. package/dist/adapters/iti.mjs.map +1 -1
  6. package/dist/effect-2ZcGZI8A.mjs +513 -0
  7. package/dist/effect-2ZcGZI8A.mjs.map +1 -0
  8. package/dist/hono.d.mts +18 -13
  9. package/dist/hono.d.mts.map +1 -1
  10. package/dist/hono.mjs +9 -5
  11. package/dist/hono.mjs.map +1 -1
  12. package/dist/{index-BafDna0B.d.mts → index-C7Qild0_.d.mts} +158 -28
  13. package/dist/index-C7Qild0_.d.mts.map +1 -0
  14. package/dist/{index-DklNCz7w.d.mts → index-DStz0JMN.d.mts} +4 -4
  15. package/dist/{index-DklNCz7w.d.mts.map → index-DStz0JMN.d.mts.map} +1 -1
  16. package/dist/{index-CULgSzUw.d.mts → index-heuaRmXR.d.mts} +5 -5
  17. package/dist/{index-CULgSzUw.d.mts.map → index-heuaRmXR.d.mts.map} +1 -1
  18. package/dist/{index-C7KX5rAP.d.mts → index-rQhZk3Nt.d.mts} +127 -24
  19. package/dist/index-rQhZk3Nt.d.mts.map +1 -0
  20. package/dist/index.d.mts +4 -5
  21. package/dist/index.mjs +7 -538
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/runtime/explicit.d.mts +1 -1
  24. package/dist/runtime/node.d.mts +1 -1
  25. package/dist/runtime-DnMn0X0X.mjs +613 -0
  26. package/dist/runtime-DnMn0X0X.mjs.map +1 -0
  27. package/dist/scope-GGnmTQck.mjs +245 -0
  28. package/dist/scope-GGnmTQck.mjs.map +1 -0
  29. package/dist/{signal-C1bagvrO.mjs → signal-B97cs85Z.mjs} +81 -2
  30. package/dist/signal-B97cs85Z.mjs.map +1 -0
  31. package/dist/{standard-services-DW-i4UuA.mjs → standard-services-BFBq-4lo.mjs} +2 -2
  32. package/dist/{standard-services-DW-i4UuA.mjs.map → standard-services-BFBq-4lo.mjs.map} +1 -1
  33. package/dist/standard-services.d.mts +2 -2
  34. package/dist/standard-services.mjs +2 -2
  35. package/dist/testing.d.mts +198 -2
  36. package/dist/testing.d.mts.map +1 -0
  37. package/dist/testing.mjs +976 -2
  38. package/dist/testing.mjs.map +1 -0
  39. package/package.json +1 -1
  40. package/dist/effect-DAMqvegy.mjs +0 -544
  41. package/dist/effect-DAMqvegy.mjs.map +0 -1
  42. package/dist/index-BafDna0B.d.mts.map +0 -1
  43. package/dist/index-C7KX5rAP.d.mts.map +0 -1
  44. package/dist/map-layer-backend-gal-mcRv.mjs +0 -53
  45. package/dist/map-layer-backend-gal-mcRv.mjs.map +0 -1
  46. package/dist/map-layer-backend-rNwfH0Bz.d.mts +0 -42
  47. package/dist/map-layer-backend-rNwfH0Bz.d.mts.map +0 -1
  48. package/dist/signal-C1bagvrO.mjs.map +0 -1
@@ -0,0 +1,513 @@
1
+ import { t as isPromiseLike } from "./runtime-CDcCF5cb.mjs";
2
+ import { t as Scope } from "./scope-GGnmTQck.mjs";
3
+ import { Err, Result, matchError, matchErrorPartial } from "better-result";
4
+ //#region src/effect/combinators.ts
5
+ const asResult = (value) => {
6
+ return value;
7
+ };
8
+ const mapResult = (result, fn) => {
9
+ return Result.map(result, fn);
10
+ };
11
+ const mapErrorResult = (result, fn) => {
12
+ return Result.mapError(result, fn);
13
+ };
14
+ const andThenResult = (result, next) => {
15
+ const resultNext = next;
16
+ return Result.andThen(result, resultNext);
17
+ };
18
+ const andThenAsyncResult = (result, next) => {
19
+ const resultNext = (value) => {
20
+ return Promise.resolve(next(value));
21
+ };
22
+ return Result.andThenAsync(result, resultNext);
23
+ };
24
+ function map$1(first, second) {
25
+ if (first instanceof Function && second === void 0) {
26
+ const callback = first;
27
+ return (effect) => {
28
+ return map$1(effect, callback);
29
+ };
30
+ }
31
+ const fn = second;
32
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => {
33
+ return mapResult(result, fn);
34
+ });
35
+ return mapResult(first, fn);
36
+ }
37
+ function mapError$1(first, second) {
38
+ if (first instanceof Function && second === void 0) {
39
+ const callback = first;
40
+ return (effect) => {
41
+ return mapError$1(effect, callback);
42
+ };
43
+ }
44
+ const fn = second;
45
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => {
46
+ return mapErrorResult(result, fn);
47
+ });
48
+ return mapErrorResult(first, fn);
49
+ }
50
+ function andThen$1(first, second) {
51
+ if (first instanceof Function && second === void 0) {
52
+ const callback = first;
53
+ return (effect) => {
54
+ return andThen$1(effect, callback);
55
+ };
56
+ }
57
+ return andThenResult(first, second);
58
+ }
59
+ function andThenAsync(first, second) {
60
+ if (first instanceof Function && second === void 0) {
61
+ const callback = first;
62
+ return (effect) => {
63
+ return andThenAsync(effect, callback);
64
+ };
65
+ }
66
+ const next = second;
67
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => {
68
+ return andThenAsyncResult(result, next);
69
+ });
70
+ return andThenAsyncResult(first, next);
71
+ }
72
+ const tapResult = (result, fn) => Result.tap(result, fn);
73
+ const tapErrorResult = (result, fn) => Result.tapError(result, fn);
74
+ const tapBothResult = (result, handlers) => Result.tapBoth(result, handlers);
75
+ const tapAsyncResult = (result, fn) => Result.tapAsync(result, (value) => Promise.resolve(fn(value)));
76
+ const tapErrorAsyncResult = (result, fn) => Result.tapErrorAsync(result, (error) => Promise.resolve(fn(error)));
77
+ const tapBothAsyncResult = (result, handlers) => Result.tapBothAsync(result, {
78
+ ok: (value) => Promise.resolve(handlers.ok(value)),
79
+ err: (error) => Promise.resolve(handlers.err(error))
80
+ });
81
+ const asTaggedResult = (result) => {
82
+ return result;
83
+ };
84
+ const matchErrorResult = (result, handlers) => {
85
+ return Result.mapError(result, (error) => matchError(error, handlers));
86
+ };
87
+ const matchErrorPartialResult = (result, handlers) => {
88
+ return Result.mapError(result, (error) => matchErrorPartial(error, handlers));
89
+ };
90
+ const recoverResult = (result, fn) => Result.tryRecover(result, fn);
91
+ const recoverAsyncResult = (result, fn) => Result.tryRecoverAsync(result, (error) => Promise.resolve(fn(error)));
92
+ const flattenResult = (result) => Result.flatten(result);
93
+ const matchResult = (result, handlers) => Result.match(result, handlers);
94
+ const allResult = (results) => Result.all(results);
95
+ function tap$1(first, second) {
96
+ if (first instanceof Function && second === void 0) {
97
+ const callback = first;
98
+ return (effect) => tap$1(effect, callback);
99
+ }
100
+ if (second === void 0) throw new TypeError("Effect.tap requires a callback");
101
+ const fn = second;
102
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => tapResult(asResult(result), fn));
103
+ return tapResult(asResult(first), fn);
104
+ }
105
+ function tapError$1(first, second) {
106
+ if (first instanceof Function && second === void 0) {
107
+ const callback = first;
108
+ return (effect) => tapError$1(effect, callback);
109
+ }
110
+ if (second === void 0) throw new TypeError("Effect.tapError requires a callback");
111
+ const fn = second;
112
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => tapErrorResult(asResult(result), fn));
113
+ return tapErrorResult(asResult(first), fn);
114
+ }
115
+ function tapBoth(first, second) {
116
+ if (second === void 0) return (effect) => tapBoth(effect, first);
117
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => tapBothResult(result, second));
118
+ return tapBothResult(asResult(first), second);
119
+ }
120
+ function tapAsync(first, second) {
121
+ if (first instanceof Function && second === void 0) {
122
+ const callback = first;
123
+ return (effect) => tapAsync(effect, callback);
124
+ }
125
+ if (second === void 0) throw new TypeError("Effect.tapAsync requires a callback");
126
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => tapAsyncResult(asResult(result), second));
127
+ return tapAsyncResult(asResult(first), second);
128
+ }
129
+ function tapErrorAsync(first, second) {
130
+ if (first instanceof Function && second === void 0) {
131
+ const callback = first;
132
+ return (effect) => tapErrorAsync(effect, callback);
133
+ }
134
+ if (second === void 0) throw new TypeError("Effect.tapErrorAsync requires a callback");
135
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => tapErrorAsyncResult(asResult(result), second));
136
+ return tapErrorAsyncResult(asResult(first), second);
137
+ }
138
+ function tapBothAsync(first, second) {
139
+ if (second === void 0) return (effect) => tapBothAsync(effect, first);
140
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => tapBothAsyncResult(result, second));
141
+ return tapBothAsyncResult(asResult(first), second);
142
+ }
143
+ function matchError$1(first, second) {
144
+ if (second === void 0) throw new TypeError("Effect.matchError requires handlers");
145
+ const handlers = second;
146
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => matchErrorResult(asTaggedResult(asResult(result)), handlers));
147
+ return matchErrorResult(asTaggedResult(asResult(first)), handlers);
148
+ }
149
+ function matchErrorPartial$1(first, second) {
150
+ if (second === void 0) throw new TypeError("Effect.matchErrorPartial requires handlers");
151
+ const handlers = second;
152
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => matchErrorPartialResult(asTaggedResult(asResult(result)), handlers));
153
+ return matchErrorPartialResult(asTaggedResult(asResult(first)), handlers);
154
+ }
155
+ function recover$1(first, second) {
156
+ if (first instanceof Function && second === void 0) {
157
+ const callback = first;
158
+ return (effect) => recover$1(effect, callback);
159
+ }
160
+ if (second === void 0) throw new TypeError("Effect.recover requires a callback");
161
+ const fn = second;
162
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => recoverResult(asResult(result), fn));
163
+ return recoverResult(asResult(first), fn);
164
+ }
165
+ function recoverAsync(first, second) {
166
+ if (first instanceof Function && second === void 0) {
167
+ const callback = first;
168
+ return (effect) => recoverAsync(effect, callback);
169
+ }
170
+ if (second === void 0) throw new TypeError("Effect.recoverAsync requires a callback");
171
+ const fn = second;
172
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => recoverAsyncResult(asResult(result), fn));
173
+ return recoverAsyncResult(asResult(first), fn);
174
+ }
175
+ /** Remove one nested Result/Effect layer. */
176
+ function flatten(effect) {
177
+ return flattenResult(asResult(effect));
178
+ }
179
+ function as(first, second) {
180
+ if (arguments.length < 2) return (effect) => as(effect, first);
181
+ return mapResult(asResult(first), () => second);
182
+ }
183
+ /** Replace a successful value with void. */
184
+ function asVoid(effect) {
185
+ return mapResult(asResult(effect), () => void 0);
186
+ }
187
+ function match(first, second) {
188
+ if (isPromiseLike(first)) return Promise.resolve(first).then((result) => match(asResult(result), second));
189
+ return matchResult(asResult(first), second);
190
+ }
191
+ /** Collect already-created Effects in input order. */
192
+ function all(results) {
193
+ return allResult(results);
194
+ }
195
+ /** Combine two already-created Effects in input order. */
196
+ function zip(left, right) {
197
+ return Result.all([left, right]);
198
+ }
199
+ //#endregion
200
+ //#region src/effect/program-combinators.ts
201
+ const asProgram = (program) => program;
202
+ const isAsyncEffect = (effect) => isPromiseLike(effect);
203
+ const mapRuntime = (effect, fn) => {
204
+ if (isAsyncEffect(effect)) return Promise.resolve(effect).then((result) => Result.map(result, fn));
205
+ return Result.map(effect, fn);
206
+ };
207
+ const mapErrorRuntime = (effect, fn) => {
208
+ if (isAsyncEffect(effect)) return Promise.resolve(effect).then((result) => Result.mapError(result, fn));
209
+ return Result.mapError(effect, fn);
210
+ };
211
+ const tapRuntime = (effect, fn) => {
212
+ if (isAsyncEffect(effect)) return Promise.resolve(effect).then((result) => Result.tap(result, fn));
213
+ return Result.tap(effect, fn);
214
+ };
215
+ const tapErrorRuntime = (effect, fn) => {
216
+ if (isAsyncEffect(effect)) return Promise.resolve(effect).then((result) => Result.tapError(result, fn));
217
+ return Result.tapError(effect, fn);
218
+ };
219
+ const invoke = (output) => output instanceof Function ? output() : output;
220
+ const andThenRuntime = (effect, next) => {
221
+ const continueWith = (value) => Promise.resolve(invoke(next(value)));
222
+ if (isAsyncEffect(effect)) return Promise.resolve(effect).then((result) => Result.andThenAsync(result, continueWith));
223
+ return Result.andThenAsync(effect, continueWith);
224
+ };
225
+ const recoverRuntime = (effect, recover) => {
226
+ const continueWith = (error) => Promise.resolve(invoke(recover(error)));
227
+ if (isAsyncEffect(effect)) return Promise.resolve(effect).then((result) => Result.tryRecoverAsync(result, continueWith));
228
+ return Result.tryRecoverAsync(effect, continueWith);
229
+ };
230
+ const mapProgram = (program, fn) => asProgram(() => mapRuntime(program(), fn));
231
+ const mapErrorProgram = (program, fn) => asProgram(() => mapErrorRuntime(program(), fn));
232
+ const tapProgram = (program, fn) => asProgram(() => tapRuntime(program(), fn));
233
+ const tapErrorProgram = (program, fn) => asProgram(() => tapErrorRuntime(program(), fn));
234
+ function map(first, second) {
235
+ if (second === void 0) return (program) => {
236
+ return mapProgram(program, first);
237
+ };
238
+ return mapProgram(first, second);
239
+ }
240
+ function mapError(first, second) {
241
+ if (second === void 0) return (program) => {
242
+ return mapErrorProgram(program, first);
243
+ };
244
+ return mapErrorProgram(first, second);
245
+ }
246
+ function andThen(first, second) {
247
+ if (second === void 0) return (program) => () => andThenRuntime(program(), first);
248
+ return () => andThenRuntime(first(), second);
249
+ }
250
+ function tap(first, second) {
251
+ if (second === void 0) return (program) => {
252
+ return tapProgram(program, first);
253
+ };
254
+ return tapProgram(first, second);
255
+ }
256
+ function tapError(first, second) {
257
+ if (second === void 0) return (program) => {
258
+ return tapErrorProgram(program, first);
259
+ };
260
+ return tapErrorProgram(first, second);
261
+ }
262
+ function recover(first, second) {
263
+ if (second === void 0) return (program) => () => recoverRuntime(program(), first);
264
+ return () => recoverRuntime(first(), second);
265
+ }
266
+ //#endregion
267
+ //#region src/effect/program-scheduler.ts
268
+ /** Validate the shared bounded-concurrency option before a Program is run. */
269
+ const validateProgramConcurrency = (concurrency) => {
270
+ if (concurrency !== void 0 && (!Number.isFinite(concurrency) || !Number.isInteger(concurrency) || concurrency <= 0)) throw new RangeError("Program.all concurrency must be a positive integer");
271
+ };
272
+ const runWorker = async (length, task, stopOnResultError, state) => {
273
+ while (!state.stopScheduling) {
274
+ const index = state.nextIndex++;
275
+ if (index >= length) return;
276
+ try {
277
+ const result = await task(index);
278
+ state.results[index] = result;
279
+ if (result instanceof Err) state.stopScheduling ||= stopOnResultError;
280
+ } catch (cause) {
281
+ state.defects[index] = { cause };
282
+ state.stopScheduling = true;
283
+ }
284
+ }
285
+ };
286
+ /** Run claimed Programs with a shared FIFO worker pool and no cancellation. */
287
+ const runProgramCollection = async (length, task, options) => {
288
+ const state = {
289
+ nextIndex: 0,
290
+ stopScheduling: false,
291
+ results: Array.from({ length }),
292
+ defects: Array.from({ length })
293
+ };
294
+ const workerCount = Math.min(options.concurrency ?? length, length);
295
+ const workers = Array.from({ length: workerCount }, () => runWorker(length, task, options.stopOnResultError, state));
296
+ await Promise.all(workers);
297
+ return state;
298
+ };
299
+ /** Select the first defect by input index, independent of settlement order. */
300
+ const firstProgramDefect = (defects) => {
301
+ for (const defect of defects) if (defect !== void 0) return defect;
302
+ };
303
+ /** Select the first short-circuiting failure by input index. */
304
+ const firstProgramFailure = (results, defects) => {
305
+ const length = Math.max(results.length, defects.length);
306
+ for (let index = 0; index < length; index++) {
307
+ const defect = defects[index];
308
+ if (defect !== void 0) return {
309
+ kind: "defect",
310
+ cause: defect.cause
311
+ };
312
+ const result = results[index];
313
+ if (result instanceof Err) return {
314
+ kind: "result",
315
+ result
316
+ };
317
+ }
318
+ };
319
+ //#endregion
320
+ //#region src/effect/effect.ts
321
+ const runResultGenerator = Result.gen;
322
+ function gen(body) {
323
+ return runResultGenerator(body);
324
+ }
325
+ function fn(body) {
326
+ const program = () => runResultGenerator(body);
327
+ return program;
328
+ }
329
+ const runShortCircuitingCollection = async (length, task, concurrency) => {
330
+ const outcome = await runProgramCollection(length, task, {
331
+ concurrency,
332
+ stopOnResultError: true
333
+ });
334
+ const failure = firstProgramFailure(outcome.results, outcome.defects);
335
+ if (failure?.kind === "defect") throw failure.cause;
336
+ if (failure?.kind === "result") return failure.result;
337
+ return Result.all(outcome.results);
338
+ };
339
+ const runAllResultsCollection = async (length, task, concurrency) => {
340
+ const outcome = await runProgramCollection(length, task, {
341
+ concurrency,
342
+ stopOnResultError: false
343
+ });
344
+ const defect = firstProgramDefect(outcome.defects);
345
+ if (defect !== void 0) throw defect.cause;
346
+ return Result.ok(outcome.results);
347
+ };
348
+ /** Build a lazy Program collection with optional bounded concurrency. */
349
+ function programAll(programs, options = {}) {
350
+ const concurrency = options.concurrency;
351
+ validateProgramConcurrency(concurrency);
352
+ const program = () => runShortCircuitingCollection(programs.length, (index) => programs[index](), concurrency);
353
+ return program;
354
+ }
355
+ /** Build a lazy Program collection from an input array and Program factory. */
356
+ function programForEach(items, makeProgram, options = {}) {
357
+ const concurrency = options.concurrency;
358
+ validateProgramConcurrency(concurrency);
359
+ const program = () => runShortCircuitingCollection(items.length, (index) => makeProgram(items[index], index)(), concurrency);
360
+ return program;
361
+ }
362
+ /** Build a lazy Program collection that retains every child Result. */
363
+ function programAllResults(programs, options = {}) {
364
+ const concurrency = options.concurrency;
365
+ validateProgramConcurrency(concurrency);
366
+ const program = () => runAllResultsCollection(programs.length, (index) => programs[index](), concurrency);
367
+ return program;
368
+ }
369
+ /** Value-level namespace for lazy Program combinators. */
370
+ const Program = {
371
+ all: programAll,
372
+ forEach: programForEach,
373
+ allResults: programAllResults,
374
+ map,
375
+ mapError,
376
+ andThen,
377
+ tap,
378
+ tapError,
379
+ recover
380
+ };
381
+ /**
382
+ * Acquire a resource in the current Scope and register its release callback.
383
+ *
384
+ * Acquisition failures are represented in the Effect Result error channel;
385
+ * release failures remain owned by Scope cleanup. The release callback
386
+ * receives the final outcome chosen by the enclosing execution boundary.
387
+ *
388
+ * @example
389
+ * ```ts
390
+ * const connection = yield* Effect.acquireRelease(
391
+ * () => pool.connect(),
392
+ * (connection, outcome) => connection.close(outcome)
393
+ * )
394
+ * ```
395
+ */
396
+ function acquireRelease(acquire, release) {
397
+ const scope = Scope.current();
398
+ return Result.await(Result.tryPromise(() => scope.acquire(acquire, release)));
399
+ }
400
+ var AcquireReleaseResultFailure = class {
401
+ result;
402
+ constructor(result) {
403
+ this.result = result;
404
+ }
405
+ };
406
+ /**
407
+ * Acquire a Result-valued resource and register only successful acquisitions.
408
+ *
409
+ * Typed acquisition failures remain unchanged in the Effect error channel;
410
+ * unexpected acquisition and registration failures are normalized by
411
+ * `better-result`. Release failures remain Scope cleanup failures.
412
+ */
413
+ function acquireReleaseResult(acquire, release) {
414
+ const scope = Scope.current();
415
+ const registered = Result.tryPromise(async () => {
416
+ try {
417
+ const resource = await scope.acquire(async () => {
418
+ const result = await acquire();
419
+ if (Result.isError(result)) throw new AcquireReleaseResultFailure(result);
420
+ return result.value;
421
+ }, release);
422
+ return Result.ok(resource);
423
+ } catch (cause) {
424
+ if (cause instanceof AcquireReleaseResultFailure) return cause.result;
425
+ throw cause;
426
+ }
427
+ });
428
+ return Result.await(registered.then((result) => result.andThen((acquired) => acquired)));
429
+ }
430
+ /**
431
+ * Lazily acquire and register a disposable resource in the current Scope.
432
+ *
433
+ * Disposal is delegated to `Scope.add`, including protocol preference,
434
+ * validation, race-safe registration, and cleanup error handling.
435
+ */
436
+ function acquireDisposable(acquire) {
437
+ const scope = Scope.current();
438
+ return Result.await(Result.tryPromise(async () => scope.add(await acquire())));
439
+ }
440
+ /**
441
+ * Register an already-acquired disposable resource in the current Scope.
442
+ *
443
+ * The resource is not acquired by this helper. Registration failures are
444
+ * represented in the Effect Result error channel; disposal failures remain
445
+ * owned by Scope cleanup.
446
+ *
447
+ * @example
448
+ * ```ts
449
+ * const file = yield* Effect.add(await openFile('notes.txt'))
450
+ * ```
451
+ */
452
+ function add(resource) {
453
+ const scope = Scope.current();
454
+ return Result.await(Result.tryPromise(() => scope.add(resource)));
455
+ }
456
+ const Effect = {
457
+ /** Compose a generator-based Effect program. */
458
+ gen,
459
+ /** Build a lazy Program from a generator. */
460
+ fn,
461
+ /** Acquire and register a resource in the current Scope. */
462
+ acquireRelease,
463
+ /** Acquire a Result-valued resource and register successful acquisitions. */
464
+ acquireReleaseResult,
465
+ /** Acquire and register a disposable resource in the current Scope. */
466
+ acquireDisposable,
467
+ /** Register an already-acquired disposable in the current Scope. */
468
+ add,
469
+ /** Map a successful Effect result. */
470
+ map: map$1,
471
+ /** Map an Effect error. */
472
+ mapError: mapError$1,
473
+ /** Chain a synchronous Effect result. */
474
+ andThen: andThen$1,
475
+ /** Chain an asynchronous Effect result. */
476
+ andThenAsync,
477
+ /** Observe successful values without changing the Result. */
478
+ tap: tap$1,
479
+ /** Observe successful values asynchronously without changing the Result. */
480
+ tapAsync,
481
+ /** Observe error values without changing the Result. */
482
+ tapError: tapError$1,
483
+ /** Observe error values asynchronously without changing the Result. */
484
+ tapErrorAsync,
485
+ /** Observe the active Result branch without changing the Result. */
486
+ tapBoth,
487
+ /** Observe the active Result branch asynchronously without changing the Result. */
488
+ tapBothAsync,
489
+ /** Match every tagged error variant and map it to a new error value. */
490
+ matchError: matchError$1,
491
+ /** Match selected tagged errors and retain unhandled variants. */
492
+ matchErrorPartial: matchErrorPartial$1,
493
+ /** Recover an error with another Effect. */
494
+ recover: recover$1,
495
+ /** Recover an error asynchronously with another Effect. */
496
+ recoverAsync,
497
+ /** Remove one nested Effect layer. */
498
+ flatten,
499
+ /** Replace a successful value. */
500
+ as,
501
+ /** Replace a successful value with void. */
502
+ asVoid,
503
+ /** Match either Result branch. */
504
+ match,
505
+ /** Collect Effects in input order. */
506
+ all,
507
+ /** Zip two Effects in input order. */
508
+ zip
509
+ };
510
+ //#endregion
511
+ export { Program as n, Effect as t };
512
+
513
+ //# sourceMappingURL=effect-2ZcGZI8A.mjs.map