functionalscript 0.1.609 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/com/cpp/module.f.d.mts +4 -8
  2. package/com/cpp/module.f.mjs +20 -25
  3. package/com/cpp/testlib.f.mjs +3 -4
  4. package/com/cs/module.f.d.mts +4 -8
  5. package/com/cs/module.f.mjs +18 -23
  6. package/com/cs/testlib.f.mjs +3 -5
  7. package/com/rust/module.f.d.mts +3 -7
  8. package/com/rust/module.f.mjs +25 -30
  9. package/com/rust/testlib.f.mjs +3 -5
  10. package/com/test/build.f.d.mts +2 -2
  11. package/com/test/build.f.mjs +2 -2
  12. package/com/test/build.mjs +4 -4
  13. package/com/types/module.f.d.mts +5 -10
  14. package/com/types/module.f.mjs +5 -12
  15. package/commonjs/build/module.f.d.mts +13 -17
  16. package/commonjs/build/module.f.mjs +23 -28
  17. package/commonjs/build/test.f.mjs +4 -4
  18. package/commonjs/module/function/module.f.d.mts +0 -2
  19. package/commonjs/module/function/module.f.mjs +0 -2
  20. package/commonjs/module/module.f.d.mts +16 -21
  21. package/commonjs/module/module.f.mjs +2 -9
  22. package/commonjs/module.d.mts +1 -5
  23. package/commonjs/module.f.d.mts +0 -2
  24. package/commonjs/module.f.mjs +0 -2
  25. package/commonjs/module.mjs +2 -7
  26. package/commonjs/package/dependencies/module.f.d.mts +3 -7
  27. package/commonjs/package/dependencies/module.f.mjs +5 -10
  28. package/commonjs/package/dependencies/test.f.mjs +1 -1
  29. package/commonjs/package/module.f.d.mts +12 -18
  30. package/commonjs/package/module.f.mjs +6 -13
  31. package/commonjs/package/test.f.mjs +1 -1
  32. package/commonjs/path/module.f.d.mts +25 -32
  33. package/commonjs/path/module.f.mjs +12 -23
  34. package/commonjs/path/test.f.mjs +11 -11
  35. package/commonjs/test.mjs +1 -1
  36. package/dev/module.f.d.mts +1 -4
  37. package/dev/module.f.mjs +1 -4
  38. package/dev/test/module.f.d.mts +2 -3
  39. package/dev/test/module.f.mjs +4 -6
  40. package/djs/module.f.d.mts +13 -18
  41. package/djs/module.f.mjs +12 -19
  42. package/djs/parser/module.f.d.mts +11 -15
  43. package/djs/parser/module.f.mjs +18 -24
  44. package/djs/parser/test.f.mjs +9 -9
  45. package/djs/test.f.mjs +4 -4
  46. package/djs/tokenizer/module.f.d.mts +6 -10
  47. package/djs/tokenizer/module.f.mjs +18 -23
  48. package/djs/tokenizer/test.f.mjs +6 -6
  49. package/fsc/module.f.d.mts +4 -9
  50. package/fsc/module.f.mjs +17 -24
  51. package/fsc/test.f.mjs +3 -3
  52. package/fsm/module.f.d.mts +13 -20
  53. package/fsm/module.f.mjs +27 -38
  54. package/fsm/test.f.mjs +8 -8
  55. package/html/module.f.d.mts +7 -12
  56. package/html/module.f.mjs +14 -23
  57. package/html/test.f.mjs +4 -4
  58. package/js/tokenizer/module.f.d.mts +10 -15
  59. package/js/tokenizer/module.f.mjs +55 -62
  60. package/js/tokenizer/test.f.mjs +6 -6
  61. package/json/module.f.d.mts +18 -26
  62. package/json/module.f.mjs +18 -31
  63. package/json/parser/module.f.d.mts +9 -13
  64. package/json/parser/module.f.mjs +9 -14
  65. package/json/parser/test.f.mjs +7 -7
  66. package/json/serializer/module.f.d.mts +11 -20
  67. package/json/serializer/module.f.mjs +14 -29
  68. package/json/serializer/test.f.mjs +2 -2
  69. package/json/test.f.mjs +3 -3
  70. package/json/tokenizer/module.f.d.mts +6 -10
  71. package/json/tokenizer/module.f.mjs +14 -19
  72. package/json/tokenizer/test.f.mjs +6 -6
  73. package/jsr.json +1 -1
  74. package/nodejs/version/main.mjs +1 -1
  75. package/nodejs/version/module.f.d.mts +4 -9
  76. package/nodejs/version/module.f.mjs +2 -7
  77. package/nodejs/version/test.f.mjs +3 -3
  78. package/package.json +1 -1
  79. package/prime_field/module.f.d.mts +20 -23
  80. package/prime_field/module.f.mjs +9 -12
  81. package/prime_field/test.f.mjs +1 -1
  82. package/secp/module.f.d.mts +27 -28
  83. package/secp/module.f.mjs +38 -39
  84. package/secp/test.f.mjs +4 -4
  85. package/sha2/module.f.d.mts +8 -16
  86. package/sha2/module.f.mjs +7 -20
  87. package/sha2/test.f.mjs +4 -4
  88. package/text/ascii/module.f.d.mts +69 -72
  89. package/text/ascii/module.f.mjs +5 -10
  90. package/text/ascii/test.f.mjs +3 -3
  91. package/text/module.f.d.mts +9 -14
  92. package/text/module.f.mjs +7 -14
  93. package/text/sgr/module.f.d.mts +7 -9
  94. package/text/sgr/module.f.mjs +2 -4
  95. package/text/test.f.mjs +3 -3
  96. package/text/utf16/module.f.d.mts +8 -15
  97. package/text/utf16/module.f.mjs +17 -28
  98. package/text/utf16/test.f.mjs +5 -5
  99. package/text/utf8/module.f.d.mts +4 -9
  100. package/text/utf8/module.f.mjs +9 -16
  101. package/text/utf8/test.f.mjs +4 -4
  102. package/types/array/module.f.d.mts +14 -24
  103. package/types/array/module.f.mjs +8 -25
  104. package/types/array/test.f.mjs +3 -3
  105. package/types/bigfloat/module.f.d.mts +4 -9
  106. package/types/bigfloat/module.f.mjs +3 -10
  107. package/types/bigfloat/test.f.mjs +1 -1
  108. package/types/bigint/module.f.d.mts +16 -64
  109. package/types/bigint/module.f.mjs +11 -30
  110. package/types/bigint/test.f.mjs +1 -1
  111. package/types/btree/find/module.f.d.mts +20 -26
  112. package/types/btree/find/module.f.mjs +8 -17
  113. package/types/btree/find/test.f.mjs +7 -7
  114. package/types/btree/module.f.d.mts +4 -8
  115. package/types/btree/module.f.mjs +6 -11
  116. package/types/btree/remove/module.f.d.mts +7 -12
  117. package/types/btree/remove/module.f.mjs +10 -17
  118. package/types/btree/remove/test.f.mjs +5 -5
  119. package/types/btree/set/module.f.d.mts +3 -7
  120. package/types/btree/set/module.f.mjs +4 -9
  121. package/types/btree/set/test.f.mjs +4 -4
  122. package/types/btree/test.f.mjs +9 -9
  123. package/types/btree/types/module.f.d.mts +0 -2
  124. package/types/btree/types/module.f.mjs +0 -2
  125. package/types/byte_set/module.f.d.mts +16 -29
  126. package/types/byte_set/module.f.mjs +14 -39
  127. package/types/byte_set/test.f.mjs +5 -5
  128. package/types/function/compare/module.f.d.mts +9 -15
  129. package/types/function/compare/module.f.mjs +3 -12
  130. package/types/function/compare/test.f.mjs +1 -1
  131. package/types/function/module.f.d.mts +20 -27
  132. package/types/function/module.f.mjs +4 -15
  133. package/types/function/operator/module.f.d.mts +28 -43
  134. package/types/function/operator/module.f.mjs +14 -41
  135. package/types/function/test.f.mjs +1 -1
  136. package/types/list/module.f.d.mts +56 -91
  137. package/types/list/module.f.mjs +45 -114
  138. package/types/list/test.f.mjs +10 -10
  139. package/types/map/module.f.d.mts +15 -24
  140. package/types/map/module.f.mjs +15 -30
  141. package/types/map/test.f.mjs +2 -2
  142. package/types/nibble_set/module.f.d.mts +10 -20
  143. package/types/nibble_set/module.f.mjs +7 -24
  144. package/types/nibble_set/test.f.mjs +2 -2
  145. package/types/nullable/module.f.d.mts +3 -8
  146. package/types/nullable/module.f.mjs +2 -9
  147. package/types/nullable/test.f.mjs +1 -1
  148. package/types/number/module.f.d.mts +7 -13
  149. package/types/number/module.f.mjs +8 -19
  150. package/types/number/test.f.mjs +1 -1
  151. package/types/object/module.f.d.mts +11 -18
  152. package/types/object/module.f.mjs +9 -20
  153. package/types/object/test.f.mjs +1 -1
  154. package/types/range/module.f.d.mts +3 -8
  155. package/types/range/module.f.mjs +2 -9
  156. package/types/range/test.f.mjs +1 -1
  157. package/types/range_map/module.f.d.mts +9 -15
  158. package/types/range_map/module.f.mjs +9 -18
  159. package/types/range_map/test.f.mjs +32 -32
  160. package/types/result/module.d.mts +3 -3
  161. package/types/result/module.f.d.mts +6 -12
  162. package/types/result/module.f.mjs +3 -12
  163. package/types/result/module.mjs +2 -2
  164. package/types/sorted_list/module.f.d.mts +22 -28
  165. package/types/sorted_list/module.f.mjs +10 -19
  166. package/types/sorted_list/test.f.mjs +7 -7
  167. package/types/sorted_set/module.f.d.mts +6 -12
  168. package/types/sorted_set/module.f.mjs +7 -16
  169. package/types/sorted_set/test.f.mjs +7 -7
  170. package/types/string/module.f.d.mts +8 -14
  171. package/types/string/module.f.mjs +10 -21
  172. package/types/string/test.f.mjs +2 -2
  173. package/types/string_set/module.f.d.mts +8 -16
  174. package/types/string_set/module.f.mjs +12 -27
  175. package/types/string_set/test.f.mjs +1 -1
