@nlozgachev/pipelined 0.66.0 → 0.67.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.
@@ -1,5 +1,5 @@
1
- import { n as Duration, t as RetryPolicy } from "./index-Bs8En5LJ.js";
2
- import { _ as WithSecond, a as Thenable, b as WithValue, c as WithCooldown, d as WithErrors, f as WithFirst, g as WithN, h as WithMinInterval, i as RetryOptions, l as WithDuration, m as WithLog, o as TimeoutOptions, p as WithKind, r as NonEmptyArr, s as WithConcurrency, u as WithError, v as WithSize, x as Deferred, y as WithTimeout } from "./InternalTypes-DzDey5Do.js";
1
+ import { n as Duration, t as RetryPolicy } from "./index-CTe9CCHY.cjs";
2
+ import { _ as WithSecond, a as Thenable, b as WithValue, c as WithCooldown, d as WithErrors, f as WithFirst, g as WithN, h as WithMinInterval, i as RetryOptions, l as WithDuration, m as WithLog, o as TimeoutOptions, p as WithKind, r as NonEmptyArr, s as WithConcurrency, u as WithError, v as WithSize, x as Deferred, y as WithTimeout } from "./InternalTypes-DxSlzrpu.cjs";
3
3
  //#region src/Core/Combinable.d.ts
4
4
  /**
5
5
  * A type that can combine two values of type `A` into one, with a neutral starting value.
@@ -575,6 +575,16 @@ declare const Lens: {
575
575
  */
576
576
  type Logged<L, A> = WithValue<A> & WithLog<L>;
577
577
  declare const Logged: {
578
+ /**
579
+ * Creates a `Logged` with a value and an optional initial log array.
580
+ *
581
+ * @example
582
+ * ```ts
583
+ * Logged.make(42); // { value: 42, log: [] }
584
+ * Logged.make(42, ["initialized"]); // { value: 42, log: ["initialized"] }
585
+ * ```
586
+ */
587
+ make: <W = never, A = unknown>(value: A, log?: readonly W[]) => Logged<W, A>;
578
588
  from: {
579
589
  /**
580
590
  * Wraps a pure value into a `Logged` with an empty log.
@@ -639,11 +649,11 @@ declare const Logged: {
639
649
  * };
640
650
  * const arg: Logged<string, number> = { value: 5, log: ["arg-loaded"] };
641
651
  *
642
- * const result = pipe(fn, Logged.ap(arg));
652
+ * const result = pipe(fn, Logged.apply(arg));
643
653
  * Logged.run(result); // [10, ["fn-loaded", "arg-loaded"]]
644
654
  * ```
645
655
  */
646
- ap: <W, A>(arg: Logged<W, A>) => <B>(data: Logged<W, (a: A) => B>) => Logged<W, B>;
656
+ apply: <W, A>(arg: Logged<W, A>) => <B>(data: Logged<W, (a: A) => B>) => Logged<W, B>;
647
657
  /**
648
658
  * Runs a side effect on the value without changing the `Logged`.
649
659
  * Useful for debugging or inspecting intermediate values.
@@ -751,6 +761,8 @@ declare const Maybe: {
751
761
  /**
752
762
  * Type guard that checks if a Maybe is Some.
753
763
  *
764
+ * @see {@link Maybe.is.none}
765
+ *
754
766
  * @example
755
767
  * ```ts
756
768
  * const value = Maybe.make.some(42);
@@ -763,6 +775,8 @@ declare const Maybe: {
763
775
  /**
764
776
  * Type guard that checks if a Maybe is None.
765
777
  *
778
+ * @see {@link Maybe.is.some}
779
+ *
766
780
  * @example
767
781
  * ```ts
768
782
  * const value = Maybe.make.none();
@@ -812,6 +826,17 @@ declare const Maybe: {
812
826
  * ```
813
827
  */
814
828
  Result: <E>(onNone: () => E) => <A>(data: Maybe<A>) => Result<E, A>;
829
+ /**
830
+ * Converts a Maybe to a Validation.
831
+ * Some becomes Passed, None becomes Failed with error produced by `onNone`.
832
+ *
833
+ * @example
834
+ * ```ts
835
+ * pipe(Maybe.make.some(42), Maybe.to.Validation(() => "missing")); // Passed(42)
836
+ * pipe(Maybe.make.none(), Maybe.to.Validation(() => "missing")); // Failed(["missing"])
837
+ * ```
838
+ */
839
+ Validation: <E>(onNone: () => E) => <A>(data: Maybe<A>) => Validation<E, A>;
815
840
  };
816
841
  from: {
817
842
  /**
@@ -866,17 +891,21 @@ declare const Maybe: {
866
891
  /**
867
892
  * Transforms the value inside a Maybe if it exists.
868
893
  *
894
+ * @see {@link Maybe.chain} for functions that return a Maybe.
895
+ *
869
896
  * @example
870
897
  * ```ts
871
898
  * pipe(Maybe.make.some(5), Maybe.map(n => n * 2)); // Some(10)
872
899
  * pipe(Maybe.make.none(), Maybe.map(n => n * 2)); // None
873
900
  * ```
874
901
  */
875
- map: <A, B>(f: (a: A) => B) => (data: Maybe<A>) => Maybe<B>;
902
+ map: <A, B>(transform: (value: A) => B) => (maybe: Maybe<A>) => Maybe<B>;
876
903
  /**
877
- * Chains Maybe computations. If the first is Some, passes the value to f.
904
+ * Chains Maybe computations. If the first is Some, passes the value to `transform`.
878
905
  * If the first is None, propagates None.
879
906
  *
907
+ * @see {@link Maybe.map} for transforming with plain non-optional functions.
908
+ *
880
909
  * @example
881
910
  * ```ts
882
911
  * const parseNumber = (s: string): Maybe<number> => {
@@ -888,10 +917,12 @@ declare const Maybe: {
888
917
  * pipe(Maybe.make.some("abc"), Maybe.chain(parseNumber)); // None
889
918
  * ```
890
919
  */
891
- chain: <A, B>(f: (a: A) => Maybe<B>) => (data: Maybe<A>) => Maybe<B>;
920
+ chain: <A, B>(transform: (value: A) => Maybe<B>) => (maybe: Maybe<A>) => Maybe<B>;
892
921
  /**
893
922
  * Extracts the value from a Maybe by providing handlers for both cases.
894
923
  *
924
+ * @see {@link Maybe.match} for named-case handling using an object.
925
+ *
895
926
  * @example
896
927
  * ```ts
897
928
  * pipe(
@@ -903,10 +934,12 @@ declare const Maybe: {
903
934
  * ); // "Value: 5"
904
935
  * ```
905
936
  */
906
- fold: <A, B>(onNone: () => B, onSome: (a: A) => B) => (data: Maybe<A>) => B;
937
+ fold: <A, B>(onNone: () => B, onSome: (value: A) => B) => (maybe: Maybe<A>) => B;
907
938
  /**
908
939
  * Pattern matches on a Maybe, returning the result of the matching case.
909
940
  *
941
+ * @see {@link Maybe.fold} for positional arguments (onNone, onSome).
942
+ *
910
943
  * @example
911
944
  * ```ts
912
945
  * pipe(
@@ -920,13 +953,16 @@ declare const Maybe: {
920
953
  */
921
954
  match: <A, B>(cases: {
922
955
  none: () => B;
923
- some: (a: A) => B;
924
- }) => (data: Maybe<A>) => B;
956
+ some: (value: A) => B;
957
+ }) => (maybe: Maybe<A>) => B;
925
958
  /**
926
959
  * Returns the value inside a Maybe, or a default value if None.
927
960
  * The default is a thunk `() => B` — evaluated only when the Maybe is None.
928
961
  * The default can be a different type, widening the result to `A | B`.
929
962
  *
963
+ * @see {@link Maybe.match}
964
+ * @see {@link Maybe.to.nullable}
965
+ *
930
966
  * @example
931
967
  * ```ts
932
968
  * pipe(Maybe.make.some(5), Maybe.getOrElse(() => 0)); // 5
@@ -934,11 +970,13 @@ declare const Maybe: {
934
970
  * pipe(Maybe.make.none<string>(), Maybe.getOrElse(() => null)); // null — typed as string | null
935
971
  * ```
936
972
  */
937
- getOrElse: <B>(defaultValue: () => B) => <A>(data: Maybe<A>) => A | B;
973
+ getOrElse: <B>(defaultValue: () => B) => <A>(maybe: Maybe<A>) => A | B;
938
974
  /**
939
975
  * Executes a side effect on the value without changing the Maybe.
940
976
  * Useful for logging or debugging.
941
977
  *
978
+ * @see {@link Maybe.tapNone} for running side effects on None.
979
+ *
942
980
  * @example
943
981
  * ```ts
944
982
  * pipe(
@@ -948,10 +986,12 @@ declare const Maybe: {
948
986
  * );
949
987
  * ```
950
988
  */
951
- tap: <A>(f: (a: A) => void) => (data: Maybe<A>) => Maybe<A>;
989
+ tap: <A>(sideEffect: (value: A) => void) => (maybe: Maybe<A>) => Maybe<A>;
952
990
  /**
953
991
  * Executes a side effect when the Maybe is None, without changing the Maybe.
954
992
  *
993
+ * @see {@link Maybe.tap} for running side effects on Some.
994
+ *
955
995
  * @example
956
996
  * ```ts
957
997
  * pipe(
@@ -960,11 +1000,13 @@ declare const Maybe: {
960
1000
  * );
961
1001
  * ```
962
1002
  */
963
- tapNone: (f: () => void) => <A>(data: Maybe<A>) => Maybe<A>;
1003
+ tapNone: (sideEffect: () => void) => <A>(maybe: Maybe<A>) => Maybe<A>;
964
1004
  /**
965
1005
  * Filters a Maybe based on a predicate or type guard.
966
1006
  * Returns None if the predicate returns false or if the Maybe is already None.
967
1007
  *
1008
+ * @see {@link Maybe.map}
1009
+ *
968
1010
  * @example
969
1011
  * ```ts
970
1012
  * pipe(Maybe.make.some(5), Maybe.filter(n => n > 3)); // Some(5)
@@ -973,20 +1015,22 @@ declare const Maybe: {
973
1015
  * ```
974
1016
  */
975
1017
  filter: {
976
- <A, B extends A>(refinement: (a: A) => a is B): (data: Maybe<A>) => Maybe<B>;
977
- <A>(predicate: (a: A) => boolean): (data: Maybe<A>) => Maybe<A>;
1018
+ <A, B extends A>(refinement: (value: A) => value is B): (maybe: Maybe<A>) => Maybe<B>;
1019
+ <A>(predicate: (value: A) => boolean): (maybe: Maybe<A>) => Maybe<A>;
978
1020
  };
979
1021
  /**
980
1022
  * Recovers from a None by providing a fallback Maybe.
981
1023
  * The fallback can produce a different type, widening the result to `Maybe<A | B>`.
982
1024
  *
1025
+ * @see {@link Maybe.getOrElse}
1026
+ *
983
1027
  * @example
984
1028
  * ```ts
985
1029
  * pipe(Maybe.make.none(), Maybe.recover(() => Maybe.make.some(42))); // Some(42)
986
1030
  * pipe(Maybe.make.some(10), Maybe.recover(() => Maybe.make.some(42))); // Some(10)
987
1031
  * ```
988
1032
  */
989
- recover: <B>(fallback: () => Maybe<B>) => <A>(data: Maybe<A>) => Maybe<A | B>;
1033
+ recover: <B>(fallback: () => Maybe<B>) => <A>(maybe: Maybe<A>) => Maybe<A | B>;
990
1034
  /**
991
1035
  * Applies a function wrapped in a Maybe to a value wrapped in a Maybe.
992
1036
  *
@@ -995,12 +1039,12 @@ declare const Maybe: {
995
1039
  * const add = (a: number) => (b: number) => a + b;
996
1040
  * pipe(
997
1041
  * Maybe.make.some(add),
998
- * Maybe.ap(Maybe.make.some(5)),
999
- * Maybe.ap(Maybe.make.some(3))
1042
+ * Maybe.apply(Maybe.make.some(5)),
1043
+ * Maybe.apply(Maybe.make.some(3))
1000
1044
  * ); // Some(8)
1001
1045
  * ```
1002
1046
  */
1003
- ap: <A>(arg: Maybe<A>) => <B>(data: Maybe<(a: A) => B>) => Maybe<B>;
1047
+ apply: <A>(arg: Maybe<A>) => <B>(data: Maybe<(a: A) => B>) => Maybe<B>;
1004
1048
  /**
1005
1049
  * Converts a Maybe value into an object containing a single property.
1006
1050
  * Initiates the pipeline accumulator record.
@@ -1051,6 +1095,7 @@ declare const Maybe: {
1051
1095
  };
1052
1096
  //#endregion
1053
1097
  //#region src/Core/Op.d.ts
1098
+ declare const _opBrand: unique symbol;
1054
1099
  /**
1055
1100
  * A reusable description of async work — decoupled from execution strategy and lifetime.
1056
1101
  *
@@ -1069,7 +1114,7 @@ declare const Maybe: {
1069
1114
  * if (!r.ok) throw new Error(`${r.status} ${r.statusText}`);
1070
1115
  * return r.json() as Promise<User>;
1071
1116
  * }),
1072
- * (e) => new ApiError(e),
1117
+ * { onError: (e) => new ApiError(e) },
1073
1118
  * );
1074
1119
  *
1075
1120
  * const manager = Op.interpret(fetchUser, { strategy: "restartable" });
@@ -1082,17 +1127,17 @@ declare const Maybe: {
1082
1127
  * manager.run(userId);
1083
1128
  * ```
1084
1129
  */
1085
- type Op<I, E, A> = {
1086
- /**
1087
- * @internal — Used by `Op.interpret`. Do not call directly.
1088
- * Returns `null` when the operation was aborted (signal fired before factory resolved).
1089
- */
1090
- readonly _factory: (input: I, signal: AbortSignal) => Deferred<Result<E, A> | null>;
1130
+ type Op<Args extends readonly any[] = any[], E = unknown, A = unknown> = {
1131
+ readonly [_opBrand]: {
1132
+ readonly _args: (...args: Args) => void;
1133
+ readonly _error: () => E;
1134
+ readonly _value: () => A;
1135
+ };
1091
1136
  };
1092
1137
  type MaybeRetry<E, O> = O extends {
1093
1138
  retry: RetryOptions<E>;
1094
1139
  } ? Op.Retrying<E> : never;
1095
- type AllInterpretOptions<I, E> = ({
1140
+ type AllInterpretOptions<Args extends readonly any[], E> = ({
1096
1141
  strategy: "once";
1097
1142
  retry?: RetryOptions<E>;
1098
1143
  } & WithTimeout<E>) | ({
@@ -1106,7 +1151,7 @@ type AllInterpretOptions<I, E> = ({
1106
1151
  retry?: RetryOptions<E>;
1107
1152
  maxSize?: number;
1108
1153
  overflow?: "drop" | "replace-last";
1109
- dedupe?: (a: I, b: I) => boolean;
1154
+ dedupe?: (a: Args, b: Args) => boolean;
1110
1155
  } & WithConcurrency & WithTimeout<E>) | ({
1111
1156
  strategy: "buffered";
1112
1157
  retry?: RetryOptions<E>;
@@ -1126,53 +1171,53 @@ type AllInterpretOptions<I, E> = ({
1126
1171
  } & WithN & WithTimeout<E>) | ({
1127
1172
  strategy: "keyed";
1128
1173
  perKey?: "exclusive" | "restartable";
1129
- key: (input: I) => unknown;
1174
+ key: (...args: Args) => unknown;
1130
1175
  } & WithTimeout<E>);
1131
- type KeyType<I, O> = O extends {
1132
- key: (input: I) => infer K;
1176
+ type KeyType<Args extends readonly any[], O> = O extends {
1177
+ key: (...args: Args) => infer K;
1133
1178
  } ? K : unknown;
1134
- type InterpretResult<I, E, A, O> = [O] extends [{
1179
+ type InterpretResult<Args extends readonly any[], E, A, O> = [O] extends [{
1135
1180
  strategy: "throttled";
1136
1181
  trailing: true;
1137
- }] ? Op.Manager<I, E, A, Op.ThrottledTrailingState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1182
+ }] ? Op.Manager<Args, E, A, Op.ThrottledTrailingState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1138
1183
  strategy: "throttled";
1139
- }] ? Op.Manager<I, E, A, Op.ThrottledState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1184
+ }] ? Op.Manager<Args, E, A, Op.ThrottledState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1140
1185
  strategy: "debounced";
1141
- }] ? Op.Manager<I, E, A, Op.DebouncedState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1186
+ }] ? Op.Manager<Args, E, A, Op.DebouncedState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1142
1187
  strategy: "concurrent";
