@nlozgachev/pipelined 0.36.0 → 0.37.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.
@@ -304,6 +304,28 @@ declare namespace Result {
304
304
  * ```
305
305
  */
306
306
  const ap: <E, A>(arg: Result<E, A>) => <B>(data: Result<E, (a: A) => B>) => Result<E, B>;
307
+ /**
308
+ * Converts a Result value into an object containing a single property.
309
+ * Initiates the pipeline accumulator record.
310
+ *
311
+ * @example
312
+ * ```ts
313
+ * pipe(Result.ok(42), Result.bindTo("value")); // Ok({ value: 42 })
314
+ * ```
315
+ */
316
+ const bindTo: <K extends string>(key: K) => <E, A>(data: Result<E, A>) => Result<E, { [P in K]: A; }>;
317
+ /**
318
+ * Evaluates a new Result using the current accumulator and attaches the output to a new key.
319
+ *
320
+ * @example
321
+ * ```ts
322
+ * pipe(
323
+ * Result.ok({ a: 1 }),
324
+ * Result.bind("b", ({ a }) => Result.ok(a + 1))
325
+ * ); // Ok({ a: 1, b: 2 })
326
+ * ```
327
+ */
328
+ const bind: <K extends string, E, A, B>(key: K, f: (a: A) => Result<E, B>) => (data: Result<E, A>) => Result<E, A & { [P in K]: B; }>;
307
329
  }
308
330
 
309
331
  type Some<A> = WithKind<"Some"> & WithValue<A>;
@@ -519,6 +541,28 @@ declare namespace Maybe {
519
541
  * ```
520
542
  */
521
543
  const ap: <A>(arg: Maybe<A>) => <B>(data: Maybe<(a: A) => B>) => Maybe<B>;
544
+ /**
545
+ * Converts a Maybe value into an object containing a single property.
546
+ * Initiates the pipeline accumulator record.
547
+ *
548
+ * @example
549
+ * ```ts
550
+ * pipe(Maybe.some(42), Maybe.bindTo("value")); // Some({ value: 42 })
551
+ * ```
552
+ */
553
+ const bindTo: <K extends string>(key: K) => <A>(data: Maybe<A>) => Maybe<{ [P in K]: A; }>;
554
+ /**
555
+ * Evaluates a new Maybe using the current accumulator and attaches the output to a new key.
556
+ *
557
+ * @example
558
+ * ```ts
559
+ * pipe(
560
+ * Maybe.some({ a: 1 }),
561
+ * Maybe.bind("b", ({ a }) => Maybe.some(a + 1))
562
+ * ); // Some({ a: 1, b: 2 })
563
+ * ```
564
+ */
565
+ const bind: <K extends string, A, B>(key: K, f: (a: A) => Maybe<B>) => (data: Maybe<A>) => Maybe<A & { [P in K]: B; }>;
522
566
  }
523
567
 
524
568
  declare const _deferred: unique symbol;
@@ -1024,6 +1068,28 @@ declare namespace Task {
1024
1068
  * ```
1025
1069
  */
1026
1070
  const run: (signal?: AbortSignal) => <A>(task: Task<A>) => Promise<A>;
1071
+ /**
1072
+ * Converts a Task value into an object containing a single property.
1073
+ * Initiates the pipeline accumulator record.
1074
+ *
1075
+ * @example
1076
+ * ```ts
1077
+ * pipe(Task.resolve(42), Task.bindTo("value")); // Task({ value: 42 })
1078
+ * ```
1079
+ */
1080
+ const bindTo: <K extends string>(key: K) => <A>(data: Task<A>) => Task<{ [P in K]: A; }>;
1081
+ /**
1082
+ * Evaluates a new Task using the current accumulator and attaches the output to a new key.
1083
+ *
1084
+ * @example
1085
+ * ```ts
1086
+ * pipe(
1087
+ * Task.resolve({ a: 1 }),
1088
+ * Task.bind("b", ({ a }) => Task.resolve(a + 1))
1089
+ * ); // Task({ a: 1, b: 2 })
1090
+ * ```
1091
+ */
1092
+ const bind: <K extends string, A, B>(key: K, f: (a: A) => Task<B>) => (data: Task<A>) => Task<A & { [P in K]: B; }>;
1027
1093
  }
1028
1094
 
1029
- export { Deferred as D, Equality as E, Maybe as M, type None as N, type Ok as O, Result as R, type Some as S, Task as T, type WithValue as W, type Err as a, Ordering as b, type WithLog as c, type WithKind as d, type WithError as e, type RetryOptions as f, type TimeoutOptions as g, type WithTimeout as h, type WithMinInterval as i, type WithCooldown as j, type WithConcurrency as k, type WithSize as l, type WithDuration as m, type WithN as n, type WithErrors as o, type WithFirst as p, type WithSecond as q };
1095
+ export { Deferred as D, Equality as E, Maybe as M, type None as N, type Ok as O, Result as R, type Some as S, Task as T, type WithConcurrency as W, type Err as a, Ordering as b, type RetryOptions as c, type TimeoutOptions as d, type WithCooldown as e, type WithDuration as f, type WithError as g, type WithErrors as h, type WithFirst as i, type WithKind as j, type WithLog as k, type WithMinInterval as l, type WithN as m, type WithSecond as n, type WithSize as o, type WithTimeout as p, type WithValue as q };
@@ -304,6 +304,28 @@ declare namespace Result {
304
304
  * ```
305
305
  */
306
306
  const ap: <E, A>(arg: Result<E, A>) => <B>(data: Result<E, (a: A) => B>) => Result<E, B>;
307
+ /**
308
+ * Converts a Result value into an object containing a single property.
309
+ * Initiates the pipeline accumulator record.
310
+ *
311
+ * @example
312
+ * ```ts
313
+ * pipe(Result.ok(42), Result.bindTo("value")); // Ok({ value: 42 })
314
+ * ```
315
+ */
316
+ const bindTo: <K extends string>(key: K) => <E, A>(data: Result<E, A>) => Result<E, { [P in K]: A; }>;
317
+ /**
318
+ * Evaluates a new Result using the current accumulator and attaches the output to a new key.
319
+ *
320
+ * @example
321
+ * ```ts
322
+ * pipe(
323
+ * Result.ok({ a: 1 }),
324
+ * Result.bind("b", ({ a }) => Result.ok(a + 1))
325
+ * ); // Ok({ a: 1, b: 2 })
326
+ * ```
327
+ */
328
+ const bind: <K extends string, E, A, B>(key: K, f: (a: A) => Result<E, B>) => (data: Result<E, A>) => Result<E, A & { [P in K]: B; }>;
307
329
  }
308
330
 
309
331
  type Some<A> = WithKind<"Some"> & WithValue<A>;
