@fncts/base 0.0.12 → 0.0.15

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 (734) hide show
  1. package/_cjs/collection/Iterable/api/traverseConc.cjs +16 -21
  2. package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
  3. package/_cjs/collection/compat/Array/api.cjs +10 -10
  4. package/_cjs/collection/compat/Array/derivations.cjs +96 -0
  5. package/_cjs/collection/compat/Array/derivations.cjs.map +1 -0
  6. package/_cjs/collection/compat/Array.cjs +13 -0
  7. package/_cjs/collection/compat/Array.cjs.map +1 -1
  8. package/_cjs/collection/compat/Record/instances.cjs +67 -16
  9. package/_cjs/collection/compat/Record/instances.cjs.map +1 -1
  10. package/_cjs/collection/compat.cjs +6 -0
  11. package/_cjs/collection/compat.cjs.map +1 -0
  12. package/_cjs/collection/immutable/Conc/api.cjs +9 -12
  13. package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
  14. package/_cjs/collection/immutable/Conc/definition.cjs +41 -43
  15. package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
  16. package/_cjs/collection/immutable/Conc/derivations.cjs +45 -0
  17. package/_cjs/collection/immutable/Conc/derivations.cjs.map +1 -0
  18. package/_cjs/collection/immutable/Conc.cjs +13 -0
  19. package/_cjs/collection/immutable/Conc.cjs.map +1 -1
  20. package/_cjs/collection/immutable/Dictionary/definition.cjs +2 -4
  21. package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -1
  22. package/_cjs/collection/immutable/HashMap/api.cjs +26 -29
  23. package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
  24. package/_cjs/collection/immutable/HashMap/definition.cjs +15 -17
  25. package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
  26. package/_cjs/collection/immutable/ImmutableArray/api.cjs +142 -159
  27. package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
  28. package/_cjs/collection/immutable/ImmutableArray/constructors.cjs +2 -2
  29. package/_cjs/collection/immutable/ImmutableArray/definition.cjs +18 -15
  30. package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -1
  31. package/_cjs/collection/immutable/ImmutableArray/derivations.cjs +41 -0
  32. package/_cjs/collection/immutable/ImmutableArray/derivations.cjs.map +1 -0
  33. package/_cjs/collection/immutable/ImmutableArray/instances.cjs +11 -9
  34. package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
  35. package/_cjs/collection/immutable/ImmutableArray.cjs +13 -0
  36. package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -1
  37. package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +21 -22
  38. package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
  39. package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +2 -2
  40. package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +3 -9
  41. package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
  42. package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs +62 -0
  43. package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs.map +1 -0
  44. package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +8 -2
  45. package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
  46. package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs +13 -0
  47. package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs.map +1 -1
  48. package/_cjs/collection/immutable/List/definition.cjs +2 -2
  49. package/_cjs/collection/immutable/RoseTree/definition.cjs +13 -15
  50. package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -1
  51. package/_cjs/collection/immutable/Vector/api.cjs +8 -12
  52. package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
  53. package/_cjs/collection/immutable/Vector/definition.cjs +11 -13
  54. package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
  55. package/_cjs/collection/immutable/Vector/internal.cjs +1 -1
  56. package/_cjs/collection/immutable.cjs +6 -0
  57. package/_cjs/collection/immutable.cjs.map +1 -0
  58. package/_cjs/collection/mutable/HashMap.cjs +4 -0
  59. package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
  60. package/_cjs/collection/mutable.cjs +6 -0
  61. package/_cjs/collection/mutable.cjs.map +1 -0
  62. package/_cjs/collection/weak/IterableWeakMap.cjs +51 -2
  63. package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
  64. package/_cjs/collection/weak/IterableWeakSet.cjs +59 -7
  65. package/_cjs/collection/weak/IterableWeakSet.cjs.map +1 -1
  66. package/_cjs/collection/weak.cjs +6 -0
  67. package/_cjs/collection/weak.cjs.map +1 -0
  68. package/_cjs/collection.cjs +6 -0
  69. package/_cjs/collection.cjs.map +1 -0
  70. package/_cjs/control/Eval/api.cjs +9 -3
  71. package/_cjs/control/Eval/api.cjs.map +1 -1
  72. package/_cjs/control/Eval/definition.cjs +1 -8
  73. package/_cjs/control/Eval/definition.cjs.map +1 -1
  74. package/_cjs/control/Eval/instance.cjs +6 -0
  75. package/_cjs/control/Eval/instance.cjs.map +1 -1
  76. package/_cjs/control/Z/api.cjs +16 -14
  77. package/_cjs/control/Z/api.cjs.map +1 -1
  78. package/_cjs/control/Z/definition.cjs +8 -14
  79. package/_cjs/control/Z/definition.cjs.map +1 -1
  80. package/_cjs/control/Z/instances.cjs +6 -0
  81. package/_cjs/control/Z/instances.cjs.map +1 -1
  82. package/_cjs/control/Z/runtime.cjs +17 -13
  83. package/_cjs/control/Z/runtime.cjs.map +1 -1
  84. package/_cjs/control.cjs +6 -0
  85. package/_cjs/control.cjs.map +1 -0
  86. package/_cjs/data/Cause/api/isEmpty.cjs +2 -0
  87. package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -1
  88. package/_cjs/data/Cause/api/linearize.cjs +2 -0
  89. package/_cjs/data/Cause/api/linearize.cjs.map +1 -1
  90. package/_cjs/data/Cause/api.cjs +2 -0
  91. package/_cjs/data/Cause/api.cjs.map +1 -1
  92. package/_cjs/data/Const/definition.cjs +0 -7
  93. package/_cjs/data/Const/definition.cjs.map +1 -1
  94. package/_cjs/data/Const/instances.cjs +11 -8
  95. package/_cjs/data/Const/instances.cjs.map +1 -1
  96. package/_cjs/data/Datum/api.cjs +479 -0
  97. package/_cjs/data/Datum/api.cjs.map +1 -0
  98. package/_cjs/data/Datum/definition.cjs +142 -0
  99. package/_cjs/data/Datum/definition.cjs.map +1 -0
  100. package/_cjs/data/Datum/instances.cjs +69 -0
  101. package/_cjs/data/Datum/instances.cjs.map +1 -0
  102. package/_cjs/data/DatumEither/api.cjs +365 -0
  103. package/_cjs/data/DatumEither/api.cjs.map +1 -0
  104. package/_cjs/data/DatumEither/definition.cjs +9 -0
  105. package/_cjs/data/DatumEither/definition.cjs.map +1 -0
  106. package/_cjs/data/DecodeError/definition.cjs +16 -4
  107. package/_cjs/data/DecodeError/definition.cjs.map +1 -1
  108. package/_cjs/data/DecodeError/instances.cjs +6 -0
  109. package/_cjs/data/DecodeError/instances.cjs.map +1 -0
  110. package/_cjs/data/DecodeError.cjs +13 -0
  111. package/_cjs/data/DecodeError.cjs.map +1 -1
  112. package/_cjs/data/Decoder/definition.cjs +3 -10
  113. package/_cjs/data/Decoder/definition.cjs.map +1 -1
  114. package/_cjs/data/Either/api/alignWith.cjs +2 -0
  115. package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
  116. package/_cjs/data/Either/api.cjs +21 -5
  117. package/_cjs/data/Either/api.cjs.map +1 -1
  118. package/_cjs/data/Either/definition.cjs +4 -11
  119. package/_cjs/data/Either/definition.cjs.map +1 -1
  120. package/_cjs/data/Either/instances.cjs +25 -23
  121. package/_cjs/data/Either/instances.cjs.map +1 -1
  122. package/_cjs/data/EitherT/api.cjs +106 -0
  123. package/_cjs/data/EitherT/api.cjs.map +1 -0
  124. package/_cjs/data/EitherT/definition.cjs +9 -0
  125. package/_cjs/data/EitherT/definition.cjs.map +1 -0
  126. package/_cjs/data/Environment/api.cjs +15 -14
  127. package/_cjs/data/Environment/api.cjs.map +1 -1
  128. package/_cjs/data/Environment/definition.cjs.map +1 -1
  129. package/_cjs/data/Identity/api.cjs +3 -1
  130. package/_cjs/data/Identity/api.cjs.map +1 -1
  131. package/_cjs/data/Identity/definition.cjs +2 -4
  132. package/_cjs/data/Identity/definition.cjs.map +1 -1
  133. package/_cjs/data/Identity/instances.cjs +6 -0
  134. package/_cjs/data/Identity/instances.cjs.map +1 -1
  135. package/_cjs/data/Intervals.cjs +292 -0
  136. package/_cjs/data/Intervals.cjs.map +1 -0
  137. package/_cjs/data/Maybe/api.cjs +3 -1
  138. package/_cjs/data/Maybe/api.cjs.map +1 -1
  139. package/_cjs/data/Maybe/definition.cjs +11 -13
  140. package/_cjs/data/Maybe/definition.cjs.map +1 -1
  141. package/_cjs/data/Maybe/instances.cjs +13 -11
  142. package/_cjs/data/Maybe/instances.cjs.map +1 -1
  143. package/_cjs/data/Newtype.cjs +3 -5
  144. package/_cjs/data/Newtype.cjs.map +1 -1
  145. package/_cjs/data/Patch/api.cjs +2 -0
  146. package/_cjs/data/Patch/api.cjs.map +1 -1
  147. package/_cjs/data/Struct/api.cjs +2 -0
  148. package/_cjs/data/Struct/api.cjs.map +1 -1
  149. package/_cjs/data/Struct/definition.cjs +2 -4
  150. package/_cjs/data/Struct/definition.cjs.map +1 -1
  151. package/_cjs/data/These/definition.cjs +1 -1
  152. package/_cjs/data/These/definition.cjs.map +1 -1
  153. package/_cjs/data/Zipped.cjs +55 -0
  154. package/_cjs/data/Zipped.cjs.map +1 -0
  155. package/_cjs/data/function/api.cjs +10 -0
  156. package/_cjs/data/function/api.cjs.map +1 -1
  157. package/_cjs/data/object/instances.cjs +9 -1
  158. package/_cjs/data/object/instances.cjs.map +1 -1
  159. package/_cjs/data/string/api.cjs +1 -1
  160. package/_cjs/data.cjs +6 -0
  161. package/_cjs/data.cjs.map +1 -0
  162. package/_cjs/global.cjs +6 -0
  163. package/_cjs/global.cjs.map +1 -0
  164. package/_cjs/index.cjs +6 -0
  165. package/_cjs/index.cjs.map +1 -0
  166. package/_cjs/json.cjs +6 -0
  167. package/_cjs/json.cjs.map +1 -0
  168. package/_cjs/optics/At/definition.cjs +2 -0
  169. package/_cjs/optics/At/definition.cjs.map +1 -1
  170. package/_cjs/optics/Iso/definition.cjs +4 -0
  171. package/_cjs/optics/Iso/definition.cjs.map +1 -1
  172. package/_cjs/optics/Lens/definition.cjs +4 -0
  173. package/_cjs/optics/Lens/definition.cjs.map +1 -1
  174. package/_cjs/optics/Optional/definition.cjs +5 -5
  175. package/_cjs/optics/Optional/definition.cjs.map +1 -1
  176. package/_cjs/optics/Prism/definition.cjs +2 -0
  177. package/_cjs/optics/Prism/definition.cjs.map +1 -1
  178. package/_cjs/optics/Traversal/api/compose.cjs +1 -1
  179. package/_cjs/optics/Traversal/api/compose.cjs.map +1 -1
  180. package/_cjs/optics/Traversal/api/fromTraversable.cjs +1 -1
  181. package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
  182. package/_cjs/optics/Traversal/definition.cjs +7 -3
  183. package/_cjs/optics/Traversal/definition.cjs.map +1 -1
  184. package/_cjs/optics.cjs +6 -0
  185. package/_cjs/optics.cjs.map +1 -0
  186. package/_cjs/typeclass/Alt.cjs +0 -7
  187. package/_cjs/typeclass/Alt.cjs.map +1 -1
  188. package/_cjs/typeclass/ApplicativeExcept.cjs +9 -35
  189. package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
  190. package/_cjs/typeclass/Apply.cjs +39 -66
  191. package/_cjs/typeclass/Apply.cjs.map +1 -1
  192. package/_cjs/typeclass/Chain.cjs +6 -28
  193. package/_cjs/typeclass/Chain.cjs.map +1 -1
  194. package/_cjs/typeclass/Fail.cjs +0 -10
  195. package/_cjs/typeclass/Fail.cjs.map +1 -1
  196. package/_cjs/typeclass/Filterable.cjs +0 -36
  197. package/_cjs/typeclass/Filterable.cjs.map +1 -1
  198. package/_cjs/typeclass/Foldable.cjs +4 -34
  199. package/_cjs/typeclass/Foldable.cjs.map +1 -1
  200. package/_cjs/typeclass/FoldableWithIndex.cjs +4 -34
  201. package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
  202. package/_cjs/typeclass/Functor.cjs +3 -18
  203. package/_cjs/typeclass/Functor.cjs.map +1 -1
  204. package/_cjs/typeclass/Guard/definition.cjs +3 -10
  205. package/_cjs/typeclass/Guard/definition.cjs.map +1 -1
  206. package/_cjs/typeclass/HashEq.cjs +2 -0
  207. package/_cjs/typeclass/HashEq.cjs.map +1 -1
  208. package/_cjs/typeclass/MonadExcept.cjs +2 -10
  209. package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
  210. package/_cjs/typeclass/Monoid.cjs +2 -0
  211. package/_cjs/typeclass/Monoid.cjs.map +1 -1
  212. package/_cjs/typeclass/Nil.cjs +0 -10
  213. package/_cjs/typeclass/Nil.cjs.map +1 -1
  214. package/_cjs/typeclass/Ord/definition.cjs +2 -0
  215. package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
  216. package/_cjs/typeclass/Ord/instances.cjs +4 -3
  217. package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
  218. package/_cjs/typeclass/Pointed.cjs +0 -11
  219. package/_cjs/typeclass/Pointed.cjs.map +1 -1
  220. package/_cjs/typeclass/Semialign.cjs +18 -46
  221. package/_cjs/typeclass/Semialign.cjs.map +1 -1
  222. package/_cjs/typeclass/Semimonoidal.cjs +0 -11
  223. package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
  224. package/_cjs/typeclass/Showable/show.cjs +12 -12
  225. package/_cjs/typeclass/Showable/show.cjs.map +1 -1
  226. package/_cjs/typeclass/Traversable.cjs +7 -26
  227. package/_cjs/typeclass/Traversable.cjs.map +1 -1
  228. package/_cjs/typeclass/TraversableWithIndex.cjs +3 -7
  229. package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
  230. package/_cjs/typeclass/Witherable.cjs +3 -45
  231. package/_cjs/typeclass/Witherable.cjs.map +1 -1
  232. package/_cjs/typeclass/WitherableWithIndex.cjs +8 -44
  233. package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
  234. package/_cjs/util.cjs +6 -0
  235. package/_cjs/util.cjs.map +1 -0
  236. package/_mjs/collection/Iterable/api/traverseConc.mjs +16 -21
  237. package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
  238. package/_mjs/collection/compat/Array/api.mjs +10 -10
  239. package/_mjs/collection/compat/Array/derivations.mjs +70 -0
  240. package/_mjs/collection/compat/Array/derivations.mjs.map +1 -0
  241. package/_mjs/collection/compat/Array.mjs +1 -0
  242. package/_mjs/collection/compat/Array.mjs.map +1 -1
  243. package/_mjs/collection/compat/Record/instances.mjs +62 -16
  244. package/_mjs/collection/compat/Record/instances.mjs.map +1 -1
  245. package/_mjs/collection/compat.mjs +2 -0
  246. package/_mjs/collection/compat.mjs.map +1 -0
  247. package/_mjs/collection/immutable/Conc/api.mjs +8 -11
  248. package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
  249. package/_mjs/collection/immutable/Conc/definition.mjs +41 -42
  250. package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
  251. package/_mjs/collection/immutable/Conc/derivations.mjs +27 -0
  252. package/_mjs/collection/immutable/Conc/derivations.mjs.map +1 -0
  253. package/_mjs/collection/immutable/Conc.mjs +2 -1
  254. package/_mjs/collection/immutable/Conc.mjs.map +1 -1
  255. package/_mjs/collection/immutable/Dictionary/definition.mjs +2 -3
  256. package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -1
  257. package/_mjs/collection/immutable/HashMap/api.mjs +18 -20
  258. package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
  259. package/_mjs/collection/immutable/HashMap/definition.mjs +15 -16
  260. package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
  261. package/_mjs/collection/immutable/HashSet/api.mjs +1 -0
  262. package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
  263. package/_mjs/collection/immutable/ImmutableArray/api.mjs +134 -153
  264. package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
  265. package/_mjs/collection/immutable/ImmutableArray/constructors.mjs +2 -2
  266. package/_mjs/collection/immutable/ImmutableArray/definition.mjs +16 -12
  267. package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -1
  268. package/_mjs/collection/immutable/ImmutableArray/derivations.mjs +25 -0
  269. package/_mjs/collection/immutable/ImmutableArray/derivations.mjs.map +1 -0
  270. package/_mjs/collection/immutable/ImmutableArray/instances.mjs +9 -8
  271. package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
  272. package/_mjs/collection/immutable/ImmutableArray.mjs +1 -0
  273. package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -1
  274. package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +19 -19
  275. package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
  276. package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +2 -2
  277. package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +0 -2
  278. package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
  279. package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs +39 -0
  280. package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs.map +1 -0
  281. package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +4 -3
  282. package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
  283. package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs +1 -0
  284. package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs.map +1 -1
  285. package/_mjs/collection/immutable/List/definition.mjs +2 -2
  286. package/_mjs/collection/immutable/RoseTree/definition.mjs +13 -14
  287. package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -1
  288. package/_mjs/collection/immutable/SortedMap/api.mjs +1 -0
  289. package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
  290. package/_mjs/collection/immutable/Vector/api.mjs +8 -12
  291. package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
  292. package/_mjs/collection/immutable/Vector/definition.mjs +11 -12
  293. package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
  294. package/_mjs/collection/immutable/Vector/internal.mjs +1 -1
  295. package/_mjs/collection/immutable.mjs +2 -0
  296. package/_mjs/collection/immutable.mjs.map +1 -0
  297. package/_mjs/collection/mutable/HashMap.mjs +4 -0
  298. package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
  299. package/_mjs/collection/mutable.mjs +2 -0
  300. package/_mjs/collection/mutable.mjs.map +1 -0
  301. package/_mjs/collection/weak/IterableWeakMap.mjs +51 -2
  302. package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
  303. package/_mjs/collection/weak/IterableWeakSet.mjs +59 -7
  304. package/_mjs/collection/weak/IterableWeakSet.mjs.map +1 -1
  305. package/_mjs/collection/weak.mjs +2 -0
  306. package/_mjs/collection/weak.mjs.map +1 -0
  307. package/_mjs/collection.mjs +2 -0
  308. package/_mjs/collection.mjs.map +1 -0
  309. package/_mjs/control/Eval/api.mjs +9 -4
  310. package/_mjs/control/Eval/api.mjs.map +1 -1
  311. package/_mjs/control/Eval/definition.mjs +1 -2
  312. package/_mjs/control/Eval/definition.mjs.map +1 -1
  313. package/_mjs/control/Eval/instance.mjs +1 -0
  314. package/_mjs/control/Eval/instance.mjs.map +1 -1
  315. package/_mjs/control/Eval/run.mjs +1 -0
  316. package/_mjs/control/Eval/run.mjs.map +1 -1
  317. package/_mjs/control/Z/api.mjs +16 -15
  318. package/_mjs/control/Z/api.mjs.map +1 -1
  319. package/_mjs/control/Z/definition.mjs +3 -5
  320. package/_mjs/control/Z/definition.mjs.map +1 -1
  321. package/_mjs/control/Z/instances.mjs +1 -0
  322. package/_mjs/control/Z/instances.mjs.map +1 -1
  323. package/_mjs/control/Z/runtime.mjs +15 -13
  324. package/_mjs/control/Z/runtime.mjs.map +1 -1
  325. package/_mjs/control.mjs +2 -0
  326. package/_mjs/control.mjs.map +1 -0
  327. package/_mjs/data/Branded/derivations.mjs +1 -0
  328. package/_mjs/data/Branded/derivations.mjs.map +1 -1
  329. package/_mjs/data/Cause/api/isEmpty.mjs +1 -0
  330. package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -1
  331. package/_mjs/data/Cause/api/linearize.mjs +1 -0
  332. package/_mjs/data/Cause/api/linearize.mjs.map +1 -1
  333. package/_mjs/data/Cause/api.mjs +2 -1
  334. package/_mjs/data/Cause/api.mjs.map +1 -1
  335. package/_mjs/data/Const/definition.mjs +0 -3
  336. package/_mjs/data/Const/definition.mjs.map +1 -1
  337. package/_mjs/data/Const/instances.mjs +7 -5
  338. package/_mjs/data/Const/instances.mjs.map +1 -1
  339. package/_mjs/data/Datum/api.mjs +404 -0
  340. package/_mjs/data/Datum/api.mjs.map +1 -0
  341. package/_mjs/data/Datum/definition.mjs +112 -0
  342. package/_mjs/data/Datum/definition.mjs.map +1 -0
  343. package/_mjs/data/Datum/instances.mjs +52 -0
  344. package/_mjs/data/Datum/instances.mjs.map +1 -0
  345. package/_mjs/data/DatumEither/api.mjs +290 -0
  346. package/_mjs/data/DatumEither/api.mjs.map +1 -0
  347. package/_mjs/data/DatumEither/definition.mjs +2 -0
  348. package/_mjs/data/DatumEither/definition.mjs.map +1 -0
  349. package/_mjs/data/DecodeError/definition.mjs +12 -3
  350. package/_mjs/data/DecodeError/definition.mjs.map +1 -1
  351. package/_mjs/data/DecodeError/instances.mjs +2 -0
  352. package/_mjs/data/DecodeError/instances.mjs.map +1 -0
  353. package/_mjs/data/DecodeError.mjs +1 -0
  354. package/_mjs/data/DecodeError.mjs.map +1 -1
  355. package/_mjs/data/Decoder/api.mjs +1 -0
  356. package/_mjs/data/Decoder/api.mjs.map +1 -1
  357. package/_mjs/data/Decoder/definition.mjs +0 -2
  358. package/_mjs/data/Decoder/definition.mjs.map +1 -1
  359. package/_mjs/data/Either/api/alignWith.mjs +1 -0
  360. package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
  361. package/_mjs/data/Either/api.mjs +17 -4
  362. package/_mjs/data/Either/api.mjs.map +1 -1
  363. package/_mjs/data/Either/definition.mjs +1 -3
  364. package/_mjs/data/Either/definition.mjs.map +1 -1
  365. package/_mjs/data/Either/instances.mjs +24 -23
  366. package/_mjs/data/Either/instances.mjs.map +1 -1
  367. package/_mjs/data/EitherT/api.mjs +73 -0
  368. package/_mjs/data/EitherT/api.mjs.map +1 -0
  369. package/_mjs/data/EitherT/definition.mjs +2 -0
  370. package/_mjs/data/EitherT/definition.mjs.map +1 -0
  371. package/_mjs/data/Environment/api.mjs +12 -13
  372. package/_mjs/data/Environment/api.mjs.map +1 -1
  373. package/_mjs/data/Environment/definition.mjs.map +1 -1
  374. package/_mjs/data/Identity/api.mjs +2 -1
  375. package/_mjs/data/Identity/api.mjs.map +1 -1
  376. package/_mjs/data/Identity/definition.mjs +2 -3
  377. package/_mjs/data/Identity/definition.mjs.map +1 -1
  378. package/_mjs/data/Identity/instances.mjs +1 -0
  379. package/_mjs/data/Identity/instances.mjs.map +1 -1
  380. package/_mjs/data/Intervals.mjs +257 -0
  381. package/_mjs/data/Intervals.mjs.map +1 -0
  382. package/_mjs/data/Maybe/api.mjs +2 -1
  383. package/_mjs/data/Maybe/api.mjs.map +1 -1
  384. package/_mjs/data/Maybe/definition.mjs +8 -10
  385. package/_mjs/data/Maybe/definition.mjs.map +1 -1
  386. package/_mjs/data/Maybe/instances.mjs +12 -11
  387. package/_mjs/data/Maybe/instances.mjs.map +1 -1
  388. package/_mjs/data/Newtype.mjs +3 -4
  389. package/_mjs/data/Newtype.mjs.map +1 -1
  390. package/_mjs/data/Patch/api.mjs +1 -0
  391. package/_mjs/data/Patch/api.mjs.map +1 -1
  392. package/_mjs/data/Struct/api.mjs +1 -0
  393. package/_mjs/data/Struct/api.mjs.map +1 -1
  394. package/_mjs/data/Struct/definition.mjs +2 -3
  395. package/_mjs/data/Struct/definition.mjs.map +1 -1
  396. package/_mjs/data/These/definition.mjs +1 -1
  397. package/_mjs/data/These/definition.mjs.map +1 -1
  398. package/_mjs/data/Zipped.mjs +37 -0
  399. package/_mjs/data/Zipped.mjs.map +1 -0
  400. package/_mjs/data/function/api.mjs +8 -0
  401. package/_mjs/data/function/api.mjs.map +1 -1
  402. package/_mjs/data/object/instances.mjs +7 -1
  403. package/_mjs/data/object/instances.mjs.map +1 -1
  404. package/_mjs/data/string/api.mjs +1 -1
  405. package/_mjs/data.mjs +2 -0
  406. package/_mjs/data.mjs.map +1 -0
  407. package/_mjs/global.mjs +2 -0
  408. package/_mjs/global.mjs.map +1 -0
  409. package/_mjs/index.mjs +2 -0
  410. package/_mjs/index.mjs.map +1 -0
  411. package/_mjs/json.mjs +2 -0
  412. package/_mjs/json.mjs.map +1 -0
  413. package/_mjs/optics/At/api.mjs +1 -0
  414. package/_mjs/optics/At/api.mjs.map +1 -1
  415. package/_mjs/optics/At/definition.mjs +1 -0
  416. package/_mjs/optics/At/definition.mjs.map +1 -1
  417. package/_mjs/optics/Index/api.mjs +1 -0
  418. package/_mjs/optics/Index/api.mjs.map +1 -1
  419. package/_mjs/optics/Iso/api.mjs +1 -0
  420. package/_mjs/optics/Iso/api.mjs.map +1 -1
  421. package/_mjs/optics/Iso/definition.mjs +2 -0
  422. package/_mjs/optics/Iso/definition.mjs.map +1 -1
  423. package/_mjs/optics/Lens/api.mjs +1 -0
  424. package/_mjs/optics/Lens/api.mjs.map +1 -1
  425. package/_mjs/optics/Lens/definition.mjs +2 -0
  426. package/_mjs/optics/Lens/definition.mjs.map +1 -1
  427. package/_mjs/optics/Optional/api/compose.mjs +1 -0
  428. package/_mjs/optics/Optional/api/compose.mjs.map +1 -1
  429. package/_mjs/optics/Optional/definition.mjs +5 -5
  430. package/_mjs/optics/Optional/definition.mjs.map +1 -1
  431. package/_mjs/optics/Prism/api/compose.mjs +1 -0
  432. package/_mjs/optics/Prism/api/compose.mjs.map +1 -1
  433. package/_mjs/optics/Prism/api/fromNullable.mjs +1 -0
  434. package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -1
  435. package/_mjs/optics/Prism/api/just.mjs +1 -0
  436. package/_mjs/optics/Prism/api/just.mjs.map +1 -1
  437. package/_mjs/optics/Prism/definition.mjs +1 -0
  438. package/_mjs/optics/Prism/definition.mjs.map +1 -1
  439. package/_mjs/optics/Traversal/api/compose.mjs +2 -1
  440. package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
  441. package/_mjs/optics/Traversal/api/fromTraversable.mjs +2 -1
  442. package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
  443. package/_mjs/optics/Traversal/definition.mjs +5 -3
  444. package/_mjs/optics/Traversal/definition.mjs.map +1 -1
  445. package/_mjs/optics.mjs +2 -0
  446. package/_mjs/optics.mjs.map +1 -0
  447. package/_mjs/typeclass/Alt.mjs +0 -5
  448. package/_mjs/typeclass/Alt.mjs.map +1 -1
  449. package/_mjs/typeclass/ApplicativeExcept.mjs +7 -32
  450. package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
  451. package/_mjs/typeclass/Apply.mjs +35 -65
  452. package/_mjs/typeclass/Apply.mjs.map +1 -1
  453. package/_mjs/typeclass/Chain.mjs +4 -25
  454. package/_mjs/typeclass/Chain.mjs.map +1 -1
  455. package/_mjs/typeclass/Eq/derivations.mjs +1 -0
  456. package/_mjs/typeclass/Eq/derivations.mjs.map +1 -1
  457. package/_mjs/typeclass/Fail.mjs +1 -8
  458. package/_mjs/typeclass/Fail.mjs.map +1 -1
  459. package/_mjs/typeclass/Filterable.mjs +0 -28
  460. package/_mjs/typeclass/Filterable.mjs.map +1 -1
  461. package/_mjs/typeclass/Foldable.mjs +3 -30
  462. package/_mjs/typeclass/Foldable.mjs.map +1 -1
  463. package/_mjs/typeclass/FoldableWithIndex.mjs +3 -30
  464. package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
  465. package/_mjs/typeclass/Functor.mjs +3 -16
  466. package/_mjs/typeclass/Functor.mjs.map +1 -1
  467. package/_mjs/typeclass/Guard/api.mjs +1 -0
  468. package/_mjs/typeclass/Guard/api.mjs.map +1 -1
  469. package/_mjs/typeclass/Guard/definition.mjs +0 -2
  470. package/_mjs/typeclass/Guard/definition.mjs.map +1 -1
  471. package/_mjs/typeclass/HashEq.mjs +1 -0
  472. package/_mjs/typeclass/HashEq.mjs.map +1 -1
  473. package/_mjs/typeclass/MonadExcept.mjs +2 -9
  474. package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
  475. package/_mjs/typeclass/Monoid.mjs +1 -0
  476. package/_mjs/typeclass/Monoid.mjs.map +1 -1
  477. package/_mjs/typeclass/Nil.mjs +1 -8
  478. package/_mjs/typeclass/Nil.mjs.map +1 -1
  479. package/_mjs/typeclass/Ord/definition.mjs +1 -0
  480. package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
  481. package/_mjs/typeclass/Ord/instances.mjs +3 -0
  482. package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
  483. package/_mjs/typeclass/Pointed.mjs +0 -9
  484. package/_mjs/typeclass/Pointed.mjs.map +1 -1
  485. package/_mjs/typeclass/Semialign.mjs +17 -45
  486. package/_mjs/typeclass/Semialign.mjs.map +1 -1
  487. package/_mjs/typeclass/Semigroup/api.mjs +1 -0
  488. package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
  489. package/_mjs/typeclass/Semigroup/derivations.mjs +1 -0
  490. package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -1
  491. package/_mjs/typeclass/Semimonoidal.mjs +0 -9
  492. package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
  493. package/_mjs/typeclass/Showable/show.mjs +12 -12
  494. package/_mjs/typeclass/Showable/show.mjs.map +1 -1
  495. package/_mjs/typeclass/Traversable.mjs +6 -25
  496. package/_mjs/typeclass/Traversable.mjs.map +1 -1
  497. package/_mjs/typeclass/TraversableWithIndex.mjs +2 -6
  498. package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
  499. package/_mjs/typeclass/Witherable.mjs +3 -40
  500. package/_mjs/typeclass/Witherable.mjs.map +1 -1
  501. package/_mjs/typeclass/WitherableWithIndex.mjs +6 -41
  502. package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
  503. package/_mjs/util.mjs +2 -0
  504. package/_mjs/util.mjs.map +1 -0
  505. package/_src/collection/Iterable/api/traverseConc.ts +24 -21
  506. package/_src/collection/compat/Array/api.ts +10 -10
  507. package/_src/collection/compat/Array/definition.ts +3 -3
  508. package/_src/collection/compat/Array/derivations.ts +85 -0
  509. package/_src/collection/compat/Array.ts +1 -0
  510. package/_src/collection/compat/Record/instances.ts +43 -0
  511. package/_src/collection/compat.ts +4 -0
  512. package/_src/collection/immutable/Conc/api.ts +9 -11
  513. package/_src/collection/immutable/Conc/definition.ts +18 -13
  514. package/_src/collection/immutable/Conc/derivations.ts +28 -0
  515. package/_src/collection/immutable/Conc.ts +1 -0
  516. package/_src/collection/immutable/Dictionary/definition.ts +1 -1
  517. package/_src/collection/immutable/HashMap/api.ts +20 -17
  518. package/_src/collection/immutable/HashMap/definition.ts +10 -6
  519. package/_src/collection/immutable/ImmutableArray/api.ts +62 -119
  520. package/_src/collection/immutable/ImmutableArray/constructors.ts +2 -2
  521. package/_src/collection/immutable/ImmutableArray/definition.ts +11 -5
  522. package/_src/collection/immutable/ImmutableArray/derivations.ts +28 -0
  523. package/_src/collection/immutable/ImmutableArray/instances.ts +47 -42
  524. package/_src/collection/immutable/ImmutableArray.ts +1 -0
  525. package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +13 -11
  526. package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +2 -2
  527. package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +10 -5
  528. package/_src/collection/immutable/ImmutableNonEmptyArray/derivations.ts +44 -0
  529. package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +24 -25
  530. package/_src/collection/immutable/ImmutableNonEmptyArray.ts +1 -0
  531. package/_src/collection/immutable/List/definition.ts +2 -2
  532. package/_src/collection/immutable/RoseTree/definition.ts +7 -4
  533. package/_src/collection/immutable/Vector/api.ts +12 -16
  534. package/_src/collection/immutable/Vector/definition.ts +10 -10
  535. package/_src/collection/immutable/Vector/internal.ts +1 -1
  536. package/_src/collection/immutable.ts +12 -0
  537. package/_src/collection/mutable/HashMap.ts +4 -0
  538. package/_src/collection/mutable.ts +6 -0
  539. package/_src/collection/weak/IterableWeakMap.ts +50 -5
  540. package/_src/collection/weak/IterableWeakSet.ts +57 -9
  541. package/_src/collection/weak.ts +4 -0
  542. package/_src/collection.ts +7 -0
  543. package/_src/control/Eval/api.ts +5 -2
  544. package/_src/control/Eval/definition.ts +8 -5
  545. package/_src/control/Eval/instance.ts +7 -7
  546. package/_src/control/Z/api.ts +40 -52
  547. package/_src/control/Z/definition.ts +36 -36
  548. package/_src/control/Z/instances.ts +3 -3
  549. package/_src/control/Z/runtime.ts +11 -11
  550. package/_src/control.ts +5 -0
  551. package/_src/data/Const/definition.ts +9 -17
  552. package/_src/data/Const/instances.ts +5 -5
  553. package/_src/data/Datum/api.ts +376 -0
  554. package/_src/data/Datum/definition.ts +102 -0
  555. package/_src/data/Datum/instances.ts +34 -0
  556. package/_src/data/DatumEither/api.ts +348 -0
  557. package/_src/data/DatumEither/definition.ts +20 -0
  558. package/_src/data/DecodeError/definition.ts +11 -3
  559. package/_src/data/DecodeError/instances.ts +0 -0
  560. package/_src/data/DecodeError.ts +1 -0
  561. package/_src/data/Decoder/definition.ts +7 -4
  562. package/_src/data/Either/api.ts +12 -2
  563. package/_src/data/Either/definition.ts +10 -15
  564. package/_src/data/Either/instances.ts +6 -6
  565. package/_src/data/EitherT/api.ts +239 -0
  566. package/_src/data/EitherT/definition.ts +23 -0
  567. package/_src/data/Environment/api.ts +8 -6
  568. package/_src/data/Environment/definition.ts +2 -2
  569. package/_src/data/Identity/api.ts +2 -2
  570. package/_src/data/Identity/definition.ts +2 -2
  571. package/_src/data/Identity/instances.ts +7 -7
  572. package/_src/data/Intervals.ts +126 -0
  573. package/_src/data/Maybe/api.ts +2 -2
  574. package/_src/data/Maybe/definition.ts +8 -5
  575. package/_src/data/Maybe/instances.ts +10 -10
  576. package/_src/data/Newtype.ts +32 -11
  577. package/_src/data/Struct/definition.ts +1 -1
  578. package/_src/data/Tag/definition.ts +2 -2
  579. package/_src/data/These/definition.ts +1 -1
  580. package/_src/data/Zipped.ts +52 -0
  581. package/_src/data/function/api.ts +8 -0
  582. package/_src/data/object/instances.ts +11 -1
  583. package/_src/data/string/api.ts +1 -1
  584. package/_src/data.ts +35 -0
  585. package/_src/global.ts +252 -0
  586. package/_src/index.ts +8 -0
  587. package/_src/json.ts +5 -0
  588. package/_src/optics/Optional/definition.ts +2 -2
  589. package/_src/optics/Traversal/api/compose.ts +1 -1
  590. package/_src/optics/Traversal/api/fromTraversable.ts +11 -11
  591. package/_src/optics/Traversal/definition.ts +13 -12
  592. package/_src/optics.ts +12 -0
  593. package/_src/typeclass/Align.ts +1 -1
  594. package/_src/typeclass/Alt.ts +24 -54
  595. package/_src/typeclass/Alternative.ts +1 -1
  596. package/_src/typeclass/Applicative.ts +6 -1
  597. package/_src/typeclass/ApplicativeExcept.ts +55 -81
  598. package/_src/typeclass/Apply.ts +224 -253
  599. package/_src/typeclass/Chain.ts +71 -98
  600. package/_src/typeclass/Fail.ts +10 -28
  601. package/_src/typeclass/Filterable.ts +13 -67
  602. package/_src/typeclass/FilterableWithIndex.ts +13 -13
  603. package/_src/typeclass/Foldable.ts +16 -35
  604. package/_src/typeclass/FoldableWithIndex.ts +14 -37
  605. package/_src/typeclass/Functor.ts +11 -21
  606. package/_src/typeclass/FunctorWithIndex.ts +4 -4
  607. package/_src/typeclass/Guard/definition.ts +1 -3
  608. package/_src/typeclass/Monad.ts +1 -1
  609. package/_src/typeclass/MonadExcept.ts +11 -7
  610. package/_src/typeclass/Nil.ts +10 -27
  611. package/_src/typeclass/Pointed.ts +11 -30
  612. package/_src/typeclass/Semialign.ts +285 -253
  613. package/_src/typeclass/Semimonoidal.ts +23 -54
  614. package/_src/typeclass/Showable/show.ts +10 -12
  615. package/_src/typeclass/Traversable.ts +45 -63
  616. package/_src/typeclass/TraversableWithIndex.ts +37 -34
  617. package/_src/typeclass/Witherable.ts +28 -115
  618. package/_src/typeclass/WitherableWithIndex.ts +82 -115
  619. package/_src/types/extractions.ts +1 -1
  620. package/_src/util.ts +8 -0
  621. package/collection/Iterable/api/traverseConc.d.ts +4 -6
  622. package/collection/compat/Array/api.d.ts +10 -10
  623. package/collection/compat/Array/definition.d.ts +3 -3
  624. package/collection/compat/Array/derivations.d.ts +24 -0
  625. package/collection/compat/Array.d.ts +1 -0
  626. package/collection/compat/Record/instances.d.ts +12 -0
  627. package/collection/compat.d.ts +2 -0
  628. package/collection/immutable/Conc/api.d.ts +4 -6
  629. package/collection/immutable/Conc/definition.d.ts +24 -20
  630. package/collection/immutable/Conc/derivations.d.ts +14 -0
  631. package/collection/immutable/Conc.d.ts +1 -0
  632. package/collection/immutable/Dictionary/definition.d.ts +1 -1
  633. package/collection/immutable/HashMap/api.d.ts +13 -13
  634. package/collection/immutable/HashMap/definition.d.ts +10 -7
  635. package/collection/immutable/ImmutableArray/api.d.ts +22 -24
  636. package/collection/immutable/ImmutableArray/constructors.d.ts +2 -2
  637. package/collection/immutable/ImmutableArray/definition.d.ts +12 -6
  638. package/collection/immutable/ImmutableArray/derivations.d.ts +14 -0
  639. package/collection/immutable/ImmutableArray/instances.d.ts +17 -17
  640. package/collection/immutable/ImmutableArray.d.ts +1 -0
  641. package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +6 -5
  642. package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +2 -2
  643. package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +9 -5
  644. package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +14 -0
  645. package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +10 -10
  646. package/collection/immutable/ImmutableNonEmptyArray.d.ts +1 -0
  647. package/collection/immutable/List/definition.d.ts +2 -2
  648. package/collection/immutable/RoseTree/definition.d.ts +7 -5
  649. package/collection/immutable/Vector/api.d.ts +4 -4
  650. package/collection/immutable/Vector/definition.d.ts +9 -10
  651. package/collection/immutable/Vector/internal.d.ts +1 -1
  652. package/collection/immutable.d.ts +10 -0
  653. package/collection/mutable/HashMap.d.ts +1 -0
  654. package/collection/mutable.d.ts +4 -0
  655. package/collection/weak/IterableWeakMap.d.ts +9 -3
  656. package/collection/weak/IterableWeakSet.d.ts +10 -4
  657. package/collection/weak.d.ts +2 -0
  658. package/collection.d.ts +5 -0
  659. package/control/Eval/api.d.ts +6 -1
  660. package/control/Eval/definition.d.ts +6 -4
  661. package/control/Eval/instance.d.ts +3 -3
  662. package/control/Z/api.d.ts +32 -30
  663. package/control/Z/definition.d.ts +43 -37
  664. package/control/Z/instances.d.ts +2 -2
  665. package/control/Z/runtime.d.ts +9 -8
  666. package/control.d.ts +3 -0
  667. package/data/Const/definition.d.ts +8 -16
  668. package/data/Const/instances.d.ts +4 -3
  669. package/data/Datum/api.d.ts +188 -0
  670. package/data/Datum/definition.d.ts +75 -0
  671. package/data/Datum/instances.d.ts +32 -0
  672. package/data/DatumEither/api.d.ts +169 -0
  673. package/data/DatumEither/definition.d.ts +21 -0
  674. package/data/DecodeError/definition.d.ts +6 -0
  675. package/data/DecodeError/instances.d.ts +1 -0
  676. package/data/DecodeError.d.ts +1 -0
  677. package/data/Decoder/definition.d.ts +6 -4
  678. package/data/Either/api.d.ts +10 -0
  679. package/data/Either/definition.d.ts +8 -14
  680. package/data/Either/instances.d.ts +4 -3
  681. package/data/EitherT/api.d.ts +60 -0
  682. package/data/EitherT/definition.d.ts +12 -0
  683. package/data/Environment/api.d.ts +7 -5
  684. package/data/Environment/definition.d.ts +3 -3
  685. package/data/Identity/api.d.ts +2 -1
  686. package/data/Identity/definition.d.ts +2 -2
  687. package/data/Identity/instances.d.ts +3 -3
  688. package/data/Intervals.d.ts +53 -0
  689. package/data/Maybe/api.d.ts +2 -1
  690. package/data/Maybe/definition.d.ts +10 -5
  691. package/data/Maybe/instances.d.ts +6 -6
  692. package/data/Newtype.d.ts +9 -8
  693. package/data/Struct/definition.d.ts +1 -1
  694. package/data/Tag/definition.d.ts +2 -2
  695. package/data/Zipped.d.ts +24 -0
  696. package/data/function/api.d.ts +6 -0
  697. package/data/object/instances.d.ts +6 -1
  698. package/data/string/api.d.ts +1 -1
  699. package/data.d.ts +33 -0
  700. package/global.d.ts +237 -0
  701. package/index.d.ts +8 -0
  702. package/json.d.ts +3 -0
  703. package/optics/Traversal/api/fromTraversable.d.ts +1 -1
  704. package/optics/Traversal/definition.d.ts +2 -4
  705. package/optics.d.ts +10 -0
  706. package/package.json +6 -2
  707. package/typeclass/Align.d.ts +1 -1
  708. package/typeclass/Alt.d.ts +2 -4
  709. package/typeclass/Alternative.d.ts +1 -1
  710. package/typeclass/Applicative.d.ts +2 -1
  711. package/typeclass/ApplicativeExcept.d.ts +5 -13
  712. package/typeclass/Apply.d.ts +20 -32
  713. package/typeclass/Chain.d.ts +5 -13
  714. package/typeclass/Fail.d.ts +2 -7
  715. package/typeclass/Filterable.d.ts +7 -31
  716. package/typeclass/FilterableWithIndex.d.ts +7 -7
  717. package/typeclass/Foldable.d.ts +6 -19
  718. package/typeclass/FoldableWithIndex.d.ts +6 -19
  719. package/typeclass/Functor.d.ts +4 -11
  720. package/typeclass/FunctorWithIndex.d.ts +2 -2
  721. package/typeclass/Guard/definition.d.ts +1 -4
  722. package/typeclass/Monad.d.ts +1 -1
  723. package/typeclass/MonadExcept.d.ts +3 -4
  724. package/typeclass/Nil.d.ts +2 -7
  725. package/typeclass/Pointed.d.ts +2 -7
  726. package/typeclass/Semialign.d.ts +26 -32
  727. package/typeclass/Semimonoidal.d.ts +3 -8
  728. package/typeclass/Showable/show.d.ts +1 -1
  729. package/typeclass/Traversable.d.ts +21 -12
  730. package/typeclass/TraversableWithIndex.d.ts +19 -6
  731. package/typeclass/Witherable.d.ts +5 -19
  732. package/typeclass/WitherableWithIndex.d.ts +33 -19
  733. package/types/extractions.d.ts +1 -1
  734. package/util.d.ts +6 -0