1143
1188
  overflow: "queue";
1144
- }] ? Op.Manager<I, E, A, Op.ConcurrentQueueState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1189
+ }] ? Op.Manager<Args, E, A, Op.ConcurrentQueueState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1145
1190
  strategy: "concurrent";
1146
- }] ? Op.Manager<I, E, A, Op.ConcurrentDropState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1191
+ }] ? Op.Manager<Args, E, A, Op.ConcurrentDropState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1147
1192
  strategy: "keyed";
1148
1193
  perKey: "restartable";
1149
- }] ? Op.KeyedManager<I, KeyType<I, O>, E, Op.KeyedRestartablePerKey<E, A>> : [O] extends [{
1194
+ }] ? Op.KeyedManager<Args, KeyType<Args, O>, E, Op.KeyedRestartablePerKey<E, A>> : [O] extends [{
1150
1195
  strategy: "keyed";
1151
- }] ? Op.KeyedManager<I, KeyType<I, O>, E, Op.KeyedExclusivePerKey<E, A>> : [O] extends [{
1196
+ }] ? Op.KeyedManager<Args, KeyType<Args, O>, E, Op.KeyedExclusivePerKey<E, A>> : [O] extends [{
1152
1197
  strategy: "once";
1153
- }] ? Op.Manager<I, E, A, Op.OnceState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1198
+ }] ? Op.Manager<Args, E, A, Op.OnceState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1154
1199
  strategy: "restartable";
1155
- }] ? Op.Manager<I, E, A, Op.RestartableState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1200
+ }] ? Op.Manager<Args, E, A, Op.RestartableState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1156
1201
  strategy: "exclusive";
1157
- }] ? Op.Manager<I, E, A, Op.ExclusiveState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1202
+ }] ? Op.Manager<Args, E, A, Op.ExclusiveState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1158
1203
  strategy: "queue";
1159
1204
  overflow: "replace-last";
1160
- dedupe: (a: I, b: I) => boolean;
1161
- }] ? Op.Manager<I, E, A, Op.QueueDropAndReplaceState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1205
+ dedupe: (a: Args, b: Args) => boolean;
1206
+ }] ? Op.Manager<Args, E, A, Op.QueueDropAndReplaceState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1162
1207
  strategy: "queue";
1163
1208
  overflow: "replace-last";
1164
- }] ? Op.Manager<I, E, A, Op.QueueReplaceState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1209
+ }] ? Op.Manager<Args, E, A, Op.QueueReplaceState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1165
1210
  strategy: "queue";
1166
1211
  maxSize: number;
1167
- }] ? Op.Manager<I, E, A, Op.QueueDropState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1212
+ }] ? Op.Manager<Args, E, A, Op.QueueDropState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1168
1213
  strategy: "queue";
1169
- dedupe: (a: I, b: I) => boolean;
1170
- }] ? Op.Manager<I, E, A, Op.QueueDropState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1214
+ dedupe: (a: Args, b: Args) => boolean;
1215
+ }] ? Op.Manager<Args, E, A, Op.QueueDropState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1171
1216
  strategy: "queue";