@@ -519,6 +541,28 @@ declare namespace Maybe {
519
541
  * ```
520
542
  */
521
543
  const ap: <A>(arg: Maybe<A>) => <B>(data: Maybe<(a: A) => B>) => Maybe<B>;
544
+ /**
545
+ * Converts a Maybe value into an object containing a single property.
546
+ * Initiates the pipeline accumulator record.
547
+ *
548
+ * @example
549
+ * ```ts
550
+ * pipe(Maybe.some(42), Maybe.bindTo("value")); // Some({ value: 42 })
551
+ * ```
552
+ */
553
+ const bindTo: <K extends string>(key: K) => <A>(data: Maybe<A>) => Maybe<{ [P in K]: A; }>;
554
+ /**
555
+ * Evaluates a new Maybe using the current accumulator and attaches the output to a new key.
556
+ *
557
+ * @example
558
+ * ```ts
559
+ * pipe(
560
+ * Maybe.some({ a: 1 }),
561
+ * Maybe.bind("b", ({ a }) => Maybe.some(a + 1))
562
+ * ); // Some({ a: 1, b: 2 })
563
+ * ```
564
+ */
565
+ const bind: <K extends string, A, B>(key: K, f: (a: A) => Maybe<B>) => (data: Maybe<A>) => Maybe<A & { [P in K]: B; }>;
522
566
  }
523
567
 
524
568
  declare const _deferred: unique symbol;
@@ -1024,6 +1068,28 @@ declare namespace Task {
1024
1068
  * ```
1025
1069
  */
1026
1070
  const run: (signal?: AbortSignal) => <A>(task: Task<A>) => Promise<A>;
1071
+ /**
1072
+ * Converts a Task value into an object containing a single property.
1073
+ * Initiates the pipeline accumulator record.
1074
+ *
1075
+ * @example
1076
+ * ```ts
1077
+ * pipe(Task.resolve(42), Task.bindTo("value")); // Task({ value: 42 })
1078
+ * ```
1079
+ */
1080
+ const bindTo: <K extends string>(key: K) => <A>(data: Task<A>) => Task<{ [P in K]: A; }>;
1081
+ /**
1082
+ * Evaluates a new Task using the current accumulator and attaches the output to a new key.
1083
+ *
1084
+ * @example
1085
+ * ```ts
1086
+ * pipe(
1087
+ * Task.resolve({ a: 1 }),
1088
+ * Task.bind("b", ({ a }) => Task.resolve(a + 1))
1089
+ * ); // Task({ a: 1, b: 2 })
1090
+ * ```
1091
+ */
1092
+ const bind: <K extends string, A, B>(key: K, f: (a: A) => Task<B>) => (data: Task<A>) => Task<A & { [P in K]: B; }>;
1027
1093
  }
1028
1094
 
1029
- export { Deferred as D, Equality as E, Maybe as M, type None as N, type Ok as O, Result as R, type Some as S, Task as T, type WithValue as W, type Err as a, Ordering as b, type WithLog as c, type WithKind as d, type WithError as e, type RetryOptions as f, type TimeoutOptions as g, type WithTimeout as h, type WithMinInterval as i, type WithCooldown as j, type WithConcurrency as k, type WithSize as l, type WithDuration as m, type WithN as n, type WithErrors as o, type WithFirst as p, type WithSecond as q };
1095
+ export { Deferred as D, Equality as E, Maybe as M, type None as N, type Ok as O, Result as R, type Some as S, Task as T, type WithConcurrency as W, type Err as a, Ordering as b, type RetryOptions as c, type TimeoutOptions as d, type WithCooldown as e, type WithDuration as f, type WithError as g, type WithErrors as h, type WithFirst as i, type WithKind as j, type WithLog as k, type WithMinInterval as l, type WithN as m, type WithSecond as n, type WithSize as o, type WithTimeout as p, type WithValue as q };
@@ -3,7 +3,7 @@ import {
3
3
  Maybe,
4
4
  Result,
5
5
  Task
6
- } from "./chunk-DLBHVYII.mjs";
6
+ } from "./chunk-PUMSVZB4.mjs";
7
7
  import {
8
8
  isNonEmptyList
9
9
  } from "./chunk-DBIC62UV.mjs";
@@ -30,6 +30,10 @@ var Maybe;
30
30
  Maybe2.filter = (predicate) => (data) => (0, Maybe2.isSome)(data) ? predicate(data.value) ? data : (0, Maybe2.none)() : data;
31
31
  Maybe2.recover = (fallback) => (data) => (0, Maybe2.isSome)(data) ? data : fallback();
32
32
  Maybe2.ap = (arg) => (data) => (0, Maybe2.isSome)(data) && (0, Maybe2.isSome)(arg) ? (0, Maybe2.some)(data.value(arg.value)) : (0, Maybe2.none)();
33
+ Maybe2.bindTo = (key) => (data) => (0, Maybe2.map)((a) => ({ [key]: a }))(data);
34
+ Maybe2.bind = (key, f) => (data) => (0, Maybe2.chain)(
35
+ (a) => (0, Maybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
36
+ )(data);
33
37
  })(Maybe || (Maybe = {}));
34
38
 
35
39
  // src/Core/Result.ts
@@ -78,6 +82,10 @@ var Result;
78
82
  Result2.recoverUnless = (isBlocked, fallback) => (data) => (0, Result2.isErr)(data) && !isBlocked(data.error) ? fallback() : data;
79
83
  Result2.toMaybe = (data) => (0, Result2.isOk)(data) ? Maybe.some(data.value) : Maybe.none();
80
84
  Result2.ap = (arg) => (data) => (0, Result2.isOk)(data) && (0, Result2.isOk)(arg) ? (0, Result2.ok)(data.value(arg.value)) : (0, Result2.isErr)(data) ? data : arg;
85
+ Result2.bindTo = (key) => (data) => (0, Result2.map)((a) => ({ [key]: a }))(data);
86
+ Result2.bind = (key, f) => (data) => (0, Result2.chain)(
87
+ (a) => (0, Result2.map)((b) => ({ ...a, [key]: b }))(f(a))
88
+ )(data);
81
89
  })(Result || (Result = {}));
82
90
 
83
91
  // src/Core/Deferred.ts
@@ -312,6 +320,10 @@ var Task;
312
320
  return { task, abort };
313
321
  };
314
322
  Task2.run = (signal) => (task) => Deferred.toPromise(task(signal));
323
+ Task2.bindTo = (key) => (data) => (0, Task2.map)((a) => ({ [key]: a }))(data);
324
+ Task2.bind = (key, f) => (data) => (0, Task2.chain)(
325
+ (a) => (0, Task2.map)((b) => ({ ...a, [key]: b }))(f(a))
326
+ )(data);
315
327
  })(Task || (Task = {}));
316
328
 
317
329
  export {
@@ -3,7 +3,7 @@ import {
3
3
  Maybe,
4
4
  Result,
5
5
  Task
6
- } from "./chunk-DLBHVYII.mjs";
6
+ } from "./chunk-PUMSVZB4.mjs";
7
7
  import {
8
8
  Duration
9
9
  } from "./chunk-VWVPHDZO.mjs";
@@ -103,6 +103,10 @@ var Logged;
103
103
  return data;
104
104
  };
105
105
  Logged2.run = (data) => [data.value, data.log];
