@zambit/elevate-ts 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CLA-CORPORATE.md +72 -0
  2. package/CLA-INDIVIDUAL.md +71 -0
  3. package/DUAL-PUBLISHING-STRATEGY.md +571 -0
  4. package/LICENSE +610 -0
  5. package/README.md +77 -0
  6. package/dist/cjs/Either.d.ts +67 -0
  7. package/dist/cjs/Either.d.ts.map +1 -0
  8. package/dist/cjs/Either.js +147 -0
  9. package/dist/cjs/Either.js.map +1 -0
  10. package/dist/cjs/EitherAsync.d.ts +139 -0
  11. package/dist/cjs/EitherAsync.d.ts.map +1 -0
  12. package/dist/cjs/EitherAsync.js +171 -0
  13. package/dist/cjs/EitherAsync.js.map +1 -0
  14. package/dist/cjs/Function.d.ts +153 -0
  15. package/dist/cjs/Function.d.ts.map +1 -0
  16. package/dist/cjs/Function.js +110 -0
  17. package/dist/cjs/Function.js.map +1 -0
  18. package/dist/cjs/List.d.ts +134 -0
  19. package/dist/cjs/List.d.ts.map +1 -0
  20. package/dist/cjs/List.js +243 -0
  21. package/dist/cjs/List.js.map +1 -0
  22. package/dist/cjs/Maybe.d.ts +64 -0
  23. package/dist/cjs/Maybe.d.ts.map +1 -0
  24. package/dist/cjs/Maybe.js +122 -0
  25. package/dist/cjs/Maybe.js.map +1 -0
  26. package/dist/cjs/MaybeAsync.d.ts +115 -0
  27. package/dist/cjs/MaybeAsync.d.ts.map +1 -0
  28. package/dist/cjs/MaybeAsync.js +151 -0
  29. package/dist/cjs/MaybeAsync.js.map +1 -0
  30. package/dist/cjs/NonEmptyList.d.ts +86 -0
  31. package/dist/cjs/NonEmptyList.d.ts.map +1 -0
  32. package/dist/cjs/NonEmptyList.js +128 -0
  33. package/dist/cjs/NonEmptyList.js.map +1 -0
  34. package/dist/cjs/Reader.d.ts +53 -0
  35. package/dist/cjs/Reader.d.ts.map +1 -0
  36. package/dist/cjs/Reader.js +60 -0
  37. package/dist/cjs/Reader.js.map +1 -0
  38. package/dist/cjs/State.d.ts +71 -0
  39. package/dist/cjs/State.d.ts.map +1 -0
  40. package/dist/cjs/State.js +94 -0
  41. package/dist/cjs/State.js.map +1 -0
  42. package/dist/cjs/Tuple.d.ts +69 -0
  43. package/dist/cjs/Tuple.d.ts.map +1 -0
  44. package/dist/cjs/Tuple.js +73 -0
  45. package/dist/cjs/Tuple.js.map +1 -0
  46. package/dist/cjs/Validation.d.ts +53 -0
  47. package/dist/cjs/Validation.d.ts.map +1 -0
  48. package/dist/cjs/Validation.js +77 -0
  49. package/dist/cjs/Validation.js.map +1 -0
  50. package/dist/cjs/index.d.ts +12 -0
  51. package/dist/cjs/index.d.ts.map +1 -0
  52. package/dist/cjs/index.js +25 -0
  53. package/dist/cjs/index.js.map +1 -0
  54. package/dist/cjs/tokens/config.d.ts +43 -0
  55. package/dist/cjs/tokens/config.d.ts.map +1 -0
  56. package/dist/cjs/tokens/config.js +162 -0
  57. package/dist/cjs/tokens/config.js.map +1 -0
  58. package/dist/cjs/tokens/cssGen.d.ts +18 -0
  59. package/dist/cjs/tokens/cssGen.d.ts.map +1 -0
  60. package/dist/cjs/tokens/cssGen.js +144 -0
  61. package/dist/cjs/tokens/cssGen.js.map +1 -0
  62. package/dist/cjs/tokens/generateCSS.d.ts +18 -0
  63. package/dist/cjs/tokens/generateCSS.d.ts.map +1 -0
  64. package/dist/cjs/tokens/generateCSS.js +83 -0
  65. package/dist/cjs/tokens/generateCSS.js.map +1 -0
  66. package/dist/cjs/tokens/index.d.ts +13 -0
  67. package/dist/cjs/tokens/index.d.ts.map +1 -0
  68. package/dist/cjs/tokens/index.js +12 -0
  69. package/dist/cjs/tokens/index.js.map +1 -0
  70. package/dist/cjs/tsconfig.tsbuildinfo +1 -0
  71. package/dist/esm/Either.d.ts +67 -0
  72. package/dist/esm/Either.d.ts.map +1 -0
  73. package/dist/esm/Either.js +136 -0
  74. package/dist/esm/Either.js.map +1 -0
  75. package/dist/esm/EitherAsync.d.ts +139 -0
  76. package/dist/esm/EitherAsync.d.ts.map +1 -0
  77. package/dist/esm/EitherAsync.js +173 -0
  78. package/dist/esm/EitherAsync.js.map +1 -0
  79. package/dist/esm/Function.d.ts +153 -0
  80. package/dist/esm/Function.d.ts.map +1 -0
  81. package/dist/esm/Function.js +109 -0
  82. package/dist/esm/Function.js.map +1 -0
  83. package/dist/esm/List.d.ts +134 -0
  84. package/dist/esm/List.d.ts.map +1 -0
  85. package/dist/esm/List.js +243 -0
  86. package/dist/esm/List.js.map +1 -0
  87. package/dist/esm/Maybe.d.ts +64 -0
  88. package/dist/esm/Maybe.d.ts.map +1 -0
  89. package/dist/esm/Maybe.js +113 -0
  90. package/dist/esm/Maybe.js.map +1 -0
  91. package/dist/esm/MaybeAsync.d.ts +115 -0
  92. package/dist/esm/MaybeAsync.d.ts.map +1 -0
  93. package/dist/esm/MaybeAsync.js +150 -0
  94. package/dist/esm/MaybeAsync.js.map +1 -0
  95. package/dist/esm/NonEmptyList.d.ts +86 -0
  96. package/dist/esm/NonEmptyList.d.ts.map +1 -0
  97. package/dist/esm/NonEmptyList.js +128 -0
  98. package/dist/esm/NonEmptyList.js.map +1 -0
  99. package/dist/esm/Reader.d.ts +53 -0
  100. package/dist/esm/Reader.d.ts.map +1 -0
  101. package/dist/esm/Reader.js +60 -0
  102. package/dist/esm/Reader.js.map +1 -0
  103. package/dist/esm/State.d.ts +71 -0
  104. package/dist/esm/State.d.ts.map +1 -0
  105. package/dist/esm/State.js +94 -0
  106. package/dist/esm/State.js.map +1 -0
  107. package/dist/esm/Tuple.d.ts +69 -0
  108. package/dist/esm/Tuple.d.ts.map +1 -0
  109. package/dist/esm/Tuple.js +73 -0
  110. package/dist/esm/Tuple.js.map +1 -0
  111. package/dist/esm/Validation.d.ts +53 -0
  112. package/dist/esm/Validation.d.ts.map +1 -0
  113. package/dist/esm/Validation.js +79 -0
  114. package/dist/esm/Validation.js.map +1 -0
  115. package/dist/esm/index.d.ts +12 -0
  116. package/dist/esm/index.d.ts.map +1 -0
  117. package/dist/esm/index.js +22 -0
  118. package/dist/esm/index.js.map +1 -0
  119. package/dist/esm/src/Either.d.ts +67 -0
  120. package/dist/esm/src/Either.d.ts.map +1 -0
  121. package/dist/esm/src/Either.js +147 -0
  122. package/dist/esm/src/Either.js.map +1 -0
  123. package/dist/esm/src/EitherAsync.d.ts +139 -0
  124. package/dist/esm/src/EitherAsync.d.ts.map +1 -0
  125. package/dist/esm/src/EitherAsync.js +171 -0
  126. package/dist/esm/src/EitherAsync.js.map +1 -0
  127. package/dist/esm/src/Function.d.ts +153 -0
  128. package/dist/esm/src/Function.d.ts.map +1 -0
  129. package/dist/esm/src/Function.js +110 -0
  130. package/dist/esm/src/Function.js.map +1 -0
  131. package/dist/esm/src/List.d.ts +134 -0
  132. package/dist/esm/src/List.d.ts.map +1 -0
  133. package/dist/esm/src/List.js +243 -0
  134. package/dist/esm/src/List.js.map +1 -0
  135. package/dist/esm/src/Maybe.d.ts +64 -0
  136. package/dist/esm/src/Maybe.d.ts.map +1 -0
  137. package/dist/esm/src/Maybe.js +122 -0
  138. package/dist/esm/src/Maybe.js.map +1 -0
  139. package/dist/esm/src/MaybeAsync.d.ts +115 -0
  140. package/dist/esm/src/MaybeAsync.d.ts.map +1 -0
  141. package/dist/esm/src/MaybeAsync.js +151 -0
  142. package/dist/esm/src/MaybeAsync.js.map +1 -0
  143. package/dist/esm/src/NonEmptyList.d.ts +86 -0
  144. package/dist/esm/src/NonEmptyList.d.ts.map +1 -0
  145. package/dist/esm/src/NonEmptyList.js +128 -0
  146. package/dist/esm/src/NonEmptyList.js.map +1 -0
  147. package/dist/esm/src/Reader.d.ts +53 -0
  148. package/dist/esm/src/Reader.d.ts.map +1 -0
  149. package/dist/esm/src/Reader.js +60 -0
  150. package/dist/esm/src/Reader.js.map +1 -0
  151. package/dist/esm/src/State.d.ts +71 -0
  152. package/dist/esm/src/State.d.ts.map +1 -0
  153. package/dist/esm/src/State.js +94 -0
  154. package/dist/esm/src/State.js.map +1 -0
  155. package/dist/esm/src/Tuple.d.ts +69 -0
  156. package/dist/esm/src/Tuple.d.ts.map +1 -0
  157. package/dist/esm/src/Tuple.js +73 -0
  158. package/dist/esm/src/Tuple.js.map +1 -0
  159. package/dist/esm/src/Validation.d.ts +53 -0
  160. package/dist/esm/src/Validation.d.ts.map +1 -0
  161. package/dist/esm/src/Validation.js +77 -0
  162. package/dist/esm/src/Validation.js.map +1 -0
  163. package/dist/esm/src/index.d.ts +12 -0
  164. package/dist/esm/src/index.d.ts.map +1 -0
  165. package/dist/esm/src/index.js +25 -0
  166. package/dist/esm/src/index.js.map +1 -0
  167. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
  168. package/elevate-ts-vs-effect-critique.md +806 -0
  169. package/eslint.config.js +104 -0
  170. package/package.json +139 -0