1172
- }] ? Op.Manager<I, E, A, Op.QueueState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1217
+ }] ? Op.Manager<Args, E, A, Op.QueueState<E, A> | MaybeRetry<E, O>> : [O] extends [{
1173
1218
  strategy: "buffered";
1174
- }] ? Op.Manager<I, E, A, Op.BufferedState<E, A> | MaybeRetry<E, O>> : never;
1175
- declare function interpretFn<I, E, A, O extends AllInterpretOptions<I, E>>(op: Op<I, E, A>, options: O): InterpretResult<I, E, A, O>;
1219
+ }] ? Op.Manager<Args, E, A, Op.BufferedState<E, A> | MaybeRetry<E, O>> : never;
1220
+ declare function interpretFn<Args extends readonly any[], E, A, O extends AllInterpretOptions<Args, E>>(op: Op<Args, E, A>, options: O): InterpretResult<Args, E, A, O>;
1176
1221
  declare const Op: {
1177
1222
  make: {
1178
1223
  /**
@@ -1282,8 +1327,24 @@ declare const Op: {
1282
1327
  */
1283
1328
  nil: <E, A>(state: Op.State<E, A>) => state is Op.Nil;
1284
1329
  };
1285
- create: <E, A, I = void>(factory: (signal: AbortSignal) => (input: I) => Promise<A>, onError: (e: unknown) => E) => Op<I, E, A>;
1286
- lift: <I, A>(f: (input: I, signal: AbortSignal) => Promise<A>) => Op<I, unknown, A>;
1330
+ /**
1331
+ * Creates an Op from a signal-accepting factory function that returns the async action,
1332
+ * along with an error mapping handler.
1333
+ *
1334
+ * Arguments to the returned function are automatically inferred as tuple parameters via `Parameters<Fn>`.
1335
+ *
1336
+ * @example
1337
+ * ```ts
1338
+ * const fetchUser = Op.create(
1339
+ * (signal) => (id: string) => fetch(`/users/${id}`, { signal }).then(r => r.json() as Promise<User>),
1340
+ * { onError: (e) => new ApiError(e) },
1341
+ * );
1342
+ * ```
1343
+ */
1344
+ create: <Fn extends (...args: any[]) => Promise<any>, E = unknown>(factory: (signal: AbortSignal) => Fn, options: {
1345
+ onError: (error: unknown) => E;
1346
+ }) => Op<Parameters<Fn>, E, Awaited<ReturnType<Fn>>>;
1347
+ lift: <Fn extends (...args: any[]) => Promise<any>>(f: (signal: AbortSignal) => Fn) => Op<Parameters<Fn>, unknown, Awaited<ReturnType<Fn>>>;
1287
1348
  match: <E, A, B>(cases: {
1288
1349
  ok: (a: A) => B;
1289
1350
  err: (e: E) => B;
@@ -1302,7 +1363,7 @@ declare const Op: {
1302
1363
  };
1303
1364
  all: <E, A>(invocations: ReadonlyArray<Deferred<Op.Outcome<E, A>>>) => Deferred<ReadonlyArray<Op.Outcome<E, A>>>;
1304
1365
  race: <E, A>(invocations: ReadonlyArray<Deferred<Op.Outcome<E, A>>>) => Deferred<Op.Outcome<E, A>>;
1305
- wire: <I, E, A, S extends Op.State<E, A>>(source: Op.Manager<I, E, A, S>, f: (a: A) => void) => () => void;
1366
+ wire: <Args extends readonly any[], E, A, S extends Op.State<E, A>>(source: Op.Manager<Args, E, A, S>, f: (a: A) => void) => () => void;
1306
1367
  interpret: typeof interpretFn;
1307
1368
  };
1308
1369
  declare namespace Op {
@@ -1336,25 +1397,25 @@ declare namespace Op {
1336
1397
  readonly lastError: E;
1337
1398
  readonly nextRetryIn?: number;
1338
1399
  };
1339
- type Manager<I, E, A, S extends State<E, A>> = {
1400
+ type Manager<Args extends readonly any[], E, A, S extends State<E, A>> = {
1340
1401
  readonly state: S;
1341
- run: (input: I) => Deferred<Exclude<S, Idle | Pending | Queued | Retrying<E>>>;
1402
+ run: (...args: Args) => Deferred<Exclude<S, Idle | Pending | Queued | Retrying<E>>>;
1342
1403
  abort: () => void;
1343
1404
  subscribe: (cb: (state: S) => void) => () => void;
1344
1405
  reset: () => void;
1345
- poll: (input: I, options: {
1406
+ poll: (options: {
1346
1407
  interval: Duration;
1347
- }) => () => void;
1408
+ }) => (...args: Args) => () => void;
1348
1409
  };
1349
- type KeyedManager<I, K, E, PerKeyS> = {
1410
+ type KeyedManager<Args extends readonly any[], K, E, PerKeyS> = {
1350
1411
  readonly state: ReadonlyMap<K, PerKeyS>;
1351
- run: (input: I) => Deferred<Exclude<PerKeyS, Pending | Retrying<E>>>;
1412
+ run: (...args: Args) => Deferred<Exclude<PerKeyS, Pending | Retrying<E>>>;
1352
1413
  abort: (key?: K) => void;
1353
1414
  subscribe: (cb: (state: ReadonlyMap<K, PerKeyS>) => void) => () => void;
1354
1415
  reset: () => void;
1355
- poll: (input: I, options: {
1416
+ poll: (options: {
1356
1417
  interval: Duration;
1357
- }) => () => void;
1418
+ }) => (...args: Args) => () => void;
1358
1419
  };
1359
1420
  type OnceState<E, A> = Idle | Pending | Ok<A> | Err<E> | AbortedNil | DroppedNil;
1360
1421
  type RetryableOnceState<E, A> = Idle | Pending | Retrying<E> | Ok<A> | Err<E> | AbortedNil | DroppedNil;
@@ -1658,7 +1719,7 @@ declare const Ordering: {
1658
1719
  * import { Pair } from "@nlozgachev/pipelined/core";
1659
1720
  * import { pipe } from "@nlozgachev/pipelined/composition";
1660
1721
  *
1661
- * const entry = Pair.from.pair("alice", 42);
1722
+ * const entry = Pair.make("alice", 42);
1662
1723
  *
1663
1724
  * pipe(
1664
1725
  * entry,
@@ -1670,16 +1731,16 @@ declare const Ordering: {
1670
1731
  */
1671
1732
  type Pair<A, B> = readonly [A, B];
1672
1733
  declare const Pair: {
1734
+ /**
1735
+ * Creates a Pair from two values.
1736
+ *
1737
+ * @example
1738
+ * ```ts
1739
+ * Pair.make("Paris", 2_161_000); // ["Paris", 2161000]
1740
+ * ```
1741
+ */
1742
+ make: <A, B>(first: A, second: B) => Pair<A, B>;
1673
1743
  from: {
1674
- /**
1675
- * Creates a Pair from two values.
1676
- *
1677
- * @example
1678
- * ```ts
1679
- * Pair.from.pair("Paris", 2_161_000); // ["Paris", 2161000]
1680
- * ```
1681
- */
1682
- pair: <A, B>(first: A, second: B) => Pair<A, B>;
1683
1744
  /**
1684
1745
  * Creates a Pair from a two-element array.
1685
1746
  *
@@ -1688,51 +1749,60 @@ declare const Pair: {
1688
1749
  * Pair.from.array(["Paris", 2_161_000] as const); // ["Paris", 2161000]
1689
1750
  * ```
1690
1751
  */
1691
- array: <A, B>(arr: readonly [A, B]) => Pair<A, B>;
1752
+ array: <A, B>(items: readonly [A, B]) => Pair<A, B>;
1692
1753
  };
1693
1754
  /**
1694
1755
  * Returns the first value from the pair.
1695
1756
  *
1696
1757
  * @example
1697
1758
  * ```ts
1698
- * Pair.first(Pair.from.pair("Paris", 2_161_000)); // "Paris"
1759
+ * Pair.first(Pair.make("Paris", 2_161_000)); // "Paris"
1699
1760
  * ```
1700
1761
  */
1701
- first: <A, B>(p: Pair<A, B>) => A;
1762
+ first: <A, B>(pair: Pair<A, B>) => A;
1702
1763
  /**
1703
1764
  * Returns the second value from the pair.
1704
1765
  *
1705
1766
  * @example
1706
1767
  * ```ts
1707
- * Pair.second(Pair.from.pair("Paris", 2_161_000)); // 2161000
1768
+ * Pair.second(Pair.make("Paris", 2_161_000)); // 2161000
1708
1769
  * ```
1709
1770
  */
1710
- second: <A, B>(p: Pair<A, B>) => B;
1771
+ second: <A, B>(pair: Pair<A, B>) => B;
1711
1772
  /**
1712
1773
  * Transforms the first value, leaving the second unchanged.
1713
1774
  *
1775
+ * @see {@link Pair.mapSecond} to transform the second element instead.
1776
+ * @see {@link Pair.mapBoth} to transform both elements at once.
1777
+ *
1714
1778
  * @example
1715
1779
  * ```ts
1716
- * pipe(Pair.from.pair("alice", 42), Pair.mapFirst((s) => s.toUpperCase())); // ["ALICE", 42]
1780
+ * pipe(Pair.make("alice", 42), Pair.mapFirst((s) => s.toUpperCase())); // ["ALICE", 42]
1717
1781
  * ```
1718
1782
  */
1719
- mapFirst: <A, C>(f: (a: A) => C) => <B>(p: Pair<A, B>) => Pair<C, B>;
1783
+ mapFirst: <A, C>(transform: (first: A) => C) => <B>(pair: Pair<A, B>) => Pair<C, B>;
1720
1784
  /**
1721
1785
  * Transforms the second value, leaving the first unchanged.
1722
1786
  *
1787
+ * @see {@link Pair.mapFirst} to transform the first element instead.
1788
+ * @see {@link Pair.mapBoth} to transform both elements at once.
1789
+ *
1723
1790
  * @example
1724
1791
  * ```ts
1725
- * pipe(Pair.from.pair("alice", 42), Pair.mapSecond((n) => n * 2)); // ["alice", 84]
1792
+ * pipe(Pair.make("alice", 42), Pair.mapSecond((n) => n * 2)); // ["alice", 84]
1726
1793
  * ```
1727
1794
  */
1728
- mapSecond: <B, D>(f: (b: B) => D) => <A>(p: Pair<A, B>) => Pair<A, D>;
1795
+ mapSecond: <B, D>(transform: (second: B) => D) => <A>(pair: Pair<A, B>) => Pair<A, D>;
1729
1796
  /**
1730
1797
  * Transforms both values independently in a single step.
1731
1798
  *
1799
+ * @see {@link Pair.mapFirst} to transform only the first element.
1800
+ * @see {@link Pair.mapSecond} to transform only the second element.
1801
+ *
1732
1802
  * @example
1733
1803
  * ```ts
1734
1804
  * pipe(
1735
- * Pair.from.pair("alice", 42),
1805
+ * Pair.make("alice", 42),
1736
1806
  * Pair.mapBoth(
1737
1807
  * (name) => name.toUpperCase(),
1738
1808
  * (score) => score * 2,
@@ -1740,37 +1810,37 @@ declare const Pair: {
1740
1810
  * ); // ["ALICE", 84]
1741
1811
  * ```
1742
1812
  */
1743
- mapBoth: <A, C, B, D>(onFirst: (a: A) => C, onSecond: (b: B) => D) => (p: Pair<A, B>) => Pair<C, D>;
1813
+ mapBoth: <A, C, B, D>(onFirst: (first: A) => C, onSecond: (second: B) => D) => (pair: Pair<A, B>) => Pair<C, D>;
1744
1814
  /**
1745
1815
  * Applies a binary function to both values, collapsing the pair into a single value.
1746
1816
  * Useful as the final step when consuming a pair in a pipeline.
1747
1817
  *
1748
1818
  * @example
1749
1819
  * ```ts
1750
- * pipe(Pair.from.pair("Alice", 100), Pair.fold((name, score) => `${name}: ${score}`));
1820
+ * pipe(Pair.make("Alice", 100), Pair.fold((name, score) => `${name}: ${score}`));
1751
1821
  * // "Alice: 100"
1752
1822
  * ```
1753
1823
  */
1754
- fold: <A, B, C>(f: (a: A, b: B) => C) => (p: Pair<A, B>) => C;
1824
+ fold: <A, B, C>(reducer: (first: A, second: B) => C) => (pair: Pair<A, B>) => C;
1755
1825
  /**
1756
1826
  * Swaps the two values: `[A, B]` becomes `[B, A]`.
1757
1827
  *
1758
1828
  * @example
1759
1829
  * ```ts
1760
- * Pair.swap(Pair.from.pair("key", 1)); // [1, "key"]
1830
+ * Pair.swap(Pair.make("key", 1)); // [1, "key"]
1761
1831
  * ```
1762
1832
  */
1763
- swap: <A, B>(p: Pair<A, B>) => Pair<B, A>;
1833
+ swap: <A, B>(pair: Pair<A, B>) => Pair<B, A>;
1764
1834
  to: {
1765
1835
  /**
1766
1836
  * Converts the pair to a heterogeneous readonly array `readonly (A | B)[]`.
1767
1837
  *
1768
1838
  * @example
1769
1839
  * ```ts
1770
- * Pair.to.Array(Pair.from.pair("hello", 42)); // ["hello", 42]
1840
+ * Pair.to.array(Pair.make("hello", 42)); // ["hello", 42]
1771
1841
  * ```
1772
1842
  */
1773
- Array: <A, B>(p: Pair<A, B>) => readonly (A | B)[];
1843
+ array: <A, B>(pair: Pair<A, B>) => readonly (A | B)[];
1774
1844
  };
1775
1845
  /**
1776
1846
  * Runs a side effect with both values without changing the pair.
@@ -1779,13 +1849,13 @@ declare const Pair: {
1779
1849
  * @example
1780
1850
  * ```ts
1781
1851
  * pipe(
1782
- * Pair.from.pair("Paris", 2_161_000),
1852
+ * Pair.make("Paris", 2_161_000),
1783
1853
  * Pair.tap((city, pop) => console.log(`${city}: ${pop}`)),
1784
1854
  * Pair.mapSecond((n) => n / 1_000_000),
1785
1855
  * ); // logs "Paris: 2161000", returns ["Paris", 2.161]
1786
1856
  * ```
1787
1857
  */
1788
- tap: <A, B>(f: (a: A, b: B) => void) => (p: Pair<A, B>) => Pair<A, B>;
1858
+ tap: <A, B>(sideEffect: (first: A, second: B) => void) => (pair: Pair<A, B>) => Pair<A, B>;
1789
1859
  };
1790
1860
  //#endregion
1791
1861
  //#region src/Core/Predicate.d.ts
@@ -2072,12 +2142,12 @@ declare const Reader: {
2072
2142
  * const add = (a: number) => (b: number) => a + b;
2073
2143
  * pipe(
2074
2144
  * Reader.resolve<Config, typeof add>(add),
2075
- * Reader.ap(Reader.asks(c => c.timeout)),
2076
- * Reader.ap(Reader.resolve(5))
2145
+ * Reader.apply(Reader.asks(c => c.timeout)),
2146
+ * Reader.apply(Reader.resolve(5))
2077
2147
  * )(appConfig);
2078
2148
  * ```
2079
2149
  */
2080
- ap: <R, A>(arg: Reader<R, A>) => <B>(data: Reader<R, (a: A) => B>) => Reader<R, B>;
2150
+ apply: <R, A>(arg: Reader<R, A>) => <B>(data: Reader<R, (a: A) => B>) => Reader<R, B>;
2081
2151
  /**
2082
2152
  * Executes a side effect on the produced value without changing the Reader.
2083
2153
  * Useful for logging or debugging inside a pipeline.
@@ -2366,7 +2436,7 @@ declare const RemoteData: {
2366
2436
  * }
2367
2437
  * ```
2368
2438
  */
2369
- notAsked: <E, A>(data: RemoteData<E, A>) => data is NotAsked;
2439
+ notAsked: <E, A>(remoteData: RemoteData<E, A>) => remoteData is NotAsked;
2370
2440
  /**
2371
2441
  * Type guard that checks if a RemoteData is Loading.
2372
2442
  *
@@ -2378,10 +2448,12 @@ declare const RemoteData: {
2378
2448
  * }
2379
2449
  * ```
2380
2450
  */
2381
- loading: <E, A>(data: RemoteData<E, A>) => data is Loading;
2451
+ loading: <E, A>(remoteData: RemoteData<E, A>) => remoteData is Loading;
2382
2452
  /**
2383
2453
  * Type guard that checks if a RemoteData is Failure.
2384
2454
  *
2455
+ * @see {@link RemoteData.is.success} to check if data loaded successfully.
2456
+ *
2385
2457
  * @example
2386
2458
  * ```ts
2387
2459
  * const data = RemoteData.make.failure("Failed");
@@ -2390,10 +2462,12 @@ declare const RemoteData: {
2390
2462
  * }
2391
2463
  * ```
2392
2464
  */
2393
- failure: <E, A>(data: RemoteData<E, A>) => data is Failure<E>;
2465
+ failure: <E, A>(remoteData: RemoteData<E, A>) => remoteData is Failure<E>;
2394
2466
  /**
2395
2467
  * Type guard that checks if a RemoteData is Success.
2396
2468
  *
2469
+ * @see {@link RemoteData.is.failure} to check if data loading failed.
2470
+ *
2397
2471
  * @example
2398
2472
  * ```ts
2399
2473
  * const data = RemoteData.make.success(42);
@@ -2402,31 +2476,38 @@ declare const RemoteData: {
2402
2476
  * }
2403
2477
  * ```
2404
2478
  */
2405
- success: <E, A>(data: RemoteData<E, A>) => data is Success<A>;
2479
+ success: <E, A>(remoteData: RemoteData<E, A>) => remoteData is Success<A>;
2406
2480
  };
2407
2481
  /**
2408
2482
  * Transforms the success value inside a RemoteData.
2409
2483
  *
2484
+ * @see {@link RemoteData.chain} to sequence operations that themselves return a RemoteData.
2485
+ * @see {@link RemoteData.mapError} to transform the error value instead of the success value.
2486
+ *
2410
2487
  * @example
2411
2488
  * ```ts
2412
2489
  * pipe(RemoteData.make.success(5), RemoteData.map(n => n * 2)); // Success(10)
2413
2490
  * pipe(RemoteData.make.loading(), RemoteData.map(n => n * 2)); // Loading
2414
2491
  * ```
2415
2492
  */
2416
- map: <A, B>(f: (a: A) => B) => <E>(data: RemoteData<E, A>) => RemoteData<E, B>;
2493
+ map: <A, B>(transform: (value: A) => B) => <E>(remoteData: RemoteData<E, A>) => RemoteData<E, B>;
2417
2494
  /**
2418
2495
  * Transforms the error value inside a RemoteData.
2419
2496
  *
2497
+ * @see {@link RemoteData.map} to transform the success value instead of the error value.
2498
+ *
2420
2499
  * @example
2421
2500
  * ```ts
2422
2501
  * pipe(RemoteData.make.failure("oops"), RemoteData.mapError(e => e.toUpperCase())); // Failure("OOPS")
2423
2502
  * ```
2424
2503
  */
2425
- mapError: <E, F>(f: (e: E) => F) => <A>(data: RemoteData<E, A>) => RemoteData<F, A>;
2504
+ mapError: <E, F>(transform: (error: E) => F) => <A>(remoteData: RemoteData<E, A>) => RemoteData<F, A>;
2426
2505
  /**
2427
- * Chains RemoteData computations. If the input is Success, passes the value to f.
2506
+ * Chains RemoteData computations. If the input is Success, passes the value to transform.
2428
2507
  * Otherwise, propagates the current state.
2429
2508
  *
2509
+ * @see {@link RemoteData.map} to transform the success value without returning a new RemoteData.
2510
+ *
2430
2511
  * @example
2431
2512
  * ```ts
2432
2513
  * pipe(
@@ -2435,7 +2516,7 @@ declare const RemoteData: {
2435
2516
  * );
2436
2517
  * ```
2437
2518
  */
2438
- chain: <E2, A, B>(f: (a: A) => RemoteData<E2, B>) => <E1 = never>(data: RemoteData<E1, A>) => RemoteData<E1 | E2, B>;
2519
+ chain: <E2, A, B>(transform: (value: A) => RemoteData<E2, B>) => <E1 = never>(remoteData: RemoteData<E1, A>) => RemoteData<E1 | E2, B>;
2439
2520
  /**
2440
2521
  * Applies a function wrapped in a RemoteData to a value wrapped in a RemoteData.
2441
2522
  *
@@ -2444,21 +2525,23 @@ declare const RemoteData: {
2444
2525
  * const add = (a: number) => (b: number) => a + b;
2445
2526
  * pipe(
2446
2527
  * RemoteData.make.success(add),
2447
- * RemoteData.ap(RemoteData.make.success(5)),
2448
- * RemoteData.ap(RemoteData.make.success(3))
2528
+ * RemoteData.apply(RemoteData.make.success(5)),
2529
+ * RemoteData.apply(RemoteData.make.success(3))
2449
2530
  * ); // Success(8)
2450
2531
  * ```
2451
2532
  */
2452
- ap: <E, A>(arg: RemoteData<E, A>) => <B>(data: RemoteData<E, (a: A) => B>) => RemoteData<E, B>;
2533
+ apply: <E2, A>(arg: RemoteData<E2, A>) => <E1, B>(remoteData: RemoteData<E1, (value: A) => B>) => RemoteData<E1 | E2, B>;
2453
2534
  /**
2454
2535
  * Extracts the value from a RemoteData by providing handlers for all four cases.
2455
2536
  *
2537
+ * @see {@link RemoteData.match} for named-case pattern matching with an object literal.
2538
+ *
2456
2539
  * @example
2457
2540
  * ```ts
2458
2541
  * pipe(
2459
2542
  * userData,
2460
2543
  * RemoteData.fold(
2461
- * e => `Error: ${e}`,
2544
+ * error => `Error: ${error}`,
2462
2545
  * () => "Not asked",
2463
2546
  * () => "Loading...",
2464
2547
  * value => `Got: ${value}`
@@ -2466,10 +2549,12 @@ declare const RemoteData: {
2466
2549
  * );
2467
2550
  * ```
2468
2551
  */
2469
- fold: <E, A, B>(onFailure: (e: E) => B, onNotAsked: () => B, onLoading: () => B, onSuccess: (a: A) => B) => (data: RemoteData<E, A>) => B;
2552
+ fold: <E, A, B>(onFailure: (error: E) => B, onNotAsked: () => B, onLoading: () => B, onSuccess: (value: A) => B) => (remoteData: RemoteData<E, A>) => B;
2470
2553
  /**
2471
2554
  * Pattern matches on a RemoteData, returning the result of the matching case.
2472
2555
  *
2556
+ * @see {@link RemoteData.fold} for positional argument pattern matching.
2557
+ *
2473
2558
  * @example
2474
2559
  * ```ts
2475
2560
  * pipe(
@@ -2477,7 +2562,7 @@ declare const RemoteData: {
2477
2562
  * RemoteData.match({
2478
2563
  * notAsked: () => "Click to load",
2479
2564
  * loading: () => "Loading...",
2480
- * failure: e => `Error: ${e}`,
2565
+ * failure: error => `Error: ${error}`,
2481
2566
  * success: user => `Hello, ${user.name}!`
2482
2567
  * })
2483
2568
  * );
@@ -2486,13 +2571,15 @@ declare const RemoteData: {
2486
2571
  match: <E, A, B>(cases: {
2487
2572
  notAsked: () => B;
2488
2573
  loading: () => B;
2489
- failure: (e: E) => B;
2490
- success: (a: A) => B;
2491
- }) => (data: RemoteData<E, A>) => B;
2574
+ failure: (error: E) => B;
2575
+ success: (value: A) => B;
2576
+ }) => (remoteData: RemoteData<E, A>) => B;
2492
2577
  /**
2493
2578
  * Returns the success value or a default value if the RemoteData is not Success.
2494
2579
  * The default can be a different type, widening the result to `A | B`.
2495
2580
  *
2581
+ * @see {@link RemoteData.fold} to handle all four lifecycle states.
2582
+ *
2496
2583
  * @example
2497
2584
  * ```ts
2498
2585
  * pipe(RemoteData.make.success(5), RemoteData.getOrElse(() => 0)); // 5
@@ -2500,10 +2587,12 @@ declare const RemoteData: {
2500
2587
  * pipe(RemoteData.make.loading<string, number>(), RemoteData.getOrElse(() => null)); // null — typed as number | null
2501
2588
  * ```
2502
2589
  */
2503
- getOrElse: <B>(defaultValue: () => B) => <E, A>(data: RemoteData<E, A>) => A | B;
2590
+ getOrElse: <B>(fallback: () => B) => <E, A>(remoteData: RemoteData<E, A>) => A | B;
2504
2591
  /**
2505
2592
  * Executes a side effect on the success value without changing the RemoteData.
2506
2593
  *
2594
+ * @see {@link RemoteData.tapError} to perform a side effect on the failure error.
2595
+ *
2507
2596
  * @example
2508
2597
  * ```ts
2509
2598
  * pipe(
@@ -2513,11 +2602,13 @@ declare const RemoteData: {
2513
2602
  * );
2514
2603
  * ```
2515
2604
  */
2516
- tap: <E, A>(f: (a: A) => void) => (data: RemoteData<E, A>) => RemoteData<E, A>;
2605
+ tap: <E, A>(sideEffect: (value: A) => void) => (remoteData: RemoteData<E, A>) => RemoteData<E, A>;
2517
2606
  /**
2518
2607
  * Executes a side effect on the failure error without changing the RemoteData.
2519
2608
  * Useful for logging errors.
2520
2609
  *
2610
+ * @see {@link RemoteData.tap} to perform a side effect on the success value.
2611
+ *
2521
2612
  * @example
2522
2613
  * ```ts
2523
2614
  * pipe(
@@ -2527,18 +2618,18 @@ declare const RemoteData: {
2527
2618
  * );
2528
2619
  * ```
2529
2620
  */
2530
- tapError: <E, A>(f: (e: E) => void) => (data: RemoteData<E, A>) => RemoteData<E, A>;
2621
+ tapError: <E, A>(sideEffect: (error: E) => void) => (remoteData: RemoteData<E, A>) => RemoteData<E, A>;
2531
2622
  /**
2532
2623
  * Recovers from a Failure state by providing a fallback RemoteData.
2533
- * The fallback can produce a different success type, widening the result to `RemoteData<E, A | B>`.
2624
+ * The fallback can produce a different success type or resolve with a different error type.
2534
2625
  */
2535
- recover: <E, B>(fallback: (e: E) => RemoteData<E, B>) => <A>(data: RemoteData<E, A>) => RemoteData<E, A | B>;
2626
+ recover: <E1, E2, B>(fallback: (error: E1) => RemoteData<E2, B>) => <A>(remoteData: RemoteData<E1, A>) => RemoteData<E2, A | B>;
2536
2627
  to: {
2537
2628
  /**
2538
2629
  * Converts a RemoteData to a Maybe.
2539
2630
  * Success becomes Some, all other states become None.
2540
2631
  */
2541
- Maybe: <E, A>(data: RemoteData<E, A>) => Maybe<A>;
2632
+ Maybe: <E, A>(remoteData: RemoteData<E, A>) => Maybe<A>;
2542
2633
  /**
2543
2634
  * Converts a RemoteData to a Result.
2544
2635
  * Success becomes Ok, Failure becomes Err.
@@ -2552,7 +2643,7 @@ declare const RemoteData: {
2552
2643
  * ); // Ok(42)
2553
2644
  * ```
2554
2645
  */
2555
- Result: <E>(onNotReady: () => E) => <A>(data: RemoteData<E, A>) => Result<E, A>;
2646
+ Result: <E>(onNotReady: () => E) => <A>(remoteData: RemoteData<E, A>) => Result<E, A>;
2556
2647
  };
2557
2648
  from: {
2558
2649
  /**
@@ -2565,7 +2656,7 @@ declare const RemoteData: {
2565
2656
  * setState(RemoteData.from.Result(result)); // Success(user) or Failure(msg)
2566
2657
  * ```
2567
2658
  */
2568
- Result: <E, A>(data: Result<E, A>) => RemoteData<E, A>;
2659
+ Result: <E, A>(result: Result<E, A>) => RemoteData<E, A>;
2569
2660
  /**
2570
2661
  * Converts a Maybe to a RemoteData.
2571
2662
  * Some becomes Success, None becomes Failure using the onNone error producer.
@@ -2576,7 +2667,7 @@ declare const RemoteData: {
2576
2667
  * pipe(Maybe.make.none(), RemoteData.from.Maybe(() => "not found")); // Failure("not found")
2577
2668
  * ```
2578
2669
  */
2579
- Maybe: <E>(onNone: () => E) => <A>(data: Maybe<A>) => RemoteData<E, A>;
2670
+ Maybe: <E>(onNone: () => E) => <A>(maybe: Maybe<A>) => RemoteData<E, A>;
2580
2671
  };
2581
2672
  /**
2582
2673
  * Filters a `Success` value. When the predicate passes, the value is kept. When it fails,
@@ -2591,7 +2682,7 @@ declare const RemoteData: {
2591
2682
  * RemoteData.filter(n => n > 0, () => "error")(RemoteData.make.loading()); // Loading
2592
2683
  * ```
2593
2684
  */
2594
- filter: <E, A>(pred: (a: A) => boolean, onFalse: (a: A) => E) => (data: RemoteData<E, A>) => RemoteData<E, A>;
2685
+ filter: <E, A>(predicate: (value: A) => boolean, onFalse: (value: A) => E) => (remoteData: RemoteData<E, A>) => RemoteData<E, A>;
2595
2686
  };
2596
2687
  //#endregion
2597
2688
  //#region src/Core/Resource.d.ts
@@ -2731,12 +2822,14 @@ declare const Result: {
2731
2822
  * Result.make.err("Error message"); // Err("Error message")
2732
2823
  * ```
2733
2824
  */
2734
- err: <E>(e: E) => Err$1<E>;
2825
+ err: <E>(error: E) => Err$1<E>;
2735
2826
  };
2736
2827
  is: {
2737
2828
  /**
2738
2829
  * Type guard that checks if a Result is Ok.
2739
2830
  *
2831
+ * @see {@link Result.is.err} to check if a Result is an Err failure.
2832
+ *
2740
2833
  * @example
2741
2834
  * ```ts
2742
2835
  * const res = Result.make.ok(42);
@@ -2745,10 +2838,12 @@ declare const Result: {
2745
2838
  * }
2746
2839
  * ```
2747
2840
  */
2748
- ok: <E, A>(data: Result<E, A>) => data is Ok$1<A>;
2841
+ ok: <E, A>(result: Result<E, A>) => result is Ok$1<A>;
2749
2842
  /**
2750
2843
  * Type guard that checks if a Result is Err.
2751
2844
  *
2845
+ * @see {@link Result.is.ok} to check if a Result is an Ok success.
2846
+ *
2752
2847
  * @example
2753
2848
  * ```ts
2754
2849
  * const res = Result.make.err("failed");
@@ -2757,7 +2852,7 @@ declare const Result: {
2757
2852
  * }
2758
2853
  * ```
2759
2854
  */
2760
- err: <E, A>(data: Result<E, A>) => data is Err$1<E>;
2855
+ err: <E, A>(result: Result<E, A>) => result is Err$1<E>;
2761
2856
  };
2762
2857
  /**
2763
2858
  * Creates a Result from a synchronous thunk that may throw.
@@ -2767,36 +2862,43 @@ declare const Result: {
2767
2862
  * ```ts
2768
2863
  * const result = Result.tryCatch(
2769
2864
  * () => JSON.parse(rawString),
2770
- * { onError: (e) => `Parse error: ${e}` }
2865
+ * { onError: (error) => `Parse error: ${error}` }
2771
2866
  * );
2772
2867
  * ```
2773
2868
  */
2774
- tryCatch: <E, A>(f: () => A, options: {
2775
- onError: (e: unknown) => E;
2869
+ tryCatch: <E, A>(fn: () => A, options: {
2870
+ onError: (error: unknown) => E;
2776
2871
  }) => Result<E, A>;
2777
2872
  /**
2778
2873
  * Transforms the success value inside a Result.
2779
2874
  *
2875
+ * @see {@link Result.chain} to sequence operations that themselves return a Result.
2876
+ * @see {@link Result.mapError} to transform the error value instead of the success value.
2877
+ *
2780
2878
  * @example
2781
2879
  * ```ts
2782
2880
  * pipe(Result.make.ok(5), Result.map(n => n * 2)); // Ok(10)
2783
2881
  * pipe(Result.make.err("error"), Result.map(n => n * 2)); // Err("error")
2784
2882
  * ```
2785
2883
  */
2786
- map: <E, A, B>(f: (a: A) => B) => (data: Result<E, A>) => Result<E, B>;
2884
+ map: <E, A, B>(transform: (value: A) => B) => (result: Result<E, A>) => Result<E, B>;
2787
2885
  /**
2788
2886
  * Transforms the error value inside a Result.
2789
2887
  *
2888
+ * @see {@link Result.map} to transform the success value instead of the error value.
2889
+ *
2790
2890
  * @example
2791
2891
  * ```ts
2792
2892
  * pipe(Result.make.err("oops"), Result.mapError(e => e.toUpperCase())); // Err("OOPS")
2793
2893
  * ```
2794
2894
  */
2795
- mapError: <E, F, A>(f: (e: E) => F) => (data: Result<E, A>) => Result<F, A>;
2895
+ mapError: <E, F, A>(transform: (error: E) => F) => (result: Result<E, A>) => Result<F, A>;
2796
2896
  /**
2797
- * Chains Result computations. If the first is Ok, passes the value to f.
2897
+ * Chains Result computations. If the first is Ok, passes the value to transform.
2798
2898
  * If the first is Err, propagates the error.
2799
2899
  *
2900
+ * @see {@link Result.map} to transform the inner value without returning a new Result.
2901
+ *
2800
2902
  * @example
2801
2903
  * ```ts
2802
2904
  * const validatePositive = (n: number): Result<string, number> =>
@@ -2806,25 +2908,29 @@ declare const Result: {
2806
2908
  * pipe(Result.make.ok(-1), Result.chain(validatePositive)); // Err("Must be positive")
2807
2909
  * ```
2808
2910
  */
2809
- chain: <E2, A, B>(f: (a: A) => Result<E2, B>) => <E1 = never>(data: Result<E1, A>) => Result<E1 | E2, B>;
2911
+ chain: <E2, A, B>(transform: (value: A) => Result<E2, B>) => <E1 = never>(result: Result<E1, A>) => Result<E1 | E2, B>;
2810
2912
  /**
2811
2913
  * Extracts the value from a Result by providing handlers for both cases.
2812
2914
  *
2915
+ * @see {@link Result.match} for named-case pattern matching with an object literal.
2916
+ *
2813
2917
  * @example
2814
2918
  * ```ts
2815
2919
  * pipe(
2816
2920
  * Result.make.ok(5),
2817
2921
  * Result.fold(
2818
- * e => `Error: ${e}`,
2819
- * n => `Value: ${n}`
2922
+ * error => `Error: ${error}`,
2923
+ * value => `Value: ${value}`
2820
2924
  * )
2821
2925
  * ); // "Value: 5"
2822
2926
  * ```
2823
2927
  */
2824
- fold: <E, A, B>(onErr: (e: E) => B, onOk: (a: A) => B) => (data: Result<E, A>) => B;
2928
+ fold: <E, A, B>(onErr: (error: E) => B, onOk: (value: A) => B) => (result: Result<E, A>) => B;
2825
2929
  /**
2826
2930
  * Pattern matches on a Result, returning the result of the matching case.
2827
2931
  *
2932
+ * @see {@link Result.fold} for positional argument pattern matching.
2933
+ *
2828
2934
  * @example
2829
2935
  * ```ts
2830
2936
  * pipe(
@@ -2837,14 +2943,16 @@ declare const Result: {
2837
2943
  * ```
2838
2944
  */
2839
2945
  match: <E, A, B>(cases: {
2840
- ok: (a: A) => B;
2841
- err: (e: E) => B;
2842
- }) => (data: Result<E, A>) => B;
2946
+ ok: (value: A) => B;
2947
+ err: (error: E) => B;
2948
+ }) => (result: Result<E, A>) => B;
2843
2949
  /**
2844
2950
  * Returns the success value or a default value if the Result is an error.
2845
2951
  * The default is a thunk `() => B` — evaluated only when the Result is Err.
2846
2952
  * The default can be a different type, widening the result to `A | B`.
2847
2953
  *
2954
+ * @see {@link Result.fold} to handle both the Ok and Err cases.
2955
+ *
2848
2956
  * @example
2849
2957
  * ```ts
2850
2958
  * pipe(Result.make.ok(5), Result.getOrElse(() => 0)); // 5
@@ -2852,11 +2960,13 @@ declare const Result: {
2852
2960
  * pipe(Result.make.err("error"), Result.getOrElse(() => null)); // null — typed as number | null
2853
2961
  * ```
2854
2962
  */
2855
- getOrElse: <B>(defaultValue: () => B) => <E, A>(data: Result<E, A>) => A | B;
2963
+ getOrElse: <B>(fallback: () => B) => <E, A>(result: Result<E, A>) => A | B;
2856
2964
  /**
2857
2965
  * Executes a side effect on the success value without changing the Result.
2858
2966
  * Useful for logging or debugging.
2859
2967
  *
2968
+ * @see {@link Result.tapError} to perform a side effect on the error value.
2969
+ *
2860
2970
  * @example
2861
2971
  * ```ts
2862
2972
  * pipe(
@@ -2866,11 +2976,13 @@ declare const Result: {
2866
2976
  * );
2867
2977
  * ```
2868
2978
  */
2869
- tap: <E, A>(f: (a: A) => void) => (data: Result<E, A>) => Result<E, A>;
2979
+ tap: <E, A>(sideEffect: (value: A) => void) => (result: Result<E, A>) => Result<E, A>;
2870
2980
  /**
2871
2981
  * Executes a side effect on the error value without changing the Result.
2872
2982
  * Useful for logging or reporting errors.
2873
2983
  *
2984
+ * @see {@link Result.tap} to perform a side effect on the success value.
2985
+ *
2874
2986
  * @example
2875
2987
  * ```ts
2876
2988
  * pipe(
@@ -2880,7 +2992,7 @@ declare const Result: {
2880
2992
  * )
2881
2993
  * ```
2882
2994
  */
2883
- tapError: <E, A>(f: (e: E) => void) => (data: Result<E, A>) => Result<E, A>;
2995
+ tapError: <E, A>(sideEffect: (error: E) => void) => (result: Result<E, A>) => Result<E, A>;
2884
2996
  from: {
2885
2997
  /**
2886
2998
  * Creates a Result from a predicate applied to a value.
@@ -2893,7 +3005,7 @@ declare const Result: {
2893
3005
  * pipe("", Result.from.Predicate(s => s.length > 0, () => "empty string")); // Err("empty string")
2894
3006
  * ```
2895
3007
  */
2896
- Predicate: <E, A>(pred: (a: A) => boolean, onFalse: (a: A) => E) => (a: A) => Result<E, A>;
3008
+ Predicate: <E, A>(predicate: (value: A) => boolean, onFalse: (value: A) => E) => (value: A) => Result<E, A>;
2897
3009
  /**
2898
3010
  * Creates a Result from a nullable value.
2899
3011
  * Returns Ok if the value is not null or undefined, error from onNull otherwise.
@@ -2925,16 +3037,20 @@ declare const Result: {
2925
3037
  * Result.from.Validation((errors) => errors.join(", "))(Validation.make.failed("error1")); // Err("error1")
2926
3038
  * ```
2927
3039
  */
2928
- Validation: <E1, E2, A>(combineErrors: (errors: NonEmptyArr<E1>) => E2) => (val: Validation<E1, A>) => Result<E2, A>;
3040
+ Validation: <E1, E2, A>(combineErrors: (errors: NonEmptyArr<E1>) => E2) => (validation: Validation<E1, A>) => Result<E2, A>;
2929
3041
  };
2930
3042
  /**
2931
3043
  * Recovers from an error by providing a fallback Result.
2932
- * The fallback can produce a different success type, widening the result to `Result<E, A | B>`.
3044
+ * The fallback can produce a different success type or resolve with a different error type.
3045
+ *
3046
+ * @see {@link Result.recoverUnless} to conditionally recover based on the error value.
2933
3047
  */
2934
- recover: <E, B>(fallback: (e: E) => Result<E, B>) => <A>(data: Result<E, A>) => Result<E, A | B>;
3048
+ recover: <E1, E2, B>(fallback: (error: E1) => Result<E2, B>) => <A>(result: Result<E1, A>) => Result<E2, A | B>;
2935
3049
  /**
2936
3050
  * Recovers from an error unless the predicate `isBlocked` returns true for that error.
2937
- * The fallback can produce a different success type, widening the result to `Result<E, A | B>`.
3051
+ * The fallback can produce a different success type, widening the result to `Result<E1 | E2, A | B>`.
3052
+ *
3053
+ * @see {@link Result.recover} for unconditional error recovery.
2938
3054
  *
2939
3055
  * @example
2940
3056
  * ```ts
@@ -2944,7 +3060,7 @@ declare const Result: {
2944
3060
  * ); // Ok(0)
2945
3061
  * ```
2946
3062
  */
2947
- recoverUnless: <E, B>(isBlocked: (e: E) => boolean, fallback: () => Result<E, B>) => <A>(data: Result<E, A>) => Result<E, A | B>;
3063
+ recoverUnless: <E1, E2, B>(isBlocked: (error: E1) => boolean, fallback: (error: E1) => Result<E2, B>) => <A>(result: Result<E1, A>) => Result<E1 | E2, A | B>;
2948
3064
  to: {
2949
3065
  /**
2950
3066
  * Converts a Result to a Maybe.
@@ -2956,7 +3072,7 @@ declare const Result: {
2956
3072
  * Result.to.Maybe(Result.make.err("oops")); // None
2957
3073
  * ```
2958
3074
  */
2959
- Maybe: <E, A>(data: Result<E, A>) => Maybe<A>;
3075
+ Maybe: <E, A>(result: Result<E, A>) => Maybe<A>;
2960
3076
  /**
2961
3077
  * Converts a `Result` to a `Validation`. `Ok(a)` becomes `Passed(a)`; `Err(e)` becomes `Failed([e])`.
2962
3078
  *
@@ -2966,7 +3082,7 @@ declare const Result: {
2966
3082
  * Result.to.Validation(Result.make.err("bad")); // Failed(["bad"])
2967
3083
  * ```
2968
3084
  */
2969
- Validation: <E, A>(data: Result<E, A>) => Validation<E, A>;
3085
+ Validation: <E, A>(result: Result<E, A>) => Validation<E, A>;
2970
3086
  };
2971
3087
  /**
2972
3088
  * Swaps the outer `Result` and inner `Maybe` context.
@@ -2979,7 +3095,7 @@ declare const Result: {
2979
3095
  * Result.transposeMaybe(Result.make.err("error")); // Some(Err("error"))
2980
3096
  * ```
2981
3097
  */
2982
- transposeMaybe: <E, A>(data: Result<E, Maybe<A>>) => Maybe<Result<E, A>>;
3098
+ transposeMaybe: <E, A>(result: Result<E, Maybe<A>>) => Maybe<Result<E, A>>;
2983
3099
  /**
2984
3100
  * Applies a function wrapped in a Result to a value wrapped in a Result.
2985
3101
  *
@@ -2988,12 +3104,12 @@ declare const Result: {
2988
3104
  * const add = (a: number) => (b: number) => a + b;
2989
3105
  * pipe(
2990
3106
  * Result.make.ok(add),
2991
- * Result.ap(Result.make.ok(5)),
2992
- * Result.ap(Result.make.ok(3))
3107
+ * Result.apply(Result.make.ok(5)),
3108
+ * Result.apply(Result.make.ok(3))
2993
3109
  * ); // Ok(8)
2994
3110
  * ```
2995
3111
  */
2996
- ap: <E, A>(arg: Result<E, A>) => <B>(data: Result<E, (a: A) => B>) => Result<E, B>;
3112
+ apply: <E2, A>(arg: Result<E2, A>) => <E1, B>(result: Result<E1, (value: A) => B>) => Result<E1 | E2, B>;
2997
3113
  /**
2998
3114
  * Converts a Result value into an object containing a single property.
2999
3115
  * Initiates the pipeline accumulator record.
@@ -3003,7 +3119,7 @@ declare const Result: {
3003
3119
  * pipe(Result.make.ok(42), Result.bindTo("value")); // Ok({ value: 42 })
3004
3120
  * ```
3005
3121
  */
3006
- bindTo: <K extends string>(key: K) => <E, A>(data: Result<E, A>) => Result<E, { [P in K]: A; }>;
3122
+ bindTo: <K extends string>(key: K) => <E, A>(result: Result<E, A>) => Result<E, { [P in K]: A; }>;
3007
3123
  /**
3008
3124
  * Evaluates a new Result using the current accumulator and attaches the output to a new key.
3009
3125
  *
@@ -3015,7 +3131,7 @@ declare const Result: {
3015
3131
  * ); // Ok({ a: 1, b: 2 })
3016
3132
  * ```
3017
3133
  */
3018
- 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; }>;
3134
+ bind: <K extends string, E2, A, B>(key: K, transform: (value: A) => Result<E2, B>) => <E1 = never>(result: Result<E1, A>) => Result<E1 | E2, A & { [P in K]: B; }>;
3019
3135
  /**
3020
3136
  * Combines a record of Results into a single Result of a record.
3021
3137
  * Evaluates fields in key order and short-circuits on the first failure.
@@ -3030,7 +3146,7 @@ declare const Result: {
3030
3146
  */
3031
3147
  struct: <E, R extends Record<string, any>>(fields: { [K in keyof R]: Result<E, R[K]>; }) => Result<E, R>;
3032
3148
  /**
3033
- * Narrows an `Ok` value with a predicate, converting to `Err(onFail(a))` if the predicate returns false.
3149
+ * Narrows an `Ok` value with a predicate, converting to `Err(onFail(value))` if the predicate returns false.
3034
3150
  *
3035
3151
  * @example
3036
3152
  * ```ts
@@ -3040,7 +3156,7 @@ declare const Result: {
3040
3156
  * ); // Err("Age 15 is below 18")
3041
3157
  * ```
3042
3158
  */
3043
- ensure: <A, E2>(predicate: (a: A) => boolean, onFail: (a: A) => E2) => <E1 = never>(data: Result<E1, A>) => Result<E1 | E2, A>;
3159
+ ensure: <A, E2>(predicate: (value: A) => boolean, onFail: (value: A) => E2) => <E1 = never>(result: Result<E1, A>) => Result<E1 | E2, A>;
3044
3160
  /**
3045
3161
  * Transforms both branches of a Result simultaneously.
3046
3162
  * Applies `onErr` to `Err` values and `onOk` to `Ok` values.
@@ -3056,7 +3172,7 @@ declare const Result: {
3056
3172
  * ); // Ok(10)
3057
3173
  * ```
3058
3174
  */
3059
- bimap: <E1, E2, A, B>(onErr: (e: E1) => E2, onOk: (a: A) => B) => (data: Result<E1, A>) => Result<E2, B>;
3175
+ bimap: <E1, E2, A, B>(onErr: (error: E1) => E2, onOk: (value: A) => B) => (result: Result<E1, A>) => Result<E2, B>;
3060
3176
  };
3061
3177
  //#endregion
3062
3178
  //#region src/Core/State.d.ts
@@ -3186,14 +3302,14 @@ declare const State$1: {
3186
3302
  * const addCounted = (n: number) => (m: number) => n + m;
3187
3303
  * const program = pipe(
3188
3304
  * State.resolve<number, typeof addCounted>(addCounted),
3189
- * State.ap(State.gets((s: number) => s * 2)),
3190
- * State.ap(State.gets((s: number) => s)),
3305
+ * State.apply(State.gets((s: number) => s * 2)),
3306
+ * State.apply(State.gets((s: number) => s)),
3191
3307
  * );
3192
3308
  *
3193
3309
  * State.evaluate(3)(program); // 6 + 3 = 9
3194
3310
  * ```
3195
3311
  */
3196
- ap: <S, A>(arg: State$1<S, A>) => <B>(fn: State$1<S, (a: A) => B>) => State$1<S, B>;
3312
+ apply: <S, A>(arg: State$1<S, A>) => <B>(fn: State$1<S, (a: A) => B>) => State$1<S, B>;
3197
3313
  /**
3198
3314
  * Runs a side effect on the produced value without changing the State computation.
3199
3315
  *
@@ -3314,8 +3430,8 @@ declare const State$1: {
3314
3430
  type Validation<E, A> = Passed<A> | Failed<E>;
3315
3431
  type Passed<A> = WithKind<"Passed"> & WithValue<A>;
3316
3432
  type Failed<E> = WithKind<"Failed"> & WithErrors<E>;
3317
- declare function toResult<E1, E2, A>(combineErrors: (errors: NonEmptyArr<E1>) => E2): (val: Validation<E1, A>) => Result<E2, A>;
3318
- declare function toResult<E, A>(data: Validation<E, A>): Result<NonEmptyArr<E>, A>;
3433
+ declare function toResult<E1, E2, A>(combineErrors: (errors: NonEmptyArr<E1>) => E2): (validation: Validation<E1, A>) => Result<E2, A>;
3434
+ declare function toResult<E, A>(validation: Validation<E, A>): Result<NonEmptyArr<E>, A>;
3319
3435
  declare const Validation: {
3320
3436
  make: {
3321
3437
  /**
@@ -3350,6 +3466,8 @@ declare const Validation: {
3350
3466
  /**
3351
3467
  * Type guard that checks if a Validation is passed.
3352
3468
  *
3469
+ * @see {@link Validation.is.failed} to check if a Validation is failed.
3470
+ *
3353
3471
  * @example
3354
3472
  * ```ts
3355
3473
  * const v = Validation.make.passed(42);
@@ -3358,10 +3476,12 @@ declare const Validation: {
3358
3476
  * }
3359
3477
  * ```
3360
3478
  */
3361
- passed: <E, A>(data: Validation<E, A>) => data is Passed<A>;
3479
+ passed: <E, A>(validation: Validation<E, A>) => validation is Passed<A>;
3362
3480
  /**
3363
3481
  * Type guard that checks if a Validation is failed.
3364
3482
  *
3483
+ * @see {@link Validation.is.passed} to check if a Validation is passed.
3484
+ *
3365
3485
  * @example
3366
3486
  * ```ts
3367
3487
  * const v = Validation.make.failed("invalid");
@@ -3370,7 +3490,7 @@ declare const Validation: {
3370
3490
  * }
3371
3491
  * ```
3372
3492
  */
3373
- failed: <E, A>(data: Validation<E, A>) => data is Failed<E>;
3493
+ failed: <E, A>(validation: Validation<E, A>) => validation is Failed<E>;
3374
3494
  };
3375
3495
  /**
3376
3496
  * Creates a Validation from a synchronous thunk that may throw.
@@ -3380,12 +3500,12 @@ declare const Validation: {
3380
3500
  * ```ts
3381
3501
  * const result = Validation.tryCatch(
3382
3502
  * () => JSON.parse(rawString),
3383
- * { onError: (e) => `Parse error: ${e}` }
3503
+ * { onError: (error) => `Parse error: ${error}` }
3384
3504
  * );
3385
3505
  * ```
3386
3506
  */
3387
- tryCatch: <E, A>(f: () => A, options: {
3388
- onError: (e: unknown) => E;
3507
+ tryCatch: <E, A>(fn: () => A, options: {
3508
+ onError: (error: unknown) => E;
3389
3509
  }) => Validation<E, A>;
3390
3510
  from: {
3391
3511
  /**
@@ -3403,7 +3523,7 @@ declare const Validation: {
3403
3523
  * validateName(""); // Failed(["Name is required"])
3404
3524
  * ```
3405
3525
  */
3406
- Predicate: <E, A>(pred: (a: A) => boolean, onFalse: (a: A) => E) => (a: A) => Validation<E, A>;
3526
+ Predicate: <E, A>(predicate: (value: A) => boolean, onFalse: (value: A) => E) => (value: A) => Validation<E, A>;
3407
3527
  /**
3408
3528
  * Creates a Validation from a nullable value.
3409
3529
  * If the value is null or undefined, returns Failed with the error from onNull.
@@ -3440,63 +3560,71 @@ declare const Validation: {
3440
3560
  * Validation.from.Result(Result.make.err("bad")); // Failed(["bad"])
3441
3561
  * ```
3442
3562
  */
3443
- Result: <E, A>(data: Result<E, A>) => Validation<E, A>;
3563
+ Result: <E, A>(result: Result<E, A>) => Validation<E, A>;
3444
3564
  };
3445
3565
  /**
3446
3566
  * Transforms the success value inside a Validation.
3447
3567
  *
3568
+ * @see {@link Validation.mapError} to transform accumulated errors.
3569
+ * @see {@link Validation.apply} to combine multiple validations.
3570
+ *
3448
3571
  * @example
3449
3572
  * ```ts
3450
3573
  * pipe(Validation.make.passed(5), Validation.map(n => n * 2)); // Passed(10)
3451
3574
  * pipe(Validation.make.failed("oops"), Validation.map(n => n * 2)); // Failed(["oops"])
3452
3575
  * ```
3453
3576
  */
3454
- map: <A, B>(f: (a: A) => B) => <E>(data: Validation<E, A>) => Validation<E, B>;
3577
+ map: <A, B>(transform: (value: A) => B) => <E>(validation: Validation<E, A>) => Validation<E, B>;
3455
3578
  /**
3456
3579
  * Transforms the error list inside a Validation.
3457
3580
  *
3581
+ * @see {@link Validation.map} to transform the success value.
3582
+ *
3458
3583
  * @example
3459
3584
  * ```ts
3460
3585
  * pipe(Validation.make.failed("oops"), Validation.mapError(e => e.toUpperCase())); // Failed(["OOPS"])
3461
3586
  * ```
3462
3587
  */
3463
- mapError: <E, F, A>(f: (e: E) => F) => (data: Validation<E, A>) => Validation<F, A>;
3588
+ mapError: <E, F, A>(transform: (error: E) => F) => (validation: Validation<E, A>) => Validation<F, A>;
3464
3589
  /**
3465
3590
  * Applies a function wrapped in a Validation to a value wrapped in a Validation.
3466
- * Accumulates errors from both sides.
3591
+ * Accumulates errors from both sides if both fail, using optional `combineErrors`
3592
+ * or default concatenation.
3593
+ *
3594
+ * @see {@link Validation.product} to combine two validations into a tuple.
3467
3595
  *
3468
3596
  * @example
3469
3597
  * ```ts
3470
3598
  * const add = (a: number) => (b: number) => a + b;
3471
3599
  * pipe(
3472
3600
  * Validation.make.passed(add),
3473
- * Validation.ap(Validation.make.passed(5)),
3474
- * Validation.ap(Validation.make.passed(3))
3601
+ * Validation.apply(Validation.make.passed(5)),
3602
+ * Validation.apply(Validation.make.passed(3))
3475
3603
  * ); // Passed(8)
3476
3604
  *
3477
3605
  * pipe(
3478
3606
  * Validation.make.passed(add),
3479
- * Validation.ap(Validation.make.failed<string>("bad a")),
3480
- * Validation.ap(Validation.make.failed<string>("bad b"))
3607
+ * Validation.apply(Validation.make.failed<string>("bad a")),
3608
+ * Validation.apply(Validation.make.failed<string>("bad b"))
3481
3609
  * ); // Failed(["bad a", "bad b"])
3482
- * ```
3483
- */
3484
- ap: <E, A>(arg: Validation<E, A>) => <B>(data: Validation<E, (a: A) => B>) => Validation<E, B>;
3485
- /**
3486
- * Applies a function wrapped in a Validation to a value wrapped in a Validation,
3487
- * using a custom error concatenator function when both sides fail.
3488
3610
  *
3489
- * @example
3490
- * ```ts
3491
- * const concat = (e1: NonEmptyArr<string>, e2: NonEmptyArr<string>): NonEmptyArr<string> =>
3492
- * [...e1, ...e2];
3493
- * pipe(fnVal, Validation.apCustom(concat)(argVal));
3611
+ * // Custom error combination:
3612
+ * pipe(
3613
+ * Validation.make.passed(add),
3614
+ * Validation.apply(Validation.make.failed("err"), {
3615
+ * combineErrors: (e1, e2) => [...e1, ...e2],
3616
+ * })
3617
+ * );
3494
3618
  * ```
3495
3619
  */
3496
- apCustom: <E1, E2, E3>(concat: (e1: NonEmptyArr<E1>, e2: NonEmptyArr<E2>) => NonEmptyArr<E3>) => <A>(arg: Validation<E2, A>) => <B>(data: Validation<E1, (a: A) => B>) => Validation<E3, B>;
3620
+ apply: <E2, A, E3 = never>(arg: Validation<E2, A>, options?: {
3621
+ combineErrors?: (e1: NonEmptyArr<any>, e2: NonEmptyArr<E2>) => NonEmptyArr<E3>;
3622
+ }) => <B, E1 = never>(validation: Validation<E1, (value: A) => B>) => Validation<[E3] extends [never] ? E1 | E2 : E3, B>;
3497
3623
  /**
3498
3624
  * Extracts the value from a Validation by providing handlers for both cases.
3499
3625
  *
3626
+ * @see {@link Validation.match} for named-case pattern matching with an object literal.
3627
+ *
3500
3628
  * @example
3501
3629
  * ```ts
3502
3630
  * pipe(
@@ -3508,10 +3636,12 @@ declare const Validation: {
3508
3636
  * );
3509
3637
  * ```
3510
3638
  */
3511
- fold: <E, A, B>(onFailed: (errors: NonEmptyArr<E>) => B, onPassed: (a: A) => B) => (data: Validation<E, A>) => B;
3639
+ fold: <E, A, B>(onFailed: (errors: NonEmptyArr<E>) => B, onPassed: (value: A) => B) => (validation: Validation<E, A>) => B;
3512
3640
  /**
3513
3641
  * Pattern matches on a Validation, returning the result of the matching case.
3514
3642
  *
3643
+ * @see {@link Validation.fold} for positional argument pattern matching.
3644
+ *
3515
3645
  * @example
3516
3646
  * ```ts
3517
3647
  * pipe(
@@ -3524,13 +3654,15 @@ declare const Validation: {
3524
3654
  * ```
3525
3655
  */
3526
3656
  match: <E, A, B>(cases: {
3527
- passed: (a: A) => B;
3657
+ passed: (value: A) => B;
3528
3658
  failed: (errors: NonEmptyArr<E>) => B;
3529
- }) => (data: Validation<E, A>) => B;
3659
+ }) => (validation: Validation<E, A>) => B;
3530
3660
  /**
3531
3661
  * Returns the success value or a default value if the Validation is failed.
3532
3662
  * The default can be a different type, widening the result to `A | B`.
3533
3663
  *
3664
+ * @see {@link Validation.fold} to handle both the passed and failed cases.
3665
+ *
3534
3666
  * @example
3535
3667
  * ```ts
3536
3668
  * pipe(Validation.make.passed(5), Validation.getOrElse(() => 0)); // 5
@@ -3538,10 +3670,12 @@ declare const Validation: {
3538
3670
  * pipe(Validation.make.failed("oops"), Validation.getOrElse(() => null)); // null — typed as number | null
3539
3671
  * ```
3540
3672
  */
3541
- getOrElse: <B>(defaultValue: () => B) => <E, A>(data: Validation<E, A>) => A | B;
3673
+ getOrElse: <B>(fallback: () => B) => <E, A>(validation: Validation<E, A>) => A | B;
3542
3674
  /**
3543
3675
  * Executes a side effect on the success value without changing the Validation.
3544
3676
  *
3677
+ * @see {@link Validation.tapError} to perform a side effect on accumulated errors.
3678
+ *
3545
3679
  * @example
3546
3680
  * ```ts
3547
3681
  * pipe(
@@ -3551,11 +3685,13 @@ declare const Validation: {
3551
3685
  * );
3552
3686
  * ```
3553
3687
  */
3554
- tap: <E, A>(f: (a: A) => void) => (data: Validation<E, A>) => Validation<E, A>;
3688
+ tap: <E, A>(sideEffect: (value: A) => void) => (validation: Validation<E, A>) => Validation<E, A>;
3555
3689
  /**
3556
3690
  * Executes a side effect on the accumulated errors without changing the Validation.
3557
3691
  * Useful for logging or reporting validation failures.
3558
3692
  *
3693
+ * @see {@link Validation.tap} to perform a side effect on the success value.
3694
+ *
3559
3695
  * @example
3560
3696
  * ```ts
3561
3697
  * pipe(
@@ -3565,16 +3701,20 @@ declare const Validation: {
3565
3701
  * );
3566
3702
  * ```
3567
3703
  */
3568
- tapError: <E, A>(f: (errors: NonEmptyArr<E>) => void) => (data: Validation<E, A>) => Validation<E, A>;
3704
+ tapError: <E, A>(sideEffect: (errors: NonEmptyArr<E>) => void) => (validation: Validation<E, A>) => Validation<E, A>;
3569
3705
  /**
3570
3706
  * Recovers from a Failed state by providing a fallback Validation.
3571
3707
  * The fallback receives the accumulated error list so callers can inspect which errors occurred.
3572
- * The fallback can produce a different success type, widening the result to `Validation<E, A | B>`.
3708
+ * The fallback can produce a different success type or resolve with a different error type.
3709
+ *
3710
+ * @see {@link Validation.recoverUnless} to conditionally recover based on accumulated errors.
3573
3711
  */
3574
- recover: <E, B>(fallback: (errors: NonEmptyArr<E>) => Validation<E, B>) => <A>(data: Validation<E, A>) => Validation<E, A | B>;
3712
+ recover: <E1, E2, B>(fallback: (errors: NonEmptyArr<E1>) => Validation<E2, B>) => <A>(validation: Validation<E1, A>) => Validation<E2, A | B>;
3575
3713
  /**
3576
3714
  * Recovers from a Failed state unless `isBlocked` returns true for any of the accumulated errors.
3577
- * The fallback can produce a different success type, widening the result to `Validation<E, A | B>`.
3715
+ * The fallback can produce a different success type, widening the result to `Validation<E1 | E2, A | B>`.
3716
+ *
3717
+ * @see {@link Validation.recover} for unconditional error recovery.
3578
3718
  *
3579
3719
  * @example
3580
3720
  * ```ts
@@ -3584,7 +3724,7 @@ declare const Validation: {
3584
3724
  * ); // Passed(0)
3585
3725
  * ```
3586
3726
  */
3587
- recoverUnless: <E, B>(isBlocked: (e: E) => boolean, fallback: () => Validation<E, B>) => <A>(data: Validation<E, A>) => Validation<E, A | B>;
3727
+ recoverUnless: <E1, E2, B>(isBlocked: (error: E1) => boolean, fallback: (errors: NonEmptyArr<E1>) => Validation<E2, B>) => <A>(validation: Validation<E1, A>) => Validation<E1 | E2, A | B>;
3588
3728
  to: {
3589
3729
  /**
3590
3730
  * Converts a Validation to a Result.
@@ -3610,13 +3750,16 @@ declare const Validation: {
3610
3750
  * Validation.to.Maybe(Validation.make.failed("bad")); // None
3611
3751
  * ```
3612
3752
  */
3613
- Maybe: <E, A>(data: Validation<E, A>) => Maybe<A>;
3753
+ Maybe: <E, A>(validation: Validation<E, A>) => Maybe<A>;
3614
3754
  };
3615
3755
  /**
3616
3756
  * Combines two independent Validation instances into a tuple.
3617
3757
  * If both are Passed, returns Passed with both values as a tuple.
3618
3758
  * If either is Failed, accumulates errors from both sides.
3619
3759
  *
3760
+ * @see {@link Validation.productAll} to combine a non-empty list of validations.
3761
+ * @see {@link Validation.apply} to apply a curried function across validations.
3762
+ *
3620
3763
  * @example
3621
3764
  * ```ts
3622
3765
  * Validation.product(
@@ -3636,6 +3779,8 @@ declare const Validation: {
3636
3779
  * If all are Passed, returns Passed with all values collected into an array.
3637
3780
  * If any are Failed, returns Failed with all accumulated errors.
3638
3781
  *
3782
+ * @see {@link Validation.product} to combine exactly two validations into a pair.
3783
+ *
3639
3784
  * @example
3640
3785
  * ```ts
3641
3786
  * Validation.productAll([
@@ -3646,7 +3791,7 @@ declare const Validation: {
3646
3791
  * // Passed([name, email, age]) or Failed([...all errors])
3647
3792
  * ```
3648
3793
  */
3649
- productAll: <E, A>(data: NonEmptyArr<Validation<E, A>>) => Validation<E, readonly A[]>;
3794
+ productAll: <E, A>(validations: NonEmptyArr<Validation<E, A>>) => Validation<E, readonly A[]>;
3650
3795
  /**
3651
3796
  * Combines a record of Validations into a single Validation of a record.
3652
3797
  * Accumulates all failed branches' errors.
@@ -3665,7 +3810,87 @@ declare const Validation: {
3665
3810
  * ```
3666
3811
  */
3667
3812
  struct: <E, R extends Record<string, any>>(fields: { [K in keyof R]: Validation<E, R[K]>; }) => Validation<E, R>;
3813
+ keyed: {
3814
+ /**
3815
+ * Creates a keyed validator function from a schema of field validators.
3816
+ * Evaluates each validator against its corresponding field in the input object,
3817
+ * returning a record where every key holds its own Validation outcome.
3818
+ *
3819
+ * @example
3820
+ * ```ts
3821
+ * const validateUser = Validation.keyed.make({
3822
+ * name: (s: string) => s.length > 0 ? Validation.make.passed(s) : Validation.make.failed("Name required"),
3823
+ * age: (n: number) => n >= 18 ? Validation.make.passed(n) : Validation.make.failed("Must be 18+"),
3824
+ * });
3825
+ *
3826
+ * const result = validateUser({ name: "", age: 16 });
3827
+ * // { name: Failed(["Name required"]), age: Failed(["Must be 18+"]) }
3828
+ * ```
3829
+ */
3830
+ make: <T extends Record<string, any>, E = unknown>(validators: { readonly [K in keyof T]: (val: T[K]) => Validation<E, T[K]>; }) => (input: T) => { readonly [K in keyof T]: Validation<E, T[K]>; };
3831
+ is: {
3832
+ /**
3833
+ * Type guard checking if every keyed field is Passed.
3834
+ *
3835
+ * @see {@link Validation.keyed.is.failed} to check if any keyed field failed.
3836
+ *
3837
+ * @example
3838
+ * ```ts
3839
+ * if (Validation.keyed.is.passed(results)) {
3840
+ * // results.name is Passed<string>, results.age is Passed<number>
3841
+ * }
3842
+ * ```
3843
+ */
3844
+ passed: <T extends Record<string, any>, E>(keyed: { readonly [K in keyof T]: Validation<E, T[K]>; }) => keyed is { readonly [K in keyof T]: Passed<T[K]>; };
3845
+ /**
3846
+ * Checks if at least one keyed field is Failed.
3847
+ *
3848
+ * @see {@link Validation.keyed.is.passed} to check if all keyed fields passed.
3849
+ *
3850
+ * @example
3851
+ * ```ts
3852
+ * if (Validation.keyed.is.failed(results)) {
3853
+ * console.log("Validation errors occurred");
3854
+ * }
3855
+ * ```
3856
+ */
3857
+ failed: <T extends Record<string, any>, E>(keyed: { readonly [K in keyof T]: Validation<E, T[K]>; }) => boolean;
3858
+ };
3859
+ /**
3860
+ * Extracts all validated field values if every field passed.
3861
+ * Returns `Some(data)` if all passed, `None` if any field failed.
3862
+ *
3863
+ * @see {@link Validation.keyed.getErrors} to extract keyed field errors when failures occur.
3864
+ *
3865
+ * @example
3866
+ * ```ts
3867
+ * const passed = Validation.keyed.getPassed(results);
3868
+ * // Some({ name: "Alice", age: 30 }) or None
3869
+ * ```
3870
+ */
3871
+ getPassed: <T extends Record<string, any>, E>(keyed: { readonly [K in keyof T]: Validation<E, T[K]>; }) => Maybe<T>;
3872
+ /**
3873
+ * Extracts keyed field errors if any field failed.
3874
+ * Symmetrical to `getPassed`: returns `Some(errors)` when there are failures,
3875
+ * or `None` if every field passed.
3876
+ *
3877
+ * @see {@link Validation.keyed.getPassed} to extract keyed values when all fields pass.
3878
+ *
3879
+ * @example
3880
+ * ```ts
3881
+ * const errors = Validation.keyed.getErrors(results);
3882
+ * // Some({ name: ["Name required"] }) or None
3883
+ * ```
3884
+ */
3885
+ getErrors: <T extends Record<string, any>, E>(keyed: { readonly [K in keyof T]: Validation<E, T[K]>; }) => Maybe<Validation.KeyedErrors<T, E>>;
3886
+ };
3668
3887
  };
3888
+ declare namespace Validation {
3889
+ type Passed<A> = WithKind<"Passed"> & WithValue<A>;
3890
+ type Failed<E> = WithKind<"Failed"> & WithErrors<E>;
3891
+ type KeyedErrors<T, E = unknown> = { readonly [K in keyof T]?: NonEmptyArr<E>; };
3892
+ type KeyedResult<T, E> = { readonly [K in keyof T]: Validation<E, T[K]>; };
3893
+ }
3669
3894
  //#endregion
3670
3895
  //#region src/Core/Task.d.ts
3671
3896
  /**
@@ -3698,7 +3923,7 @@ declare const Validation: {
3698
3923
  *
3699
3924
  * @example
3700
3925
  * ```ts
3701
- * const getTimestamp: Task<number> = Task.resolve(Date.now());
3926
+ * const getTimestamp: Task<number> = Task.make(Date.now());
3702
3927
  *
3703
3928
  * // Nothing runs yet — getTimestamp is just a description
3704
3929
  * const formatted = pipe(
@@ -3717,15 +3942,15 @@ declare const Task: {
3717
3942
  *
3718
3943
  * @example
3719
3944
  * ```ts
3720
- * const task = Task.resolve(42);
3945
+ * const task = Task.make(42);
3721
3946
  * const value = await task(); // 42
3722
3947
  * ```
3723
3948
  */
3724
- resolve: <A>(value: A) => Task<A>;
3949
+ make: <A>(value: A) => Task<A>;
3725
3950
  from: {
3726
3951
  /**
3727
3952
  * Creates a Task from a lazy synchronous thunk.
3728
- * Unlike `Task.resolve(f())`, `from.sync` does not evaluate `f` until the Task is called.
3953
+ * Unlike `Task.make(f())`, `from.sync` does not evaluate `f` until the Task is called.
3729
3954
  *
3730
3955
  * @example
3731
3956
  * ```ts
@@ -3733,7 +3958,7 @@ declare const Task: {
3733
3958
  * const ts = await t(); // called here, every time
3734
3959
  * ```
3735
3960
  */
3736
- sync: <A>(f: () => A) => Task<A>;
3961
+ sync: <A>(fn: () => A) => Task<A>;
3737
3962
  };
3738
3963
  /**
3739
3964
  * Wraps a Promise-returning thunk that may throw or reject,
@@ -3747,12 +3972,14 @@ declare const Task: {
3747
3972
  * );
3748
3973
  * ```
3749
3974
  */
3750
- tryCatch: <A>(f: (signal?: AbortSignal) => globalThis.Promise<A>, options: {
3975
+ tryCatch: <A>(fn: (signal?: AbortSignal) => globalThis.Promise<A>, options: {
3751
3976
  onError: (error: unknown) => A;
3752
3977
  }) => Task<A>;
3753
3978
  /**
3754
3979
  * Transforms the value inside a Task.
3755
3980
  *
3981
+ * @see {@link Task.chain} to sequence operations that return a Task.
3982
+ *
3756
3983
  * @example
3757
3984
  * ```ts
3758
3985
  * pipe(
@@ -3761,9 +3988,11 @@ declare const Task: {
3761
3988
  * )(); // Deferred<10>
3762
3989
  * ```
3763
3990
  */
3764
- map: <A, B>(f: (a: A) => B) => (data: Task<A>) => Task<B>;
3991
+ map: <A, B>(transform: (value: A) => B) => (task: Task<A>) => Task<B>;
3765
3992
  /**
3766
- * Chains Task computations. Passes the resolved value of the first Task to f.
3993
+ * Chains Task computations. Passes the resolved value of the first Task to transform.
3994
+ *
3995
+ * @see {@link Task.map} to transform the resolved value without creating a new Task.
3767
3996
  *
3768
3997
  * @example
3769
3998
  * ```ts
@@ -3777,22 +4006,24 @@ declare const Task: {
3777
4006
  * )(); // Deferred<Preferences>
3778
4007
  * ```
3779
4008
  */
3780
- chain: <A, B>(f: (a: A) => Task<B>) => (data: Task<A>) => Task<B>;
4009
+ chain: <A, B>(transform: (value: A) => Task<B>) => (task: Task<A>) => Task<B>;
3781
4010
  /**
3782
4011
  * Applies a function wrapped in a Task to a value wrapped in a Task.
3783
4012
  * Both Tasks run in parallel.
3784
4013
  *
4014
+ * @see {@link Task.all} to run multiple independent Tasks in parallel.
4015
+ *
3785
4016
  * @example
3786
4017
  * ```ts
3787
4018
  * const add = (a: number) => (b: number) => a + b;
3788
4019
  * pipe(
3789
- * Task.resolve(add),
3790
- * Task.ap(Task.resolve(5)),
3791
- * Task.ap(Task.resolve(3))
4020
+ * Task.make(add),
4021
+ * Task.apply(Task.make(5)),
4022
+ * Task.apply(Task.make(3))
3792
4023
  * )(); // Deferred<8>
3793
4024
  * ```
3794
4025
  */
3795
- ap: <A>(arg: Task<A>) => <B>(data: Task<(a: A) => B>) => Task<B>;
4026
+ apply: <A>(arg: Task<A>) => <B>(task: Task<(value: A) => B>) => Task<B>;
3796
4027
  /**
3797
4028
  * Executes a side effect on the value without changing the Task.
3798
4029
  * Useful for logging or debugging.
@@ -3806,11 +4037,14 @@ declare const Task: {
3806
4037
  * );
3807
4038
  * ```
3808
4039
  */
3809
- tap: <A>(f: (a: A) => void) => (data: Task<A>) => Task<A>;
4040
+ tap: <A>(sideEffect: (value: A) => void) => (task: Task<A>) => Task<A>;
3810
4041
  /**
3811
4042
  * Runs multiple Tasks in parallel and collects their results.
3812
4043
  * An optional `concurrency` option limits the number of tasks executing at any given time.
3813
4044
  *
4045
+ * @see {@link Task.sequence} to run an array of Tasks concurrently.
4046
+ * @see {@link Task.sequential} to run an array of Tasks one after another in order.
4047
+ *
3814
4048
  * @example
3815
4049
  * ```ts
3816
4050
  * Task.all([loadConfig, detectLocale, loadTheme])();
@@ -3829,16 +4063,18 @@ declare const Task: {
3829
4063
  * @example
3830
4064
  * ```ts
3831
4065
  * pipe(
3832
- * Task.resolve(42),
4066
+ * Task.make(42),
3833
4067
  * Task.delay(Duration.seconds(1))
3834
4068
  * )(); // Resolves after 1 second
3835
4069
  * ```
3836
4070
  */
3837
- delay: (duration: Duration) => <A>(data: Task<A>) => Task<A>;
4071
+ delay: (duration: Duration) => <A>(task: Task<A>) => Task<A>;
3838
4072
  /**
3839
4073
  * Runs a Task a fixed number of times sequentially, collecting all results into an array.
3840
4074
  * An optional delay duration can be inserted between runs.
3841
4075
  *
4076
+ * @see {@link Task.poll} to repeatedly run a Task until a predicate is satisfied.
4077
+ *
3842
4078
  * @example
3843
4079
  * ```ts
3844
4080
  * pipe(
@@ -3857,6 +4093,8 @@ declare const Task: {
3857
4093
  * An optional `attempts` cap stops the loop after N calls — the last value is returned
3858
4094
  * regardless of whether the predicate was satisfied.
3859
4095
  *
4096
+ * @see {@link Task.repeat} to run a Task a fixed number of times.
4097
+ *
3860
4098
  * @example
3861
4099
  * ```ts
3862
4100
  * pipe(
@@ -3866,7 +4104,7 @@ declare const Task: {
3866
4104
  * ```
3867
4105
  */
3868
4106
  poll: <A>(options: {
3869
- until: (a: A) => boolean;
4107
+ until: (value: A) => boolean;
3870
4108
  delay?: Duration;
3871
4109
  attempts?: number;
3872
4110
  }) => (task: Task<A>) => Task<A>;
@@ -3877,8 +4115,8 @@ declare const Task: {
3877
4115
  *
3878
4116
  * @example
3879
4117
  * ```ts
3880
- * const fast = Task.resolve("fast");
3881
- * const slow = Task.delay(Duration.milliseconds(200))(Task.resolve("slow"));
4118
+ * const fast = Task.make("fast");
4119
+ * const slow = Task.delay(Duration.milliseconds(200))(Task.make("slow"));
3882
4120
  *
3883
4121
  * await Task.race([fast, slow])(); // "fast"
3884
4122
  * ```
@@ -3888,6 +4126,9 @@ declare const Task: {
3888
4126
  * Runs an array of Tasks concurrently and collects their results in an array.
3889
4127
  * Forward-propagates the call site's AbortSignal to all subtasks concurrently.
3890
4128
  *
4129
+ * @see {@link Task.sequential} to run an array of tasks one after another in order.
4130
+ * @see {@link Task.all} to run an array or tuple of tasks in parallel with optional concurrency limit.
4131
+ *
3891
4132
  * @example
3892
4133
  * ```ts
3893
4134
  * Task.sequence([loadConfig, detectLocale, loadTheme])();
@@ -3899,10 +4140,12 @@ declare const Task: {
3899
4140
  * Runs an array of Tasks one at a time in order, collecting all results.
3900
4141
  * Each Task starts only after the previous one resolves.
3901
4142
  *
4143
+ * @see {@link Task.sequence} to run an array of tasks concurrently.
4144
+ *
3902
4145
  * @example
3903
4146
  * ```ts
3904
4147
  * let log: number[] = [];
3905
- * const makeTask = (n: number) => Task.resolve(n);
4148
+ * const makeTask = (n: number) => Task.make(n);
3906
4149
  *
3907
4150
  * await Task.sequential([makeTask(1), makeTask(2), makeTask(3)])();
3908
4151
  * // log = [1, 2, 3] — tasks ran in order
@@ -3972,22 +4215,22 @@ declare const Task: {
3972
4215
  *
3973
4216
  * @example
3974
4217
  * ```ts
3975
- * pipe(Task.resolve(42), Task.bindTo("value")); // Task({ value: 42 })
4218
+ * pipe(Task.make(42), Task.bindTo("value")); // Task({ value: 42 })
3976
4219
  * ```
3977
4220
  */
3978
- bindTo: <K extends string>(key: K) => <A>(data: Task<A>) => Task<{ [P in K]: A; }>;
4221
+ bindTo: <K extends string>(key: K) => <A>(task: Task<A>) => Task<{ [P in K]: A; }>;
3979
4222
  /**
3980
4223
  * Evaluates a new Task using the current accumulator and attaches the output to a new key.
3981
4224
  *
3982
4225
  * @example
3983
4226
  * ```ts
3984
4227
  * pipe(
3985
- * Task.resolve({ a: 1 }),
3986
- * Task.bind("b", ({ a }) => Task.resolve(a + 1))
4228
+ * Task.make({ a: 1 }),
4229
+ * Task.bind("b", ({ a }) => Task.make(a + 1))
3987
4230
  * ); // Task({ a: 1, b: 2 })
3988
4231
  * ```
3989
4232
  */
3990
- bind: <K extends string, A, B>(key: K, f: (a: A) => Task<B>) => (data: Task<A>) => Task<A & { [P in K]: B; }>;
4233
+ bind: <K extends string, A, B>(key: K, transform: (value: A) => Task<B>) => (task: Task<A>) => Task<A & { [P in K]: B; }>;
3991
4234
  /**
3992
4235
  * Creates a memoized version of a Task. The task is executed at most once on first call,
3993
4236
  * and its resolved value is cached for all subsequent calls.
@@ -4028,29 +4271,29 @@ declare const Task: {
4028
4271
  none: <A = never>() => Task.Maybe<A>;
4029
4272
  };
4030
4273
  from: {
4031
- Maybe: <A>(option: Maybe<A>) => Task.Maybe<A>;
4274
+ Maybe: <A>(maybe: Maybe<A>) => Task.Maybe<A>;
4032
4275
  nullable: <A>(value: A | null | undefined) => Task.Maybe<A>;
4033
4276
  Result: <E, A>(result: Result<E, A>) => Task.Maybe<A>;
4034
4277
  Task: <A>(task: Task<A>) => Task.Maybe<A>;
4035
4278
  };
4036
- tryCatch: <A>(f: (signal?: AbortSignal) => Thenable<A>) => Task.Maybe<A>;
4037
- map: <A, B>(f: (a: A) => B) => (data: Task.Maybe<A>) => Task.Maybe<B>;
4038
- chain: <A, B>(f: (a: A) => Task.Maybe<B>) => (data: Task.Maybe<A>) => Task.Maybe<B>;
4039
- ap: <A>(arg: Task.Maybe<A>) => <B>(data: Task.Maybe<(a: A) => B>) => Task.Maybe<B>;
4040
- fold: <A, B>(onNone: () => B, onSome: (a: A) => B) => (data: Task.Maybe<A>) => Task<B>;
4279
+ tryCatch: <A>(fn: (signal?: AbortSignal) => Thenable<A>) => Task.Maybe<A>;
4280
+ map: <A, B>(transform: (value: A) => B) => (task: Task.Maybe<A>) => Task.Maybe<B>;
4281
+ chain: <A, B>(transform: (value: A) => Task.Maybe<B>) => (task: Task.Maybe<A>) => Task.Maybe<B>;
4282
+ apply: <A>(arg: Task.Maybe<A>) => <B>(task: Task.Maybe<(value: A) => B>) => Task.Maybe<B>;
4283
+ fold: <A, B>(onNone: () => B, onSome: (value: A) => B) => (task: Task.Maybe<A>) => Task<B>;
4041
4284
  match: <A, B>(cases: {
4042
4285
  none: () => B;
4043
- some: (a: A) => B;
4044
- }) => (data: Task.Maybe<A>) => Task<B>;
4045
- getOrElse: <B>(defaultValue: () => B) => <A>(data: Task.Maybe<A>) => Task<A | B>;
4046
- tap: <A>(f: (a: A) => void) => (data: Task.Maybe<A>) => Task.Maybe<A>;
4047
- filter: <A>(predicate: (a: A) => boolean) => (data: Task.Maybe<A>) => Task.Maybe<A>;
4286
+ some: (value: A) => B;
4287
+ }) => (task: Task.Maybe<A>) => Task<B>;
4288
+ getOrElse: <B>(fallback: () => B) => <A>(task: Task.Maybe<A>) => Task<A | B>;
4289
+ tap: <A>(sideEffect: (value: A) => void) => (task: Task.Maybe<A>) => Task.Maybe<A>;
4290
+ filter: <A>(predicate: (value: A) => boolean) => (task: Task.Maybe<A>) => Task.Maybe<A>;
4048
4291
  to: {
4049
- Result: <E>(onNone: () => E) => <A>(data: Task.Maybe<A>) => Task.Result<E, A>;
4292
+ Result: <E>(onNone: () => E) => <A>(task: Task.Maybe<A>) => Task.Result<E, A>;
4050
4293
  };
4051
- bindTo: <K extends string>(key: K) => <A>(data: Task.Maybe<A>) => Task.Maybe<{ [P in K]: A; }>;
4052
- bind: <K extends string, A, B>(key: K, f: (a: A) => Task.Maybe<B>) => (data: Task.Maybe<A>) => Task.Maybe<A & { [P in K]: B; }>;
4053
- recover: <B>(fallback: () => Task.Maybe<B>) => <A>(data: Task.Maybe<A>) => Task.Maybe<A | B>;
4294
+ bindTo: <K extends string>(key: K) => <A>(task: Task.Maybe<A>) => Task.Maybe<{ [P in K]: A; }>;
4295
+ bind: <K extends string, A, B>(key: K, transform: (value: A) => Task.Maybe<B>) => (task: Task.Maybe<A>) => Task.Maybe<A & { [P in K]: B; }>;
4296
+ recover: <B>(fallback: () => Task.Maybe<B>) => <A>(task: Task.Maybe<A>) => Task.Maybe<A | B>;
4054
4297
  struct: <R extends Record<string, any>>(fields: { [K in keyof R]: Task.Maybe<R[K]>; }) => Task.Maybe<R>;
4055
4298
  memoize: <A>(task: Task.Maybe<A>) => Task.Maybe<A>;
4056
4299
  };
@@ -4065,28 +4308,71 @@ declare const Task: {
4065
4308
  Result: <E, A>(result: Result<E, A>) => Task.Result<E, A>;
4066
4309
  };
4067
4310
  to: {
4068
- Maybe: <E, A>(data: Task.Result<E, A>) => Task.Maybe<A>;
4311
+ Maybe: <E, A>(task: Task.Result<E, A>) => Task.Maybe<A>;
4069
4312
  };
4070
- tryCatch: <E, A>(f: (signal?: AbortSignal) => Thenable<A>, options: {
4313
+ tryCatch: <E, A>(fn: (signal?: AbortSignal) => Thenable<A>, options: {
4071
4314
  onError: (error: unknown) => E;
4072
4315
  }) => Task.Result<E, A>;
4073
- map: <E, A, B>(f: (a: A) => B) => (data: Task.Result<E, A>) => Task.Result<E, B>;
4074
- mapError: <E, F, A>(f: (e: E) => F) => (data: Task.Result<E, A>) => Task.Result<F, A>;
4075
- chain: <E2, A, B>(f: (a: A) => Task.Result<E2, B>) => <E1 = never>(data: Task.Result<E1, A>) => Task.Result<E1 | E2, B>;
4076
- fold: <E, A, B>(onErr: (e: E) => B, onOk: (a: A) => B) => (data: Task.Result<E, A>) => Task<B>;
4316
+ map: <E, A, B>(transform: (value: A) => B) => (task: Task.Result<E, A>) => Task.Result<E, B>;
4317
+ mapError: <E, F, A>(transform: (error: E) => F) => (task: Task.Result<E, A>) => Task.Result<F, A>;
4318
+ chain: <E2, A, B>(transform: (value: A) => Task.Result<E2, B>) => <E1 = never
4319
+ /**
4320
+ * A lazy async computation that always resolves.
4321
+ *
4322
+ * Two guarantees:
4323
+ * - **Lazy** — nothing starts until you call it.
4324
+ * - **Infallible** — it never rejects. If failure is possible, encode it in the
4325
+ * return type using `Task.Result<E, A>` instead.
4326
+ *
4327
+ * An optional `AbortSignal` can be passed at the call site. Combinators like
4328
+ * `retry`, `poll`, and `timeout` thread it automatically to every inner
4329
+ * operation. Existing tasks that ignore the signal continue to work unchanged.
4330
+ *
4331
+ * Calling a Task returns a `Deferred<A>` — a one-shot async value that supports
4332
+ * `await` but has no `.catch()`, `.finally()`, or chainable `.then()`.
4333
+ *
4334
+ * **Consuming a Task:**
4335
+ *
4336
+ * Use `await task()` to run it and get the value directly:
4337
+ * ```ts
4338
+ * const value: number = await task();
4339
+ * ```
4340
+ *
4341
+ * When you need an explicit `Promise<A>` (e.g. for a third-party API), convert
4342
+ * the `Deferred` with `Deferred.to.Promise`:
4343
+ * ```ts
4344
+ * const p: Promise<number> = Deferred.to.Promise(task());
4345
+ * ```
4346
+ *
4347
+ * @example
4348
+ * ```ts
4349
+ * const getTimestamp: Task<number> = Task.make(Date.now());
4350
+ *
4351
+ * // Nothing runs yet — getTimestamp is just a description
4352
+ * const formatted = pipe(
4353
+ * getTimestamp,
4354
+ * Task.map(ts => new Date(ts).toISOString())
4355
+ * );
4356
+ *
4357
+ * // Execute when ready
4358
+ * const result = await formatted();
4359
+ * ```
4360
+ */
4361
+ >(task: Task.Result<E1, A>) => Task.Result<E1 | E2, B>;
4362
+ fold: <E, A, B>(onErr: (error: E) => B, onOk: (value: A) => B) => (task: Task.Result<E, A>) => Task<B>;
4077
4363
  match: <E, A, B>(cases: {
4078
- err: (e: E) => B;
4079
- ok: (a: A) => B;
4080
- }) => (data: Task.Result<E, A>) => Task<B>;
4081
- recover: <E, B>(fallback: (e: E) => Task.Result<E, B>) => <A>(data: Task.Result<E, A>) => Task.Result<E, A | B>;
4082
- recoverUnless: <E, B>(isBlocked: (e: E) => boolean, fallback: (e: E) => Task.Result<E, B>) => <A>(data: Task.Result<E, A>) => Task.Result<E, A | B>;
4083
- getOrElse: <B>(defaultValue: () => B) => <E, A>(data: Task.Result<E, A>) => Task<A | B>;
4084
- tap: <E, A>(f: (a: A) => void) => (data: Task.Result<E, A>) => Task.Result<E, A>;
4085
- tapError: <E, A>(f: (e: E) => void) => (data: Task.Result<E, A>) => Task.Result<E, A>;
4086
- ap: <E, A>(arg: Task.Result<E, A>) => <B>(data: Task.Result<E, (a: A) => B>) => Task.Result<E, B>;
4364
+ err: (error: E) => B;
4365
+ ok: (value: A) => B;
4366
+ }) => (task: Task.Result<E, A>) => Task<B>;
4367
+ recover: <E1, E2, B>(fallback: (error: E1) => Task.Result<E2, B>) => <A>(task: Task.Result<E1, A>) => Task.Result<E2, A | B>;
4368
+ recoverUnless: <E1, E2, B>(isBlocked: (error: E1) => boolean, fallback: (error: E1) => Task.Result<E2, B>) => <A>(task: Task.Result<E1, A>) => Task.Result<E1 | E2, A | B>;
4369
+ getOrElse: <B>(fallback: () => B) => <E, A>(task: Task.Result<E, A>) => Task<A | B>;
4370
+ tap: <E, A>(sideEffect: (value: A) => void) => (task: Task.Result<E, A>) => Task.Result<E, A>;
4371
+ tapError: <E, A>(sideEffect: (error: E) => void) => (task: Task.Result<E, A>) => Task.Result<E, A>;
4372
+ apply: <E2, A>(arg: Task.Result<E2, A>) => <B, E1 = never>(task: Task.Result<E1, (value: A) => B>) => Task.Result<E1 | E2, B>;
4087
4373
  run: (signal?: AbortSignal) => <E, A>(task: Task.Result<E, A>) => Deferred<Result<E, A>>;
4088
- bindTo: <K extends string>(key: K) => <E, A>(data: Task.Result<E, A>) => Task.Result<E, { [P in K]: A; }>;
4089
- bind: <K extends string, E, A, B>(key: K, f: (a: A) => Task.Result<E, B>) => (data: Task.Result<E, A>) => Task.Result<E, A & { [P in K]: B; }>;
4374
+ bindTo: <K extends string>(key: K) => <E, A>(task: Task.Result<E, A>) => Task.Result<E, { [P in K]: A; }>;
4375
+ bind: <K extends string, E2, A, B>(key: K, transform: (value: A) => Task.Result<E2, B>) => <E1 = never>(task: Task.Result<E1, A>) => Task.Result<E1 | E2, A & { [P in K]: B; }>;
4090
4376
  struct: <E, R extends Record<string, any>>(fields: { [K in keyof R]: Task.Result<E, R[K]>; }) => Task.Result<E, R>;
4091
4377
  retry: (policy: RetryPolicy, options?: {
4092
4378
  when?: (error: unknown) => boolean;
@@ -4097,8 +4383,8 @@ declare const Task: {
4097
4383
  onTimeout: () => E2;
4098
4384
  }) => <E1 = never, A = unknown>(task: Task.Result<E1, A>) => Task.Result<E1 | E2, A>;
4099
4385
  allSettled: <E, A>(tasks: ReadonlyArray<Task.Result<E, A>>) => Task<ReadonlyArray<Result<E, A>>>;
4100
- ensure: <A, E2>(predicate: (a: A) => boolean, onFail: (a: A) => E2) => <E1 = never>(task: Task.Result<E1, A>) => Task.Result<E1 | E2, A>;
4101
- bimap: <E1, E2, A, B>(onErr: (e: E1) => E2, onOk: (a: A) => B) => (task: Task.Result<E1, A>) => Task.Result<E2, B>;
4386
+ ensure: <A, E2>(predicate: (value: A) => boolean, onFail: (value: A) => E2) => <E1 = never>(task: Task.Result<E1, A>) => Task.Result<E1 | E2, A>;
4387
+ bimap: <E1, E2, A, B>(onErr: (error: E1) => E2, onOk: (value: A) => B) => (task: Task.Result<E1, A>) => Task.Result<E2, B>;
4102
4388
  };
4103
4389
  Validation: {
4104
4390
  make: {
@@ -4113,27 +4399,27 @@ declare const Task: {
4113
4399
  Result: <E, A>(result: Result<E, A>) => Task.Validation<E, A>;
4114
4400
  };
4115
4401
  to: {
4116
- Result: <E1, E2, A>(combineErrors: (errors: NonEmptyArr<E1>) => E2) => (data: Task.Validation<E1, A>) => Task.Result<E2, A>;
4117
- Maybe: <E, A>(data: Task.Validation<E, A>) => Task.Maybe<A>;
4402
+ Result: <E1, E2, A>(combineErrors: (errors: NonEmptyArr<E1>) => E2) => (task: Task.Validation<E1, A>) => Task.Result<E2, A>;
4403
+ Maybe: <E, A>(task: Task.Validation<E, A>) => Task.Maybe<A>;
4118
4404
  };
4119
- tryCatch: <E, A>(f: (signal?: AbortSignal) => Thenable<A>, options: {
4405
+ tryCatch: <E, A>(fn: (signal?: AbortSignal) => Thenable<A>, options: {
4120
4406
  onError: (error: unknown) => E;
4121
4407
  }) => Task.Validation<E, A>;
4122
- map: <E, A, B>(f: (a: A) => B) => (data: Task.Validation<E, A>) => Task.Validation<E, B>;
4123
- ap: <E, A>(arg: Task.Validation<E, A>) => <B>(data: Task.Validation<E, (a: A) => B>) => Task.Validation<E, B>;
4124
- fold: <E, A, B>(onFailed: (errors: NonEmptyArr<E>) => B, onPassed: (a: A) => B) => (data: Task.Validation<E, A>) => Task<B>;
4408
+ map: <E, A, B>(transform: (value: A) => B) => (task: Task.Validation<E, A>) => Task.Validation<E, B>;
4409
+ apply: <E2, A>(arg: Task.Validation<E2, A>) => <B, E1 = never>(task: Task.Validation<E1, (value: A) => B>) => Task.Validation<E1 | E2, B>;
4410
+ fold: <E, A, B>(onFailed: (errors: NonEmptyArr<E>) => B, onPassed: (value: A) => B) => (task: Task.Validation<E, A>) => Task<B>;
4125
4411
  match: <E, A, B>(cases: {
4126
- passed: (a: A) => B;
4412
+ passed: (value: A) => B;
4127
4413
  failed: (errors: NonEmptyArr<E>) => B;
4128
- }) => (data: Task.Validation<E, A>) => Task<B>;
4129
- getOrElse: <B>(defaultValue: () => B) => <E, A>(data: Task.Validation<E, A>) => Task<A | B>;
4130
- tap: <E, A>(f: (a: A) => void) => (data: Task.Validation<E, A>) => Task.Validation<E, A>;
4131
- recover: <E, B>(fallback: (errors: NonEmptyArr<E>) => Task.Validation<E, B>) => <A>(data: Task.Validation<E, A>) => Task.Validation<E, A | B>;
4132
- recoverUnless: <E, B>(isBlocked: (errors: NonEmptyArr<E>) => boolean, fallback: (errors: NonEmptyArr<E>) => Task.Validation<E, B>) => <A>(data: Task.Validation<E, A>) => Task.Validation<E, A | B>;
4414
+ }) => (task: Task.Validation<E, A>) => Task<B>;
4415
+ getOrElse: <B>(fallback: () => B) => <E, A>(task: Task.Validation<E, A>) => Task<A | B>;
4416
+ tap: <E, A>(sideEffect: (value: A) => void) => (task: Task.Validation<E, A>) => Task.Validation<E, A>;
4417
+ recover: <E1, E2, B>(fallback: (errors: NonEmptyArr<E1>) => Task.Validation<E2, B>) => <A>(task: Task.Validation<E1, A>) => Task.Validation<E2, A | B>;
4418
+ recoverUnless: <E1, E2, B>(isBlocked: (errors: NonEmptyArr<E1>) => boolean, fallback: (errors: NonEmptyArr<E1>) => Task.Validation<E2, B>) => <A>(task: Task.Validation<E1, A>) => Task.Validation<E1 | E2, A | B>;
4133
4419
  product: <E, A, B>(first: Task.Validation<E, A>, second: Task.Validation<E, B>) => Task.Validation<E, readonly [A, B]>;
4134
- productAll: <E, A>(data: NonEmptyArr<Task.Validation<E, A>>) => Task.Validation<E, readonly A[]>;
4135
- mapError: <E, F, A>(f: (e: E) => F) => (data: Task.Validation<E, A>) => Task.Validation<F, A>;
4136
- tapError: <E, A>(f: (errors: NonEmptyArr<E>) => void) => (data: Task.Validation<E, A>) => Task.Validation<E, A>;
4420
+ productAll: <E, A>(validations: NonEmptyArr<Task.Validation<E, A>>) => Task.Validation<E, readonly A[]>;
4421
+ mapError: <E, F, A>(transform: (error: E) => F) => (task: Task.Validation<E, A>) => Task.Validation<F, A>;
4422
+ tapError: <E, A>(sideEffect: (errors: NonEmptyArr<E>) => void) => (task: Task.Validation<E, A>) => Task.Validation<E, A>;
4137
4423
  struct: <E, R extends Record<string, any>>(fields: { [K in keyof R]: Task.Validation<E, R[K]>; }) => Task.Validation<E, R>;
4138
4424
  memoize: <E, A>(task: Task.Validation<E, A>) => Task.Validation<E, A>;
4139
4425
  };
@@ -4206,7 +4492,7 @@ declare const These: {
4206
4492
  * These.make.both(42, "Deprecated API used"); // { kind: "Both", first: 42, second: "Deprecated API used" }
4207
4493
  * ```
4208
4494
  */
4209
- both: <A, B>(f: A, s: B) => TheseBoth<A, B>;
4495
+ both: <A, B>(first: A, second: B) => TheseBoth<A, B>;
4210
4496
  };
4211
4497
  is: {
4212
4498
  /**
@@ -4220,7 +4506,7 @@ declare const These: {
4220
4506
  * }
4221
4507
  * ```
4222
4508
  */
4223
- first: <A, B>(data: These<A, B>) => data is TheseFirst<A>;
4509
+ first: <A, B>(these: These<A, B>) => these is TheseFirst<A>;
4224
4510
  /**
4225
4511
  * Type guard — checks if a These holds only a second value.
4226
4512
  *
@@ -4232,7 +4518,7 @@ declare const These: {
4232
4518
  * }
4233
4519
  * ```
4234
4520
  */
4235
- second: <A, B>(data: These<A, B>) => data is TheseSecond<B>;
4521
+ second: <A, B>(these: These<A, B>) => these is TheseSecond<B>;
4236
4522
  /**
4237
4523
  * Type guard — checks if a These holds both values simultaneously.
4238
4524
  *
@@ -4244,11 +4530,13 @@ declare const These: {
4244
4530
  * }
4245
4531
  * ```
4246
4532
  */
4247
- both: <A, B>(data: These<A, B>) => data is TheseBoth<A, B>;
4533
+ both: <A, B>(these: These<A, B>) => these is TheseBoth<A, B>;
4248
4534
  };
4249
4535
  /**
4250
4536
  * Returns true if the These contains a first value (First or Both).
4251
4537
  *
4538
+ * @see {@link These.hasSecond} to check if These contains a second value.
4539
+ *
4252
4540
  * @example
4253
4541
  * ```ts
4254
4542
  * These.hasFirst(These.make.first(42)); // true
@@ -4256,10 +4544,12 @@ declare const These: {
4256
4544
  * These.hasFirst(These.make.second("warn")); // false
4257
4545
  * ```
4258
4546
  */
4259
- hasFirst: <A, B>(data: These<A, B>) => data is TheseFirst<A> | TheseBoth<A, B>;
4547
+ hasFirst: <A, B>(these: These<A, B>) => these is TheseFirst<A> | TheseBoth<A, B>;
4260
4548
  /**
4261
4549
  * Returns true if the These contains a second value (Second or Both).
4262
4550
  *
4551
+ * @see {@link These.hasFirst} to check if These contains a first value.
4552
+ *
4263
4553
  * @example
4264
4554
  * ```ts
4265
4555
  * These.hasSecond(These.make.second("warn")); // true
@@ -4267,10 +4557,13 @@ declare const These: {
4267
4557
  * These.hasSecond(These.make.first(42)); // false
4268
4558
  * ```
4269
4559
  */
4270
- hasSecond: <A, B>(data: These<A, B>) => data is TheseSecond<B> | TheseBoth<A, B>;
4560
+ hasSecond: <A, B>(these: These<A, B>) => these is TheseSecond<B> | TheseBoth<A, B>;
4271
4561
  /**
4272
4562
  * Transforms the first value, leaving the second unchanged.
4273
4563
  *
4564
+ * @see {@link These.mapSecond} to transform the second element.
4565
+ * @see {@link These.mapBoth} to transform both elements.
4566
+ *
4274
4567
  * @example
4275
4568
  * ```ts
4276
4569
  * pipe(These.make.first(5), These.mapFirst(n => n * 2)); // First(10)
@@ -4278,20 +4571,26 @@ declare const These: {
4278
4571
  * pipe(These.make.second("warn"), These.mapFirst(n => n * 2)); // Second("warn")
4279
4572
  * ```
4280
4573
  */
4281
- mapFirst: <A, C>(f: (a: A) => C) => <B>(data: These<A, B>) => These<C, B>;
4574
+ mapFirst: <A, C>(transform: (first: A) => C) => <B>(these: These<A, B>) => These<C, B>;
4282
4575
  /**
4283
4576
  * Transforms the second value, leaving the first unchanged.
4284
4577
  *
4578
+ * @see {@link These.mapFirst} to transform the first element.
4579
+ * @see {@link These.mapBoth} to transform both elements.
4580
+ *
4285
4581
  * @example
4286
4582
  * ```ts
4287
4583
  * pipe(These.make.second("warn"), These.mapSecond(e => e.toUpperCase())); // Second("WARN")
4288
4584
  * pipe(These.make.both(5, "warn"), These.mapSecond(e => e.toUpperCase())); // Both(5, "WARN")
4289
4585
  * ```
4290
4586
  */
4291
- mapSecond: <B, D>(f: (b: B) => D) => <A>(data: These<A, B>) => These<A, D>;
4587
+ mapSecond: <B, D>(transform: (second: B) => D) => <A>(these: These<A, B>) => These<A, D>;
4292
4588
  /**
4293
4589
  * Transforms both the first and second values independently.
4294
4590
  *
4591
+ * @see {@link These.mapFirst} to transform only the first element.
4592
+ * @see {@link These.mapSecond} to transform only the second element.
4593
+ *
4295
4594
  * @example
4296
4595
  * ```ts
4297
4596
  * pipe(
@@ -4300,10 +4599,12 @@ declare const These: {
4300
4599
  * ); // Both(10, "WARN")
4301
4600
  * ```
4302
4601
  */
4303
- mapBoth: <A, C, B, D>(onFirst: (a: A) => C, onSecond: (b: B) => D) => (data: These<A, B>) => These<C, D>;
4602
+ mapBoth: <A, C, B, D>(onFirst: (first: A) => C, onSecond: (second: B) => D) => (these: These<A, B>) => These<C, D>;
4304
4603
  /**
4305
- * Chains These computations by passing the first value to f.
4306
- * Second propagates unchanged; First and Both apply f to the first value.
4604
+ * Chains These computations by passing the first value to transform.
4605
+ * Second propagates unchanged; First and Both apply transform to the first value.
4606
+ *
4607
+ * @see {@link These.chainSecond} to chain based on the second value.
4307
4608
  *
4308
4609
  * @example
4309
4610
  * ```ts
@@ -4314,10 +4615,12 @@ declare const These: {
4314
4615
  * pipe(These.make.second("warn"), These.chainFirst(double)); // Second("warn")
4315
4616
  * ```
4316
4617
  */
4317
- chainFirst: <A, B, C>(f: (a: A) => These<C, B>) => (data: These<A, B>) => These<C, B>;
4618
+ chainFirst: <A, B, C>(transform: (first: A) => These<C, B>) => (these: These<A, B>) => These<C, B>;
4318
4619
  /**
4319
- * Chains These computations by passing the second value to f.
4320
- * First propagates unchanged; Second and Both apply f to the second value.
4620
+ * Chains These computations by passing the second value to transform.
4621
+ * First propagates unchanged; Second and Both apply transform to the second value.
4622
+ *
4623
+ * @see {@link These.chainFirst} to chain based on the first value.
4321
4624
  *
4322
4625
  * @example
4323
4626
  * ```ts
@@ -4328,10 +4631,12 @@ declare const These: {
4328
4631
  * pipe(These.make.first(5), These.chainSecond(shout)); // First(5)
4329
4632
  * ```
4330
4633
  */
4331
- chainSecond: <A, B, D>(f: (b: B) => These<A, D>) => (data: These<A, B>) => These<A, D>;
4634
+ chainSecond: <A, B, D>(transform: (second: B) => These<A, D>) => (these: These<A, B>) => These<A, D>;
4332
4635
  /**
4333
4636
  * Extracts a value from a These by providing handlers for all three cases.
4334
4637
  *
4638
+ * @see {@link These.match} for named-case pattern matching with an object literal.
4639
+ *
4335
4640
  * @example
4336
4641
  * ```ts
4337
4642
  * pipe(
@@ -4344,10 +4649,12 @@ declare const These: {
4344
4649
  * );
4345
4650
  * ```
4346
4651
  */
4347
- fold: <A, B, C>(onFirst: (a: A) => C, onSecond: (b: B) => C, onBoth: (a: A, b: B) => C) => (data: These<A, B>) => C;
4652
+ fold: <A, B, C>(onFirst: (first: A) => C, onSecond: (second: B) => C, onBoth: (first: A, second: B) => C) => (these: These<A, B>) => C;
4348
4653
  /**
4349
4654
  * Pattern matches on a These, returning the result of the matching case.
4350
4655
  *
4656
+ * @see {@link These.fold} for positional argument pattern matching.
4657
+ *
4351
4658
  * @example
4352
4659
  * ```ts
4353
4660
  * pipe(
@@ -4361,14 +4668,16 @@ declare const These: {
4361
4668
  * ```
4362
4669
  */
4363
4670
  match: <A, B, C>(cases: {
4364
- first: (a: A) => C;
4365
- second: (b: B) => C;
4366
- both: (a: A, b: B) => C;
4367
- }) => (data: These<A, B>) => C;
4671
+ first: (first: A) => C;
4672
+ second: (second: B) => C;
4673
+ both: (first: A, second: B) => C;
4674
+ }) => (these: These<A, B>) => C;
4368
4675
  /**
4369
4676
  * Returns the first value, or a default if the These has no first value.
4370
4677
  * The default can be a different type, widening the result to `A | C`.
4371
4678
  *
4679
+ * @see {@link These.getSecondOrElse} to retrieve the second value with fallback.
4680
+ *
4372
4681
  * @example
4373
4682
  * ```ts
4374
4683
  * pipe(These.make.first(5), These.getFirstOrElse(() => 0)); // 5
@@ -4377,11 +4686,13 @@ declare const These: {
4377
4686
  * pipe(These.make.second("warn"), These.getFirstOrElse(() => null)); // null — typed as number | null
4378
4687
  * ```
4379
4688
  */
4380
- getFirstOrElse: <A, C>(defaultValue: () => C) => <B>(data: These<A, B>) => A | C;
4689
+ getFirstOrElse: <A, C>(fallback: () => C) => <B>(these: These<A, B>) => A | C;
4381
4690
  /**
4382
4691
  * Returns the second value, or a default if the These has no second value.
4383
4692
  * The default can be a different type, widening the result to `B | D`.
4384
4693
  *
4694
+ * @see {@link These.getFirstOrElse} to retrieve the first value with fallback.
4695
+ *
4385
4696
  * @example
4386
4697
  * ```ts
4387
4698
  * pipe(These.make.second("warn"), These.getSecondOrElse(() => "none")); // "warn"
@@ -4390,7 +4701,7 @@ declare const These: {
4390
4701
  * pipe(These.make.first(5), These.getSecondOrElse(() => null)); // null — typed as string | null
4391
4702
  * ```
4392
4703
  */
4393
- getSecondOrElse: <B, D>(defaultValue: () => D) => <A>(data: These<A, B>) => B | D;
4704
+ getSecondOrElse: <B, D>(fallback: () => D) => <A>(these: These<A, B>) => B | D;
4394
4705
  /**
4395
4706
  * Runs a side effect on the first value without changing the These.
4396
4707
  * Useful for logging or debugging.
@@ -4400,7 +4711,7 @@ declare const These: {
4400
4711
  * pipe(These.make.first(5), These.tap(console.log)); // logs 5, returns First(5)
4401
4712
  * ```
4402
4713
  */
4403
- tap: <A>(f: (a: A) => void) => <B>(data: These<A, B>) => These<A, B>;
4714
+ tap: <A>(sideEffect: (first: A) => void) => <B>(these: These<A, B>) => These<A, B>;
4404
4715
  /**
4405
4716
  * Swaps the roles of first and second values.
4406
4717
  * - First(a) → Second(a)
@@ -4414,7 +4725,7 @@ declare const These: {
4414
4725
  * These.swap(These.make.both(5, "warn")); // Both("warn", 5)
4415
4726
  * ```
4416
4727
  */
4417
- swap: <A, B>(data: These<A, B>) => These<B, A>;
4728
+ swap: <A, B>(these: These<A, B>) => These<B, A>;
4418
4729
  };
4419
4730
  //#endregion
4420
4731
  export { Lens as A, Ordering as C, None as D, Maybe as E, EventBus as M, Equality as N, Some as O, Combinable as P, Pair as S, Op as T, RemoteData as _, Task as a, Reader as b, Validation as c, Ok$1 as d, Result as f, NotAsked as g, Loading as h, TheseSecond as i, Lazy as j, Logged as k, State$1 as l, Failure as m, TheseBoth as n, Failed as o, Resource as p, TheseFirst as r, Passed as s, These as t, Err$1 as u, Success as v, Optional as w, Predicate as x, Refinement as y };