106
+ Logged2.bindTo = (key) => (data) => (0, Logged2.map)((a) => ({ [key]: a }))(data);
107
+ Logged2.bind = (key, f) => (data) => (0, Logged2.chain)(
108
+ (a) => (0, Logged2.map)((b) => ({ ...a, [key]: b }))(f(a))
109
+ )(data);
106
110
  })(Logged || (Logged = {}));
107
111
 
108
112
  // src/internal/Op.util.ts
@@ -1277,6 +1281,10 @@ var Reader;
1277
1281
  };
1278
1282
  Reader2.local = (f) => (data) => (env) => data(f(env));
1279
1283
  Reader2.run = (env) => (data) => data(env);
1284
+ Reader2.bindTo = (key) => (data) => (0, Reader2.map)((a) => ({ [key]: a }))(data);
1285
+ Reader2.bind = (key, f) => (data) => (0, Reader2.chain)(
1286
+ (a) => (0, Reader2.map)((b) => ({ ...a, [key]: b }))(f(a))
1287
+ )(data);
1280
1288
  })(Reader || (Reader = {}));
1281
1289
 
1282
1290
  // src/Core/Refinement.ts
@@ -1449,6 +1457,10 @@ var State;
1449
1457
  State2.run = (initialState) => (st) => st(initialState);
1450
1458
  State2.evaluate = (initialState) => (st) => st(initialState)[0];
1451
1459
  State2.execute = (initialState) => (st) => st(initialState)[1];
1460
+ State2.bindTo = (key) => (data) => (0, State2.map)((a) => ({ [key]: a }))(data);
1461
+ State2.bind = (key, f) => (data) => (0, State2.chain)(
1462
+ (a) => (0, State2.map)((b) => ({ ...a, [key]: b }))(f(a))
1463
+ )(data);
1452
1464
  })(State || (State = {}));
1453
1465
 
1454
1466
  // src/Core/TaskMaybe.ts
@@ -1474,6 +1486,10 @@ var TaskMaybe;
1474
1486
  TaskMaybe2.tap = (f) => (data) => Task.map(Maybe.tap(f))(data);
1475
1487
  TaskMaybe2.filter = (predicate) => (data) => Task.map(Maybe.filter(predicate))(data);
1476
1488
  TaskMaybe2.toTaskResult = (onNone) => (data) => Task.map(Maybe.toResult(onNone))(data);
1489
+ TaskMaybe2.bindTo = (key) => (data) => (0, TaskMaybe2.map)((a) => ({ [key]: a }))(data);
1490
+ TaskMaybe2.bind = (key, f) => (data) => (0, TaskMaybe2.chain)(
1491
+ (a) => (0, TaskMaybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
1492
+ )(data);
1477
1493
  })(TaskMaybe || (TaskMaybe = {}));
1478
1494
 
1479
1495
  // src/Core/TaskResult.ts
@@ -1505,6 +1521,10 @@ var TaskResult;
1505
1521
  )
1506
1522
  );
1507
1523
  TaskResult2.run = (signal) => (task) => Deferred.toPromise(task(signal));
1524
+ TaskResult2.bindTo = (key) => (data) => (0, TaskResult2.map)((a) => ({ [key]: a }))(data);
1525
+ TaskResult2.bind = (key, f) => (data) => (0, TaskResult2.chain)(
1526
+ (a) => (0, TaskResult2.map)((b) => ({ ...a, [key]: b }))(f(a))
1527
+ )(data);
1508
1528
  })(TaskResult || (TaskResult = {}));
1509
1529
 
1510
1530
  // src/Core/Validation.ts
package/dist/core.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Maybe, W as WithValue, c as WithLog, D as Deferred, R as Result, d as WithKind, e as WithError, f as RetryOptions, g as TimeoutOptions, h as WithTimeout, i as WithMinInterval, j as WithCooldown, k as WithConcurrency, l as WithSize, m as WithDuration, n as WithN, T as Task, o as WithErrors, p as WithFirst, q as WithSecond } from './Task-DXsuurnc.mjs';
2
- export { E as Equality, a as Err, N as None, O as Ok, b as Ordering, S as Some } from './Task-DXsuurnc.mjs';
1
+ import { M as Maybe, q as WithValue, k as WithLog, D as Deferred, R as Result, j as WithKind, g as WithError, c as RetryOptions, d as TimeoutOptions, p as WithTimeout, l as WithMinInterval, e as WithCooldown, W as WithConcurrency, o as WithSize, f as WithDuration, m as WithN, T as Task, h as WithErrors, i as WithFirst, n as WithSecond } from './Task-fn1n--6H.mjs';
2
+ export { E as Equality, a as Err, N as None, O as Ok, b as Ordering, S as Some } from './Task-fn1n--6H.mjs';
3
3
  import { Duration, NonEmptyList } from './types.mjs';
4
4
 
5
5
  /**
@@ -561,6 +561,27 @@ declare namespace Logged {
561
561
  * ```
562
562
  */
563
563
  const run: <W, A>(data: Logged<W, A>) => readonly [A, ReadonlyArray<W>];
564
+ /**
565
+ * Lifts a Logged value into an accumulator object.
566
+ *
567
+ * @example
568
+ * ```ts
569
+ * pipe(Logged.make<string, number>(42), Logged.bindTo("value")); // Logged({ value: 42 })
570
+ * ```
571
+ */
572
+ const bindTo: <K extends string>(key: K) => <W, A>(data: Logged<W, A>) => Logged<W, { [P in K]: A; }>;
573
+ /**
574
+ * Evaluates a new Logged using the current accumulator and attaches the output to a new key.
575
+ *
576
+ * @example
577
+ * ```ts
578
+ * pipe(
579
+ * Logged.make<string, { a: number }>({ a: 1 }),
580
+ * Logged.bind("b", ({ a }) => Logged.make<string, number>(a + 1))
581
+ * ); // Logged({ value: { a: 1, b: 2 } })
582
+ * ```
583
+ */
584
+ const bind: <K extends string, W, A, B>(key: K, f: (a: A) => Logged<W, B>) => (data: Logged<W, A>) => Logged<W, A & { [P in K]: B; }>;
564
585
  }
565
586
 