@@ -1,25 +1,3 @@
1
- declare namespace _default {
2
- export { join };
3
- export { addition };
4
- export { increment };
5
- export { strictEqual };
6
- export { logicalNot };
7
- export { min };
8
- export { max };
9
- export { stateScanToScan };
10
- export { foldToScan };
11
- export { reduceToScan };
12
- export { counter };
13
- export { concat };
14
- }
15
- export default _default;
16
- export type Binary<A, B, R> = (a: A) => (b: B) => R;
17
- export type Fold<I, O> = Binary<I, O, O>;
18
- export type Unary<T, R> = (value: T) => R;
19
- export type Equal<T> = Binary<T, T, boolean>;
20
- export type Scan<I, O> = (input: I) => readonly [O, Scan<I, O>];
21
- export type StateScan<I, S, O> = (prior: S) => (input: I) => readonly [O, S];
22
- export type Reduce<T> = Fold<T, T>;
23
1
  /**
24
2
  * @template A
25
3
  * @template B
@@ -31,27 +9,22 @@ export type Reduce<T> = Fold<T, T>;
31
9
  * @typedef {Binary<I, O, O>} Fold
32
10
  */
33
11
  /** @type {(separator: string) => Reduce<string>} */
34
- declare const join: (separator: string) => Reduce<string>;
35
- /** @type {Reduce<number>} */
36
- declare const addition: Reduce<number>;
37
- declare const increment: (b: number) => number;
38
- /**
39
- * @template T
40
- * @typedef {Binary<T, T, boolean>} Equal
41
- */
42
- /** @type {<T>(a: T) => (b: T) => boolean} */
43
- declare const strictEqual: <T>(a: T) => (b: T) => boolean;
12
+ export const join: (separator: string) => Reduce<string>;
13
+ /** @type {Reduce<string>} */
14
+ export const concat: Reduce<string>;
44
15
  /**
45
16
  * @template T
46
17
  * @template R
47
18
  * @typedef {(value: T) => R} Unary
48
19
  */
