@fncts/base 0.0.20 → 0.0.21

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 (975) hide show
  1. package/_cjs/collection/Iterable/api/traverseConc.cjs +8 -8
  2. package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
  3. package/_cjs/collection/Iterable/api.cjs +497 -444
  4. package/_cjs/collection/Iterable/api.cjs.map +1 -1
  5. package/_cjs/collection/Iterable/constructors.cjs +7 -7
  6. package/_cjs/collection/Iterable/constructors.cjs.map +1 -1
  7. package/_cjs/collection/compat/Array/api.cjs +16 -12
  8. package/_cjs/collection/compat/Array/api.cjs.map +1 -1
  9. package/_cjs/collection/compat/Array/derivations.cjs +41 -19
  10. package/_cjs/collection/compat/Array/derivations.cjs.map +1 -1
  11. package/_cjs/collection/compat/ArrayLike/api.cjs +1 -1
  12. package/_cjs/collection/compat/ArrayLike/api.cjs.map +1 -1
  13. package/_cjs/collection/compat/Record/instances.cjs +39 -3
  14. package/_cjs/collection/compat/Record/instances.cjs.map +1 -1
  15. package/_cjs/collection/immutable/Conc/api/makeBy.cjs +1 -1
  16. package/_cjs/collection/immutable/Conc/api/makeBy.cjs.map +1 -1
  17. package/_cjs/collection/immutable/Conc/api.cjs +866 -765
  18. package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
  19. package/_cjs/collection/immutable/Conc/definition.cjs +55 -53
  20. package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
  21. package/_cjs/collection/immutable/Conc/derivations.cjs +13 -2
  22. package/_cjs/collection/immutable/Conc/derivations.cjs.map +1 -1
  23. package/_cjs/collection/immutable/Conc.cjs.map +1 -1
  24. package/_cjs/collection/immutable/Dictionary/api.cjs +57 -44
  25. package/_cjs/collection/immutable/Dictionary/api.cjs.map +1 -1
  26. package/_cjs/collection/immutable/HashMap/api.cjs +351 -258
  27. package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
  28. package/_cjs/collection/immutable/HashMap/definition.cjs +1 -1
  29. package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
  30. package/_cjs/collection/immutable/HashMap/internal.cjs.map +1 -1
  31. package/_cjs/collection/immutable/HashSet/api.cjs +230 -192
  32. package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
  33. package/_cjs/collection/immutable/HashSet/definition.cjs +1 -1
  34. package/_cjs/collection/immutable/HashSet/definition.cjs.map +1 -1
  35. package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs +6 -4
  36. package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs.map +1 -1
  37. package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs +6 -4
  38. package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs.map +1 -1
  39. package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs +6 -4
  40. package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs.map +1 -1
  41. package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs +15 -13
  42. package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs.map +1 -1
  43. package/_cjs/collection/immutable/ImmutableArray/api.cjs +943 -749
  44. package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
  45. package/_cjs/collection/immutable/ImmutableArray/derivations.cjs +12 -1
  46. package/_cjs/collection/immutable/ImmutableArray/derivations.cjs.map +1 -1
  47. package/_cjs/collection/immutable/ImmutableArray/instances.cjs +33 -33
  48. package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
  49. package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -1
  50. package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +338 -273
  51. package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
  52. package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +1 -1
  53. package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
  54. package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs +15 -4
  55. package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs.map +1 -1
  56. package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs +2 -2
  57. package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs.map +1 -1
  58. package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +12 -12
  59. package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
  60. package/_cjs/collection/immutable/List/api/foldLeft.cjs +12 -10
  61. package/_cjs/collection/immutable/List/api/foldLeft.cjs.map +1 -1
  62. package/_cjs/collection/immutable/List/api.cjs +164 -141
  63. package/_cjs/collection/immutable/List/api.cjs.map +1 -1
  64. package/_cjs/collection/immutable/List.cjs.map +1 -1
  65. package/_cjs/collection/immutable/Queue/api.cjs +64 -48
  66. package/_cjs/collection/immutable/Queue/api.cjs.map +1 -1
  67. package/_cjs/collection/immutable/Queue/definition.cjs +1 -1
  68. package/_cjs/collection/immutable/Queue/definition.cjs.map +1 -1
  69. package/_cjs/collection/immutable/RoseTree/api.cjs +50 -36
  70. package/_cjs/collection/immutable/RoseTree/api.cjs.map +1 -1
  71. package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -1
  72. package/_cjs/collection/immutable/SortedMap/api.cjs +408 -368
  73. package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -1
  74. package/_cjs/collection/immutable/Vector/api.cjs +723 -608
  75. package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
  76. package/_cjs/collection/immutable/Vector/definition.cjs +18 -16
  77. package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
  78. package/_cjs/collection/immutable/Vector/internal.cjs +40 -39
  79. package/_cjs/collection/immutable/Vector/internal.cjs.map +1 -1
  80. package/_cjs/collection/mutable/HashMap.cjs +3 -5
  81. package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
  82. package/_cjs/collection/mutable/HashSet.cjs.map +1 -1
  83. package/_cjs/collection/mutable/ListBuffer.cjs +2 -2
  84. package/_cjs/collection/mutable/ListBuffer.cjs.map +1 -1
  85. package/_cjs/collection/mutable/internal.cjs +0 -2
  86. package/_cjs/collection/mutable/internal.cjs.map +1 -1
  87. package/_cjs/collection/weak/IterableWeakMap.cjs +7 -7
  88. package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
  89. package/_cjs/collection/weak/IterableWeakSet.cjs +7 -7
  90. package/_cjs/collection/weak/IterableWeakSet.cjs.map +1 -1
  91. package/_cjs/control/Eval/api.cjs +55 -43
  92. package/_cjs/control/Eval/api.cjs.map +1 -1
  93. package/_cjs/control/Eval/instance.cjs +4 -4
  94. package/_cjs/control/Eval/instance.cjs.map +1 -1
  95. package/_cjs/control/Eval/run.cjs +1 -1
  96. package/_cjs/control/Eval/run.cjs.map +1 -1
  97. package/_cjs/control/Z/api.cjs +241 -172
  98. package/_cjs/control/Z/api.cjs.map +1 -1
  99. package/_cjs/control/Z/instances.cjs +3 -3
  100. package/_cjs/control/Z/instances.cjs.map +1 -1
  101. package/_cjs/control/Z/runtime.cjs +250 -241
  102. package/_cjs/control/Z/runtime.cjs.map +1 -1
  103. package/_cjs/data/Branded/definition.cjs.map +1 -1
  104. package/_cjs/data/Branded/derivations.cjs +3 -3
  105. package/_cjs/data/Branded/derivations.cjs.map +1 -1
  106. package/_cjs/data/CaseClass.cjs.map +1 -1
  107. package/_cjs/data/Cause/api/fold.cjs +20 -18
  108. package/_cjs/data/Cause/api/fold.cjs.map +1 -1
  109. package/_cjs/data/Cause/api/isEmpty.cjs +1 -1
  110. package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -1
  111. package/_cjs/data/Cause/api/linearize.cjs +8 -8
  112. package/_cjs/data/Cause/api/linearize.cjs.map +1 -1
  113. package/_cjs/data/Cause/api/prettyPrint.cjs +1 -1
  114. package/_cjs/data/Cause/api/prettyPrint.cjs.map +1 -1
  115. package/_cjs/data/Cause/api.cjs +160 -140
  116. package/_cjs/data/Cause/api.cjs.map +1 -1
  117. package/_cjs/data/Cause/definition.cjs +18 -18
  118. package/_cjs/data/Cause/definition.cjs.map +1 -1
  119. package/_cjs/data/Cause.cjs.map +1 -1
  120. package/_cjs/data/Const/api.cjs +8 -6
  121. package/_cjs/data/Const/api.cjs.map +1 -1
  122. package/_cjs/data/Const/instances.cjs +4 -4
  123. package/_cjs/data/Const/instances.cjs.map +1 -1
  124. package/_cjs/data/Datum/api.cjs +219 -176
  125. package/_cjs/data/Datum/api.cjs.map +1 -1
  126. package/_cjs/data/Datum/definition.cjs.map +1 -1
  127. package/_cjs/data/DatumEither/api.cjs +165 -133
  128. package/_cjs/data/DatumEither/api.cjs.map +1 -1
  129. package/_cjs/data/DecodeError/definition.cjs +14 -14
  130. package/_cjs/data/DecodeError/definition.cjs.map +1 -1
  131. package/_cjs/data/Decoder/api.cjs +9 -7
  132. package/_cjs/data/Decoder/api.cjs.map +1 -1
  133. package/_cjs/data/Duration/api.cjs +18 -12
  134. package/_cjs/data/Duration/api.cjs.map +1 -1
  135. package/_cjs/data/Either/api/align.cjs +8 -3
  136. package/_cjs/data/Either/api/align.cjs.map +1 -1
  137. package/_cjs/data/Either/api/alignWith.cjs +14 -12
  138. package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
  139. package/_cjs/data/Either/api.cjs +206 -169
  140. package/_cjs/data/Either/api.cjs.map +1 -1
  141. package/_cjs/data/Either/constructors.cjs +11 -9
  142. package/_cjs/data/Either/constructors.cjs.map +1 -1
  143. package/_cjs/data/Either/destructors.cjs +16 -14
  144. package/_cjs/data/Either/destructors.cjs.map +1 -1
  145. package/_cjs/data/Either/instances.cjs +8 -8
  146. package/_cjs/data/Either/instances.cjs.map +1 -1
  147. package/_cjs/data/EitherT/api.cjs +8 -8
  148. package/_cjs/data/EitherT/api.cjs.map +1 -1
  149. package/_cjs/data/Encoder/api.cjs +134 -0
  150. package/_cjs/data/Encoder/api.cjs.map +1 -0
  151. package/_cjs/data/Encoder/definition.cjs +25 -0
  152. package/_cjs/data/Encoder/definition.cjs.map +1 -0
  153. package/_cjs/data/Encoder.cjs +32 -0
  154. package/_cjs/data/Encoder.cjs.map +1 -0
  155. package/_cjs/data/Environment/api.cjs +45 -33
  156. package/_cjs/data/Environment/api.cjs.map +1 -1
  157. package/_cjs/data/EnvironmentPatch.cjs +17 -13
  158. package/_cjs/data/EnvironmentPatch.cjs.map +1 -1
  159. package/_cjs/data/ExecutionStrategy.cjs +21 -29
  160. package/_cjs/data/ExecutionStrategy.cjs.map +1 -1
  161. package/_cjs/data/Exit/api.cjs +159 -127
  162. package/_cjs/data/Exit/api.cjs.map +1 -1
  163. package/_cjs/data/Exit/constructors.cjs +4 -4
  164. package/_cjs/data/Exit/constructors.cjs.map +1 -1
  165. package/_cjs/data/FiberId/api.cjs +23 -21
  166. package/_cjs/data/FiberId/api.cjs.map +1 -1
  167. package/_cjs/data/FiberId/constructors.cjs.map +1 -1
  168. package/_cjs/data/Identity/api.cjs +26 -18
  169. package/_cjs/data/Identity/api.cjs.map +1 -1
  170. package/_cjs/data/Identity/instances.cjs +3 -3
  171. package/_cjs/data/Identity/instances.cjs.map +1 -1
  172. package/_cjs/data/Interval.cjs +43 -33
  173. package/_cjs/data/Interval.cjs.map +1 -1
  174. package/_cjs/data/Intervals.cjs +35 -27
  175. package/_cjs/data/Intervals.cjs.map +1 -1
  176. package/_cjs/data/Maybe/api.cjs +160 -125
  177. package/_cjs/data/Maybe/api.cjs.map +1 -1
  178. package/_cjs/data/Maybe/constructors.cjs +2 -2
  179. package/_cjs/data/Maybe/constructors.cjs.map +1 -1
  180. package/_cjs/data/Maybe/definition.cjs.map +1 -1
  181. package/_cjs/data/Maybe/destructors.cjs +9 -7
  182. package/_cjs/data/Maybe/destructors.cjs.map +1 -1
  183. package/_cjs/data/Maybe/instances.cjs +11 -11
  184. package/_cjs/data/Maybe/instances.cjs.map +1 -1
  185. package/_cjs/data/Predicate/api.cjs +10 -8
  186. package/_cjs/data/Predicate/api.cjs.map +1 -1
  187. package/_cjs/data/Refinement/api.cjs +15 -9
  188. package/_cjs/data/Refinement/api.cjs.map +1 -1
  189. package/_cjs/data/Struct/api.cjs +62 -50
  190. package/_cjs/data/Struct/api.cjs.map +1 -1
  191. package/_cjs/data/Tag/constructors.cjs +3 -2
  192. package/_cjs/data/Tag/constructors.cjs.map +1 -1
  193. package/_cjs/data/Tag/definition.cjs +0 -3
  194. package/_cjs/data/Tag/definition.cjs.map +1 -1
  195. package/_cjs/data/These/api.cjs +188 -170
  196. package/_cjs/data/These/api.cjs.map +1 -1
  197. package/_cjs/data/These/constructors.cjs +1 -1
  198. package/_cjs/data/These/constructors.cjs.map +1 -1
  199. package/_cjs/data/These/destructors.cjs +39 -35
  200. package/_cjs/data/These/destructors.cjs.map +1 -1
  201. package/_cjs/data/These/instances.cjs +1 -1
  202. package/_cjs/data/These/instances.cjs.map +1 -1
  203. package/_cjs/data/Trace/api.cjs +7 -5
  204. package/_cjs/data/Trace/api.cjs.map +1 -1
  205. package/_cjs/data/Zipped.cjs.map +1 -1
  206. package/_cjs/data/function/api.cjs +6 -4
  207. package/_cjs/data/function/api.cjs.map +1 -1
  208. package/_cjs/data/function/pipe.cjs +9 -0
  209. package/_cjs/data/function/pipe.cjs.map +1 -1
  210. package/_cjs/data/string/api.cjs +53 -96
  211. package/_cjs/data/string/api.cjs.map +1 -1
  212. package/_cjs/global/api.cjs +4 -2
  213. package/_cjs/global/api.cjs.map +1 -1
  214. package/_cjs/internal/AtomicBoolean.cjs.map +1 -1
  215. package/_cjs/internal/AtomicNumber.cjs.map +1 -1
  216. package/_cjs/internal/AtomicReference.cjs.map +1 -1
  217. package/_cjs/internal/Stack.cjs +2 -2
  218. package/_cjs/internal/Stack.cjs.map +1 -1
  219. package/_cjs/optics/At/api.cjs +1 -1
  220. package/_cjs/optics/At/api.cjs.map +1 -1
  221. package/_cjs/optics/At/definition.cjs +2 -2
  222. package/_cjs/optics/At/definition.cjs.map +1 -1
  223. package/_cjs/optics/Fold/definition.cjs +3 -4
  224. package/_cjs/optics/Fold/definition.cjs.map +1 -1
  225. package/_cjs/optics/Getter/definition.cjs +2 -3
  226. package/_cjs/optics/Getter/definition.cjs.map +1 -1
  227. package/_cjs/optics/Index/api.cjs +4 -4
  228. package/_cjs/optics/Index/api.cjs.map +1 -1
  229. package/_cjs/optics/Index/definition.cjs +2 -2
  230. package/_cjs/optics/Index/definition.cjs.map +1 -1
  231. package/_cjs/optics/Iso/api.cjs +9 -7
  232. package/_cjs/optics/Iso/api.cjs.map +1 -1
  233. package/_cjs/optics/Iso/definition.cjs +12 -12
  234. package/_cjs/optics/Iso/definition.cjs.map +1 -1
  235. package/_cjs/optics/Lens/api.cjs +54 -44
  236. package/_cjs/optics/Lens/api.cjs.map +1 -1
  237. package/_cjs/optics/Lens/definition.cjs +10 -10
  238. package/_cjs/optics/Lens/definition.cjs.map +1 -1
  239. package/_cjs/optics/Optional/api/compose.cjs +9 -7
  240. package/_cjs/optics/Optional/api/compose.cjs.map +1 -1
  241. package/_cjs/optics/Optional/definition.cjs +12 -13
  242. package/_cjs/optics/Optional/definition.cjs.map +1 -1
  243. package/_cjs/optics/Optional.cjs.map +1 -1
  244. package/_cjs/optics/Prism/api/compose.cjs +9 -7
  245. package/_cjs/optics/Prism/api/compose.cjs.map +1 -1
  246. package/_cjs/optics/Prism/api/fromNullable.cjs +2 -2
  247. package/_cjs/optics/Prism/api/fromNullable.cjs.map +1 -1
  248. package/_cjs/optics/Prism/api/just.cjs +2 -2
  249. package/_cjs/optics/Prism/api/just.cjs.map +1 -1
  250. package/_cjs/optics/Prism/definition.cjs +9 -9
  251. package/_cjs/optics/Prism/definition.cjs.map +1 -1
  252. package/_cjs/optics/Prism.cjs.map +1 -1
  253. package/_cjs/optics/Setter/definition.cjs +8 -13
  254. package/_cjs/optics/Setter/definition.cjs.map +1 -1
  255. package/_cjs/optics/Traversal/api/compose.cjs +8 -6
  256. package/_cjs/optics/Traversal/api/compose.cjs.map +1 -1
  257. package/_cjs/optics/Traversal/api/fromTraversable.cjs +2 -2
  258. package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
  259. package/_cjs/optics/Traversal/definition.cjs +12 -12
  260. package/_cjs/optics/Traversal/definition.cjs.map +1 -1
  261. package/_cjs/optics/Traversal.cjs.map +1 -1
  262. package/_cjs/typeclass/Align.cjs.map +1 -1
  263. package/_cjs/typeclass/Alt.cjs.map +1 -1
  264. package/_cjs/typeclass/Applicative.cjs.map +1 -1
  265. package/_cjs/typeclass/ApplicativeExcept.cjs +5 -10
  266. package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
  267. package/_cjs/typeclass/Apply.cjs +8 -8
  268. package/_cjs/typeclass/Apply.cjs.map +1 -1
  269. package/_cjs/typeclass/Chain.cjs +4 -4
  270. package/_cjs/typeclass/Chain.cjs.map +1 -1
  271. package/_cjs/typeclass/Eq/definition.cjs.map +1 -1
  272. package/_cjs/typeclass/Eq/derivations.cjs.map +1 -1
  273. package/_cjs/typeclass/Equatable/api.cjs.map +1 -1
  274. package/_cjs/typeclass/Equatable/definition.cjs.map +1 -1
  275. package/_cjs/typeclass/Equatable/fast-equals.cjs.map +1 -1
  276. package/_cjs/typeclass/Filterable.cjs.map +1 -1
  277. package/_cjs/typeclass/FilterableWithIndex.cjs.map +1 -1
  278. package/_cjs/typeclass/Foldable.cjs +1 -1
  279. package/_cjs/typeclass/Foldable.cjs.map +1 -1
  280. package/_cjs/typeclass/FoldableWithIndex.cjs +1 -1
  281. package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
  282. package/_cjs/typeclass/Functor.cjs.map +1 -1
  283. package/_cjs/typeclass/FunctorWithIndex.cjs.map +1 -1
  284. package/_cjs/typeclass/Guard/api.cjs +18 -10
  285. package/_cjs/typeclass/Guard/api.cjs.map +1 -1
  286. package/_cjs/typeclass/Guard/definition.cjs.map +1 -1
  287. package/_cjs/typeclass/Guard/derivations.cjs.map +1 -1
  288. package/_cjs/typeclass/Has.cjs +7 -5
  289. package/_cjs/typeclass/Has.cjs.map +1 -1
  290. package/_cjs/typeclass/HashEq.cjs.map +1 -1
  291. package/_cjs/typeclass/Hashable/definition.cjs.map +1 -1
  292. package/_cjs/typeclass/Hashable/hash.cjs.map +1 -1
  293. package/_cjs/typeclass/MonadExcept.cjs +1 -1
  294. package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
  295. package/_cjs/typeclass/Ord/api/contramap.cjs +7 -5
  296. package/_cjs/typeclass/Ord/api/contramap.cjs.map +1 -1
  297. package/_cjs/typeclass/Ord/api/max.cjs.map +1 -1
  298. package/_cjs/typeclass/Ord/api/min.cjs.map +1 -1
  299. package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
  300. package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
  301. package/_cjs/typeclass/Ordering.cjs.map +1 -1
  302. package/_cjs/typeclass/Semialign.cjs +7 -7
  303. package/_cjs/typeclass/Semialign.cjs.map +1 -1
  304. package/_cjs/typeclass/Semigroup/api.cjs.map +1 -1
  305. package/_cjs/typeclass/Semigroup/definition.cjs.map +1 -1
  306. package/_cjs/typeclass/Semigroup/derivations.cjs.map +1 -1
  307. package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
  308. package/_cjs/typeclass/Showable/definition.cjs.map +1 -1
  309. package/_cjs/typeclass/Showable/show.cjs +107 -107
  310. package/_cjs/typeclass/Showable/show.cjs.map +1 -1
  311. package/_cjs/typeclass/Showable/styles.cjs.map +1 -1
  312. package/_cjs/typeclass/Showable/util.cjs +1 -1
  313. package/_cjs/typeclass/Showable/util.cjs.map +1 -1
  314. package/_cjs/typeclass/Traversable.cjs +1 -2
  315. package/_cjs/typeclass/Traversable.cjs.map +1 -1
  316. package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
  317. package/_cjs/typeclass/Witherable.cjs +3 -1
  318. package/_cjs/typeclass/Witherable.cjs.map +1 -1
  319. package/_cjs/typeclass/WitherableWithIndex.cjs +3 -1
  320. package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
  321. package/_cjs/util/AnsiFormat.cjs +11 -11
  322. package/_cjs/util/AnsiFormat.cjs.map +1 -1
  323. package/_cjs/util/PCGRandom.cjs.map +1 -1
  324. package/_cjs/util/assert.cjs.map +1 -1
  325. package/_cjs/util/pattern.cjs.map +1 -1
  326. package/_cjs/util/predicates.cjs.map +1 -1
  327. package/_cjs/util/rand/Random.cjs.map +1 -1
  328. package/_cjs/util/rand/distribution/UniformArrayIntDistribution.cjs.map +1 -1
  329. package/_cjs/util/rand/distribution/UniformBigIntDistribution.cjs.map +1 -1
  330. package/_cjs/util/rand/distribution/UniformIntDistribution.cjs.map +1 -1
  331. package/_cjs/util/rand/distribution/internals/ArrayInt.cjs.map +1 -1
  332. package/_cjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.cjs.map +1 -1
  333. package/_cjs/util/rand/distribution/internals/UniformIntDistributionInternal.cjs.map +1 -1
  334. package/_cjs/util/rand/generator/MersenneTwister.cjs.map +1 -1
  335. package/_cjs/util/rand/generator/RandomGenerator.cjs.map +1 -1
  336. package/_cjs/util/rand.cjs.map +1 -1
  337. package/_mjs/collection/Iterable/api/traverseConc.mjs +5 -5
  338. package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
  339. package/_mjs/collection/Iterable/api.mjs +465 -411
  340. package/_mjs/collection/Iterable/api.mjs.map +1 -1
  341. package/_mjs/collection/Iterable/constructors.mjs +5 -5
  342. package/_mjs/collection/Iterable/constructors.mjs.map +1 -1
  343. package/_mjs/collection/compat/Array/api.mjs +16 -12
  344. package/_mjs/collection/compat/Array/api.mjs.map +1 -1
  345. package/_mjs/collection/compat/Array/derivations.mjs +35 -19
  346. package/_mjs/collection/compat/Array/derivations.mjs.map +1 -1
  347. package/_mjs/collection/compat/ArrayLike/api.mjs +1 -1
  348. package/_mjs/collection/compat/ArrayLike/api.mjs.map +1 -1
  349. package/_mjs/collection/compat/Record/instances.mjs +34 -3
  350. package/_mjs/collection/compat/Record/instances.mjs.map +1 -1
  351. package/_mjs/collection/immutable/Conc/api/makeBy.mjs +1 -1
  352. package/_mjs/collection/immutable/Conc/api/makeBy.mjs.map +1 -1
  353. package/_mjs/collection/immutable/Conc/api.mjs +795 -697
  354. package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
  355. package/_mjs/collection/immutable/Conc/definition.mjs +53 -51
  356. package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
  357. package/_mjs/collection/immutable/Conc/derivations.mjs +10 -2
  358. package/_mjs/collection/immutable/Conc/derivations.mjs.map +1 -1
  359. package/_mjs/collection/immutable/Conc.mjs.map +1 -1
  360. package/_mjs/collection/immutable/Dictionary/api.mjs +47 -35
  361. package/_mjs/collection/immutable/Dictionary/api.mjs.map +1 -1
  362. package/_mjs/collection/immutable/HashMap/api.mjs +295 -217
  363. package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
  364. package/_mjs/collection/immutable/HashMap/definition.mjs +1 -1
  365. package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
  366. package/_mjs/collection/immutable/HashMap/internal.mjs.map +1 -1
  367. package/_mjs/collection/immutable/HashSet/api.mjs +206 -168
  368. package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
  369. package/_mjs/collection/immutable/HashSet/definition.mjs +1 -1
  370. package/_mjs/collection/immutable/HashSet/definition.mjs.map +1 -1
  371. package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs +5 -3
  372. package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs.map +1 -1
  373. package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs +5 -3
  374. package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs.map +1 -1
  375. package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs +5 -3
  376. package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs.map +1 -1
  377. package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs +13 -11
  378. package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs.map +1 -1
  379. package/_mjs/collection/immutable/ImmutableArray/api.mjs +816 -629
  380. package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
  381. package/_mjs/collection/immutable/ImmutableArray/derivations.mjs +9 -1
  382. package/_mjs/collection/immutable/ImmutableArray/derivations.mjs.map +1 -1
  383. package/_mjs/collection/immutable/ImmutableArray/instances.mjs +34 -34
  384. package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
  385. package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -1
  386. package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +301 -239
  387. package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
  388. package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +1 -1
  389. package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
  390. package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs +12 -4
  391. package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs.map +1 -1
  392. package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs +2 -2
  393. package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs.map +1 -1
  394. package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +13 -13
  395. package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
  396. package/_mjs/collection/immutable/List/api/foldLeft.mjs +11 -9
  397. package/_mjs/collection/immutable/List/api/foldLeft.mjs.map +1 -1
  398. package/_mjs/collection/immutable/List/api.mjs +157 -133
  399. package/_mjs/collection/immutable/List/api.mjs.map +1 -1
  400. package/_mjs/collection/immutable/List.mjs.map +1 -1
  401. package/_mjs/collection/immutable/Queue/api.mjs +55 -39
  402. package/_mjs/collection/immutable/Queue/api.mjs.map +1 -1
  403. package/_mjs/collection/immutable/Queue/definition.mjs +1 -1
  404. package/_mjs/collection/immutable/Queue/definition.mjs.map +1 -1
  405. package/_mjs/collection/immutable/RoseTree/api.mjs +50 -36
  406. package/_mjs/collection/immutable/RoseTree/api.mjs.map +1 -1
  407. package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -1
  408. package/_mjs/collection/immutable/SortedMap/api.mjs +398 -358
  409. package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
  410. package/_mjs/collection/immutable/Vector/api.mjs +650 -538
  411. package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
  412. package/_mjs/collection/immutable/Vector/definition.mjs +16 -14
  413. package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
  414. package/_mjs/collection/immutable/Vector/internal.mjs +40 -39
  415. package/_mjs/collection/immutable/Vector/internal.mjs.map +1 -1
  416. package/_mjs/collection/mutable/HashMap.mjs +3 -5
  417. package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
  418. package/_mjs/collection/mutable/HashSet.mjs.map +1 -1
  419. package/_mjs/collection/mutable/ListBuffer.mjs +2 -2
  420. package/_mjs/collection/mutable/ListBuffer.mjs.map +1 -1
  421. package/_mjs/collection/mutable/internal.mjs +0 -2
  422. package/_mjs/collection/mutable/internal.mjs.map +1 -1
  423. package/_mjs/collection/weak/IterableWeakMap.mjs +7 -7
  424. package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
  425. package/_mjs/collection/weak/IterableWeakSet.mjs +7 -7
  426. package/_mjs/collection/weak/IterableWeakSet.mjs.map +1 -1
  427. package/_mjs/control/Eval/api.mjs +40 -28
  428. package/_mjs/control/Eval/api.mjs.map +1 -1
  429. package/_mjs/control/Eval/instance.mjs +5 -5
  430. package/_mjs/control/Eval/instance.mjs.map +1 -1
  431. package/_mjs/control/Eval/run.mjs +1 -1
  432. package/_mjs/control/Eval/run.mjs.map +1 -1
  433. package/_mjs/control/Z/api.mjs +196 -128
  434. package/_mjs/control/Z/api.mjs.map +1 -1
  435. package/_mjs/control/Z/instances.mjs +4 -4
  436. package/_mjs/control/Z/instances.mjs.map +1 -1
  437. package/_mjs/control/Z/runtime.mjs +244 -234
  438. package/_mjs/control/Z/runtime.mjs.map +1 -1
  439. package/_mjs/data/Branded/definition.mjs.map +1 -1
  440. package/_mjs/data/Branded/derivations.mjs +3 -3
  441. package/_mjs/data/Branded/derivations.mjs.map +1 -1
  442. package/_mjs/data/CaseClass.mjs.map +1 -1
  443. package/_mjs/data/Cause/api/fold.mjs +19 -17
  444. package/_mjs/data/Cause/api/fold.mjs.map +1 -1
  445. package/_mjs/data/Cause/api/isEmpty.mjs +1 -1
  446. package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -1
  447. package/_mjs/data/Cause/api/linearize.mjs +8 -8
  448. package/_mjs/data/Cause/api/linearize.mjs.map +1 -1
  449. package/_mjs/data/Cause/api/prettyPrint.mjs +1 -1
  450. package/_mjs/data/Cause/api/prettyPrint.mjs.map +1 -1
  451. package/_mjs/data/Cause/api.mjs +149 -129
  452. package/_mjs/data/Cause/api.mjs.map +1 -1
  453. package/_mjs/data/Cause/definition.mjs +18 -18
  454. package/_mjs/data/Cause/definition.mjs.map +1 -1
  455. package/_mjs/data/Cause.mjs.map +1 -1
  456. package/_mjs/data/Const/api.mjs +6 -4
  457. package/_mjs/data/Const/api.mjs.map +1 -1
  458. package/_mjs/data/Const/instances.mjs +4 -4
  459. package/_mjs/data/Const/instances.mjs.map +1 -1
  460. package/_mjs/data/Datum/api.mjs +220 -179
  461. package/_mjs/data/Datum/api.mjs.map +1 -1
  462. package/_mjs/data/Datum/definition.mjs.map +1 -1
  463. package/_mjs/data/DatumEither/api.mjs +163 -132
  464. package/_mjs/data/DatumEither/api.mjs.map +1 -1
  465. package/_mjs/data/DecodeError/definition.mjs +14 -14
  466. package/_mjs/data/DecodeError/definition.mjs.map +1 -1
  467. package/_mjs/data/Decoder/api.mjs +9 -7
  468. package/_mjs/data/Decoder/api.mjs.map +1 -1
  469. package/_mjs/data/Duration/api.mjs +16 -10
  470. package/_mjs/data/Duration/api.mjs.map +1 -1
  471. package/_mjs/data/Either/api/align.mjs +8 -2
  472. package/_mjs/data/Either/api/align.mjs.map +1 -1
  473. package/_mjs/data/Either/api/alignWith.mjs +13 -11
  474. package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
  475. package/_mjs/data/Either/api.mjs +175 -136
  476. package/_mjs/data/Either/api.mjs.map +1 -1
  477. package/_mjs/data/Either/constructors.mjs +7 -5
  478. package/_mjs/data/Either/constructors.mjs.map +1 -1
  479. package/_mjs/data/Either/destructors.mjs +15 -13
  480. package/_mjs/data/Either/destructors.mjs.map +1 -1
  481. package/_mjs/data/Either/instances.mjs +9 -9
  482. package/_mjs/data/Either/instances.mjs.map +1 -1
  483. package/_mjs/data/EitherT/api.mjs +8 -8
  484. package/_mjs/data/EitherT/api.mjs.map +1 -1
  485. package/_mjs/data/Encoder/api.mjs +102 -0
  486. package/_mjs/data/Encoder/api.mjs.map +1 -0
  487. package/_mjs/data/Encoder/definition.mjs +15 -0
  488. package/_mjs/data/Encoder/definition.mjs.map +1 -0
  489. package/_mjs/data/Encoder.mjs +4 -0
  490. package/_mjs/data/Encoder.mjs.map +1 -0
  491. package/_mjs/data/Environment/api.mjs +45 -33
  492. package/_mjs/data/Environment/api.mjs.map +1 -1
  493. package/_mjs/data/EnvironmentPatch.mjs +17 -13
  494. package/_mjs/data/EnvironmentPatch.mjs.map +1 -1
  495. package/_mjs/data/ExecutionStrategy.mjs +19 -27
  496. package/_mjs/data/ExecutionStrategy.mjs.map +1 -1
  497. package/_mjs/data/Exit/api.mjs +140 -108
  498. package/_mjs/data/Exit/api.mjs.map +1 -1
  499. package/_mjs/data/Exit/constructors.mjs +3 -3
  500. package/_mjs/data/Exit/constructors.mjs.map +1 -1
  501. package/_mjs/data/FiberId/api.mjs +22 -20
  502. package/_mjs/data/FiberId/api.mjs.map +1 -1
  503. package/_mjs/data/FiberId/constructors.mjs.map +1 -1
  504. package/_mjs/data/Identity/api.mjs +21 -13
  505. package/_mjs/data/Identity/api.mjs.map +1 -1
  506. package/_mjs/data/Identity/instances.mjs +4 -4
  507. package/_mjs/data/Identity/instances.mjs.map +1 -1
  508. package/_mjs/data/Interval.mjs +38 -28
  509. package/_mjs/data/Interval.mjs.map +1 -1
  510. package/_mjs/data/Intervals.mjs +35 -27
  511. package/_mjs/data/Intervals.mjs.map +1 -1
  512. package/_mjs/data/Maybe/api.mjs +141 -106
  513. package/_mjs/data/Maybe/api.mjs.map +1 -1
  514. package/_mjs/data/Maybe/constructors.mjs +1 -1
  515. package/_mjs/data/Maybe/constructors.mjs.map +1 -1
  516. package/_mjs/data/Maybe/definition.mjs.map +1 -1
  517. package/_mjs/data/Maybe/destructors.mjs +8 -6
  518. package/_mjs/data/Maybe/destructors.mjs.map +1 -1
  519. package/_mjs/data/Maybe/instances.mjs +12 -12
  520. package/_mjs/data/Maybe/instances.mjs.map +1 -1
  521. package/_mjs/data/Predicate/api.mjs +10 -8
  522. package/_mjs/data/Predicate/api.mjs.map +1 -1
  523. package/_mjs/data/Refinement/api.mjs +15 -9
  524. package/_mjs/data/Refinement/api.mjs.map +1 -1
  525. package/_mjs/data/Struct/api.mjs +56 -44
  526. package/_mjs/data/Struct/api.mjs.map +1 -1
  527. package/_mjs/data/Tag/constructors.mjs +3 -2
  528. package/_mjs/data/Tag/constructors.mjs.map +1 -1
  529. package/_mjs/data/Tag/definition.mjs +0 -2
  530. package/_mjs/data/Tag/definition.mjs.map +1 -1
  531. package/_mjs/data/These/api.mjs +187 -169
  532. package/_mjs/data/These/api.mjs.map +1 -1
  533. package/_mjs/data/These/constructors.mjs +1 -1
  534. package/_mjs/data/These/constructors.mjs.map +1 -1
  535. package/_mjs/data/These/destructors.mjs +35 -31
  536. package/_mjs/data/These/destructors.mjs.map +1 -1
  537. package/_mjs/data/These/instances.mjs +1 -1
  538. package/_mjs/data/These/instances.mjs.map +1 -1
  539. package/_mjs/data/Trace/api.mjs +6 -4
  540. package/_mjs/data/Trace/api.mjs.map +1 -1
  541. package/_mjs/data/Zipped.mjs.map +1 -1
  542. package/_mjs/data/function/api.mjs +5 -3
  543. package/_mjs/data/function/api.mjs.map +1 -1
  544. package/_mjs/data/function/pipe.mjs +7 -0
  545. package/_mjs/data/function/pipe.mjs.map +1 -1
  546. package/_mjs/data/string/api.mjs +46 -66
  547. package/_mjs/data/string/api.mjs.map +1 -1
  548. package/_mjs/global/api.mjs +4 -2
  549. package/_mjs/global/api.mjs.map +1 -1
  550. package/_mjs/internal/AtomicBoolean.mjs.map +1 -1
  551. package/_mjs/internal/AtomicNumber.mjs.map +1 -1
  552. package/_mjs/internal/AtomicReference.mjs.map +1 -1
  553. package/_mjs/internal/Stack.mjs +1 -1
  554. package/_mjs/internal/Stack.mjs.map +1 -1
  555. package/_mjs/optics/At/api.mjs +1 -1
  556. package/_mjs/optics/At/api.mjs.map +1 -1
  557. package/_mjs/optics/At/definition.mjs +2 -2
  558. package/_mjs/optics/At/definition.mjs.map +1 -1
  559. package/_mjs/optics/Fold/definition.mjs +2 -3
  560. package/_mjs/optics/Fold/definition.mjs.map +1 -1
  561. package/_mjs/optics/Getter/definition.mjs +1 -2
  562. package/_mjs/optics/Getter/definition.mjs.map +1 -1
  563. package/_mjs/optics/Index/api.mjs +4 -4
  564. package/_mjs/optics/Index/api.mjs.map +1 -1
  565. package/_mjs/optics/Index/definition.mjs +1 -1
  566. package/_mjs/optics/Index/definition.mjs.map +1 -1
  567. package/_mjs/optics/Iso/api.mjs +8 -6
  568. package/_mjs/optics/Iso/api.mjs.map +1 -1
  569. package/_mjs/optics/Iso/definition.mjs +9 -9
  570. package/_mjs/optics/Iso/definition.mjs.map +1 -1
  571. package/_mjs/optics/Lens/api.mjs +49 -39
  572. package/_mjs/optics/Lens/api.mjs.map +1 -1
  573. package/_mjs/optics/Lens/definition.mjs +7 -7
  574. package/_mjs/optics/Lens/definition.mjs.map +1 -1
  575. package/_mjs/optics/Optional/api/compose.mjs +8 -6
  576. package/_mjs/optics/Optional/api/compose.mjs.map +1 -1
  577. package/_mjs/optics/Optional/definition.mjs +8 -10
  578. package/_mjs/optics/Optional/definition.mjs.map +1 -1
  579. package/_mjs/optics/Optional.mjs.map +1 -1
  580. package/_mjs/optics/Prism/api/compose.mjs +8 -6
  581. package/_mjs/optics/Prism/api/compose.mjs.map +1 -1
  582. package/_mjs/optics/Prism/api/fromNullable.mjs +2 -2
  583. package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -1
  584. package/_mjs/optics/Prism/api/just.mjs +2 -2
  585. package/_mjs/optics/Prism/api/just.mjs.map +1 -1
  586. package/_mjs/optics/Prism/definition.mjs +6 -6
  587. package/_mjs/optics/Prism/definition.mjs.map +1 -1
  588. package/_mjs/optics/Prism.mjs.map +1 -1
  589. package/_mjs/optics/Setter/definition.mjs +5 -10
  590. package/_mjs/optics/Setter/definition.mjs.map +1 -1
  591. package/_mjs/optics/Traversal/api/compose.mjs +7 -5
  592. package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
  593. package/_mjs/optics/Traversal/api/fromTraversable.mjs +2 -2
  594. package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
  595. package/_mjs/optics/Traversal/definition.mjs +9 -9
  596. package/_mjs/optics/Traversal/definition.mjs.map +1 -1
  597. package/_mjs/optics/Traversal.mjs.map +1 -1
  598. package/_mjs/typeclass/Align.mjs.map +1 -1
  599. package/_mjs/typeclass/Alt.mjs.map +1 -1
  600. package/_mjs/typeclass/Applicative.mjs.map +1 -1
  601. package/_mjs/typeclass/ApplicativeExcept.mjs +6 -10
  602. package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
  603. package/_mjs/typeclass/Apply.mjs +9 -9
  604. package/_mjs/typeclass/Apply.mjs.map +1 -1
  605. package/_mjs/typeclass/Chain.mjs +5 -5
  606. package/_mjs/typeclass/Chain.mjs.map +1 -1
  607. package/_mjs/typeclass/Eq/definition.mjs.map +1 -1
  608. package/_mjs/typeclass/Eq/derivations.mjs.map +1 -1
  609. package/_mjs/typeclass/Equatable/api.mjs.map +1 -1
  610. package/_mjs/typeclass/Equatable/definition.mjs.map +1 -1
  611. package/_mjs/typeclass/Equatable/fast-equals.mjs.map +1 -1
  612. package/_mjs/typeclass/Filterable.mjs.map +1 -1
  613. package/_mjs/typeclass/FilterableWithIndex.mjs.map +1 -1
  614. package/_mjs/typeclass/Foldable.mjs +1 -1
  615. package/_mjs/typeclass/Foldable.mjs.map +1 -1
  616. package/_mjs/typeclass/FoldableWithIndex.mjs +1 -1
  617. package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
  618. package/_mjs/typeclass/Functor.mjs.map +1 -1
  619. package/_mjs/typeclass/FunctorWithIndex.mjs.map +1 -1
  620. package/_mjs/typeclass/Guard/api.mjs +18 -10
  621. package/_mjs/typeclass/Guard/api.mjs.map +1 -1
  622. package/_mjs/typeclass/Guard/definition.mjs.map +1 -1
  623. package/_mjs/typeclass/Guard/derivations.mjs.map +1 -1
  624. package/_mjs/typeclass/Has.mjs +7 -5
  625. package/_mjs/typeclass/Has.mjs.map +1 -1
  626. package/_mjs/typeclass/HashEq.mjs.map +1 -1
  627. package/_mjs/typeclass/Hashable/definition.mjs.map +1 -1
  628. package/_mjs/typeclass/Hashable/hash.mjs.map +1 -1
  629. package/_mjs/typeclass/MonadExcept.mjs +1 -1
  630. package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
  631. package/_mjs/typeclass/Ord/api/contramap.mjs +7 -5
  632. package/_mjs/typeclass/Ord/api/contramap.mjs.map +1 -1
  633. package/_mjs/typeclass/Ord/api/max.mjs.map +1 -1
  634. package/_mjs/typeclass/Ord/api/min.mjs.map +1 -1
  635. package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
  636. package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
  637. package/_mjs/typeclass/Ordering.mjs.map +1 -1
  638. package/_mjs/typeclass/Semialign.mjs +7 -7
  639. package/_mjs/typeclass/Semialign.mjs.map +1 -1
  640. package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
  641. package/_mjs/typeclass/Semigroup/definition.mjs.map +1 -1
  642. package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -1
  643. package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
  644. package/_mjs/typeclass/Showable/definition.mjs.map +1 -1
  645. package/_mjs/typeclass/Showable/show.mjs +107 -107
  646. package/_mjs/typeclass/Showable/show.mjs.map +1 -1
  647. package/_mjs/typeclass/Showable/styles.mjs.map +1 -1
  648. package/_mjs/typeclass/Showable/util.mjs +1 -1
  649. package/_mjs/typeclass/Showable/util.mjs.map +1 -1
  650. package/_mjs/typeclass/Traversable.mjs +1 -2
  651. package/_mjs/typeclass/Traversable.mjs.map +1 -1
  652. package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
  653. package/_mjs/typeclass/Witherable.mjs +2 -1
  654. package/_mjs/typeclass/Witherable.mjs.map +1 -1
  655. package/_mjs/typeclass/WitherableWithIndex.mjs +2 -1
  656. package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
  657. package/_mjs/util/AnsiFormat.mjs +11 -11
  658. package/_mjs/util/AnsiFormat.mjs.map +1 -1
  659. package/_mjs/util/PCGRandom.mjs.map +1 -1
  660. package/_mjs/util/assert.mjs.map +1 -1
  661. package/_mjs/util/pattern.mjs.map +1 -1
  662. package/_mjs/util/predicates.mjs.map +1 -1
  663. package/_mjs/util/rand/Random.mjs.map +1 -1
  664. package/_mjs/util/rand/distribution/UniformArrayIntDistribution.mjs.map +1 -1
  665. package/_mjs/util/rand/distribution/UniformBigIntDistribution.mjs.map +1 -1
  666. package/_mjs/util/rand/distribution/UniformIntDistribution.mjs.map +1 -1
  667. package/_mjs/util/rand/distribution/internals/ArrayInt.mjs.map +1 -1
  668. package/_mjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.mjs.map +1 -1
  669. package/_mjs/util/rand/distribution/internals/UniformIntDistributionInternal.mjs.map +1 -1
  670. package/_mjs/util/rand/generator/MersenneTwister.mjs.map +1 -1
  671. package/_mjs/util/rand/generator/RandomGenerator.mjs.map +1 -1
  672. package/_mjs/util/rand.mjs.map +1 -1
  673. package/_src/collection/Iterable/api/traverseConc.ts +3 -3
  674. package/_src/collection/Iterable/api.ts +445 -408
  675. package/_src/collection/Iterable/constructors.ts +1 -1
  676. package/_src/collection/compat/Array/api.ts +16 -13
  677. package/_src/collection/compat/Array/derivations.ts +27 -1
  678. package/_src/collection/compat/Record/instances.ts +51 -2
  679. package/_src/collection/immutable/Conc/api.ts +716 -607
  680. package/_src/collection/immutable/Conc/definition.ts +60 -68
  681. package/_src/collection/immutable/Conc/derivations.ts +13 -0
  682. package/_src/collection/immutable/Conc.ts +0 -1
  683. package/_src/collection/immutable/Dictionary/api.ts +44 -32
  684. package/_src/collection/immutable/HashMap/api.ts +338 -224
  685. package/_src/collection/immutable/HashMap/internal.ts +3 -7
  686. package/_src/collection/immutable/HashSet/api.ts +193 -158
  687. package/_src/collection/immutable/ImmutableArray/api/chunksOf.ts +5 -3
  688. package/_src/collection/immutable/ImmutableArray/api/slice.ts +5 -3
  689. package/_src/collection/immutable/ImmutableArray/api/splitAt.ts +5 -3
  690. package/_src/collection/immutable/ImmutableArray/api/splitWhere.ts +13 -14
  691. package/_src/collection/immutable/ImmutableArray/api.ts +870 -722
  692. package/_src/collection/immutable/ImmutableArray/derivations.ts +13 -0
  693. package/_src/collection/immutable/ImmutableArray/instances.ts +54 -73
  694. package/_src/collection/immutable/ImmutableArray.ts +0 -1
  695. package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +311 -273
  696. package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +19 -4
  697. package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +0 -1
  698. package/_src/collection/immutable/ImmutableNonEmptyArray/derivations.ts +13 -0
  699. package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +22 -23
  700. package/_src/collection/immutable/List/api/foldLeft.ts +11 -9
  701. package/_src/collection/immutable/List/api.ts +147 -133
  702. package/_src/collection/immutable/List.ts +0 -1
  703. package/_src/collection/immutable/Queue/api.ts +53 -37
  704. package/_src/collection/immutable/Queue/definition.ts +0 -1
  705. package/_src/collection/immutable/RoseTree/api.ts +38 -32
  706. package/_src/collection/immutable/RoseTree/definition.ts +2 -0
  707. package/_src/collection/immutable/SortedMap/api.ts +364 -332
  708. package/_src/collection/immutable/Vector/api.ts +608 -482
  709. package/_src/collection/immutable/Vector/definition.ts +11 -12
  710. package/_src/collection/immutable/Vector/internal.ts +37 -38
  711. package/_src/collection/mutable/HashMap.ts +1 -4
  712. package/_src/collection/mutable/HashSet.ts +1 -2
  713. package/_src/collection/mutable/ListBuffer.ts +1 -1
  714. package/_src/collection/mutable/internal.ts +0 -2
  715. package/_src/collection/weak/IterableWeakMap.ts +11 -7
  716. package/_src/collection/weak/IterableWeakSet.ts +10 -5
  717. package/_src/control/Eval/api.ts +35 -19
  718. package/_src/control/Eval/instance.ts +5 -5
  719. package/_src/control/Z/api.ts +191 -208
  720. package/_src/control/Z/instances.ts +4 -5
  721. package/_src/control/Z/runtime.ts +190 -189
  722. package/_src/data/Branded/definition.ts +11 -12
  723. package/_src/data/Branded/derivations.ts +2 -2
  724. package/_src/data/CaseClass.ts +4 -1
  725. package/_src/data/Cause/api/fold.ts +13 -14
  726. package/_src/data/Cause/api.ts +125 -105
  727. package/_src/data/Cause.ts +0 -1
  728. package/_src/data/Const/api.ts +6 -4
  729. package/_src/data/Const/instances.ts +3 -3
  730. package/_src/data/Datum/api.ts +229 -197
  731. package/_src/data/Datum/definition.ts +2 -5
  732. package/_src/data/DatumEither/api.ts +208 -193
  733. package/_src/data/Decoder/api.ts +5 -3
  734. package/_src/data/Duration/api.ts +19 -15
  735. package/_src/data/Either/api/align.ts +7 -2
  736. package/_src/data/Either/api/alignWith.ts +13 -15
  737. package/_src/data/Either/api.ts +141 -119
  738. package/_src/data/Either/constructors.ts +12 -10
  739. package/_src/data/Either/destructors.ts +11 -9
  740. package/_src/data/Either/instances.ts +24 -20
  741. package/_src/data/EitherT/api.ts +43 -49
  742. package/_src/data/Encoder/api.ts +123 -0
  743. package/_src/data/Encoder/definition.ts +12 -0
  744. package/_src/data/Encoder.ts +4 -0
  745. package/_src/data/Environment/api.ts +52 -44
  746. package/_src/data/EnvironmentPatch.ts +10 -9
  747. package/_src/data/ExecutionStrategy.ts +14 -24
  748. package/_src/data/Exit/api.ts +104 -73
  749. package/_src/data/Exit/constructors.ts +2 -2
  750. package/_src/data/FiberId/api.ts +19 -17
  751. package/_src/data/FiberId/constructors.ts +1 -2
  752. package/_src/data/Identity/api.ts +20 -12
  753. package/_src/data/Identity/instances.ts +4 -7
  754. package/_src/data/Interval.ts +39 -29
  755. package/_src/data/Intervals.ts +31 -23
  756. package/_src/data/Maybe/api.ts +112 -79
  757. package/_src/data/Maybe/constructors.ts +3 -3
  758. package/_src/data/Maybe/definition.ts +11 -1
  759. package/_src/data/Maybe/destructors.ts +6 -4
  760. package/_src/data/Maybe/instances.ts +10 -21
  761. package/_src/data/Predicate/api.ts +14 -8
  762. package/_src/data/Refinement/api.ts +19 -13
  763. package/_src/data/Struct/api.ts +75 -55
  764. package/_src/data/Tag/constructors.ts +1 -2
  765. package/_src/data/Tag/definition.ts +0 -1
  766. package/_src/data/These/api.ts +114 -114
  767. package/_src/data/These/destructors.ts +23 -24
  768. package/_src/data/Trace/api.ts +5 -3
  769. package/_src/data/Zipped.ts +3 -4
  770. package/_src/data/function/api.ts +6 -7
  771. package/_src/data/function/pipe.ts +9 -1
  772. package/_src/data/string/api.ts +40 -60
  773. package/_src/data.ts +1 -0
  774. package/_src/global/api.ts +7 -12
  775. package/_src/global.ts +4 -0
  776. package/_src/internal/AtomicBoolean.ts +0 -1
  777. package/_src/internal/AtomicNumber.ts +0 -7
  778. package/_src/internal/AtomicReference.ts +0 -4
  779. package/_src/internal/Stack.ts +1 -7
  780. package/_src/optics/At/definition.ts +5 -3
  781. package/_src/optics/Fold/definition.ts +3 -10
  782. package/_src/optics/Getter/definition.ts +1 -2
  783. package/_src/optics/Index/definition.ts +1 -1
  784. package/_src/optics/Iso/api.ts +8 -6
  785. package/_src/optics/Iso/definition.ts +3 -3
  786. package/_src/optics/Lens/api.ts +44 -42
  787. package/_src/optics/Lens/definition.ts +5 -5
  788. package/_src/optics/Optional/api/compose.ts +9 -9
  789. package/_src/optics/Optional/definition.ts +9 -16
  790. package/_src/optics/Optional.ts +0 -1
  791. package/_src/optics/Prism/api/compose.ts +9 -6
  792. package/_src/optics/Prism/definition.ts +3 -3
  793. package/_src/optics/Prism.ts +0 -1
  794. package/_src/optics/Setter/definition.ts +3 -23
  795. package/_src/optics/Traversal/api/compose.ts +7 -8
  796. package/_src/optics/Traversal/api/fromTraversable.ts +1 -1
  797. package/_src/optics/Traversal/definition.ts +10 -15
  798. package/_src/optics/Traversal.ts +0 -1
  799. package/_src/typeclass/Align.ts +0 -3
  800. package/_src/typeclass/Alt.ts +2 -1
  801. package/_src/typeclass/Applicative.ts +0 -1
  802. package/_src/typeclass/ApplicativeExcept.ts +15 -10
  803. package/_src/typeclass/Apply.ts +30 -33
  804. package/_src/typeclass/Chain.ts +9 -12
  805. package/_src/typeclass/Eq/definition.ts +0 -3
  806. package/_src/typeclass/Eq/derivations.ts +0 -2
  807. package/_src/typeclass/Equatable/api.ts +0 -2
  808. package/_src/typeclass/Equatable/definition.ts +0 -4
  809. package/_src/typeclass/Equatable/fast-equals.ts +11 -93
  810. package/_src/typeclass/Filterable.ts +19 -13
  811. package/_src/typeclass/FilterableWithIndex.ts +19 -13
  812. package/_src/typeclass/Foldable.ts +7 -10
  813. package/_src/typeclass/FoldableWithIndex.ts +7 -10
  814. package/_src/typeclass/Functor.ts +6 -4
  815. package/_src/typeclass/FunctorWithIndex.ts +3 -2
  816. package/_src/typeclass/Guard/api.ts +21 -16
  817. package/_src/typeclass/Guard/definition.ts +0 -3
  818. package/_src/typeclass/Guard/derivations.ts +5 -6
  819. package/_src/typeclass/Has.ts +6 -4
  820. package/_src/typeclass/HashEq.ts +0 -7
  821. package/_src/typeclass/Hashable/definition.ts +0 -4
  822. package/_src/typeclass/Hashable/hash.ts +0 -26
  823. package/_src/typeclass/MonadExcept.ts +1 -1
  824. package/_src/typeclass/Ord/api/contramap.ts +7 -6
  825. package/_src/typeclass/Ord/api/max.ts +0 -1
  826. package/_src/typeclass/Ord/api/min.ts +0 -1
  827. package/_src/typeclass/Ord/definition.ts +0 -4
  828. package/_src/typeclass/Ord/instances.ts +0 -2
  829. package/_src/typeclass/Ordering.ts +2 -0
  830. package/_src/typeclass/Semialign.ts +43 -32
  831. package/_src/typeclass/Semigroup/api.ts +0 -2
  832. package/_src/typeclass/Semigroup/definition.ts +0 -4
  833. package/_src/typeclass/Semigroup/derivations.ts +0 -2
  834. package/_src/typeclass/Semimonoidal.ts +3 -2
  835. package/_src/typeclass/Showable/definition.ts +0 -6
  836. package/_src/typeclass/Showable/show.ts +1 -57
  837. package/_src/typeclass/Showable/styles.ts +0 -8
  838. package/_src/typeclass/Showable/util.ts +22 -57
  839. package/_src/typeclass/Traversable.ts +13 -18
  840. package/_src/typeclass/TraversableWithIndex.ts +5 -7
  841. package/_src/typeclass/Witherable.ts +21 -13
  842. package/_src/typeclass/WitherableWithIndex.ts +26 -17
  843. package/_src/typeclass/builtin/Symbol.ts +0 -1
  844. package/_src/types/extractions.ts +12 -3
  845. package/_src/types/utility.ts +3 -5
  846. package/_src/util/AnsiFormat.ts +0 -25
  847. package/_src/util/PCGRandom.ts +4 -9
  848. package/_src/util/assert.ts +1 -2
  849. package/_src/util/pattern.ts +91 -12
  850. package/_src/util/predicates.ts +3 -1
  851. package/_src/util/rand/Random.ts +12 -16
  852. package/_src/util/rand/distribution/Distribution.ts +0 -1
  853. package/_src/util/rand/distribution/UniformArrayIntDistribution.ts +0 -3
  854. package/_src/util/rand/distribution/UniformBigIntDistribution.ts +0 -5
  855. package/_src/util/rand/distribution/UniformIntDistribution.ts +0 -7
  856. package/_src/util/rand/distribution/internals/ArrayInt.ts +3 -13
  857. package/_src/util/rand/distribution/internals/UniformArrayIntDistributionInternal.ts +0 -3
  858. package/_src/util/rand/distribution/internals/UniformIntDistributionInternal.ts +0 -4
  859. package/_src/util/rand/generator/MersenneTwister.ts +6 -29
  860. package/_src/util/rand/generator/RandomGenerator.ts +0 -3
  861. package/_src/util/rand.ts +0 -2
  862. package/collection/Iterable/api/traverseConc.d.ts +2 -2
  863. package/collection/Iterable/api.d.ts +64 -64
  864. package/collection/Iterable/constructors.d.ts +1 -1
  865. package/collection/compat/Array/api.d.ts +6 -6
  866. package/collection/compat/Array/derivations.d.ts +11 -0
  867. package/collection/compat/Record/instances.d.ts +30 -6
  868. package/collection/immutable/Conc/api.d.ts +108 -105
  869. package/collection/immutable/Conc/definition.d.ts +2 -2
  870. package/collection/immutable/Conc/derivations.d.ts +6 -0
  871. package/collection/immutable/Dictionary/api.d.ts +12 -12
  872. package/collection/immutable/HashMap/api.d.ts +76 -70
  873. package/collection/immutable/HashSet/api.d.ts +45 -41
  874. package/collection/immutable/ImmutableArray/api/chunksOf.d.ts +2 -2
  875. package/collection/immutable/ImmutableArray/api/slice.d.ts +2 -2
  876. package/collection/immutable/ImmutableArray/api/splitAt.d.ts +2 -2
  877. package/collection/immutable/ImmutableArray/api/splitWhere.d.ts +3 -3
  878. package/collection/immutable/ImmutableArray/api.d.ts +206 -206
  879. package/collection/immutable/ImmutableArray/derivations.d.ts +6 -0
  880. package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +64 -63
  881. package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +6 -0
  882. package/collection/immutable/List/api/foldLeft.d.ts +2 -2
  883. package/collection/immutable/List/api.d.ts +24 -24
  884. package/collection/immutable/Queue/api.d.ts +16 -16
  885. package/collection/immutable/RoseTree/api.d.ts +14 -14
  886. package/collection/immutable/SortedMap/api.d.ts +41 -41
  887. package/collection/immutable/Vector/api.d.ts +121 -117
  888. package/collection/immutable/Vector/definition.d.ts +2 -2
  889. package/collection/immutable/Vector/internal.d.ts +2 -2
  890. package/collection/mutable/ListBuffer.d.ts +1 -1
  891. package/control/Eval/api.d.ts +12 -12
  892. package/control/Z/api.d.ts +68 -68
  893. package/control/Z/runtime.d.ts +10 -10
  894. package/data/Branded/derivations.d.ts +2 -2
  895. package/data/Cause/api/fold.d.ts +3 -3
  896. package/data/Cause/api.d.ts +20 -20
  897. package/data/Const/api.d.ts +3 -3
  898. package/data/Datum/api.d.ts +43 -41
  899. package/data/DatumEither/api.d.ts +48 -46
  900. package/data/Decoder/api.d.ts +2 -2
  901. package/data/Duration/api.d.ts +7 -7
  902. package/data/Either/api/align.d.ts +5 -1
  903. package/data/Either/api/alignWith.d.ts +2 -2
  904. package/data/Either/api.d.ts +40 -46
  905. package/data/Either/constructors.d.ts +6 -6
  906. package/data/Either/destructors.d.ts +2 -2
  907. package/data/EitherT/api.d.ts +6 -6
  908. package/data/Encoder/api.d.ts +73 -0
  909. package/data/Encoder/definition.d.ts +12 -0
  910. package/data/Encoder.d.ts +2 -0
  911. package/data/Environment/api.d.ts +14 -14
  912. package/data/EnvironmentPatch.d.ts +4 -4
  913. package/data/ExecutionStrategy.d.ts +1 -6
  914. package/data/Exit/api.d.ts +32 -32
  915. package/data/Exit/constructors.d.ts +2 -2
  916. package/data/FiberId/api.d.ts +2 -2
  917. package/data/Identity/api.d.ts +8 -8
  918. package/data/Interval.d.ts +11 -11
  919. package/data/Intervals.d.ts +11 -11
  920. package/data/Maybe/api.d.ts +36 -37
  921. package/data/Maybe/constructors.d.ts +2 -2
  922. package/data/Maybe/definition.d.ts +7 -3
  923. package/data/Maybe/destructors.d.ts +2 -2
  924. package/data/Predicate/api.d.ts +5 -5
  925. package/data/Refinement/api.d.ts +9 -9
  926. package/data/Struct/api.d.ts +13 -23
  927. package/data/Tag/constructors.d.ts +1 -2
  928. package/data/Tag/definition.d.ts +0 -1
  929. package/data/These/api.d.ts +18 -22
  930. package/data/These/destructors.d.ts +4 -4
  931. package/data/Trace/api.d.ts +2 -2
  932. package/data/function/api.d.ts +3 -3
  933. package/data/function/pipe.d.ts +7 -1
  934. package/data/string/api.d.ts +9 -49
  935. package/data.d.ts +1 -0
  936. package/global/api.d.ts +3 -3
  937. package/global.d.ts +4 -0
  938. package/internal/Stack.d.ts +1 -1
  939. package/optics/At/definition.d.ts +1 -1
  940. package/optics/Fold/definition.d.ts +2 -6
  941. package/optics/Getter/definition.d.ts +1 -1
  942. package/optics/Index/definition.d.ts +1 -1
  943. package/optics/Iso/api.d.ts +2 -2
  944. package/optics/Iso/definition.d.ts +2 -2
  945. package/optics/Lens/api.d.ts +10 -10
  946. package/optics/Lens/definition.d.ts +4 -4
  947. package/optics/Optional/api/compose.d.ts +2 -2
  948. package/optics/Optional/definition.d.ts +4 -8
  949. package/optics/Prism/api/compose.d.ts +2 -2
  950. package/optics/Prism/definition.d.ts +2 -2
  951. package/optics/Setter/definition.d.ts +2 -14
  952. package/optics/Traversal/api/compose.d.ts +2 -2
  953. package/optics/Traversal/definition.d.ts +4 -4
  954. package/package.json +1 -1
  955. package/typeclass/Alt.d.ts +1 -1
  956. package/typeclass/ApplicativeExcept.d.ts +2 -6
  957. package/typeclass/Apply.d.ts +5 -5
  958. package/typeclass/Chain.d.ts +4 -4
  959. package/typeclass/Filterable.d.ts +6 -6
  960. package/typeclass/FilterableWithIndex.d.ts +6 -6
  961. package/typeclass/Foldable.d.ts +4 -4
  962. package/typeclass/FoldableWithIndex.d.ts +4 -4
  963. package/typeclass/Functor.d.ts +2 -2
  964. package/typeclass/FunctorWithIndex.d.ts +1 -1
  965. package/typeclass/Guard/api.d.ts +7 -7
  966. package/typeclass/Has.d.ts +3 -3
  967. package/typeclass/Ord/api/contramap.d.ts +2 -2
  968. package/typeclass/Semialign.d.ts +14 -14
  969. package/typeclass/Semimonoidal.d.ts +1 -1
  970. package/typeclass/Traversable.d.ts +4 -6
  971. package/typeclass/TraversableWithIndex.d.ts +2 -2
  972. package/typeclass/Witherable.d.ts +3 -3
  973. package/typeclass/WitherableWithIndex.d.ts +5 -5
  974. package/types/extractions.d.ts +10 -6
  975. package/util/assert.d.ts +1 -1
