@fncts/base 0.0.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 (1681) hide show
  1. package/_cjs/collection/Iterable/api/traverseConc.cjs +43 -0
  2. package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -0
  3. package/_cjs/collection/Iterable/api.cjs +857 -0
  4. package/_cjs/collection/Iterable/api.cjs.map +1 -0
  5. package/_cjs/collection/Iterable/constructors.cjs +114 -0
  6. package/_cjs/collection/Iterable/constructors.cjs.map +1 -0
  7. package/_cjs/collection/Iterable/definition.cjs +9 -0
  8. package/_cjs/collection/Iterable/definition.cjs.map +1 -0
  9. package/_cjs/collection/Iterable.cjs +45 -0
  10. package/_cjs/collection/Iterable.cjs.map +1 -0
  11. package/_cjs/collection/compat/Array/api.cjs +72 -0
  12. package/_cjs/collection/compat/Array/api.cjs.map +1 -0
  13. package/_cjs/collection/compat/Array/definition.cjs +9 -0
  14. package/_cjs/collection/compat/Array/definition.cjs.map +1 -0
  15. package/_cjs/collection/compat/Array.cjs +32 -0
  16. package/_cjs/collection/compat/Array.cjs.map +1 -0
  17. package/_cjs/collection/compat/ArrayLike/api.cjs +51 -0
  18. package/_cjs/collection/compat/ArrayLike/api.cjs.map +1 -0
  19. package/_cjs/collection/compat/ArrayLike/definition.cjs +6 -0
  20. package/_cjs/collection/compat/ArrayLike/definition.cjs.map +1 -0
  21. package/_cjs/collection/immutable/Conc/api/empty.cjs +16 -0
  22. package/_cjs/collection/immutable/Conc/api/empty.cjs.map +1 -0
  23. package/_cjs/collection/immutable/Conc/api/makeBy.cjs +34 -0
  24. package/_cjs/collection/immutable/Conc/api/makeBy.cjs.map +1 -0
  25. package/_cjs/collection/immutable/Conc/api/replicate.cjs +20 -0
  26. package/_cjs/collection/immutable/Conc/api/replicate.cjs.map +1 -0
  27. package/_cjs/collection/immutable/Conc/api.cjs +1493 -0
  28. package/_cjs/collection/immutable/Conc/api.cjs.map +1 -0
  29. package/_cjs/collection/immutable/Conc/constructors.cjs +61 -0
  30. package/_cjs/collection/immutable/Conc/constructors.cjs.map +1 -0
  31. package/_cjs/collection/immutable/Conc/definition.cjs +852 -0
  32. package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -0
  33. package/_cjs/collection/immutable/Conc.cjs +84 -0
  34. package/_cjs/collection/immutable/Conc.cjs.map +1 -0
  35. package/_cjs/collection/immutable/Dictionary/api.cjs +84 -0
  36. package/_cjs/collection/immutable/Dictionary/api.cjs.map +1 -0
  37. package/_cjs/collection/immutable/Dictionary/definition.cjs +16 -0
  38. package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -0
  39. package/_cjs/collection/immutable/HashMap/api.cjs +873 -0
  40. package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -0
  41. package/_cjs/collection/immutable/HashMap/definition.cjs +135 -0
  42. package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -0
  43. package/_cjs/collection/immutable/HashMap/internal.cjs +403 -0
  44. package/_cjs/collection/immutable/HashMap/internal.cjs.map +1 -0
  45. package/_cjs/collection/immutable/HashMap.cjs +32 -0
  46. package/_cjs/collection/immutable/HashMap.cjs.map +1 -0
  47. package/_cjs/collection/immutable/HashSet/api.cjs +590 -0
  48. package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -0
  49. package/_cjs/collection/immutable/HashSet/definition.cjs +412 -0
  50. package/_cjs/collection/immutable/HashSet/definition.cjs.map +1 -0
  51. package/_cjs/collection/immutable/HashSet.cjs +32 -0
  52. package/_cjs/collection/immutable/HashSet.cjs.map +1 -0
  53. package/_cjs/collection/immutable/ImmutableArray/api.cjs +1807 -0
  54. package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -0
  55. package/_cjs/collection/immutable/ImmutableArray/constructors.cjs +79 -0
  56. package/_cjs/collection/immutable/ImmutableArray/constructors.cjs.map +1 -0
  57. package/_cjs/collection/immutable/ImmutableArray/definition.cjs +56 -0
  58. package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -0
  59. package/_cjs/collection/immutable/ImmutableArray/instances.cjs +187 -0
  60. package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -0
  61. package/_cjs/collection/immutable/ImmutableArray.cjs +58 -0
  62. package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -0
  63. package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +634 -0
  64. package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -0
  65. package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +105 -0
  66. package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +1 -0
  67. package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +27 -0
  68. package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -0
  69. package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs +72 -0
  70. package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs.map +1 -0
  71. package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +143 -0
  72. package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -0
  73. package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs +71 -0
  74. package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs.map +1 -0
  75. package/_cjs/collection/immutable/List/api/foldLeft.cjs +28 -0
  76. package/_cjs/collection/immutable/List/api/foldLeft.cjs.map +1 -0
  77. package/_cjs/collection/immutable/List/api/unsafeTail.cjs +26 -0
  78. package/_cjs/collection/immutable/List/api/unsafeTail.cjs.map +1 -0
  79. package/_cjs/collection/immutable/List/api.cjs +443 -0
  80. package/_cjs/collection/immutable/List/api.cjs.map +1 -0
  81. package/_cjs/collection/immutable/List/constructors.cjs +92 -0
  82. package/_cjs/collection/immutable/List/constructors.cjs.map +1 -0
  83. package/_cjs/collection/immutable/List/definition.cjs +125 -0
  84. package/_cjs/collection/immutable/List/definition.cjs.map +1 -0
  85. package/_cjs/collection/immutable/List.cjs +71 -0
  86. package/_cjs/collection/immutable/List.cjs.map +1 -0
  87. package/_cjs/collection/immutable/Queue/api.cjs +210 -0
  88. package/_cjs/collection/immutable/Queue/api.cjs.map +1 -0
  89. package/_cjs/collection/immutable/Queue/constructors.cjs +33 -0
  90. package/_cjs/collection/immutable/Queue/constructors.cjs.map +1 -0
  91. package/_cjs/collection/immutable/Queue/definition.cjs +53 -0
  92. package/_cjs/collection/immutable/Queue/definition.cjs.map +1 -0
  93. package/_cjs/collection/immutable/Queue/guards.cjs +20 -0
  94. package/_cjs/collection/immutable/Queue/guards.cjs.map +1 -0
  95. package/_cjs/collection/immutable/Queue.cjs +58 -0
  96. package/_cjs/collection/immutable/Queue.cjs.map +1 -0
  97. package/_cjs/collection/immutable/SortedMap/api.cjs +691 -0
  98. package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -0
  99. package/_cjs/collection/immutable/SortedMap/definition.cjs +27 -0
  100. package/_cjs/collection/immutable/SortedMap/definition.cjs.map +1 -0
  101. package/_cjs/collection/immutable/SortedMap/internal.cjs +530 -0
  102. package/_cjs/collection/immutable/SortedMap/internal.cjs.map +1 -0
  103. package/_cjs/collection/immutable/SortedMap/iterator.cjs +394 -0
  104. package/_cjs/collection/immutable/SortedMap/iterator.cjs.map +1 -0
  105. package/_cjs/collection/immutable/SortedMap/node.cjs +23 -0
  106. package/_cjs/collection/immutable/SortedMap/node.cjs.map +1 -0
  107. package/_cjs/collection/immutable/SortedMap.cjs +71 -0
  108. package/_cjs/collection/immutable/SortedMap.cjs.map +1 -0
  109. package/_cjs/collection/immutable/Vector/api.cjs +1525 -0
  110. package/_cjs/collection/immutable/Vector/api.cjs.map +1 -0
  111. package/_cjs/collection/immutable/Vector/definition.cjs +105 -0
  112. package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -0
  113. package/_cjs/collection/immutable/Vector/internal.cjs +1665 -0
  114. package/_cjs/collection/immutable/Vector/internal.cjs.map +1 -0
  115. package/_cjs/collection/immutable/Vector.cjs +32 -0
  116. package/_cjs/collection/immutable/Vector.cjs.map +1 -0
  117. package/_cjs/collection/mutable/HashMap.cjs +390 -0
  118. package/_cjs/collection/mutable/HashMap.cjs.map +1 -0
  119. package/_cjs/collection/mutable/HashSet.cjs +308 -0
  120. package/_cjs/collection/mutable/HashSet.cjs.map +1 -0
  121. package/_cjs/collection/mutable/ListBuffer.cjs +156 -0
  122. package/_cjs/collection/mutable/ListBuffer.cjs.map +1 -0
  123. package/_cjs/collection/mutable/internal.cjs +39 -0
  124. package/_cjs/collection/mutable/internal.cjs.map +1 -0
  125. package/_cjs/control/Eval/api/sequenceArray.cjs +22 -0
  126. package/_cjs/control/Eval/api/sequenceArray.cjs.map +1 -0
  127. package/_cjs/control/Eval/api.cjs +148 -0
  128. package/_cjs/control/Eval/api.cjs.map +1 -0
  129. package/_cjs/control/Eval/constructors.cjs +49 -0
  130. package/_cjs/control/Eval/constructors.cjs.map +1 -0
  131. package/_cjs/control/Eval/definition.cjs +68 -0
  132. package/_cjs/control/Eval/definition.cjs.map +1 -0
  133. package/_cjs/control/Eval/instance.cjs +52 -0
  134. package/_cjs/control/Eval/instance.cjs.map +1 -0
  135. package/_cjs/control/Eval/run.cjs +72 -0
  136. package/_cjs/control/Eval/run.cjs.map +1 -0
  137. package/_cjs/control/Eval.cjs +71 -0
  138. package/_cjs/control/Eval.cjs.map +1 -0
  139. package/_cjs/control/LazyValue.cjs +38 -0
  140. package/_cjs/control/LazyValue.cjs.map +1 -0
  141. package/_cjs/control/Z/api.cjs +667 -0
  142. package/_cjs/control/Z/api.cjs.map +1 -0
  143. package/_cjs/control/Z/definition.cjs +227 -0
  144. package/_cjs/control/Z/definition.cjs.map +1 -0
  145. package/_cjs/control/Z/instances.cjs +28 -0
  146. package/_cjs/control/Z/instances.cjs.map +1 -0
  147. package/_cjs/control/Z/runtime.cjs +387 -0
  148. package/_cjs/control/Z/runtime.cjs.map +1 -0
  149. package/_cjs/control/Z.cjs +58 -0
  150. package/_cjs/control/Z.cjs.map +1 -0
  151. package/_cjs/data/Byte.cjs +6 -0
  152. package/_cjs/data/Byte.cjs.map +1 -0
  153. package/_cjs/data/CaseClass.cjs +127 -0
  154. package/_cjs/data/CaseClass.cjs.map +1 -0
  155. package/_cjs/data/Cause/api/fold.cjs +191 -0
  156. package/_cjs/data/Cause/api/fold.cjs.map +1 -0
  157. package/_cjs/data/Cause/api/isEmpty.cjs +83 -0
  158. package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -0
  159. package/_cjs/data/Cause/api/linearize.cjs +32 -0
  160. package/_cjs/data/Cause/api/linearize.cjs.map +1 -0
  161. package/_cjs/data/Cause/api/prettyPrint.cjs +51 -0
  162. package/_cjs/data/Cause/api/prettyPrint.cjs.map +1 -0
  163. package/_cjs/data/Cause/api/unified.cjs +168 -0
  164. package/_cjs/data/Cause/api/unified.cjs.map +1 -0
  165. package/_cjs/data/Cause/api.cjs +1406 -0
  166. package/_cjs/data/Cause/api.cjs.map +1 -0
  167. package/_cjs/data/Cause/definition.cjs +670 -0
  168. package/_cjs/data/Cause/definition.cjs.map +1 -0
  169. package/_cjs/data/Cause.cjs +32 -0
  170. package/_cjs/data/Cause.cjs.map +1 -0
  171. package/_cjs/data/Const/api.cjs +30 -0
  172. package/_cjs/data/Const/api.cjs.map +1 -0
  173. package/_cjs/data/Const/definition.cjs +9 -0
  174. package/_cjs/data/Const/definition.cjs.map +1 -0
  175. package/_cjs/data/Const/instances.cjs +50 -0
  176. package/_cjs/data/Const/instances.cjs.map +1 -0
  177. package/_cjs/data/Const.cjs +45 -0
  178. package/_cjs/data/Const.cjs.map +1 -0
  179. package/_cjs/data/Duration/api.cjs +97 -0
  180. package/_cjs/data/Duration/api.cjs.map +1 -0
  181. package/_cjs/data/Duration/definition.cjs +50 -0
  182. package/_cjs/data/Duration/definition.cjs.map +1 -0
  183. package/_cjs/data/Duration.cjs +32 -0
  184. package/_cjs/data/Duration.cjs.map +1 -0
  185. package/_cjs/data/Either/api/align.cjs +19 -0
  186. package/_cjs/data/Either/api/align.cjs.map +1 -0
  187. package/_cjs/data/Either/api/alignWith.cjs +28 -0
  188. package/_cjs/data/Either/api/alignWith.cjs.map +1 -0
  189. package/_cjs/data/Either/api.cjs +343 -0
  190. package/_cjs/data/Either/api.cjs.map +1 -0
  191. package/_cjs/data/Either/constructors.cjs +95 -0
  192. package/_cjs/data/Either/constructors.cjs.map +1 -0
  193. package/_cjs/data/Either/definition.cjs +56 -0
  194. package/_cjs/data/Either/definition.cjs.map +1 -0
  195. package/_cjs/data/Either/destructors.cjs +24 -0
  196. package/_cjs/data/Either/destructors.cjs.map +1 -0
  197. package/_cjs/data/Either/instances.cjs +85 -0
  198. package/_cjs/data/Either/instances.cjs.map +1 -0
  199. package/_cjs/data/Either.cjs +71 -0
  200. package/_cjs/data/Either.cjs.map +1 -0
  201. package/_cjs/data/Environment/api.cjs +116 -0
  202. package/_cjs/data/Environment/api.cjs.map +1 -0
  203. package/_cjs/data/Environment/definition.cjs +60 -0
  204. package/_cjs/data/Environment/definition.cjs.map +1 -0
  205. package/_cjs/data/Environment.cjs +32 -0
  206. package/_cjs/data/Environment.cjs.map +1 -0
  207. package/_cjs/data/ExecutionStrategy.cjs +73 -0
  208. package/_cjs/data/ExecutionStrategy.cjs.map +1 -0
  209. package/_cjs/data/Exit/api.cjs +259 -0
  210. package/_cjs/data/Exit/api.cjs.map +1 -0
  211. package/_cjs/data/Exit/constructors.cjs +93 -0
  212. package/_cjs/data/Exit/constructors.cjs.map +1 -0
  213. package/_cjs/data/Exit/definition.cjs +139 -0
  214. package/_cjs/data/Exit/definition.cjs.map +1 -0
  215. package/_cjs/data/Exit.cjs +45 -0
  216. package/_cjs/data/Exit.cjs.map +1 -0
  217. package/_cjs/data/FiberId/api.cjs +72 -0
  218. package/_cjs/data/FiberId/api.cjs.map +1 -0
  219. package/_cjs/data/FiberId/constructors.cjs +41 -0
  220. package/_cjs/data/FiberId/constructors.cjs.map +1 -0
  221. package/_cjs/data/FiberId/definition.cjs +130 -0
  222. package/_cjs/data/FiberId/definition.cjs.map +1 -0
  223. package/_cjs/data/FiberId.cjs +45 -0
  224. package/_cjs/data/FiberId.cjs.map +1 -0
  225. package/_cjs/data/Identity/api.cjs +42 -0
  226. package/_cjs/data/Identity/api.cjs.map +1 -0
  227. package/_cjs/data/Identity/definition.cjs +9 -0
  228. package/_cjs/data/Identity/definition.cjs.map +1 -0
  229. package/_cjs/data/Identity/instances.cjs +50 -0
  230. package/_cjs/data/Identity/instances.cjs.map +1 -0
  231. package/_cjs/data/Identity.cjs +45 -0
  232. package/_cjs/data/Identity.cjs.map +1 -0
  233. package/_cjs/data/Maybe/api.cjs +265 -0
  234. package/_cjs/data/Maybe/api.cjs.map +1 -0
  235. package/_cjs/data/Maybe/constructors.cjs +117 -0
  236. package/_cjs/data/Maybe/constructors.cjs.map +1 -0
  237. package/_cjs/data/Maybe/definition.cjs +128 -0
  238. package/_cjs/data/Maybe/definition.cjs.map +1 -0
  239. package/_cjs/data/Maybe/destructors.cjs +19 -0
  240. package/_cjs/data/Maybe/destructors.cjs.map +1 -0
  241. package/_cjs/data/Maybe/instances.cjs +68 -0
  242. package/_cjs/data/Maybe/instances.cjs.map +1 -0
  243. package/_cjs/data/Maybe.cjs +71 -0
  244. package/_cjs/data/Maybe.cjs.map +1 -0
  245. package/_cjs/data/Newtype.cjs +27 -0
  246. package/_cjs/data/Newtype.cjs.map +1 -0
  247. package/_cjs/data/Patch/api.cjs +137 -0
  248. package/_cjs/data/Patch/api.cjs.map +1 -0
  249. package/_cjs/data/Patch/definition.cjs +88 -0
  250. package/_cjs/data/Patch/definition.cjs.map +1 -0
  251. package/_cjs/data/Patch.cjs +32 -0
  252. package/_cjs/data/Patch.cjs.map +1 -0
  253. package/_cjs/data/Predicate/api.cjs +41 -0
  254. package/_cjs/data/Predicate/api.cjs.map +1 -0
  255. package/_cjs/data/Predicate/definition.cjs +6 -0
  256. package/_cjs/data/Predicate/definition.cjs.map +1 -0
  257. package/_cjs/data/Predicate.cjs +32 -0
  258. package/_cjs/data/Predicate.cjs.map +1 -0
  259. package/_cjs/data/Refinement/api.cjs +43 -0
  260. package/_cjs/data/Refinement/api.cjs.map +1 -0
  261. package/_cjs/data/Refinement/definition.cjs +6 -0
  262. package/_cjs/data/Refinement/definition.cjs.map +1 -0
  263. package/_cjs/data/Refinement.cjs +32 -0
  264. package/_cjs/data/Refinement.cjs.map +1 -0
  265. package/_cjs/data/Struct/api.cjs +37 -0
  266. package/_cjs/data/Struct/api.cjs.map +1 -0
  267. package/_cjs/data/Struct/definition.cjs +16 -0
  268. package/_cjs/data/Struct/definition.cjs.map +1 -0
  269. package/_cjs/data/Tag/constructors.cjs +20 -0
  270. package/_cjs/data/Tag/constructors.cjs.map +1 -0
  271. package/_cjs/data/Tag/definition.cjs +57 -0
  272. package/_cjs/data/Tag/definition.cjs.map +1 -0
  273. package/_cjs/data/Tag.cjs +32 -0
  274. package/_cjs/data/Tag.cjs.map +1 -0
  275. package/_cjs/data/These/constructors.cjs +37 -0
  276. package/_cjs/data/These/constructors.cjs.map +1 -0
  277. package/_cjs/data/These/definition.cjs +63 -0
  278. package/_cjs/data/These/definition.cjs.map +1 -0
  279. package/_cjs/data/These/destructors.cjs +29 -0
  280. package/_cjs/data/These/destructors.cjs.map +1 -0
  281. package/_cjs/data/These.cjs +45 -0
  282. package/_cjs/data/These.cjs.map +1 -0
  283. package/_cjs/data/Trace/api.cjs +35 -0
  284. package/_cjs/data/Trace/api.cjs.map +1 -0
  285. package/_cjs/data/Trace/constructors.cjs +32 -0
  286. package/_cjs/data/Trace/constructors.cjs.map +1 -0
  287. package/_cjs/data/Trace/definition.cjs +21 -0
  288. package/_cjs/data/Trace/definition.cjs.map +1 -0
  289. package/_cjs/data/Trace.cjs +45 -0
  290. package/_cjs/data/Trace.cjs.map +1 -0
  291. package/_cjs/data/TraceElement/definition.cjs +75 -0
  292. package/_cjs/data/TraceElement/definition.cjs.map +1 -0
  293. package/_cjs/data/TraceElement.cjs +19 -0
  294. package/_cjs/data/TraceElement.cjs.map +1 -0
  295. package/_cjs/data/exceptions/ArrayIndexOutOfBoundsError.cjs +20 -0
  296. package/_cjs/data/exceptions/ArrayIndexOutOfBoundsError.cjs.map +1 -0
  297. package/_cjs/data/exceptions/IllegalArgumentError.cjs +21 -0
  298. package/_cjs/data/exceptions/IllegalArgumentError.cjs.map +1 -0
  299. package/_cjs/data/exceptions/IllegalStateError.cjs +20 -0
  300. package/_cjs/data/exceptions/IllegalStateError.cjs.map +1 -0
  301. package/_cjs/data/exceptions/IndexOutOfBoundsError.cjs +20 -0
  302. package/_cjs/data/exceptions/IndexOutOfBoundsError.cjs.map +1 -0
  303. package/_cjs/data/exceptions/InterruptedException.cjs +27 -0
  304. package/_cjs/data/exceptions/InterruptedException.cjs.map +1 -0
  305. package/_cjs/data/exceptions/InvalidCapacityError.cjs +23 -0
  306. package/_cjs/data/exceptions/InvalidCapacityError.cjs.map +1 -0
  307. package/_cjs/data/exceptions/NoSuchElementError.cjs +20 -0
  308. package/_cjs/data/exceptions/NoSuchElementError.cjs.map +1 -0
  309. package/_cjs/data/exceptions.cjs +97 -0
  310. package/_cjs/data/exceptions.cjs.map +1 -0
  311. package/_cjs/data/function/api.cjs +52 -0
  312. package/_cjs/data/function/api.cjs.map +1 -0
  313. package/_cjs/data/function/definition.cjs +6 -0
  314. package/_cjs/data/function/definition.cjs.map +1 -0
  315. package/_cjs/data/function/pipe.cjs +74 -0
  316. package/_cjs/data/function/pipe.cjs.map +1 -0
  317. package/_cjs/data/function.cjs +45 -0
  318. package/_cjs/data/function.cjs.map +1 -0
  319. package/_cjs/data/number/api.cjs +14 -0
  320. package/_cjs/data/number/api.cjs.map +1 -0
  321. package/_cjs/data/number/definition.cjs +6 -0
  322. package/_cjs/data/number/definition.cjs.map +1 -0
  323. package/_cjs/data/number/instances.cjs +34 -0
  324. package/_cjs/data/number/instances.cjs.map +1 -0
  325. package/_cjs/data/number.cjs +45 -0
  326. package/_cjs/data/number.cjs.map +1 -0
  327. package/_cjs/data/object/definition.cjs +6 -0
  328. package/_cjs/data/object/definition.cjs.map +1 -0
  329. package/_cjs/data/object.cjs +19 -0
  330. package/_cjs/data/object.cjs.map +1 -0
  331. package/_cjs/data/string/api.cjs +254 -0
  332. package/_cjs/data/string/api.cjs.map +1 -0
  333. package/_cjs/data/string/definition.cjs +6 -0
  334. package/_cjs/data/string/definition.cjs.map +1 -0
  335. package/_cjs/data/string/instances.cjs +55 -0
  336. package/_cjs/data/string/instances.cjs.map +1 -0
  337. package/_cjs/data/string.cjs +45 -0
  338. package/_cjs/data/string.cjs.map +1 -0
  339. package/_cjs/global/api.cjs +11 -0
  340. package/_cjs/global/api.cjs.map +1 -0
  341. package/_cjs/internal/AtomicBoolean.cjs +18 -0
  342. package/_cjs/internal/AtomicBoolean.cjs.map +1 -0
  343. package/_cjs/internal/AtomicNumber.cjs +36 -0
  344. package/_cjs/internal/AtomicNumber.cjs.map +1 -0
  345. package/_cjs/internal/AtomicReference.cjs +40 -0
  346. package/_cjs/internal/AtomicReference.cjs.map +1 -0
  347. package/_cjs/internal/Stack.cjs +69 -0
  348. package/_cjs/internal/Stack.cjs.map +1 -0
  349. package/_cjs/optics/At/api.cjs +24 -0
  350. package/_cjs/optics/At/api.cjs.map +1 -0
  351. package/_cjs/optics/At/definition.cjs +34 -0
  352. package/_cjs/optics/At/definition.cjs.map +1 -0
  353. package/_cjs/optics/At.cjs +32 -0
  354. package/_cjs/optics/At.cjs.map +1 -0
  355. package/_cjs/optics/Fold/definition.cjs +21 -0
  356. package/_cjs/optics/Fold/definition.cjs.map +1 -0
  357. package/_cjs/optics/Fold.cjs +19 -0
  358. package/_cjs/optics/Fold.cjs.map +1 -0
  359. package/_cjs/optics/Getter/definition.cjs +22 -0
  360. package/_cjs/optics/Getter/definition.cjs.map +1 -0
  361. package/_cjs/optics/Getter.cjs +19 -0
  362. package/_cjs/optics/Getter.cjs.map +1 -0
  363. package/_cjs/optics/Index/api.cjs +37 -0
  364. package/_cjs/optics/Index/api.cjs.map +1 -0
  365. package/_cjs/optics/Index/definition.cjs +20 -0
  366. package/_cjs/optics/Index/definition.cjs.map +1 -0
  367. package/_cjs/optics/Index.cjs +32 -0
  368. package/_cjs/optics/Index.cjs.map +1 -0
  369. package/_cjs/optics/Iso/api.cjs +25 -0
  370. package/_cjs/optics/Iso/api.cjs.map +1 -0
  371. package/_cjs/optics/Iso/definition.cjs +54 -0
  372. package/_cjs/optics/Iso/definition.cjs.map +1 -0
  373. package/_cjs/optics/Iso.cjs +32 -0
  374. package/_cjs/optics/Iso.cjs.map +1 -0
  375. package/_cjs/optics/Lens/api.cjs +171 -0
  376. package/_cjs/optics/Lens/api.cjs.map +1 -0
  377. package/_cjs/optics/Lens/definition.cjs +50 -0
  378. package/_cjs/optics/Lens/definition.cjs.map +1 -0
  379. package/_cjs/optics/Lens.cjs +32 -0
  380. package/_cjs/optics/Lens.cjs.map +1 -0
  381. package/_cjs/optics/Optional/api/compose.cjs +27 -0
  382. package/_cjs/optics/Optional/api/compose.cjs.map +1 -0
  383. package/_cjs/optics/Optional/definition.cjs +57 -0
  384. package/_cjs/optics/Optional/definition.cjs.map +1 -0
  385. package/_cjs/optics/Optional.cjs +32 -0
  386. package/_cjs/optics/Optional.cjs.map +1 -0
  387. package/_cjs/optics/Prism/api/compose.cjs +29 -0
  388. package/_cjs/optics/Prism/api/compose.cjs.map +1 -0
  389. package/_cjs/optics/Prism/api/fromNullable.cjs +27 -0
  390. package/_cjs/optics/Prism/api/fromNullable.cjs.map +1 -0
  391. package/_cjs/optics/Prism/api/just.cjs +29 -0
  392. package/_cjs/optics/Prism/api/just.cjs.map +1 -0
  393. package/_cjs/optics/Prism/definition.cjs +48 -0
  394. package/_cjs/optics/Prism/definition.cjs.map +1 -0
  395. package/_cjs/optics/Prism.cjs +58 -0
  396. package/_cjs/optics/Prism.cjs.map +1 -0
  397. package/_cjs/optics/Setter/definition.cjs +33 -0
  398. package/_cjs/optics/Setter/definition.cjs.map +1 -0
  399. package/_cjs/optics/Setter.cjs +19 -0
  400. package/_cjs/optics/Setter.cjs.map +1 -0
  401. package/_cjs/optics/Traversal/api/compose.cjs +22 -0
  402. package/_cjs/optics/Traversal/api/compose.cjs.map +1 -0
  403. package/_cjs/optics/Traversal/api/fromTraversable.cjs +22 -0
  404. package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -0
  405. package/_cjs/optics/Traversal/definition.cjs +53 -0
  406. package/_cjs/optics/Traversal/definition.cjs.map +1 -0
  407. package/_cjs/optics/Traversal.cjs +45 -0
  408. package/_cjs/optics/Traversal.cjs.map +1 -0
  409. package/_cjs/typeclass/Align.cjs +29 -0
  410. package/_cjs/typeclass/Align.cjs.map +1 -0
  411. package/_cjs/typeclass/Alt.cjs +26 -0
  412. package/_cjs/typeclass/Alt.cjs.map +1 -0
  413. package/_cjs/typeclass/Alternative.cjs +32 -0
  414. package/_cjs/typeclass/Alternative.cjs.map +1 -0
  415. package/_cjs/typeclass/Applicative.cjs +31 -0
  416. package/_cjs/typeclass/Applicative.cjs.map +1 -0
  417. package/_cjs/typeclass/ApplicativeExcept.cjs +56 -0
  418. package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -0
  419. package/_cjs/typeclass/Apply.cjs +136 -0
  420. package/_cjs/typeclass/Apply.cjs.map +1 -0
  421. package/_cjs/typeclass/Chain.cjs +35 -0
  422. package/_cjs/typeclass/Chain.cjs.map +1 -0
  423. package/_cjs/typeclass/Closure.cjs +21 -0
  424. package/_cjs/typeclass/Closure.cjs.map +1 -0
  425. package/_cjs/typeclass/Eq.cjs +21 -0
  426. package/_cjs/typeclass/Eq.cjs.map +1 -0
  427. package/_cjs/typeclass/Equatable/api.cjs +45 -0
  428. package/_cjs/typeclass/Equatable/api.cjs.map +1 -0
  429. package/_cjs/typeclass/Equatable/definition.cjs +28 -0
  430. package/_cjs/typeclass/Equatable/definition.cjs.map +1 -0
  431. package/_cjs/typeclass/Equatable/fast-equals.cjs +520 -0
  432. package/_cjs/typeclass/Equatable/fast-equals.cjs.map +1 -0
  433. package/_cjs/typeclass/Equatable.cjs +45 -0
  434. package/_cjs/typeclass/Equatable.cjs.map +1 -0
  435. package/_cjs/typeclass/Fail.cjs +22 -0
  436. package/_cjs/typeclass/Fail.cjs.map +1 -0
  437. package/_cjs/typeclass/Filterable.cjs +32 -0
  438. package/_cjs/typeclass/Filterable.cjs.map +1 -0
  439. package/_cjs/typeclass/FilterableWithIndex.cjs +35 -0
  440. package/_cjs/typeclass/FilterableWithIndex.cjs.map +1 -0
  441. package/_cjs/typeclass/Foldable.cjs +34 -0
  442. package/_cjs/typeclass/Foldable.cjs.map +1 -0
  443. package/_cjs/typeclass/FoldableWithIndex.cjs +36 -0
  444. package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -0
  445. package/_cjs/typeclass/Functor.cjs +30 -0
  446. package/_cjs/typeclass/Functor.cjs.map +1 -0
  447. package/_cjs/typeclass/FunctorWithIndex.cjs +30 -0
  448. package/_cjs/typeclass/FunctorWithIndex.cjs.map +1 -0
  449. package/_cjs/typeclass/Has.cjs +17 -0
  450. package/_cjs/typeclass/Has.cjs.map +1 -0
  451. package/_cjs/typeclass/Hash.cjs +18 -0
  452. package/_cjs/typeclass/Hash.cjs.map +1 -0
  453. package/_cjs/typeclass/HashEq.cjs +51 -0
  454. package/_cjs/typeclass/HashEq.cjs.map +1 -0
  455. package/_cjs/typeclass/Hashable/definition.cjs +28 -0
  456. package/_cjs/typeclass/Hashable/definition.cjs.map +1 -0
  457. package/_cjs/typeclass/Hashable/hash.cjs +267 -0
  458. package/_cjs/typeclass/Hashable/hash.cjs.map +1 -0
  459. package/_cjs/typeclass/Hashable.cjs +32 -0
  460. package/_cjs/typeclass/Hashable.cjs.map +1 -0
  461. package/_cjs/typeclass/Monad.cjs +31 -0
  462. package/_cjs/typeclass/Monad.cjs.map +1 -0
  463. package/_cjs/typeclass/MonadExcept.cjs +36 -0
  464. package/_cjs/typeclass/MonadExcept.cjs.map +1 -0
  465. package/_cjs/typeclass/Monoid.cjs +27 -0
  466. package/_cjs/typeclass/Monoid.cjs.map +1 -0
  467. package/_cjs/typeclass/Nil.cjs +6 -0
  468. package/_cjs/typeclass/Nil.cjs.map +1 -0
  469. package/_cjs/typeclass/Ord/api/contramap.cjs +19 -0
  470. package/_cjs/typeclass/Ord/api/contramap.cjs.map +1 -0
  471. package/_cjs/typeclass/Ord/api/max.cjs +15 -0
  472. package/_cjs/typeclass/Ord/api/max.cjs.map +1 -0
  473. package/_cjs/typeclass/Ord/api/min.cjs +15 -0
  474. package/_cjs/typeclass/Ord/api/min.cjs.map +1 -0
  475. package/_cjs/typeclass/Ord/api.cjs +45 -0
  476. package/_cjs/typeclass/Ord/api.cjs.map +1 -0
  477. package/_cjs/typeclass/Ord/definition.cjs +28 -0
  478. package/_cjs/typeclass/Ord/definition.cjs.map +1 -0
  479. package/_cjs/typeclass/Ord/instances.cjs +52 -0
  480. package/_cjs/typeclass/Ord/instances.cjs.map +1 -0
  481. package/_cjs/typeclass/Ord.cjs +45 -0
  482. package/_cjs/typeclass/Ord.cjs.map +1 -0
  483. package/_cjs/typeclass/Ordering.cjs +57 -0
  484. package/_cjs/typeclass/Ordering.cjs.map +1 -0
  485. package/_cjs/typeclass/Pointed.cjs +25 -0
  486. package/_cjs/typeclass/Pointed.cjs.map +1 -0
  487. package/_cjs/typeclass/Semialign.cjs +121 -0
  488. package/_cjs/typeclass/Semialign.cjs.map +1 -0
  489. package/_cjs/typeclass/Semigroup/api.cjs +37 -0
  490. package/_cjs/typeclass/Semigroup/api.cjs.map +1 -0
  491. package/_cjs/typeclass/Semigroup/definition.cjs +18 -0
  492. package/_cjs/typeclass/Semigroup/definition.cjs.map +1 -0
  493. package/_cjs/typeclass/Semigroup.cjs +32 -0
  494. package/_cjs/typeclass/Semigroup.cjs.map +1 -0
  495. package/_cjs/typeclass/Semimonoidal.cjs +24 -0
  496. package/_cjs/typeclass/Semimonoidal.cjs.map +1 -0
  497. package/_cjs/typeclass/Showable/definition.cjs +32 -0
  498. package/_cjs/typeclass/Showable/definition.cjs.map +1 -0
  499. package/_cjs/typeclass/Showable/show.cjs +837 -0
  500. package/_cjs/typeclass/Showable/show.cjs.map +1 -0
  501. package/_cjs/typeclass/Showable/styles.cjs +39 -0
  502. package/_cjs/typeclass/Showable/styles.cjs.map +1 -0
  503. package/_cjs/typeclass/Showable/util.cjs +433 -0
  504. package/_cjs/typeclass/Showable/util.cjs.map +1 -0
  505. package/_cjs/typeclass/Showable.cjs +32 -0
  506. package/_cjs/typeclass/Showable.cjs.map +1 -0
  507. package/_cjs/typeclass/Traversable.cjs +54 -0
  508. package/_cjs/typeclass/Traversable.cjs.map +1 -0
  509. package/_cjs/typeclass/TraversableWithIndex.cjs +49 -0
  510. package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -0
  511. package/_cjs/typeclass/Witherable.cjs +68 -0
  512. package/_cjs/typeclass/Witherable.cjs.map +1 -0
  513. package/_cjs/typeclass/WitherableWithIndex.cjs +76 -0
  514. package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -0
  515. package/_cjs/typeclass/builtin/Symbol.cjs +6 -0
  516. package/_cjs/typeclass/builtin/Symbol.cjs.map +1 -0
  517. package/_cjs/typeclass/builtin.cjs +19 -0
  518. package/_cjs/typeclass/builtin.cjs.map +1 -0
  519. package/_cjs/typeclass.cjs +474 -0
  520. package/_cjs/typeclass.cjs.map +1 -0
  521. package/_cjs/types/extractions.cjs +6 -0
  522. package/_cjs/types/extractions.cjs.map +1 -0
  523. package/_cjs/types/test.cjs +6 -0
  524. package/_cjs/types/test.cjs.map +1 -0
  525. package/_cjs/types/utility.cjs +6 -0
  526. package/_cjs/types/utility.cjs.map +1 -0
  527. package/_cjs/types.cjs +45 -0
  528. package/_cjs/types.cjs.map +1 -0
  529. package/_cjs/util/AnsiFormat.cjs +338 -0
  530. package/_cjs/util/AnsiFormat.cjs.map +1 -0
  531. package/_cjs/util/PCGRandom.cjs +177 -0
  532. package/_cjs/util/PCGRandom.cjs.map +1 -0
  533. package/_cjs/util/assert.cjs +24 -0
  534. package/_cjs/util/assert.cjs.map +1 -0
  535. package/_cjs/util/pattern.cjs +23 -0
  536. package/_cjs/util/pattern.cjs.map +1 -0
  537. package/_cjs/util/predicates.cjs +157 -0
  538. package/_cjs/util/predicates.cjs.map +1 -0
  539. package/_cjs/util/rand/Random.cjs +103 -0
  540. package/_cjs/util/rand/Random.cjs.map +1 -0
  541. package/_cjs/util/rand/distribution/Distribution.cjs +6 -0
  542. package/_cjs/util/rand/distribution/Distribution.cjs.map +1 -0
  543. package/_cjs/util/rand/distribution/UniformArrayIntDistribution.cjs +32 -0
  544. package/_cjs/util/rand/distribution/UniformArrayIntDistribution.cjs.map +1 -0
  545. package/_cjs/util/rand/distribution/UniformBigIntDistribution.cjs +50 -0
  546. package/_cjs/util/rand/distribution/UniformBigIntDistribution.cjs.map +1 -0
  547. package/_cjs/util/rand/distribution/UniformIntDistribution.cjs +70 -0
  548. package/_cjs/util/rand/distribution/UniformIntDistribution.cjs.map +1 -0
  549. package/_cjs/util/rand/distribution/internals/ArrayInt.cjs +220 -0
  550. package/_cjs/util/rand/distribution/internals/ArrayInt.cjs.map +1 -0
  551. package/_cjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.cjs +44 -0
  552. package/_cjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.cjs.map +1 -0
  553. package/_cjs/util/rand/distribution/internals/UniformIntDistributionInternal.cjs +56 -0
  554. package/_cjs/util/rand/distribution/internals/UniformIntDistributionInternal.cjs.map +1 -0
  555. package/_cjs/util/rand/generator/MersenneTwister.cjs +115 -0
  556. package/_cjs/util/rand/generator/MersenneTwister.cjs.map +1 -0
  557. package/_cjs/util/rand/generator/RandomGenerator.cjs +23 -0
  558. package/_cjs/util/rand/generator/RandomGenerator.cjs.map +1 -0
  559. package/_cjs/util/rand.cjs +88 -0
  560. package/_cjs/util/rand.cjs.map +1 -0
  561. package/_mjs/collection/Iterable/api/traverseConc.mjs +28 -0
  562. package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -0
  563. package/_mjs/collection/Iterable/api.mjs +784 -0
  564. package/_mjs/collection/Iterable/api.mjs.map +1 -0
  565. package/_mjs/collection/Iterable/constructors.mjs +100 -0
  566. package/_mjs/collection/Iterable/constructors.mjs.map +1 -0
  567. package/_mjs/collection/Iterable/definition.mjs +2 -0
  568. package/_mjs/collection/Iterable/definition.mjs.map +1 -0
  569. package/_mjs/collection/Iterable.mjs +5 -0
  570. package/_mjs/collection/Iterable.mjs.map +1 -0
  571. package/_mjs/collection/compat/Array/api.mjs +56 -0
  572. package/_mjs/collection/compat/Array/api.mjs.map +1 -0
  573. package/_mjs/collection/compat/Array/definition.mjs +2 -0
  574. package/_mjs/collection/compat/Array/definition.mjs.map +1 -0
  575. package/_mjs/collection/compat/Array.mjs +4 -0
  576. package/_mjs/collection/compat/Array.mjs.map +1 -0
  577. package/_mjs/collection/compat/ArrayLike/api.mjs +40 -0
  578. package/_mjs/collection/compat/ArrayLike/api.mjs.map +1 -0
  579. package/_mjs/collection/compat/ArrayLike/definition.mjs +2 -0
  580. package/_mjs/collection/compat/ArrayLike/definition.mjs.map +1 -0
  581. package/_mjs/collection/immutable/Conc/api/empty.mjs +9 -0
  582. package/_mjs/collection/immutable/Conc/api/empty.mjs.map +1 -0
  583. package/_mjs/collection/immutable/Conc/api/makeBy.mjs +22 -0
  584. package/_mjs/collection/immutable/Conc/api/makeBy.mjs.map +1 -0
  585. package/_mjs/collection/immutable/Conc/api/replicate.mjs +9 -0
  586. package/_mjs/collection/immutable/Conc/api/replicate.mjs.map +1 -0
  587. package/_mjs/collection/immutable/Conc/api.mjs +1340 -0
  588. package/_mjs/collection/immutable/Conc/api.mjs.map +1 -0
  589. package/_mjs/collection/immutable/Conc/constructors.mjs +40 -0
  590. package/_mjs/collection/immutable/Conc/constructors.mjs.map +1 -0
  591. package/_mjs/collection/immutable/Conc/definition.mjs +798 -0
  592. package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -0
  593. package/_mjs/collection/immutable/Conc.mjs +10 -0
  594. package/_mjs/collection/immutable/Conc.mjs.map +1 -0
  595. package/_mjs/collection/immutable/Dictionary/api.mjs +62 -0
  596. package/_mjs/collection/immutable/Dictionary/api.mjs.map +1 -0
  597. package/_mjs/collection/immutable/Dictionary/definition.mjs +3 -0
  598. package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -0
  599. package/_mjs/collection/immutable/HashMap/api.mjs +724 -0
  600. package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -0
  601. package/_mjs/collection/immutable/HashMap/definition.mjs +111 -0
  602. package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -0
  603. package/_mjs/collection/immutable/HashMap/internal.mjs +352 -0
  604. package/_mjs/collection/immutable/HashMap/internal.mjs.map +1 -0
  605. package/_mjs/collection/immutable/HashMap.mjs +4 -0
  606. package/_mjs/collection/immutable/HashMap.mjs.map +1 -0
  607. package/_mjs/collection/immutable/HashSet/api.mjs +515 -0
  608. package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -0
  609. package/_mjs/collection/immutable/HashSet/definition.mjs +370 -0
  610. package/_mjs/collection/immutable/HashSet/definition.mjs.map +1 -0
  611. package/_mjs/collection/immutable/HashSet.mjs +4 -0
  612. package/_mjs/collection/immutable/HashSet.mjs.map +1 -0
  613. package/_mjs/collection/immutable/ImmutableArray/api.mjs +1514 -0
  614. package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -0
  615. package/_mjs/collection/immutable/ImmutableArray/constructors.mjs +56 -0
  616. package/_mjs/collection/immutable/ImmutableArray/constructors.mjs.map +1 -0
  617. package/_mjs/collection/immutable/ImmutableArray/definition.mjs +34 -0
  618. package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -0
  619. package/_mjs/collection/immutable/ImmutableArray/instances.mjs +142 -0
  620. package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -0
  621. package/_mjs/collection/immutable/ImmutableArray.mjs +6 -0
  622. package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -0
  623. package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +521 -0
  624. package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -0
  625. package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +76 -0
  626. package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +1 -0
  627. package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +14 -0
  628. package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -0
  629. package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs +52 -0
  630. package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs.map +1 -0
  631. package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +110 -0
  632. package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -0
  633. package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs +7 -0
  634. package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs.map +1 -0
  635. package/_mjs/collection/immutable/List/api/foldLeft.mjs +17 -0
  636. package/_mjs/collection/immutable/List/api/foldLeft.mjs.map +1 -0
  637. package/_mjs/collection/immutable/List/api/unsafeTail.mjs +14 -0
  638. package/_mjs/collection/immutable/List/api/unsafeTail.mjs.map +1 -0
  639. package/_mjs/collection/immutable/List/api.mjs +388 -0
  640. package/_mjs/collection/immutable/List/api.mjs.map +1 -0
  641. package/_mjs/collection/immutable/List/constructors.mjs +71 -0
  642. package/_mjs/collection/immutable/List/constructors.mjs.map +1 -0
  643. package/_mjs/collection/immutable/List/definition.mjs +106 -0
  644. package/_mjs/collection/immutable/List/definition.mjs.map +1 -0
  645. package/_mjs/collection/immutable/List.mjs +9 -0
  646. package/_mjs/collection/immutable/List.mjs.map +1 -0
  647. package/_mjs/collection/immutable/Queue/api.mjs +165 -0
  648. package/_mjs/collection/immutable/Queue/api.mjs.map +1 -0
  649. package/_mjs/collection/immutable/Queue/constructors.mjs +18 -0
  650. package/_mjs/collection/immutable/Queue/constructors.mjs.map +1 -0
  651. package/_mjs/collection/immutable/Queue/definition.mjs +38 -0
  652. package/_mjs/collection/immutable/Queue/definition.mjs.map +1 -0
  653. package/_mjs/collection/immutable/Queue/guards.mjs +9 -0
  654. package/_mjs/collection/immutable/Queue/guards.mjs.map +1 -0
  655. package/_mjs/collection/immutable/Queue.mjs +6 -0
  656. package/_mjs/collection/immutable/Queue.mjs.map +1 -0
  657. package/_mjs/collection/immutable/SortedMap/api.mjs +631 -0
  658. package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -0
  659. package/_mjs/collection/immutable/SortedMap/definition.mjs +18 -0
  660. package/_mjs/collection/immutable/SortedMap/definition.mjs.map +1 -0
  661. package/_mjs/collection/immutable/SortedMap/internal.mjs +515 -0
  662. package/_mjs/collection/immutable/SortedMap/internal.mjs.map +1 -0
  663. package/_mjs/collection/immutable/SortedMap/iterator.mjs +373 -0
  664. package/_mjs/collection/immutable/SortedMap/iterator.mjs.map +1 -0
  665. package/_mjs/collection/immutable/SortedMap/node.mjs +13 -0
  666. package/_mjs/collection/immutable/SortedMap/node.mjs.map +1 -0
  667. package/_mjs/collection/immutable/SortedMap.mjs +7 -0
  668. package/_mjs/collection/immutable/SortedMap.mjs.map +1 -0
  669. package/_mjs/collection/immutable/Vector/api.mjs +1367 -0
  670. package/_mjs/collection/immutable/Vector/api.mjs.map +1 -0
  671. package/_mjs/collection/immutable/Vector/definition.mjs +81 -0
  672. package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -0
  673. package/_mjs/collection/immutable/Vector/internal.mjs +1557 -0
  674. package/_mjs/collection/immutable/Vector/internal.mjs.map +1 -0
  675. package/_mjs/collection/immutable/Vector.mjs +4 -0
  676. package/_mjs/collection/immutable/Vector.mjs.map +1 -0
  677. package/_mjs/collection/mutable/HashMap.mjs +370 -0
  678. package/_mjs/collection/mutable/HashMap.mjs.map +1 -0
  679. package/_mjs/collection/mutable/HashSet.mjs +290 -0
  680. package/_mjs/collection/mutable/HashSet.mjs.map +1 -0
  681. package/_mjs/collection/mutable/ListBuffer.mjs +141 -0
  682. package/_mjs/collection/mutable/ListBuffer.mjs.map +1 -0
  683. package/_mjs/collection/mutable/internal.mjs +26 -0
  684. package/_mjs/collection/mutable/internal.mjs.map +1 -0
  685. package/_mjs/control/Eval/api/sequenceArray.mjs +10 -0
  686. package/_mjs/control/Eval/api/sequenceArray.mjs.map +1 -0
  687. package/_mjs/control/Eval/api.mjs +98 -0
  688. package/_mjs/control/Eval/api.mjs.map +1 -0
  689. package/_mjs/control/Eval/constructors.mjs +35 -0
  690. package/_mjs/control/Eval/constructors.mjs.map +1 -0
  691. package/_mjs/control/Eval/definition.mjs +47 -0
  692. package/_mjs/control/Eval/definition.mjs.map +1 -0
  693. package/_mjs/control/Eval/instance.mjs +33 -0
  694. package/_mjs/control/Eval/instance.mjs.map +1 -0
  695. package/_mjs/control/Eval/run.mjs +60 -0
  696. package/_mjs/control/Eval/run.mjs.map +1 -0
  697. package/_mjs/control/Eval.mjs +7 -0
  698. package/_mjs/control/Eval.mjs.map +1 -0
  699. package/_mjs/control/LazyValue.mjs +27 -0
  700. package/_mjs/control/LazyValue.mjs.map +1 -0
  701. package/_mjs/control/Z/api.mjs +541 -0
  702. package/_mjs/control/Z/api.mjs.map +1 -0
  703. package/_mjs/control/Z/definition.mjs +169 -0
  704. package/_mjs/control/Z/definition.mjs.map +1 -0
  705. package/_mjs/control/Z/instances.mjs +14 -0
  706. package/_mjs/control/Z/instances.mjs.map +1 -0
  707. package/_mjs/control/Z/runtime.mjs +354 -0
  708. package/_mjs/control/Z/runtime.mjs.map +1 -0
  709. package/_mjs/control/Z.mjs +6 -0
  710. package/_mjs/control/Z.mjs.map +1 -0
  711. package/_mjs/data/Byte.mjs +2 -0
  712. package/_mjs/data/Byte.mjs.map +1 -0
  713. package/_mjs/data/CaseClass.mjs +103 -0
  714. package/_mjs/data/CaseClass.mjs.map +1 -0
  715. package/_mjs/data/Cause/api/fold.mjs +174 -0
  716. package/_mjs/data/Cause/api/fold.mjs.map +1 -0
  717. package/_mjs/data/Cause/api/isEmpty.mjs +72 -0
  718. package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -0
  719. package/_mjs/data/Cause/api/linearize.mjs +19 -0
  720. package/_mjs/data/Cause/api/linearize.mjs.map +1 -0
  721. package/_mjs/data/Cause/api/prettyPrint.mjs +37 -0
  722. package/_mjs/data/Cause/api/prettyPrint.mjs.map +1 -0
  723. package/_mjs/data/Cause/api/unified.mjs +150 -0
  724. package/_mjs/data/Cause/api/unified.mjs.map +1 -0
  725. package/_mjs/data/Cause/api.mjs +1200 -0
  726. package/_mjs/data/Cause/api.mjs.map +1 -0
  727. package/_mjs/data/Cause/definition.mjs +612 -0
  728. package/_mjs/data/Cause/definition.mjs.map +1 -0
  729. package/_mjs/data/Cause.mjs +4 -0
  730. package/_mjs/data/Cause.mjs.map +1 -0
  731. package/_mjs/data/Const/api.mjs +17 -0
  732. package/_mjs/data/Const/api.mjs.map +1 -0
  733. package/_mjs/data/Const/definition.mjs +2 -0
  734. package/_mjs/data/Const/definition.mjs.map +1 -0
  735. package/_mjs/data/Const/instances.mjs +32 -0
  736. package/_mjs/data/Const/instances.mjs.map +1 -0
  737. package/_mjs/data/Const.mjs +5 -0
  738. package/_mjs/data/Const.mjs.map +1 -0
  739. package/_mjs/data/Duration/api.mjs +70 -0
  740. package/_mjs/data/Duration/api.mjs.map +1 -0
  741. package/_mjs/data/Duration/definition.mjs +29 -0
  742. package/_mjs/data/Duration/definition.mjs.map +1 -0
  743. package/_mjs/data/Duration.mjs +4 -0
  744. package/_mjs/data/Duration.mjs.map +1 -0
  745. package/_mjs/data/Either/api/align.mjs +6 -0
  746. package/_mjs/data/Either/api/align.mjs.map +1 -0
  747. package/_mjs/data/Either/api/alignWith.mjs +16 -0
  748. package/_mjs/data/Either/api/alignWith.mjs.map +1 -0
  749. package/_mjs/data/Either/api.mjs +211 -0
  750. package/_mjs/data/Either/api.mjs.map +1 -0
  751. package/_mjs/data/Either/constructors.mjs +70 -0
  752. package/_mjs/data/Either/constructors.mjs.map +1 -0
  753. package/_mjs/data/Either/definition.mjs +40 -0
  754. package/_mjs/data/Either/definition.mjs.map +1 -0
  755. package/_mjs/data/Either/destructors.mjs +17 -0
  756. package/_mjs/data/Either/destructors.mjs.map +1 -0
  757. package/_mjs/data/Either/instances.mjs +66 -0
  758. package/_mjs/data/Either/instances.mjs.map +1 -0
  759. package/_mjs/data/Either.mjs +7 -0
  760. package/_mjs/data/Either.mjs.map +1 -0
  761. package/_mjs/data/Environment/api.mjs +87 -0
  762. package/_mjs/data/Environment/api.mjs.map +1 -0
  763. package/_mjs/data/Environment/definition.mjs +38 -0
  764. package/_mjs/data/Environment/definition.mjs.map +1 -0
  765. package/_mjs/data/Environment.mjs +4 -0
  766. package/_mjs/data/Environment.mjs.map +1 -0
  767. package/_mjs/data/ExecutionStrategy.mjs +57 -0
  768. package/_mjs/data/ExecutionStrategy.mjs.map +1 -0
  769. package/_mjs/data/Exit/api.mjs +206 -0
  770. package/_mjs/data/Exit/api.mjs.map +1 -0
  771. package/_mjs/data/Exit/constructors.mjs +65 -0
  772. package/_mjs/data/Exit/constructors.mjs.map +1 -0
  773. package/_mjs/data/Exit/definition.mjs +106 -0
  774. package/_mjs/data/Exit/definition.mjs.map +1 -0
  775. package/_mjs/data/Exit.mjs +5 -0
  776. package/_mjs/data/Exit.mjs.map +1 -0
  777. package/_mjs/data/FiberId/api.mjs +55 -0
  778. package/_mjs/data/FiberId/api.mjs.map +1 -0
  779. package/_mjs/data/FiberId/constructors.mjs +24 -0
  780. package/_mjs/data/FiberId/constructors.mjs.map +1 -0
  781. package/_mjs/data/FiberId/definition.mjs +101 -0
  782. package/_mjs/data/FiberId/definition.mjs.map +1 -0
  783. package/_mjs/data/FiberId.mjs +5 -0
  784. package/_mjs/data/FiberId.mjs.map +1 -0
  785. package/_mjs/data/Identity/api.mjs +29 -0
  786. package/_mjs/data/Identity/api.mjs.map +1 -0
  787. package/_mjs/data/Identity/definition.mjs +2 -0
  788. package/_mjs/data/Identity/definition.mjs.map +1 -0
  789. package/_mjs/data/Identity/instances.mjs +32 -0
  790. package/_mjs/data/Identity/instances.mjs.map +1 -0
  791. package/_mjs/data/Identity.mjs +5 -0
  792. package/_mjs/data/Identity.mjs.map +1 -0
  793. package/_mjs/data/Maybe/api.mjs +206 -0
  794. package/_mjs/data/Maybe/api.mjs.map +1 -0
  795. package/_mjs/data/Maybe/constructors.mjs +92 -0
  796. package/_mjs/data/Maybe/constructors.mjs.map +1 -0
  797. package/_mjs/data/Maybe/definition.mjs +99 -0
  798. package/_mjs/data/Maybe/definition.mjs.map +1 -0
  799. package/_mjs/data/Maybe/destructors.mjs +12 -0
  800. package/_mjs/data/Maybe/destructors.mjs.map +1 -0
  801. package/_mjs/data/Maybe/instances.mjs +42 -0
  802. package/_mjs/data/Maybe/instances.mjs.map +1 -0
  803. package/_mjs/data/Maybe.mjs +7 -0
  804. package/_mjs/data/Maybe.mjs.map +1 -0
  805. package/_mjs/data/Newtype.mjs +11 -0
  806. package/_mjs/data/Newtype.mjs.map +1 -0
  807. package/_mjs/data/Patch/api.mjs +111 -0
  808. package/_mjs/data/Patch/api.mjs.map +1 -0
  809. package/_mjs/data/Patch/definition.mjs +61 -0
  810. package/_mjs/data/Patch/definition.mjs.map +1 -0
  811. package/_mjs/data/Patch.mjs +4 -0
  812. package/_mjs/data/Patch.mjs.map +1 -0
  813. package/_mjs/data/Predicate/api.mjs +28 -0
  814. package/_mjs/data/Predicate/api.mjs.map +1 -0
  815. package/_mjs/data/Predicate/definition.mjs +2 -0
  816. package/_mjs/data/Predicate/definition.mjs.map +1 -0
  817. package/_mjs/data/Predicate.mjs +4 -0
  818. package/_mjs/data/Predicate.mjs.map +1 -0
  819. package/_mjs/data/Refinement/api.mjs +30 -0
  820. package/_mjs/data/Refinement/api.mjs.map +1 -0
  821. package/_mjs/data/Refinement/definition.mjs +2 -0
  822. package/_mjs/data/Refinement/definition.mjs.map +1 -0
  823. package/_mjs/data/Refinement.mjs +4 -0
  824. package/_mjs/data/Refinement.mjs.map +1 -0
  825. package/_mjs/data/Struct/api.mjs +26 -0
  826. package/_mjs/data/Struct/api.mjs.map +1 -0
  827. package/_mjs/data/Struct/definition.mjs +3 -0
  828. package/_mjs/data/Struct/definition.mjs.map +1 -0
  829. package/_mjs/data/Tag/constructors.mjs +9 -0
  830. package/_mjs/data/Tag/constructors.mjs.map +1 -0
  831. package/_mjs/data/Tag/definition.mjs +36 -0
  832. package/_mjs/data/Tag/definition.mjs.map +1 -0
  833. package/_mjs/data/Tag.mjs +4 -0
  834. package/_mjs/data/Tag.mjs.map +1 -0
  835. package/_mjs/data/These/constructors.mjs +26 -0
  836. package/_mjs/data/These/constructors.mjs.map +1 -0
  837. package/_mjs/data/These/definition.mjs +46 -0
  838. package/_mjs/data/These/definition.mjs.map +1 -0
  839. package/_mjs/data/These/destructors.mjs +22 -0
  840. package/_mjs/data/These/destructors.mjs.map +1 -0
  841. package/_mjs/data/These.mjs +5 -0
  842. package/_mjs/data/These.mjs.map +1 -0
  843. package/_mjs/data/Trace/api.mjs +19 -0
  844. package/_mjs/data/Trace/api.mjs.map +1 -0
  845. package/_mjs/data/Trace/constructors.mjs +16 -0
  846. package/_mjs/data/Trace/constructors.mjs.map +1 -0
  847. package/_mjs/data/Trace/definition.mjs +12 -0
  848. package/_mjs/data/Trace/definition.mjs.map +1 -0
  849. package/_mjs/data/Trace.mjs +5 -0
  850. package/_mjs/data/Trace.mjs.map +1 -0
  851. package/_mjs/data/TraceElement/definition.mjs +62 -0
  852. package/_mjs/data/TraceElement/definition.mjs.map +1 -0
  853. package/_mjs/data/TraceElement.mjs +3 -0
  854. package/_mjs/data/TraceElement.mjs.map +1 -0
  855. package/_mjs/data/exceptions/ArrayIndexOutOfBoundsError.mjs +10 -0
  856. package/_mjs/data/exceptions/ArrayIndexOutOfBoundsError.mjs.map +1 -0
  857. package/_mjs/data/exceptions/IllegalArgumentError.mjs +11 -0
  858. package/_mjs/data/exceptions/IllegalArgumentError.mjs.map +1 -0
  859. package/_mjs/data/exceptions/IllegalStateError.mjs +10 -0
  860. package/_mjs/data/exceptions/IllegalStateError.mjs.map +1 -0
  861. package/_mjs/data/exceptions/IndexOutOfBoundsError.mjs +10 -0
  862. package/_mjs/data/exceptions/IndexOutOfBoundsError.mjs.map +1 -0
  863. package/_mjs/data/exceptions/InterruptedException.mjs +13 -0
  864. package/_mjs/data/exceptions/InterruptedException.mjs.map +1 -0
  865. package/_mjs/data/exceptions/InvalidCapacityError.mjs +12 -0
  866. package/_mjs/data/exceptions/InvalidCapacityError.mjs.map +1 -0
  867. package/_mjs/data/exceptions/NoSuchElementError.mjs +10 -0
  868. package/_mjs/data/exceptions/NoSuchElementError.mjs.map +1 -0
  869. package/_mjs/data/exceptions.mjs +9 -0
  870. package/_mjs/data/exceptions.mjs.map +1 -0
  871. package/_mjs/data/function/api.mjs +37 -0
  872. package/_mjs/data/function/api.mjs.map +1 -0
  873. package/_mjs/data/function/definition.mjs +2 -0
  874. package/_mjs/data/function/definition.mjs.map +1 -0
  875. package/_mjs/data/function/pipe.mjs +67 -0
  876. package/_mjs/data/function/pipe.mjs.map +1 -0
  877. package/_mjs/data/function.mjs +5 -0
  878. package/_mjs/data/function.mjs.map +1 -0
  879. package/_mjs/data/number/api.mjs +7 -0
  880. package/_mjs/data/number/api.mjs.map +1 -0
  881. package/_mjs/data/number/definition.mjs +2 -0
  882. package/_mjs/data/number/definition.mjs.map +1 -0
  883. package/_mjs/data/number/instances.mjs +20 -0
  884. package/_mjs/data/number/instances.mjs.map +1 -0
  885. package/_mjs/data/number.mjs +5 -0
  886. package/_mjs/data/number.mjs.map +1 -0
  887. package/_mjs/data/object/definition.mjs +2 -0
  888. package/_mjs/data/object/definition.mjs.map +1 -0
  889. package/_mjs/data/object.mjs +3 -0
  890. package/_mjs/data/object.mjs.map +1 -0
  891. package/_mjs/data/string/api.mjs +192 -0
  892. package/_mjs/data/string/api.mjs.map +1 -0
  893. package/_mjs/data/string/definition.mjs +2 -0
  894. package/_mjs/data/string/definition.mjs.map +1 -0
  895. package/_mjs/data/string/instances.mjs +36 -0
  896. package/_mjs/data/string/instances.mjs.map +1 -0
  897. package/_mjs/data/string.mjs +5 -0
  898. package/_mjs/data/string.mjs.map +1 -0
  899. package/_mjs/global/api.mjs +4 -0
  900. package/_mjs/global/api.mjs.map +1 -0
  901. package/_mjs/internal/AtomicBoolean.mjs +8 -0
  902. package/_mjs/internal/AtomicBoolean.mjs.map +1 -0
  903. package/_mjs/internal/AtomicNumber.mjs +26 -0
  904. package/_mjs/internal/AtomicNumber.mjs.map +1 -0
  905. package/_mjs/internal/AtomicReference.mjs +31 -0
  906. package/_mjs/internal/AtomicReference.mjs.map +1 -0
  907. package/_mjs/internal/Stack.mjs +56 -0
  908. package/_mjs/internal/Stack.mjs.map +1 -0
  909. package/_mjs/optics/At/api.mjs +12 -0
  910. package/_mjs/optics/At/api.mjs.map +1 -0
  911. package/_mjs/optics/At/definition.mjs +19 -0
  912. package/_mjs/optics/At/definition.mjs.map +1 -0
  913. package/_mjs/optics/At.mjs +4 -0
  914. package/_mjs/optics/At.mjs.map +1 -0
  915. package/_mjs/optics/Fold/definition.mjs +12 -0
  916. package/_mjs/optics/Fold/definition.mjs.map +1 -0
  917. package/_mjs/optics/Fold.mjs +3 -0
  918. package/_mjs/optics/Fold.mjs.map +1 -0
  919. package/_mjs/optics/Getter/definition.mjs +13 -0
  920. package/_mjs/optics/Getter/definition.mjs.map +1 -0
  921. package/_mjs/optics/Getter.mjs +3 -0
  922. package/_mjs/optics/Getter.mjs.map +1 -0
  923. package/_mjs/optics/Index/api.mjs +22 -0
  924. package/_mjs/optics/Index/api.mjs.map +1 -0
  925. package/_mjs/optics/Index/definition.mjs +11 -0
  926. package/_mjs/optics/Index/definition.mjs.map +1 -0
  927. package/_mjs/optics/Index.mjs +4 -0
  928. package/_mjs/optics/Index.mjs.map +1 -0
  929. package/_mjs/optics/Iso/api.mjs +13 -0
  930. package/_mjs/optics/Iso/api.mjs.map +1 -0
  931. package/_mjs/optics/Iso/definition.mjs +34 -0
  932. package/_mjs/optics/Iso/definition.mjs.map +1 -0
  933. package/_mjs/optics/Iso.mjs +4 -0
  934. package/_mjs/optics/Iso.mjs.map +1 -0
  935. package/_mjs/optics/Lens/api.mjs +140 -0
  936. package/_mjs/optics/Lens/api.mjs.map +1 -0
  937. package/_mjs/optics/Lens/definition.mjs +29 -0
  938. package/_mjs/optics/Lens/definition.mjs.map +1 -0
  939. package/_mjs/optics/Lens.mjs +4 -0
  940. package/_mjs/optics/Lens.mjs.map +1 -0
  941. package/_mjs/optics/Optional/api/compose.mjs +14 -0
  942. package/_mjs/optics/Optional/api/compose.mjs.map +1 -0
  943. package/_mjs/optics/Optional/definition.mjs +35 -0
  944. package/_mjs/optics/Optional/definition.mjs.map +1 -0
  945. package/_mjs/optics/Optional.mjs +6 -0
  946. package/_mjs/optics/Optional.mjs.map +1 -0
  947. package/_mjs/optics/Prism/api/compose.mjs +15 -0
  948. package/_mjs/optics/Prism/api/compose.mjs.map +1 -0
  949. package/_mjs/optics/Prism/api/fromNullable.mjs +14 -0
  950. package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -0
  951. package/_mjs/optics/Prism/api/just.mjs +15 -0
  952. package/_mjs/optics/Prism/api/just.mjs.map +1 -0
  953. package/_mjs/optics/Prism/definition.mjs +28 -0
  954. package/_mjs/optics/Prism/definition.mjs.map +1 -0
  955. package/_mjs/optics/Prism.mjs +8 -0
  956. package/_mjs/optics/Prism.mjs.map +1 -0
  957. package/_mjs/optics/Setter/definition.mjs +23 -0
  958. package/_mjs/optics/Setter/definition.mjs.map +1 -0
  959. package/_mjs/optics/Setter.mjs +3 -0
  960. package/_mjs/optics/Setter.mjs.map +1 -0
  961. package/_mjs/optics/Traversal/api/compose.mjs +11 -0
  962. package/_mjs/optics/Traversal/api/compose.mjs.map +1 -0
  963. package/_mjs/optics/Traversal/api/fromTraversable.mjs +10 -0
  964. package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -0
  965. package/_mjs/optics/Traversal/definition.mjs +33 -0
  966. package/_mjs/optics/Traversal/definition.mjs.map +1 -0
  967. package/_mjs/optics/Traversal.mjs +7 -0
  968. package/_mjs/optics/Traversal.mjs.map +1 -0
  969. package/_mjs/typeclass/Align.mjs +13 -0
  970. package/_mjs/typeclass/Align.mjs.map +1 -0
  971. package/_mjs/typeclass/Alt.mjs +10 -0
  972. package/_mjs/typeclass/Alt.mjs.map +1 -0
  973. package/_mjs/typeclass/Alternative.mjs +15 -0
  974. package/_mjs/typeclass/Alternative.mjs.map +1 -0
  975. package/_mjs/typeclass/Applicative.mjs +14 -0
  976. package/_mjs/typeclass/Applicative.mjs.map +1 -0
  977. package/_mjs/typeclass/ApplicativeExcept.mjs +33 -0
  978. package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -0
  979. package/_mjs/typeclass/Apply.mjs +114 -0
  980. package/_mjs/typeclass/Apply.mjs.map +1 -0
  981. package/_mjs/typeclass/Chain.mjs +18 -0
  982. package/_mjs/typeclass/Chain.mjs.map +1 -0
  983. package/_mjs/typeclass/Closure.mjs +12 -0
  984. package/_mjs/typeclass/Closure.mjs.map +1 -0
  985. package/_mjs/typeclass/Eq.mjs +12 -0
  986. package/_mjs/typeclass/Eq.mjs.map +1 -0
  987. package/_mjs/typeclass/Equatable/api.mjs +31 -0
  988. package/_mjs/typeclass/Equatable/api.mjs.map +1 -0
  989. package/_mjs/typeclass/Equatable/definition.mjs +12 -0
  990. package/_mjs/typeclass/Equatable/definition.mjs.map +1 -0
  991. package/_mjs/typeclass/Equatable/fast-equals.mjs +476 -0
  992. package/_mjs/typeclass/Equatable/fast-equals.mjs.map +1 -0
  993. package/_mjs/typeclass/Equatable.mjs +5 -0
  994. package/_mjs/typeclass/Equatable.mjs.map +1 -0
  995. package/_mjs/typeclass/Fail.mjs +11 -0
  996. package/_mjs/typeclass/Fail.mjs.map +1 -0
  997. package/_mjs/typeclass/Filterable.mjs +16 -0
  998. package/_mjs/typeclass/Filterable.mjs.map +1 -0
  999. package/_mjs/typeclass/FilterableWithIndex.mjs +18 -0
  1000. package/_mjs/typeclass/FilterableWithIndex.mjs.map +1 -0
  1001. package/_mjs/typeclass/Foldable.mjs +19 -0
  1002. package/_mjs/typeclass/Foldable.mjs.map +1 -0
  1003. package/_mjs/typeclass/FoldableWithIndex.mjs +20 -0
  1004. package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -0
  1005. package/_mjs/typeclass/Functor.mjs +15 -0
  1006. package/_mjs/typeclass/Functor.mjs.map +1 -0
  1007. package/_mjs/typeclass/FunctorWithIndex.mjs +14 -0
  1008. package/_mjs/typeclass/FunctorWithIndex.mjs.map +1 -0
  1009. package/_mjs/typeclass/Has.mjs +10 -0
  1010. package/_mjs/typeclass/Has.mjs.map +1 -0
  1011. package/_mjs/typeclass/Hash.mjs +9 -0
  1012. package/_mjs/typeclass/Hash.mjs.map +1 -0
  1013. package/_mjs/typeclass/HashEq.mjs +32 -0
  1014. package/_mjs/typeclass/HashEq.mjs.map +1 -0
  1015. package/_mjs/typeclass/Hashable/definition.mjs +12 -0
  1016. package/_mjs/typeclass/Hashable/definition.mjs.map +1 -0
  1017. package/_mjs/typeclass/Hashable/hash.mjs +242 -0
  1018. package/_mjs/typeclass/Hashable/hash.mjs.map +1 -0
  1019. package/_mjs/typeclass/Hashable.mjs +4 -0
  1020. package/_mjs/typeclass/Hashable.mjs.map +1 -0
  1021. package/_mjs/typeclass/Monad.mjs +14 -0
  1022. package/_mjs/typeclass/Monad.mjs.map +1 -0
  1023. package/_mjs/typeclass/MonadExcept.mjs +17 -0
  1024. package/_mjs/typeclass/MonadExcept.mjs.map +1 -0
  1025. package/_mjs/typeclass/Monoid.mjs +12 -0
  1026. package/_mjs/typeclass/Monoid.mjs.map +1 -0
  1027. package/_mjs/typeclass/Nil.mjs +2 -0
  1028. package/_mjs/typeclass/Nil.mjs.map +1 -0
  1029. package/_mjs/typeclass/Ord/api/contramap.mjs +12 -0
  1030. package/_mjs/typeclass/Ord/api/contramap.mjs.map +1 -0
  1031. package/_mjs/typeclass/Ord/api/max.mjs +8 -0
  1032. package/_mjs/typeclass/Ord/api/max.mjs.map +1 -0
  1033. package/_mjs/typeclass/Ord/api/min.mjs +8 -0
  1034. package/_mjs/typeclass/Ord/api/min.mjs.map +1 -0
  1035. package/_mjs/typeclass/Ord/api.mjs +5 -0
  1036. package/_mjs/typeclass/Ord/api.mjs.map +1 -0
  1037. package/_mjs/typeclass/Ord/definition.mjs +13 -0
  1038. package/_mjs/typeclass/Ord/definition.mjs.map +1 -0
  1039. package/_mjs/typeclass/Ord/instances.mjs +34 -0
  1040. package/_mjs/typeclass/Ord/instances.mjs.map +1 -0
  1041. package/_mjs/typeclass/Ord.mjs +5 -0
  1042. package/_mjs/typeclass/Ord.mjs.map +1 -0
  1043. package/_mjs/typeclass/Ordering.mjs +42 -0
  1044. package/_mjs/typeclass/Ordering.mjs.map +1 -0
  1045. package/_mjs/typeclass/Pointed.mjs +10 -0
  1046. package/_mjs/typeclass/Pointed.mjs.map +1 -0
  1047. package/_mjs/typeclass/Semialign.mjs +84 -0
  1048. package/_mjs/typeclass/Semialign.mjs.map +1 -0
  1049. package/_mjs/typeclass/Semigroup/api.mjs +22 -0
  1050. package/_mjs/typeclass/Semigroup/api.mjs.map +1 -0
  1051. package/_mjs/typeclass/Semigroup/definition.mjs +8 -0
  1052. package/_mjs/typeclass/Semigroup/definition.mjs.map +1 -0
  1053. package/_mjs/typeclass/Semigroup.mjs +4 -0
  1054. package/_mjs/typeclass/Semigroup.mjs.map +1 -0
  1055. package/_mjs/typeclass/Semimonoidal.mjs +9 -0
  1056. package/_mjs/typeclass/Semimonoidal.mjs.map +1 -0
  1057. package/_mjs/typeclass/Showable/definition.mjs +13 -0
  1058. package/_mjs/typeclass/Showable/definition.mjs.map +1 -0
  1059. package/_mjs/typeclass/Showable/show.mjs +796 -0
  1060. package/_mjs/typeclass/Showable/show.mjs.map +1 -0
  1061. package/_mjs/typeclass/Showable/styles.mjs +22 -0
  1062. package/_mjs/typeclass/Showable/styles.mjs.map +1 -0
  1063. package/_mjs/typeclass/Showable/util.mjs +368 -0
  1064. package/_mjs/typeclass/Showable/util.mjs.map +1 -0
  1065. package/_mjs/typeclass/Showable.mjs +3 -0
  1066. package/_mjs/typeclass/Showable.mjs.map +1 -0
  1067. package/_mjs/typeclass/Traversable.mjs +32 -0
  1068. package/_mjs/typeclass/Traversable.mjs.map +1 -0
  1069. package/_mjs/typeclass/TraversableWithIndex.mjs +27 -0
  1070. package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -0
  1071. package/_mjs/typeclass/Witherable.mjs +40 -0
  1072. package/_mjs/typeclass/Witherable.mjs.map +1 -0
  1073. package/_mjs/typeclass/WitherableWithIndex.mjs +45 -0
  1074. package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -0
  1075. package/_mjs/typeclass/builtin/Symbol.mjs +2 -0
  1076. package/_mjs/typeclass/builtin/Symbol.mjs.map +1 -0
  1077. package/_mjs/typeclass/builtin.mjs +3 -0
  1078. package/_mjs/typeclass/builtin.mjs.map +1 -0
  1079. package/_mjs/typeclass.mjs +38 -0
  1080. package/_mjs/typeclass.mjs.map +1 -0
  1081. package/_mjs/types/extractions.mjs +2 -0
  1082. package/_mjs/types/extractions.mjs.map +1 -0
  1083. package/_mjs/types/test.mjs +2 -0
  1084. package/_mjs/types/test.mjs.map +1 -0
  1085. package/_mjs/types/utility.mjs +2 -0
  1086. package/_mjs/types/utility.mjs.map +1 -0
  1087. package/_mjs/types.mjs +5 -0
  1088. package/_mjs/types.mjs.map +1 -0
  1089. package/_mjs/util/AnsiFormat.mjs +244 -0
  1090. package/_mjs/util/AnsiFormat.mjs.map +1 -0
  1091. package/_mjs/util/PCGRandom.mjs +166 -0
  1092. package/_mjs/util/PCGRandom.mjs.map +1 -0
  1093. package/_mjs/util/assert.mjs +13 -0
  1094. package/_mjs/util/assert.mjs.map +1 -0
  1095. package/_mjs/util/pattern.mjs +9 -0
  1096. package/_mjs/util/pattern.mjs.map +1 -0
  1097. package/_mjs/util/predicates.mjs +93 -0
  1098. package/_mjs/util/predicates.mjs.map +1 -0
  1099. package/_mjs/util/rand/Random.mjs +92 -0
  1100. package/_mjs/util/rand/Random.mjs.map +1 -0
  1101. package/_mjs/util/rand/distribution/Distribution.mjs +2 -0
  1102. package/_mjs/util/rand/distribution/Distribution.mjs.map +1 -0
  1103. package/_mjs/util/rand/distribution/UniformArrayIntDistribution.mjs +26 -0
  1104. package/_mjs/util/rand/distribution/UniformArrayIntDistribution.mjs.map +1 -0
  1105. package/_mjs/util/rand/distribution/UniformBigIntDistribution.mjs +45 -0
  1106. package/_mjs/util/rand/distribution/UniformBigIntDistribution.mjs.map +1 -0
  1107. package/_mjs/util/rand/distribution/UniformIntDistribution.mjs +62 -0
  1108. package/_mjs/util/rand/distribution/UniformIntDistribution.mjs.map +1 -0
  1109. package/_mjs/util/rand/distribution/internals/ArrayInt.mjs +203 -0
  1110. package/_mjs/util/rand/distribution/internals/ArrayInt.mjs.map +1 -0
  1111. package/_mjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.mjs +37 -0
  1112. package/_mjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.mjs.map +1 -0
  1113. package/_mjs/util/rand/distribution/internals/UniformIntDistributionInternal.mjs +49 -0
  1114. package/_mjs/util/rand/distribution/internals/UniformIntDistributionInternal.mjs.map +1 -0
  1115. package/_mjs/util/rand/generator/MersenneTwister.mjs +106 -0
  1116. package/_mjs/util/rand/generator/MersenneTwister.mjs.map +1 -0
  1117. package/_mjs/util/rand/generator/RandomGenerator.mjs +17 -0
  1118. package/_mjs/util/rand/generator/RandomGenerator.mjs.map +1 -0
  1119. package/_mjs/util/rand.mjs +9 -0
  1120. package/_mjs/util/rand.mjs.map +1 -0
  1121. package/_src/collection/Iterable/api/traverseConc.ts +40 -0
  1122. package/_src/collection/Iterable/api.ts +690 -0
  1123. package/_src/collection/Iterable/constructors.ts +73 -0
  1124. package/_src/collection/Iterable/definition.ts +15 -0
  1125. package/_src/collection/Iterable.ts +5 -0
  1126. package/_src/collection/compat/Array/api.ts +53 -0
  1127. package/_src/collection/compat/Array/definition.ts +21 -0
  1128. package/_src/collection/compat/Array.ts +4 -0
  1129. package/_src/collection/compat/ArrayLike/api.ts +26 -0
  1130. package/_src/collection/compat/ArrayLike/definition.ts +11 -0
  1131. package/_src/collection/immutable/Conc/api/empty.ts +8 -0
  1132. package/_src/collection/immutable/Conc/api/makeBy.ts +16 -0
  1133. package/_src/collection/immutable/Conc/api/replicate.ts +6 -0
  1134. package/_src/collection/immutable/Conc/api.ts +1146 -0
  1135. package/_src/collection/immutable/Conc/constructors.ts +38 -0
  1136. package/_src/collection/immutable/Conc/definition.ts +785 -0
  1137. package/_src/collection/immutable/Conc.ts +11 -0
  1138. package/_src/collection/immutable/Dictionary/api.ts +49 -0
  1139. package/_src/collection/immutable/Dictionary/definition.ts +21 -0
  1140. package/_src/collection/immutable/HashMap/api.ts +731 -0
  1141. package/_src/collection/immutable/HashMap/definition.ts +128 -0
  1142. package/_src/collection/immutable/HashMap/internal.ts +380 -0
  1143. package/_src/collection/immutable/HashMap.ts +4 -0
  1144. package/_src/collection/immutable/HashSet/api.ts +481 -0
  1145. package/_src/collection/immutable/HashSet/definition.ts +402 -0
  1146. package/_src/collection/immutable/HashSet.ts +4 -0
  1147. package/_src/collection/immutable/ImmutableArray/api.ts +1519 -0
  1148. package/_src/collection/immutable/ImmutableArray/constructors.ts +47 -0
  1149. package/_src/collection/immutable/ImmutableArray/definition.ts +39 -0
  1150. package/_src/collection/immutable/ImmutableArray/instances.ts +168 -0
  1151. package/_src/collection/immutable/ImmutableArray.ts +6 -0
  1152. package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +513 -0
  1153. package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +66 -0
  1154. package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +31 -0
  1155. package/_src/collection/immutable/ImmutableNonEmptyArray/destructors.ts +41 -0
  1156. package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +115 -0
  1157. package/_src/collection/immutable/ImmutableNonEmptyArray.ts +7 -0
  1158. package/_src/collection/immutable/List/api/foldLeft.ts +12 -0
  1159. package/_src/collection/immutable/List/api/unsafeTail.ts +9 -0
  1160. package/_src/collection/immutable/List/api.ts +354 -0
  1161. package/_src/collection/immutable/List/constructors.ts +64 -0
  1162. package/_src/collection/immutable/List/definition.ts +91 -0
  1163. package/_src/collection/immutable/List.ts +10 -0
  1164. package/_src/collection/immutable/Queue/api.ts +142 -0
  1165. package/_src/collection/immutable/Queue/constructors.ts +16 -0
  1166. package/_src/collection/immutable/Queue/definition.ts +34 -0
  1167. package/_src/collection/immutable/Queue/guards.ts +8 -0
  1168. package/_src/collection/immutable/Queue.ts +6 -0
  1169. package/_src/collection/immutable/SortedMap/api.ts +540 -0
  1170. package/_src/collection/immutable/SortedMap/definition.ts +17 -0
  1171. package/_src/collection/immutable/SortedMap/internal.ts +358 -0
  1172. package/_src/collection/immutable/SortedMap/iterator.ts +304 -0
  1173. package/_src/collection/immutable/SortedMap/node.ts +21 -0
  1174. package/_src/collection/immutable/SortedMap.ts +7 -0
  1175. package/_src/collection/immutable/Vector/api.ts +1335 -0
  1176. package/_src/collection/immutable/Vector/definition.ts +96 -0
  1177. package/_src/collection/immutable/Vector/internal.ts +1438 -0
  1178. package/_src/collection/immutable/Vector.ts +4 -0
  1179. package/_src/collection/mutable/HashMap.ts +338 -0
  1180. package/_src/collection/mutable/HashSet.ts +254 -0
  1181. package/_src/collection/mutable/ListBuffer.ts +123 -0
  1182. package/_src/collection/mutable/internal.ts +26 -0
  1183. package/_src/control/Eval/api/sequenceArray.ts +6 -0
  1184. package/_src/control/Eval/api.ts +93 -0
  1185. package/_src/control/Eval/constructors.ts +30 -0
  1186. package/_src/control/Eval/definition.ts +67 -0
  1187. package/_src/control/Eval/instance.ts +31 -0
  1188. package/_src/control/Eval/run.ts +41 -0
  1189. package/_src/control/Eval.ts +7 -0
  1190. package/_src/control/LazyValue.ts +24 -0
  1191. package/_src/control/Z/api.ts +619 -0
  1192. package/_src/control/Z/definition.ts +189 -0
  1193. package/_src/control/Z/instances.ts +14 -0
  1194. package/_src/control/Z/runtime.ts +291 -0
  1195. package/_src/control/Z.ts +6 -0
  1196. package/_src/data/Byte.ts +1 -0
  1197. package/_src/data/CaseClass.ts +112 -0
  1198. package/_src/data/Cause/api/fold.ts +104 -0
  1199. package/_src/data/Cause/api/isEmpty.ts +46 -0
  1200. package/_src/data/Cause/api/linearize.ts +16 -0
  1201. package/_src/data/Cause/api/prettyPrint.ts +38 -0
  1202. package/_src/data/Cause/api/unified.ts +67 -0
  1203. package/_src/data/Cause/api.ts +984 -0
  1204. package/_src/data/Cause/definition.ts +521 -0
  1205. package/_src/data/Cause.ts +4 -0
  1206. package/_src/data/Const/api.ts +16 -0
  1207. package/_src/data/Const/definition.ts +11 -0
  1208. package/_src/data/Const/instances.ts +34 -0
  1209. package/_src/data/Const.ts +5 -0
  1210. package/_src/data/Duration/api.ts +69 -0
  1211. package/_src/data/Duration/definition.ts +25 -0
  1212. package/_src/data/Duration.ts +4 -0
  1213. package/_src/data/Either/api/align.ts +8 -0
  1214. package/_src/data/Either/api/alignWith.ts +21 -0
  1215. package/_src/data/Either/api.ts +200 -0
  1216. package/_src/data/Either/constructors.ts +77 -0
  1217. package/_src/data/Either/definition.ts +48 -0
  1218. package/_src/data/Either/destructors.ts +13 -0
  1219. package/_src/data/Either/instances.ts +80 -0
  1220. package/_src/data/Either.ts +7 -0
  1221. package/_src/data/Environment/api.ts +78 -0
  1222. package/_src/data/Environment/definition.ts +32 -0
  1223. package/_src/data/Environment.ts +4 -0
  1224. package/_src/data/ExecutionStrategy.ts +81 -0
  1225. package/_src/data/Exit/api.ts +172 -0
  1226. package/_src/data/Exit/constructors.ts +55 -0
  1227. package/_src/data/Exit/definition.ts +102 -0
  1228. package/_src/data/Exit.ts +5 -0
  1229. package/_src/data/FiberId/api.ts +45 -0
  1230. package/_src/data/FiberId/constructors.ts +21 -0
  1231. package/_src/data/FiberId/definition.ts +91 -0
  1232. package/_src/data/FiberId.ts +5 -0
  1233. package/_src/data/Identity/api.ts +28 -0
  1234. package/_src/data/Identity/definition.ts +11 -0
  1235. package/_src/data/Identity/instances.ts +21 -0
  1236. package/_src/data/Identity.ts +5 -0
  1237. package/_src/data/Maybe/api.ts +187 -0
  1238. package/_src/data/Maybe/constructors.ts +84 -0
  1239. package/_src/data/Maybe/definition.ts +91 -0
  1240. package/_src/data/Maybe/destructors.ts +11 -0
  1241. package/_src/data/Maybe/instances.ts +53 -0
  1242. package/_src/data/Maybe.ts +7 -0
  1243. package/_src/data/Newtype.ts +66 -0
  1244. package/_src/data/Patch/api.ts +75 -0
  1245. package/_src/data/Patch/definition.ts +58 -0
  1246. package/_src/data/Patch.ts +4 -0
  1247. package/_src/data/Predicate/api.ts +27 -0
  1248. package/_src/data/Predicate/definition.ts +10 -0
  1249. package/_src/data/Predicate.ts +4 -0
  1250. package/_src/data/Refinement/api.ts +29 -0
  1251. package/_src/data/Refinement/definition.ts +13 -0
  1252. package/_src/data/Refinement.ts +4 -0
  1253. package/_src/data/Struct/api.ts +22 -0
  1254. package/_src/data/Struct/definition.ts +23 -0
  1255. package/_src/data/Tag/constructors.ts +6 -0
  1256. package/_src/data/Tag/definition.ts +31 -0
  1257. package/_src/data/Tag.ts +4 -0
  1258. package/_src/data/These/constructors.ts +25 -0
  1259. package/_src/data/These/definition.ts +47 -0
  1260. package/_src/data/These/destructors.ts +20 -0
  1261. package/_src/data/These.ts +5 -0
  1262. package/_src/data/Trace/api.ts +13 -0
  1263. package/_src/data/Trace/constructors.ts +13 -0
  1264. package/_src/data/Trace/definition.ts +9 -0
  1265. package/_src/data/Trace.ts +5 -0
  1266. package/_src/data/TraceElement/definition.ts +69 -0
  1267. package/_src/data/TraceElement.ts +3 -0
  1268. package/_src/data/exceptions/ArrayIndexOutOfBoundsError.ts +9 -0
  1269. package/_src/data/exceptions/IllegalArgumentError.ts +9 -0
  1270. package/_src/data/exceptions/IllegalStateError.ts +9 -0
  1271. package/_src/data/exceptions/IndexOutOfBoundsError.ts +9 -0
  1272. package/_src/data/exceptions/InterruptedException.ts +13 -0
  1273. package/_src/data/exceptions/InvalidCapacityError.ts +12 -0
  1274. package/_src/data/exceptions/NoSuchElementError.ts +9 -0
  1275. package/_src/data/exceptions.ts +9 -0
  1276. package/_src/data/function/api.ts +39 -0
  1277. package/_src/data/function/definition.ts +31 -0
  1278. package/_src/data/function/pipe.ts +301 -0
  1279. package/_src/data/function.ts +5 -0
  1280. package/_src/data/number/api.ts +6 -0
  1281. package/_src/data/number/definition.ts +13 -0
  1282. package/_src/data/number/instances.ts +15 -0
  1283. package/_src/data/number.ts +5 -0
  1284. package/_src/data/object/definition.ts +12 -0
  1285. package/_src/data/object.ts +3 -0
  1286. package/_src/data/string/api.ts +182 -0
  1287. package/_src/data/string/definition.ts +13 -0
  1288. package/_src/data/string/instances.ts +24 -0
  1289. package/_src/data/string.ts +5 -0
  1290. package/_src/global/api.ts +23 -0
  1291. package/_src/internal/AtomicBoolean.ts +7 -0
  1292. package/_src/internal/AtomicNumber.ts +28 -0
  1293. package/_src/internal/AtomicReference.ts +28 -0
  1294. package/_src/internal/Stack.ts +52 -0
  1295. package/_src/optics/At/api.ts +10 -0
  1296. package/_src/optics/At/definition.ts +32 -0
  1297. package/_src/optics/At.ts +4 -0
  1298. package/_src/optics/Fold/definition.ts +38 -0
  1299. package/_src/optics/Fold.ts +3 -0
  1300. package/_src/optics/Getter/definition.ts +34 -0
  1301. package/_src/optics/Getter.ts +3 -0
  1302. package/_src/optics/Index/api.ts +19 -0
  1303. package/_src/optics/Index/definition.ts +24 -0
  1304. package/_src/optics/Index.ts +4 -0
  1305. package/_src/optics/Iso/api.ts +11 -0
  1306. package/_src/optics/Iso/definition.ts +52 -0
  1307. package/_src/optics/Iso.ts +4 -0
  1308. package/_src/optics/Lens/api.ts +132 -0
  1309. package/_src/optics/Lens/definition.ts +51 -0
  1310. package/_src/optics/Lens.ts +4 -0
  1311. package/_src/optics/Optional/api/compose.ts +15 -0
  1312. package/_src/optics/Optional/definition.ts +90 -0
  1313. package/_src/optics/Optional.ts +7 -0
  1314. package/_src/optics/Prism/api/compose.ts +12 -0
  1315. package/_src/optics/Prism/api/fromNullable.ts +12 -0
  1316. package/_src/optics/Prism/api/just.ts +11 -0
  1317. package/_src/optics/Prism/definition.ts +59 -0
  1318. package/_src/optics/Prism.ts +9 -0
  1319. package/_src/optics/Setter/definition.ts +66 -0
  1320. package/_src/optics/Setter.ts +3 -0
  1321. package/_src/optics/Traversal/api/compose.ts +13 -0
  1322. package/_src/optics/Traversal/api/fromTraversable.ts +50 -0
  1323. package/_src/optics/Traversal/definition.ts +73 -0
  1324. package/_src/optics/Traversal.ts +8 -0
  1325. package/_src/typeclass/Align.ts +28 -0
  1326. package/_src/typeclass/Alt.ts +105 -0
  1327. package/_src/typeclass/Alternative.ts +31 -0
  1328. package/_src/typeclass/Applicative.ts +31 -0
  1329. package/_src/typeclass/ApplicativeExcept.ts +226 -0
  1330. package/_src/typeclass/Apply.ts +634 -0
  1331. package/_src/typeclass/Chain.ts +226 -0
  1332. package/_src/typeclass/Closure.ts +36 -0
  1333. package/_src/typeclass/Eq.ts +36 -0
  1334. package/_src/typeclass/Equatable/api.ts +34 -0
  1335. package/_src/typeclass/Equatable/definition.ts +22 -0
  1336. package/_src/typeclass/Equatable/fast-equals.ts +498 -0
  1337. package/_src/typeclass/Equatable.ts +5 -0
  1338. package/_src/typeclass/Fail.ts +40 -0
  1339. package/_src/typeclass/Filterable.ts +139 -0
  1340. package/_src/typeclass/FilterableWithIndex.ts +143 -0
  1341. package/_src/typeclass/Foldable.ts +73 -0
  1342. package/_src/typeclass/FoldableWithIndex.ts +96 -0
  1343. package/_src/typeclass/Functor.ts +76 -0
  1344. package/_src/typeclass/FunctorWithIndex.ts +43 -0
  1345. package/_src/typeclass/Has.ts +19 -0
  1346. package/_src/typeclass/Hash.ts +17 -0
  1347. package/_src/typeclass/HashEq.ts +44 -0
  1348. package/_src/typeclass/Hashable/definition.ts +22 -0
  1349. package/_src/typeclass/Hashable/hash.ts +208 -0
  1350. package/_src/typeclass/Hashable.ts +4 -0
  1351. package/_src/typeclass/Monad.ts +26 -0
  1352. package/_src/typeclass/MonadExcept.ts +47 -0
  1353. package/_src/typeclass/Monoid.ts +31 -0
  1354. package/_src/typeclass/Nil.ts +23 -0
  1355. package/_src/typeclass/Ord/api/contramap.ts +13 -0
  1356. package/_src/typeclass/Ord/api/max.ts +9 -0
  1357. package/_src/typeclass/Ord/api/min.ts +9 -0
  1358. package/_src/typeclass/Ord/api.ts +5 -0
  1359. package/_src/typeclass/Ord/definition.ts +43 -0
  1360. package/_src/typeclass/Ord/instances.ts +30 -0
  1361. package/_src/typeclass/Ord.ts +5 -0
  1362. package/_src/typeclass/Ordering.ts +42 -0
  1363. package/_src/typeclass/Pointed.ts +37 -0
  1364. package/_src/typeclass/Semialign.ts +551 -0
  1365. package/_src/typeclass/Semigroup/api.ts +21 -0
  1366. package/_src/typeclass/Semigroup/definition.ts +24 -0
  1367. package/_src/typeclass/Semigroup.ts +4 -0
  1368. package/_src/typeclass/Semimonoidal.ts +97 -0
  1369. package/_src/typeclass/Showable/definition.ts +23 -0
  1370. package/_src/typeclass/Showable/show.ts +914 -0
  1371. package/_src/typeclass/Showable/styles.ts +57 -0
  1372. package/_src/typeclass/Showable/util.ts +385 -0
  1373. package/_src/typeclass/Showable.ts +2 -0
  1374. package/_src/typeclass/Traversable.ts +177 -0
  1375. package/_src/typeclass/TraversableWithIndex.ts +142 -0
  1376. package/_src/typeclass/Witherable.ts +303 -0
  1377. package/_src/typeclass/WitherableWithIndex.ts +359 -0
  1378. package/_src/typeclass/builtin/Symbol.ts +8 -0
  1379. package/_src/typeclass/builtin.ts +3 -0
  1380. package/_src/typeclass.ts +38 -0
  1381. package/_src/types/extractions.ts +11 -0
  1382. package/_src/types/test.ts +0 -0
  1383. package/_src/types/utility.ts +9 -0
  1384. package/_src/types.ts +5 -0
  1385. package/_src/util/AnsiFormat.ts +259 -0
  1386. package/_src/util/PCGRandom.ts +191 -0
  1387. package/_src/util/assert.ts +11 -0
  1388. package/_src/util/pattern.ts +35 -0
  1389. package/_src/util/predicates.ts +144 -0
  1390. package/_src/util/rand/Random.ts +100 -0
  1391. package/_src/util/rand/distribution/Distribution.ts +10 -0
  1392. package/_src/util/rand/distribution/UniformArrayIntDistribution.ts +49 -0
  1393. package/_src/util/rand/distribution/UniformBigIntDistribution.ts +62 -0
  1394. package/_src/util/rand/distribution/UniformIntDistribution.ts +75 -0
  1395. package/_src/util/rand/distribution/internals/ArrayInt.ts +200 -0
  1396. package/_src/util/rand/distribution/internals/UniformArrayIntDistributionInternal.ts +43 -0
  1397. package/_src/util/rand/distribution/internals/UniformIntDistributionInternal.ts +47 -0
  1398. package/_src/util/rand/generator/MersenneTwister.ts +160 -0
  1399. package/_src/util/rand/generator/RandomGenerator.ts +22 -0
  1400. package/_src/util/rand.ts +20 -0
  1401. package/collection/Iterable/api/traverseConc.d.ts +13 -0
  1402. package/collection/Iterable/api.d.ts +172 -0
  1403. package/collection/Iterable/constructors.d.ts +25 -0
  1404. package/collection/Iterable/definition.d.ts +14 -0
  1405. package/collection/Iterable.d.ts +3 -0
  1406. package/collection/compat/Array/api.d.ts +32 -0
  1407. package/collection/compat/Array/definition.d.ts +20 -0
  1408. package/collection/compat/Array.d.ts +2 -0
  1409. package/collection/compat/ArrayLike/api.d.ts +5 -0
  1410. package/collection/compat/ArrayLike/definition.d.ts +13 -0
  1411. package/collection/immutable/Conc/api/empty.d.ts +6 -0
  1412. package/collection/immutable/Conc/api/makeBy.d.ts +7 -0
  1413. package/collection/immutable/Conc/api/replicate.d.ts +6 -0
  1414. package/collection/immutable/Conc/api.d.ts +368 -0
  1415. package/collection/immutable/Conc/constructors.d.ts +27 -0
  1416. package/collection/immutable/Conc/definition.d.ts +213 -0
  1417. package/collection/immutable/Conc.d.ts +6 -0
  1418. package/collection/immutable/Dictionary/api.d.ts +27 -0
  1419. package/collection/immutable/Dictionary/definition.d.ts +19 -0
  1420. package/collection/immutable/HashMap/api.d.ts +336 -0
  1421. package/collection/immutable/HashMap/definition.d.ts +44 -0
  1422. package/collection/immutable/HashMap/internal.d.ts +67 -0
  1423. package/collection/immutable/HashMap.d.ts +2 -0
  1424. package/collection/immutable/HashSet/api.d.ts +170 -0
  1425. package/collection/immutable/HashSet/definition.d.ts +97 -0
  1426. package/collection/immutable/HashSet.d.ts +2 -0
  1427. package/collection/immutable/ImmutableArray/api.d.ts +680 -0
  1428. package/collection/immutable/ImmutableArray/constructors.d.ts +32 -0
  1429. package/collection/immutable/ImmutableArray/definition.d.ts +25 -0
  1430. package/collection/immutable/ImmutableArray/instances.d.ts +18 -0
  1431. package/collection/immutable/ImmutableArray.d.ts +4 -0
  1432. package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +205 -0
  1433. package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +45 -0
  1434. package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +28 -0
  1435. package/collection/immutable/ImmutableNonEmptyArray/destructors.d.ts +32 -0
  1436. package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +52 -0
  1437. package/collection/immutable/ImmutableNonEmptyArray.d.ts +5 -0
  1438. package/collection/immutable/List/api/foldLeft.d.ts +6 -0
  1439. package/collection/immutable/List/api/unsafeTail.d.ts +6 -0
  1440. package/collection/immutable/List/api.d.ts +100 -0
  1441. package/collection/immutable/List/constructors.d.ts +27 -0
  1442. package/collection/immutable/List/definition.d.ts +40 -0
  1443. package/collection/immutable/List.d.ts +5 -0
  1444. package/collection/immutable/Queue/api.d.ts +78 -0
  1445. package/collection/immutable/Queue/constructors.d.ts +11 -0
  1446. package/collection/immutable/Queue/definition.d.ts +12 -0
  1447. package/collection/immutable/Queue/guards.d.ts +6 -0
  1448. package/collection/immutable/Queue.d.ts +4 -0
  1449. package/collection/immutable/SortedMap/api.d.ts +134 -0
  1450. package/collection/immutable/SortedMap/definition.d.ts +13 -0
  1451. package/collection/immutable/SortedMap/internal.d.ts +8 -0
  1452. package/collection/immutable/SortedMap/iterator.d.ts +64 -0
  1453. package/collection/immutable/SortedMap/node.d.ts +16 -0
  1454. package/collection/immutable/SortedMap.d.ts +5 -0
  1455. package/collection/immutable/Vector/api.d.ts +596 -0
  1456. package/collection/immutable/Vector/definition.d.ts +66 -0
  1457. package/collection/immutable/Vector/internal.d.ts +199 -0
  1458. package/collection/immutable/Vector.d.ts +2 -0
  1459. package/collection/mutable/HashMap.d.ts +55 -0
  1460. package/collection/mutable/HashSet.d.ts +48 -0
  1461. package/collection/mutable/ListBuffer.d.ts +19 -0
  1462. package/collection/mutable/internal.d.ts +4 -0
  1463. package/control/Eval/api/sequenceArray.d.ts +6 -0
  1464. package/control/Eval/api.d.ts +53 -0
  1465. package/control/Eval/constructors.d.ts +19 -0
  1466. package/control/Eval/definition.d.ts +59 -0
  1467. package/control/Eval/instance.d.ts +17 -0
  1468. package/control/Eval/run.d.ts +7 -0
  1469. package/control/Eval.d.ts +5 -0
  1470. package/control/LazyValue.d.ts +15 -0
  1471. package/control/Z/api.d.ts +343 -0
  1472. package/control/Z/definition.d.ts +135 -0
  1473. package/control/Z/instances.d.ts +7 -0
  1474. package/control/Z/runtime.d.ts +55 -0
  1475. package/control/Z.d.ts +4 -0
  1476. package/data/Byte.d.ts +1 -0
  1477. package/data/CaseClass.d.ts +26 -0
  1478. package/data/Cause/api/fold.d.ts +19 -0
  1479. package/data/Cause/api/isEmpty.d.ts +7 -0
  1480. package/data/Cause/api/linearize.d.ts +7 -0
  1481. package/data/Cause/api/prettyPrint.d.ts +6 -0
  1482. package/data/Cause/api/unified.d.ts +9 -0
  1483. package/data/Cause/api.d.ts +283 -0
  1484. package/data/Cause/definition.d.ts +130 -0
  1485. package/data/Cause.d.ts +2 -0
  1486. package/data/Const/api.d.ts +12 -0
  1487. package/data/Const/definition.d.ts +12 -0
  1488. package/data/Const/instances.d.ts +20 -0
  1489. package/data/Const.d.ts +3 -0
  1490. package/data/Duration/api.d.ts +52 -0
  1491. package/data/Duration/definition.d.ts +16 -0
  1492. package/data/Duration.d.ts +2 -0
  1493. package/data/Either/api/align.d.ts +3 -0
  1494. package/data/Either/api/alignWith.d.ts +7 -0
  1495. package/data/Either/api.d.ts +128 -0
  1496. package/data/Either/constructors.d.ts +50 -0
  1497. package/data/Either/definition.d.ts +40 -0
  1498. package/data/Either/destructors.d.ts +6 -0
  1499. package/data/Either/instances.d.ts +21 -0
  1500. package/data/Either.d.ts +5 -0
  1501. package/data/Environment/api.d.ts +45 -0
  1502. package/data/Environment/definition.d.ts +25 -0
  1503. package/data/Environment.d.ts +2 -0
  1504. package/data/ExecutionStrategy.d.ts +45 -0
  1505. package/data/Exit/api.d.ts +99 -0
  1506. package/data/Exit/constructors.d.ts +45 -0
  1507. package/data/Exit/definition.d.ts +70 -0
  1508. package/data/Exit.d.ts +3 -0
  1509. package/data/FiberId/api.d.ts +17 -0
  1510. package/data/FiberId/constructors.d.ts +17 -0
  1511. package/data/FiberId/definition.d.ts +65 -0
  1512. package/data/FiberId.d.ts +3 -0
  1513. package/data/Identity/api.d.ts +22 -0
  1514. package/data/Identity/definition.d.ts +10 -0
  1515. package/data/Identity/instances.d.ts +21 -0
  1516. package/data/Identity.d.ts +3 -0
  1517. package/data/Maybe/api.d.ts +125 -0
  1518. package/data/Maybe/constructors.d.ts +47 -0
  1519. package/data/Maybe/definition.d.ts +59 -0
  1520. package/data/Maybe/destructors.d.ts +8 -0
  1521. package/data/Maybe/instances.d.ts +15 -0
  1522. package/data/Maybe.d.ts +5 -0
  1523. package/data/Newtype.d.ts +36 -0
  1524. package/data/Patch/api.d.ts +24 -0
  1525. package/data/Patch/definition.d.ts +44 -0
  1526. package/data/Patch.d.ts +2 -0
  1527. package/data/Predicate/api.d.ts +21 -0
  1528. package/data/Predicate/definition.d.ts +9 -0
  1529. package/data/Predicate.d.ts +2 -0
  1530. package/data/Refinement/api.d.ts +23 -0
  1531. package/data/Refinement/definition.d.ts +12 -0
  1532. package/data/Refinement.d.ts +2 -0
  1533. package/data/Struct/api.d.ts +12 -0
  1534. package/data/Struct/definition.d.ts +19 -0
  1535. package/data/Tag/constructors.d.ts +6 -0
  1536. package/data/Tag/definition.d.ts +19 -0
  1537. package/data/Tag.d.ts +2 -0
  1538. package/data/These/constructors.d.ts +19 -0
  1539. package/data/These/definition.d.ts +45 -0
  1540. package/data/These/destructors.d.ts +6 -0
  1541. package/data/These.d.ts +3 -0
  1542. package/data/Trace/api.d.ts +12 -0
  1543. package/data/Trace/constructors.d.ts +14 -0
  1544. package/data/Trace/definition.d.ts +12 -0
  1545. package/data/Trace.d.ts +3 -0
  1546. package/data/TraceElement/definition.d.ts +39 -0
  1547. package/data/TraceElement.d.ts +1 -0
  1548. package/data/exceptions/ArrayIndexOutOfBoundsError.d.ts +5 -0
  1549. package/data/exceptions/IllegalArgumentError.d.ts +6 -0
  1550. package/data/exceptions/IllegalStateError.d.ts +5 -0
  1551. package/data/exceptions/IndexOutOfBoundsError.d.ts +5 -0
  1552. package/data/exceptions/InterruptedException.d.ts +8 -0
  1553. package/data/exceptions/InvalidCapacityError.d.ts +5 -0
  1554. package/data/exceptions/NoSuchElementError.d.ts +5 -0
  1555. package/data/exceptions.d.ts +7 -0
  1556. package/data/function/api.d.ts +27 -0
  1557. package/data/function/definition.d.ts +30 -0
  1558. package/data/function/pipe.d.ts +25 -0
  1559. package/data/function.d.ts +3 -0
  1560. package/data/number/api.d.ts +5 -0
  1561. package/data/number/definition.d.ts +13 -0
  1562. package/data/number/instances.d.ts +11 -0
  1563. package/data/number.d.ts +3 -0
  1564. package/data/object/definition.d.ts +13 -0
  1565. package/data/object.d.ts +1 -0
  1566. package/data/string/api.d.ts +145 -0
  1567. package/data/string/definition.d.ts +13 -0
  1568. package/data/string/instances.d.ts +21 -0
  1569. package/data/string.d.ts +3 -0
  1570. package/global/api.d.ts +8 -0
  1571. package/internal/AtomicBoolean.d.ts +4 -0
  1572. package/internal/AtomicNumber.d.ts +7 -0
  1573. package/internal/AtomicReference.d.ts +9 -0
  1574. package/internal/Stack.d.ts +28 -0
  1575. package/optics/At/api.d.ts +7 -0
  1576. package/optics/At/definition.d.ts +22 -0
  1577. package/optics/At.d.ts +2 -0
  1578. package/optics/Fold/definition.d.ts +28 -0
  1579. package/optics/Fold.d.ts +1 -0
  1580. package/optics/Getter/definition.d.ts +24 -0
  1581. package/optics/Getter.d.ts +1 -0
  1582. package/optics/Index/api.d.ts +14 -0
  1583. package/optics/Index/definition.d.ts +19 -0
  1584. package/optics/Index.d.ts +2 -0
  1585. package/optics/Iso/api.d.ts +6 -0
  1586. package/optics/Iso/definition.d.ts +40 -0
  1587. package/optics/Iso.d.ts +2 -0
  1588. package/optics/Lens/api.d.ts +49 -0
  1589. package/optics/Lens/definition.d.ts +40 -0
  1590. package/optics/Lens.d.ts +2 -0
  1591. package/optics/Optional/api/compose.d.ts +6 -0
  1592. package/optics/Optional/definition.d.ts +62 -0
  1593. package/optics/Optional.d.ts +2 -0
  1594. package/optics/Prism/api/compose.d.ts +6 -0
  1595. package/optics/Prism/api/fromNullable.d.ts +6 -0
  1596. package/optics/Prism/api/just.d.ts +7 -0
  1597. package/optics/Prism/definition.d.ts +42 -0
  1598. package/optics/Prism.d.ts +4 -0
  1599. package/optics/Setter/definition.d.ts +51 -0
  1600. package/optics/Setter.d.ts +1 -0
  1601. package/optics/Traversal/api/compose.d.ts +6 -0
  1602. package/optics/Traversal/api/fromTraversable.d.ts +8 -0
  1603. package/optics/Traversal/definition.d.ts +46 -0
  1604. package/optics/Traversal.d.ts +3 -0
  1605. package/package.json +16 -0
  1606. package/typeclass/Align.d.ts +21 -0
  1607. package/typeclass/Alt.d.ts +30 -0
  1608. package/typeclass/Alternative.d.ts +23 -0
  1609. package/typeclass/Applicative.d.ts +20 -0
  1610. package/typeclass/ApplicativeExcept.d.ts +60 -0
  1611. package/typeclass/Apply.d.ts +103 -0
  1612. package/typeclass/Chain.d.ts +39 -0
  1613. package/typeclass/Closure.d.ts +27 -0
  1614. package/typeclass/Eq.d.ts +27 -0
  1615. package/typeclass/Equatable/api.d.ts +11 -0
  1616. package/typeclass/Equatable/definition.d.ts +18 -0
  1617. package/typeclass/Equatable/fast-equals.d.ts +202 -0
  1618. package/typeclass/Equatable.d.ts +3 -0
  1619. package/typeclass/Fail.d.ts +23 -0
  1620. package/typeclass/Filterable.d.ts +68 -0
  1621. package/typeclass/FilterableWithIndex.d.ts +67 -0
  1622. package/typeclass/Foldable.d.ts +47 -0
  1623. package/typeclass/FoldableWithIndex.d.ts +49 -0
  1624. package/typeclass/Functor.d.ts +37 -0
  1625. package/typeclass/FunctorWithIndex.d.ts +27 -0
  1626. package/typeclass/Has.d.ts +16 -0
  1627. package/typeclass/Hash.d.ts +14 -0
  1628. package/typeclass/HashEq.d.ts +30 -0
  1629. package/typeclass/Hashable/definition.d.ts +18 -0
  1630. package/typeclass/Hashable/hash.d.ts +55 -0
  1631. package/typeclass/Hashable.d.ts +2 -0
  1632. package/typeclass/Monad.d.ts +19 -0
  1633. package/typeclass/MonadExcept.d.ts +32 -0
  1634. package/typeclass/Monoid.d.ts +22 -0
  1635. package/typeclass/Nil.d.ts +13 -0
  1636. package/typeclass/Ord/api/contramap.d.ts +6 -0
  1637. package/typeclass/Ord/api/max.d.ts +7 -0
  1638. package/typeclass/Ord/api/min.d.ts +7 -0
  1639. package/typeclass/Ord/api.d.ts +3 -0
  1640. package/typeclass/Ord/definition.d.ts +31 -0
  1641. package/typeclass/Ord/instances.d.ts +13 -0
  1642. package/typeclass/Ord.d.ts +3 -0
  1643. package/typeclass/Ordering.d.ts +32 -0
  1644. package/typeclass/Pointed.d.ts +21 -0
  1645. package/typeclass/Semialign.d.ts +84 -0
  1646. package/typeclass/Semigroup/api.d.ts +12 -0
  1647. package/typeclass/Semigroup/definition.d.ts +20 -0
  1648. package/typeclass/Semigroup.d.ts +2 -0
  1649. package/typeclass/Semimonoidal.d.ts +25 -0
  1650. package/typeclass/Showable/definition.d.ts +17 -0
  1651. package/typeclass/Showable/show.d.ts +54 -0
  1652. package/typeclass/Showable/styles.d.ts +8 -0
  1653. package/typeclass/Showable/util.d.ts +38 -0
  1654. package/typeclass/Showable.d.ts +2 -0
  1655. package/typeclass/Traversable.d.ts +71 -0
  1656. package/typeclass/TraversableWithIndex.d.ts +64 -0
  1657. package/typeclass/Witherable.d.ts +98 -0
  1658. package/typeclass/WitherableWithIndex.d.ts +114 -0
  1659. package/typeclass/builtin/Symbol.d.ts +8 -0
  1660. package/typeclass/builtin.d.ts +1 -0
  1661. package/typeclass.d.ts +36 -0
  1662. package/types/extractions.d.ts +12 -0
  1663. package/types/test.d.ts +1 -0
  1664. package/types/utility.d.ts +8 -0
  1665. package/types.d.ts +3 -0
  1666. package/util/AnsiFormat.d.ts +107 -0
  1667. package/util/PCGRandom.d.ts +50 -0
  1668. package/util/assert.d.ts +5 -0
  1669. package/util/pattern.d.ts +68 -0
  1670. package/util/predicates.d.ts +36 -0
  1671. package/util/rand/Random.d.ts +69 -0
  1672. package/util/rand/distribution/Distribution.d.ts +9 -0
  1673. package/util/rand/distribution/UniformArrayIntDistribution.d.ts +23 -0
  1674. package/util/rand/distribution/UniformBigIntDistribution.d.ts +22 -0
  1675. package/util/rand/distribution/UniformIntDistribution.d.ts +22 -0
  1676. package/util/rand/distribution/internals/ArrayInt.d.ts +57 -0
  1677. package/util/rand/distribution/internals/UniformArrayIntDistributionInternal.d.ts +12 -0
  1678. package/util/rand/distribution/internals/UniformIntDistributionInternal.d.ts +6 -0
  1679. package/util/rand/generator/MersenneTwister.d.ts +11 -0
  1680. package/util/rand/generator/RandomGenerator.d.ts +10 -0
  1681. package/util/rand.d.ts +9 -0