49
20
  /** @type {Unary<boolean, boolean>} */
50
- declare const logicalNot: Unary<boolean, boolean>;
51
- /** @type {Reduce<number>} */
52
- declare const min: Reduce<number>;
53
- /** @type {Reduce<number>} */
54
- declare const max: Reduce<number>;
21
+ export const logicalNot: Unary<boolean, boolean>;
22
+ /**
23
+ * @template T
24
+ * @typedef {Binary<T, T, boolean>} Equal
25
+ */
26
+ /** @type {<T>(a: T) => (b: T) => boolean} */
27
+ export const strictEqual: <T>(a: T) => (b: T) => boolean;
55
28
  /**
56
29
  * @template I,O
57
30
  * @typedef {(input: I) => readonly[O, Scan<I,O>]} Scan
@@ -61,15 +34,27 @@ declare const max: Reduce<number>;
61
34
  * @typedef {(prior: S) => (input: I) => readonly[O, S]} StateScan
62
35
  */
63
36
  /** @type {<I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>} */
64
- declare const stateScanToScan: <I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>;
37
+ export const stateScanToScan: <I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>;
65
38
  /** @type {<I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>} */
66
- declare const foldToScan: <I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>;
39
+ export const foldToScan: <I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>;
67
40
  /**
68
41
  * @template T
69
42
  * @typedef {Fold<T, T>} Reduce
70
43
  */
