@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,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,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AAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAE3B,CAAC"}
@@ -0,0 +1,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,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CAAC,CAAC,KAAG,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,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,C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AAM,CAAC,MAAM,SAAS,GACpB,CAAO,KAAQ,EAAqC,EAAE,CACtD,CAAC,WAAW,EAAE,EAAE;IACd,MAAM,CAAC,CAAC,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,G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CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,EAAE,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","source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AAO,GAAoB,EAAe,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;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,IAA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,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAEvE,CAAC"}
@@ -0,0 +1,77 @@
1
+ // Validation — Accumulating Errors
2
+ /** Create a Failure with one or more errors. */
3
+ export const Failure = (errors) => ({
4
+ tag: 'Failure',
5
+ errors
6
+ });
7
+ /** Create a Success value. */
8
+ export const Success = (value) => ({
9
+ tag: 'Success',
10
+ value
11
+ });
12
+ /** Test if a Validation is Failure. */
13
+ export const isFailure = (va) => va.tag === 'Failure';
14
+ /** Test if a Validation is Success. */
15
+ export const isSuccess = (va) => va.tag === 'Success';
16
+ /** Lift an Either into Validation. */
17
+ export const fromEither = (ea) => (ea.tag === 'Left' ? Failure([ea.left]) : Success(ea.right));
18
+ /** Convert Validation to Either with errors array. */
19
+ export const toEither = (va) => (va.tag === 'Failure' ? { tag: 'Left', left: va.errors } : { tag: 'Right', right: va.value });
20
+ /** Construct Success if predicate holds, Failure otherwise. */
21
+ export const fromPredicate = (predicate, onFalse) => (a) => predicate(a) ? Success(a) : Failure([onFalse(a)]);
22
+ /** Functor map over Success. */
23
+ export const map = (f) => (va) => va.tag === 'Success' ? Success(f(va.value)) : va;
24
+ /** Applicative ap: accumulates errors when both are Failures. */
25
+ export const ap = (vf) => (va) => {
26
+ if (vf.tag === 'Failure' && va.tag === 'Failure') {
27
+ return Failure([...vf.errors, ...va.errors]);
28
+ }
29
+ if (vf.tag === 'Failure')
30
+ return vf;
31
+ if (va.tag === 'Failure')
32
+ return va;
33
+ return Success(vf.value(va.value));
34
+ };
35
+ /** Monadic bind (short-circuits on first Failure). */
36
+ export const chain = (f) => (va) => va.tag === 'Failure' ? va : f(va.value);
37
+ /** Extract Success or default. */
38
+ export const getOrElse = (a) => (va) => va.tag === 'Success' ? va.value : a;
39
+ /** Case analysis. */
40
+ export const fold = (onFailure, onSuccess) => (va) => va.tag === 'Failure' ? onFailure(va.errors) : onSuccess(va.value);
41
+ /** Merge two Validations; if both are Failure, concatenate errors. */
42
+ export const concat = (va2) => (va1) => {
43
+ if (va1.tag === 'Failure' && va2.tag === 'Failure') {
44
+ return Failure([...va1.errors, ...va2.errors]);
45
+ }
46
+ if (va1.tag === 'Failure')
47
+ return va1;
48
+ return va2;
49
+ };
50
+ /** Sequence all-or-Failure, collecting all errors. */
51
+ export const sequence = (validations) => {
52
+ const result = [];
53
+ const errors = [];
54
+ for (const va of validations) {
55
+ if (va.tag === 'Failure') {
56
+ errors.push(...va.errors);
57
+ }
58
+ else {
59
+ result.push(va.value);
60
+ }
61
+ }
62
+ return errors.length > 0 ? Failure(errors) : Success(result);
63
+ };
64
+ /** Traverse a sequence, collecting all errors. */
65
+ export const traverse = (f) => (as) => sequence(as.map(f));
66
+ // Fantasy Land symbols
67
+ // Note: FL methods are excluded to work around vitest coverage serialization issues.
68
+ // The core functionality is complete and all point-free functions work correctly.
69
+ // TODO: Re-enable Fantasy Land methods when vitest issue is resolved.
70
+ //
71
+ // Object.defineProperty(Success, 'fantasy-land/of', { value: Success })
72
+ // Object.defineProperty(Failure, 'fantasy-land/zero', { value: Failure([]) })
73
+ //
74
+ // const successProto = Object.getPrototypeOf(Success(0))
75
+ // successProto['fantasy-land/map'] = ...
76
+ // etc.
77
+ //# sourceMappingURL=Validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Validation.js","sourceRoot":"","sources":["../../../src/Validation.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAgBnC,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,MAAoB,EAAc,EAAE,CAAC,CAAC;IAC/D,GAAG,EAAE,SAAS;IACd,MAAM;CACP,CAAC,CAAC;AAEH,8BAA8B;AAC9B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAQ,EAAc,EAAE,CAAC,CAAC;IACnD,GAAG,EAAE,SAAS;IACd,KAAK;CACN,CAAC,CAAC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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAExB,uBAAuB;AACvB,qFAAqF;AACrF,kFAAkF;AAClF,sEAAsE;AACtE,EAAE;AACF,wEAAwE;AACxE,8EAA8E;AAC9E,EAAE;AACF,yDAAyD;AACzD,yCAAyC;AACzC,OAAO"}
@@ -0,0 +1,12 @@
1
+ export * as Maybe from './Maybe.js';
2
+ export * as Either from './Either.js';
3
+ export * as Validation from './Validation.js';
4
+ export * as Reader from './Reader.js';
5
+ export * as State from './State.js';
6
+ export * as Tuple from './Tuple.js';
7
+ export * as NonEmptyList from './NonEmptyList.js';
8
+ export * as List from './List.js';
9
+ export * as Function from './Function.js';
10
+ export * as MaybeAsync from './MaybeAsync.js';
11
+ export * as EitherAsync from './EitherAsync.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC"}