functionalscript 0.1.609 → 0.2.1

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 (393) hide show
  1. package/com/cpp/module.f.mjs +20 -25
  2. package/com/cpp/testlib.f.mjs +3 -4
  3. package/com/cs/module.f.mjs +18 -23
  4. package/com/cs/testlib.f.mjs +3 -5
  5. package/com/rust/module.f.mjs +25 -30
  6. package/com/rust/testlib.f.mjs +3 -5
  7. package/com/test/build.f.mjs +2 -2
  8. package/com/test/build.mjs +4 -4
  9. package/com/types/module.f.mjs +5 -12
  10. package/commonjs/build/module.f.mjs +23 -28
  11. package/commonjs/build/test.f.mjs +4 -4
  12. package/commonjs/module/function/module.f.mjs +0 -2
  13. package/commonjs/module/module.f.mjs +2 -9
  14. package/commonjs/module.f.mjs +0 -2
  15. package/commonjs/module.mjs +2 -7
  16. package/commonjs/package/dependencies/module.f.mjs +5 -10
  17. package/commonjs/package/dependencies/test.f.mjs +1 -1
  18. package/commonjs/package/module.f.mjs +6 -13
  19. package/commonjs/package/test.f.mjs +1 -1
  20. package/commonjs/path/module.f.mjs +12 -23
  21. package/commonjs/path/test.f.mjs +11 -11
  22. package/commonjs/test.mjs +1 -1
  23. package/dev/module.f.mjs +1 -4
  24. package/dev/module.mjs +1 -1
  25. package/dev/test/module.f.mjs +4 -6
  26. package/djs/module.f.mjs +12 -19
  27. package/djs/parser/module.f.mjs +18 -24
  28. package/djs/parser/test.f.mjs +9 -9
  29. package/djs/test.f.mjs +4 -4
  30. package/djs/tokenizer/module.f.mjs +18 -23
  31. package/djs/tokenizer/test.f.mjs +6 -6
  32. package/fsc/module.f.mjs +17 -24
  33. package/fsc/test.f.mjs +3 -3
  34. package/fsm/module.f.mjs +27 -38
  35. package/fsm/test.f.mjs +8 -8
  36. package/html/module.f.mjs +14 -23
  37. package/html/test.f.mjs +4 -4
  38. package/js/tokenizer/module.f.mjs +55 -62
  39. package/js/tokenizer/test.f.mjs +6 -6
  40. package/json/module.f.mjs +18 -31
  41. package/json/parser/module.f.mjs +9 -14
  42. package/json/parser/test.f.mjs +7 -7
  43. package/json/serializer/module.f.mjs +14 -29
  44. package/json/serializer/test.f.mjs +2 -2
  45. package/json/test.f.mjs +3 -3
  46. package/json/tokenizer/module.f.mjs +14 -19
  47. package/json/tokenizer/test.f.mjs +6 -6
  48. package/jsr.json +59 -59
  49. package/nodejs/version/main.mjs +1 -1
  50. package/nodejs/version/module.f.mjs +2 -7
  51. package/nodejs/version/test.f.mjs +3 -3
  52. package/out/com/cpp/module.f.d.mts +4 -0
  53. package/out/com/cpp/module.f.mjs +123 -0
  54. package/out/com/cpp/test.f.mjs +40 -0
  55. package/out/com/cpp/testlib.f.mjs +7 -0
  56. package/out/com/cs/module.f.d.mts +4 -0
  57. package/out/com/cs/module.f.mjs +95 -0
  58. package/out/com/cs/test.f.mjs +43 -0
  59. package/out/com/cs/testlib.f.mjs +7 -0
  60. package/{com → out/com}/rust/module.f.d.mts +3 -7
  61. package/out/com/rust/module.f.mjs +213 -0
  62. package/out/com/rust/test.f.mjs +123 -0
  63. package/out/com/rust/testlib.f.mjs +7 -0
  64. package/{com → out/com}/test/build.f.d.mts +2 -2
  65. package/out/com/test/build.f.mjs +98 -0
  66. package/out/com/test/build.mjs +40 -0
  67. package/{com → out/com}/types/module.f.d.mts +5 -10
  68. package/out/com/types/module.f.mjs +51 -0
  69. package/out/com/types/testlib.f.mjs +30 -0
  70. package/out/commonjs/build/module.f.d.mts +20 -0
  71. package/out/commonjs/build/module.f.mjs +107 -0
  72. package/out/commonjs/build/test.f.mjs +102 -0
  73. package/{commonjs → out/commonjs}/module/function/module.f.d.mts +0 -2
  74. package/out/commonjs/module/function/module.f.mjs +15 -0
  75. package/{commonjs → out/commonjs}/module/module.f.d.mts +16 -21
  76. package/out/commonjs/module/module.f.mjs +48 -0
  77. package/out/commonjs/module.d.mts +3 -0
  78. package/{commonjs → out/commonjs}/module.f.d.mts +0 -2
  79. package/out/commonjs/module.f.mjs +10 -0
  80. package/out/commonjs/module.mjs +26 -0
  81. package/out/commonjs/package/dependencies/module.f.d.mts +6 -0
  82. package/out/commonjs/package/dependencies/module.f.mjs +21 -0
  83. package/out/commonjs/package/dependencies/test.f.mjs +15 -0
  84. package/out/commonjs/package/module.f.d.mts +21 -0
  85. package/out/commonjs/package/module.f.mjs +40 -0
  86. package/out/commonjs/package/test.f.mjs +27 -0
  87. package/{commonjs → out/commonjs}/path/module.f.d.mts +25 -32
  88. package/out/commonjs/path/module.f.mjs +171 -0
  89. package/out/commonjs/path/test.f.mjs +231 -0
  90. package/out/commonjs/test.mjs +87 -0
  91. package/out/dev/index.mjs +2 -0
  92. package/out/dev/module.f.d.mts +1 -0
  93. package/out/dev/module.f.mjs +2 -0
  94. package/out/dev/module.mjs +167 -0
  95. package/{dev → out/dev}/test/module.f.d.mts +2 -3
  96. package/out/dev/test/module.f.mjs +134 -0
  97. package/out/dev/test.f.mjs +58 -0
  98. package/out/dev/test.mjs +52 -0
  99. package/{djs → out/djs}/module.f.d.mts +13 -18
  100. package/out/djs/module.f.mjs +75 -0
  101. package/{djs → out/djs}/parser/module.f.d.mts +11 -15
  102. package/out/djs/parser/module.f.mjs +432 -0
  103. package/out/djs/parser/test.f.mjs +535 -0
  104. package/out/djs/test.f.mjs +84 -0
  105. package/out/djs/tokenizer/module.f.d.mts +13 -0
  106. package/out/djs/tokenizer/module.f.mjs +87 -0
  107. package/out/djs/tokenizer/test.f.mjs +480 -0
  108. package/out/fsc/module.f.d.mts +7 -0
  109. package/out/fsc/module.f.mjs +105 -0
  110. package/out/fsc/test.f.mjs +19 -0
  111. package/out/fsm/module.f.d.mts +14 -0
  112. package/out/fsm/module.f.mjs +80 -0
  113. package/out/fsm/test.f.mjs +138 -0
  114. package/out/html/module.f.d.mts +15 -0
  115. package/out/html/module.f.mjs +94 -0
  116. package/out/html/test.f.mjs +45 -0
  117. package/out/issues/test.f.mjs +66 -0
  118. package/{js → out/js}/tokenizer/module.f.d.mts +10 -15
  119. package/out/js/tokenizer/module.f.mjs +686 -0
  120. package/out/js/tokenizer/test.f.mjs +844 -0
  121. package/out/json/module.f.d.mts +33 -0
  122. package/out/json/module.f.mjs +89 -0
  123. package/{json → out/json}/parser/module.f.d.mts +9 -13
  124. package/out/json/parser/module.f.mjs +224 -0
  125. package/out/json/parser/test.f.mjs +321 -0
  126. package/out/json/serializer/module.f.d.mts +36 -0
  127. package/out/json/serializer/module.f.mjs +67 -0
  128. package/out/json/serializer/test.f.mjs +87 -0
  129. package/out/json/test.f.mjs +61 -0
  130. package/out/json/tokenizer/module.f.d.mts +13 -0
  131. package/out/json/tokenizer/module.f.mjs +78 -0
  132. package/out/json/tokenizer/test.f.mjs +420 -0
  133. package/out/nanvm-lib/tests/test.f.mjs +87 -0
  134. package/out/nodejs/version/main.mjs +3 -0
  135. package/{nodejs → out/nodejs}/version/module.f.d.mts +4 -9
  136. package/out/nodejs/version/module.f.mjs +34 -0
  137. package/out/nodejs/version/test.f.mjs +97 -0
  138. package/{prime_field → out/prime_field}/module.f.d.mts +20 -23
  139. package/out/prime_field/module.f.mjs +87 -0
  140. package/out/prime_field/test.f.mjs +145 -0
  141. package/{secp → out/secp}/module.f.d.mts +27 -28
  142. package/out/secp/module.f.mjs +113 -0
  143. package/out/secp/test.f.mjs +63 -0
  144. package/out/sha2/module.f.d.mts +15 -0
  145. package/out/sha2/module.f.mjs +172 -0
  146. package/out/sha2/test.f.mjs +86 -0
  147. package/out/text/ascii/module.f.d.mts +70 -0
  148. package/out/text/ascii/module.f.mjs +154 -0
  149. package/out/text/ascii/test.f.mjs +14 -0
  150. package/out/text/module.f.d.mts +13 -0
  151. package/out/text/module.f.mjs +19 -0
  152. package/out/text/sgr/module.f.d.mts +12 -0
  153. package/out/text/sgr/module.f.mjs +17 -0
  154. package/out/text/test.f.mjs +19 -0
  155. package/out/text/utf16/module.f.d.mts +12 -0
  156. package/out/text/utf16/module.f.mjs +86 -0
  157. package/out/text/utf16/test.f.mjs +145 -0
  158. package/out/text/utf8/module.f.d.mts +10 -0
  159. package/out/text/utf8/module.f.mjs +126 -0
  160. package/out/text/utf8/test.f.mjs +175 -0
  161. package/{types → out/types}/array/module.f.d.mts +14 -24
  162. package/out/types/array/module.f.mjs +95 -0
  163. package/out/types/array/test.f.mjs +116 -0
  164. package/out/types/bigfloat/module.f.d.mts +6 -0
  165. package/out/types/bigfloat/module.f.mjs +77 -0
  166. package/out/types/bigfloat/test.f.mjs +349 -0
  167. package/out/types/bigint/module.f.d.mts +29 -0
  168. package/{types/bigint/module.f.d.mts → out/types/bigint/module.f.mjs} +64 -27
  169. package/out/types/bigint/test.f.mjs +192 -0
  170. package/{types → out/types}/btree/find/module.f.d.mts +20 -26
  171. package/out/types/btree/find/module.f.mjs +137 -0
  172. package/out/types/btree/find/test.f.mjs +156 -0
  173. package/out/types/btree/module.f.d.mts +5 -0
  174. package/out/types/btree/module.f.mjs +34 -0
  175. package/{types → out/types}/btree/remove/module.f.d.mts +7 -12
  176. package/out/types/btree/remove/module.f.mjs +209 -0
  177. package/out/types/btree/remove/test.f.mjs +638 -0
  178. package/{types → out/types}/btree/set/module.f.d.mts +3 -7
  179. package/out/types/btree/set/module.f.mjs +114 -0
  180. package/out/types/btree/set/test.f.mjs +390 -0
  181. package/out/types/btree/test.f.mjs +83 -0
  182. package/{types → out/types}/btree/types/module.f.d.mts +0 -2
  183. package/out/types/btree/types/module.f.mjs +50 -0
  184. package/out/types/byte_set/module.f.d.mts +25 -0
  185. package/out/types/byte_set/module.f.mjs +42 -0
  186. package/out/types/byte_set/test.f.mjs +123 -0
  187. package/{types → out/types}/function/compare/module.f.d.mts +9 -15
  188. package/out/types/function/compare/module.f.mjs +22 -0
  189. package/out/types/function/compare/test.f.mjs +8 -0
  190. package/{types → out/types}/function/module.f.d.mts +20 -27
  191. package/out/types/function/module.f.mjs +44 -0
  192. package/{types → out/types}/function/operator/module.f.d.mts +28 -43
  193. package/out/types/function/operator/module.f.mjs +60 -0
  194. package/out/types/function/test.f.mjs +15 -0
  195. package/out/types/list/module.f.d.mts +82 -0
  196. package/out/types/list/module.f.mjs +269 -0
  197. package/out/types/list/test.f.mjs +401 -0
  198. package/out/types/map/module.f.d.mts +21 -0
  199. package/out/types/map/module.f.mjs +54 -0
  200. package/out/types/map/test.f.mjs +115 -0
  201. package/out/types/nibble_set/module.f.d.mts +16 -0
  202. package/out/types/nibble_set/module.f.mjs +19 -0
  203. package/out/types/nibble_set/test.f.mjs +90 -0
  204. package/out/types/nullable/module.f.d.mts +9 -0
  205. package/out/types/nullable/module.f.mjs +9 -0
  206. package/out/types/nullable/test.f.mjs +12 -0
  207. package/out/types/number/module.f.d.mts +7 -0
  208. package/out/types/number/module.f.mjs +12 -0
  209. package/out/types/number/test.f.mjs +126 -0
  210. package/out/types/object/module.f.d.mts +22 -0
  211. package/out/types/object/module.f.mjs +27 -0
  212. package/out/types/object/test.f.mjs +17 -0
  213. package/out/types/range/module.f.d.mts +6 -0
  214. package/out/types/range/module.f.mjs +6 -0
  215. package/out/types/range/test.f.mjs +18 -0
  216. package/{types → out/types}/range_map/module.f.d.mts +9 -15
  217. package/out/types/range_map/module.f.mjs +84 -0
  218. package/out/types/range_map/test.f.mjs +201 -0
  219. package/out/types/result/module.d.mts +7 -0
  220. package/{types → out/types}/result/module.f.d.mts +6 -12
  221. package/out/types/result/module.f.mjs +25 -0
  222. package/out/types/result/module.mjs +16 -0
  223. package/{types → out/types}/sorted_list/module.f.d.mts +22 -28
  224. package/out/types/sorted_list/module.f.mjs +102 -0
  225. package/out/types/sorted_list/test.f.mjs +66 -0
  226. package/{types → out/types}/sorted_set/module.f.d.mts +6 -12
  227. package/out/types/sorted_set/module.f.mjs +29 -0
  228. package/out/types/sorted_set/test.f.mjs +80 -0
  229. package/out/types/string/module.f.d.mts +9 -0
  230. package/out/types/string/module.f.mjs +17 -0
  231. package/out/types/string/test.f.mjs +58 -0
  232. package/out/types/string_set/module.f.d.mts +13 -0
  233. package/out/types/string_set/module.f.mjs +29 -0
  234. package/out/types/string_set/test.f.mjs +65 -0
  235. package/package.json +5 -4
  236. package/prime_field/module.f.mjs +9 -12
  237. package/prime_field/test.f.mjs +1 -1
  238. package/secp/module.f.mjs +38 -39
  239. package/secp/test.f.mjs +4 -4
  240. package/sha2/module.f.mjs +7 -20
  241. package/sha2/test.f.mjs +4 -4
  242. package/text/ascii/module.f.mjs +5 -10
  243. package/text/ascii/test.f.mjs +3 -3
  244. package/text/module.f.mjs +7 -14
  245. package/text/sgr/module.f.mjs +2 -4
  246. package/text/test.f.mjs +3 -3
  247. package/text/utf16/module.f.mjs +17 -28
  248. package/text/utf16/test.f.mjs +5 -5
  249. package/text/utf8/module.f.mjs +9 -16
  250. package/text/utf8/test.f.mjs +4 -4
  251. package/tsconfig.json +2 -2
  252. package/types/array/module.f.mjs +8 -25
  253. package/types/array/test.f.mjs +3 -3
  254. package/types/bigfloat/module.f.mjs +3 -10
  255. package/types/bigfloat/test.f.mjs +1 -1
  256. package/types/bigint/module.f.mjs +11 -30
  257. package/types/bigint/test.f.mjs +1 -1
  258. package/types/btree/find/module.f.mjs +8 -17
  259. package/types/btree/find/test.f.mjs +7 -7
  260. package/types/btree/module.f.mjs +6 -11
  261. package/types/btree/remove/module.f.mjs +10 -17
  262. package/types/btree/remove/test.f.mjs +5 -5
  263. package/types/btree/set/module.f.mjs +4 -9
  264. package/types/btree/set/test.f.mjs +4 -4
  265. package/types/btree/test.f.mjs +9 -9
  266. package/types/btree/types/module.f.mjs +0 -2
  267. package/types/byte_set/module.f.mjs +14 -39
  268. package/types/byte_set/test.f.mjs +5 -5
  269. package/types/function/compare/module.f.mjs +3 -12
  270. package/types/function/compare/test.f.mjs +1 -1
  271. package/types/function/module.f.mjs +4 -15
  272. package/types/function/operator/module.f.mjs +14 -41
  273. package/types/function/test.f.mjs +1 -1
  274. package/types/list/module.f.mjs +45 -114
  275. package/types/list/test.f.mjs +10 -10
  276. package/types/map/module.f.mjs +15 -30
  277. package/types/map/test.f.mjs +2 -2
  278. package/types/nibble_set/module.f.mjs +7 -24
  279. package/types/nibble_set/test.f.mjs +2 -2
  280. package/types/nullable/module.f.mjs +2 -9
  281. package/types/nullable/test.f.mjs +1 -1
  282. package/types/number/module.f.mjs +8 -19
  283. package/types/number/test.f.mjs +1 -1
  284. package/types/object/module.f.mjs +9 -20
  285. package/types/object/test.f.mjs +1 -1
  286. package/types/range/module.f.mjs +2 -9
  287. package/types/range/test.f.mjs +1 -1
  288. package/types/range_map/module.f.mjs +9 -18
  289. package/types/range_map/test.f.mjs +32 -32
  290. package/types/result/module.f.mjs +3 -12
  291. package/types/result/module.mjs +2 -2
  292. package/types/sorted_list/module.f.mjs +10 -19
  293. package/types/sorted_list/test.f.mjs +7 -7
  294. package/types/sorted_set/module.f.mjs +7 -16
  295. package/types/sorted_set/test.f.mjs +7 -7
  296. package/types/string/module.f.mjs +10 -21
  297. package/types/string/test.f.mjs +2 -2
  298. package/types/string_set/module.f.mjs +12 -27
  299. package/types/string_set/test.f.mjs +1 -1
  300. package/com/cpp/module.f.d.mts +0 -8
  301. package/com/cs/module.f.d.mts +0 -8
  302. package/commonjs/build/module.f.d.mts +0 -24
  303. package/commonjs/module.d.mts +0 -7
  304. package/commonjs/package/dependencies/module.f.d.mts +0 -10
  305. package/commonjs/package/module.f.d.mts +0 -27
  306. package/dev/module.f.d.mts +0 -4
  307. package/djs/tokenizer/module.f.d.mts +0 -17
  308. package/fsc/module.f.d.mts +0 -12
  309. package/fsm/module.f.d.mts +0 -21
  310. package/html/module.f.d.mts +0 -20
  311. package/json/module.f.d.mts +0 -41
  312. package/json/serializer/module.f.d.mts +0 -45
  313. package/json/tokenizer/module.f.d.mts +0 -17
  314. package/sha2/module.f.d.mts +0 -23
  315. package/text/ascii/module.f.d.mts +0 -73
  316. package/text/module.f.d.mts +0 -18
  317. package/text/sgr/module.f.d.mts +0 -14
  318. package/text/utf16/module.f.d.mts +0 -19
  319. package/text/utf8/module.f.d.mts +0 -15
  320. package/types/bigfloat/module.f.d.mts +0 -11
  321. package/types/btree/module.f.d.mts +0 -9
  322. package/types/byte_set/module.f.d.mts +0 -38
  323. package/types/list/module.f.d.mts +0 -117
  324. package/types/map/module.f.d.mts +0 -30
  325. package/types/nibble_set/module.f.d.mts +0 -26
  326. package/types/nullable/module.f.d.mts +0 -14
  327. package/types/number/module.f.d.mts +0 -13
  328. package/types/object/module.f.d.mts +0 -29
  329. package/types/range/module.f.d.mts +0 -11
  330. package/types/result/module.d.mts +0 -7
  331. package/types/string/module.f.d.mts +0 -15
  332. package/types/string_set/module.f.d.mts +0 -21
  333. /package/{com → out/com}/cpp/test.f.d.mts +0 -0
  334. /package/{com → out/com}/cpp/testlib.f.d.mts +0 -0
  335. /package/{com → out/com}/cs/test.f.d.mts +0 -0
  336. /package/{com → out/com}/cs/testlib.f.d.mts +0 -0
  337. /package/{com → out/com}/rust/test.f.d.mts +0 -0
  338. /package/{com → out/com}/rust/testlib.f.d.mts +0 -0
  339. /package/{com → out/com}/test/build.d.mts +0 -0
  340. /package/{com → out/com}/types/testlib.f.d.mts +0 -0
  341. /package/{commonjs → out/commonjs}/build/test.f.d.mts +0 -0
  342. /package/{commonjs → out/commonjs}/package/dependencies/test.f.d.mts +0 -0
  343. /package/{commonjs → out/commonjs}/package/test.f.d.mts +0 -0
  344. /package/{commonjs → out/commonjs}/path/test.f.d.mts +0 -0
  345. /package/{commonjs → out/commonjs}/test.d.mts +0 -0
  346. /package/{dev → out/dev}/index.d.mts +0 -0
  347. /package/{dev → out/dev}/module.d.mts +0 -0
  348. /package/{dev → out/dev}/test.d.mts +0 -0
  349. /package/{dev → out/dev}/test.f.d.mts +0 -0
  350. /package/{djs → out/djs}/parser/test.f.d.mts +0 -0
  351. /package/{djs → out/djs}/test.f.d.mts +0 -0
  352. /package/{djs → out/djs}/tokenizer/test.f.d.mts +0 -0
  353. /package/{fsc → out/fsc}/test.f.d.mts +0 -0
  354. /package/{fsm → out/fsm}/test.f.d.mts +0 -0
  355. /package/{html → out/html}/test.f.d.mts +0 -0
  356. /package/{issues → out/issues}/test.f.d.mts +0 -0
  357. /package/{js → out/js}/tokenizer/test.f.d.mts +0 -0
  358. /package/{json → out/json}/parser/test.f.d.mts +0 -0
  359. /package/{json → out/json}/serializer/test.f.d.mts +0 -0
  360. /package/{json → out/json}/test.f.d.mts +0 -0
  361. /package/{json → out/json}/tokenizer/test.f.d.mts +0 -0
  362. /package/{nanvm-lib → out/nanvm-lib}/tests/test.f.d.mts +0 -0
  363. /package/{nodejs → out/nodejs}/version/main.d.mts +0 -0
  364. /package/{nodejs → out/nodejs}/version/test.f.d.mts +0 -0
  365. /package/{prime_field → out/prime_field}/test.f.d.mts +0 -0
  366. /package/{secp → out/secp}/test.f.d.mts +0 -0
  367. /package/{sha2 → out/sha2}/test.f.d.mts +0 -0
  368. /package/{text → out/text}/ascii/test.f.d.mts +0 -0
  369. /package/{text → out/text}/test.f.d.mts +0 -0
  370. /package/{text → out/text}/utf16/test.f.d.mts +0 -0
  371. /package/{text → out/text}/utf8/test.f.d.mts +0 -0
  372. /package/{types → out/types}/array/test.f.d.mts +0 -0
  373. /package/{types → out/types}/bigfloat/test.f.d.mts +0 -0
  374. /package/{types → out/types}/bigint/test.f.d.mts +0 -0
  375. /package/{types → out/types}/btree/find/test.f.d.mts +0 -0
  376. /package/{types → out/types}/btree/remove/test.f.d.mts +0 -0
  377. /package/{types → out/types}/btree/set/test.f.d.mts +0 -0
  378. /package/{types → out/types}/btree/test.f.d.mts +0 -0
  379. /package/{types → out/types}/byte_set/test.f.d.mts +0 -0
  380. /package/{types → out/types}/function/compare/test.f.d.mts +0 -0
  381. /package/{types → out/types}/function/test.f.d.mts +0 -0
  382. /package/{types → out/types}/list/test.f.d.mts +0 -0
  383. /package/{types → out/types}/map/test.f.d.mts +0 -0
  384. /package/{types → out/types}/nibble_set/test.f.d.mts +0 -0
  385. /package/{types → out/types}/nullable/test.f.d.mts +0 -0
  386. /package/{types → out/types}/number/test.f.d.mts +0 -0
  387. /package/{types → out/types}/object/test.f.d.mts +0 -0
  388. /package/{types → out/types}/range/test.f.d.mts +0 -0
  389. /package/{types → out/types}/range_map/test.f.d.mts +0 -0
  390. /package/{types → out/types}/sorted_list/test.f.d.mts +0 -0
  391. /package/{types → out/types}/sorted_set/test.f.d.mts +0 -0
  392. /package/{types → out/types}/string/test.f.d.mts +0 -0
  393. /package/{types → out/types}/string_set/test.f.d.mts +0 -0