71
44
  /** @type {<T>(fold: Reduce<T>) => Scan<T, T>} */
72
- declare const reduceToScan: <T>(fold: Reduce<T>) => Scan<T, T>;
73
- declare function counter(): (b: number) => number;
74
- /** @type {Reduce<string>} */
75
- declare const concat: Reduce<string>;
45
+ export const reduceToScan: <T>(fold: Reduce<T>) => Scan<T, T>;
46
+ /** @type {Reduce<number>} */
47
+ export const addition: Reduce<number>;
48
+ /** @type {Reduce<number>} */
49
+ export const min: Reduce<number>;
50
+ /** @type {Reduce<number>} */
51
+ export const max: Reduce<number>;
52
+ export const increment: (b: number) => number;
53
+ export function counter(): (b: number) => number;
54
+ export type Binary<A, B, R> = (a: A) => (b: B) => R;
55
+ export type Fold<I, O> = Binary<I, O, O>;
56
+ export type Unary<T, R> = (value: T) => R;
57
+ export type Equal<T> = Binary<T, T, boolean>;
58
+ export type Scan<I, O> = (input: I) => readonly [O, Scan<I, O>];
59
+ export type StateScan<I, S, O> = (prior: S) => (input: I) => readonly [O, S];
60
+ export type Reduce<T> = Fold<T, T>;
@@ -12,10 +12,10 @@
12
12
  */
13
13
 
14
14
  /** @type {(separator: string) => Reduce<string>} */
15
- const join = separator => value => prior => `${prior}${separator}${value}`
15
+ export const join = separator => value => prior => `${prior}${separator}${value}`
16
16
 
17
17
  /** @type {Reduce<string>} */
18
- const concat = i => acc => `${acc}${i}`
18
+ export const concat = i => acc => `${acc}${i}`
19
19
 
20
20
  /**
21
21
  * @template T
@@ -24,7 +24,7 @@ const concat = i => acc => `${acc}${i}`
24
24
  */
25
25
 
26
26
  /** @type {Unary<boolean, boolean>} */
27
- const logicalNot = v => !v
27
+ export const logicalNot = v => !v
28
28
 
29
29
  /**
30
30
  * @template T
@@ -32,7 +32,7 @@ const logicalNot = v => !v
32
32
  */
33
33
 
34
34
  /** @type {<T>(a: T) => (b: T) => boolean} */
35
- const strictEqual = a => b => a === b
35
+ export const strictEqual = a => b => a === b
36
36
 
37
37
  /**
38
38
  * @template I,O
@@ -45,13 +45,13 @@ const strictEqual = a => b => a === b
45
45
  */
46
46
 
47
47
  /** @type {<I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>} */