@@ -2,6 +2,7 @@
2
2
  export * from "./ImmutableArray/api.js";
3
3
  export * from "./ImmutableArray/constructors.js";
4
4
  export * from "./ImmutableArray/definition.js";
5
+ export * from "./ImmutableArray/derivations.js";
5
6
  export * from "./ImmutableArray/instances.js";
6
7
  // codegen:end
7
8
 
@@ -174,8 +174,8 @@ export function crossWith_<A, B, C>(
174
174
  export function cross_<A, B>(
175
175
  self: ImmutableNonEmptyArray<A>,
176
176
  fb: ImmutableNonEmptyArray<B>,
177
- ): ImmutableNonEmptyArray<readonly [A, B]> {
178
- return self.crossWith(fb, (a, b) => [a, b]);
177
+ ): ImmutableNonEmptyArray<Zipped.Make<A, B>> {
178
+ return self.crossWith(fb, (a, b) => Zipped(a, b));
179
179
  }
180
180
 
181
181
  /**
@@ -394,19 +394,21 @@ export function sort<A>(self: ImmutableNonEmptyArray<A>, /** @tsplus auto */ O:
394
394
  }
395
395
 
396
396
  /**
397
- * @tsplus fluent fncts.ImmutableNonEmptyArray traverseWithIndex
397
+ * @tsplus getter fncts.ImmutableNonEmptyArray traverseWithIndex
398
398
  */