@@ -0,0 +1,42 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ import * as f from '../function/module.f.mjs';
3
+ const { compose } = f;
4
+ import * as RangeMap from '../range_map/module.f.mjs';
5
+ import * as SortedSet from '../sorted_set/module.f.mjs';
6
+ import * as list from '../list/module.f.mjs';
7
+ const { reverse, countdown, flat, map } = list;
8
+ /** @typedef {bigint} ByteSet */
9
+ /** @typedef {number} Byte */
10
+ /** @type {(n: Byte) => (s: ByteSet) => boolean} */
11
+ export const has = n => s => ((s >> BigInt(n)) & 1n) === 1n;
12
+ // create a set
13
+ export const empty = 0n;
14
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
15
+ export const universe = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn;
16
+ /** @type {(n: Byte) => ByteSet} */
17
+ export const one = n => 1n << BigInt(n);
18
+ /** @type {(r: readonly[Byte, Byte]) => ByteSet} */
19
+ export const range = ([b, e]) => one(e - b + 1) - 1n << BigInt(b);
20
+ // set operations
21
+ /** @type {(a: ByteSet) => (b: ByteSet) => ByteSet} */
22
+ export const union = a => b => a | b;
23
+ /** @type {(a: ByteSet) => (b: ByteSet) => ByteSet} */
24
+ const intersect = a => b => a & b;
25
+ /** @type {(n: ByteSet) => ByteSet} */
26
+ export const complement = n => universe ^ n;
27
+ /** @type {(a: ByteSet) => (b: ByteSet) => ByteSet} */
28
+ const difference = compose(intersect)(compose(complement));
29
+ // additional operations
30
+ export const set = compose(one)(union);
31
+ export const setRange = compose(range)(union);
32
+ /** @type {(n: Byte) => (s: ByteSet) => ByteSet} */
33
+ export const unset = n => s => difference(s)(one(n));
34
+ const counter = reverse(countdown(256));
35
+ /** @type {(n: ByteSet) => (s: string) => (i: number) => RangeMap.RangeMap<SortedSet.SortedSet<string>>} */
36
+ const toRangeMapOp = n => s => i => {
37
+ const current = has(i + 1)(n);
38
+ const prev = has(i)(n);
39
+ return current === prev ? null : [[prev ? [s] : [], i]];
40
+ };
41
+ /** @type {(n: ByteSet) => (s: string) => RangeMap.RangeMap<SortedSet.SortedSet<string>>} */
42
+ export const toRangeMap = n => s => flat(map(toRangeMapOp(n)(s))(counter));
@@ -0,0 +1,123 @@
1
+ import * as _ from './module.f.mjs';
2
+ import * as list from '../list/module.f.mjs';
3
+ const { every, countdown, map, toArray } = list;
4
+ import * as json from '../../json/module.f.mjs';
5
+ import * as o from '../object/module.f.mjs';
6
+ const { sort } = o;
7
+ /** @type {(a: readonly json.Unknown[]) => string} */
8
+ const stringify = json.stringify(sort);
9
+ export default {
10
+ has: [
11
+ () => {
12
+ if (_.has(0)(_.empty)) {
13
+ throw _.empty;
14
+ }
15
+ if (_.has(1)(_.empty)) {
16
+ throw _.empty;
17
+ }
18
+ if (_.has(33)(_.empty)) {
19
+ throw _.empty;
20
+ }
21
+ },
22
+ () => {
23
+ const s = _.set(0)(_.empty);
24
+ if (s !== 1n) {
25
+ throw s;
26
+ }
27
+ if (!_.has(0)(s)) {
28
+ throw s;
29
+ }
30
+ if (_.has(1)(s)) {
31
+ throw s;
32
+ }
33
+ if (_.has(33)(s)) {
34
+ throw s;
35
+ }
36
+ },
37
+ () => {
38
+ const s = _.set(33)(_.empty);
39
+ if (s !== 8589934592n) {
40
+ throw s;
41
+ }
42
+ if (_.has(0)(s)) {
43
+ throw s;
44
+ }
45
+ if (_.has(1)(s)) {
46
+ throw s;
47
+ }
48
+ if (!_.has(33)(s)) {
49
+ throw s;
50
+ }
51
+ }
52
+ ],
53
+ setRange: () => {
54
+ const result = _.setRange([2, 5])(_.empty);
55
+ if (result !== 60n) {
56
+ throw result;
57
+ }
58
+ },
59
+ unset: [
60
+ () => {
61
+ const a = _.set(0)(_.empty);
62
+ const result = _.unset(0)(a);
63
+ if (result !== 0n) {
64
+ throw result;
65
+ }
66
+ },
67
+ () => {
68
+ const a = _.set(255)(_.empty);
69
+ const result = _.unset(255)(a);
70
+ if (result !== 0n) {
71
+ throw result;
72
+ }
73
+ }
74
+ ],
75
+ universe: () => {
76
+ const x = every(map(v => _.has(v)(_.universe))(countdown(256)));
77
+ if (!x) {
78
+ throw x;
79
+ }
80
+ },
81
+ compliment: {
82
+ empty: () => {
83
+ const r = _.complement(_.empty);
84
+ if (r !== _.universe) {
85
+ throw r;
86
+ }
87
+ },
88
+ universe: () => {
89
+ const r = _.complement(_.universe);
90
+ if (r !== _.empty) {
91
+ throw r;
92
+ }
93
+ },
94
+ },
95
+ toRangeMap: [
96
+ () => {
97
+ const result = stringify(toArray(_.toRangeMap(_.empty)('a')));
98
+ if (result !== '[]') {
99
+ throw result;
100
+ }
101
+ },
102
+ () => {
103
+ const s = _.set(0)(_.empty);
104
+ const result = stringify(toArray(_.toRangeMap(s)('a')));
105
+ if (result !== '[[["a"],0]]') {
106
+ throw result;
107
+ }
108
+ },
109
+ () => {
110
+ const s = _.setRange([1, 2])(_.empty);
111
+ const result = stringify(toArray(_.toRangeMap(s)('a')));
112
+ if (result !== '[[[],0],[["a"],2]]') {
113
+ throw result;
114
+ }
115
+ },
116
+ () => {
117
+ const result = stringify(toArray(_.toRangeMap(_.universe)('a')));
118
+ if (result !== '[[["a"],255]]') {
119
+ throw result;
120
+ }
121
+ },
122
+ ]
123
+ };
@@ -1,16 +1,3 @@
1
- declare namespace _default {
2
- export { unsafeCmp };
3
- export { index3 };
4
- export { index5 };
5
- }
6
- export default _default;
7
- export type Index3 = Array.Index3;
8
- export type Index5 = Array.Index5;
9
- export type Array2<T> = Array.Array2<T>;
10
- export type Sign = -1 | 0 | 1;
11
- export type Compare<T> = (_: T) => Sign;
12
- /** @type {<T>(a: T) => (b: T) => Sign} */
13
- declare const unsafeCmp: <T>(a: T) => (b: T) => Sign;
14
1
  /** @typedef {Array.Index3} Index3 */