48
- const stateScanToScan = op => prior => i => {
48
+ export const stateScanToScan = op => prior => i => {
49
49
  const [o, s] = op(prior)(i)
50
50
  return [o, stateScanToScan(op)(s)]
51
51
  }
52
52
 
53
53
  /** @type {<I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>} */
54
- const foldToScan = fold => prior => i => {
54
+ export const foldToScan = fold => prior => i => {
55
55
  const result = fold(i)(prior)
56
56
  return [result, foldToScan(fold)(result)]
57
57
  }
@@ -62,44 +62,17 @@ const foldToScan = fold => prior => i => {
62
62
  */
63
63
 
64
64
  /** @type {<T>(fold: Reduce<T>) => Scan<T, T>} */
65
- const reduceToScan = op => init => [init, foldToScan(op)(init)]
65
+ export const reduceToScan = op => init => [init, foldToScan(op)(init)]
66
66
 
67
67
  /** @type {Reduce<number>} */
68
- const addition = a => b => a + b
68
+ export const addition = a => b => a + b
69
69
 
70
70
  /** @type {Reduce<number>} */
71
- const min = a => b => a < b ? a : b
71
+ export const min = a => b => a < b ? a : b
72
72
 
73
73
  /** @type {Reduce<number>} */
74
- const max = a => b => a > b ? a : b
75
-
76
- const increment = addition(1)
77
-
78
- const counter = () => increment
79
-
80
- export default {
81
- /** @readonly */
82
- join,
83
- /** @readonly */
84
- addition,
85
- /** @readonly */
86
- increment,
87
- /** @readonly */
88
- strictEqual,
89
- /** @readonly */
90
- logicalNot,
91
- /** @readonly */
92
- min,
93
- /** @readonly */
94
- max,
95
- /** @readonly */
96
- stateScanToScan,
97
- /** @readonly */
98
- foldToScan,
99
- /** @readonly */
100
- reduceToScan,
101
- /** @readonly */
102
- counter,
103
- /** @readonly */
104
- concat,
105
- }
74
+ export const max = a => b => a > b ? a : b
75
+
76
+ export const increment = addition(1)
77
+
78
+ export const counter = () => increment
@@ -1,4 +1,4 @@
1
- import _ from './module.f.mjs'
1
+ import * as _ from './module.f.mjs'
2
2
 
3
3
  const { fn } = _
4
4
 
@@ -1,117 +1,82 @@
1
- declare namespace _default {
2
- export let empty: null;
3
- export { concat };
4
- export { next };
5
- export { iterable };
6
- export { toArray };
7
- export { flat };
8
- export { map };
9
- export { flatMap };
10
- export { filter };
11
- export { filterMap };
12
- export { takeWhile };
13
- export { take };
14
- export { dropWhile };
15
- export { drop };
16
- export { first };
17
- export { last };
18
- export { find };
19
- export { some };
20
- export { every };
21
- export { isEmpty };
22
- export { includes };
23
- export { countdown };
24
- export { repeat };
25
- export { cycle };
26
- export { scan };
27
- export { stateScan };
28
- export { foldScan };
29
- export { fold };
30
- export { reduce };
31
- export { length };
32
- export { entries };
33
- export { reverse };
34
- export { zip };
35
- export { equal };
36
- }
37
- export default _default;
38
- export type List<T> = NotLazy<T> | Thunk<T>;
39
- export type NotLazy<T> = Result<T> | Concat<T> | readonly T[];
40
- export type Empty = null;
41
- export type Result<T> = Empty | NonEmpty<T>;
42
- export type Thunk<T> = () => List<T>;
43
- export type NonEmpty<T> = {
44
- readonly first: T;
45
- readonly tail: List<T>;
46
- };
47
- export type Concat<T> = {
48
- readonly head: List<T>;
49
- readonly tail: List<T>;
50
- };
51
- export type Entry<T> = readonly [number, T];
52
1
  /** @type {<T>(head: List<T>) => (tail: List<T>) => List<T>} */
53
- declare const concat: <T>(head: List<T>) => (tail: List<T>) => List<T>;
2
+ export const concat: <T>(head: List<T>) => (tail: List<T>) => List<T>;
54
3
  /** @type {<T>(list: List<T>) => Result<T>} */
55
- declare const next: <T>(list: List<T>) => Result<T>;
4
+ export const next: <T>(list: List<T>) => Result<T>;
56
5
  /** @type {<T>(list: List<T>) => Iterable<T>} */
57
- declare const iterable: <T>(list: List<T>) => Iterable<T>;
6
+ export const iterable: <T>(list: List<T>) => Iterable<T>;
58
7
  /** @type {<T>(list: List<T>) => readonly T[]} */
59
- declare const toArray: <T>(list: List<T>) => readonly T[];
8
+ export const toArray: <T>(list: List<T>) => readonly T[];
60
9
  /** @type {<T>(list: List<List<T>>) => Thunk<T>} */
61
- declare const flat: <T>(list: List<List<T>>) => Thunk<T>;
10
+ export const flat: <T>(list: List<List<T>>) => Thunk<T>;
62
11
  /** @type {<I, O>(f: (value: I) => O) => (input: List<I>) => Thunk<O>} */
63
- declare const map: <I, O>(f: (value: I) => O) => (input: List<I>) => Thunk<O>;
12
+ export const map: <I, O>(f: (value: I) => O) => (input: List<I>) => Thunk<O>;
64
13
  /** @type {<I, O>(f: (value: I) => List<O>) => (input: List<I>) => Thunk<O>} */
65
- declare const flatMap: <I, O>(f: (value: I) => List<O>) => (input: List<I>) => Thunk<O>;
14
+ export const flatMap: <I, O>(f: (value: I) => List<O>) => (input: List<I>) => Thunk<O>;
66
15
  /** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
67
- declare const filter: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
16
+ export const filter: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
68
17
  /** @type {<I, O>(f: (value: I) => O|null) => (input: List<I>) => Thunk<O>} */
69
- declare const filterMap: <I, O>(f: (value: I) => O | null) => (input: List<I>) => Thunk<O>;
18
+ export const filterMap: <I, O>(f: (value: I) => O | null) => (input: List<I>) => Thunk<O>;
70
19
  /** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
71
- declare const takeWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
20
+ export const takeWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
72
21
  /** @type {(n: number) => <T>(input: List<T>) => Thunk<T>} */
73
- declare const take: (n: number) => <T>(input: List<T>) => Thunk<T>;
22
+ export const take: (n: number) => <T>(input: List<T>) => Thunk<T>;
74
23
  /** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
75
- declare const dropWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
24
+ export const dropWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
76
25
  /** @type {(n: number) => <T>(input: List<T>) => Thunk<T>} */
77
- declare const drop: (n: number) => <T>(input: List<T>) => Thunk<T>;
26
+ export const drop: (n: number) => <T>(input: List<T>) => Thunk<T>;
78
27
  /** @type {<D>(def: D) => <T>(input: List<T>) => D|T} */
79
- declare const first: <D>(def: D) => <T>(input: List<T>) => D | T;
28
+ export const first: <D>(def: D) => <T>(input: List<T>) => D | T;
80
29
  /** @type {<D>(first: D) => <T>(tail: List<T>) => D|T} */
81
- declare const last: <D>(first: D) => <T>(tail: List<T>) => D | T;
30
+ export const last: <D>(first: D) => <T>(tail: List<T>) => D | T;
82
31
  /** @type {<D>(def: D) => <T>(f: (value: T) => boolean) => (input: List<T>) => D|T} */
83
- declare const find: <D>(def: D) => <T>(f: (value: T) => boolean) => (input: List<T>) => D | T;
32
+ export const find: <D>(def: D) => <T>(f: (value: T) => boolean) => (input: List<T>) => D | T;
84
33
  /** @type {(input: List<boolean>) => boolean} */
85
- declare const some: (input: List<boolean>) => boolean;
86
- declare const every: import("../function/module.f.mjs").Func<List<boolean>, boolean>;
34
+ export const some: (input: List<boolean>) => boolean;
87
35
  /** @type {<T>(input: List<T>) => boolean} */
88
- declare const isEmpty: <T>(input: List<T>) => boolean;
36
+ export const isEmpty: <T>(input: List<T>) => boolean;
37
+ export const every: function_.Func<List<boolean>, boolean>;
89
38
  /** @type {<T>(value: T) => (sequence: List<T>) => boolean} */
90
- declare const includes: <T>(value: T) => (sequence: List<T>) => boolean;
39
+ export const includes: <T>(value: T) => (sequence: List<T>) => boolean;
91
40
  /** @type {(count: number) => Thunk<number>} */
92
- declare const countdown: (count: number) => Thunk<number>;
41
+ export const countdown: (count: number) => Thunk<number>;
93
42
  /** @type {<T>(v: T) => (c: number) => Thunk<T>} */
94
- declare const repeat: <T>(v: T) => (c: number) => Thunk<T>;
43
+ export const repeat: <T>(v: T) => (c: number) => Thunk<T>;
95
44
  /** @type {<T>(list: List<T>) => List<T>} */
96
- declare const cycle: <T>(list: List<T>) => List<T>;
97
- /** @type {<I, O>(op: Operator.Scan<I, O>) => (input: List<I>) => Thunk<O>} */
98
- declare const scan: <I, O>(op: Operator.Scan<I, O>) => (input: List<I>) => Thunk<O>;
99
- /** @type {<I, S, O>(op: Operator.StateScan<I, S, O>) => (init: S) => (input: List<I>) => Thunk<O>} */
100
- declare const stateScan: <I, S, O>(op: Operator.StateScan<I, S, O>) => (init: S) => (input: List<I>) => Thunk<O>;
101
- /** @type {<I,O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => Thunk<O>} */
102
- declare const foldScan: <I, O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => Thunk<O>;
103
- /** @type {<I,O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => O} */
104
- declare const fold: <I, O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => O;
105
- /** @type {<T>(op: Operator.Reduce<T>) => <D>(def: D) => (input: List<T>) => D|T} */
106
- declare const reduce: <T>(op: Operator.Reduce<T>) => <D>(def: D) => (input: List<T>) => D | T;
45
+ export const cycle: <T>(list: List<T>) => List<T>;
46
+ /** @type {<I, O>(op: operator.Scan<I, O>) => (input: List<I>) => Thunk<O>} */
47
+ export const scan: <I, O>(op: operator.Scan<I, O>) => (input: List<I>) => Thunk<O>;
48
+ /** @type {<I, S, O>(op: operator.StateScan<I, S, O>) => (init: S) => (input: List<I>) => Thunk<O>} */
49
+ export const stateScan: <I, S, O>(op: operator.StateScan<I, S, O>) => (init: S) => (input: List<I>) => Thunk<O>;
50
+ /** @type {<I,O>(op: operator.Fold<I, O>) => (init: O) => (input: List<I>) => Thunk<O>} */
51
+ export const foldScan: <I, O>(op: operator.Fold<I, O>) => (init: O) => (input: List<I>) => Thunk<O>;
52
+ /** @type {<I,O>(op: operator.Fold<I, O>) => (init: O) => (input: List<I>) => O} */
53
+ export const fold: <I, O>(op: operator.Fold<I, O>) => (init: O) => (input: List<I>) => O;
54
+ /** @type {<T>(op: operator.Reduce<T>) => <D>(def: D) => (input: List<T>) => D|T} */
55
+ export const reduce: <T>(op: operator.Reduce<T>) => <D>(def: D) => (input: List<T>) => D | T;
107
56
  /** @type {<T>(input: List<T>) => number} */
108
- declare const length: <T>(input: List<T>) => number;
57
+ export const length: <T>(input: List<T>) => number;
109
58
  /** @type {<T>(input: List<T>) => Thunk<Entry<T>>} */
110
- declare const entries: <T>(input: List<T>) => Thunk<Entry<T>>;
59
+ export const entries: <T>(input: List<T>) => Thunk<Entry<T>>;
111
60
  /** @type {<T>(input: List<T>) => List<T>} */
112
- declare const reverse: <T>(input: List<T>) => List<T>;
61
+ export const reverse: <T>(input: List<T>) => List<T>;
113
62
  /** @type {<A>(a: List<A>) => <B>(b: List<B>) => Thunk<readonly[A, B]>} */
114
- declare const zip: <A>(a: List<A>) => <B>(b: List<B>) => Thunk<readonly [A, B]>;
115
- /** @type {<T>(e: Operator.Equal<T>) => (a: List<T>) => (b: List<T>) => boolean} */
116
- declare const equal: <T>(e: Operator.Equal<T>) => (a: List<T>) => (b: List<T>) => boolean;
117
- import * as Operator from '../function/operator/module.f.mjs';
63
+ export const zip: <A>(a: List<A>) => <B>(b: List<B>) => Thunk<readonly [A, B]>;
64
+ /** @type {<T>(e: operator.Equal<T>) => (a: List<T>) => (b: List<T>) => boolean} */
65
+ export const equal: <T>(e: operator.Equal<T>) => (a: List<T>) => (b: List<T>) => boolean;
66
+ export const empty: null;
67
+ export type List<T> = NotLazy<T> | Thunk<T>;
68
+ export type NotLazy<T> = Result<T> | Concat<T> | readonly T[];
69
+ export type Empty = null;
70
+ export type Result<T> = Empty | NonEmpty<T>;
71
+ export type Thunk<T> = () => List<T>;
72
+ export type NonEmpty<T> = {
73
+ readonly first: T;
74
+ readonly tail: List<T>;
75
+ };
76
+ export type Concat<T> = {
77
+ readonly head: List<T>;
78
+ readonly tail: List<T>;
79
+ };
80
+ export type Entry<T> = readonly [number, T];
81
+ import * as function_ from '../function/module.f.mjs';
82
+ import * as operator from '../function/operator/module.f.mjs';