566
587
  type MaybeRetry<E, O> = O extends {
@@ -1715,6 +1736,27 @@ declare namespace Reader {
1715
1736
  * ```
1716
1737
  */
1717
1738
  const run: <R>(env: R) => <A>(data: Reader<R, A>) => A;
1739
+ /**
1740
+ * Lifts a Reader value into an accumulator object.
1741
+ *
1742
+ * @example
1743
+ * ```ts
1744
+ * pipe(Reader.resolve(42), Reader.bindTo("value")); // Reader({ value: 42 })
1745
+ * ```
1746
+ */
1747
+ const bindTo: <K extends string>(key: K) => <R, A>(data: Reader<R, A>) => Reader<R, { [P in K]: A; }>;
1748
+ /**
1749
+ * Evaluates a new Reader using the current accumulator and attaches the output to a new key.
1750
+ *
1751
+ * @example
1752
+ * ```ts
1753
+ * pipe(
1754
+ * Reader.resolve({ a: 1 }),
1755
+ * Reader.bind("b", ({ a }) => Reader.resolve(a + 1))
1756
+ * ); // Reader({ a: 1, b: 2 })
1757
+ * ```
1758
+ */
1759
+ const bind: <K extends string, R, A, B>(key: K, f: (a: A) => Reader<R, B>) => (data: Reader<R, A>) => Reader<R, A & { [P in K]: B; }>;
1718
1760
  }
1719
1761
 
1720
1762
  type NotAsked = WithKind<"NotAsked">;
@@ -2092,6 +2134,28 @@ declare namespace TaskResult {
2092
2134
  * ```
2093
2135
  */
2094
2136
  const run: (signal?: AbortSignal) => <E, A>(task: TaskResult<E, A>) => Promise<Result<E, A>>;
2137
+ /**
2138
+ * Converts a TaskResult value into an object containing a single property.
2139
+ * Initiates the pipeline accumulator record.
2140
+ *
2141
+ * @example
2142
+ * ```ts
2143
+ * pipe(TaskResult.ok(42), TaskResult.bindTo("value")); // TaskResult({ value: 42 })
2144
+ * ```
2145
+ */
2146
+ const bindTo: <K extends string>(key: K) => <E, A>(data: TaskResult<E, A>) => TaskResult<E, { [P in K]: A; }>;
2147
+ /**
2148
+ * Evaluates a new TaskResult using the current accumulator and attaches the output to a new key.
2149
+ *
2150
+ * @example
2151
+ * ```ts
2152
+ * pipe(
2153
+ * TaskResult.ok({ a: 1 }),
2154
+ * TaskResult.bind("b", ({ a }) => TaskResult.ok(a + 1))
2155
+ * ); // TaskResult({ a: 1, b: 2 })
2156
+ * ```
2157
+ */
2158
+ const bind: <K extends string, E, A, B>(key: K, f: (a: A) => TaskResult<E, B>) => (data: TaskResult<E, A>) => TaskResult<E, A & { [P in K]: B; }>;
2095
2159
  }
2096
2160
 
2097
2161
  /**
@@ -2379,6 +2443,27 @@ declare namespace State {
2379
2443
  * ```
2380
2444
  */
2381
2445
  const execute: <S>(initialState: S) => <A>(st: State<S, A>) => S;
2446
+ /**
2447
+ * Lifts a State value into an accumulator object.
2448
+ *
2449
+ * @example
2450
+ * ```ts
2451
+ * pipe(State.resolve(42), State.bindTo("value")); // State({ value: 42 })
2452
+ * ```
2453
+ */
2454
+ const bindTo: <K extends string>(key: K) => <S, A>(data: State<S, A>) => State<S, { [P in K]: A; }>;
2455
+ /**
2456
+ * Evaluates a new State using the current accumulator and attaches the output to a new key.
2457
+ *
2458
+ * @example
2459
+ * ```ts
2460
+ * pipe(
2461
+ * State.resolve({ a: 1 }),
2462
+ * State.bind("b", ({ a }) => State.resolve(a + 1))
2463
+ * ); // State({ a: 1, b: 2 })
2464
+ * ```
2465
+ */
2466
+ const bind: <K extends string, S, A, B>(key: K, f: (a: A) => State<S, B>) => (data: State<S, A>) => State<S, A & { [P in K]: B; }>;
2382
2467
  }
2383
2468
 
2384
2469
  /**
@@ -2508,6 +2593,27 @@ declare namespace TaskMaybe {
2508
2593
  * ```
2509
2594
  */
2510
2595
  const toTaskResult: <E>(onNone: () => E) => <A>(data: TaskMaybe<A>) => TaskResult<E, A>;
2596
+ /**
2597
+ * Lifts a TaskMaybe value into an accumulator object.
2598
+ *
2599
+ * @example
2600
+ * ```ts
2601
+ * pipe(TaskMaybe.some(42), TaskMaybe.bindTo("value")); // TaskMaybe({ value: 42 })
2602
+ * ```
2603
+ */
2604
+ const bindTo: <K extends string>(key: K) => <A>(data: TaskMaybe<A>) => TaskMaybe<{ [P in K]: A; }>;
2605
+ /**
2606
+ * Evaluates a new TaskMaybe using the current accumulator and attaches the output to a new key.
2607
+ *
2608
+ * @example
2609
+ * ```ts
2610
+ * pipe(
2611
+ * TaskMaybe.some({ a: 1 }),
2612
+ * TaskMaybe.bind("b", ({ a }) => TaskMaybe.some(a + 1))
2613
+ * ); // TaskMaybe({ a: 1, b: 2 })
2614
+ * ```
2615
+ */
2616
+ const bind: <K extends string, A, B>(key: K, f: (a: A) => TaskMaybe<B>) => (data: TaskMaybe<A>) => TaskMaybe<A & { [P in K]: B; }>;
2511
2617
  }
2512
2618
 
2513
2619
  type Passed<A> = WithKind<"Passed"> & WithValue<A>;
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Maybe, W as WithValue, c as WithLog, D as Deferred, R as Result, d as WithKind, e as WithError, f as RetryOptions, g as TimeoutOptions, h as WithTimeout, i as WithMinInterval, j as WithCooldown, k as WithConcurrency, l as WithSize, m as WithDuration, n as WithN, T as Task, o as WithErrors, p as WithFirst, q as WithSecond } from './Task-zAY4kSVB.js';
2
- export { E as Equality, a as Err, N as None, O as Ok, b as Ordering, S as Some } from './Task-zAY4kSVB.js';
1
+ import { M as Maybe, q as WithValue, k as WithLog, D as Deferred, R as Result, j as WithKind, g as WithError, c as RetryOptions, d as TimeoutOptions, p as WithTimeout, l as WithMinInterval, e as WithCooldown, W as WithConcurrency, o as WithSize, f as WithDuration, m as WithN, T as Task, h as WithErrors, i as WithFirst, n as WithSecond } from './Task-DIgwvoIb.js';
2
+ export { E as Equality, a as Err, N as None, O as Ok, b as Ordering, S as Some } from './Task-DIgwvoIb.js';
3
3
  import { Duration, NonEmptyList } from './types.js';
4
4
 
5
5
  /**
@@ -561,6 +561,27 @@ declare namespace Logged {
561
561
  * ```
562
562
  */
563
563
  const run: <W, A>(data: Logged<W, A>) => readonly [A, ReadonlyArray<W>];