@@ -0,0 +1,128 @@
1
+ // NonEmptyList — Guaranteed Nonempty Arrays (branded type)
2
+ import * as Maybe from './Maybe.js';
3
+ /**
4
+ * Unsafely cast an array to NonEmptyList.
5
+ * @param arr - An array (must be nonempty at runtime).
6
+ * @returns The array cast as NonEmptyList.
7
+ */
8
+ const unsafeBrand = (arr) => arr;
9
+ /**
10
+ * Safely lift an array to NonEmptyList if nonempty.
11
+ * @param arr - The array to lift.
12
+ * @returns Just the NonEmptyList if nonempty, Nothing if empty.
13
+ */
14
+ export const fromArray = (arr) => (arr.length > 0 ? Maybe.Just(unsafeBrand(arr)) : Maybe.Nothing);
15
+ /**
16
+ * Unsafely cast an array to NonEmptyList without checking.
17
+ * @param arr - An array (assumed nonempty).
18
+ * @returns The array cast as NonEmptyList.
19
+ */
20
+ export const fromArrayUnsafe = (arr) => unsafeBrand(arr);
21
+ /**
22
+ * Convert a NonEmptyList back to a plain array.
23
+ * @param nel - The nonempty list.
24
+ * @returns A readonly array.
25
+ */
26
+ export const toArray = (nel) => nel;
27
+ /**
28
+ * Extract the first element (guaranteed to exist).
29
+ * @param nel - The nonempty list.
30
+ * @returns The first element.
31
+ */
32
+ export const head = (nel) => nel[0];
33
+ /**
34
+ * Extract all elements after the first.
35
+ * @param nel - The nonempty list.
36
+ * @returns An array of remaining elements (may be empty).
37
+ */
38
+ export const tail = (nel) => nel.slice(1);
39
+ /**
40
+ * Extract the last element.
41
+ * @param nel - The nonempty list.
42
+ * @returns The last element.
43
+ */
44
+ export const last = (nel) => nel[nel.length - 1];
45
+ /**
46
+ * Extract all elements except the last.
47
+ * @param nel - The nonempty list.
48
+ * @returns An array of all but the last element.
49
+ */
50
+ export const init = (nel) => nel.slice(0, -1);
51
+ /**
52
+ * Functor map over a NonEmptyList.
53
+ * @param f - Function to transform each element.
54
+ * @returns A function that takes a NonEmptyList and returns a new NonEmptyList.
55
+ */
56
+ export const map = (f) => (nel) => unsafeBrand(nel.map(f));
57
+ /**
58
+ * Applicative ap: apply a NonEmptyList of functions to a NonEmptyList of values.
59
+ * @param nf - A NonEmptyList of functions.
60
+ * @returns A function that takes a NonEmptyList and returns a new NonEmptyList.
61
+ */
62
+ export const ap = (nf) => (nel) => {
63
+ const result = [];
64
+ for (const f of nf) {
65
+ for (const a of nel) {
66
+ result.push(f(a));
67
+ }
68
+ }
69
+ return unsafeBrand(result);
70
+ };
71
+ /**
72
+ * Monadic bind: sequentially compose NonEmptyList computations.
73
+ * @param f - Function that returns a NonEmptyList.
74
+ * @returns A function that takes a NonEmptyList and returns a flattened NonEmptyList.
75
+ */
76
+ export const chain = (f) => (nel) => {
77
+ const result = [];
78
+ for (const a of nel) {
79
+ const bs = f(a);
80
+ for (const b of bs) {
81
+ result.push(b);
82
+ }
83
+ }
84
+ return unsafeBrand(result);
85
+ };
86
+ /**
87
+ * Concatenate two nonempty lists.
88
+ * @param nel2 - The second nonempty list.
89
+ * @returns A function that takes the first nonempty list and returns their concatenation.
90
+ */
91
+ export const concat = (nel2) => (nel1) => unsafeBrand([...nel1, ...nel2]);
92
+ /**
93
+ * Find the minimum element using a comparator.
94
+ * @param ord - Comparator function (returns negative if first < second, positive if first > second).
95
+ * @returns A function that takes a NonEmptyList and returns the minimum element.
96
+ */
97
+ export const min = (ord) => (nel) => {
98
+ let result = nel[0];
99
+ for (let i = 1; i < nel.length; i++) {
100
+ if (ord(nel[i], result) < 0) {
101
+ result = nel[i];
102
+ }
103
+ }
104
+ return result;
105
+ };
106
+ /**
107
+ * Find the maximum element using a comparator.
108
+ * @param ord - Comparator function (returns negative if first < second, positive if first > second).
109
+ * @returns A function that takes a NonEmptyList and returns the maximum element.
110
+ */
111
+ export const max = (ord) => (nel) => {
112
+ let result = nel[0];
113
+ for (let i = 1; i < nel.length; i++) {
114
+ if (ord(nel[i], result) > 0) {
115
+ result = nel[i];
116
+ }
117
+ }
118
+ return result;
119
+ };
120
+ // Fantasy Land symbols
121
+ // Note: FL methods excluded to work around vitest coverage serialization issues.
122
+ // The core functionality is complete and all point-free functions work correctly.
123
+ // TODO: Re-enable Fantasy Land methods when vitest issue is resolved.
124
+ //
125
+ // const nelProto = Object.getPrototypeOf(unsafeBrand([0]))
126
+ // nelProto['fantasy-land/map'] = ...
127
+ // etc.
128
+ //# sourceMappingURL=NonEmptyList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NonEmptyList.js","sourceRoot":"","sources":["../../src/NonEmptyList.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AASpC;;;;GAIG;AACH,MAAM,WAAW,GAAG,CAAI,GAAiB,EAAmB,EAAE,CAAC,GAAsB,CAAC;AAEtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,GAAiB,EAAgC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAEjJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GA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AC,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEJ,uBAAuB;AACvB,iFAAiF;AACjF,kFAAkF;AAClF,sEAAsE;AACtE,EAAE;AACF,2DAA2D;AAC3D,qCAAqC;AACrC,OAAO"}
@@ -0,0 +1,53 @@
1
+ /** Represents a Reader computation: a pure function (env: R) => A. */
2
+ export type Reader<R, A> = {
3
+ readonly tag: 'Reader';
4
+ readonly run: (env: R) => A;
5
+ };
6
+ /**
7
+ * Construct a Reader from a function.
8
+ * @param run - The function that reads the environment.
9
+ * @returns A Reader that encapsulates the function.
10
+ */
11
+ export declare const Reader: <R, A>(run: (env: R) => A) => Reader<R, A>;
12
+ /**
13
+ * Retrieve the environment as a value.
14
+ * @returns A Reader that returns the environment unchanged.
15
+ */
16
+ export declare const ask: <R>() => Reader<R, R>;
17
+ /**
18
+ * Retrieve and transform the environment.
19
+ * @param f - Function to transform the environment.
20
+ * @returns A Reader that applies the function to the environment.
21
+ */
22
+ export declare const asks: <R, A>(f: (env: R) => A) => Reader<R, A>;
23
+ /**
24
+ * Modify the environment for a sub-computation.
25
+ * @param f - Function to transform the environment.
26
+ * @returns A function that takes a Reader and returns a new Reader with modified environment.
27
+ */
28
+ export declare const local: <R>(f: (env: R) => R) => (<A>(reader: Reader<R, A>) => Reader<R, A>);
29
+ /**
30
+ * Functor map over the result.
31
+ * @param f - Function to transform the value.
32
+ * @returns A function that takes a Reader and returns a new Reader with mapped value.
33
+ */
34
+ export declare const map: <A, B>(f: (a: A) => B) => (<R>(reader: Reader<R, A>) => Reader<R, B>);
35
+ /**
36
+ * Applicative ap: apply a Reader containing a function to a Reader containing a value.
37
+ * @param rf - A Reader containing a function.
38
+ * @returns A function that takes a Reader and returns a new Reader with applied function.
39
+ */
40
+ export declare const ap: <R, A, B>(rf: Reader<R, (a: A) => B>) => ((ra: Reader<R, A>) => Reader<R, B>);
41
+ /**
42
+ * Monadic bind: sequentially compose two Readers.
43
+ * @param f - Function that returns a new Reader.
44
+ * @returns A function that takes a Reader and returns a new Reader.
45
+ */
46
+ export declare const chain: <R, A, B>(f: (a: A) => Reader<R, B>) => ((reader: Reader<R, A>) => Reader<R, B>);
47
+ /**
48
+ * Execute a Reader with an environment.
49
+ * @param env - The environment to provide.
50
+ * @returns A function that takes a Reader and returns its result.
51
+ */
52
+ export declare const runReader: <R, A>(env: R) => ((reader: Reader<R, A>) => A);
53
+ //# sourceMappingURL=Reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reader.d.ts","sourceRoot":"","sources":["../../src/Reader.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI;IAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;CAAE,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAG3D,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,GAAG,GAAI,CAAC,OAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAyB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,CAAC,EAA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60 @@
1
+ // Reader — Dependency Injection
2
+ /**
3
+ * Construct a Reader from a function.
4
+ * @param run - The function that reads the environment.
5
+ * @returns A Reader that encapsulates the function.
6
+ */
7
+ export const Reader = (run) => ({
8
+ tag: 'Reader',
9
+ run
10
+ });
11
+ /**
12
+ * Retrieve the environment as a value.
13
+ * @returns A Reader that returns the environment unchanged.
14
+ */
15
+ export const ask = () => Reader((env) => env);
16
+ /**
17
+ * Retrieve and transform the environment.
18
+ * @param f - Function to transform the environment.
19
+ * @returns A Reader that applies the function to the environment.
20
+ */
21
+ export const asks = (f) => Reader(f);
22
+ /**
23
+ * Modify the environment for a sub-computation.
24
+ * @param f - Function to transform the environment.
25
+ * @returns A function that takes a Reader and returns a new Reader with modified environment.
26
+ */
27
+ export const local = (f) => (reader) => Reader((env) => reader.run(f(env)));
28
+ /**
29
+ * Functor map over the result.
30
+ * @param f - Function to transform the value.
31
+ * @returns A function that takes a Reader and returns a new Reader with mapped value.
32
+ */
33
+ export const map = (f) => (reader) => Reader((env) => f(reader.run(env)));
34
+ /**
35
+ * Applicative ap: apply a Reader containing a function to a Reader containing a value.
36
+ * @param rf - A Reader containing a function.
37
+ * @returns A function that takes a Reader and returns a new Reader with applied function.
38
+ */
39
+ export const ap = (rf) => (ra) => Reader((env) => rf.run(env)(ra.run(env)));
40
+ /**
41
+ * Monadic bind: sequentially compose two Readers.
42
+ * @param f - Function that returns a new Reader.
43
+ * @returns A function that takes a Reader and returns a new Reader.
44
+ */
45
+ export const chain = (f) => (reader) => Reader((env) => f(reader.run(env)).run(env));
46
+ /**
47
+ * Execute a Reader with an environment.
48
+ * @param env - The environment to provide.
49
+ * @returns A function that takes a Reader and returns its result.
50
+ */
51
+ export const runReader = (env) => (reader) => reader.run(env);
52
+ // Fantasy Land symbols
53
+ // Note: FL methods excluded to work around vitest coverage serialization issues.
54
+ // The core functionality is complete and all point-free functions work correctly.
55
+ // TODO: Re-enable Fantasy Land methods when vitest issue is resolved.
56
+ //
57
+ // const readerProto = Object.getPrototypeOf(Reader(() => 0))
58
+ // readerProto['fantasy-land/map'] = ...
59
+ // etc.
60
+ //# sourceMappingURL=Reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reader.js","sourceRoot":"","sources":["../../src/Reader.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAKhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAO,GAAkB,EAAgB,EAAE,CAAC,CAAC;IACjE,GAAG,EAAE,QAAQ;IACb,GAAG;CACJ,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,GAAoB,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,CAAgB,EAAgB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAChB,CAAI,CAAgB,EAA+C,EAAE,CACrE,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GACd,CAAO,CAAc,EAA+C,EAAE,CACtE,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,EAAE,GACb,CAAU,EAA0B,EAAwC,EAAE,CAC9E,CAAC,EAAE,EAAE,EAAE,CACL,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAChB,CAAU,CAAyB,EAA4C,EAAE,CACjF,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACpB,CAAO,GAAM,EAAiC,EAAE,CAChD,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEpB,uBAAuB;AACvB,iFAAiF;AACjF,kFAAkF;AAClF,sEAAsE;AACtE,EAAE;AACF,6DAA6D;AAC7D,wCAAwC;AACxC,OAAO"}
@@ -0,0 +1,71 @@
1
+ /** Represents a State computation: a pure function (s: S) => readonly [A, S]. */
2
+ export type State<S, A> = {
3
+ readonly tag: 'State';
4
+ readonly run: (s: S) => readonly [A, S];
5
+ };
6
+ /**
7
+ * Construct a State from a function.
8
+ * @param run - The function that computes a value and new state.
9
+ * @returns A State that encapsulates the computation.
10
+ */
11
+ export declare const State: <S, A>(run: (s: S) => readonly [A, S]) => State<S, A>;
12
+ /**
13
+ * Retrieve the current state.
14
+ * @returns A State that returns the state as its value.
15
+ */
16
+ export declare const get: <S>() => State<S, S>;
17
+ /**
18
+ * Replace the state.
19
+ * @param s - The new state.
20
+ * @returns A State that replaces the current state and returns void.
21
+ */
22
+ export declare const put: <S>(s: S) => State<S, void>;
23
+ /**
24
+ * Transform the state.
25
+ * @param f - Function to transform the state.
26
+ * @returns A State that applies the transformation and returns void.
27
+ */
28
+ export declare const modify: <S>(f: (s: S) => S) => State<S, void>;
29
+ /**
30
+ * Retrieve and transform the state.
31
+ * @param f - Function to transform the state.
32
+ * @returns A State that applies the function to the state and returns the result.
33
+ */
34
+ export declare const gets: <S, A>(f: (s: S) => A) => State<S, A>;
35
+ /**
36
+ * Functor map over the value.
37
+ * @param f - Function to transform the value.
38
+ * @returns A function that takes a State and returns a new State with mapped value.
39
+ */
40
+ export declare const map: <A, B>(f: (a: A) => B) => (<S>(state: State<S, A>) => State<S, B>);
41
+ /**
42
+ * Applicative ap: apply a State function to a State value.
43
+ * @param sf - A State containing a function.
44
+ * @returns A function that takes a State and returns a new State with applied function.
45
+ */
46
+ export declare const ap: <S, A, B>(sf: State<S, (a: A) => B>) => ((sa: State<S, A>) => State<S, B>);
47
+ /**
48
+ * Monadic bind: sequentially compose two State computations.
49
+ * @param f - Function that returns a new State.
50
+ * @returns A function that takes a State and returns a new State.
51
+ */
52
+ export declare const chain: <S, A, B>(f: (a: A) => State<S, B>) => ((state: State<S, A>) => State<S, B>);
53
+ /**
54
+ * Execute a State computation with an initial state.
55
+ * @param state - The initial state.
56
+ * @returns A function that takes a State and returns the result pair.
57
+ */
58
+ export declare const runState: <S, A>(state: S) => ((computation: State<S, A>) => readonly [A, S]);
59
+ /**
60
+ * Execute a State computation and extract only the value.
61
+ * @param state - The initial state.
62
+ * @returns A function that takes a State and returns only the value.
63
+ */
64
+ export declare const evalState: <S, A>(state: S) => ((computation: State<S, A>) => A);
65
+ /**
66
+ * Execute a State computation and extract only the final state.
67
+ * @param state - The initial state.
68
+ * @returns A function that takes a State and returns only the final state.
69
+ */
70
+ export declare const execState: <S, A>(state: S) => ((computation: State<S, A>) => S);
71
+ //# sourceMappingURL=State.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../src/State.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI;IAAE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC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EAAE,CAAC,CAAC,CAMnE,CAAC;AAEP;;;;GAIG;AACH,eAAO,MAAM,KAAK,GACf,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAKrE,CAAC;AAEP;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAClB,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAG,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAExC,CAAC;AAE3B;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACnB,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAG,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAIjD,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACnB,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAG,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAIjD,CAAC"}
@@ -0,0 +1,94 @@
1
+ // State — Pure Stateful Computation
2
+ /**
3
+ * Construct a State from a function.
4
+ * @param run - The function that computes a value and new state.
5
+ * @returns A State that encapsulates the computation.
6
+ */
7
+ export const State = (run) => ({
8
+ tag: 'State',
9
+ run
10
+ });
11
+ /**
12
+ * Retrieve the current state.
13
+ * @returns A State that returns the state as its value.
14
+ */
15
+ export const get = () => State((s) => [s, s]);
16
+ /**
17
+ * Replace the state.
18
+ * @param s - The new state.
19
+ * @returns A State that replaces the current state and returns void.
20
+ */
21
+ export const put = (s) => State(() => [undefined, s]);
22
+ /**
23
+ * Transform the state.
24
+ * @param f - Function to transform the state.
25
+ * @returns A State that applies the transformation and returns void.
26
+ */
27
+ export const modify = (f) => State((s) => [undefined, f(s)]);
28
+ /**
29
+ * Retrieve and transform the state.
30
+ * @param f - Function to transform the state.
31
+ * @returns A State that applies the function to the state and returns the result.
32
+ */
33
+ export const gets = (f) => State((s) => [f(s), s]);
34
+ /**
35
+ * Functor map over the value.
36
+ * @param f - Function to transform the value.
37
+ * @returns A function that takes a State and returns a new State with mapped value.
38
+ */
39
+ export const map = (f) => (state) => State((s) => {
40
+ const [a, s2] = state.run(s);
41
+ return [f(a), s2];
42
+ });
43
+ /**
44
+ * Applicative ap: apply a State function to a State value.
45
+ * @param sf - A State containing a function.
46
+ * @returns A function that takes a State and returns a new State with applied function.
47
+ */
48
+ export const ap = (sf) => (sa) => State((s) => {
49
+ const [f, s2] = sf.run(s);
50
+ const [a, s3] = sa.run(s2);
51
+ return [f(a), s3];
52
+ });
53
+ /**
54
+ * Monadic bind: sequentially compose two State computations.
55
+ * @param f - Function that returns a new State.
56
+ * @returns A function that takes a State and returns a new State.
57
+ */
58
+ export const chain = (f) => (state) => State((s) => {
59
+ const [a, s2] = state.run(s);
60
+ return f(a).run(s2);
61
+ });
62
+ /**
63
+ * Execute a State computation with an initial state.
64
+ * @param state - The initial state.
65
+ * @returns A function that takes a State and returns the result pair.
66
+ */
67
+ export const runState = (state) => (computation) => computation.run(state);
68
+ /**
69
+ * Execute a State computation and extract only the value.
70
+ * @param state - The initial state.
71
+ * @returns A function that takes a State and returns only the value.
72
+ */
73
+ export const evalState = (state) => (computation) => {
74
+ const [a] = computation.run(state);
75
+ return a;
76
+ };
77
+ /**
78
+ * Execute a State computation and extract only the final state.
79
+ * @param state - The initial state.
80
+ * @returns A function that takes a State and returns only the final state.
81
+ */
82
+ export const execState = (state) => (computation) => {
83
+ const [, s] = computation.run(state);
84
+ return s;
85
+ };
86
+ // Fantasy Land symbols
87
+ // Note: FL methods excluded to work around vitest coverage serialization issues.
88
+ // The core functionality is complete and all point-free functions work correctly.
89
+ // TODO: Re-enable Fantasy Land methods when vitest issue is resolved.
90
+ //
91
+ // const stateProto = Object.getPrototypeOf(State(() => [0, 0]))
92
+ // stateProto['fantasy-land/map'] = ...
93
+ // etc.
94
+ //# sourceMappingURL=State.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"State.js","sourceRoot":"","sources":["../../src/State.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAKpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAO,GAA8B,EAAe,EAAE,CAAC,CAAC;IAC3E,GAAG,EAAE,OAAO;IACZ,GAAG;CACJ,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,GAAmB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAI,CAAI,EAAkB,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,CAAc,EAAkB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7F;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,CAAc,EAAe,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEnF;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GACd,CAAO,CAAc,EAA4C,EAAE,CACnE,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,CAAC,CAA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AAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACpB,CAAO,KAAQ,EAAqC,EAAE,CACtD,CAAC,WAAW,EAAE,EAAE;IACd,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEJ,uBAAuB;AACvB,iFAAiF;AACjF,kFAAkF;AAClF,sEAAsE;AACtE,EAAE;AACF,gEAAgE;AAChE,uCAAuC;AACvC,OAAO"}
@@ -0,0 +1,69 @@
1
+ /** Immutable 2-tuple. */
2
+ export type Tuple<A, B> = {
3
+ readonly fst: A;
4
+ readonly snd: B;
5
+ };
6
+ /**
7
+ * Construct a Tuple from two values.
8
+ * @param fst - The first component.
9
+ * @param snd - The second component.
10
+ * @returns A Tuple containing both values.
11
+ */
12
+ export declare const Tuple: <A, B>(fst: A, snd: B) => Tuple<A, B>;
13
+ /**
14
+ * Extract the first component.
15
+ * @param tuple - The tuple to extract from.
16
+ * @returns The first component.
17
+ */
18
+ export declare const fst: <A, B>(tuple: Tuple<A, B>) => A;
19
+ /**
20
+ * Extract the second component.
21
+ * @param tuple - The tuple to extract from.
22
+ * @returns The second component.
23
+ */
24
+ export declare const snd: <A, B>(tuple: Tuple<A, B>) => B;
25
+ /**
26
+ * Map over the first component.
27
+ * @param f - Function to transform the first component.
28
+ * @returns A function that takes a Tuple and returns a new Tuple with mapped first component.
29
+ */
30
+ export declare const mapFst: <A, B, A2>(f: (a: A) => A2) => ((tuple: Tuple<A, B>) => Tuple<A2, B>);
31
+ /**
32
+ * Map over the second component.
33
+ * @param f - Function to transform the second component.
34
+ * @returns A function that takes a Tuple and returns a new Tuple with mapped second component.
35
+ */
36
+ export declare const mapSnd: <A, B, B2>(f: (b: B) => B2) => ((tuple: Tuple<A, B>) => Tuple<A, B2>);
37
+ /**
38
+ * Bifunctor bimap: map over both components independently.
39
+ * @param f - Function to transform the first component.
40
+ * @param g - Function to transform the second component.
41
+ * @returns A function that takes a Tuple and returns a new Tuple with both components mapped.
42
+ */
43
+ export declare const bimap: <A, B, A2, B2>(f: (a: A) => A2, g: (b: B) => B2) => ((tuple: Tuple<A, B>) => Tuple<A2, B2>);
44
+ /**
45
+ * Convert a Tuple to a 2-element array.
46
+ * @param tuple - The tuple to convert.
47
+ * @returns A 2-element array.
48
+ */
49
+ export declare const toArray: <A, B>(tuple: Tuple<A, B>) => readonly [A, B];
50
+ /**
51
+ * Construct a Tuple from a 2-element array.
52
+ * @param arr - A 2-element array.
53
+ * @returns A Tuple constructed from the array.
54
+ */
55
+ export declare const fromArray: <A, B>(arr: readonly [A, B]) => Tuple<A, B>;
56
+ /**
57
+ * Swap the components of a Tuple.
58
+ * @param tuple - The tuple to swap.
59
+ * @returns A new Tuple with components reversed.
60
+ */
61
+ export declare const swap: <A, B>(tuple: Tuple<A, B>) => Tuple<B, A>;
62
+ /**
63
+ * Apply two functions to the same input, combining results as a Tuple.
64
+ * @param f - Function to apply to the input.
65
+ * @param g - Function to apply to the input.
66
+ * @returns A function that takes a value and returns a Tuple of the results.
67
+ */
68
+ export declare const fanout: <A, B, C>(f: (a: A) => B, g: (a: A) => C) => ((a: A) => Tuple<B, C>);
69
+ //# sourceMappingURL=Tuple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tuple.d.ts","sourceRoot":"","sources":["../../src/Tuple.ts"],"names":[],"mappings":"AAEA,yBAAyB;AACzB,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI;IAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAA;CAAE,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,CAAC,EAAE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,CAAC,CAAC,KAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAA2B,CAAC;AAE7F;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAA0B,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAgC,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAChB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAE9C,CAAC"}
@@ -0,0 +1,73 @@
1
+ // Tuple — Immutable 2-Tuples
2
+ /**
3
+ * Construct a Tuple from two values.
4
+ * @param fst - The first component.
5
+ * @param snd - The second component.
6
+ * @returns A Tuple containing both values.
7
+ */
8
+ export const Tuple = (fst, snd) => ({ fst, snd });
9
+ /**
10
+ * Extract the first component.
11
+ * @param tuple - The tuple to extract from.
12
+ * @returns The first component.
13
+ */
14
+ export const fst = (tuple) => tuple.fst;
15
+ /**
16
+ * Extract the second component.
17
+ * @param tuple - The tuple to extract from.
18
+ * @returns The second component.
19
+ */
20
+ export const snd = (tuple) => tuple.snd;
21
+ /**
22
+ * Map over the first component.
23
+ * @param f - Function to transform the first component.
24
+ * @returns A function that takes a Tuple and returns a new Tuple with mapped first component.
25
+ */
26
+ export const mapFst = (f) => (tuple) => Tuple(f(tuple.fst), tuple.snd);
27
+ /**
28
+ * Map over the second component.
29
+ * @param f - Function to transform the second component.
30
+ * @returns A function that takes a Tuple and returns a new Tuple with mapped second component.
31
+ */
32
+ export const mapSnd = (f) => (tuple) => Tuple(tuple.fst, f(tuple.snd));
33
+ /**
34
+ * Bifunctor bimap: map over both components independently.
35
+ * @param f - Function to transform the first component.
36
+ * @param g - Function to transform the second component.
37
+ * @returns A function that takes a Tuple and returns a new Tuple with both components mapped.
38
+ */
39
+ export const bimap = (f, g) => (tuple) => Tuple(f(tuple.fst), g(tuple.snd));
40
+ /**
41
+ * Convert a Tuple to a 2-element array.
42
+ * @param tuple - The tuple to convert.
43
+ * @returns A 2-element array.
44
+ */
45
+ export const toArray = (tuple) => [tuple.fst, tuple.snd];
46
+ /**
47
+ * Construct a Tuple from a 2-element array.
48
+ * @param arr - A 2-element array.
49
+ * @returns A Tuple constructed from the array.
50
+ */
51
+ export const fromArray = (arr) => Tuple(arr[0], arr[1]);
52
+ /**
53
+ * Swap the components of a Tuple.
54
+ * @param tuple - The tuple to swap.
55
+ * @returns A new Tuple with components reversed.
56
+ */
57
+ export const swap = (tuple) => Tuple(tuple.snd, tuple.fst);
58
+ /**
59
+ * Apply two functions to the same input, combining results as a Tuple.
60
+ * @param f - Function to apply to the input.
61
+ * @param g - Function to apply to the input.
62
+ * @returns A function that takes a value and returns a Tuple of the results.
63
+ */
64
+ export const fanout = (f, g) => (a) => Tuple(f(a), g(a));
65
+ // Fantasy Land symbols
66
+ // Note: FL methods excluded to work around vitest coverage serialization issues.
67
+ // The core functionality is complete and all point-free functions work correctly.
68
+ // TODO: Re-enable Fantasy Land methods when vitest issue is resolved.
69
+ //
70
+ // const tupleProto = Object.getPrototypeOf(Tuple(0, 0))
71
+ // tupleProto['fantasy-land/bimap'] = ...
72
+ // etc.
73
+ //# sourceMappingURL=Tuple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tuple.js","sourceRoot":"","sources":["../../src/Tuple.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAK7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GA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C;AAE5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,KAAkB,EAAe,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GACjB,CAAU,CAAc,EAAE,CAAc,EAA2B,EAAE,CACrE,CAAC,CAAC,EAAE,EAAE,CACJ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtB,uBAAuB;AACvB,iFAAiF;AACjF,kFAAkF;AAClF,sEAAsE;AACtE,EAAE;AACF,wDAAwD;AACxD,yCAAyC;AACzC,OAAO"}
@@ -0,0 +1,53 @@
1
+ /** Represents a Failure with accumulated errors. */
2
+ export type Failure<E> = {
3
+ readonly tag: 'Failure';
4
+ readonly errors: readonly E[];
5
+ };
6
+ /** Represents a Success value. */
7
+ export type Success<A> = {
8
+ readonly tag: 'Success';
9
+ readonly value: A;
10
+ };
11
+ /** Validation type: Failure<E> (errors) or Success<A> (value). */
12
+ export type Validation<E, A> = Failure<E> | Success<A>;
13
+ type Left<L> = {
14
+ readonly tag: 'Left';
15
+ readonly left: L;
16
+ };
17
+ type Right<R> = {
18
+ readonly tag: 'Right';
19
+ readonly right: R;
20
+ };
21
+ type Either<L, R> = Left<L> | Right<R>;
22
+ /** Create a Failure with one or more errors. */
23
+ export declare const Failure: <E>(errors: readonly E[]) => Failure<E>;
24
+ /** Create a Success value. */
25
+ export declare const Success: <A>(value: A) => Success<A>;
26
+ /** Test if a Validation is Failure. */
27
+ export declare const isFailure: <E, A>(va: Validation<E, A>) => va is Failure<E>;
28
+ /** Test if a Validation is Success. */
29
+ export declare const isSuccess: <E, A>(va: Validation<E, A>) => va is Success<A>;
30
+ /** Lift an Either into Validation. */
31
+ export declare const fromEither: <E, A>(ea: Either<E, A>) => Validation<E, A>;
32
+ /** Convert Validation to Either with errors array. */
33
+ export declare const toEither: <E, A>(va: Validation<E, A>) => Either<readonly E[], A>;
34
+ /** Construct Success if predicate holds, Failure otherwise. */
35
+ export declare const fromPredicate: <E, A>(predicate: (a: A) => boolean, onFalse: (a: A) => E) => ((a: A) => Validation<E, A>);
36
+ /** Functor map over Success. */
37
+ export declare const map: <E, A, B>(f: (a: A) => B) => ((va: Validation<E, A>) => Validation<E, B>);
38
+ /** Applicative ap: accumulates errors when both are Failures. */
39
+ export declare const ap: <E, A, B>(vf: Validation<E, (a: A) => B>) => ((va: Validation<E, A>) => Validation<E, B>);
40
+ /** Monadic bind (short-circuits on first Failure). */
41
+ export declare const chain: <E, A, B>(f: (a: A) => Validation<E, B>) => ((va: Validation<E, A>) => Validation<E, B>);
42
+ /** Extract Success or default. */
43
+ export declare const getOrElse: <E, A>(a: A) => ((va: Validation<E, A>) => A);
44
+ /** Case analysis. */
45
+ export declare const fold: <E, A, B>(onFailure: (errors: readonly E[]) => B, onSuccess: (a: A) => B) => ((va: Validation<E, A>) => B);
46
+ /** Merge two Validations; if both are Failure, concatenate errors. */
47
+ export declare const concat: <E, A>(va2: Validation<E, A>) => ((va1: Validation<E, A>) => Validation<E, A>);
48
+ /** Sequence all-or-Failure, collecting all errors. */
49
+ export declare const sequence: <E, A>(validations: readonly Validation<E, A>[]) => Validation<E, readonly A[]>;
50
+ /** Traverse a sequence, collecting all errors. */
51
+ export declare const traverse: <E, A, B>(f: (a: A) => Validation<E, B>) => ((as: readonly A[]) => Validation<E, readonly B[]>);
52
+ export {};
53
+ //# sourceMappingURL=Validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Validation.d.ts","sourceRoot":"","sources":["../../src/Validation.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAA;CAAE,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