@@ -2,90 +2,96 @@ import type { ImmutableArrayF } from "@fncts/base/collection/immutable/Immutable
2
2
  import type { Monoid } from "@fncts/base/typeclass";
3
3
 
4
4
  import { EitherTag } from "@fncts/base/data/Either";
5
- import { identity, tuple } from "@fncts/base/data/function";
5
+ import { identity, pipe, tuple } from "@fncts/base/data/function";
6
6
  import * as P from "@fncts/base/typeclass";
7
7
 
8
8
  /**
9
- * @tsplus fluent fncts.ImmutableArray alignWith
9
+ * @tsplus pipeable fncts.ImmutableArray alignWith
10
10
  */
11
- export function alignWith_<A, B, C>(
12
- self: ImmutableArray<A>,
13
- fb: ImmutableArray<B>,
14
- f: (_: These<A, B>) => C,
15
- ): ImmutableArray<C> {
16
- const selfArray = self._array;
17
- const thatArray = fb._array;
18
- const minlen = Math.min(selfArray.length, thatArray.length);
19
- const maxlen = Math.max(selfArray.length, thatArray.length);
20
- const ret = Array<C>(maxlen);
21
- for (let i = 0; i < minlen; i++) {
22
- ret[i] = f(These.both(selfArray[i]!, thatArray[i]!));
23
- }
24
- if (minlen === maxlen) {
25
- return ret.asImmutableArray;
26
- } else if (selfArray.length > thatArray.length) {
27
- for (let i = minlen; i < maxlen; i++) {
28
- ret[i] = f(These.left(selfArray[i]!));
11
+ export function alignWith<A, B, C>(fb: ImmutableArray<B>, f: (_: These<A, B>) => C) {
12
+ return (self: ImmutableArray<A>): ImmutableArray<C> => {
13
+ const selfArray = self._array;
14
+ const thatArray = fb._array;
15
+ const minlen = Math.min(selfArray.length, thatArray.length);
16
+ const maxlen = Math.max(selfArray.length, thatArray.length);
17
+ const ret = Array<C>(maxlen);
18
+ for (let i = 0; i < minlen; i++) {
19
+ ret[i] = f(These.both(selfArray[i]!, thatArray[i]!));
29
20
  }
30
- } else {
31
- for (let i = minlen; i < maxlen; i++) {
32
- ret[i] = f(These.right(thatArray[i]!));
21
+ if (minlen === maxlen) {
22
+ return ret.asImmutableArray;
23
+ } else if (selfArray.length > thatArray.length) {
24
+ for (let i = minlen; i < maxlen; i++) {
25
+ ret[i] = f(These.left(selfArray[i]!));
26
+ }
27
+ } else {
28
+ for (let i = minlen; i < maxlen; i++) {
29
+ ret[i] = f(These.right(thatArray[i]!));
30
+ }
33
31
  }
34
- }
35
- return ret.asImmutableArray;
32
+ return ret.asImmutableArray;
33
+ };
36
34
  }
37
35
 
38
36
  /**
39
- * @tsplus fluent fncts.ImmutableArray align
37
+ * @tsplus pipeable fncts.ImmutableArray align
40
38
  */
41
- export function align_<A, B>(self: ImmutableArray<A>, fb: ImmutableArray<B>): ImmutableArray<These<A, B>> {
42
- return self.alignWith(fb, identity);
39
+ export function align<B>(fb: ImmutableArray<B>) {
40
+ return <A>(self: ImmutableArray<A>): ImmutableArray<These<A, B>> => {
41
+ return self.alignWith(fb, identity);
42
+ };
43
43
  }
44
44
 
45
45
  /**
46
- * @tsplus fluent fncts.ImmutableArray alt
46
+ * @tsplus pipeable fncts.ImmutableArray alt
47
47
  */
48
- export function alt_<A, B>(self: ImmutableArray<A>, that: Lazy<ImmutableArray<B>>): ImmutableArray<A | B> {
49
- return self.concat(that());
48
+ export function alt<B>(that: Lazy<ImmutableArray<B>>) {
49
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A | B> => {
50
+ return self.concat(that());
51
+ };
50
52
  }
51
53
 
52
54
  /**
53
- * @tsplus fluent fncts.ImmutableArray ap
55
+ * @tsplus pipeable fncts.ImmutableArray ap
54
56
  */
55
- export function ap_<A, B>(self: ImmutableArray<(a: A) => B>, fa: ImmutableArray<A>): ImmutableArray<B> {
56
- return self.flatMap((f) => fa.map(f));
57
+ export function ap<A>(fa: ImmutableArray<A>) {
58
+ return <B>(self: ImmutableArray<(a: A) => B>): ImmutableArray<B> => {
59
+ return self.flatMap((f) => fa.map(f));
60
+ };
57
61
  }
58
62
 
59
63
  /**
60
- * @tsplus fluent fncts.ImmutableArray append
64
+ * @tsplus pipeable fncts.ImmutableArray append
61
65
  */
62
- export function append_<A, B>(self: ImmutableArray<A>, last: B): ImmutableArray<A | B> {
63
- const selfArray = self._array;
64
- const len = selfArray.length;
65
- const r = Array<A | B>(len + 1);
66
- r[len] = last;
67
- for (let i = 0; i < len; i++) {
68
- r[i] = selfArray[i]!;
69
- }
70
- return r.asImmutableArray;
66
+ export function append<B>(last: B) {
67
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A | B> => {
68
+ const selfArray = self._array;
69
+ const len = selfArray.length;
70
+ const r = Array<A | B>(len + 1);
71
+ r[len] = last;
72
+ for (let i = 0; i < len; i++) {
73
+ r[i] = selfArray[i]!;
74
+ }
75
+ return r.asImmutableArray;
76
+ };
71
77
  }
72
78
 
73
79
  /**
74
- * @tsplus fluent fncts.ImmutableArray crossWith
80
+ * @tsplus pipeable fncts.ImmutableArray crossWith
75
81
  */
76
- export function crossWith_<A, B, C>(
77
- self: ImmutableArray<A>,
78
- fb: ImmutableArray<B>,
79
- f: (a: A, b: B) => C,
80
- ): ImmutableArray<C> {
81
- return self.flatMap((a) => fb.map((b) => f(a, b)));
82
+ export function crossWith<A, B, C>(fb: ImmutableArray<B>, f: (a: A, b: B) => C) {
83
+ return (self: ImmutableArray<A>): ImmutableArray<C> => {
84
+ return self.flatMap((a) => fb.map((b) => f(a, b)));
85
+ };
82
86
  }
83
87
 
84
88
  /**
85
- * @tsplus fluent fncts.ImmutableArray cross
89
+ * @tsplus pipeable fncts.ImmutableArray cross
86
90
  */
87
- export function cross_<A, B>(self: ImmutableArray<A>, fb: ImmutableArray<B>): ImmutableArray<Zipped.Make<A, B>> {
88
- return self.crossWith(fb, (a, b) => Zipped(a, b));
91
+ export function cross<B>(fb: ImmutableArray<B>) {
92
+ return <A>(self: ImmutableArray<A>): ImmutableArray<Zipped.Make<A, B>> => {
93
+ return self.crossWith(fb, (a, b) => Zipped(a, b));
94
+ };
89
95
  }
90
96
 
91
97
  /**
@@ -137,40 +143,41 @@ export function chainRecBreadthFirst<A, B>(a: A, f: (a: A) => ImmutableArray<Eit
137
143
  }
138
144
 
139
145
  /**
140
- * @tsplus fluent fncts.ImmutableArray flatMapWithIndex
146
+ * @tsplus pipeable fncts.ImmutableArray flatMapWithIndex
141
147
  */
142
- export function flatMapWithIndex_<A, B>(
143
- self: ImmutableArray<A>,
144
- f: (i: number, a: A) => ImmutableArray<B>,
145
- ): ImmutableArray<B> {
146
- let outLen = 0;
147
- const selfArray = self._array;
148
- const len = selfArray.length;
149
- const temp = Array<Array<B>>(len);
150
- for (let i = 0; i < len; i++) {
151
- const e = selfArray[i]!;
152
- const arr = f(i, e)._array;
153
- outLen += arr.length;
154
- temp[i] = arr! as Array<B>;
155
- }
156
- const out = Array<B>(outLen);
157
- let start = 0;
158
- for (let i = 0; i < len; i++) {
159
- const arr = temp[i]!;
160
- const l = arr.length;
161
- for (let j = 0; j < l; j++) {
162
- out[j + start] = arr[j]!;
148
+ export function flatMapWithIndex<A, B>(f: (i: number, a: A) => ImmutableArray<B>) {
149
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
150
+ let outLen = 0;
151
+ const selfArray = self._array;
152
+ const len = selfArray.length;
153
+ const temp = Array<Array<B>>(len);
154
+ for (let i = 0; i < len; i++) {
155
+ const e = selfArray[i]!;
156
+ const arr = f(i, e)._array;
157
+ outLen += arr.length;
158
+ temp[i] = arr! as Array<B>;
163
159
  }
164
- start += l;
165
- }
166
- return out.asImmutableArray;
160
+ const out = Array<B>(outLen);
161
+ let start = 0;
162
+ for (let i = 0; i < len; i++) {
163
+ const arr = temp[i]!;
164
+ const l = arr.length;
165
+ for (let j = 0; j < l; j++) {
166
+ out[j + start] = arr[j]!;
167
+ }
168
+ start += l;
169
+ }
170
+ return out.asImmutableArray;
171
+ };
167
172
  }
168
173
 
169
174
  /**
170
- * @tsplus fluent fncts.ImmutableArray flatMap
175
+ * @tsplus pipeable fncts.ImmutableArray flatMap
171
176
  */
172
- export function flatMap_<A, B>(self: ImmutableArray<A>, f: (a: A) => ImmutableArray<B>): ImmutableArray<B> {
173
- return self.flatMapWithIndex((_, a) => f(a));
177
+ export function flatMap<A, B>(f: (a: A) => ImmutableArray<B>) {
178
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
179
+ return self.flatMapWithIndex((_, a) => f(a));
180
+ };
174
181
  }
175
182
 
176
183
  /**
@@ -185,38 +192,37 @@ export function flatten<A>(self: ImmutableArray<ImmutableArray<A>>): ImmutableAr
185
192
  * often used for "chopping" up the input `Array`. Typically chop is called with some function
186
193
  * that will consume an initial prefix of the `Array` and produce a value and the rest of the `Array`.
187
194
  *
188
- * @tsplus fluent fncts.ImmutableArray chop
189
- */
190
- export function chop_<A, B>(
191
- as: ImmutableArray<A>,
192
- f: (as: ImmutableNonEmptyArray<A>) => readonly [B, ImmutableArray<A>],
193
- ): ImmutableArray<B> {
194
- const result: Array<B> = [];
195
- let cs: ImmutableArray<A> = as;
196
- while (cs.isNonEmpty()) {
197
- const [b, c] = f(cs);
198
- result.push(b);
199
- cs = c;
200
- }
201
- return result.asImmutableArray;
195
+ * @tsplus pipeable fncts.ImmutableArray chop
196
+ */
197
+ export function chop<A, B>(f: (as: ImmutableNonEmptyArray<A>) => readonly [B, ImmutableArray<A>]) {
198
+ return (as: ImmutableArray<A>): ImmutableArray<B> => {
199
+ const result: Array<B> = [];
200
+ let cs: ImmutableArray<A> = as;
201
+ while (cs.isNonEmpty()) {
202
+ const [b, c] = f(cs);
203
+ result.push(b);
204
+ cs = c;
205
+ }
206
+ return result.asImmutableArray;
207
+ };
202
208
  }
203
209
 
204
- export const chop = Pipeable(chop_);
205
-
206
210
  /**
207
- * @tsplus fluent fncts.ImmutableArray collectWhile
211
+ * @tsplus pipeable fncts.ImmutableArray collectWhile
208
212
  */
209
- export function collectWhile_<A, B>(as: ImmutableArray<A>, f: (a: A) => Maybe<B>): ImmutableArray<B> {
210
- const result: Array<B> = [];
211
- for (let i = 0; i < as.length; i++) {
212
- const o = f(as._array[i]!);
213
- if (o.isJust()) {
214
- result.push(o.value);
215
- } else {
216
- break;
213
+ export function collectWhile<A, B>(f: (a: A) => Maybe<B>) {
214
+ return (as: ImmutableArray<A>): ImmutableArray<B> => {
215
+ const result: Array<B> = [];
216
+ for (let i = 0; i < as.length; i++) {
217
+ const o = f(as._array[i]!);
218
+ if (o.isJust()) {
219
+ result.push(o.value);
220
+ } else {
221
+ break;
222
+ }
217
223
  }
218
- }
219
- return result.asImmutableArray;
224
+ return result.asImmutableArray;
225
+ };
220
226
  }
221
227
 
222
228
  function comprehensionLoop<A, R>(
@@ -266,72 +272,82 @@ export function comprehension<A, R>(
266
272
  }
267
273
 
268
274
  /**
269
- * @tsplus fluent fncts.ImmutableArray concat
270
- * @tsplus operator fncts.ImmutableArray +
275
+ * @tsplus pipeable fncts.ImmutableArray concat
276
+ * @tsplus pipeable-operator fncts.ImmutableArray +
271
277
  */
272
- export function concat_<A, B>(self: ImmutableArray<A>, that: ImmutableArray<B>): ImmutableArray<A | B> {
273
- const lenx = self._array.length;
274
- if (lenx === 0) {
275
- return that;
276
- }
277
- const leny = that._array.length;
278
- if (leny === 0) {
279
- return self;
280
- }
281
- const r = Array<A | B>(lenx + leny);
282
- for (let i = 0; i < lenx; i++) {
283
- r[i] = self._array[i]!;
284
- }
285
- for (let i = 0; i < leny; i++) {
286
- r[i + lenx] = that._array[i]!;
287
- }
288
- return r.asImmutableArray;
278
+ export function concat<B>(that: ImmutableArray<B>) {
279
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A | B> => {
280
+ const lenx = self._array.length;
281
+ if (lenx === 0) {
282
+ return that;
283
+ }
284
+ const leny = that._array.length;
285
+ if (leny === 0) {
286
+ return self;
287
+ }
288
+ const r = Array<A | B>(lenx + leny);
289
+ for (let i = 0; i < lenx; i++) {
290
+ r[i] = self._array[i]!;
291
+ }
292
+ for (let i = 0; i < leny; i++) {
293
+ r[i + lenx] = that._array[i]!;
294
+ }
295
+ return r.asImmutableArray;
296
+ };
289
297
  }
290
298
 
291
299
  /**
292
- * @tsplus fluent fncts.ImmutableArray deleteAt
300
+ * @tsplus pipeable fncts.ImmutableArray deleteAt
293
301
  */
294
- export function deleteAt_<A>(as: ImmutableArray<A>, i: number): Maybe<ImmutableArray<A>> {
295
- return as.isOutOfBound(i) ? Nothing() : Just(as.unsafeDeleteAt(i));
302
+ export function deleteAt(i: number) {
303
+ return <A>(as: ImmutableArray<A>): Maybe<ImmutableArray<A>> => {
304
+ return as.isOutOfBound(i) ? Nothing() : Just(as.unsafeDeleteAt(i));
305
+ };
296
306
  }
297
307
 
298
308
  /**
299
- * @tsplus fluent fncts.ImmutableArray difference
309
+ * @tsplus pipeable fncts.ImmutableArray difference
300
310
  */
301
- export function difference_<A>(
302
- self: ImmutableArray<A>,
303
- ys: ImmutableArray<A>,
304
- /** @tsplus auto */ E: P.Eq<A>,
305
- ): ImmutableArray<A> {
306
- return self.filter((a) => !ys.elem(a, E));
311
+ export function difference<A>(ys: ImmutableArray<A>, /** @tsplus auto */ E: P.Eq<A>) {
312
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
313
+ return self.filter((a) => !ys.elem(a, E));
314
+ };
307
315
  }
308
316
 
309
317
  /**
310
- * @tsplus fluent fncts.ImmutableArray drop
318
+ * @tsplus pipeable fncts.ImmutableArray drop
311
319
  */
312
- export function drop_<A>(self: ImmutableArray<A>, n: number): ImmutableArray<A> {
313
- return self.slice(n);
320
+ export function drop(n: number) {
321
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A> => {
322
+ return self.slice(n);
323
+ };
314
324
  }
315
325
 
316
326
  /**
317
- * @tsplus fluent fncts.ImmutableArray dropLast
327
+ * @tsplus pipeable fncts.ImmutableArray dropLast
318
328
  */
319
- export function dropLast_<A>(self: ImmutableArray<A>, n: number): ImmutableArray<A> {
320
- return self.slice(0, self.length - n);
329
+ export function dropLast(n: number) {
330
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A> => {
331
+ return self.slice(0, self.length - n);
332
+ };
321
333
  }
322
334
 
323
335
  /**
324
- * @tsplus fluent fncts.ImmutableArray dropWhile
336
+ * @tsplus pipeable fncts.ImmutableArray dropWhile
325
337
  */
326
- export function dropWhile_<A>(self: ImmutableArray<A>, p: Predicate<A>): ImmutableArray<A> {
327
- return self.slice(self.spanIndexLeft(p));
338
+ export function dropWhile<A>(p: Predicate<A>) {
339
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
340
+ return self.slice(self.spanIndexLeft(p));
341
+ };
328
342
  }
329
343
 
330
344
  /**
331
- * @tsplus fluent fncts.ImmutableArray dropLastWhile
345
+ * @tsplus pipeable fncts.ImmutableArray dropLastWhile
332
346
  */
333
- export function dropLastWhile_<A>(as: ImmutableArray<A>, p: Predicate<A>): ImmutableArray<A> {
334
- return as.slice(0, as.spanIndexRight(p) + 1);
347
+ export function dropLastWhile<A>(p: Predicate<A>) {
348
+ return (as: ImmutableArray<A>): ImmutableArray<A> => {
349
+ return as.slice(0, as.spanIndexRight(p) + 1);
350
+ };
335
351
  }
336
352
 
337
353
  /**
@@ -339,334 +355,383 @@ export function dropLastWhile_<A>(as: ImmutableArray<A>, p: Predicate<A>): Immut
339
355
  * argument which returns the function to use to search for a value of type `A` in
340
356
  * an array of type `ImmutableArray<A>`.
341
357
  *
342
- * @tsplus fluent fncts.ImmutableArray elem
343
- */
344
- export function elem_<A>(as: ImmutableArray<A>, a: A, /** @tsplus auto */ E: P.Eq<A>): boolean {
345
- const predicate = (element: A) => E.equals(element, a);
346
- const len = as.length;
347
- for (let i = 0; i < len; i++) {
348
- if (predicate(as._array[i]!)) {
349
- return true;
358
+ * @tsplus pipeable fncts.ImmutableArray elem
359
+ */
360
+ export function elem<A>(a: A, /** @tsplus auto */ E: P.Eq<A>) {
361
+ return (as: ImmutableArray<A>): boolean => {
362
+ const predicate = (element: A) => E.equals(element, a);
363
+ const len = as.length;
364
+ for (let i = 0; i < len; i++) {
365
+ if (predicate(as._array[i]!)) {
366
+ return true;
367
+ }
350
368
  }
351
- }
352
- return false;
369
+ return false;
370
+ };
353
371
  }
354
372
 
355
373
  /**
356
- * @tsplus fluent fncts.ImmutableArray every
374
+ * @tsplus pipeable fncts.ImmutableArray every
357
375
  */
358
- export function every_<A, B extends A>(self: ImmutableArray<A>, p: Refinement<A, B>): self is ImmutableArray<B>;
359
- export function every_<A>(self: ImmutableArray<A>, p: Predicate<A>): boolean;
360
- export function every_<A>(self: ImmutableArray<A>, p: Predicate<A>): boolean {
361
- return self.everyWithIndex((_, a) => p(a));
376
+ export function every<A, B extends A>(p: Refinement<A, B>): (self: ImmutableArray<A>) => self is ImmutableArray<B>;
377
+ export function every<A>(p: Predicate<A>): (self: ImmutableArray<A>) => boolean;
378
+ export function every<A>(p: Predicate<A>) {
379
+ return (self: ImmutableArray<A>): boolean => {
380
+ return self.everyWithIndex((_, a) => p(a));
381
+ };
362
382
  }
363
383
 
364
384
  /**
365
- * @tsplus fluent fncts.ImmutableArray everyWithIndex
385
+ * @tsplus pipeable fncts.ImmutableArray everyWithIndex
366
386
  */
367
- export function everyWithIndex_<A, B extends A>(
368
- self: ImmutableArray<A>,
387
+ export function everyWithIndex<A, B extends A>(
369
388
  p: RefinementWithIndex<number, A, B>,
370
- ): self is ImmutableArray<B>;
371
- export function everyWithIndex_<A>(self: ImmutableArray<A>, p: PredicateWithIndex<number, A>): boolean;
372
- export function everyWithIndex_<A>(self: ImmutableArray<A>, p: PredicateWithIndex<number, A>): boolean {
373
- let result = true;
374
- let i = 0;
375
- while (result && i < self.length) {
376
- result = p(i, self._array[i]!);
377
- i++;
378
- }
379
- return result;
389
+ ): (self: ImmutableArray<A>) => self is ImmutableArray<B>;
390
+ export function everyWithIndex<A>(p: PredicateWithIndex<number, A>): (self: ImmutableArray<A>) => boolean;
391
+ export function everyWithIndex<A>(p: PredicateWithIndex<number, A>) {
392
+ return (self: ImmutableArray<A>): boolean => {
393
+ let result = true;
394
+ let i = 0;
395
+ while (result && i < self.length) {
396
+ result = p(i, self._array[i]!);
397
+ i++;
398
+ }
399
+ return result;
400
+ };
380
401
  }
381
402
 
382
403
  /**
383
- * @tsplus fluent fncts.ImmutableArray exists
404
+ * @tsplus pipeable fncts.ImmutableArray exists
384
405
  */
385
- export function exists_<A>(self: ImmutableArray<A>, p: Predicate<A>): self is ImmutableNonEmptyArray<A> {
386
- let result = false;
387
- let i = 0;
388
- while (!result && i < self.length) {
389
- result = p(self._array[i]!);
390
- i++;
391
- }
392
- return result;
406
+ export function exists<A>(p: Predicate<A>) {
407
+ return (self: ImmutableArray<A>): self is ImmutableNonEmptyArray<A> => {
408
+ let result = false;
409
+ let i = 0;
410
+ while (!result && i < self.length) {
411
+ result = p(self._array[i]!);
412
+ i++;
413
+ }
414
+ return result;
415
+ };
393
416
  }
394
417
 
395
418
  /**
396
- * @tsplus fluent fncts.ImmutableArray filter
419
+ * @tsplus pipeable fncts.ImmutableArray filter
397
420
  */
398
- export function filter_<A, B extends A>(self: ImmutableArray<A>, p: Refinement<A, B>): ImmutableArray<B>;
399
- export function filter_<A>(self: ImmutableArray<A>, p: Predicate<A>): ImmutableArray<A>;
400
- export function filter_<A>(self: ImmutableArray<A>, p: Predicate<A>): ImmutableArray<A> {
401
- return self.filterWithIndex((_, a) => p(a));
421
+ export function filter<A, B extends A>(p: Refinement<A, B>): (self: ImmutableArray<A>) => ImmutableArray<B>;
422
+ export function filter<A>(p: Predicate<A>): (self: ImmutableArray<A>) => ImmutableArray<A>;
423
+ export function filter<A>(p: Predicate<A>) {
424
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
425
+ return self.filterWithIndex((_, a) => p(a));
426
+ };
402
427
  }
403
428
 
404
429
  /**
405
- * @tsplus fluent fncts.ImmutableArray filterWithIndex
430
+ * @tsplus pipeable fncts.ImmutableArray filterWithIndex
406
431
  */
407
- export function filterWithIndex_<A, B extends A>(
408
- self: ImmutableArray<A>,
432
+ export function filterWithIndex<A, B extends A>(
409
433
  p: RefinementWithIndex<number, A, B>,
410
- ): ImmutableArray<B>;
411
- export function filterWithIndex_<A>(self: ImmutableArray<A>, p: PredicateWithIndex<number, A>): ImmutableArray<A>;
412
- export function filterWithIndex_<A>(self: ImmutableArray<A>, p: PredicateWithIndex<number, A>): ImmutableArray<A> {
413
- const result: Array<A> = [];
414
- for (let i = 0; i < self.length; i++) {
415
- const a = self._array[i]!;
416
- if (p(i, a)) {
417
- result.push(a);
434
+ ): (self: ImmutableArray<A>) => ImmutableArray<B>;
435
+ export function filterWithIndex<A>(p: PredicateWithIndex<number, A>): (self: ImmutableArray<A>) => ImmutableArray<A>;
436
+ export function filterWithIndex<A>(p: PredicateWithIndex<number, A>) {
437
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
438
+ const result: Array<A> = [];
439
+ for (let i = 0; i < self.length; i++) {
440
+ const a = self._array[i]!;
441
+ if (p(i, a)) {
442
+ result.push(a);
443
+ }
418
444
  }
419
- }
420
- return result.asImmutableArray;
445
+ return result.asImmutableArray;
446
+ };
421
447
  }
422
448
 
423
449
  /**
424
- * @tsplus fluent fncts.ImmutableArray filterMapWithIndex
450
+ * @tsplus pipeable fncts.ImmutableArray filterMapWithIndex
425
451
  */
426
- export function filterMapWithIndex_<A, B>(fa: ImmutableArray<A>, f: (i: number, a: A) => Maybe<B>): ImmutableArray<B> {
427
- const result = [];
428
- for (let i = 0; i < fa.length; i++) {
429
- const maybeB = f(i, fa[i]!);
430
- if (maybeB.isJust()) {
431
- result.push(maybeB.value);
452
+ export function filterMapWithIndex<A, B>(f: (i: number, a: A) => Maybe<B>) {
453
+ return (fa: ImmutableArray<A>): ImmutableArray<B> => {
454
+ const result = [];
455
+ for (let i = 0; i < fa.length; i++) {
456
+ const maybeB = f(i, fa[i]!);
457
+ if (maybeB.isJust()) {
458
+ result.push(maybeB.value);
459
+ }
432
460
  }
433
- }
434
- return result.asImmutableArray;
461
+ return result.asImmutableArray;
462
+ };
435
463
  }
436
464
 
437
465
  /**
438
- * @tsplus fluent fncts.ImmutableArray filterMap
466
+ * @tsplus pipeable fncts.ImmutableArray filterMap
439
467
  */
440
- export function filterMap_<A, B>(self: ImmutableArray<A>, f: (a: A) => Maybe<B>): ImmutableArray<B> {
441
- return self.filterMapWithIndex((_, a) => f(a));
468
+ export function filterMap<A, B>(f: (a: A) => Maybe<B>) {
469
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
470
+ return self.filterMapWithIndex((_, a) => f(a));
471
+ };
442
472
  }
443
473
 
444
474
  /**
445
- * @tsplus fluent fncts.ImmutableArray find
475
+ * @tsplus pipeable fncts.ImmutableArray find
446
476
  */
447
- export function find_<A, B extends A>(self: ImmutableArray<A>, p: Refinement<A, B>): Maybe<B>;
448
- export function find_<A>(self: ImmutableArray<A>, p: Predicate<A>): Maybe<A>;
449
- export function find_<A>(self: ImmutableArray<A>, p: Predicate<A>): Maybe<A> {
450
- return self.findWithIndex((_, a) => p(a));
477
+ export function find<A, B extends A>(p: Refinement<A, B>): (self: ImmutableArray<A>) => Maybe<B>;
478
+ export function find<A>(p: Predicate<A>): (self: ImmutableArray<A>) => Maybe<A>;
479
+ export function find<A>(p: Predicate<A>) {
480
+ return (self: ImmutableArray<A>): Maybe<A> => {
481
+ return self.findWithIndex((_, a) => p(a));
482
+ };
451
483
  }
452
484
 
453
485
  /**
454
- * @tsplus fluent fncts.ImmutableArray findIndex
486
+ * @tsplus pipeable fncts.ImmutableArray findIndex
455
487
  */
456
- export function findIndex_<A>(as: ImmutableArray<A>, predicate: Predicate<A>): Maybe<number> {
457
- return as.findMapWithIndex((i, a) => (predicate(a) ? Just(i) : Nothing()));
488
+ export function findIndex<A>(predicate: Predicate<A>) {
489
+ return (as: ImmutableArray<A>): Maybe<number> => {
490
+ return as.findMapWithIndex((i, a) => (predicate(a) ? Just(i) : Nothing()));
491
+ };
458
492
  }
459
493
 
460
494
  /**
461
- * @tsplus fluent fncts.ImmutableArray findWithIndex
495
+ * @tsplus pipeable fncts.ImmutableArray findWithIndex
462
496
  */
463
- export function findWithIndex_<A, B extends A>(as: ImmutableArray<A>, p: RefinementWithIndex<number, A, B>): Maybe<B>;
464
- export function findWithIndex_<A>(as: ImmutableArray<A>, p: PredicateWithIndex<number, A>): Maybe<A>;
465
- export function findWithIndex_<A>(as: ImmutableArray<A>, p: PredicateWithIndex<number, A>): Maybe<A> {
466
- const len = as.length;
467
- for (let i = 0; i < len; i++) {
468
- if (p(i, as._array[i]!)) {
469
- return Just(as._array[i]!);
497
+ export function findWithIndex<A, B extends A>(
498
+ p: RefinementWithIndex<number, A, B>,
499
+ ): (as: ImmutableArray<A>) => Maybe<B>;
500
+ export function findWithIndex<A>(p: PredicateWithIndex<number, A>): (as: ImmutableArray<A>) => Maybe<A>;
501
+ export function findWithIndex<A>(p: PredicateWithIndex<number, A>) {
502
+ return (as: ImmutableArray<A>): Maybe<A> => {
503
+ const len = as.length;
504
+ for (let i = 0; i < len; i++) {
505
+ if (p(i, as._array[i]!)) {
506
+ return Just(as._array[i]!);
507
+ }
470
508
  }
471
- }
472
- return Nothing();
509
+ return Nothing();
510
+ };
473
511
  }
474
512
 
475
513
  /**
476
- * @tsplus fluent fncts.ImmutableArray findMap
514
+ * @tsplus pipeable fncts.ImmutableArray findMap
477
515
  */
478
- export function findMap_<A, B>(as: ImmutableArray<A>, f: (a: A) => Maybe<B>): Maybe<B> {
479
- return as.findMapWithIndex((_, a) => f(a));
516
+ export function findMap<A, B>(f: (a: A) => Maybe<B>) {
517
+ return (as: ImmutableArray<A>): Maybe<B> => {
518
+ return as.findMapWithIndex((_, a) => f(a));
519
+ };
480
520
  }
481
521
 
482
522
  /**
483
- * @tsplus fluent fncts.ImmutableArray findMapWithIndex
523
+ * @tsplus pipeable fncts.ImmutableArray findMapWithIndex
484
524
  */
485
- export function findMapWithIndex_<A, B>(as: ImmutableArray<A>, f: (index: number, a: A) => Maybe<B>): Maybe<B> {
486
- const len = as.length;
487
- for (let i = 0; i < len; i++) {
488
- const v = f(i, as._array[i]!);
489
- if (v.isJust()) {
490
- return v;
525
+ export function findMapWithIndex<A, B>(f: (index: number, a: A) => Maybe<B>) {
526
+ return (as: ImmutableArray<A>): Maybe<B> => {
527
+ const len = as.length;
528
+ for (let i = 0; i < len; i++) {
529
+ const v = f(i, as._array[i]!);
530
+ if (v.isJust()) {
531
+ return v;
532
+ }
491
533
  }
492
- }
493
- return Nothing();
534
+ return Nothing();
535
+ };
494
536
  }
495
537
 
496
538
  /**
497
- * @tsplus fluent fncts.ImmutableArray findLast
539
+ * @tsplus pipeable fncts.ImmutableArray findLast
498
540
  */
499
- export function findLast_<A, B extends A>(as: ImmutableArray<A>, p: Refinement<A, B>): Maybe<B>;
500
- export function findLast_<A>(as: ImmutableArray<A>, p: Predicate<A>): Maybe<A>;
501
- export function findLast_<A>(as: ImmutableArray<A>, p: Predicate<A>): Maybe<A> {
502
- const len = as.length;
503
- for (let i = len - 1; i >= 0; i--) {
504
- if (p(as._array[i]!)) {
505
- return Just(as._array[i]!);
541
+ export function findLast<A, B extends A>(p: Refinement<A, B>): (as: ImmutableArray<A>) => Maybe<B>;
542
+ export function findLast<A>(p: Predicate<A>): (as: ImmutableArray<A>) => Maybe<A>;
543
+ export function findLast<A>(p: Predicate<A>) {
544
+ return (as: ImmutableArray<A>): Maybe<A> => {
545
+ const len = as.length;
546
+ for (let i = len - 1; i >= 0; i--) {
547
+ if (p(as._array[i]!)) {
548
+ return Just(as._array[i]!);
549
+ }
506
550
  }
507
- }
508
- return Nothing();
551
+ return Nothing();
552
+ };
509
553
  }
510
554
 
511
555
  /**
512
- * @tsplus fluent fncts.ImmutableArray findLastIndex
556
+ * @tsplus pipeable fncts.ImmutableArray findLastIndex
513
557
  */
514
- export function findLastIndex_<A>(self: ImmutableArray<A>, p: Predicate<A>): Maybe<number> {
515
- return self.findLastMapWithIndex((i, a) => (p(a) ? Just(i) : Nothing()));
558
+ export function findLastIndex<A>(p: Predicate<A>) {
559
+ return (self: ImmutableArray<A>): Maybe<number> => {
560
+ return self.findLastMapWithIndex((i, a) => (p(a) ? Just(i) : Nothing()));
561
+ };
516
562
  }
517
563
 
518
564
  /**
519
- * @tsplus fluent fncts.ImmutableArray findLastMap
565
+ * @tsplus pipeable fncts.ImmutableArray findLastMap
520
566
  */
521
- export function findLastMap_<A, B>(as: ImmutableArray<A>, f: (a: A) => Maybe<B>): Maybe<B> {
522
- return as.findLastMapWithIndex((_, a) => f(a));
567
+ export function findLastMap<A, B>(f: (a: A) => Maybe<B>) {
568
+ return (as: ImmutableArray<A>): Maybe<B> => {
569
+ return as.findLastMapWithIndex((_, a) => f(a));
570
+ };
523
571
  }
524
572
 
525
573
  /**
526
- * @tsplus fluent fncts.ImmutableArray findLastMapWithIndex
574
+ * @tsplus pipeable fncts.ImmutableArray findLastMapWithIndex
527
575
  */
528
- export function findLastMapWithIndex_<A, B>(as: ImmutableArray<A>, f: (i: number, a: A) => Maybe<B>): Maybe<B> {
529
- const len = as.length;
530
- for (let i = len - 1; i >= 0; i--) {
531
- const v = f(i, as._array[i]!);
532
- if (v.isJust()) {
533
- return v;
576
+ export function findLastMapWithIndex<A, B>(f: (i: number, a: A) => Maybe<B>) {
577
+ return (as: ImmutableArray<A>): Maybe<B> => {
578
+ const len = as.length;
579
+ for (let i = len - 1; i >= 0; i--) {
580
+ const v = f(i, as._array[i]!);
581
+ if (v.isJust()) {
582
+ return v;
583
+ }
534
584
  }
535
- }
536
- return Nothing();
585
+ return Nothing();
586
+ };
537
587
  }
538
588
 
539
589
  /**
540
- * @tsplus fluent fncts.ImmutableArray foldLeftWithIndex
541
- * @tsplus fluent fncts.MutableArray foldLeftWithIndex
590
+ * @tsplus pipeable fncts.ImmutableArray foldLeftWithIndex
591
+ * @tsplus pipeable fncts.MutableArray foldLeftWithIndex
542
592
  */
543
- export function foldLeftWithIndex_<A, B>(self: ImmutableArray<A>, b: B, f: (i: number, b: B, a: A) => B): B {
544
- const len = self.length;
545
- let r = b;
546
- for (let i = 0; i < len; i++) {
547
- r = f(i, r, self._array[i]!);
548
- }
549
- return r;
593
+ export function foldLeftWithIndex<A, B>(b: B, f: (i: number, b: B, a: A) => B) {
594
+ return (self: ImmutableArray<A>): B => {
595
+ const len = self.length;
596
+ let r = b;
597
+ for (let i = 0; i < len; i++) {
598
+ r = f(i, r, self._array[i]!);
599
+ }
600
+ return r;
601
+ };
550
602
  }
551
603
 
552
604
  /**
553
- * @tsplus fluent fncts.ImmutableArray foldLeft
554
- * @tsplus fluent fncts.MutableArray foldLeft
605
+ * @tsplus pipeable fncts.ImmutableArray foldLeft
606
+ * @tsplus pipeable fncts.MutableArray foldLeft
555
607
  */
556
- export function foldLeft_<A, B>(self: ImmutableArray<A>, b: B, f: (b: B, a: A) => B): B {
557
- return self.foldLeftWithIndex(b, (_, b, a) => f(b, a));
608
+ export function foldLeft<A, B>(b: B, f: (b: B, a: A) => B) {
609
+ return (self: ImmutableArray<A>): B => {
610
+ return self.foldLeftWithIndex(b, (_, b, a) => f(b, a));
611
+ };
558
612
  }
559
613
 
560
614
  /**
561
- * @tsplus fluent fncts.ImmutableArray foldLeftWhile
562
- * @tsplus fluent fncts.MutableArray foldLeftWhile
615
+ * @tsplus pipeable fncts.ImmutableArray foldLeftWhile
616
+ * @tsplus pipeable fncts.MutableArray foldLeftWhile
563
617
  */
564
- export function foldLeftWhile_<A, B>(self: ImmutableArray<A>, b: B, p: Predicate<B>, f: (b: B, a: A) => B): B {
565
- return self.foldLeftWithIndexWhile(b, p, (_, b, a) => f(b, a));
618
+ export function foldLeftWhile<A, B>(b: B, p: Predicate<B>, f: (b: B, a: A) => B) {
619
+ return (self: ImmutableArray<A>): B => {
620
+ return self.foldLeftWithIndexWhile(b, p, (_, b, a) => f(b, a));
621
+ };
566
622
  }
567
623
 
568
624
  /**
569
- * @tsplus fluent fncts.ImmutableArray foldLeftWithIndexWhile
570
- * @tsplus fluent fncts.MutableArray foldLeftWithIndexWhile
625
+ * @tsplus pipeable fncts.ImmutableArray foldLeftWithIndexWhile
626
+ * @tsplus pipeable fncts.MutableArray foldLeftWithIndexWhile
571
627
  */
572
- export function foldLeftWithIndexWhile_<A, B>(
573
- self: ImmutableArray<A>,
574
- b: B,
575
- p: Predicate<B>,
576
- f: (i: number, b: B, a: A) => B,
577
- ): B {
578
- let out = b;
579
- let cont = p(out);
580
- for (let i = 0; cont && i < self.length; i++) {
581
- out = f(i, out, self._array[i]!);
582
- cont = p(out);
583
- }
584
- return out;
628
+ export function foldLeftWithIndexWhile<A, B>(b: B, p: Predicate<B>, f: (i: number, b: B, a: A) => B) {
629
+ return (self: ImmutableArray<A>): B => {
630
+ let out = b;
631
+ let cont = p(out);
632
+ for (let i = 0; cont && i < self.length; i++) {
633
+ out = f(i, out, self._array[i]!);
634
+ cont = p(out);
635
+ }
636
+ return out;
637
+ };
585
638
  }
586
639
 
587
640
  /**
588
- * @tsplus fluent fncts.ImmutableArray fold
641
+ * @tsplus pipeable fncts.ImmutableArray fold
589
642
  */
590
- export function fold<M>(self: ImmutableArray<M>, /** @tsplus auto */ M: Monoid<M>): M {
591
- return self.foldLeft(M.nat, M.combine);
643
+ export function fold<M>(/** @tsplus auto */ M: Monoid<M>) {
644
+ return (self: ImmutableArray<M>): M => {
645
+ return self.foldLeft(M.nat, M.combine);
646
+ };
592
647
  }
593
648
 
594
649
  /**
595
- * @tsplus fluent fncts.ImmutableArray foldMapWithIndex
650
+ * @tsplus pipeable fncts.ImmutableArray foldMapWithIndex
596
651
  */
597
- export function foldMapWithIndex_<A, M>(
598
- self: ImmutableArray<A>,
599
- f: (i: number, a: A) => M,
600
- /** @tsplus auto */ M: Monoid<M>,
601
- ): M {
602
- return self.foldLeftWithIndex(M.nat, (i, b, a) => M.combine(b, f(i, a)));
652
+ export function foldMapWithIndex<A, M>(f: (i: number, a: A) => M, /** @tsplus auto */ M: Monoid<M>) {
653
+ return (self: ImmutableArray<A>): M => {
654
+ return self.foldLeftWithIndex(M.nat, (i, b, a) => M.combine(b, f(i, a)));
655
+ };
603
656
  }
604
657
 
605
658
  /**
606
- * @tsplus fluent fncts.ImmutableArray foldMap
659
+ * @tsplus pipeable fncts.ImmutableArray foldMap
607
660
  */
608
- export function foldMap_<A, M>(self: ImmutableArray<A>, f: (a: A) => M, /** @tsplus auto */ M: Monoid<M>): M {
609
- return self.foldMapWithIndex((_, a) => f(a), M);
661
+ export function foldMap<A, M>(f: (a: A) => M, /** @tsplus auto */ M: Monoid<M>) {
662
+ return (self: ImmutableArray<A>): M => {
663
+ return self.foldMapWithIndex((_, a) => f(a), M);
664
+ };
610
665
  }
611
666
 
612
667
  /**
613
- * @tsplus fluent fncts.ImmutableArray foldRightWithIndex
668
+ * @tsplus pipeable fncts.ImmutableArray foldRightWithIndex
614
669
  */
615
- export function foldRightWithIndex_<A, B>(self: ImmutableArray<A>, b: B, f: (i: number, a: A, b: B) => B): B {
616
- let r = b;
617
- for (let i = self.length - 1; i >= 0; i--) {
618
- r = f(i, self._array[i]!, r);
619
- }
620
- return r;
670
+ export function foldRightWithIndex<A, B>(b: B, f: (i: number, a: A, b: B) => B) {
671
+ return (self: ImmutableArray<A>): B => {
672
+ let r = b;
673
+ for (let i = self.length - 1; i >= 0; i--) {
674
+ r = f(i, self._array[i]!, r);
675
+ }
676
+ return r;
677
+ };
621
678
  }
622
679
 
623
680
  /**
624
- * @tsplus fluent fncts.ImmutableArray foldRight
681
+ * @tsplus pipeable fncts.ImmutableArray foldRight
625
682
  */
626
- export function foldRight_<A, B>(self: ImmutableArray<A>, b: B, f: (a: A, b: B) => B): B {
627
- return self.foldRightWithIndex(b, (_, a, b) => f(a, b));
683
+ export function foldRight<A, B>(b: B, f: (a: A, b: B) => B) {
684
+ return (self: ImmutableArray<A>): B => {
685
+ return self.foldRightWithIndex(b, (_, a, b) => f(a, b));
686
+ };
628
687
  }
629
688
 
630
689
  /**
631
- * @tsplus fluent fncts.ImmutableArray foldRighWhile
690
+ * @tsplus pipeable fncts.ImmutableArray foldRighWhile
632
691
  */
633
- export function foldRightWhile_<A, B>(self: ImmutableArray<A>, b: B, p: Predicate<B>, f: (a: A, b: B) => B): B {
634
- return self.foldRightWithIndexWhile(b, p, (_, a, b) => f(a, b));
692
+ export function foldRightWhile<A, B>(b: B, p: Predicate<B>, f: (a: A, b: B) => B) {
693
+ return (self: ImmutableArray<A>): B => {
694
+ return self.foldRightWithIndexWhile(b, p, (_, a, b) => f(a, b));
695
+ };
635
696
  }
636
697
 
637
698
  /**
638
- * @tsplus fluent fncts.ImmutableArray foldRightWithIndexWhile
699
+ * @tsplus pipeable fncts.ImmutableArray foldRightWithIndexWhile
639
700
  */
640
- export function foldRightWithIndexWhile_<A, B>(
641
- self: ImmutableArray<A>,
642
- b: B,
643
- predicate: Predicate<B>,
644
- f: (i: number, a: A, b: B) => B,
645
- ): B {
646
- let out = b;
647
- let cont = predicate(out);
648
- for (let i = self.length - 1; cont && i >= 0; i--) {
649
- out = f(i, self._array[i]!, out);
650
- cont = predicate(out);
651
- }
652
- return out;
701
+ export function foldRightWithIndexWhile<A, B>(b: B, predicate: Predicate<B>, f: (i: number, a: A, b: B) => B) {
702
+ return (self: ImmutableArray<A>): B => {
703
+ let out = b;
704
+ let cont = predicate(out);
705
+ for (let i = self.length - 1; cont && i >= 0; i--) {
706
+ out = f(i, self._array[i]!, out);
707
+ cont = predicate(out);
708
+ }
709
+ return out;
710
+ };
653
711
  }
654
712
 
655
713
  /**
656
- * @tsplus fluent fncts.ImmutableArray forEach
714
+ * @tsplus pipeable fncts.ImmutableArray forEach
657
715
  */
658
- export function forEach_<A, B>(self: ImmutableArray<A>, f: (a: A) => B): void {
659
- return self.forEach(f);
716
+ export function forEach<A, B>(f: (a: A) => B) {
717
+ return (self: ImmutableArray<A>): void => {
718
+ return self.forEach(f);
719
+ };
660
720
  }
661
721
 
662
722
  /**
663
- * @tsplus fluent fncts.ImmutableArray get
664
- * @tsplus fluent fncts.MutableArray get
723
+ * @tsplus pipeable fncts.ImmutableArray get
724
+ * @tsplus pipeable fncts.MutableArray get
665
725
  */
666
- export function get_<A>(self: ImmutableArray<A>, i: number): Maybe<A> {
667
- return self.isOutOfBound(i) ? Nothing() : Just(self._array[i]!);
726
+ export function get(i: number) {
727
+ return <A>(self: ImmutableArray<A>): Maybe<A> => {
728
+ return self.isOutOfBound(i) ? Nothing() : Just(self._array[i]!);
729
+ };
668
730
  }
669
731
 
732
+ /**
733
+ * @tsplus pipeable fncts.ImmutableArray group
734
+ */
670
735
  export function group<A>(E: P.Eq<A>): (self: ImmutableArray<A>) => ImmutableArray<ImmutableNonEmptyArray<A>> {
671
736
  return chop((self) => {
672
737
  const h = self._array[0]!;
@@ -685,30 +750,22 @@ export function group<A>(E: P.Eq<A>): (self: ImmutableArray<A>) => ImmutableArra
685
750
  }
686
751
 
687
752
  /**
688
- * @tsplus fluent fncts.ImmutableArray group
753
+ * @tsplus pipeable fncts.ImmutableArray groupBy
689
754
  */
690
- export function chopSelf<A>(self: ImmutableArray<A>, E: P.Eq<A>): ImmutableArray<ImmutableNonEmptyArray<A>> {
691
- return group(E)(self);
692
- }
693
-
694
- /**
695
- * @tsplus fluent fncts.ImmutableArray groupBy
696
- */
697
- export function groupBy_<A>(
698
- self: ImmutableArray<A>,
699
- f: (a: A) => string,
700
- ): Readonly<Record<string, ImmutableNonEmptyArray<A>>> {
701
- const out: Record<string, NonEmptyArray<A>> = {};
702
- for (let i = 0; i < self.length; i++) {
703
- const a = self._array[i]!;
704
- const k = f(a);
705
- if (Object.prototype.hasOwnProperty.call(out, k)) {
706
- out[k]!.push(a);
707
- } else {
708
- out[k] = [a];
755
+ export function groupBy<A>(f: (a: A) => string) {
756
+ return (self: ImmutableArray<A>): Readonly<Record<string, ImmutableNonEmptyArray<A>>> => {
757
+ const out: Record<string, NonEmptyArray<A>> = {};
758
+ for (let i = 0; i < self.length; i++) {
759
+ const a = self._array[i]!;
760
+ const k = f(a);
761
+ if (Object.prototype.hasOwnProperty.call(out, k)) {
762
+ out[k]!.push(a);
763
+ } else {
764
+ out[k] = [a];
765
+ }
709
766
  }
710
- }
711
- return Dictionary.get(out).map(ImmutableNonEmptyArray.from).toRecord;
767
+ return Dictionary.get(out).map(ImmutableNonEmptyArray.from).toRecord;
768
+ };
712
769
  }
713
770
 
714
771
  /**
@@ -727,26 +784,31 @@ export function init<A>(self: ImmutableArray<A>): Maybe<ImmutableArray<A>> {
727
784
  }
728
785
 
729
786
  /**
730
- * @tsplus fluent fncts.ImmutableArray insertAt
787
+ * @tsplus pipeable fncts.ImmutableArray insertAt
731
788
  */
732
- export function insertAt_<A>(self: ImmutableArray<A>, i: number, a: A): Maybe<ImmutableNonEmptyArray<A>> {
733
- return self.isOutOfBound(i) ? Nothing() : Just(self.unsafeInsertAt(i, a));
789
+ export function insertAt<A>(i: number, a: A) {
790
+ return (self: ImmutableArray<A>): Maybe<ImmutableNonEmptyArray<A>> => {
791
+ return self.isOutOfBound(i) ? Nothing() : Just(self.unsafeInsertAt(i, a));
792
+ };
734
793
  }
735
794
 
736
795
  /**
737
- * @tsplus fluent fncts.ImmutableArray intersection
796
+ * @tsplus pipeable fncts.ImmutableArray intersection
738
797
  */
739
- export function intersection_<A>(
740
- self: ImmutableArray<A>,
741
- that: ImmutableArray<A>,
742
- /** @tsplus auto */ E: P.Eq<A>,
743
- ): ImmutableArray<A> {
744
- return self.filter((a) => that.elem(a, E));
798
+ export function intersection<A>(that: ImmutableArray<A>, /** @tsplus auto */ E: P.Eq<A>) {
799
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
800
+ return self.filter((a) => that.elem(a, E));
801
+ };
745
802
  }
746
803
 
747
- export function intersperse_<A>(self: ImmutableArray<A>, a: A): ImmutableArray<A> {
748
- const len = self.length;
749
- return len === 0 ? self : self.slice(1, len).prependAll(a).prepend(self[0]!);
804
+ /**
805
+ * @tsplus pipeable fncts.ImmutableArray intersperse
806
+ */
807
+ export function intersperse<A>(a: A) {
808
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
809
+ const len = self.length;
810
+ return len === 0 ? self : self.slice(1, len).prependAll(a).prepend(self[0]!);
811
+ };
750
812
  }
751
813
 
752
814
  /**
@@ -757,17 +819,21 @@ export function isEmpty<A>(self: ImmutableArray<A>): boolean {
757
819
  }
758
820
 
759
821
  /**
760
- * @tsplus fluent fncts.ImmutableArray isOutOfBound
822
+ * @tsplus pipeable fncts.ImmutableArray isOutOfBound
761
823
  */
762
- export function isOutOfBound_<A>(self: ImmutableArray<A>, i: number): boolean {
763
- return i < 0 || i >= self.length;
824
+ export function isOutOfBound(i: number) {
825
+ return <A>(self: ImmutableArray<A>): boolean => {
826
+ return i < 0 || i >= self.length;
827
+ };
764
828
  }
765
829
 
766
830
  /**
767
- * @tsplus fluent fncts.ImmutableArray join
831
+ * @tsplus pipeable fncts.ImmutableArray join
768
832
  */
769
- export function join(self: ImmutableArray<string>, separator: string): string {
770
- return self._array.join(separator);
833
+ export function join(separator: string) {
834
+ return (self: ImmutableArray<string>): string => {
835
+ return self._array.join(separator);
836
+ };
771
837
  }
772
838
 
773
839
  /**
@@ -800,56 +866,62 @@ export function lefts<E, A>(self: ImmutableArray<Either<E, A>>): ImmutableArray<
800
866
  }
801
867
 
802
868
  /**
803
- * @tsplus fluent fncts.ImmutableArray map
869
+ * @tsplus pipeable fncts.ImmutableArray map
804
870
  */
805
- export function map_<A, B>(self: ImmutableArray<A>, f: (a: A) => B): ImmutableArray<B> {
806
- return self.mapWithIndex((_, a) => f(a));
871
+ export function map<A, B>(f: (a: A) => B) {
872
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
873
+ return self.mapWithIndex((_, a) => f(a));
874
+ };
807
875
  }
808
876
 
809
877
  /**
810
- * @tsplus fluent fncts.ImmutableArray mapAccum
878
+ * @tsplus pipeable fncts.ImmutableArray mapAccum
811
879
  */
812
- export function mapAccum_<A, S, B>(
813
- self: ImmutableArray<A>,
814
- s: S,
815
- f: (s: S, a: A) => readonly [B, S],
816
- ): readonly [ImmutableArray<B>, S] {
817
- const bs = Array<B>(self.length);
818
- let state = s;
819
- for (let i = 0; i < self.length; i++) {
820
- const result = f(state, self._array[i]!);
821
- bs[i] = result[0];
822
- state = result[1];
823
- }
824
- return [bs.asImmutableArray, state];
880
+ export function mapAccum<A, S, B>(s: S, f: (s: S, a: A) => readonly [B, S]) {
881
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<B>, S] => {
882
+ const bs = Array<B>(self.length);
883
+ let state = s;
884
+ for (let i = 0; i < self.length; i++) {
885
+ const result = f(state, self._array[i]!);
886
+ bs[i] = result[0];
887
+ state = result[1];
888
+ }
889
+ return [bs.asImmutableArray, state];
890
+ };
825
891
  }
826
892
 
827
893
  /**
828
- * @tsplus fluent fncts.ImmutableArray mapWithIndex
894
+ * @tsplus pipeable fncts.ImmutableArray mapWithIndex
829
895
  */
830
- export function mapWithIndex_<A, B>(self: ImmutableArray<A>, f: (i: number, a: A) => B): ImmutableArray<B> {
831
- const len = self._array.length;
832
- const bs = Array<B>(len);
833
- for (let i = 0; i < len; i++) {
834
- bs[i] = f(i, self._array[i]!);
835
- }
836
- return bs.asImmutableArray;
896
+ export function mapWithIndex<A, B>(f: (i: number, a: A) => B) {
897
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
898
+ const len = self._array.length;
899
+ const bs = Array<B>(len);
900
+ for (let i = 0; i < len; i++) {
901
+ bs[i] = f(i, self._array[i]!);
902
+ }
903
+ return bs.asImmutableArray;
904
+ };
837
905
  }
838
906
 
839
907
  /**
840
- * @tsplus fluent fncts.ImmutableArray modifyAt
908
+ * @tsplus pipeable fncts.ImmutableArray modifyAt
841
909
  */
842
- export function modifyAt_<A>(self: ImmutableArray<A>, i: number, f: (a: A) => A): Maybe<ImmutableArray<A>> {
843
- return self.isOutOfBound(i) ? Nothing() : Just(self.unsafeModifyAt(i, f));
910
+ export function modifyAt<A>(i: number, f: (a: A) => A) {
911
+ return (self: ImmutableArray<A>): Maybe<ImmutableArray<A>> => {
912
+ return self.isOutOfBound(i) ? Nothing() : Just(self.unsafeModifyAt(i, f));
913
+ };
844
914
  }
845
915
 
846
916
  /**
847
- * @tsplus fluent fncts.ImmutableArray mutate
917
+ * @tsplus pipeable fncts.ImmutableArray mutate
848
918
  */
849
- export function mutate_<A>(self: ImmutableArray<A>, f: (self: Array<A>) => void): ImmutableArray<A> {
850
- const mut = mutableClone(self);
851
- f(mut);
852
- return mut.asImmutableArray;
919
+ export function mutate<A>(f: (self: Array<A>) => void) {
920
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
921
+ const mut = mutableClone(self);
922
+ f(mut);
923
+ return mut.asImmutableArray;
924
+ };
853
925
  }
854
926
 
855
927
  /**
@@ -860,108 +932,103 @@ export function mutableClone<A>(self: ImmutableArray<A>): Array<A> {
860
932
  }
861
933
 
862
934
  /**
863
- * @tsplus fluent fncts.ImmutableArray partitionWithIndex
935
+ * @tsplus pipeable fncts.ImmutableArray partitionWithIndex
864
936
  */
865
- export function partitionWithIndex_<A, B extends A>(
866
- self: ImmutableArray<A>,
937
+ export function partitionWithIndex<A, B extends A>(
867
938
  p: RefinementWithIndex<number, A, B>,
868
- ): readonly [ImmutableArray<A>, ImmutableArray<B>];
869
- export function partitionWithIndex_<A>(
870
- self: ImmutableArray<A>,
939
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<B>];
940
+ export function partitionWithIndex<A>(
871
941
  p: PredicateWithIndex<number, A>,
872
- ): readonly [ImmutableArray<A>, ImmutableArray<A>];
873
- export function partitionWithIndex_<A>(
874
- self: ImmutableArray<A>,
875
- p: PredicateWithIndex<number, A>,
876
- ): readonly [ImmutableArray<A>, ImmutableArray<A>] {
877
- const left: Array<A> = [];
878
- const right: Array<A> = [];
879
- for (let i = 0; i < self.length; i++) {
880
- const a = self._array[i]!;
881
- if (p(i, a)) {
882
- right.push(a);
883
- } else {
884
- left.push(a);
942
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<A>];
943
+ export function partitionWithIndex<A>(p: PredicateWithIndex<number, A>) {
944
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<A>, ImmutableArray<A>] => {
945
+ const left: Array<A> = [];
946
+ const right: Array<A> = [];
947
+ for (let i = 0; i < self.length; i++) {
948
+ const a = self._array[i]!;
949
+ if (p(i, a)) {
950
+ right.push(a);
951
+ } else {
952
+ left.push(a);
953
+ }
885
954
  }
886
- }
887
- return [left.asImmutableArray, right.asImmutableArray];
955
+ return [left.asImmutableArray, right.asImmutableArray];
956
+ };
888
957
  }
889
958
 
890
959
  /**
891
- * @tsplus fluent fncts.ImmutableArray partition
960
+ * @tsplus pipeable fncts.ImmutableArray partition
892
961
  */
893
- export function partition_<A, B extends A>(
894
- self: ImmutableArray<A>,
962
+ export function partition<A, B extends A>(
895
963
  p: Refinement<A, B>,
896
- ): readonly [ImmutableArray<A>, ImmutableArray<B>];
897
- export function partition_<A>(
898
- self: ImmutableArray<A>,
899
- p: Predicate<A>,
900
- ): readonly [ImmutableArray<A>, ImmutableArray<A>];
901
- export function partition_<A>(
902
- self: ImmutableArray<A>,
964
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<B>];
965
+ export function partition<A>(
903
966
  p: Predicate<A>,
904
- ): readonly [ImmutableArray<A>, ImmutableArray<A>] {
905
- return self.partitionWithIndex((_, a) => p(a));
906
- }
907
-
908
- /**
909
- * @tsplus fluent fncts.ImmutableArray partitionMapWithIndex
910
- */
911
- export function partitionMapWithIndex_<A, B, C>(
912
- self: ImmutableArray<A>,
913
- f: (i: number, a: A) => Either<B, C>,
914
- ): readonly [ImmutableArray<B>, ImmutableArray<C>] {
915
- const left = [] as Array<B>;
916
- const right = [] as Array<C>;
917
- for (let i = 0; i < self.length; i++) {
918
- const ea = f(i, self._array[i]!);
919
- Either.concrete(ea);
920
- switch (ea._tag) {
921
- case EitherTag.Left:
922
- left.push(ea.left);
923
- break;
924
- case EitherTag.Right:
925
- right.push(ea.right);
926
- break;
967
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<A>];
968
+ export function partition<A>(p: Predicate<A>) {
969
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<A>, ImmutableArray<A>] => {
970
+ return self.partitionWithIndex((_, a) => p(a));
971
+ };
972
+ }
973
+
974
+ /**
975
+ * @tsplus pipeable fncts.ImmutableArray partitionMapWithIndex
976
+ */
977
+ export function partitionMapWithIndex<A, B, C>(f: (i: number, a: A) => Either<B, C>) {
978
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<B>, ImmutableArray<C>] => {
979
+ const left = [] as Array<B>;
980
+ const right = [] as Array<C>;
981
+ for (let i = 0; i < self.length; i++) {
982
+ const ea = f(i, self._array[i]!);
983
+ Either.concrete(ea);
984
+ switch (ea._tag) {
985
+ case EitherTag.Left:
986
+ left.push(ea.left);
987
+ break;
988
+ case EitherTag.Right:
989
+ right.push(ea.right);
990
+ break;
991
+ }
927
992
  }
928
- }
929
- return [left.asImmutableArray, right.asImmutableArray];
993
+ return [left.asImmutableArray, right.asImmutableArray];
994
+ };
930
995
  }
931
996
 
932
997
  /**
933
- * @tsplus fluent fncts.ImmutableArray partitionMap
998
+ * @tsplus pipeable fncts.ImmutableArray partitionMap
934
999
  */
935
- export function partitionMap_<A, B, C>(
936
- self: ImmutableArray<A>,
937
- f: (a: A) => Either<B, C>,
938
- ): readonly [ImmutableArray<B>, ImmutableArray<C>] {
939
- return self.partitionMapWithIndex((_, a) => f(a));
1000
+ export function partitionMap<A, B, C>(f: (a: A) => Either<B, C>) {
1001
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<B>, ImmutableArray<C>] => {
1002
+ return self.partitionMapWithIndex((_, a) => f(a));
1003
+ };
940
1004
  }
941
1005
 
942
1006
  /**
943
- * @tsplus fluent fncts.ImmutableArray prepend
1007
+ * @tsplus pipeable fncts.ImmutableArray prepend
944
1008
  */
945
- export function prepend_<A, B>(self: ImmutableArray<A>, head: B): ImmutableArray<A | B> {
946
- const len = self.length;
947
- const out = Array<A | B>(len + 1);
948
- out[0] = head;
949
- for (let i = 0; i < len; i++) {
950
- out[i + 1] = self._array[i]!;
951
- }
952
- return out.asImmutableArray;
1009
+ export function prepend<B>(head: B) {
1010
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A | B> => {
1011
+ const len = self.length;
1012
+ const out = Array<A | B>(len + 1);
1013
+ out[0] = head;
1014
+ for (let i = 0; i < len; i++) {
1015
+ out[i + 1] = self._array[i]!;
1016
+ }
1017
+ return out.asImmutableArray;
1018
+ };
953
1019
  }
954
1020
 
955
1021
  /**
956
- * @tsplus fluent fncts.ImmutableArray prependAll
957
- * @tsplus fluent fncts.MutableArray prependAll
1022
+ * @tsplus pipeable fncts.ImmutableArray prependAll
958
1023
  */
959
- export function prependAll_<A>(self: ImmutableArray<A>, a: A): ImmutableArray<A> {
960
- const out: Array<A> = [];
961
- for (let i = 0; i < self.length; i++) {
962
- out.push(a, self._array[i]!);
963
- }
964
- return out.asImmutableArray;
1024
+ export function prependAll<A>(a: A) {
1025
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
1026
+ const out: Array<A> = [];
1027
+ for (let i = 0; i < self.length; i++) {
1028
+ out.push(a, self._array[i]!);
1029
+ }
1030
+ return out.asImmutableArray;
1031
+ };
965
1032
  }
966
1033
 
967
1034
  /**
@@ -997,137 +1064,148 @@ export function rights<E, A>(self: ImmutableArray<Either<E, A>>): ImmutableArray
997
1064
  }
998
1065
 
999
1066
  /**
1000
- * @tsplus fluent fncts.ImmutableArray rotate
1067
+ * @tsplus pipeable fncts.ImmutableArray rotate
1001
1068
  */
1002
- export function rotate_<A>(self: ImmutableArray<A>, n: number): ImmutableArray<A> {
1003
- const len = self.length;
1004
- if (n === 0 || len <= 1 || len === Math.abs(n)) {
1005
- return self;
1006
- } else if (n < 0) {
1007
- return self.rotate(len + n);
1008
- } else {
1009
- return self.slice(-n).concat(self.slice(0, len - n));
1010
- }
1069
+ export function rotate(n: number) {
1070
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A> => {
1071
+ const len = self.length;
1072
+ if (n === 0 || len <= 1 || len === Math.abs(n)) {
1073
+ return self;
1074
+ } else if (n < 0) {
1075
+ return self.rotate(len + n);
1076
+ } else {
1077
+ return self.slice(-n).concat(self.slice(0, len - n));
1078
+ }
1079
+ };
1011
1080
  }
1012
1081
 
1013
1082
  /**
1014
- * @tsplus fluent fncts.ImmutableArray scanLeft
1083
+ * @tsplus pipeable fncts.ImmutableArray scanLeft
1015
1084
  */
1016
- export function scanLeft_<A, B>(self: ImmutableArray<A>, b: B, f: (b: B, a: A) => B): ImmutableArray<B> {
1017
- const l = self.length;
1018
- const r = Array(l + 1);
1019
- r[0] = b;
1020
- for (let i = 0; i < l; i++) {
1021
- r[i + 1] = f(r[i]!, self._array[i]!);
1022
- }
1023
- return r.asImmutableArray;
1085
+ export function scanLeft<A, B>(b: B, f: (b: B, a: A) => B) {
1086
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
1087
+ const l = self.length;
1088
+ const r = Array(l + 1);
1089
+ r[0] = b;
1090
+ for (let i = 0; i < l; i++) {
1091
+ r[i + 1] = f(r[i]!, self._array[i]!);
1092
+ }
1093
+ return r.asImmutableArray;
1094
+ };
1024
1095
  }
1025
1096
 
1026
1097
  /**
1027
- * @tsplus fluent fncts.ImmutableArray scanRight
1098
+ * @tsplus pipeable fncts.ImmutableArray scanRight
1028
1099
  */
1029
- export function scanRight_<A, B>(self: ImmutableArray<A>, b: B, f: (a: A, b: B) => B): ImmutableArray<B> {
1030
- const l = self.length;
1031
- const r = Array(l + 1);
1032
- r[l] = b;
1033
- for (let i = l - 1; i >= 0; i--) {
1034
- r[i] = f(self._array[i]!, r[i + 1]!);
1035
- }
1036
- return r.asImmutableArray;
1100
+ export function scanRight<A, B>(b: B, f: (a: A, b: B) => B) {
1101
+ return (self: ImmutableArray<A>): ImmutableArray<B> => {
1102
+ const l = self.length;
1103
+ const r = Array(l + 1);
1104
+ r[l] = b;
1105
+ for (let i = l - 1; i >= 0; i--) {
1106
+ r[i] = f(self._array[i]!, r[i + 1]!);
1107
+ }
1108
+ return r.asImmutableArray;
1109
+ };
1037
1110
  }
1038
1111
 
1039
1112
  /**
1040
- * @tsplus fluent fncts.ImmutableArray sort
1113
+ * @tsplus pipeable fncts.ImmutableArray sort
1041
1114
  */
1042
- export function sort<A>(self: ImmutableArray<A>, /** @tsplus auto */ O: P.Ord<A>): ImmutableArray<A> {
1043
- return self.isEmpty() || self.length === 1 ? self : self._array.slice().sort(O.compare).asImmutableArray;
1115
+ export function sort<A>(/** @tsplus auto */ O: P.Ord<A>) {
1116
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
1117
+ return self.isEmpty() || self.length === 1 ? self : self._array.slice().sort(O.compare).asImmutableArray;
1118
+ };
1044
1119
  }
1045
1120
 
1046
1121
  /**
1047
- * @tsplus fluent fncts.ImmutableArray sortBy
1122
+ * @tsplus pipeable fncts.ImmutableArray sortBy
1048
1123
  */
1049
- export function sortBy<A>(self: ImmutableArray<A>, Os: ImmutableArray<P.Ord<A>>): ImmutableArray<A> {
1050
- return self.sort(Os.fold(P.Ord.getMonoid()));
1124
+ export function sortBy<A>(Os: ImmutableArray<P.Ord<A>>) {
1125
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
1126
+ return self.sort(Os.fold(P.Ord.getMonoid()));
1127
+ };
1051
1128
  }
1052
1129
 
1053
1130
  /**
1054
- * @tsplus fluent fncts.ImmutableArray spanLeft
1131
+ * @tsplus pipeable fncts.ImmutableArray spanLeft
1055
1132
  */
1056
- export function spanLeft_<A, B extends A>(
1057
- self: ImmutableArray<A>,
1133
+ export function spanLeft<A, B extends A>(
1058
1134
  p: Refinement<A, B>,
1059
- ): readonly [ImmutableArray<B>, ImmutableArray<A>];
1060
- export function spanLeft_<A>(self: ImmutableArray<A>, p: Predicate<A>): readonly [ImmutableArray<A>, ImmutableArray<A>];
1061
- export function spanLeft_<A>(
1062
- self: ImmutableArray<A>,
1135
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<B>, ImmutableArray<A>];
1136
+ export function spanLeft<A>(
1063
1137
  p: Predicate<A>,
1064
- ): readonly [ImmutableArray<A>, ImmutableArray<A>] {
1065
- const i = self.spanIndexLeft(p);
1066
- const init = Array<A>(i);
1067
- for (let j = 0; j < i; j++) {
1068
- init[j] = self._array[j]!;
1069
- }
1070
- const l = self.length;
1071
- const rest = Array<A>(l - i);
1072
- for (let j = i; j < l; j++) {
1073
- rest[j - i] = self._array[j]!;
1074
- }
1075
- return [init.asImmutableArray, rest.asImmutableArray];
1138
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<A>];
1139
+ export function spanLeft<A>(p: Predicate<A>) {
1140
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<A>, ImmutableArray<A>] => {
1141
+ const i = self.spanIndexLeft(p);
1142
+ const init = Array<A>(i);
1143
+ for (let j = 0; j < i; j++) {
1144
+ init[j] = self._array[j]!;
1145
+ }
1146
+ const l = self.length;
1147
+ const rest = Array<A>(l - i);
1148
+ for (let j = i; j < l; j++) {
1149
+ rest[j - i] = self._array[j]!;
1150
+ }
1151
+ return [init.asImmutableArray, rest.asImmutableArray];
1152
+ };
1076
1153
  }
1077
1154
 
1078
1155
  /**
1079
- * @tsplus fluent fncts.ImmutableArray spanRight
1156
+ * @tsplus pipeable fncts.ImmutableArray spanRight
1080
1157
  */
1081
- export function spanRight_<A, B extends A>(
1082
- self: ImmutableArray<A>,
1158
+ export function spanRight<A, B extends A>(
1083
1159
  p: Refinement<A, B>,
1084
- ): readonly [ImmutableArray<A>, ImmutableArray<B>];
1085
- export function spanRight_<A>(
1086
- self: ImmutableArray<A>,
1087
- p: Predicate<A>,
1088
- ): readonly [ImmutableArray<A>, ImmutableArray<A>];
1089
- export function spanRight_<A>(
1090
- self: ImmutableArray<A>,
1160
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<B>];
1161
+ export function spanRight<A>(
1091
1162
  p: Predicate<A>,
1092
- ): readonly [ImmutableArray<A>, ImmutableArray<A>] {
1093
- const i = self.spanIndexRight(p);
1094
- const l = self.length;
1095
- const tail = Array<A>(l - i - 1);
1096
- for (let j = l - 1; j > i; j--) {
1097
- tail[j - i - 1] = self._array[j]!;
1098
- }
1099
- const rest = Array<A>(i);
1100
- for (let j = i; j >= 0; j--) {
1101
- rest[j] = self._array[j]!;
1102
- }
1103
- return [rest.asImmutableArray, tail.asImmutableArray];
1163
+ ): (self: ImmutableArray<A>) => readonly [ImmutableArray<A>, ImmutableArray<A>];
1164
+ export function spanRight<A>(p: Predicate<A>) {
1165
+ return (self: ImmutableArray<A>): readonly [ImmutableArray<A>, ImmutableArray<A>] => {
1166
+ const i = self.spanIndexRight(p);
1167
+ const l = self.length;
1168
+ const tail = Array<A>(l - i - 1);
1169
+ for (let j = l - 1; j > i; j--) {
1170
+ tail[j - i - 1] = self._array[j]!;
1171
+ }
1172
+ const rest = Array<A>(i);
1173
+ for (let j = i; j >= 0; j--) {
1174
+ rest[j] = self._array[j]!;
1175
+ }
1176
+ return [rest.asImmutableArray, tail.asImmutableArray];
1177
+ };
1104
1178
  }
1105
1179
 
1106
1180
  /**
1107
- * @tsplus fluent fncts.ImmutableArray spanIndexLeft
1181
+ * @tsplus pipeable fncts.ImmutableArray spanIndexLeft
1108
1182
  */
1109
- export function spanIndexLeft_<A>(self: ImmutableArray<A>, p: Predicate<A>): number {
1110
- const l = self.length;
1111
- let i = 0;
1112
- for (; i < l; i++) {
1113
- if (!p(self._array[i]!)) {
1114
- break;
1183
+ export function spanIndexLeft<A>(p: Predicate<A>) {
1184
+ return (self: ImmutableArray<A>): number => {
1185
+ const l = self.length;
1186
+ let i = 0;
1187
+ for (; i < l; i++) {
1188
+ if (!p(self._array[i]!)) {
1189
+ break;
1190
+ }
1115
1191
  }
1116
- }
1117
- return i;
1192
+ return i;
1193
+ };
1118
1194
  }
1119
1195
 
1120
1196
  /**
1121
- * @tsplus fluent fncts.ImmutableArray spanIndexRight
1197
+ * @tsplus pipeable fncts.ImmutableArray spanIndexRight
1122
1198
  */
1123
- export function spanIndexRight_<A>(as: ImmutableArray<A>, predicate: Predicate<A>): number {
1124
- let i = as.length - 1;
1125
- for (; i >= 0; i--) {
1126
- if (!predicate(as._array[i]!)) {
1127
- break;
1199
+ export function spanIndexRight<A>(predicate: Predicate<A>) {
1200
+ return (as: ImmutableArray<A>): number => {
1201
+ let i = as.length - 1;
1202
+ for (; i >= 0; i--) {
1203
+ if (!predicate(as._array[i]!)) {
1204
+ break;
1205
+ }
1128
1206
  }
1129
- }
1130
- return i;
1207
+ return i;
1208
+ };
1131
1209
  }
1132
1210
 
1133
1211
  /**
@@ -1138,76 +1216,107 @@ export function tail<A>(self: ImmutableArray<A>): Maybe<ImmutableArray<A>> {
1138
1216
  }
1139
1217
 
1140
1218
  /**
1141
- * @tsplus fluent fncts.ImmutableArray take
1219
+ * @tsplus pipeable fncts.ImmutableArray take
1142
1220
  */
1143
- export function take_<A>(self: ImmutableArray<A>, n: number): ImmutableArray<A> {
1144
- return self.slice(0, n);
1221
+ export function take(n: number) {
1222
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A> => {
1223
+ return self.slice(0, n);
1224
+ };
1145
1225
  }
1146
1226
 
1147
1227
  /**
1148
- * @tsplus fluent fncts.ImmutableArray takeLast
1228
+ * @tsplus pipeable fncts.ImmutableArray takeLast
1149
1229
  */
1150
- export function takeLast_<A>(as: ImmutableArray<A>, n: number): ImmutableArray<A> {
1151
- return isEmpty(as) ? ImmutableArray.empty() : as.slice(-n);
1230
+ export function takeLast(n: number) {
1231
+ return <A>(as: ImmutableArray<A>): ImmutableArray<A> => {
1232
+ return isEmpty(as) ? ImmutableArray.empty() : as.slice(-n);
1233
+ };
1152
1234
  }
1153
1235
 
1154
1236
  /**
1155
- * @tsplus fluent fncts.ImmutableArray takeWhile
1237
+ * @tsplus pipeable fncts.ImmutableArray takeWhile
1156
1238
  */
1157
- export function takeWhile_<A, B extends A>(self: ImmutableArray<A>, p: Refinement<A, B>): ImmutableArray<B>;
1158
- export function takeWhile_<A>(self: ImmutableArray<A>, p: Predicate<A>): ImmutableArray<A>;
1159
- export function takeWhile_<A>(self: ImmutableArray<A>, p: Predicate<A>): ImmutableArray<A> {
1160
- const i = self.spanIndexLeft(p);
1161
- const init = Array<A>(i);
1162
- for (let j = 0; j < i; j++) {
1163
- init[j] = self._array[j]!;
1164
- }
1165
- return init.asImmutableArray;
1239
+ export function takeWhile<A, B extends A>(p: Refinement<A, B>): (self: ImmutableArray<A>) => ImmutableArray<B>;
1240
+ export function takeWhile<A>(p: Predicate<A>): (self: ImmutableArray<A>) => ImmutableArray<A>;
1241
+ export function takeWhile<A>(p: Predicate<A>) {
1242
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
1243
+ const i = self.spanIndexLeft(p);
1244
+ const init = Array<A>(i);
1245
+ for (let j = 0; j < i; j++) {
1246
+ init[j] = self._array[j]!;
1247
+ }
1248
+ return init.asImmutableArray;
1249
+ };
1166
1250
  }
1167
1251
 
1168
1252
  /**
1169
1253
  * @tsplus getter fncts.ImmutableArray traverseWithIndex
1170
1254
  */
1171
- export const traverseWithIndex_ = P.TraversableWithIndex.makeTraverseWithIndex<ImmutableArrayF>()(
1172
- () => (ta) => (G) => (f) =>
1173
- ta.foldLeftWithIndex(G.pure(ImmutableArray.empty()), (i, fbs, a) =>
1174
- G.zipWith(fbs, f(i, a), (bs, b) => bs.append(b)),
1175
- ),
1176
- );
1255
+ export function _traverseWithIndex<A>(
1256
+ self: ImmutableArray<A>,
1257
+ ): <G extends HKT, GC = HKT.None>(
1258
+ G: P.Applicative<G, GC>,
1259
+ ) => <K, Q, W, X, I, S, R, E, B>(
1260
+ f: (i: number, a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, B>,
1261
+ ) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, ImmutableArray<B>>;
1262
+ export function _traverseWithIndex<A>(
1263
+ self: ImmutableArray<A>,
1264
+ ): <G>(G: P.Applicative<HKT.F<G>>) => <B>(f: (i: number, a: A) => HKT.FK1<G, B>) => HKT.FK1<G, ImmutableArray<B>> {
1265
+ return (G) => (f) =>
1266
+ self.foldLeftWithIndex(G.pure(ImmutableArray.empty()), (i, fbs, a) =>
1267
+ pipe(
1268
+ fbs,
1269
+ G.zipWith(f(i, a), (bs, b) => bs.append(b)),
1270
+ ),
1271
+ );
1272
+ }
1177
1273
 
1178
1274
  /**
1179
1275
  * @tsplus getter fncts.ImmutableArray traverse
1180
1276
  */
1181
- export const traverse_: P.Traversable<ImmutableArrayF>["traverse"] = (self) => (G) => (f) =>
1277
+ export function _traverse<A>(
1278
+ self: ImmutableArray<A>,
1279
+ ): <G extends HKT, GC = HKT.None>(
1280
+ G: P.Applicative<G, GC>,
1281
+ ) => <K, Q, W, X, I, S, R, E, B>(
1282
+ f: (a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, B>,
1283
+ ) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, ImmutableArray<B>> {
1284
+ return (G) => (f) => self.traverseWithIndex(G)((_, a) => f(a));
1285
+ }
1286
+
1287
+ export const traverseWithIndex: P.TraversableWithIndex<ImmutableArrayF>["traverseWithIndex"] = (G) => (f) => (self) =>
1288
+ self.traverseWithIndex(G)(f);
1289
+
1290
+ export const traverse: P.Traversable<ImmutableArrayF>["traverse"] = (G) => (f) => (self) =>
1182
1291
  self.traverseWithIndex(G)((_, a) => f(a));
1183
1292
 
1184
1293
  /**
1185
- * @tsplus fluent fncts.ImmutableArray union
1294
+ * @tsplus pipeable fncts.ImmutableArray union
1186
1295
  */
1187
- export function union_<A>(
1188
- self: ImmutableArray<A>,
1189
- that: ImmutableArray<A>,
1190
- /** @tsplus auto */ E: P.Eq<A>,
1191
- ): ImmutableArray<A> {
1192
- return self.concat(that.filter((a) => !self.elem(a, E)));
1296
+ export function union<A>(that: ImmutableArray<A>, /** @tsplus auto */ E: P.Eq<A>) {
1297
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
1298
+ return self.concat(that.filter((a) => !self.elem(a, E)));
1299
+ };
1193
1300
  }
1194
1301
 
1195
1302
  /**
1196
- * @tsplus fluent fncts.ImmutableArray uniq
1303
+ * @tsplus pipeable fncts.ImmutableArray uniq
1197
1304
  */
1198
- export function uniq<A>(self: ImmutableArray<A>, /** @tsplus auto */ E: P.Eq<A>): ImmutableArray<A> {
1199
- if (self.length === 1) {
1200
- return self;
1201
- }
1202
- const out = [] as Array<A>;
1203
- const len = self.length;
1204
- for (let i = 0; i < len; i++) {
1205
- const a = self._array[i]!;
1206
- if (!out.asImmutableArray.elem(a, E)) {
1207
- out.push(a);
1305
+ export function uniq<A>(/** @tsplus auto */ E: P.Eq<A>) {
1306
+ return (self: ImmutableArray<A>): ImmutableArray<A> => {
1307
+ if (self.length === 1) {
1308
+ return self;
1208
1309
  }
1209
- }
1210
- return out.asImmutableArray;
1310
+ const out = [] as Array<A>;
1311
+ const len = self.length;
1312
+ for (let i = 0; i < len; i++) {
1313
+ const a = self._array[i]!;
1314
+ if (!out.asImmutableArray.elem(a, E)) {
1315
+ out.push(a);
1316
+ }
1317
+ }
1318
+ return out.asImmutableArray;
1319
+ };
1211
1320
  }
1212
1321
 
1213
1322
  /**
@@ -1232,47 +1341,55 @@ export function unsafeAsMutable<A>(self: ImmutableArray<A>): Array<A> {
1232
1341
  }
1233
1342
 
1234
1343
  /**
1235
- * @tsplus fluent fncts.ImmutableArray unsafeDeleteAt
1344
+ * @tsplus pipeable fncts.ImmutableArray unsafeDeleteAt
1236
1345
  */
1237
- export function unsafeDeleteAt_<A>(self: ImmutableArray<A>, i: number): ImmutableArray<A> {
1238
- return self.mutate((xs) => {
1239
- xs.splice(i, 1);
1240
- });
1346
+ export function unsafeDeleteAt(i: number) {
1347
+ return <A>(self: ImmutableArray<A>): ImmutableArray<A> => {
1348
+ return self.mutate((xs) => {
1349
+ xs.splice(i, 1);
1350
+ });
1351
+ };
1241
1352
  }
1242
1353
 
1243
1354
  /**
1244
- * @tsplus fluent fncts.ImmutableArray unsafeInsertAt
1355
+ * @tsplus pipeable fncts.ImmutableArray unsafeInsertAt
1245
1356
  */
1246
- export function unsafeInsertAt_<A>(as: ImmutableArray<A>, i: number, a: A): ImmutableNonEmptyArray<A> {
1247
- return as.mutate((xs) => {
1248
- xs.splice(i, 0, a);
1249
- }) as unknown as ImmutableNonEmptyArray<A>;
1357
+ export function unsafeInsertAt<A>(i: number, a: A) {
1358
+ return (as: ImmutableArray<A>): ImmutableNonEmptyArray<A> => {
1359
+ return as.mutate((xs) => {
1360
+ xs.splice(i, 0, a);
1361
+ }) as unknown as ImmutableNonEmptyArray<A>;
1362
+ };
1250
1363
  }
1251
1364
 
1252
1365
  /**
1253
- * @tsplus fluent fncts.ImmutableArray unsafeModifyAt
1366
+ * @tsplus pipeable fncts.ImmutableArray unsafeModifyAt
1254
1367
  */
1255
- export function unsafeModifyAt_<A>(as: ImmutableArray<A>, i: number, f: (a: A) => A): ImmutableArray<A> {
1256
- const next = f(as[i]!);
1257
- if (as[i] === next) {
1258
- return as;
1259
- }
1260
- return as.mutate((xs) => {
1261
- xs[i] = next;
1262
- });
1368
+ export function unsafeModifyAt<A>(i: number, f: (a: A) => A) {
1369
+ return (as: ImmutableArray<A>): ImmutableArray<A> => {
1370
+ const next = f(as[i]!);
1371
+ if (as[i] === next) {
1372
+ return as;
1373
+ }
1374
+ return as.mutate((xs) => {
1375
+ xs[i] = next;
1376
+ });
1377
+ };
1263
1378
  }
1264
1379
 
1265
1380
  /**
1266
- * @tsplus fluent fncts.ImmutableArray unsafeUpdateAt
1381
+ * @tsplus pipeable fncts.ImmutableArray unsafeUpdateAt
1267
1382
  */
1268
- export function unsafeUpdateAt_<A>(as: ImmutableArray<A>, i: number, a: A): ImmutableArray<A> {
1269
- if (as[i] === a) {
1270
- return as;
1271
- } else {
1272
- return as.mutate((xs) => {
1273
- xs[i] = a;
1274
- });
1275
- }
1383
+ export function unsafeUpdateAt<A>(i: number, a: A) {
1384
+ return (as: ImmutableArray<A>): ImmutableArray<A> => {
1385
+ if (as[i] === a) {
1386
+ return as;
1387
+ } else {
1388
+ return as.mutate((xs) => {
1389
+ xs[i] = a;
1390
+ });
1391
+ }
1392
+ };
1276
1393
  }
1277
1394
 
1278
1395
  /**
@@ -1291,86 +1408,117 @@ export function unzip<A, B>(self: ImmutableArray<readonly [A, B]>): readonly [Im
1291
1408
  }
1292
1409
 
1293
1410
  /**
1294
- * @tsplus fluent fncts.ImmutableArray updateAt
1411
+ * @tsplus pipeable fncts.ImmutableArray updateAt
1295
1412
  */
1296
- export function updateAt_<A>(as: ImmutableArray<A>, i: number, a: A): Maybe<ImmutableArray<A>> {
1297
- return as.isOutOfBound(i) ? Nothing() : Just(as.unsafeUpdateAt(i, a));
1413
+ export function updateAt<A>(i: number, a: A) {
1414
+ return (as: ImmutableArray<A>): Maybe<ImmutableArray<A>> => {
1415
+ return as.isOutOfBound(i) ? Nothing() : Just(as.unsafeUpdateAt(i, a));
1416
+ };
1298
1417
  }
1299
1418
 
1300
1419
  /**
1301
1420
  * @tsplus getter fncts.ImmutableArray wiltWithIndex
1302
1421
  */
1303
- export const wiltWithIndex = P.WitherableWithIndex.makeWiltWithIndex<ImmutableArrayF>()(
1304
- (_) => (self) => (G) => (f) =>
1305
- G.map(
1306
- self.foldLeftWithIndex(G.pure([[] as Array<typeof _["B"]>, [] as Array<typeof _["B1"]>] as const), (i, fbs, a) =>
1307
- G.zipWith(f(i, a), fbs, (eb, r) =>
1308
- eb.match(
1309
- (b1) => {
1310
- r[0].push(b1);
1311
- return r;
1312
- },
1313
- (b2) => {
1314
- r[1].push(b2);
1315
- return r;
1316
- },
1422
+ export function _wiltWithIndex<A>(self: ImmutableArray<A>) {
1423
+ return <G extends HKT, GC = HKT.None>(G: P.Applicative<G, GC>) =>
1424
+ <K, Q, W, X, I, S, R, E, B, B2>(
1425
+ f: (i: number, a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Either<B, B2>>,
1426
+ ): HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, readonly [ImmutableArray<B>, ImmutableArray<B2>]> =>
1427
+ self
1428
+ .foldLeftWithIndex(G.pure([[] as Array<B>, [] as Array<B2>] as const), (i, fbs, a) =>
1429
+ f(i, a).pipe(
1430
+ G.zipWith(fbs, (eb, r) =>
1431
+ eb.match(
1432
+ (b1) => {
1433
+ r[0].push(b1);
1434
+ return r;
1435
+ },
1436
+ (b2) => {
1437
+ r[1].push(b2);
1438
+ return r;
1439
+ },
1440
+ ),
1441
+ ),
1317
1442
  ),
1318
- ),
1319
- ),
1320
- ([b1s, b2s]) => [b1s.asImmutableArray, b2s.asImmutableArray],
1321
- ),
1322
- );
1443
+ )
1444
+ .pipe(G.map(([b1s, b2s]) => [b1s.asImmutableArray, b2s.asImmutableArray]));
1445
+ }
1323
1446
 
1324
1447
  /**
1325
1448
  * @tsplus getter fncts.ImmutableArray wilt
1326
1449
  */
1327
- export const wilt: P.WitherableWithIndex<ImmutableArrayF>["wilt"] = (self) => (G) => (f) =>
1328
- self.wiltWithIndex(G)((_, a) => f(a));
1450
+ export function _wilt<A>(self: ImmutableArray<A>) {
1451
+ return <G extends HKT, GC = HKT.None>(G: P.Applicative<G, GC>) =>
1452
+ <K, Q, W, X, I, S, R, E, B, B2>(
1453
+ f: (a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Either<B, B2>>,
1454
+ ): HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, readonly [ImmutableArray<B>, ImmutableArray<B2>]> =>
1455
+ self.wiltWithIndex(G)((_, a) => f(a));
1456
+ }
1329
1457
 
1330
1458
  /**
1331
1459
  * @tsplus getter fncts.ImmutableArray witherWithIndex
1332
1460
  */
1333
- export const witherWithIndex = P.WitherableWithIndex.makeWitherWithIndex<ImmutableArrayF>()(
1334
- (_) => (self) => (G) => (f) => {
1335
- return G.map(
1336
- self.foldLeftWithIndex(G.pure([] as Array<typeof _["B"]>), (i, b, a) =>
1337
- G.zipWith(f(i, a), b, (maybeB, bs) => {
1338
- if (maybeB.isJust()) {
1339
- bs.push(maybeB.value);
1340
- }
1341
- return bs;
1342
- }),
1343
- ),
1344
- (bs) => bs.asImmutableArray,
1345
- );
1346
- },
1347
- );
1461
+ export function _witherWithIndex<A>(self: ImmutableArray<A>) {
1462
+ return <G extends HKT, GC = HKT.None>(G: P.Applicative<G, GC>) =>
1463
+ <K, Q, W, X, I, S, R, E, B>(
1464
+ f: (i: number, a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Maybe<B>>,
1465
+ ): HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, ImmutableArray<B>> =>
1466
+ self
1467
+ .foldLeftWithIndex(G.pure([] as Array<B>), (i, b, a) =>
1468
+ f(i, a).pipe(
1469
+ G.zipWith(b, (maybeB, bs) => {
1470
+ if (maybeB.isJust()) {
1471
+ bs.push(maybeB.value);
1472
+ }
1473
+ return bs;
1474
+ }),
1475
+ ),
1476
+ )
1477
+ .pipe(G.map((bs) => bs.asImmutableArray));
1478
+ }
1348
1479
 
1349
1480
  /**
1350
1481
  * @tsplus getter fncts.ImmutableArray wither
1351
1482
  */
1352
- export const wither: P.Witherable<ImmutableArrayF>["wither"] = (self) => (G) => (f) =>
1483
+ export function _wither<A>(self: ImmutableArray<A>) {
1484
+ return <G extends HKT, GC = HKT.None>(G: P.Applicative<G, GC>) =>
1485
+ <K, Q, W, X, I, S, R, E, B>(
1486
+ f: (a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Maybe<B>>,
1487
+ ): HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, ImmutableArray<B>> =>
1488
+ self.witherWithIndex(G)((_, a) => f(a));
1489
+ }
1490
+
1491
+ export const wiltWithIndex: P.WitherableWithIndex<ImmutableArrayF>["wiltWithIndex"] = (G) => (f) => (self) =>
1492
+ self.wiltWithIndex(G)(f);
1493
+
1494
+ export const wilt: P.WitherableWithIndex<ImmutableArrayF>["wilt"] = (G) => (f) => (self) =>
1495
+ self.wiltWithIndex(G)((_, a) => f(a));
1496
+
1497
+ export const witherWithIndex: P.WitherableWithIndex<ImmutableArrayF>["witherWithIndex"] = (G) => (f) => (self) =>
1498
+ self.witherWithIndex(G)(f);
1499
+
1500
+ export const wither: P.Witherable<ImmutableArrayF>["wither"] = (G) => (f) => (self) =>
1353
1501
  self.witherWithIndex(G)((_, a) => f(a));
1354
1502
 
1355
1503
  /**
1356
- * @tsplus fluent fncts.ImmutableArray zip
1504
+ * @tsplus pipeable fncts.ImmutableArray zip
1357
1505
  */
1358
- export function zip_<A, B>(self: ImmutableArray<A>, that: ImmutableArray<B>): ImmutableArray<readonly [A, B]> {
1359
- return self.zipWith(that, tuple);
1506
+ export function zip<B>(that: ImmutableArray<B>) {
1507
+ return <A>(self: ImmutableArray<A>): ImmutableArray<readonly [A, B]> => {
1508
+ return self.zipWith(that, tuple);
1509
+ };
1360
1510
  }
1361
1511
 
1362
1512
  /**
1363
- * @tsplus fluent fncts.ImmutableArray zipWith
1513
+ * @tsplus pipeable fncts.ImmutableArray zipWith
1364
1514
  */
1365
- export function zipWith_<A, B, C>(
1366
- self: ImmutableArray<A>,
1367
- fb: ImmutableArray<B>,
1368
- f: (a: A, b: B) => C,
1369
- ): ImmutableArray<C> {
1370
- const len = Math.min(self.length, fb.length);
1371
- const fc = Array<C>(len);
1372
- for (let i = 0; i < len; i++) {
1373
- fc[i] = f(self._array[i]!, fb._array[i]!);
1374
- }
1375
- return fc.asImmutableArray;
1515
+ export function zipWith<A, B, C>(fb: ImmutableArray<B>, f: (a: A, b: B) => C) {
1516
+ return (self: ImmutableArray<A>): ImmutableArray<C> => {
1517
+ const len = Math.min(self.length, fb.length);
1518
+ const fc = Array<C>(len);
1519
+ for (let i = 0; i < len; i++) {
1520
+ fc[i] = f(self._array[i]!, fb._array[i]!);
1521
+ }
1522
+ return fc.asImmutableArray;
1523
+ };
1376
1524
  }