564
+ /**
565
+ * Lifts a Logged value into an accumulator object.
566
+ *
567
+ * @example
568
+ * ```ts
569
+ * pipe(Logged.make<string, number>(42), Logged.bindTo("value")); // Logged({ value: 42 })
570
+ * ```
571
+ */
572
+ const bindTo: <K extends string>(key: K) => <W, A>(data: Logged<W, A>) => Logged<W, { [P in K]: A; }>;
573
+ /**
574
+ * Evaluates a new Logged using the current accumulator and attaches the output to a new key.
575
+ *
576
+ * @example
577
+ * ```ts
578
+ * pipe(
579
+ * Logged.make<string, { a: number }>({ a: 1 }),
580
+ * Logged.bind("b", ({ a }) => Logged.make<string, number>(a + 1))
581
+ * ); // Logged({ value: { a: 1, b: 2 } })
582
+ * ```
583
+ */
584
+ const bind: <K extends string, W, A, B>(key: K, f: (a: A) => Logged<W, B>) => (data: Logged<W, A>) => Logged<W, A & { [P in K]: B; }>;
564
585
  }
565
586
 
566
587
  type MaybeRetry<E, O> = O extends {
@@ -1715,6 +1736,27 @@ declare namespace Reader {
1715
1736
  * ```
1716
1737
  */
1717
1738
  const run: <R>(env: R) => <A>(data: Reader<R, A>) => A;
1739
+ /**
1740
+ * Lifts a Reader value into an accumulator object.
1741
+ *
1742
+ * @example
1743
+ * ```ts
1744
+ * pipe(Reader.resolve(42), Reader.bindTo("value")); // Reader({ value: 42 })
1745
+ * ```
1746
+ */
1747
+ const bindTo: <K extends string>(key: K) => <R, A>(data: Reader<R, A>) => Reader<R, { [P in K]: A; }>;
1748
+ /**
1749
+ * Evaluates a new Reader using the current accumulator and attaches the output to a new key.
1750
+ *
1751
+ * @example
1752
+ * ```ts
1753
+ * pipe(
1754
+ * Reader.resolve({ a: 1 }),
1755
+ * Reader.bind("b", ({ a }) => Reader.resolve(a + 1))
1756
+ * ); // Reader({ a: 1, b: 2 })
1757
+ * ```
1758
+ */
1759
+ const bind: <K extends string, R, A, B>(key: K, f: (a: A) => Reader<R, B>) => (data: Reader<R, A>) => Reader<R, A & { [P in K]: B; }>;
1718
1760
  }
1719
1761
 
1720
1762
  type NotAsked = WithKind<"NotAsked">;
@@ -2092,6 +2134,28 @@ declare namespace TaskResult {
2092
2134
  * ```
2093
2135
  */
2094
2136
  const run: (signal?: AbortSignal) => <E, A>(task: TaskResult<E, A>) => Promise<Result<E, A>>;
2137
+ /**
2138
+ * Converts a TaskResult value into an object containing a single property.
2139
+ * Initiates the pipeline accumulator record.
2140
+ *
2141
+ * @example
2142
+ * ```ts
2143
+ * pipe(TaskResult.ok(42), TaskResult.bindTo("value")); // TaskResult({ value: 42 })
2144
+ * ```
2145
+ */
2146
+ const bindTo: <K extends string>(key: K) => <E, A>(data: TaskResult<E, A>) => TaskResult<E, { [P in K]: A; }>;
2147
+ /**
2148
+ * Evaluates a new TaskResult using the current accumulator and attaches the output to a new key.
2149
+ *
2150
+ * @example
2151
+ * ```ts
2152
+ * pipe(
2153
+ * TaskResult.ok({ a: 1 }),
2154
+ * TaskResult.bind("b", ({ a }) => TaskResult.ok(a + 1))
2155
+ * ); // TaskResult({ a: 1, b: 2 })
2156
+ * ```
2157
+ */
2158
+ const bind: <K extends string, E, A, B>(key: K, f: (a: A) => TaskResult<E, B>) => (data: TaskResult<E, A>) => TaskResult<E, A & { [P in K]: B; }>;
2095
2159
  }
2096
2160
 
2097
2161
  /**
@@ -2379,6 +2443,27 @@ declare namespace State {
2379
2443
  * ```
2380
2444
  */
2381
2445
  const execute: <S>(initialState: S) => <A>(st: State<S, A>) => S;
2446
+ /**
2447
+ * Lifts a State value into an accumulator object.
2448
+ *
2449
+ * @example
2450
+ * ```ts
2451
+ * pipe(State.resolve(42), State.bindTo("value")); // State({ value: 42 })
2452
+ * ```
2453
+ */
2454
+ const bindTo: <K extends string>(key: K) => <S, A>(data: State<S, A>) => State<S, { [P in K]: A; }>;
2455
+ /**
2456
+ * Evaluates a new State using the current accumulator and attaches the output to a new key.
2457
+ *
2458
+ * @example
2459
+ * ```ts
2460
+ * pipe(
2461
+ * State.resolve({ a: 1 }),
2462
+ * State.bind("b", ({ a }) => State.resolve(a + 1))
2463
+ * ); // State({ a: 1, b: 2 })
2464
+ * ```
2465
+ */
2466
+ const bind: <K extends string, S, A, B>(key: K, f: (a: A) => State<S, B>) => (data: State<S, A>) => State<S, A & { [P in K]: B; }>;
2382
2467
  }
2383
2468
 
2384
2469
  /**
@@ -2508,6 +2593,27 @@ declare namespace TaskMaybe {
2508
2593
  * ```
2509
2594
  */
2510
2595
  const toTaskResult: <E>(onNone: () => E) => <A>(data: TaskMaybe<A>) => TaskResult<E, A>;
2596
+ /**
2597
+ * Lifts a TaskMaybe value into an accumulator object.
2598
+ *
2599
+ * @example
2600
+ * ```ts
2601
+ * pipe(TaskMaybe.some(42), TaskMaybe.bindTo("value")); // TaskMaybe({ value: 42 })
2602
+ * ```
2603
+ */
2604
+ const bindTo: <K extends string>(key: K) => <A>(data: TaskMaybe<A>) => TaskMaybe<{ [P in K]: A; }>;
2605
+ /**
2606
+ * Evaluates a new TaskMaybe using the current accumulator and attaches the output to a new key.
2607
+ *
2608
+ * @example
2609
+ * ```ts
2610
+ * pipe(
2611
+ * TaskMaybe.some({ a: 1 }),
2612
+ * TaskMaybe.bind("b", ({ a }) => TaskMaybe.some(a + 1))
2613
+ * ); // TaskMaybe({ a: 1, b: 2 })
2614
+ * ```
2615
+ */
2616
+ const bind: <K extends string, A, B>(key: K, f: (a: A) => TaskMaybe<B>) => (data: TaskMaybe<A>) => TaskMaybe<A & { [P in K]: B; }>;
2511
2617
  }
2512
2618
 
2513
2619
  type Passed<A> = WithKind<"Passed"> & WithValue<A>;
package/dist/core.js CHANGED
@@ -93,6 +93,10 @@ var Result;
93
93
  Result2.recoverUnless = (isBlocked, fallback) => (data) => (0, Result2.isErr)(data) && !isBlocked(data.error) ? fallback() : data;
94
94
  Result2.toMaybe = (data) => (0, Result2.isOk)(data) ? Maybe.some(data.value) : Maybe.none();