15
2
  /** @typedef {Array.Index5} Index5 */
16
3
  /**
@@ -23,7 +10,14 @@ declare const unsafeCmp: <T>(a: T) => (b: T) => Sign;
23
10
  * @typedef {(_: T) => Sign} Compare
24
11
  */
25
12
  /** @type {<T>(cmp: Compare<T>) => (value: T) => Index3} */
26
- declare const index3: <T>(cmp: Compare<T>) => (value: T) => Index3;
13
+ export const index3: <T>(cmp: Compare<T>) => (value: T) => Index3;
27
14
  /** @type {<T>(cmp: Compare<T>) => (v2: Array2<T>) => Index5} */
28
- declare const index5: <T>(cmp: Compare<T>) => (v2: Array2<T>) => Index5;
15
+ export const index5: <T>(cmp: Compare<T>) => (v2: Array2<T>) => Index5;
16
+ /** @type {<T>(a: T) => (b: T) => Sign} */
17
+ export const unsafeCmp: <T>(a: T) => (b: T) => Sign;
18
+ export type Index3 = Array.Index3;
19
+ export type Index5 = Array.Index5;
20
+ export type Array2<T> = Array.Array2<T>;
21
+ export type Sign = -1 | 0 | 1;
22
+ export type Compare<T> = (_: T) => Sign;
29
23
  import * as Array from '../../array/module.f.mjs';