@@ -0,0 +1,1335 @@
1
+ /* eslint-disable prefer-const */
2
+ import type { MutableVector } from "@fncts/base/collection/immutable/Vector/definition";
3
+ import type { Eq, Monoid, Ord, Ordering } from "@fncts/base/typeclass";
4
+
5
+ import {
6
+ affixPush,
7
+ appendNodeToTree,
8
+ arrayPush,
9
+ branchBits,
10
+ concatAffixes,
11
+ concatBuffer,
12
+ concatSubTree,
13
+ copyArray,
14
+ emptyAffix,
15
+ foldLeftCb,
16
+ foldLeftNode,
17
+ foldLeftPrefix,
18
+ foldLeftSuffix,
19
+ foldRightCb,
20
+ foldRightNode,
21
+ foldRightPrefix,
22
+ foldRightSuffix,
23
+ getDepth,
24
+ getHeight,
25
+ getPrefixSize,
26
+ getSuffixSize,
27
+ handleOffset,
28
+ incrementPrefix,
29
+ incrementSuffix,
30
+ mapAffix,
31
+ mapNode,
32
+ mapPrefix,
33
+ mask,
34
+ newAffix,
35
+ newOffset,
36
+ nodeNth,
37
+ nodeNthDense,
38
+ prependNodeToTree,
39
+ reverseArray,
40
+ setDepth,
41
+ setPrefix,
42
+ setSizes,
43
+ setSuffix,
44
+ sliceLeft,
45
+ sliceRight,
46
+ sliceTreeVector,
47
+ updateNode,
48
+ zeroOffset,
49
+ } from "@fncts/base/collection/immutable/Vector/internal";
50
+
51
+ /**
52
+ * Appends an element to the end of a Vector and returns the new Vector.
53
+ *
54
+ * @complexity O(n)
55
+ *
56
+ * @tsplus fluent fncts.Vector append
57
+ */
58
+ export function append_<A>(as: Vector<A>, a: A): Vector<A> {
59
+ const suffixSize = getSuffixSize(as);
60
+ if (suffixSize < 32) {
61
+ return new Vector(
62
+ incrementSuffix(as.bits),
63
+ as.offset,
64
+ as.length + 1,
65
+ as.prefix,
66
+ as.root,
67
+ affixPush(a, as.suffix, suffixSize),
68
+ );
69
+ }
70
+ const newSuffix = [a];
71
+ const newVector = mutableClone(as);
72
+ appendNodeToTree(newVector, as.suffix);
73
+ newVector.suffix = newSuffix;
74
+ newVector.length++;
75
+ newVector.bits = setSuffix(1, newVector.bits);
76
+ return newVector;
77
+ }
78
+
79
+ /**
80
+ * Maps a function over a Vector and concatenates all the resulting
81
+ * Vectors together.
82
+ *
83
+ * @tsplus fluent fncts.Vector flatMap
84
+ */
85
+ export function flatMap_<A, B>(ma: Vector<A>, f: (a: A) => Vector<B>): Vector<B> {
86
+ return ma.map(f).flatten;
87
+ }
88
+
89
+ /**
90
+ * Splits the Vector into chunks of the given size.
91
+ *
92
+ * @tsplus fluent fncts.Vector chunksOf
93
+ */
94
+ export function chunksOf_<A>(as: Vector<A>, size: number): Vector<Vector<A>> {
95
+ const { buffer, l2 } = as.foldLeft(
96
+ { l2: Vector.emptyPushable<Vector<A>>(), buffer: Vector.emptyPushable<A>() },
97
+ ({ buffer, l2 }, elem) => {
98
+ buffer.push(elem);
99
+ if (buffer.length === size) {
100
+ return { l2: l2.push(buffer), buffer: Vector.emptyPushable<A>() };
101
+ } else {
102
+ return { l2, buffer };
103
+ }
104
+ },
105
+ );
106
+ return buffer.length === 0 ? l2 : l2.push(buffer);
107
+ }
108
+
109
+ /**
110
+ * Concatenates two Vectors.
111
+ *
112
+ * @complexity O(log(n))
113
+ * @tsplus fluent fncts.Vector concat
114
+ */
115
+ export function concat_<A, B>(self: Vector<A>, that: Vector<B>): Vector<A | B>;
116
+ export function concat_<A>(self: Vector<A>, that: Vector<A>): Vector<A> {
117
+ if (self.length === 0) {
118
+ return that;
119
+ } else if (that.length === 0) {
120
+ return self;
121
+ }
122
+ const newSize = self.length + that.length;
123
+ const rightSuffixSize = getSuffixSize(that);
124
+ let newVector = self.mutableClone;
125
+ if (that.root === undefined) {
126
+ // right is nothing but a prefix and a suffix
127
+ const nrOfAffixes = concatAffixes(self, that);
128
+ for (let i = 0; i < nrOfAffixes; ++i) {
129
+ newVector = appendNodeToTree(newVector, concatBuffer[i]);
130
+ newVector.length += concatBuffer[i].length;
131
+ // wipe pointer, otherwise it might end up keeping the array alive
132
+ concatBuffer[i] = undefined;
133
+ }
134
+ newVector.length = newSize;
135
+ newVector.suffix = concatBuffer[nrOfAffixes];
136
+ newVector.bits = setSuffix(concatBuffer[nrOfAffixes].length, newVector.bits);
137
+ concatBuffer[nrOfAffixes] = undefined;
138
+ return newVector;
139
+ } else {
140
+ const leftSuffixSize = getSuffixSize(self);
141
+ if (leftSuffixSize > 0) {
142
+ newVector = appendNodeToTree(newVector, self.suffix.slice(0, leftSuffixSize));
143
+ newVector.length += leftSuffixSize;
144
+ }
145
+ newVector = appendNodeToTree(newVector, that.prefix.slice(0, getPrefixSize(that)).reverse());
146
+ const newNode = concatSubTree(newVector.root!, getDepth(newVector), that.root, getDepth(that), true);
147
+ const newDepth = getHeight(newNode);
148
+ setSizes(newNode, newDepth);
149
+ newVector.root = newNode;
150
+ newVector.offset &= ~(mask << (getDepth(self) * branchBits));
151
+ newVector.length = newSize;
152
+ newVector.bits = setSuffix(rightSuffixSize, setDepth(newDepth, newVector.bits));
153
+ newVector.suffix = that.suffix;
154
+ return newVector;
155
+ }
156
+ }
157
+
158
+ type ContainsState = {
159
+ element: any;
160
+ result: boolean;
161
+ };
162
+
163
+ const containsState: ContainsState = {
164
+ element: undefined,
165
+ result: false,
166
+ };
167
+
168
+ function containsCb(value: any, state: ContainsState): boolean {
169
+ return !(state.result = value === state.element);
170
+ }
171
+
172
+ /**
173
+ * Returns `true` if the Vector contains the specified element.
174
+ * Otherwise it returns `false`.
175
+ *
176
+ * @complexity O(n)
177
+ * @tsplus fluent fncts.Vector contains
178
+ */
179
+ export function contains_<A>(as: Vector<A>, element: A): boolean {
180
+ containsState.element = element;
181
+ containsState.result = false;
182
+ return foldLeftCb(containsCb, containsState, as).result;
183
+ }
184
+
185
+ /**
186
+ * Returns a new Vector without the first `n` elements.
187
+ *
188
+ * @complexity `O(log(n))`
189
+ * @tsplus fluent fncts.Vector drop
190
+ */
191
+ export function drop_<A>(as: Vector<A>, n: number): Vector<A> {
192
+ return as.slice(n, as.length);
193
+ }
194
+
195
+ /**
196
+ * Returns a new Vector without the last `n` elements.
197
+ *
198
+ * @complexity `O(log(n))`
199
+ * @tsplus fluent fncts.Vector dropLast
200
+ */
201
+ export function dropLast_<A>(as: Vector<A>, n: number): Vector<A> {
202
+ return as.slice(0, as.length - n);
203
+ }
204
+
205
+ /**
206
+ * Returns a new Vector without repeated elements.
207
+ *
208
+ * @complexity `O(n)`
209
+ * @tsplus getter fncts.Vector dropRepeats
210
+ */
211
+ export function dropRepeats<A>(as: Vector<A>): Vector<A> {
212
+ return as.dropRepeatsWith(Equatable.strictEquals);
213
+ }
214
+
215
+ /**
216
+ * Returns a new Vector without repeated elements by using the given
217
+ * function to determine when elements are equal.
218
+ *
219
+ * @complexity `O(n)`
220
+ * @tsplus fluent fncts.Vector dropRepeatsWith
221
+ */
222
+ export function dropRepeatsWith_<A>(as: Vector<A>, predicate: (a: A, b: A) => boolean): Vector<A> {
223
+ return as.foldLeft(Vector.emptyPushable(), (acc, a) =>
224
+ acc.length !== 0 && predicate((acc as Vector<A>).unsafeLast!, a) ? acc : acc.push(a),
225
+ );
226
+ }
227
+
228
+ type FindNotIndexState = {
229
+ predicate: (a: any) => boolean;
230
+ index: number;
231
+ };
232
+
233
+ function findNotIndexCb(value: any, state: FindNotIndexState): boolean {
234
+ if (state.predicate(value)) {
235
+ ++state.index;
236
+ return true;
237
+ } else {
238
+ return false;
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Removes the first elements in the Vector for which the predicate returns
244
+ * `true`.
245
+ *
246
+ * @complexity `O(k + log(n))` where `k` is the number of elements
247
+ * satisfying the predicate.
248
+ * @tsplus fluent fncts.Vector dropWhile
249
+ */
250
+ export function dropWhile_<A>(as: Vector<A>, predicate: Predicate<A>): Vector<A> {
251
+ const { index } = foldLeftCb(findNotIndexCb, { predicate, index: 0 }, as);
252
+ return as.slice(index, as.length);
253
+ }
254
+
255
+ type ElemState = {
256
+ element: any;
257
+ equals: (x: any, y: any) => boolean;
258
+ result: boolean;
259
+ };
260
+
261
+ function elemCb(value: any, state: ElemState): boolean {
262
+ return !(state.result = state.equals(value, state.element));
263
+ }
264
+
265
+ /**
266
+ * @tsplus getter fncts.Vector elem
267
+ */
268
+ export function elem_<A>(self: Vector<A>) {
269
+ return (E: Eq<A>) => {
270
+ const elemState: ElemState = { equals: E.equals_, element: undefined, result: false };
271
+ return (a: A): boolean => {
272
+ elemState.element = a;
273
+ return foldLeftCb(elemCb, elemState, self).result;
274
+ };
275
+ };
276
+ }
277
+
278
+ /**
279
+ * Returns true if the two Vectors are equivalent.
280
+ *
281
+ * @complexity O(n)
282
+ * @tsplus fluent fncts.Vector equals
283
+ */
284
+ export function equals_<A>(self: Vector<A>, that: Vector<A>): boolean {
285
+ return self.corresponds(that, Equatable.strictEquals);
286
+ }
287
+
288
+ type PredState = {
289
+ predicate: (a: any) => boolean;
290
+ result: any;
291
+ };
292
+
293
+ function everyCb<A>(value: A, state: any): boolean {
294
+ return (state.result = state.predicate(value));
295
+ }
296
+
297
+ /**
298
+ * Returns `true` if and only if the predicate function returns `true`
299
+ * for all elements in the given Vector.
300
+ *
301
+ * @complexity O(n)
302
+ * @tsplus fluent fncts.Vector every
303
+ */
304
+ export function every_<A, B extends A>(as: Vector<A>, refinement: Refinement<A, B>): as is Vector<B>;
305
+ export function every_<A>(as: Vector<A>, predicate: Predicate<A>): boolean;
306
+ export function every_<A>(as: Vector<A>, predicate: Predicate<A>): boolean {
307
+ return foldLeftCb<A, PredState>(everyCb, { predicate, result: true }, as).result;
308
+ }
309
+
310
+ /**
311
+ * Creates an empty Vector.
312
+ *
313
+ * @complexity O(1)
314
+ * @tsplus static fncts.VectorOps empty
315
+ */
316
+ export function empty<A = any>(): Vector<A> {
317
+ return new Vector(0, 0, 0, emptyAffix, undefined, emptyAffix);
318
+ }
319
+
320
+ /**
321
+ * @tsplus static fncts.VectorOps emptyPushable
322
+ */
323
+ export function emptyPushable<A>(): MutableVector<A> {
324
+ return new Vector(0, 0, 0, [], undefined, []) as any;
325
+ }
326
+
327
+ function existsCb<A>(value: A, state: PredState): boolean {
328
+ return !(state.result = state.predicate(value));
329
+ }
330
+
331
+ /**
332
+ * Returns true if and only if there exists an element in the Vector for
333
+ * which the predicate returns true.
334
+ *
335
+ * @complexity O(n)
336
+ *
337
+ * @tsplus fluent fncts.Vector exists
338
+ */
339
+ export function exists_<A>(as: Vector<A>, predicate: Predicate<A>): boolean {
340
+ return foldLeftCb<A, PredState>(existsCb, { predicate, result: false }, as).result;
341
+ }
342
+
343
+ /**
344
+ * Returns the _first_ element for which the predicate returns `true`.
345
+ * If no such element is found the function returns `undefined`.
346
+ *
347
+ * @complexity O(n)
348
+ * @tsplus fluent fncts.Vector find
349
+ */
350
+ export function find_<A>(as: Vector<A>, predicate: Predicate<A>): Maybe<A> {
351
+ return Maybe.fromNullable(as.unsafeFind(predicate));
352
+ }
353
+
354
+ type FindIndexState = {
355
+ predicate: (a: any) => boolean;
356
+ found: boolean;
357
+ index: number;
358
+ };
359
+
360
+ function findIndexCb<A>(value: A, state: FindIndexState): boolean {
361
+ ++state.index;
362
+ return !(state.found = state.predicate(value));
363
+ }
364
+
365
+ /**
366
+ * Returns the index of the `first` element for which the predicate
367
+ * returns true. If no such element is found the function returns
368
+ * `-1`.
369
+ *
370
+ * @complexity O(n)
371
+ * @tsplus fluent fncts.Vector findIndex
372
+ */
373
+ export function findIndex_<A>(as: Vector<A>, predicate: Predicate<A>): number {
374
+ const { found, index } = foldLeftCb<A, FindIndexState>(findIndexCb, { predicate, found: false, index: -1 }, as);
375
+ return found ? index : -1;
376
+ }
377
+
378
+ /**
379
+ * Returns the _last_ element for which the predicate returns `true`.
380
+ * If no such element is found the function returns `undefined`.
381
+ *
382
+ * @complexity O(n)
383
+ * @tsplus fluent fncts.Vector findLast
384
+ */
385
+ export function findLast_<A>(as: Vector<A>, predicate: Predicate<A>): Maybe<A> {
386
+ return Maybe.fromNullable(as.unsafeFindLast(predicate));
387
+ }
388
+
389
+ /**
390
+ * Returns the index of the `last` element for which the predicate
391
+ * returns true. If no such element is found the function returns
392
+ * `-1`.
393
+ *
394
+ * @complexity O(n)
395
+ * @tsplus fluent fncts.Vector findLastIndex
396
+ */
397
+ export function findLastIndex_<A>(as: Vector<A>, predicate: Predicate<A>): number {
398
+ const { found, index } = foldRightCb<A, FindIndexState>(findIndexCb, { predicate, found: false, index: -0 }, as);
399
+ return found ? index : -1;
400
+ }
401
+
402
+ /**
403
+ * Flattens a Vector of Vectors into a Vector. Note that this function does
404
+ * not flatten recursively. It removes one level of nesting only.
405
+ *
406
+ * @complexity O(n * log(m)), where n is the length of the outer Vector and m the length of the inner Vectors.
407
+ *
408
+ * @tsplus getter fncts.Vector flatten
409
+ */
410
+ export function flatten<A>(mma: Vector<Vector<A>>): Vector<A> {
411
+ return mma.foldLeft<Vector<A>, Vector<A>>(Vector.empty(), (acc, a) => acc.concat(a));
412
+ }
413
+
414
+ /**
415
+ * Converts an array, an array-like, or an iterable into a Vector.
416
+ *
417
+ * @complexity O(n)
418
+ * @tsplus static fncts.VectorOps from
419
+ */
420
+ export function from<A>(sequence: A[] | ArrayLike<A> | Iterable<A>): Vector<A>;
421
+ export function from<A>(sequence: any): Vector<A> {
422
+ const l = emptyPushable<A>();
423
+ if (sequence.length > 0 && (sequence[0] !== undefined || 0 in sequence)) {
424
+ for (let i = 0; i < sequence.length; ++i) {
425
+ l.push(sequence[i]);
426
+ }
427
+ } else if (Symbol.iterator in sequence) {
428
+ const iterator = sequence[Symbol.iterator]();
429
+ let cur;
430
+ while (!(cur = iterator.next()).done) {
431
+ l.push(cur.value);
432
+ }
433
+ }
434
+ return l;
435
+ }
436
+
437
+ /**
438
+ * Folds a function over a Vector. Left-associative.
439
+ *
440
+ * @tsplus fluent fncts.Vector foldLeft
441
+ */
442
+ export function foldLeft_<A, B>(fa: Vector<A>, initial: B, f: (acc: B, a: A) => B): B {
443
+ return fa.foldLeftWithIndex(initial, (_, b, a) => f(b, a));
444
+ }
445
+
446
+ /**
447
+ * @tsplus fluent fncts.Vector foldLeftWithIndex
448
+ */
449
+ export function foldLeftWithIndex_<A, B>(fa: Vector<A>, b: B, f: (i: number, b: B, a: A) => B): B {
450
+ const suffixSize = getSuffixSize(fa);
451
+ const prefixSize = getPrefixSize(fa);
452
+ let [acc, index] = foldLeftPrefix(f, b, fa.prefix, prefixSize);
453
+ if (fa.root !== undefined) {
454
+ [acc, index] = foldLeftNode(f, acc, fa.root, getDepth(fa), index);
455
+ }
456
+ return foldLeftSuffix(f, acc, fa.suffix, suffixSize, index)[0];
457
+ }
458
+
459
+ type FoldWhileState<A, B> = {
460
+ predicate: Predicate<B>;
461
+ result: B;
462
+ f: (i: number, b: B, a: A) => B;
463
+ };
464
+
465
+ /**
466
+ * Similar to `foldl`. But, for each element it calls the predicate function
467
+ * _before_ the folding function and stops folding if it returns `false`.
468
+ *
469
+ *
470
+ * @example
471
+ * const isOdd = (_acc:, x) => x % 2 === 1;
472
+ *
473
+ * const xs = V.vector(1, 3, 5, 60, 777, 800);
474
+ * foldlWhile(isOdd, (n, m) => n + m, 0, xs) //=> 9
475
+ *
476
+ * const ys = V.vector(2, 4, 6);
477
+ * foldlWhile(isOdd, (n, m) => n + m, 111, ys) //=> 111
478
+ */
479
+ function foldWhileCb<A, B>(a: A, state: FoldWhileState<A, B>, i: number): boolean {
480
+ if (state.predicate(state.result) === false) {
481
+ return false;
482
+ }
483
+ state.result = state.f(i, state.result, a);
484
+ return true;
485
+ }
486
+
487
+ /**
488
+ * @tsplus fluent fncts.Vector foldLeftWhile
489
+ */
490
+ export function foldLeftWhile_<A, B>(fa: Vector<A>, b: B, cont: Predicate<B>, f: (i: number, b: B, a: A) => B): B {
491
+ if (!cont(b)) {
492
+ return b;
493
+ }
494
+ return foldLeftCb<A, FoldWhileState<A, B>>(foldWhileCb, { predicate: cont, f, result: b }, fa).result;
495
+ }
496
+
497
+ /**
498
+ * @tsplus fluent fncts.Vector foldRightWhile
499
+ */
500
+ export function foldRightWhile_<A, B>(fa: Vector<A>, b: B, cont: Predicate<B>, f: (i: number, a: A, b: B) => B): B {
501
+ return foldRightCb<A, FoldWhileState<A, B>>(
502
+ foldWhileCb,
503
+ { predicate: cont, result: b, f: (i, b, a) => f(i, a, b) },
504
+ fa,
505
+ ).result;
506
+ }
507
+
508
+ /**
509
+ * @tsplus getter fncts.Vector foldMap
510
+ */
511
+ export function foldMap_<A>(self: Vector<A>) {
512
+ return <M>(M: Monoid<M>) =>
513
+ (f: (a: A) => M): M =>
514
+ self.foldMapWithIndex(M)((_, a) => f(a));
515
+ }
516
+
517
+ /**
518
+ * @tsplus getter fncts.Vector foldMapWithIndex
519
+ */
520
+ export function foldMapWithIndex_<A>(self: Vector<A>) {
521
+ return <M>(M: Monoid<M>) =>
522
+ (f: (i: number, a: A) => M): M =>
523
+ self.foldLeftWithIndex(M.nat, (i, b, a) => M.combine_(b, f(i, a)));
524
+ }
525
+
526
+ /**
527
+ * Folds a function over a Vector. Right-associative.
528
+ *
529
+ * @complexity O(n)
530
+ * @tsplus fluent fncts.Vector foldRight
531
+ */
532
+ export function foldRight_<A, B>(fa: Vector<A>, initial: B, f: (value: A, acc: B) => B): B {
533
+ return fa.foldRightWithIndex(initial, (_, a, b) => f(a, b));
534
+ }
535
+
536
+ /**
537
+ * Folds a function over a Vector. Right-associative.
538
+ *
539
+ * @complexity O(n)
540
+ * @tsplus fluent fncts.Vector foldRightWithIndex
541
+ */
542
+ export function foldRightWithIndex_<A, B>(fa: Vector<A>, b: B, f: (i: number, a: A, b: B) => B): B {
543
+ const suffixSize = getSuffixSize(fa);
544
+ const prefixSize = getPrefixSize(fa);
545
+ let [acc, j] = foldRightSuffix(f, b, fa.suffix, suffixSize, fa.length - 1);
546
+ if (fa.root !== undefined) {
547
+ [acc, j] = foldRightNode(f, acc, fa.root, getDepth(fa), j);
548
+ }
549
+ return foldRightPrefix(f, acc, fa.prefix, prefixSize, j)[0];
550
+ }
551
+
552
+ /**
553
+ * Invokes a given callback for each element in the Vector from left to
554
+ * right. Returns `undefined`.
555
+ *
556
+ * This function is very similar to map. It should be used instead of
557
+ * `map` when the mapping function has side-effects. Whereas `map`
558
+ * constructs a new Vector `forEach` merely returns `undefined`. This
559
+ * makes `forEach` faster when the new Vector is unneeded.
560
+ *
561
+ * @complexity O(n)
562
+ * @tsplus fluent fncts.Vector forEach
563
+ */
564
+ export function forEach_<A>(as: Vector<A>, f: (a: A) => void): void {
565
+ as.foldLeft(undefined as void, (_, element) => f(element));
566
+ }
567
+
568
+ /**
569
+ * @tsplus fluent fncts.Vector forEachWithIndex
570
+ */
571
+ export function forEachWithIndex_<A>(as: Vector<A>, f: (i: number, a: A) => void): void {
572
+ as.foldLeftWithIndex(undefined as void, (index, _, element) => f(index, element));
573
+ }
574
+
575
+ /**
576
+ * Gets the nth element of the Vector. If `n` is out of bounds
577
+ * `undefined` is returned.
578
+ *
579
+ * @complexity O(log(n))
580
+ * @tsplus fluent fncts.Vector get
581
+ */
582
+ export function get_<A>(self: Vector<A>, index: number): Maybe<A> {
583
+ return Maybe.fromNullable(self.unsafeGet(index));
584
+ }
585
+
586
+ /**
587
+ * Returns a Vector of Vectors where each subvector's elements are pairwise
588
+ * equal based on the given comparison function.
589
+ *
590
+ * Note that only adjacent elements are compared for equality. If all
591
+ * equal elements should be grouped together the Vector should be sorted
592
+ * before grouping.
593
+ *
594
+ * @tsplus fluent fncts.Vector groupWith
595
+ */
596
+ export function groupWith_<A>(as: Vector<A>, f: (a: A, b: A) => boolean): Vector<Vector<A>> {
597
+ const result = Vector.emptyPushable<MutableVector<A>>();
598
+ let buffer = Vector.emptyPushable<A>();
599
+ forEach_(as, (a) => {
600
+ if (buffer.length !== 0 && !f(unsafeLast(buffer)!, a)) {
601
+ result.push(buffer);
602
+ buffer = emptyPushable();
603
+ }
604
+ buffer.push(a);
605
+ });
606
+ return buffer.length === 0 ? result : result.push(buffer);
607
+ }
608
+
609
+ /**
610
+ * Returns the first element of the Vector.
611
+ *
612
+ * @complexity O(1)
613
+ * @tsplus getter fncts.Vector head
614
+ */
615
+ export function head<A>(self: Vector<A>): Maybe<NonNullable<A>> {
616
+ return Maybe.fromNullable(self.unsafeHead);
617
+ }
618
+
619
+ type IndexOfState = {
620
+ element: any;
621
+ found: boolean;
622
+ index: number;
623
+ };
624
+
625
+ function indexOfCb(value: any, state: IndexOfState): boolean {
626
+ ++state.index;
627
+ return !(state.found = Equatable.strictEquals(value, state.element));
628
+ }
629
+
630
+ /**
631
+ * Returns the index of the _first_ element in the Vector that is equal
632
+ * to the given element. If no such element is found `-1` is returned.
633
+ *
634
+ * @complexity O(n)
635
+ * @tsplus fluent fncts.Vector indexOf
636
+ */
637
+ export function indexOf_<A>(as: Vector<A>, element: A): number {
638
+ const state = { element, found: false, index: -1 };
639
+ foldLeftCb(indexOfCb, state, as);
640
+ return state.found ? state.index : -1;
641
+ }
642
+
643
+ /**
644
+ * Inserts the given element at the given index in the Vector.
645
+ *
646
+ * @complexity O(log(n))
647
+ * @tsplus fluent fncts.Vector insertAt
648
+ */
649
+ export function insertAt_<A>(as: Vector<A>, index: number, element: A): Vector<A> {
650
+ return as.slice(0, index).append(element).concat(as.slice(index, as.length));
651
+ }
652
+
653
+ /**
654
+ * Inserts the given Vector of elements at the given index in the Vector.
655
+ *
656
+ * @complexity `O(log(n))`
657
+ * @tsplus fluent fncts.Vector insertAllAt
658
+ */
659
+ export function insertAllAt_<A>(as: Vector<A>, index: number, elements: Vector<A>): Vector<A> {
660
+ return as.slice(0, index).concat(elements).concat(as.slice(index, as.length));
661
+ }
662
+
663
+ /**
664
+ * Inserts a separator between each element in a Vector.
665
+ *
666
+ * @tsplus fluent fncts.Vector intersperse
667
+ */
668
+ export function intersperse_<A>(as: Vector<A>, separator: A): Vector<A> {
669
+ return (as.foldLeft(Vector.emptyPushable(), (l2, a) => l2.push(a).push(separator)) as Vector<A>).pop;
670
+ }
671
+
672
+ /**
673
+ * @tsplus fluent fncts.Vector isEmpty
674
+ */
675
+ export function isEmpty<A>(l: Vector<A>): boolean {
676
+ return l.length === 0;
677
+ }
678
+
679
+ /**
680
+ * @tsplus fluent fncts.Vector isNonEmpty
681
+ */
682
+ export function isNonEmpty<A>(l: Vector<A>): boolean {
683
+ return l.length > 0;
684
+ }
685
+
686
+ /**
687
+ * Concatenates the strings in the Vector separated by a specified separator.
688
+ *
689
+ * @tsplus fluent fncts.Vector join
690
+ */
691
+ export function join_(as: Vector<string>, separator: string): string {
692
+ return as.foldLeft("", (a, b) => (a.length === 0 ? b : a + separator + b));
693
+ }
694
+
695
+ /**
696
+ * Returns the last element of the Vector.
697
+ *
698
+ * @complexity O(1)
699
+ * @tsplus getter fncts.Vector last
700
+ */
701
+ export function last<A>(l: Vector<A>): Maybe<NonNullable<A>> {
702
+ return Maybe.fromNullable(l.unsafeLast);
703
+ }
704
+
705
+ /**
706
+ * Returns the index of the _last_ element in the Vector that is equal
707
+ * to the given element. If no such element is found `-1` is returned.
708
+ *
709
+ * @complexity O(n)
710
+ * @tsplus fluent fncts.Vector lastIndexOf
711
+ */
712
+ export function lastIndexOf_<A>(as: Vector<A>, element: A): number {
713
+ const state = { element, found: false, index: 0 };
714
+ foldRightCb(indexOfCb, state, as);
715
+ return state.found ? as.length - state.index : -1;
716
+ }
717
+
718
+ /**
719
+ * Generates a new Vector by calling a function with the current index
720
+ * `n` times.
721
+ *
722
+ * @complexity O(n)
723
+ * @tsplus static fncts.VectorOps makeBy
724
+ */
725
+ export function makeBy<A>(n: number, f: (index: number) => A): Vector<A> {
726
+ const l = emptyPushable<A>();
727
+ for (let i = 0; i < n; i++) {
728
+ l.push(f(i));
729
+ }
730
+ return l;
731
+ }
732
+
733
+ /**
734
+ * @tsplus fluent fncts.Vector mapAccum
735
+ */
736
+ export function mapAccum_<A, S, B>(fa: Vector<A>, s: S, f: (s: S, a: A) => readonly [B, S]): readonly [Vector<B>, S] {
737
+ return fa.foldLeft([Vector.emptyPushable(), s], ([acc, s], a) => {
738
+ const r = f(s, a);
739
+ acc.push(r[0]);
740
+ return [acc, r[1]];
741
+ });
742
+ }
743
+
744
+ /**
745
+ * Applies a function to each element in the given Vector and returns a
746
+ * new Vector of the values that the function return.
747
+ *
748
+ * @complexity O(n)
749
+ * @tsplus fluent fncts.Vector map
750
+ */
751
+ export function map_<A, B>(fa: Vector<A>, f: (a: A) => B): Vector<B> {
752
+ return fa.mapWithIndex((_, a) => f(a));
753
+ }
754
+
755
+ /**
756
+ * Applies a function to each element in the given Vector and returns a
757
+ * new Vector of the values that the function return.
758
+ *
759
+ * @complexity O(n)
760
+ * @tsplus fluent fncts.Vector mapWithIndex
761
+ */
762
+ export function mapWithIndex_<A, B>(fa: Vector<A>, f: (i: number, a: A) => B): Vector<B> {
763
+ return new Vector(
764
+ fa.bits,
765
+ fa.offset,
766
+ fa.length,
767
+ mapPrefix(f, fa.prefix, getPrefixSize(fa)),
768
+ fa.root === undefined ? undefined : mapNode(f, fa.root, getDepth(fa), getPrefixSize(fa), 1)[0],
769
+ mapAffix(f, fa.suffix, getSuffixSize(fa), fa.length),
770
+ );
771
+ }
772
+
773
+ /**
774
+ * @tsplus getter fncts.Vector mutableClone
775
+ */
776
+ export function mutableClone<A>(as: Vector<A>): MutableVector<A> {
777
+ return new Vector(as.bits, as.offset, as.length, as.prefix, as.root, as.suffix) as any;
778
+ }
779
+
780
+ /**
781
+ * Returns a Vector that has the entry specified by the index replaced with
782
+ * the value returned by applying the function to the value.
783
+ *
784
+ * If the index is out of bounds the given Vector is
785
+ * returned unchanged.
786
+ *
787
+ * @complexity `O(log(n))`
788
+ *
789
+ * @tsplus fluent fncts.Vector modifyAt
790
+ */
791
+ export function modifyAt_<A>(as: Vector<A>, i: number, f: (a: A) => A): Vector<A> {
792
+ if (i < 0 || as.length <= i) {
793
+ return as;
794
+ }
795
+ return as.updateAt(i, f(as.unsafeGet(i)!));
796
+ }
797
+
798
+ /**
799
+ * Returns `true` if and only if the predicate function returns
800
+ * `false` for every element in the given Vector.
801
+ *
802
+ * @complexity O(n)
803
+ *
804
+ * @tsplus fluent fncts.Vector none
805
+ */
806
+ export function none_<A>(as: Vector<A>, predicate: Predicate<A>): boolean {
807
+ return !as.exists(predicate);
808
+ }
809
+
810
+ /**
811
+ * Takes two arguments and returns a Vector that contains them.
812
+ *
813
+ * @complexity O(1)
814
+ * @tsplus static fncts.VectorOps pair
815
+ */
816
+ export function pair<A>(first: A, second: A): Vector<A> {
817
+ return new Vector(2, 0, 2, emptyAffix, undefined, [first, second]);
818
+ }
819
+
820
+ /**
821
+ * Returns a new Vector with the last element removed. If the Vector is
822
+ * empty the empty Vector is returned.
823
+ *
824
+ * @complexity `O(1)`
825
+ * @tsplus getter fncts.Vector pop
826
+ */
827
+ export function pop<A>(as: Vector<A>): Vector<A> {
828
+ return as.slice(0, -1);
829
+ }
830
+
831
+ /**
832
+ * Prepends an element to the front of a Vector and returns the new Vector.
833
+ *
834
+ * @complexity O(1)
835
+ *
836
+ * @tsplus fluent fncts.Vector prepend
837
+ */
838
+ export function prepend_<A>(as: Vector<A>, a: A): Vector<A> {
839
+ const prefixSize = getPrefixSize(as);
840
+ if (prefixSize < 32) {
841
+ return new Vector<A>(
842
+ incrementPrefix(as.bits),
843
+ as.offset,
844
+ as.length + 1,
845
+ affixPush(a, as.prefix, prefixSize),
846
+ as.root,
847
+ as.suffix,
848
+ );
849
+ } else {
850
+ const newVector = mutableClone(as);
851
+ prependNodeToTree(newVector, reverseArray(as.prefix));
852
+ const newPrefix = [a];
853
+ newVector.prefix = newPrefix;
854
+ newVector.length++;
855
+ newVector.bits = setPrefix(1, newVector.bits);
856
+ return newVector;
857
+ }
858
+ }
859
+
860
+ /**
861
+ * Returns a Vector of numbers between an inclusive lower bound and an exclusive upper bound.
862
+ *
863
+ * @complexity O(n)
864
+ * @tsplus static fncts.VectorOps range
865
+ */
866
+ export function range(start: number, end: number): Vector<number> {
867
+ const vec = emptyPushable<number>();
868
+ for (let i = start; i < end; ++i) {
869
+ vec.push(i);
870
+ }
871
+ return vec;
872
+ }
873
+
874
+ /**
875
+ * Takes an index, a number of elements to remove and a Vector. Returns a
876
+ * new Vector with the given amount of elements removed from the specified
877
+ * index.
878
+ *
879
+ * @complexity `O(log(n))`
880
+ *
881
+ * @tsplus fluent fncts.Vector remove
882
+ */
883
+ export function remove_<A>(as: Vector<A>, from: number, amount: number): Vector<A> {
884
+ return as.slice(0, from).concat(as.slice(from + amount, as.length));
885
+ }
886
+
887
+ /**
888
+ * Returns a Vector of a given length that contains the specified value
889
+ * in all positions.
890
+ *
891
+ * @complexity O(n)
892
+ * @tsplus static fncts.VectorOps replicate
893
+ */
894
+ export function replicate<A>(n: number, a: A): Vector<A> {
895
+ let t = n;
896
+ const l = emptyPushable<A>();
897
+ while (--t >= 0) {
898
+ l.push(a);
899
+ }
900
+ return l;
901
+ }
902
+
903
+ /**
904
+ * Folds a function over a Vector from left to right while collecting
905
+ * all the intermediate steps in a resulting Vector.
906
+ *
907
+ * @tsplus fluent fncts.Vector scanLeft
908
+ */
909
+ export function scanLeft_<A, B>(as: Vector<A>, initial: B, f: (acc: B, value: A) => B): Vector<B> {
910
+ return as.foldLeft(emptyPushable<B>().push(initial), (l2, a) => l2.push(f((l2 as Vector<B>).unsafeLast!, a)));
911
+ }
912
+
913
+ /**
914
+ * Takes a single arguments and returns a singleton Vector that contains it.
915
+ *
916
+ * @complexity O(1)
917
+ * @tsplus static fncts.VectorOps single
918
+ */
919
+ export function single<A>(a: A): Vector<A> {
920
+ return Vector(a);
921
+ }
922
+
923
+ /**
924
+ * Returns a slice of a Vector. Elements are removed from the beginning and
925
+ * end. Both the indices can be negative in which case they will count
926
+ * from the right end of the Vector.
927
+ *
928
+ * @complexity `O(log(n))`
929
+ * @tsplus fluent fncts.Vector slice
930
+ */
931
+ export function slice_<A>(as: Vector<A>, from: number, to: number): Vector<A> {
932
+ let { bits, length } = as;
933
+ let _to = to;
934
+ let _from = from;
935
+ _to = Math.min(length, to);
936
+ // Handle negative indices
937
+ if (_from < 0) {
938
+ _from = length + from;
939
+ }
940
+ if (_to < 0) {
941
+ _to = length + to;
942
+ }
943
+
944
+ // Should we just return the empty Vector?
945
+ if (_to <= _from || _to <= 0 || length <= _from) {
946
+ return empty();
947
+ }
948
+
949
+ // Return Vector unchanged if we are slicing nothing off
950
+ if (_from <= 0 && length <= _to) {
951
+ return as;
952
+ }
953
+
954
+ const newLength = _to - _from;
955
+ let prefixSize = getPrefixSize(as);
956
+ const suffixSize = getSuffixSize(as);
957
+
958
+ // Both indices lie in the prefix
959
+ if (_to <= prefixSize) {
960
+ return new Vector(
961
+ setPrefix(newLength, 0),
962
+ 0,
963
+ newLength,
964
+ as.prefix.slice(prefixSize - _to, prefixSize - _from),
965
+ undefined,
966
+ emptyAffix,
967
+ );
968
+ }
969
+
970
+ const suffixStart = length - suffixSize;
971
+ // Both indices lie in the suffix
972
+ if (suffixStart <= _from) {
973
+ return new Vector(
974
+ setSuffix(newLength, 0),
975
+ 0,
976
+ newLength,
977
+ emptyAffix,
978
+ undefined,
979
+ as.suffix.slice(_from - suffixStart, _to - suffixStart),
980
+ );
981
+ }
982
+
983
+ const newVector = mutableClone(as);
984
+ newVector.length = newLength;
985
+
986
+ // Both indices lie in the tree
987
+ if (prefixSize <= _from && _to <= suffixStart) {
988
+ sliceTreeVector(
989
+ _from - prefixSize + as.offset,
990
+ _to - prefixSize + as.offset - 1,
991
+ as.root!,
992
+ getDepth(as),
993
+ as.offset,
994
+ newVector,
995
+ );
996
+ return newVector;
997
+ }
998
+
999
+ if (0 < _from) {
1000
+ // we need _to slice something off of the left
1001
+ if (_from < prefixSize) {
1002
+ // shorten the prefix even though it's not strictly needed,
1003
+ // so that referenced items can be GC'd
1004
+ newVector.prefix = as.prefix.slice(0, prefixSize - _from);
1005
+ bits = setPrefix(prefixSize - _from, bits);
1006
+ } else {
1007
+ // if we're here `_to` can't lie in the tree, so we can set the
1008
+ // root
1009
+ zeroOffset();
1010
+ newVector.root = sliceLeft(newVector.root!, getDepth(as), _from - prefixSize, as.offset, true);
1011
+ newVector.offset = newOffset;
1012
+ if (newVector.root === undefined) {
1013
+ bits = setDepth(0, bits);
1014
+ }
1015
+ bits = setPrefix(newAffix.length, bits);
1016
+ prefixSize = newAffix.length;
1017
+ newVector.prefix = newAffix;
1018
+ }
1019
+ }
1020
+ if (_to < length) {
1021
+ // we need _to slice something off of the right
1022
+ if (length - _to < suffixSize) {
1023
+ bits = setSuffix(suffixSize - (length - _to), bits);
1024
+ // slice the suffix even though it's not strictly needed,
1025
+ // _to allow the removed items _to be GC'd
1026
+ newVector.suffix = as.suffix.slice(0, suffixSize - (length - _to));
1027
+ } else {
1028
+ newVector.root = sliceRight(newVector.root!, getDepth(as), _to - prefixSize - 1, newVector.offset);
1029
+ if (newVector.root === undefined) {
1030
+ bits = setDepth(0, bits);
1031
+ newVector.offset = 0;
1032
+ }
1033
+ bits = setSuffix(newAffix.length, bits);
1034
+ newVector.suffix = newAffix;
1035
+ }
1036
+ }
1037
+ newVector.bits = bits;
1038
+ return newVector;
1039
+ }
1040
+
1041
+ /**
1042
+ * @tsplus getter fncts.Vector sort
1043
+ */
1044
+ export function sort_<A>(self: Vector<A>) {
1045
+ return (O: Ord<A>): Vector<A> => self.sortWith(O.compare_);
1046
+ }
1047
+
1048
+ /**
1049
+ * Sort the given Vector by comparing values using the given function.
1050
+ * The function receieves two values and should return `-1` if the
1051
+ * first value is stricty larger than the second, `0` is they are
1052
+ * equal and `1` if the first values is strictly smaller than the
1053
+ * second.
1054
+ *
1055
+ * @complexity O(n * log(n))
1056
+ *
1057
+ * @tsplus fluent fncts.Vector sortWith
1058
+ */
1059
+ export function sortWith_<A>(as: Vector<A>, compare: (a: A, b: A) => Ordering): Vector<A> {
1060
+ const arr: { idx: number; elm: A }[] = [];
1061
+ let i = 0;
1062
+ as.forEach((elm) => arr.push({ idx: i++, elm }));
1063
+ arr.sort(({ elm: a, idx: i }, { elm: b, idx: j }) => {
1064
+ const c = compare(a, b);
1065
+ return c !== 0 ? c : i < j ? -1 : 1;
1066
+ });
1067
+ const newL = emptyPushable<A>();
1068
+ for (let i = 0; i < arr.length; ++i) {
1069
+ newL.push(arr[i]!.elm);
1070
+ }
1071
+ return newL;
1072
+ }
1073
+
1074
+ /**
1075
+ * Splits a Vector at the given index and return the two sides in a pair.
1076
+ * The left side will contain all elements before but not including the
1077
+ * element at the given index. The right side contains the element at the
1078
+ * index and all elements after it.
1079
+ *
1080
+ * @complexity `O(log(n))`
1081
+ *
1082
+ * @tsplus fluent fncts.Vector splitAt
1083
+ */
1084
+ export function splitAt_<A>(as: Vector<A>, index: number): [Vector<A>, Vector<A>] {
1085
+ return [as.slice(0, index), as.slice(index, as.length)];
1086
+ }
1087
+
1088
+ /**
1089
+ * Splits a Vector at the first element in the Vector for which the given
1090
+ * predicate returns `true`.
1091
+ *
1092
+ * @complexity `O(n)`
1093
+ *
1094
+ * @tsplus fluent fncts.Vector splitWhen
1095
+ */
1096
+ export function splitWhen_<A>(as: Vector<A>, predicate: Predicate<A>): [Vector<A>, Vector<A>] {
1097
+ const idx = as.findIndex(predicate);
1098
+ return idx === -1 ? [as, Vector.empty()] : as.splitAt(idx);
1099
+ }
1100
+
1101
+ /**
1102
+ * Returns a new Vector with the first element removed. If the Vector is
1103
+ * empty the empty Vector is returned.
1104
+ *
1105
+ * @complexity `O(1)`
1106
+ *
1107
+ * @tsplus getter fncts.Vector tail
1108
+ */
1109
+ export function tail<A>(as: Vector<A>): Vector<A> {
1110
+ return as.slice(1, as.length);
1111
+ }
1112
+
1113
+ /**
1114
+ * Takes the first `n` elements from a Vector and returns them in a new Vector.
1115
+ *
1116
+ * @complexity `O(log(n))`
1117
+ * @tsplus fluent fncts.Vector take
1118
+ */
1119
+ export function take_<A>(as: Vector<A>, n: number): Vector<A> {
1120
+ return as.slice(0, n);
1121
+ }
1122
+
1123
+ /**
1124
+ * Takes the first elements in the Vector for which the predicate returns
1125
+ * `true`.
1126
+ *
1127
+ * @complexity `O(k + log(n))` where `k` is the number of elements satisfying
1128
+ * the predicate.
1129
+ *
1130
+ * @tsplus fluent fncts.Vector takeWhile
1131
+ */
1132
+ export function takeWhile_<A>(as: Vector<A>, predicate: Predicate<A>): Vector<A> {
1133
+ const { index } = foldLeftCb(findNotIndexCb, { predicate, index: 0 }, as);
1134
+ return as.slice(0, index);
1135
+ }
1136
+
1137
+ /**
1138
+ * Takes the last `n` elements from a Vector and returns them in a new
1139
+ * Vector.
1140
+ *
1141
+ * @complexity `O(log(n))`
1142
+ * @tsplus fluent fncts.Vector takeLast
1143
+ */
1144
+ export function takeLast_<A>(as: Vector<A>, n: number): Vector<A> {
1145
+ return as.slice(as.length - n, as.length);
1146
+ }
1147
+
1148
+ /**
1149
+ * Takes the last elements in the Vector for which the predicate returns
1150
+ * `true`.
1151
+ *
1152
+ * @complexity `O(k + log(n))` where `k` is the number of elements
1153
+ * satisfying the predicate.
1154
+ *
1155
+ * @tsplus fluent fncts.Vector takeLastWhile
1156
+ */
1157
+ export function takeLastWhile_<A>(as: Vector<A>, predicate: Predicate<A>): Vector<A> {
1158
+ const { index } = foldRightCb(findNotIndexCb, { predicate, index: 0 }, as);
1159
+ return as.slice(as.length - index, as.length);
1160
+ }
1161
+
1162
+ /**
1163
+ * Converts a Vector into an array.
1164
+ *
1165
+ * @complexity `O(n)`
1166
+ * @tsplus getter fncts.Vector toArray
1167
+ */
1168
+ export function toArray<A>(self: Vector<A>): ReadonlyArray<A> {
1169
+ return self.foldLeft<A, A[]>([], arrayPush);
1170
+ }
1171
+
1172
+ /**
1173
+ * Converts a Vector into a List.
1174
+ *
1175
+ * @complexity `O(n)`
1176
+ * @tsplus getter fncts.Vector toList
1177
+ */
1178
+ export function toList<A>(self: Vector<A>): List<A> {
1179
+ const buffer = new ListBuffer<A>();
1180
+ self.forEach((a) => {
1181
+ buffer.append(a);
1182
+ });
1183
+ return buffer.toList;
1184
+ }
1185
+
1186
+ /**
1187
+ * Returns a new Vector without repeated elements by using the given
1188
+ * Eq instance to determine when elements are equal
1189
+ *
1190
+ * @complexity `O(n)`
1191
+ * @tsplus getter fncts.Vector uniq
1192
+ */
1193
+ export function uniq<A>(as: Vector<A>) {
1194
+ return (E: Eq<A>) => as.dropRepeatsWith(E.equals_);
1195
+ }
1196
+
1197
+ /**
1198
+ * @tsplus static fncts.VectorOps unfold
1199
+ */
1200
+ export function unfold<A, B>(b: B, f: (b: B) => Maybe<readonly [A, B]>): Vector<A> {
1201
+ const out = emptyPushable<A>();
1202
+ let state = b;
1203
+ // eslint-disable-next-line no-constant-condition
1204
+ while (true) {
1205
+ const mt = f(state);
1206
+ if (mt.isJust()) {
1207
+ const [a, b] = mt.value;
1208
+ out.push(a);
1209
+ state = b;
1210
+ } else {
1211
+ break;
1212
+ }
1213
+ }
1214
+ return out;
1215
+ }
1216
+
1217
+ function findCb<A>(value: A, state: PredState): boolean {
1218
+ if (state.predicate(value)) {
1219
+ state.result = value;
1220
+ return false;
1221
+ } else {
1222
+ return true;
1223
+ }
1224
+ }
1225
+
1226
+ /**
1227
+ * Returns the _first_ element for which the predicate returns `true`.
1228
+ * If no such element is found the function returns `undefined`.
1229
+ *
1230
+ * @complexity O(n)
1231
+ * @tsplus fluent fncts.Vector unsafeFind
1232
+ */
1233
+ export function unsafeFind_<A>(as: Vector<A>, predicate: Predicate<A>): A | undefined {
1234
+ return foldLeftCb<A, PredState>(findCb, { predicate, result: undefined }, as).result;
1235
+ }
1236
+
1237
+ /**
1238
+ * Returns the _last_ element for which the predicate returns `true`.
1239
+ * If no such element is found the function returns `undefined`.
1240
+ *
1241
+ * @complexity O(n)
1242
+ * @tsplus fluent fncts.Vector unsafeFindLast
1243
+ */
1244
+ export function unsafeFindLast_<A>(as: Vector<A>, predicate: Predicate<A>): A | undefined {
1245
+ return foldRightCb<A, PredState>(findCb, { predicate, result: undefined }, as).result;
1246
+ }
1247
+
1248
+ /**
1249
+ * Gets the nth element of the Vector. If `n` is out of bounds
1250
+ * `undefined` is returned.
1251
+ *
1252
+ * @complexity O(log(n))
1253
+ * @tsplus fluent fncts.Vector unsafeGet
1254
+ */
1255
+ export function unsafeGet_<A>(l: Vector<A>, index: number): A | undefined {
1256
+ if (index < 0 || l.length <= index) {
1257
+ return undefined;
1258
+ }
1259
+ const prefixSize = getPrefixSize(l);
1260
+ const suffixSize = getSuffixSize(l);
1261
+ if (index < prefixSize) {
1262
+ return l.prefix[prefixSize - index - 1];
1263
+ } else if (index >= l.length - suffixSize) {
1264
+ return l.suffix[index - (l.length - suffixSize)];
1265
+ }
1266
+ const { offset } = l;
1267
+ const depth = getDepth(l);
1268
+ return l.root!.sizes === undefined
1269
+ ? nodeNthDense(l.root!, depth, offset === 0 ? index - prefixSize : handleOffset(depth, offset, index - prefixSize))
1270
+ : nodeNth(l.root!, depth, offset, index - prefixSize);
1271
+ }
1272
+
1273
+ /**
1274
+ * Returns the first element of the Vector. If the Vector is empty the
1275
+ * function returns undefined.
1276
+ *
1277
+ * @complexity O(1)
1278
+ * @tsplus getter fncts.Vector unsafeHead
1279
+ */
1280
+ export function unsafeHead<A>(l: Vector<A>): A | undefined {
1281
+ const prefixSize = getPrefixSize(l);
1282
+ return prefixSize !== 0 ? l.prefix[prefixSize - 1] : l.length !== 0 ? l.suffix[0] : undefined;
1283
+ }
1284
+
1285
+ /**
1286
+ * Returns the last element of the Vector. If the Vector is empty the
1287
+ * function returns `undefined`.
1288
+ *
1289
+ * @complexity O(1)
1290
+ * @tsplus getter fncts.Vector unsafeLast
1291
+ */
1292
+ export function unsafeLast<A>(l: Vector<A>): A | undefined {
1293
+ const suffixSize = getSuffixSize(l);
1294
+ return suffixSize !== 0 ? l.suffix[suffixSize - 1] : l.length !== 0 ? l.prefix[0] : undefined;
1295
+ }
1296
+
1297
+ /**
1298
+ * Returns a Vector that has the entry specified by the index replaced with the given value.
1299
+ *
1300
+ * If the index is out of bounds the given Vector is returned unchanged.
1301
+ *
1302
+ * @complexity O(log(n))
1303
+ * @tsplus fluent fncts.Vector updateAt
1304
+ */
1305
+ export function updateAt_<A>(as: Vector<A>, i: number, a: A): Vector<A> {
1306
+ if (i < 0 || as.length <= i) {
1307
+ return as;
1308
+ }
1309
+ const prefixSize = getPrefixSize(as);
1310
+ const suffixSize = getSuffixSize(as);
1311
+ const newVector = mutableClone(as);
1312
+ if (i < prefixSize) {
1313
+ const newPrefix = copyArray(newVector.prefix);
1314
+ newPrefix[newPrefix.length - i - 1] = a;
1315
+ newVector.prefix = newPrefix;
1316
+ } else if (i >= as.length - suffixSize) {
1317
+ const newSuffix = copyArray(newVector.suffix);
1318
+ newSuffix[i - (as.length - suffixSize)] = a;
1319
+ newVector.suffix = newSuffix;
1320
+ } else {
1321
+ newVector.root = updateNode(as.root!, getDepth(as), i - prefixSize, as.offset, a);
1322
+ }
1323
+ return newVector;
1324
+ }
1325
+
1326
+ /**
1327
+ * @tsplus static fncts.VectorOps __call
1328
+ */
1329
+ export function vector<A>(...elements: ReadonlyArray<A>): Vector<A> {
1330
+ const v = Vector.emptyPushable<A>();
1331
+ for (const element of elements) {
1332
+ v.push(element);
1333
+ }
1334
+ return v;
1335
+ }