95
95
  Result2.ap = (arg) => (data) => (0, Result2.isOk)(data) && (0, Result2.isOk)(arg) ? (0, Result2.ok)(data.value(arg.value)) : (0, Result2.isErr)(data) ? data : arg;
96
+ Result2.bindTo = (key) => (data) => (0, Result2.map)((a) => ({ [key]: a }))(data);
97
+ Result2.bind = (key, f) => (data) => (0, Result2.chain)(
98
+ (a) => (0, Result2.map)((b) => ({ ...a, [key]: b }))(f(a))
99
+ )(data);
96
100
  })(Result || (Result = {}));
97
101
 
98
102
  // src/Core/Maybe.ts
@@ -123,6 +127,10 @@ var Maybe;
123
127
  Maybe2.filter = (predicate) => (data) => (0, Maybe2.isSome)(data) ? predicate(data.value) ? data : (0, Maybe2.none)() : data;
124
128
  Maybe2.recover = (fallback) => (data) => (0, Maybe2.isSome)(data) ? data : fallback();
125
129
  Maybe2.ap = (arg) => (data) => (0, Maybe2.isSome)(data) && (0, Maybe2.isSome)(arg) ? (0, Maybe2.some)(data.value(arg.value)) : (0, Maybe2.none)();
130
+ Maybe2.bindTo = (key) => (data) => (0, Maybe2.map)((a) => ({ [key]: a }))(data);
131
+ Maybe2.bind = (key, f) => (data) => (0, Maybe2.chain)(
132
+ (a) => (0, Maybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
133
+ )(data);
126
134
  })(Maybe || (Maybe = {}));
127
135
 
128
136
  // src/Core/Combinable.ts
@@ -230,6 +238,10 @@ var Logged;
230
238
  return data;
231
239
  };
232
240
  Logged2.run = (data) => [data.value, data.log];
241
+ Logged2.bindTo = (key) => (data) => (0, Logged2.map)((a) => ({ [key]: a }))(data);
242
+ Logged2.bind = (key, f) => (data) => (0, Logged2.chain)(
243
+ (a) => (0, Logged2.map)((b) => ({ ...a, [key]: b }))(f(a))
244
+ )(data);
233
245
  })(Logged || (Logged = {}));
234
246
 
235
247
  // src/Types/Brand.ts
@@ -1429,6 +1441,10 @@ var Reader;
1429
1441
  };
1430
1442
  Reader2.local = (f) => (data) => (env) => data(f(env));
1431
1443
  Reader2.run = (env) => (data) => data(env);
1444
+ Reader2.bindTo = (key) => (data) => (0, Reader2.map)((a) => ({ [key]: a }))(data);
1445
+ Reader2.bind = (key, f) => (data) => (0, Reader2.chain)(
1446
+ (a) => (0, Reader2.map)((b) => ({ ...a, [key]: b }))(f(a))
1447
+ )(data);
1432
1448
  })(Reader || (Reader = {}));
1433
1449
 
1434
1450
  // src/Core/Refinement.ts
@@ -1748,6 +1764,10 @@ var Task;
1748
1764
  return { task, abort };
1749
1765
  };
1750
1766
  Task2.run = (signal) => (task) => Deferred.toPromise(task(signal));
1767
+ Task2.bindTo = (key) => (data) => (0, Task2.map)((a) => ({ [key]: a }))(data);
1768
+ Task2.bind = (key, f) => (data) => (0, Task2.chain)(
1769
+ (a) => (0, Task2.map)((b) => ({ ...a, [key]: b }))(f(a))
1770
+ )(data);
1751
1771
  })(Task || (Task = {}));
1752
1772
 
1753
1773
  // src/Core/Resource.ts
@@ -1825,6 +1845,10 @@ var State;
1825
1845
  State2.run = (initialState) => (st) => st(initialState);
1826
1846
  State2.evaluate = (initialState) => (st) => st(initialState)[0];
1827
1847
  State2.execute = (initialState) => (st) => st(initialState)[1];
1848
+ State2.bindTo = (key) => (data) => (0, State2.map)((a) => ({ [key]: a }))(data);
1849
+ State2.bind = (key, f) => (data) => (0, State2.chain)(
1850
+ (a) => (0, State2.map)((b) => ({ ...a, [key]: b }))(f(a))
1851
+ )(data);
1828
1852
  })(State || (State = {}));
1829
1853
 
1830
1854
  // src/Core/TaskMaybe.ts
@@ -1850,6 +1874,10 @@ var TaskMaybe;
1850
1874
  TaskMaybe2.tap = (f) => (data) => Task.map(Maybe.tap(f))(data);
1851
1875
  TaskMaybe2.filter = (predicate) => (data) => Task.map(Maybe.filter(predicate))(data);
1852
1876
  TaskMaybe2.toTaskResult = (onNone) => (data) => Task.map(Maybe.toResult(onNone))(data);
1877
+ TaskMaybe2.bindTo = (key) => (data) => (0, TaskMaybe2.map)((a) => ({ [key]: a }))(data);
1878
+ TaskMaybe2.bind = (key, f) => (data) => (0, TaskMaybe2.chain)(
1879
+ (a) => (0, TaskMaybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
1880
+ )(data);
1853
1881
  })(TaskMaybe || (TaskMaybe = {}));
1854
1882
 
1855
1883
  // src/Core/TaskResult.ts
@@ -1881,6 +1909,10 @@ var TaskResult;
1881
1909
  )
1882
1910
  );
1883
1911
  TaskResult2.run = (signal) => (task) => Deferred.toPromise(task(signal));
1912
+ TaskResult2.bindTo = (key) => (data) => (0, TaskResult2.map)((a) => ({ [key]: a }))(data);
1913
+ TaskResult2.bind = (key, f) => (data) => (0, TaskResult2.chain)(
1914
+ (a) => (0, TaskResult2.map)((b) => ({ ...a, [key]: b }))(f(a))
1915
+ )(data);
1884
1916
  })(TaskResult || (TaskResult = {}));
1885
1917
 
1886
1918
  // src/Core/Validation.ts
package/dist/core.mjs CHANGED
@@ -19,13 +19,13 @@ import {
19
19
  These,
20
20
  Tuple,
21
21
  Validation
22
- } from "./chunk-4QMYKCWE.mjs";
22
+ } from "./chunk-SHO53CQC.mjs";
23
23
  import {
24
24
  Deferred,
25
25
  Maybe,
26
26
  Result,
27
27
  Task
28
- } from "./chunk-DLBHVYII.mjs";
28
+ } from "./chunk-PUMSVZB4.mjs";
29
29
  import "./chunk-VWVPHDZO.mjs";
30
30
  export {
31
31
  Combinable,
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, uncurry, uncurry3, uncurry4 } from './composition.mjs';
2
2
  export { Combinable, Failed, Failure, Lazy, Lens, Loading, Logged, NotAsked, Op, Optional, Passed, Predicate, Reader, Refinement, RemoteData, Resource, State, Success, TaskMaybe, TaskResult, TaskValidation, These, TheseBoth, TheseFirst, TheseSecond, Tuple, Validation } from './core.mjs';