399
- export const traverseWithIndex_: P.TraversableWithIndex<ImmutableNonEmptyArrayF>["traverseWithIndex"] = (self, f, G) =>
400
- self.tail.foldLeftWithIndex(
401
- f(0, self.head).map((b) => ImmutableNonEmptyArray(b), G),
402
- (i, fbs, a) => fbs.zipWith(f(i + 1, a), (bs, b) => bs.append(b), G),
403
- );
399
+ export const traverseWithIndex = P.TraversableWithIndex.makeTraverseWithIndex<ImmutableNonEmptyArrayF>()(
400
+ () => (self) => (G) => (f) =>
401
+ self.tail.foldLeftWithIndex(
402
+ G.map(f(0, self.head), (b) => ImmutableNonEmptyArray(b)),
403
+ (i, fbs, a) => G.zipWith(fbs, f(i + 1, a), (bs, b) => bs.append(b)),
404
+ ),
405
+ );
404
406
 
405
407
  /**
406
- * @tsplus fluent fncts.ImmutableNonEmptyArray traverse
408
+ * @tsplus getter fncts.ImmutableNonEmptyArray traverse
407
409
  */
408
- export const traverse_: P.Traversable<ImmutableNonEmptyArrayF>["traverse"] = (self, f, A) =>
409
- self.traverseWithIndex((_, a) => f(a), A);
410
+ export const traverse: P.Traversable<ImmutableNonEmptyArrayF>["traverse"] = (self) => (G) => (f) =>
411
+ self.traverseWithIndex(G)((_, a) => f(a));
410
412
 