@@ -0,0 +1,22 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ import * as Array from '../../array/module.f.mjs';
3
+ /** @typedef {Array.Index3} Index3 */
4
+ /** @typedef {Array.Index5} Index5 */
5
+ /**
6
+ * @template T
7
+ * @typedef {Array.Array2<T>} Array2
8
+ */
9
+ /** @typedef {-1|0|1} Sign */
10
+ /**
11
+ * @template T
12
+ * @typedef {(_: T) => Sign} Compare
13
+ */
14
+ /** @type {<T>(cmp: Compare<T>) => (value: T) => Index3} */
15
+ export const index3 = cmp => value => /** @type {Index3} */ (cmp(value) + 1);
16
+ /** @type {<T>(cmp: Compare<T>) => (v2: Array2<T>) => Index5} */
17
+ export const index5 = cmp => ([v0, v1]) => {
18
+ const _0 = cmp(v0);
19
+ return /** @type {Index5} */ (_0 <= 0 ? _0 + 1 : cmp(v1) + 3);
20
+ };
21
+ /** @type {<T>(a: T) => (b: T) => Sign} */
22
+ export const unsafeCmp = a => b => a < b ? -1 : a > b ? 1 : 0;
@@ -0,0 +1,8 @@
1
+ import * as _ from './module.f.mjs';
2
+ const { unsafeCmp } = _;
3
+ export default () => {
4
+ const result = unsafeCmp(true)(false);
5
+ if (result !== 1) {
6
+ throw result;
7
+ }
8
+ };
@@ -1,27 +1,3 @@
1
- declare namespace _default {
2
- export { identity };
3
- export { compose };
4
- export { flip };
5
- export { fn };
6
- }
7
- export default _default;
8
- /**
9
- * A generic function type.
10
- */
11
- export type Func<I, O> = (_: I) => O;
12
- /**
13
- * A functional utility type that enables seamless chaining of transformations.
14
- */
15
- export type Fn<I, O> = {
16
- readonly result: Func<I, O>;
17
- readonly then: <T>(g: Func<O, T>) => Fn<I, T>;
18
- };
19
- /**
20
- * A generic identity function.
21
- *
22
- * @type {<T>(value: T) => T}
23
- */
24
- declare const identity: <T>(value: T) => T;
25
1
  /**
26
2
  * A generic function type.
27
3
  *
@@ -34,13 +10,19 @@ declare const identity: <T>(value: T) => T;
34
10
  *
35
11
  * @type {<I, X>(g: Func<I, X>) => <O>(f: Func<X, O>) => Func<I, O>}
36
12
  */