3
- export { D as Deferred, E as Equality, a as Err, M as Maybe, N as None, O as Ok, b as Ordering, R as Result, S as Some, T as Task } from './Task-DXsuurnc.mjs';
3
+ export { D as Deferred, E as Equality, a as Err, M as Maybe, N as None, O as Ok, b as Ordering, R as Result, S as Some, T as Task } from './Task-fn1n--6H.mjs';
4
4
  export { Brand, Duration, NonEmptyList, isNonEmptyList } from './types.mjs';
5
5
  export { Arr, Dict, Num, Rec, Str, Uniq } from './utils.mjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, uncurry, uncurry3, uncurry4 } from './composition.js';
2
2
  export { Combinable, Failed, Failure, Lazy, Lens, Loading, Logged, NotAsked, Op, Optional, Passed, Predicate, Reader, Refinement, RemoteData, Resource, State, Success, TaskMaybe, TaskResult, TaskValidation, These, TheseBoth, TheseFirst, TheseSecond, Tuple, Validation } from './core.js';
3
- export { D as Deferred, E as Equality, a as Err, M as Maybe, N as None, O as Ok, b as Ordering, R as Result, S as Some, T as Task } from './Task-zAY4kSVB.js';
3
+ export { D as Deferred, E as Equality, a as Err, M as Maybe, N as None, O as Ok, b as Ordering, R as Result, S as Some, T as Task } from './Task-DIgwvoIb.js';
4
4
  export { Brand, Duration, NonEmptyList, isNonEmptyList } from './types.js';
5
5
  export { Arr, Dict, Num, Rec, Str, Uniq } from './utils.js';
package/dist/index.js CHANGED
@@ -463,6 +463,10 @@ var Result;
463
463
  Result2.recoverUnless = (isBlocked, fallback) => (data) => (0, Result2.isErr)(data) && !isBlocked(data.error) ? fallback() : data;
464
464
  Result2.toMaybe = (data) => (0, Result2.isOk)(data) ? Maybe.some(data.value) : Maybe.none();
465
465
  Result2.ap = (arg) => (data) => (0, Result2.isOk)(data) && (0, Result2.isOk)(arg) ? (0, Result2.ok)(data.value(arg.value)) : (0, Result2.isErr)(data) ? data : arg;
466
+ Result2.bindTo = (key) => (data) => (0, Result2.map)((a) => ({ [key]: a }))(data);
467
+ Result2.bind = (key, f) => (data) => (0, Result2.chain)(
468
+ (a) => (0, Result2.map)((b) => ({ ...a, [key]: b }))(f(a))
469
+ )(data);
466
470
  })(Result || (Result = {}));
467
471
 
468
472
  // src/Core/Maybe.ts
@@ -493,6 +497,10 @@ var Maybe;
493
497
  Maybe2.filter = (predicate) => (data) => (0, Maybe2.isSome)(data) ? predicate(data.value) ? data : (0, Maybe2.none)() : data;
494
498
  Maybe2.recover = (fallback) => (data) => (0, Maybe2.isSome)(data) ? data : fallback();
495
499
  Maybe2.ap = (arg) => (data) => (0, Maybe2.isSome)(data) && (0, Maybe2.isSome)(arg) ? (0, Maybe2.some)(data.value(arg.value)) : (0, Maybe2.none)();
500
+ Maybe2.bindTo = (key) => (data) => (0, Maybe2.map)((a) => ({ [key]: a }))(data);
501
+ Maybe2.bind = (key, f) => (data) => (0, Maybe2.chain)(
502
+ (a) => (0, Maybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
503
+ )(data);
496
504
  })(Maybe || (Maybe = {}));
497
505
 
498
506
  // src/Core/Combinable.ts
@@ -600,6 +608,10 @@ var Logged;
600
608
  return data;
601
609
  };
602
610
  Logged2.run = (data) => [data.value, data.log];
611
+ Logged2.bindTo = (key) => (data) => (0, Logged2.map)((a) => ({ [key]: a }))(data);
612
+ Logged2.bind = (key, f) => (data) => (0, Logged2.chain)(
613
+ (a) => (0, Logged2.map)((b) => ({ ...a, [key]: b }))(f(a))
614
+ )(data);
603
615
  })(Logged || (Logged = {}));
604
616
 
605
617
  // src/Types/Brand.ts
@@ -1799,6 +1811,10 @@ var Reader;
1799
1811
  };
1800
1812
  Reader2.local = (f) => (data) => (env) => data(f(env));
1801
1813
  Reader2.run = (env) => (data) => data(env);
1814
+ Reader2.bindTo = (key) => (data) => (0, Reader2.map)((a) => ({ [key]: a }))(data);
1815
+ Reader2.bind = (key, f) => (data) => (0, Reader2.chain)(
1816
+ (a) => (0, Reader2.map)((b) => ({ ...a, [key]: b }))(f(a))
1817
+ )(data);
1802
1818
  })(Reader || (Reader = {}));
1803
1819
 
1804
1820
  // src/Core/Refinement.ts
@@ -2118,6 +2134,10 @@ var Task;
2118
2134
  return { task, abort };
2119
2135
  };
2120
2136
  Task2.run = (signal) => (task) => Deferred.toPromise(task(signal));
2137
+ Task2.bindTo = (key) => (data) => (0, Task2.map)((a) => ({ [key]: a }))(data);
2138
+ Task2.bind = (key, f) => (data) => (0, Task2.chain)(
2139
+ (a) => (0, Task2.map)((b) => ({ ...a, [key]: b }))(f(a))
2140
+ )(data);
2121
2141
  })(Task || (Task = {}));
2122
2142
 
2123
2143
  // src/Core/Resource.ts
@@ -2195,6 +2215,10 @@ var State;
2195
2215
  State2.run = (initialState) => (st) => st(initialState);
2196
2216
  State2.evaluate = (initialState) => (st) => st(initialState)[0];
2197
2217
  State2.execute = (initialState) => (st) => st(initialState)[1];
2218
+ State2.bindTo = (key) => (data) => (0, State2.map)((a) => ({ [key]: a }))(data);
2219
+ State2.bind = (key, f) => (data) => (0, State2.chain)(
2220
+ (a) => (0, State2.map)((b) => ({ ...a, [key]: b }))(f(a))
2221
+ )(data);
2198
2222
  })(State || (State = {}));
2199
2223
 
2200
2224
  // src/Core/TaskMaybe.ts
@@ -2220,6 +2244,10 @@ var TaskMaybe;
2220
2244
  TaskMaybe2.tap = (f) => (data) => Task.map(Maybe.tap(f))(data);
2221
2245
  TaskMaybe2.filter = (predicate) => (data) => Task.map(Maybe.filter(predicate))(data);
2222
2246
  TaskMaybe2.toTaskResult = (onNone) => (data) => Task.map(Maybe.toResult(onNone))(data);