411
413
  /**
412
414
  * @tsplus fluent fncts.ImmutableNonEmptyArray uniq
@@ -7,8 +7,8 @@ export function allocWithHead<A>(head: A, length: number): Array<A> & { 0: A } {
7
7
  }
8
8
 
9
9
  /**
10
- * @tsplus getter fncts.base.ReadonlyArray unsafeAsNonEmptyArray
11
- * @tsplus getter fncts.base.Array unsafeAsNonEmptyArray
10
+ * @tsplus getter fncts.ReadonlyArray unsafeAsNonEmptyArray
11
+ * @tsplus getter fncts.Array unsafeAsNonEmptyArray
12
12
  */
13
13
  export function unsafeAsNonEmptyArray<A>(self: ReadonlyArray<A>): ImmutableNonEmptyArray<A> {
14
14
  if (self.length === 0) {
@@ -1,28 +1,33 @@
1
1
  import { ImmutableArray } from "@fncts/base/collection/immutable/ImmutableArray/definition";
2
2
 
3
- export interface ImmutableNonEmptyArrayF extends ImmutableNonEmptyArray<any> {}
3
+ export interface ImmutableNonEmptyArrayF extends HKT {
4
+ type: ImmutableNonEmptyArray<this["A"]>;
5
+ variance: {
6
+ A: "+";
7
+ };
8
+ index: number;
9
+ }
4
10
 
5
11
  /**
6
12
  * @tsplus type fncts.ImmutableNonEmptyArray
7
13
  * @tsplus companion fncts.ImmutableNonEmptyArrayOps
8
14
  */
9
15
  export class ImmutableNonEmptyArray<A> extends ImmutableArray<A> {
10
- [HKT.F]!: ImmutableNonEmptyArrayF;
11
- [HKT.T]!: ImmutableNonEmptyArray<HKT._A<this>>;
16
+ readonly _A!: () => A;
12
17
  constructor(readonly _array: ReadonlyNonEmptyArray<A>) {
13
18
  super(_array);
14
19
  }
15
20
  }
16
21
 
17
22
  /**
18
- * @tsplus type fncts.base.NonEmptyArray
23
+ * @tsplus type fncts.NonEmptyArray
19
24
  */
20
25
  export interface NonEmptyArray<T> extends Array<T> {
21
26
  0: T;
22
27
  }
23
28
 
24
29
  /**
25
- * @tsplus type fncts.base.ReadonlyNonEmptyArray
30
+ * @tsplus type fncts.ReadonlyNonEmptyArray
26
31
  */
27
32
  export interface ReadonlyNonEmptyArray<T> extends ReadonlyArray<T> {
28
33
  readonly 0: T;
@@ -0,0 +1,44 @@
1
+ import type { Check } from "@fncts/typelevel/Check";
2
+
3
+ import { CompoundError, EmptyError } from "@fncts/base/data/DecodeError";
4
+
5
+ /**
6
+ * @tsplus derive fncts.Guard[fncts.ImmutableNonEmptyArray]<_> 10
7
+ */
8
+ export function deriveGuard<A extends ImmutableNonEmptyArray<any>>(
9
+ ...[elem]: [A] extends [ImmutableNonEmptyArray<infer _A>] ? [elem: Guard<_A>] : never
10
+ ): Guard<A> {
11
+ return Guard((u): u is A => {
12
+ if (ImmutableNonEmptyArray.is(u)) {
13
+ return u.every(elem.is);
14
+ }
15
+ return false;
16
+ });
17
+ }
18
+
19
+ /**
20
+ * @tsplus derive fncts.Decoder[fncts.ImmutableNonEmptyArray]<_> 10
21
+ */
22
+ export function deriveDecoder<A extends ImmutableNonEmptyArray<any>>(
23
+ ...[array, elem]: [A] extends [ImmutableNonEmptyArray<infer _A>]
24
+ ? Check<Check.IsEqual<A, ImmutableNonEmptyArray<_A>>> extends Check.True
25
+ ? [array: Decoder<Array<_A>>, elem: Decoder<_A>]
26
+ : never
27
+ : never
28
+ ): Decoder<A> {
29
+ return Decoder(
30
+ (u) =>
31
+ array.decode(u).match2(These.left, (warn, as) => {
32
+ if (as.isNonEmpty()) {
33
+ return These.right(new ImmutableNonEmptyArray(as) as A);
34
+ } else {
35
+ const err = new EmptyError(as);
36
+ return warn.match(
37
+ () => These.left(err),
38
+ (err0) => These.left(new CompoundError(`ImmutableNonEmptyArray<${elem.label}>`, Vector(err0, err))),
39
+ );
40
+ }
41
+ }),
42
+ `ImmutableNonEmptyArray<${elem.label}>`,
43
+ );
44
+ }
@@ -4,7 +4,6 @@ import type * as P from "@fncts/base/typeclass";
4
4
  import {
5
5
  align_,
6
6
  alignWith_,
7
- ap_,
8
7
  cross_,
9
8
  crossWith_,
10
9
  flatMap_,
@@ -14,92 +13,92 @@ import {
14
13
  foldRightWithIndex_,
15
14
  map_,
16
15
  mapWithIndex_,
17
- traverse_,
18
- traverseWithIndex_,
16
+ traverse,
17
+ traverseWithIndex,
19
18
  } from "@fncts/base/collection/immutable/ImmutableNonEmptyArray/api";
20
19
  import { make } from "@fncts/base/collection/immutable/ImmutableNonEmptyArray/constructors";
21
20
 
22
21
  /**
23
22
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Semialign
24
23
  */
25
- export const Semialign: P.Semialign<ImmutableNonEmptyArrayF> = {
24
+ export const Semialign = HKT.instance<P.Semialign<ImmutableNonEmptyArrayF>>({
26
25
  map: map_,
27
26
  alignWith: alignWith_,
28
- };
27
+ });
29
28
 
30
29
  /**
31
30
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Functor
32
31
  */
33
- export const Functor: P.Functor<ImmutableNonEmptyArrayF> = {
32
+ export const Functor = HKT.instance<P.Functor<ImmutableNonEmptyArrayF>>({
34
33
  map: map_,
35
- };
34
+ });
36
35
 
37
36
  /**
38
37
  * @tsplus static fncts.ImmutableNonEmptyArrayOps FunctorWithIndex
39
38
  */
40
- export const FunctorWithIndex: P.FunctorWithIndex<ImmutableNonEmptyArrayF> = {
39
+ export const FunctorWithIndex = HKT.instance<P.FunctorWithIndex<ImmutableNonEmptyArrayF>>({
41
40
  map: map_,
42
41
  mapWithIndex: mapWithIndex_,
43
- };
42
+ });
44
43
 
45
44
  /**
46
45
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Apply
47
46
  */
48
- export const Apply: P.Apply<ImmutableNonEmptyArrayF> = {
47
+ export const Apply = HKT.instance<P.Apply<ImmutableNonEmptyArrayF>>({
49
48
  ...Functor,
50
49
  zip: cross_,
51
50
  zipWith: crossWith_,
52
- };
51
+ });
53
52
 
54
53
  /**
55
54
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Applicative
56
55
  */
57
- export const Applicative: P.Applicative<ImmutableNonEmptyArrayF> = {
56
+ export const Applicative = HKT.instance<P.Applicative<ImmutableNonEmptyArrayF>>({
58
57
  ...Apply,
59
58
  pure: make,
60
- };
59
+ });
61
60
 
62
61
  /**
63
62
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Monad
64
63
  */
65
- export const Monad: P.Monad<ImmutableNonEmptyArrayF> = {
64
+ export const Monad = HKT.instance<P.Monad<ImmutableNonEmptyArrayF>>({
66
65
  ...Applicative,
67
66
  flatMap: flatMap_,
68
- };
67
+ });
69
68
 
70
69
  /**
71
70
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Foldable
72
71
  */
73
- export const Foldable: P.Foldable<ImmutableNonEmptyArrayF> = {
72
+ export const Foldable = HKT.instance<P.Foldable<ImmutableNonEmptyArrayF>>({
74
73
  foldLeft: foldLeft_,
75
74
  foldRight: foldRight_,
76
- };
75
+ });
77
76
 
78
77
  /**
79
78
  * @tsplus static fncts.ImmutableNonEmptyArrayOps FoldableWithIndex
80
79
  */
81
- export const FoldableWithIndex: P.FoldableWithIndex<ImmutableNonEmptyArrayF> = {
80
+ export const FoldableWithIndex = HKT.instance<P.FoldableWithIndex<ImmutableNonEmptyArrayF>>({
82
81
  ...Foldable,
83
82
  foldLeftWithIndex: foldLeftWithIndex_,
84
83
  foldRightWithIndex: foldRightWithIndex_,
85
- };
84
+ });
86
85
 
87
86
  /**
88
87
  * @tsplus static fncts.ImmutableNonEmptyArrayOps Traversable
89
88
  */
90
- export const Traversable: P.Traversable<ImmutableNonEmptyArrayF> = {
89
+ export const Traversable = HKT.instance<P.Traversable<ImmutableNonEmptyArrayF>>({
91
90
  ...Functor,
92
91
  ...Foldable,
93
- traverse: traverse_,
94
- };
92
+ traverse: traverse,
93
+ });
95
94
 
96
95
  /**
97
96
  * @tsplus static fncts.ImmutableNonEmptyArrayOps TraversableWithIndex
98
97
  */
99
- export const TraversableWithIndex: P.TraversableWithIndex<ImmutableNonEmptyArrayF> = {
98
+ export const TraversableWithIndex = HKT.instance<P.TraversableWithIndex<ImmutableNonEmptyArrayF>>({
100
99
  ...Functor,
101
100
  ...FunctorWithIndex,
102
101
  ...FoldableWithIndex,
103
102
  ...Traversable,
104
- traverseWithIndex: traverseWithIndex_,
105
- };
103
+ traverseWithIndex: traverseWithIndex,
104
+ });
@@ -2,6 +2,7 @@
2
2
  export * from "./ImmutableNonEmptyArray/api.js";
3
3
  export * from "./ImmutableNonEmptyArray/constructors.js";
4
4
  export * from "./ImmutableNonEmptyArray/definition.js";
5
+ export * from "./ImmutableNonEmptyArray/derivations.js";
5
6
  export * from "./ImmutableNonEmptyArray/destructors.js";
6
7
  export * from "./ImmutableNonEmptyArray/instances.js";
7
8
  // codegen:end
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  /**
16
- * @tsplus type fncts.base.List.Cons
16
+ * @tsplus type fncts.List.Cons
17
17
  * @tsplus companion fncts.ConsOps
18
18
  */
19
19
  export class Cons<A> implements Iterable<A> {
@@ -48,7 +48,7 @@ export class Cons<A> implements Iterable<A> {
48
48
  }
49
49
 
50
50
  /**
51
- * @tsplus type fncts.base.List.Nil
51
+ * @tsplus type fncts.List.Nil
52
52
  * @tsplus companion fncts.NilOps
53
53
  */
54
54
  export class Nil<A> implements Iterable<A> {
@@ -1,7 +1,12 @@
1
1
  export const RoseTreeTypeId = Symbol.for("fncts.RoseTree");
2
2
  export type RoseTreeTypeId = typeof RoseTreeTypeId;
3
3
 
4
- export interface RoseTreeF extends RoseTree<any> {}
4
+ export interface RoseTreeF extends HKT {
5
+ type: RoseTree<this["A"]>;
6
+ variance: {
7
+ A: "+";
8
+ };
9
+ }
5
10
 
6
11
  /**
7
12
  * @tsplus type fncts.RoseTree
@@ -9,9 +14,7 @@ export interface RoseTreeF extends RoseTree<any> {}
9
14
  */
10
15
  export class RoseTree<A> implements Hashable, Equatable {
11
16
  readonly _typeId: RoseTreeTypeId = RoseTreeTypeId;
12
- readonly [HKT.F]!: RoseTreeF;
13
- readonly [HKT.A]!: () => A;
14
- readonly [HKT.T]!: RoseTree<HKT._A<this>>;
17
+ declare _A: () => A;
15
18
  constructor(readonly value: A, readonly forest: Vector<RoseTree<A>>) {}
16
19
  [Symbol.equals](that: unknown): boolean {
17
20
  return isRoseTree(that) ? Equatable.strictEquals(this.value, that.value) && this.forest == that.forest : false;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable prefer-const */
2
2
  import type { MutableVector, VectorF } from "@fncts/base/collection/immutable/Vector/definition";
3
- import type { Eq, Monoid, Ord, Ordering, Traversable, TraversableWithIndex } from "@fncts/base/typeclass";
3
+ import type { Eq, Monoid, Ord, Ordering, Traversable } from "@fncts/base/typeclass";
4
4
 
5
5
  import {
6
6
  affixPush,
@@ -48,6 +48,7 @@ import {
48
48
  updateNode,
49
49
  zeroOffset,
50
50
  } from "@fncts/base/collection/immutable/Vector/internal";
51
+ import { TraversableWithIndex } from "@fncts/base/typeclass";
51
52
 
52
53
  /**
53
54
  * Appends an element to the end of a Vector and returns the new Vector.
@@ -1201,27 +1202,22 @@ export function toList<A>(self: Vector<A>): List<A> {
1201
1202
  }
1202
1203
 
1203
1204
  /**
1204
- * @tsplus fluent fncts.Vector traverseWithIndex
1205
+ * @tsplus getter fncts.Vector traverseWithIndex
1205
1206
  */
1206
- export const traverseWithIndex: TraversableWithIndex<VectorF>["traverseWithIndex"] = (self, f, G) => {
1207
+ export const traverseWithIndex = TraversableWithIndex.makeTraverseWithIndex<VectorF>()(() => (self) => (G) => (f) => {
1207
1208
  return self.foldLeftWithIndex(G.pure(Vector.emptyPushable()), (i, b, a) =>
1208
- b.zipWith(
1209
- f(i, a),
1210
- (v, b) => {
1211
- push(v, b);
1212
- return v;
1213
- },
1214
- G,
1215
- ),
1209
+ G.zipWith(b, f(i, a), (v, b) => {
1210
+ push(v, b);
1211
+ return v;
1212
+ }),
1216
1213
  );
1217
- };
1214
+ });
1218
1215
 
1219
1216
  /**
1220
- * @tsplus fluent fncts.Vector traverse
1217
+ * @tsplus getter fncts.Vector traverse
1221
1218
  */
1222
- export const traverse: Traversable<VectorF>["traverse"] = (self, f, G) => {
1223
- return self.traverseWithIndex((_, a) => f(a));
1224
- };
1219
+ export const traverse: Traversable<VectorF>["traverse"] = (self) => (G) => (f) =>
1220
+ self.traverseWithIndex(G)((_, a) => f(a));
1225
1221
 
1226
1222
  /**
1227
1223
  * Returns a new Vector without repeated elements by using the given
@@ -8,7 +8,13 @@ import { ForwardVectorIterator } from "@fncts/base/collection/immutable/Vector/i
8
8
  export const VectorTypeId = Symbol.for("fncts.Vector");
9
9
  export type VectorTypeId = typeof VectorTypeId;
10
10
 
11
- export interface VectorF extends Vector<any> {}
11
+ export interface VectorF extends HKT {
12
+ type: Vector<this["A"]>;
13
+ variance: {
14
+ A: "+";
15
+ };
16
+ index: number;
17
+ }
12
18
 
13
19
  /**
14
20
  * Represents a Vector of elements.
@@ -18,10 +24,7 @@ export interface VectorF extends Vector<any> {}
18
24
  */
19
25
  export class Vector<A> implements Iterable<A> {
20
26
  readonly _typeId: VectorTypeId = VectorTypeId;
21
- readonly [HKT.F]!: VectorF;
22
- readonly [HKT.A]!: () => A;
23
- readonly [HKT.T]!: Vector<HKT._A<this>>;
24
- readonly [HKT.Ix]!: number;
27
+ readonly _A!: () => A;
25
28
  constructor(
26
29
  /** @private */
27
30
  readonly bits: number,
@@ -50,14 +53,11 @@ export class Vector<A> implements Iterable<A> {
50
53
  }
51
54
 
52
55
  /**
53
- * @tsplus type fncts.base.MutableVector
56
+ * @tsplus type fncts.MutableVector
54
57
  */
55
58
  export interface MutableVector<A> {
56
59
  readonly _typeId: VectorTypeId;
57
- readonly [HKT.F]: VectorF;
58
- readonly [HKT.A]: () => A;
59
- readonly [HKT.T]: Vector<HKT._A<this>>;
60
- readonly [HKT.Ix]: number;
60
+ readonly _A: () => A;
61
61
  bits: number;
62
62
  offset: number;
63
63
  length: number;
@@ -357,7 +357,7 @@ export function decrementDepth(bits: number): number {
357
357
  /**
358
358
  * Appends the value to the Vector by _mutating_ the Vector and its content.
359
359
  *
360
- * @tsplus fluent fncts.base.MutableVector push
360
+ * @tsplus fluent fncts.MutableVector push
361
361
  */
362
362
  export function push<A>(l: MutableVector<A>, value: A): MutableVector<A> {
363
363
  const suffixSize = getSuffixSize(l);
@@ -0,0 +1,12 @@
1
+ // codegen:start { preset: type-barrel, include: ./immutable/*.ts }
2
+ export type {} from "./immutable/Conc.js";
3
+ export type {} from "./immutable/HashMap.js";
4
+ export type {} from "./immutable/HashSet.js";
5
+ export type {} from "./immutable/ImmutableArray.js";
6
+ export type {} from "./immutable/ImmutableNonEmptyArray.js";
7
+ export type {} from "./immutable/List.js";
8
+ export type {} from "./immutable/Queue.js";
9
+ export type {} from "./immutable/RoseTree.js";
10
+ export type {} from "./immutable/SortedMap.js";
11
+ export type {} from "./immutable/Vector.js";
12
+ // codegen:end
@@ -56,6 +56,10 @@ export class HashMap<K, V> implements Iterable<readonly [K, V]> {
56
56
  return this.findNode(key) !== undefined;
57
57
  }
58
58
 
59
+ unsafeGet(key: K): V | undefined {
60
+ return this.findNode(key)?.value;
61
+ }
62
+
59
63
  get(key: K): Maybe<V> {
60
64
  const n = this.findNode(key);
61
65
  return n ? Just(n.value) : Nothing();
@@ -0,0 +1,6 @@
1
+ // codegen:start { preset: type-barrel, include: ./mutable/*.ts }
2
+ export type {} from "./mutable/HashMap.js";
3
+ export type {} from "./mutable/HashSet.js";
4
+ export type {} from "./mutable/internal.js";
5
+ export type {} from "./mutable/ListBuffer.js";
6
+ // codegen:end
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @tsplus type fncts.IterableWeakMap
3
3
  */
4
- export class IterableWeakMap<K extends object, V> implements Iterable<readonly [K, V]> {
4
+ export class IterableWeakMap<K extends object, V> implements Iterable<readonly [K, V]>, Map<K, V> {
5
5
  private weakMap = new WeakMap<K, { value: V; ref: WeakRef<K> }>();
6
6
  private refSet = new Set<WeakRef<K>>();
7
7
  private finalizationGroup = new FinalizationRegistry<{ ref: WeakRef<K>; set: Set<WeakRef<K>> }>(
@@ -44,11 +44,48 @@ export class IterableWeakMap<K extends object, V> implements Iterable<readonly [
44
44
  return true;
45
45
  }
46
46
 
47
- [Symbol.iterator](this: this): IterableIterator<readonly [K, V]> {
47
+ has(this: this, key: K): boolean {
48
+ return this.weakMap.has(key);
49
+ }
50
+
51
+ clear(): void {
52
+ for (const ref of this.refSet) {
53
+ const key = ref.deref();
54
+ if (!key) continue;
55
+ const entry = this.weakMap.get(key)!;
56
+ this.weakMap.delete(key);
57
+ this.refSet.delete(entry.ref);
58
+ this.finalizationGroup.unregister(entry.ref);
59
+ }
60
+ this.refSet.clear();
61
+ }
62
+
63
+ forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: IterableWeakMap<K, V>): void {
64
+ thisArg = thisArg ?? this;
65
+ for (const kv of this) {
66
+ callbackfn(kv[1], kv[0], thisArg);
67
+ }
68
+ }
69
+
70
+ get size(): number {
71
+ let n = 0;
72
+ for (const ref of this.refSet) {
73
+ const key = ref.deref();
74
+ if (!key) continue;
75
+ n++;
76
+ }
77
+ return n;
78
+ }
79
+
80
+ [Symbol.iterator](this: this): IterableIterator<[K, V]> {
48
81
  return this.entries();
49
82
  }
50
83
 
51
- *entries(this: this): IterableIterator<readonly [K, V]> {
84
+ get [Symbol.toStringTag](): string {
85
+ return this.weakMap[Symbol.toStringTag];
86
+ }
87
+
88
+ *entries(this: this): IterableIterator<[K, V]> {
52
89
  for (const ref of this.refSet) {
53
90
  const key = ref.deref();
54
91
  if (!key) continue;
@@ -57,7 +94,15 @@ export class IterableWeakMap<K extends object, V> implements Iterable<readonly [
57
94
  }
58
95
  }
59
96
 
60
- has(this: this, key: K): boolean {
61
- return this.weakMap.has(key);
97
+ *keys(this: this): IterableIterator<K> {
98
+ for (const [key] of this) {
99
+ yield key;
100
+ }
101
+ }
102
+
103
+ *values(): IterableIterator<V> {
104
+ for (const [, value] of this) {
105
+ yield value;
106
+ }
62
107
  }
63
108
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @tsplus type fncts.IterableWeakSet
3
3
  */
4
- export class IterableWeakSet<A extends object> implements Iterable<A> {
4
+ export class IterableWeakSet<A extends object> implements Iterable<A>, Set<A> {
5
5
  private weakMap = new WeakMap<A, { ref: WeakRef<A> }>();
6
6
  private refSet = new Set<WeakRef<A>>();
7
7
  private finalizationGroup = new FinalizationRegistry<{ ref: WeakRef<A>; set: Set<WeakRef<A>> }>(
@@ -12,9 +12,11 @@ export class IterableWeakSet<A extends object> implements Iterable<A> {
12
12
  set.delete(ref);
13
13
  }
14
14
 
15
- constructor(iterable: Iterable<A>) {
16
- for (const value of iterable) {
17
- this.add(value);
15
+ constructor(iterable?: Iterable<A>) {
16
+ if (iterable) {
17
+ for (const value of iterable) {
18
+ this.add(value);
19
+ }
18
20
  }
19
21
  }
20
22
 
@@ -35,14 +37,52 @@ export class IterableWeakSet<A extends object> implements Iterable<A> {
35
37
 
36
38
  this.weakMap.delete(value);
37
39
  this.refSet.delete(entry.ref);
40
+ this.finalizationGroup.unregister(entry.ref);
38
41
  return true;
39
42
  }
40
43
 
41
- [Symbol.iterator](this: this): IterableIterator<A> {
42
- return this.entries();
44
+ has(this: this, value: A): boolean {
45
+ return this.weakMap.has(value);
46
+ }
47
+
48
+ keys(): IterableIterator<A> {
49
+ return this[Symbol.iterator]();
50
+ }
51
+
52
+ values(): IterableIterator<A> {
53
+ return this[Symbol.iterator]();
54
+ }
55
+
56
+ forEach(f: (value: A, value2: A, set: Set<A>) => void, thisArg?: Set<A>): void {
57
+ thisArg = thisArg ?? this;
58
+ for (const value of this) {
59
+ f(value, value, thisArg);
60
+ }
43
61
  }
44
62
 
45
- *entries(this: this): IterableIterator<A> {
63
+ clear(): void {
64
+ for (const ref of this.refSet) {
65
+ const key = ref.deref();
66
+ if (!key) continue;
67
+ const entry = this.weakMap.get(key)!;
68
+ this.weakMap.delete(key);
69
+ this.refSet.delete(entry.ref);
70
+ this.finalizationGroup.unregister(entry.ref);
71
+ }
72
+ this.refSet.clear();
73
+ }
74
+
75
+ get size(): number {
76
+ let n = 0;
77
+ for (const ref of this.refSet) {
78
+ const value = ref.deref();
79
+ if (!value) continue;
80
+ n++;
81
+ }
82
+ return n;
83
+ }
84
+
85
+ *[Symbol.iterator](this: this): IterableIterator<A> {
46
86
  for (const ref of this.refSet) {
47
87
  const key = ref.deref();
48
88
  if (!key) continue;
@@ -50,7 +90,15 @@ export class IterableWeakSet<A extends object> implements Iterable<A> {
50
90
  }
51
91
  }
52
92
 
53
- has(this: this, value: A): boolean {
54
- return this.weakMap.has(value);
93
+ get [Symbol.toStringTag]() {
94
+ return this.refSet[Symbol.toStringTag];
95
+ }
96
+
97
+ *entries(this: this): IterableIterator<[A, A]> {
98
+ for (const ref of this.refSet) {
99
+ const key = ref.deref();
100
+ if (!key) continue;
101
+ yield [key, key];
102
+ }
55
103
  }
56
104
  }
@@ -0,0 +1,4 @@
1
+ // codegen:start { preset: type-barrel, include: ./weak/*.ts }
2
+ export type {} from "./weak/IterableWeakMap.js";
3
+ export type {} from "./weak/IterableWeakSet.js";
4
+ // codegen:end
@@ -0,0 +1,7 @@
1
+ // codegen:start { preset: type-barrel, include: ./collection/*.ts }
2
+ export type {} from "./collection/compat.js";
3
+ export type {} from "./collection/immutable.js";
4
+ export type {} from "./collection/Iterable.js";
5
+ export type {} from "./collection/mutable.js";
6
+ export type {} from "./collection/weak.js";
7
+ // codegen:end
@@ -38,8 +38,11 @@ export function zipWith_<A, B, C>(self: Eval<A>, fb: Eval<B>, f: (a: A, b: B) =>
38
38
  return self.flatMap((a) => fb.map((b) => f(a, b)));
39
39
  }
40
40
 
41
- export function zip_<A, B>(self: Eval<A>, fb: Eval<B>): Eval<readonly [A, B]> {
42
- return self.zipWith(fb, tuple);
41
+ /**
42
+ * @tsplus fluent fncts.control.Eval zip
43
+ */
44
+ export function zip_<A, B>(self: Eval<A>, fb: Eval<B>): Eval<Zipped.Make<A, B>> {
45
+ return self.zipWith(fb, (a, b) => Zipped(a, b));
43
46
  }
44
47
 
45
48
  /**