37
- declare const compose: <I, X>(g: Func<I, X>) => <O>(f: Func<X, O>) => Func<I, O>;
13
+ export const compose: <I, X>(g: Func<I, X>) => <O>(f: Func<X, O>) => Func<I, O>;
14
+ /**
15
+ * A generic identity function.
16
+ *
17
+ * @type {<T>(value: T) => T}
18
+ */
19
+ export const identity: <T>(value: T) => T;
38
20
  /**
39
21
  * Flips the arguments of a curried function.
40
22
  *
41
23
  * @type {<A, B, C>(f: (a: A) => (b: B) => C) => (b: B) => (a: A) => C}
42
24
  */
43
- declare const flip: <A, B, C>(f: (a: A) => (b: B) => C) => (b: B) => (a: A) => C;
25
+ export const flip: <A, B, C>(f: (a: A) => (b: B) => C) => (b: B) => (a: A) => C;
44
26
  /**
45
27
  * A functional utility type that enables seamless chaining of transformations.
46
28
  *
@@ -55,4 +37,15 @@ declare const flip: <A, B, C>(f: (a: A) => (b: B) => C) => (b: B) => (a: A) => C
55
37
  *
56
38
  * @type {<I, O>(f: (i: I) => O) => Fn<I, O>}
57
39
  */