2247
+ TaskMaybe2.bindTo = (key) => (data) => (0, TaskMaybe2.map)((a) => ({ [key]: a }))(data);
2248
+ TaskMaybe2.bind = (key, f) => (data) => (0, TaskMaybe2.chain)(
2249
+ (a) => (0, TaskMaybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
2250
+ )(data);
2223
2251
  })(TaskMaybe || (TaskMaybe = {}));
2224
2252
 
2225
2253
  // src/Core/TaskResult.ts
@@ -2251,6 +2279,10 @@ var TaskResult;
2251
2279
  )
2252
2280
  );
2253
2281
  TaskResult2.run = (signal) => (task) => Deferred.toPromise(task(signal));
2282
+ TaskResult2.bindTo = (key) => (data) => (0, TaskResult2.map)((a) => ({ [key]: a }))(data);
2283
+ TaskResult2.bind = (key, f) => (data) => (0, TaskResult2.chain)(
2284
+ (a) => (0, TaskResult2.map)((b) => ({ ...a, [key]: b }))(f(a))
2285
+ )(data);
2254
2286
  })(TaskResult || (TaskResult = {}));
2255
2287
 
2256
2288
  // src/Core/Validation.ts
package/dist/index.mjs CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  These,
50
50
  Tuple,
51
51
  Validation
52
- } from "./chunk-4QMYKCWE.mjs";
52
+ } from "./chunk-SHO53CQC.mjs";
53
53
  import {
54
54
  Arr,
55
55
  Dict,
@@ -57,13 +57,13 @@ import {
57
57
  Rec,
58
58
  Str,
59
59
  Uniq
60
- } from "./chunk-IJFFWBKW.mjs";
60
+ } from "./chunk-72BGUEQM.mjs";
61
61
  import {
62
62
  Deferred,
63
63
  Maybe,
64
64
  Result,
65
65
  Task
66
- } from "./chunk-DLBHVYII.mjs";
66
+ } from "./chunk-PUMSVZB4.mjs";
67
67
  import "./chunk-IPP4XFYH.mjs";
68
68
  import {
69
69
  isNonEmptyList
package/dist/utils.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-DXsuurnc.mjs';
1
+ import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-fn1n--6H.mjs';
2
2
  import { NonEmptyList } from './types.mjs';
3
3
 
4
4
  /**
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-zAY4kSVB.js';
1
+ import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-DIgwvoIb.js';
2
2
  import { NonEmptyList } from './types.js';
3
3
 
4
4
  /**
package/dist/utils.js CHANGED
@@ -85,6 +85,10 @@ var Result;
85
85
  Result2.recoverUnless = (isBlocked, fallback) => (data) => (0, Result2.isErr)(data) && !isBlocked(data.error) ? fallback() : data;
86
86
  Result2.toMaybe = (data) => (0, Result2.isOk)(data) ? Maybe.some(data.value) : Maybe.none();
87
87
  Result2.ap = (arg) => (data) => (0, Result2.isOk)(data) && (0, Result2.isOk)(arg) ? (0, Result2.ok)(data.value(arg.value)) : (0, Result2.isErr)(data) ? data : arg;
88
+ Result2.bindTo = (key) => (data) => (0, Result2.map)((a) => ({ [key]: a }))(data);
89
+ Result2.bind = (key, f) => (data) => (0, Result2.chain)(
90
+ (a) => (0, Result2.map)((b) => ({ ...a, [key]: b }))(f(a))
91
+ )(data);
88
92
  })(Result || (Result = {}));
89
93
 
90
94
  // src/Core/Maybe.ts
@@ -115,6 +119,10 @@ var Maybe;
115
119
  Maybe2.filter = (predicate) => (data) => (0, Maybe2.isSome)(data) ? predicate(data.value) ? data : (0, Maybe2.none)() : data;
116
120
  Maybe2.recover = (fallback) => (data) => (0, Maybe2.isSome)(data) ? data : fallback();
117
121
  Maybe2.ap = (arg) => (data) => (0, Maybe2.isSome)(data) && (0, Maybe2.isSome)(arg) ? (0, Maybe2.some)(data.value(arg.value)) : (0, Maybe2.none)();
122
+ Maybe2.bindTo = (key) => (data) => (0, Maybe2.map)((a) => ({ [key]: a }))(data);
123
+ Maybe2.bind = (key, f) => (data) => (0, Maybe2.chain)(
124
+ (a) => (0, Maybe2.map)((b) => ({ ...a, [key]: b }))(f(a))
125
+ )(data);
118
126
  })(Maybe || (Maybe = {}));
119
127
 
120
128
  // src/Types/Brand.ts
@@ -364,6 +372,10 @@ var Task;
364
372
  return { task, abort };
365
373
  };
366
374
  Task2.run = (signal) => (task) => Deferred.toPromise(task(signal));
375
+ Task2.bindTo = (key) => (data) => (0, Task2.map)((a) => ({ [key]: a }))(data);
376
+ Task2.bind = (key, f) => (data) => (0, Task2.chain)(
377
+ (a) => (0, Task2.map)((b) => ({ ...a, [key]: b }))(f(a))
378
+ )(data);
367
379
  })(Task || (Task = {}));
368
380
 
369
381
  // src/Types/NonEmptyList.ts
package/dist/utils.mjs CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  Rec,
6
6
  Str,
7
7
  Uniq
8
- } from "./chunk-IJFFWBKW.mjs";
9
- import "./chunk-DLBHVYII.mjs";
8
+ } from "./chunk-72BGUEQM.mjs";
9
+ import "./chunk-PUMSVZB4.mjs";
10
10
  import "./chunk-DBIC62UV.mjs";
11
11
  import "./chunk-VWVPHDZO.mjs";
12
12
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nlozgachev/pipelined",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Opinionated functional abstractions for TypeScript",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://pipelined.lozgachev.dev",
@@ -18,7 +18,7 @@
18
18
  "types": "./dist/index.d.ts",
19
19
  "sideEffects": false,
20
20
  "engines": {
21
- "node": ">=22"
21
+ "node": ">=24"
22
22
  },
23
23
  "files": [
24
24
  "dist"
@@ -53,11 +53,16 @@
53
53
  "format:check": "dprint check && dprint check --config dprint.md.json docs/**/*.md docs/**/*.mdx README.md",
54
54
  "typecheck": "tsc --noEmit",
55
55
  "lint": "oxlint src/",
56
- "publish:npm": "pnpm build && npm publish --access public"
56
+ "publish:npm": "pnpm build && npm publish --access public",
57
+ "release:patch": "bumpp --patch -c -t -p",
58
+ "release:minor": "bumpp --minor -c -t -p",
59
+ "docs:dev": "pnpm --filter pipelined-docs dev",
60
+ "docs:build": "pnpm --filter pipelined-docs build"
57
61
  },
58
62
  "devDependencies": {
59
63
  "@types/node": "25.9.1",
60
64
  "@vitest/coverage-v8": "4.1.7",
65
+ "bumpp": "11.1.0",
61
66
  "dprint": "0.54.0",
62
67
  "fast-check": "4.8.0",
63
68
  "oxlint": "1.66.0",