58
- declare const fn: <I, O>(f: (i: I) => O) => Fn<I, O>;
40
+ export const fn: <I, O>(f: (i: I) => O) => Fn<I, O>;
41
+ /**
42
+ * A generic function type.
43
+ */
44
+ export type Func<I, O> = (_: I) => O;
45
+ /**
46
+ * A functional utility type that enables seamless chaining of transformations.
47
+ */
48
+ export type Fn<I, O> = {
49
+ readonly result: Func<I, O>;
50
+ readonly then: <T>(g: Func<O, T>) => Fn<I, T>;
51
+ };
@@ -0,0 +1,44 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ /**
3
+ * A generic function type.
4
+ *
5
+ * @template I
6
+ * @template O
7
+ * @typedef {(_: I) => O} Func
8
+ */
9
+ /**
10
+ * A postfix compose function.
11
+ *
12
+ * @type {<I, X>(g: Func<I, X>) => <O>(f: Func<X, O>) => Func<I, O>}
13
+ */
14
+ export const compose = g => f => x => f(g(x));
15
+ /**
16
+ * A generic identity function.
17
+ *
18
+ * @type {<T>(value: T) => T}
19
+ */
20
+ export const identity = value => value;
21
+ /**
22
+ * Flips the arguments of a curried function.
23
+ *
24
+ * @type {<A, B, C>(f: (a: A) => (b: B) => C) => (b: B) => (a: A) => C}
25
+ */
26
+ export const flip = f => b => a => f(a)(b);
27
+ /**
28
+ * A functional utility type that enables seamless chaining of transformations.
29
+ *
30
+ * @template I,O
31
+ * @typedef {{
32
+ * readonly result: Func<I, O>
33
+ * readonly then: <T>(g: Func<O, T>) => Fn<I, T>
34
+ * }} Fn
35
+ */
36
+ /**
37
+ * Creates an `Fn` instance from a function, enabling chaining of transformations.
38
+ *
39
+ * @type {<I, O>(f: (i: I) => O) => Fn<I, O>}
40
+ */
41
+ export const fn = result => ({
42
+ result,
43
+ then: g => fn(compose(result)(g))
44
+ });
@@ -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>;
@@ -0,0 +1,60 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ /**
3
+ * @template A
4
+ * @template B
5
+ * @template R
6
+ * @typedef {(a: A) => (b: B) => R} Binary
7
+ */
8
+ /**
9
+ * @template I,O
10
+ * @typedef {Binary<I, O, O>} Fold
11
+ */
12
+ /** @type {(separator: string) => Reduce<string>} */
13
+ export const join = separator => value => prior => `${prior}${separator}${value}`;
14
+ /** @type {Reduce<string>} */
15
+ export const concat = i => acc => `${acc}${i}`;
16
+ /**
17
+ * @template T
18
+ * @template R
19
+ * @typedef {(value: T) => R} Unary
20
+ */
21
+ /** @type {Unary<boolean, boolean>} */
22
+ export const logicalNot = v => !v;
23
+ /**
24
+ * @template T
25
+ * @typedef {Binary<T, T, boolean>} Equal
26
+ */
27
+ /** @type {<T>(a: T) => (b: T) => boolean} */
28
+ export const strictEqual = a => b => a === b;
29
+ /**
30
+ * @template I,O
31
+ * @typedef {(input: I) => readonly[O, Scan<I,O>]} Scan
32
+ */
33
+ /**
34
+ * @template I,S,O
35
+ * @typedef {(prior: S) => (input: I) => readonly[O, S]} StateScan
36
+ */
37
+ /** @type {<I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>} */
38
+ export const stateScanToScan = op => prior => i => {
39
+ const [o, s] = op(prior)(i);
40
+ return [o, stateScanToScan(op)(s)];
41
+ };
42
+ /** @type {<I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>} */
43
+ export const foldToScan = fold => prior => i => {
44
+ const result = fold(i)(prior);
45
+ return [result, foldToScan(fold)(result)];
46
+ };
47
+ /**
48
+ * @template T
49
+ * @typedef {Fold<T, T>} Reduce
50
+ */
51
+ /** @type {<T>(fold: Reduce<T>) => Scan<T, T>} */
52
+ export const reduceToScan = op => init => [init, foldToScan(op)(init)];
53
+ /** @type {Reduce<number>} */
54
+ export const addition = a => b => a + b;
55
+ /** @type {Reduce<number>} */
56
+ export const min = a => b => a < b ? a : b;
57
+ /** @type {Reduce<number>} */
58
+ export const max = a => b => a > b ? a : b;
59
+ export const increment = addition(1);
60
+ export const counter = () => increment;
@@ -0,0 +1,15 @@
1
+ import * as _ from './module.f.mjs';
2
+ const { fn } = _;
3
+ export default () => {
4
+ /** @type {(x: string) => readonly[string]} */
5
+ const f = x => [x];
6
+ /** @type {(x: readonly[string]) => readonly[number]} */
7
+ const g = ([x]) => [x.length];
8
+ /** @type {(x: readonly[number]) => number} */
9
+ const w = ([x]) => x;
10
+ const r = fn(f).then(g).then(w).result;
11
+ const result = r('hello');
12
+ if (result !== 5) {
13
+ throw r;
14
+ }
15
+ };
@@ -0,0 +1,82 @@
1
+ /** @type {<T>(head: List<T>) => (tail: List<T>) => List<T>} */
2
+ export const concat: <T>(head: List<T>) => (tail: List<T>) => List<T>;
3
+ /** @type {<T>(list: List<T>) => Result<T>} */
4
+ export const next: <T>(list: List<T>) => Result<T>;
5
+ /** @type {<T>(list: List<T>) => Iterable<T>} */
6
+ export const iterable: <T>(list: List<T>) => Iterable<T>;
7
+ /** @type {<T>(list: List<T>) => readonly T[]} */
8
+ export const toArray: <T>(list: List<T>) => readonly T[];
9
+ /** @type {<T>(list: List<List<T>>) => Thunk<T>} */
10
+ export const flat: <T>(list: List<List<T>>) => Thunk<T>;
11
+ /** @type {<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>;
13
+ /** @type {<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>;
15
+ /** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
16
+ export const filter: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
17
+ /** @type {<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>;
19
+ /** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
20
+ export const takeWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
21
+ /** @type {(n: number) => <T>(input: List<T>) => Thunk<T>} */
22
+ export const take: (n: number) => <T>(input: List<T>) => Thunk<T>;
23
+ /** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
24
+ export const dropWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
25
+ /** @type {(n: number) => <T>(input: List<T>) => Thunk<T>} */
26
+ export const drop: (n: number) => <T>(input: List<T>) => Thunk<T>;
27
+ /** @type {<D>(def: D) => <T>(input: List<T>) => D|T} */
28
+ export const first: <D>(def: D) => <T>(input: List<T>) => D | T;
29
+ /** @type {<D>(first: D) => <T>(tail: List<T>) => D|T} */
30
+ export const last: <D>(first: D) => <T>(tail: List<T>) => D | T;
31
+ /** @type {<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;
33
+ /** @type {(input: List<boolean>) => boolean} */
34
+ export const some: (input: List<boolean>) => boolean;
35
+ /** @type {<T>(input: List<T>) => boolean} */
36
+ export const isEmpty: <T>(input: List<T>) => boolean;
37
+ export const every: function_.Func<List<boolean>, boolean>;
38
+ /** @type {<T>(value: T) => (sequence: List<T>) => boolean} */
39
+ export const includes: <T>(value: T) => (sequence: List<T>) => boolean;
40
+ /** @type {(count: number) => Thunk<number>} */
41
+ export const countdown: (count: number) => Thunk<number>;
42
+ /** @type {<T>(v: T) => (c: number) => Thunk<T>} */
43
+ export const repeat: <T>(v: T) => (c: number) => Thunk<T>;
44
+ /** @type {<T>(list: List<T>) => List<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;
56
+ /** @type {<T>(input: List<T>) => number} */
57
+ export const length: <T>(input: List<T>) => number;
58
+ /** @type {<T>(input: List<T>) => Thunk<Entry<T>>} */
59
+ export const entries: <T>(input: List<T>) => Thunk<Entry<T>>;
60
+ /** @type {<T>(input: List<T>) => List<T>} */
61
+ export const reverse: <T>(input: List<T>) => List<T>;
62
+ /** @type {<A>(a: List<A>) => <B>(b: List<B>) => Thunk<readonly[A, B]>} */
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';