@fncts/io 0.0.48 → 0.0.49

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 (675) hide show
  1. package/Cached/api.d.ts +1 -1
  2. package/Channel/api.d.ts +80 -80
  3. package/Channel/core-api.d.ts +26 -26
  4. package/Console/definition.d.ts +1 -0
  5. package/CountdownLatch.d.ts +1 -0
  6. package/Fiber/FiberMessage.d.ts +6 -28
  7. package/Fiber/FiberRuntime.d.ts +108 -77
  8. package/Fiber/api/interruptAs.d.ts +2 -2
  9. package/Fiber/definition.d.ts +2 -0
  10. package/FiberScope/definition.d.ts +3 -0
  11. package/FiberSet.d.ts +2 -1
  12. package/Future/State.d.ts +59 -0
  13. package/Future/api.d.ts +8 -3
  14. package/Future/constructors.d.ts +1 -1
  15. package/Future/definition.d.ts +1 -17
  16. package/Future.d.ts +1 -0
  17. package/Hub/api.d.ts +15 -15
  18. package/IO/api/array.d.ts +22 -0
  19. package/IO/api/awaitAllChildren.d.ts +6 -0
  20. package/IO/api/cachedInvalidate.d.ts +15 -0
  21. package/IO/api/forkDaemon.d.ts +1 -1
  22. package/IO/api/onTermination.d.ts +1 -2
  23. package/IO/api/transplant.d.ts +11 -1
  24. package/IO/api.d.ts +247 -225
  25. package/IO/definition.d.ts +12 -25
  26. package/IO.d.ts +3 -1
  27. package/Random/definition.d.ts +1 -0
  28. package/Ref/Synchronized/api.d.ts +1 -1
  29. package/Semaphore/Reservation.d.ts +15 -0
  30. package/Semaphore/constructors.d.ts +13 -0
  31. package/Semaphore/definition.d.ts +29 -0
  32. package/Semaphore.d.ts +3 -40
  33. package/Stream/api.d.ts +164 -164
  34. package/_cjs/Cached/api.cjs +1 -2
  35. package/_cjs/Cached/api.cjs.map +1 -1
  36. package/_cjs/Cached/internal.cjs +1 -2
  37. package/_cjs/Cached/internal.cjs.map +1 -1
  38. package/_cjs/Channel/api/interruptWhen.cjs +1 -2
  39. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  40. package/_cjs/Channel/api/mapOutConcurrentIO.cjs +2 -3
  41. package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
  42. package/_cjs/Channel/api/mergeAll.cjs +1 -2
  43. package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
  44. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +1 -2
  45. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
  46. package/_cjs/Channel/api/mergeAllWith.cjs +2 -3
  47. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  48. package/_cjs/Channel/api/mergeMap.cjs +1 -2
  49. package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
  50. package/_cjs/Channel/api/mergeWith.cjs +1 -2
  51. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  52. package/_cjs/Channel/api/run.cjs +1 -2
  53. package/_cjs/Channel/api/run.cjs.map +1 -1
  54. package/_cjs/Channel/api/runCollect.cjs +1 -2
  55. package/_cjs/Channel/api/runCollect.cjs.map +1 -1
  56. package/_cjs/Channel/api/runDrain.cjs +1 -2
  57. package/_cjs/Channel/api/runDrain.cjs.map +1 -1
  58. package/_cjs/Channel/api/runScoped.cjs +3 -4
  59. package/_cjs/Channel/api/runScoped.cjs.map +1 -1
  60. package/_cjs/Channel/api/toPull.cjs +2 -3
  61. package/_cjs/Channel/api/toPull.cjs.map +1 -1
  62. package/_cjs/Channel/api/zipConcurrent.cjs +1 -2
  63. package/_cjs/Channel/api/zipConcurrent.cjs.map +1 -1
  64. package/_cjs/Channel/api.cjs +206 -207
  65. package/_cjs/Channel/api.cjs.map +1 -1
  66. package/_cjs/Channel/core-api.cjs +43 -42
  67. package/_cjs/Channel/core-api.cjs.map +1 -1
  68. package/_cjs/Channel/internal/ChannelExecutor.cjs +4 -5
  69. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  70. package/_cjs/Channel/internal/ChannelState.cjs +1 -2
  71. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
  72. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +1 -2
  73. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  74. package/_cjs/Clock/api.cjs +1 -2
  75. package/_cjs/Clock/api.cjs.map +1 -1
  76. package/_cjs/Clock/definition.cjs +1 -2
  77. package/_cjs/Clock/definition.cjs.map +1 -1
  78. package/_cjs/Clock/live.cjs +1 -2
  79. package/_cjs/Clock/live.cjs.map +1 -1
  80. package/_cjs/Console/api.cjs +1 -2
  81. package/_cjs/Console/api.cjs.map +1 -1
  82. package/_cjs/Console/definition.cjs +2 -2
  83. package/_cjs/Console/definition.cjs.map +1 -1
  84. package/_cjs/Console/live.cjs +1 -2
  85. package/_cjs/Console/live.cjs.map +1 -1
  86. package/_cjs/CountdownLatch.cjs +3 -3
  87. package/_cjs/CountdownLatch.cjs.map +1 -1
  88. package/_cjs/Differ/api.cjs +1 -2
  89. package/_cjs/Differ/api.cjs.map +1 -1
  90. package/_cjs/Fiber/FiberMessage.cjs +3 -24
  91. package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
  92. package/_cjs/Fiber/FiberRuntime.cjs +879 -636
  93. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  94. package/_cjs/Fiber/api/awaitAll.cjs +1 -2
  95. package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
  96. package/_cjs/Fiber/api/collectAll.cjs +2 -3
  97. package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
  98. package/_cjs/Fiber/api/fromIO.cjs +1 -2
  99. package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
  100. package/_cjs/Fiber/api/interrupt.cjs +2 -3
  101. package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
  102. package/_cjs/Fiber/api/interruptAll.cjs +2 -3
  103. package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
  104. package/_cjs/Fiber/api/interruptAs.cjs +5 -10
  105. package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
  106. package/_cjs/Fiber/api/interruptFork.cjs +2 -3
  107. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  108. package/_cjs/Fiber/api/join.cjs +1 -2
  109. package/_cjs/Fiber/api/join.cjs.map +1 -1
  110. package/_cjs/Fiber/api/joinAll.cjs +1 -2
  111. package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
  112. package/_cjs/Fiber/api/mapFiber.cjs +1 -2
  113. package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
  114. package/_cjs/Fiber/api/mapIO.cjs +2 -3
  115. package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
  116. package/_cjs/Fiber/api/zipWith.cjs +2 -3
  117. package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
  118. package/_cjs/Fiber/constructors.cjs +2 -3
  119. package/_cjs/Fiber/constructors.cjs.map +1 -1
  120. package/_cjs/Fiber/definition.cjs +6 -4
  121. package/_cjs/Fiber/definition.cjs.map +1 -1
  122. package/_cjs/FiberRef/api/locallyScoped.cjs +1 -2
  123. package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
  124. package/_cjs/FiberRef/api/locallyScopedWith.cjs +1 -2
  125. package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
  126. package/_cjs/FiberRef/constructors.cjs +1 -2
  127. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  128. package/_cjs/FiberRef/definition.cjs +1 -2
  129. package/_cjs/FiberRef/definition.cjs.map +1 -1
  130. package/_cjs/FiberRef/operations.cjs +1 -2
  131. package/_cjs/FiberRef/operations.cjs.map +1 -1
  132. package/_cjs/FiberRef/unsafe.cjs +1 -2
  133. package/_cjs/FiberRef/unsafe.cjs.map +1 -1
  134. package/_cjs/FiberRefs/Patch.cjs +1 -2
  135. package/_cjs/FiberRefs/Patch.cjs.map +1 -1
  136. package/_cjs/FiberRefs/api.cjs +1 -2
  137. package/_cjs/FiberRefs/api.cjs.map +1 -1
  138. package/_cjs/FiberRefs/definition.cjs +1 -2
  139. package/_cjs/FiberRefs/definition.cjs.map +1 -1
  140. package/_cjs/FiberScope/definition.cjs +29 -6
  141. package/_cjs/FiberScope/definition.cjs.map +1 -1
  142. package/_cjs/FiberSet.cjs +16 -15
  143. package/_cjs/FiberSet.cjs.map +1 -1
  144. package/_cjs/FiberStatus/definition.cjs +1 -2
  145. package/_cjs/FiberStatus/definition.cjs.map +1 -1
  146. package/_cjs/Future/State.cjs +108 -0
  147. package/_cjs/Future/State.cjs.map +1 -0
  148. package/_cjs/Future/api.cjs +71 -64
  149. package/_cjs/Future/api.cjs.map +1 -1
  150. package/_cjs/Future/constructors.cjs +3 -4
  151. package/_cjs/Future/constructors.cjs.map +1 -1
  152. package/_cjs/Future/definition.cjs +1 -15
  153. package/_cjs/Future/definition.cjs.map +1 -1
  154. package/_cjs/Future.cjs +11 -0
  155. package/_cjs/Future.cjs.map +1 -1
  156. package/_cjs/Hub/api.cjs +56 -57
  157. package/_cjs/Hub/api.cjs.map +1 -1
  158. package/_cjs/Hub/internal.cjs +1 -2
  159. package/_cjs/Hub/internal.cjs.map +1 -1
  160. package/_cjs/IO/api/acquireRelease.cjs +1 -2
  161. package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
  162. package/_cjs/IO/api/acquireReleaseExit.cjs +1 -2
  163. package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
  164. package/_cjs/IO/api/acquireReleaseInterruptible.cjs +1 -2
  165. package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -1
  166. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +1 -2
  167. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
  168. package/_cjs/IO/api/addFinalizer.cjs +1 -2
  169. package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
  170. package/_cjs/IO/api/addFinalizerExit.cjs +1 -2
  171. package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
  172. package/_cjs/IO/api/all.cjs +1 -2
  173. package/_cjs/IO/api/all.cjs.map +1 -1
  174. package/_cjs/IO/api/array.cjs +51 -0
  175. package/_cjs/IO/api/array.cjs.map +1 -0
  176. package/_cjs/IO/api/asyncIO.cjs +1 -2
  177. package/_cjs/IO/api/asyncIO.cjs.map +1 -1
  178. package/_cjs/IO/api/asyncInterrupt.cjs +1 -2
  179. package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
  180. package/_cjs/IO/api/awaitAllChildren.cjs +17 -0
  181. package/_cjs/IO/api/awaitAllChildren.cjs.map +1 -0
  182. package/_cjs/IO/api/blocking.cjs +1 -2
  183. package/_cjs/IO/api/blocking.cjs.map +1 -1
  184. package/_cjs/IO/api/bracket.cjs +1 -2
  185. package/_cjs/IO/api/bracket.cjs.map +1 -1
  186. package/_cjs/IO/api/bracketExit.cjs +1 -2
  187. package/_cjs/IO/api/bracketExit.cjs.map +1 -1
  188. package/_cjs/IO/api/cachedInvalidate.cjs +47 -0
  189. package/_cjs/IO/api/cachedInvalidate.cjs.map +1 -0
  190. package/_cjs/IO/api/clockWith.cjs +1 -2
  191. package/_cjs/IO/api/clockWith.cjs.map +1 -1
  192. package/_cjs/IO/api/concurrency.cjs +1 -2
  193. package/_cjs/IO/api/concurrency.cjs.map +1 -1
  194. package/_cjs/IO/api/concurrentFinalizers.cjs +1 -2
  195. package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
  196. package/_cjs/IO/api/consoleWith.cjs +1 -2
  197. package/_cjs/IO/api/consoleWith.cjs.map +1 -1
  198. package/_cjs/IO/api/daemonChildren.cjs +1 -2
  199. package/_cjs/IO/api/daemonChildren.cjs.map +1 -1
  200. package/_cjs/IO/api/delay.cjs +1 -2
  201. package/_cjs/IO/api/delay.cjs.map +1 -1
  202. package/_cjs/IO/api/descriptor.cjs +1 -2
  203. package/_cjs/IO/api/descriptor.cjs.map +1 -1
  204. package/_cjs/IO/api/diffFiberRefs.cjs +1 -2
  205. package/_cjs/IO/api/diffFiberRefs.cjs.map +1 -1
  206. package/_cjs/IO/api/disconnect.cjs +2 -3
  207. package/_cjs/IO/api/disconnect.cjs.map +1 -1
  208. package/_cjs/IO/api/ensuringChildren.cjs +1 -2
  209. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
  210. package/_cjs/IO/api/environment.cjs +1 -2
  211. package/_cjs/IO/api/environment.cjs.map +1 -1
  212. package/_cjs/IO/api/foreachConcurrent.cjs +36 -30
  213. package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
  214. package/_cjs/IO/api/foreachExec.cjs +1 -2
  215. package/_cjs/IO/api/foreachExec.cjs.map +1 -1
  216. package/_cjs/IO/api/fork.cjs +2 -3
  217. package/_cjs/IO/api/fork.cjs.map +1 -1
  218. package/_cjs/IO/api/forkAll.cjs +1 -2
  219. package/_cjs/IO/api/forkAll.cjs.map +1 -1
  220. package/_cjs/IO/api/forkDaemon.cjs +5 -6
  221. package/_cjs/IO/api/forkDaemon.cjs.map +1 -1
  222. package/_cjs/IO/api/forkIn.cjs +1 -2
  223. package/_cjs/IO/api/forkIn.cjs.map +1 -1
  224. package/_cjs/IO/api/forkScoped.cjs +1 -2
  225. package/_cjs/IO/api/forkScoped.cjs.map +1 -1
  226. package/_cjs/IO/api/fulfill.cjs +1 -2
  227. package/_cjs/IO/api/fulfill.cjs.map +1 -1
  228. package/_cjs/IO/api/interrupt.cjs +4 -5
  229. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  230. package/_cjs/IO/api/memoize.cjs +1 -2
  231. package/_cjs/IO/api/memoize.cjs.map +1 -1
  232. package/_cjs/IO/api/onTermination.cjs +2 -3
  233. package/_cjs/IO/api/onTermination.cjs.map +1 -1
  234. package/_cjs/IO/api/once.cjs +1 -2
  235. package/_cjs/IO/api/once.cjs.map +1 -1
  236. package/_cjs/IO/api/patchFiberRefs.cjs +1 -2
  237. package/_cjs/IO/api/patchFiberRefs.cjs.map +1 -1
  238. package/_cjs/IO/api/provideLayer.cjs +1 -2
  239. package/_cjs/IO/api/provideLayer.cjs.map +1 -1
  240. package/_cjs/IO/api/provideScope.cjs +1 -2
  241. package/_cjs/IO/api/provideScope.cjs.map +1 -1
  242. package/_cjs/IO/api/provideSomeLayer.cjs +1 -2
  243. package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
  244. package/_cjs/IO/api/provideSomeRuntime.cjs +1 -2
  245. package/_cjs/IO/api/provideSomeRuntime.cjs.map +1 -1
  246. package/_cjs/IO/api/race.cjs +2 -3
  247. package/_cjs/IO/api/race.cjs.map +1 -1
  248. package/_cjs/IO/api/raceFirst.cjs +1 -2
  249. package/_cjs/IO/api/raceFirst.cjs.map +1 -1
  250. package/_cjs/IO/api/raceWith.cjs +1 -2
  251. package/_cjs/IO/api/raceWith.cjs.map +1 -1
  252. package/_cjs/IO/api/randomWith.cjs +1 -2
  253. package/_cjs/IO/api/randomWith.cjs.map +1 -1
  254. package/_cjs/IO/api/repeat.cjs +1 -2
  255. package/_cjs/IO/api/repeat.cjs.map +1 -1
  256. package/_cjs/IO/api/retry.cjs +1 -2
  257. package/_cjs/IO/api/retry.cjs.map +1 -1
  258. package/_cjs/IO/api/schedule.cjs +1 -2
  259. package/_cjs/IO/api/schedule.cjs.map +1 -1
  260. package/_cjs/IO/api/scope.cjs +1 -2
  261. package/_cjs/IO/api/scope.cjs.map +1 -1
  262. package/_cjs/IO/api/scopeWith.cjs +1 -2
  263. package/_cjs/IO/api/scopeWith.cjs.map +1 -1
  264. package/_cjs/IO/api/scoped.cjs +1 -2
  265. package/_cjs/IO/api/scoped.cjs.map +1 -1
  266. package/_cjs/IO/api/sleep.cjs +1 -2
  267. package/_cjs/IO/api/sleep.cjs.map +1 -1
  268. package/_cjs/IO/api/stateful.cjs +1 -2
  269. package/_cjs/IO/api/stateful.cjs.map +1 -1
  270. package/_cjs/IO/api/supervised.cjs +1 -2
  271. package/_cjs/IO/api/supervised.cjs.map +1 -1
  272. package/_cjs/IO/api/timeout.cjs +9 -11
  273. package/_cjs/IO/api/timeout.cjs.map +1 -1
  274. package/_cjs/IO/api/transplant.cjs +22 -7
  275. package/_cjs/IO/api/transplant.cjs.map +1 -1
  276. package/_cjs/IO/api/whenFiberRef.cjs +1 -2
  277. package/_cjs/IO/api/whenFiberRef.cjs.map +1 -1
  278. package/_cjs/IO/api/whenRef.cjs +1 -2
  279. package/_cjs/IO/api/whenRef.cjs.map +1 -1
  280. package/_cjs/IO/api/withChildren.cjs +1 -2
  281. package/_cjs/IO/api/withChildren.cjs.map +1 -1
  282. package/_cjs/IO/api/withEarlyRelease.cjs +1 -2
  283. package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
  284. package/_cjs/IO/api/withFinalizer.cjs +1 -2
  285. package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
  286. package/_cjs/IO/api/withFinalizerExit.cjs +1 -2
  287. package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
  288. package/_cjs/IO/api/zipConcurrent.cjs +5 -6
  289. package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
  290. package/_cjs/IO/api.cjs +522 -473
  291. package/_cjs/IO/api.cjs.map +1 -1
  292. package/_cjs/IO/definition.cjs +2 -3
  293. package/_cjs/IO/definition.cjs.map +1 -1
  294. package/_cjs/IO/runtime.cjs +9 -10
  295. package/_cjs/IO/runtime.cjs.map +1 -1
  296. package/_cjs/IO.cjs +33 -11
  297. package/_cjs/IO.cjs.map +1 -1
  298. package/_cjs/IOEnv/definition.cjs +1 -2
  299. package/_cjs/IOEnv/definition.cjs.map +1 -1
  300. package/_cjs/IOEnv/live.cjs +1 -2
  301. package/_cjs/IOEnv/live.cjs.map +1 -1
  302. package/_cjs/IOEnv/services.cjs +1 -2
  303. package/_cjs/IOEnv/services.cjs.map +1 -1
  304. package/_cjs/Layer/MemoMap.cjs +1 -2
  305. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  306. package/_cjs/Layer/api.cjs +1 -2
  307. package/_cjs/Layer/api.cjs.map +1 -1
  308. package/_cjs/Logger/api.cjs +1 -2
  309. package/_cjs/Logger/api.cjs.map +1 -1
  310. package/_cjs/Logger/constructors.cjs +1 -2
  311. package/_cjs/Logger/constructors.cjs.map +1 -1
  312. package/_cjs/MVar/api.cjs +1 -2
  313. package/_cjs/MVar/api.cjs.map +1 -1
  314. package/_cjs/Push/api.cjs +2 -3
  315. package/_cjs/Push/api.cjs.map +1 -1
  316. package/_cjs/Push/internal.cjs +1 -2
  317. package/_cjs/Push/internal.cjs.map +1 -1
  318. package/_cjs/Queue/api/dimapIO.cjs +1 -2
  319. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  320. package/_cjs/Queue/api/filterInputIO.cjs +1 -2
  321. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  322. package/_cjs/Queue/api/filterOutputIO.cjs +1 -2
  323. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  324. package/_cjs/Queue/api/poll.cjs +1 -2
  325. package/_cjs/Queue/api/poll.cjs.map +1 -1
  326. package/_cjs/Queue/api/takeBetween.cjs +1 -2
  327. package/_cjs/Queue/api/takeBetween.cjs.map +1 -1
  328. package/_cjs/Queue/api/takeN.cjs +1 -2
  329. package/_cjs/Queue/api/takeN.cjs.map +1 -1
  330. package/_cjs/Queue/api/zipWithIO.cjs +1 -2
  331. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
  332. package/_cjs/Queue/constructors.cjs +1 -2
  333. package/_cjs/Queue/constructors.cjs.map +1 -1
  334. package/_cjs/Queue/internal.cjs +1 -2
  335. package/_cjs/Queue/internal.cjs.map +1 -1
  336. package/_cjs/Queue/strategy.cjs +1 -2
  337. package/_cjs/Queue/strategy.cjs.map +1 -1
  338. package/_cjs/Random/api.cjs +1 -2
  339. package/_cjs/Random/api.cjs.map +1 -1
  340. package/_cjs/Random/definition.cjs +2 -2
  341. package/_cjs/Random/definition.cjs.map +1 -1
  342. package/_cjs/Random/live.cjs +1 -2
  343. package/_cjs/Random/live.cjs.map +1 -1
  344. package/_cjs/Ref/Atomic.cjs +1 -2
  345. package/_cjs/Ref/Atomic.cjs.map +1 -1
  346. package/_cjs/Ref/Derived.cjs +1 -2
  347. package/_cjs/Ref/Derived.cjs.map +1 -1
  348. package/_cjs/Ref/DerivedAll.cjs +1 -2
  349. package/_cjs/Ref/DerivedAll.cjs.map +1 -1
  350. package/_cjs/Ref/Synchronized/api.cjs +2 -3
  351. package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
  352. package/_cjs/Ref/Synchronized/constructors.cjs +2 -3
  353. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
  354. package/_cjs/Ref/Synchronized/definition.cjs +2 -3
  355. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  356. package/_cjs/Ref/api/collect.cjs +1 -2
  357. package/_cjs/Ref/api/collect.cjs.map +1 -1
  358. package/_cjs/Ref/api/dimap.cjs +1 -2
  359. package/_cjs/Ref/api/dimap.cjs.map +1 -1
  360. package/_cjs/Ref/api/filter.cjs +1 -2
  361. package/_cjs/Ref/api/filter.cjs.map +1 -1
  362. package/_cjs/Ref/api/modify.cjs +1 -2
  363. package/_cjs/Ref/api/modify.cjs.map +1 -1
  364. package/_cjs/Ref/api.cjs +1 -2
  365. package/_cjs/Ref/api.cjs.map +1 -1
  366. package/_cjs/Ref/constructors.cjs +1 -2
  367. package/_cjs/Ref/constructors.cjs.map +1 -1
  368. package/_cjs/RefSubject/Atomic.cjs +1 -2
  369. package/_cjs/RefSubject/Atomic.cjs.map +1 -1
  370. package/_cjs/RefSubject/Synchronized/api.cjs +1 -2
  371. package/_cjs/RefSubject/Synchronized/api.cjs.map +1 -1
  372. package/_cjs/RefSubject/Synchronized/definition.cjs +1 -2
  373. package/_cjs/RefSubject/Synchronized/definition.cjs.map +1 -1
  374. package/_cjs/RefSubject/api.cjs +1 -2
  375. package/_cjs/RefSubject/api.cjs.map +1 -1
  376. package/_cjs/Reloadable/api.cjs +1 -2
  377. package/_cjs/Reloadable/api.cjs.map +1 -1
  378. package/_cjs/Reloadable/constructors.cjs +1 -2
  379. package/_cjs/Reloadable/constructors.cjs.map +1 -1
  380. package/_cjs/Reloadable/definition.cjs +1 -2
  381. package/_cjs/Reloadable/definition.cjs.map +1 -1
  382. package/_cjs/RuntimeFlags/Patch.cjs +1 -2
  383. package/_cjs/RuntimeFlags/Patch.cjs.map +1 -1
  384. package/_cjs/RuntimeFlags/RuntimeFlags.cjs +1 -2
  385. package/_cjs/RuntimeFlags/RuntimeFlags.cjs.map +1 -1
  386. package/_cjs/STM/api/atomically.cjs +1 -2
  387. package/_cjs/STM/api/atomically.cjs.map +1 -1
  388. package/_cjs/STM/api/core-api.cjs +1 -2
  389. package/_cjs/STM/api/core-api.cjs.map +1 -1
  390. package/_cjs/STM/api.cjs +1 -2
  391. package/_cjs/STM/api.cjs.map +1 -1
  392. package/_cjs/STM/definition.cjs +2 -3
  393. package/_cjs/STM/definition.cjs.map +1 -1
  394. package/_cjs/STM/driver.cjs +1 -2
  395. package/_cjs/STM/driver.cjs.map +1 -1
  396. package/_cjs/STM/internal/CommitState.cjs +1 -2
  397. package/_cjs/STM/internal/CommitState.cjs.map +1 -1
  398. package/_cjs/STM/internal/Journal.cjs +1 -2
  399. package/_cjs/STM/internal/Journal.cjs.map +1 -1
  400. package/_cjs/Schedule/Decision.cjs +1 -2
  401. package/_cjs/Schedule/Decision.cjs.map +1 -1
  402. package/_cjs/Schedule/api/driver.cjs +1 -2
  403. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  404. package/_cjs/Schedule/api.cjs +1 -2
  405. package/_cjs/Schedule/api.cjs.map +1 -1
  406. package/_cjs/Scope/Finalizer/definition.cjs +1 -2
  407. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  408. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -2
  409. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
  410. package/_cjs/Scope/ReleaseMap/api.cjs +1 -2
  411. package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
  412. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -2
  413. package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
  414. package/_cjs/Scope/ReleaseMap/definition.cjs +1 -2
  415. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  416. package/_cjs/Scope/api.cjs +1 -2
  417. package/_cjs/Scope/api.cjs.map +1 -1
  418. package/_cjs/Scope/definition.cjs +1 -2
  419. package/_cjs/Scope/definition.cjs.map +1 -1
  420. package/_cjs/ScopedRef/api.cjs +2 -3
  421. package/_cjs/ScopedRef/api.cjs.map +1 -1
  422. package/_cjs/Semaphore/Reservation.cjs +24 -0
  423. package/_cjs/Semaphore/Reservation.cjs.map +1 -0
  424. package/_cjs/Semaphore/constructors.cjs +25 -0
  425. package/_cjs/Semaphore/constructors.cjs.map +1 -0
  426. package/_cjs/Semaphore/definition.cjs +149 -0
  427. package/_cjs/Semaphore/definition.cjs.map +1 -0
  428. package/_cjs/Semaphore.cjs +31 -138
  429. package/_cjs/Semaphore.cjs.map +1 -1
  430. package/_cjs/Sink/api.cjs +1 -2
  431. package/_cjs/Sink/api.cjs.map +1 -1
  432. package/_cjs/State/api.cjs +1 -2
  433. package/_cjs/State/api.cjs.map +1 -1
  434. package/_cjs/Stream/api/zipAllWith.cjs +1 -2
  435. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
  436. package/_cjs/Stream/api/zipWith.cjs +1 -2
  437. package/_cjs/Stream/api/zipWith.cjs.map +1 -1
  438. package/_cjs/Stream/api/zipWithChunks.cjs +1 -2
  439. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
  440. package/_cjs/Stream/api.cjs +702 -703
  441. package/_cjs/Stream/api.cjs.map +1 -1
  442. package/_cjs/Stream/internal/Handoff.cjs +1 -2
  443. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  444. package/_cjs/Stream/internal/Pull.cjs +1 -2
  445. package/_cjs/Stream/internal/Pull.cjs.map +1 -1
  446. package/_cjs/Stream/internal/Take.cjs +1 -2
  447. package/_cjs/Stream/internal/Take.cjs.map +1 -1
  448. package/_cjs/Stream/internal/util.cjs +1 -2
  449. package/_cjs/Stream/internal/util.cjs.map +1 -1
  450. package/_cjs/Subject/Atomic.cjs +1 -2
  451. package/_cjs/Subject/Atomic.cjs.map +1 -1
  452. package/_cjs/Subject/api.cjs +1 -2
  453. package/_cjs/Subject/api.cjs.map +1 -1
  454. package/_cjs/SubscriptionRef.cjs +2 -3
  455. package/_cjs/SubscriptionRef.cjs.map +1 -1
  456. package/_cjs/Supervisor/api.cjs +1 -2
  457. package/_cjs/Supervisor/api.cjs.map +1 -1
  458. package/_cjs/Supervisor/constructors.cjs +1 -2
  459. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  460. package/_cjs/Supervisor/definition.cjs +1 -2
  461. package/_cjs/Supervisor/definition.cjs.map +1 -1
  462. package/_cjs/SupervisorPatch.cjs +1 -2
  463. package/_cjs/SupervisorPatch.cjs.map +1 -1
  464. package/_cjs/TExit/definition.cjs +1 -2
  465. package/_cjs/TExit/definition.cjs.map +1 -1
  466. package/_cjs/TFuture/api.cjs +1 -2
  467. package/_cjs/TFuture/api.cjs.map +1 -1
  468. package/_cjs/TFuture/constructors.cjs +1 -2
  469. package/_cjs/TFuture/constructors.cjs.map +1 -1
  470. package/_cjs/TFuture/definition.cjs +1 -2
  471. package/_cjs/TFuture/definition.cjs.map +1 -1
  472. package/_cjs/TReentrantLock/api.cjs +1 -2
  473. package/_cjs/TReentrantLock/api.cjs.map +1 -1
  474. package/_cjs/TReentrantLock/definition.cjs +1 -2
  475. package/_cjs/TReentrantLock/definition.cjs.map +1 -1
  476. package/_cjs/TRef/api.cjs +1 -2
  477. package/_cjs/TRef/api.cjs.map +1 -1
  478. package/_cjs/TRef/constructors.cjs +1 -2
  479. package/_cjs/TRef/constructors.cjs.map +1 -1
  480. package/_cjs/TRef/definition.cjs +1 -2
  481. package/_cjs/TRef/definition.cjs.map +1 -1
  482. package/_cjs/TSemaphore/api.cjs +1 -2
  483. package/_cjs/TSemaphore/api.cjs.map +1 -1
  484. package/_cjs/TSemaphore/constructors.cjs +1 -2
  485. package/_cjs/TSemaphore/constructors.cjs.map +1 -1
  486. package/_cjs/TSemaphore/definition.cjs +1 -2
  487. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  488. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +1 -2
  489. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
  490. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +1 -2
  491. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
  492. package/_cjs/collection/immutable/Conc/filterIO.cjs +1 -2
  493. package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
  494. package/_cjs/collection/immutable/Conc/findIO.cjs +1 -2
  495. package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
  496. package/_cjs/collection/immutable/Conc/mapIO.cjs +1 -2
  497. package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
  498. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +1 -2
  499. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
  500. package/_cjs/data/Exit/foreachIO.cjs +1 -2
  501. package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
  502. package/_cjs/internal/HashedPair.cjs +1 -2
  503. package/_cjs/internal/HashedPair.cjs.map +1 -1
  504. package/_cjs/internal/Hub.cjs +1 -2
  505. package/_cjs/internal/Hub.cjs.map +1 -1
  506. package/_cjs/internal/MutableQueue.cjs +1 -2
  507. package/_cjs/internal/MutableQueue.cjs.map +1 -1
  508. package/_cjs/internal/Scheduler.cjs +1 -2
  509. package/_cjs/internal/Scheduler.cjs.map +1 -1
  510. package/_cjs/internal/StackTraceBuilder.cjs +1 -2
  511. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
  512. package/_mjs/Cached/api.mjs.map +1 -1
  513. package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
  514. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  515. package/_mjs/Channel/api/runScoped.mjs +2 -2
  516. package/_mjs/Channel/api/runScoped.mjs.map +1 -1
  517. package/_mjs/Channel/api/toPull.mjs +1 -1
  518. package/_mjs/Channel/api/toPull.mjs.map +1 -1
  519. package/_mjs/Channel/api.mjs +205 -205
  520. package/_mjs/Channel/api.mjs.map +1 -1
  521. package/_mjs/Channel/core-api.mjs +43 -42
  522. package/_mjs/Channel/core-api.mjs.map +1 -1
  523. package/_mjs/Channel/internal/ChannelExecutor.mjs +3 -3
  524. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  525. package/_mjs/Console/definition.mjs +1 -0
  526. package/_mjs/Console/definition.mjs.map +1 -1
  527. package/_mjs/CountdownLatch.mjs +2 -1
  528. package/_mjs/CountdownLatch.mjs.map +1 -1
  529. package/_mjs/Fiber/FiberMessage.mjs +2 -20
  530. package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
  531. package/_mjs/Fiber/FiberRuntime.mjs +877 -633
  532. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  533. package/_mjs/Fiber/api/collectAll.mjs +1 -1
  534. package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
  535. package/_mjs/Fiber/api/interrupt.mjs +1 -1
  536. package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
  537. package/_mjs/Fiber/api/interruptAll.mjs +1 -1
  538. package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
  539. package/_mjs/Fiber/api/interruptAs.mjs +4 -7
  540. package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
  541. package/_mjs/Fiber/api/interruptFork.mjs +1 -1
  542. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  543. package/_mjs/Fiber/api/mapIO.mjs +1 -1
  544. package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
  545. package/_mjs/Fiber/api/zipWith.mjs +1 -1
  546. package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
  547. package/_mjs/Fiber/constructors.mjs +1 -1
  548. package/_mjs/Fiber/constructors.mjs.map +1 -1
  549. package/_mjs/Fiber/definition.mjs +5 -2
  550. package/_mjs/Fiber/definition.mjs.map +1 -1
  551. package/_mjs/FiberScope/definition.mjs +28 -4
  552. package/_mjs/FiberScope/definition.mjs.map +1 -1
  553. package/_mjs/FiberSet.mjs +14 -12
  554. package/_mjs/FiberSet.mjs.map +1 -1
  555. package/_mjs/Future/State.mjs +96 -0
  556. package/_mjs/Future/State.mjs.map +1 -0
  557. package/_mjs/Future/api.mjs +67 -61
  558. package/_mjs/Future/api.mjs.map +1 -1
  559. package/_mjs/Future/constructors.mjs +3 -3
  560. package/_mjs/Future/constructors.mjs.map +1 -1
  561. package/_mjs/Future/definition.mjs +0 -12
  562. package/_mjs/Future/definition.mjs.map +1 -1
  563. package/_mjs/Future.mjs +1 -0
  564. package/_mjs/Future.mjs.map +1 -1
  565. package/_mjs/Hub/api.mjs +55 -55
  566. package/_mjs/Hub/api.mjs.map +1 -1
  567. package/_mjs/IO/api/array.mjs +42 -0
  568. package/_mjs/IO/api/array.mjs.map +1 -0
  569. package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
  570. package/_mjs/IO/api/awaitAllChildren.mjs +10 -0
  571. package/_mjs/IO/api/awaitAllChildren.mjs.map +1 -0
  572. package/_mjs/IO/api/cachedInvalidate.mjs +39 -0
  573. package/_mjs/IO/api/cachedInvalidate.mjs.map +1 -0
  574. package/_mjs/IO/api/disconnect.mjs +1 -1
  575. package/_mjs/IO/api/disconnect.mjs.map +1 -1
  576. package/_mjs/IO/api/foreachConcurrent.mjs +35 -28
  577. package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
  578. package/_mjs/IO/api/fork.mjs +1 -1
  579. package/_mjs/IO/api/fork.mjs.map +1 -1
  580. package/_mjs/IO/api/forkDaemon.mjs +4 -4
  581. package/_mjs/IO/api/forkDaemon.mjs.map +1 -1
  582. package/_mjs/IO/api/interrupt.mjs +3 -3
  583. package/_mjs/IO/api/onTermination.mjs +1 -1
  584. package/_mjs/IO/api/onTermination.mjs.map +1 -1
  585. package/_mjs/IO/api/race.mjs +1 -1
  586. package/_mjs/IO/api/race.mjs.map +1 -1
  587. package/_mjs/IO/api/timeout.mjs +8 -9
  588. package/_mjs/IO/api/timeout.mjs.map +1 -1
  589. package/_mjs/IO/api/transplant.mjs +19 -5
  590. package/_mjs/IO/api/transplant.mjs.map +1 -1
  591. package/_mjs/IO/api/zipConcurrent.mjs +4 -4
  592. package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
  593. package/_mjs/IO/api.mjs +515 -468
  594. package/_mjs/IO/api.mjs.map +1 -1
  595. package/_mjs/IO/definition.mjs +1 -1
  596. package/_mjs/IO/definition.mjs.map +1 -1
  597. package/_mjs/IO/runtime.mjs +8 -8
  598. package/_mjs/IO/runtime.mjs.map +1 -1
  599. package/_mjs/IO.mjs +3 -1
  600. package/_mjs/IO.mjs.map +1 -1
  601. package/_mjs/IOEnv/definition.mjs.map +1 -1
  602. package/_mjs/Push/api.mjs +1 -1
  603. package/_mjs/Random/definition.mjs +1 -0
  604. package/_mjs/Random/definition.mjs.map +1 -1
  605. package/_mjs/Ref/Synchronized/api.mjs +1 -1
  606. package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
  607. package/_mjs/Ref/Synchronized/constructors.mjs +1 -1
  608. package/_mjs/Ref/Synchronized/definition.mjs +1 -1
  609. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  610. package/_mjs/STM/definition.mjs +1 -1
  611. package/_mjs/ScopedRef/api.mjs +1 -1
  612. package/_mjs/ScopedRef/api.mjs.map +1 -1
  613. package/_mjs/Semaphore/Reservation.mjs +16 -0
  614. package/_mjs/Semaphore/Reservation.mjs.map +1 -0
  615. package/_mjs/Semaphore/constructors.mjs +17 -0
  616. package/_mjs/Semaphore/constructors.mjs.map +1 -0
  617. package/_mjs/Semaphore/definition.mjs +141 -0
  618. package/_mjs/Semaphore/definition.mjs.map +1 -0
  619. package/_mjs/Semaphore.mjs +4 -133
  620. package/_mjs/Semaphore.mjs.map +1 -1
  621. package/_mjs/Stream/api.mjs +701 -701
  622. package/_mjs/Stream/api.mjs.map +1 -1
  623. package/_mjs/SubscriptionRef.mjs +1 -1
  624. package/_src/Cached/api.ts +3 -3
  625. package/_src/Channel/api/toPull.ts +1 -1
  626. package/_src/Channel/api.ts +273 -272
  627. package/_src/Channel/core-api.ts +57 -55
  628. package/_src/Channel/internal/ChannelExecutor.ts +3 -3
  629. package/_src/Console/definition.ts +1 -0
  630. package/_src/CountdownLatch.ts +2 -0
  631. package/_src/Fiber/FiberMessage.ts +3 -28
  632. package/_src/Fiber/FiberRuntime.ts +988 -616
  633. package/_src/Fiber/api/interruptAs.ts +4 -3
  634. package/_src/Fiber/constructors.ts +1 -1
  635. package/_src/Fiber/definition.ts +4 -0
  636. package/_src/FiberScope/definition.ts +40 -2
  637. package/_src/FiberSet.ts +6 -2
  638. package/_src/Future/State.ts +128 -0
  639. package/_src/Future/api.ts +62 -51
  640. package/_src/Future/constructors.ts +4 -2
  641. package/_src/Future/definition.ts +2 -17
  642. package/_src/Future.ts +4 -3
  643. package/_src/Hub/api.ts +61 -61
  644. package/_src/IO/api/addFinalizerExit.ts +4 -4
  645. package/_src/IO/api/array.ts +49 -0
  646. package/_src/IO/api/asyncInterrupt.ts +1 -1
  647. package/_src/IO/api/awaitAllChildren.ts +6 -0
  648. package/_src/IO/api/cachedInvalidate.ts +42 -0
  649. package/_src/IO/api/foreachConcurrent.ts +39 -23
  650. package/_src/IO/api/fork.ts +1 -1
  651. package/_src/IO/api/forkDaemon.ts +2 -2
  652. package/_src/IO/api/memoize.ts +3 -3
  653. package/_src/IO/api/onTermination.ts +2 -2
  654. package/_src/IO/api/transplant.ts +26 -3
  655. package/_src/IO/api/zipConcurrent.ts +2 -2
  656. package/_src/IO/api.ts +547 -525
  657. package/_src/IO/definition.ts +4 -28
  658. package/_src/IO/runtime.ts +0 -1
  659. package/_src/IO.ts +65 -63
  660. package/_src/IOEnv/definition.ts +1 -4
  661. package/_src/Random/definition.ts +1 -0
  662. package/_src/Ref/Synchronized/api.ts +2 -2
  663. package/_src/Ref/Synchronized/definition.ts +1 -1
  664. package/_src/Semaphore/Reservation.ts +15 -0
  665. package/_src/Semaphore/constructors.ts +14 -0
  666. package/_src/Semaphore/definition.ts +180 -0
  667. package/_src/Semaphore.ts +5 -159
  668. package/_src/Stream/api.ts +679 -679
  669. package/package.json +4 -4
  670. package/IO/api/sequenceT.d.ts +0 -26
  671. package/_cjs/IO/api/sequenceT.cjs +0 -18
  672. package/_cjs/IO/api/sequenceT.cjs.map +0 -1
  673. package/_mjs/IO/api/sequenceT.mjs +0 -10
  674. package/_mjs/IO/api/sequenceT.mjs.map +0 -1
  675. package/_src/IO/api/sequenceT.ts +0 -16
package/_mjs/IO/api.mjs CHANGED
@@ -1,53 +1,50 @@
1
1
  const fileName_1 = "(@fncts/io) src/IO/api.ts";
2
- import * as tsplus_module_1 from "@fncts/base/data/FiberId/constructors";
3
- import * as tsplus_module_2 from "@fncts/base/data/Cause/api";
4
- import * as tsplus_module_3 from "@fncts/base/data/Maybe/constructors";
2
+ import * as tsplus_module_1 from "@fncts/base/data/Cause/api";
3
+ import * as tsplus_module_2 from "@fncts/base/data/Maybe/constructors";
4
+ import * as tsplus_module_3 from "@fncts/base/data/FiberId/constructors";
5
5
  import * as tsplus_module_4 from "@fncts/base/data/Either/destructors";
6
- import * as tsplus_module_5 from "@fncts/base/util/predicates";
7
- import * as tsplus_module_6 from "@fncts/base/data/Maybe/api";
6
+ import * as tsplus_module_5 from "@fncts/base/data/Maybe/api";
7
+ import * as tsplus_module_6 from "@fncts/base/util/predicates";
8
8
  import * as tsplus_module_7 from "@fncts/io/RuntimeFlags/RuntimeFlags";
9
9
  import * as tsplus_module_8 from "@fncts/io/InterruptStatus/constructors";
10
10
  import * as tsplus_module_9 from "@fncts/base/data/Either/constructors";
11
- import * as tsplus_module_10 from "@fncts/base/collection/immutable/Conc/api";
12
- import * as tsplus_module_11 from "@fncts/base/collection/Iterable/api";
13
- import * as tsplus_module_12 from "@fncts/base/collection/immutable/Conc/constructors";
14
- import * as tsplus_module_13 from "@fncts/base/data/Maybe/definition";
15
- import * as tsplus_module_14 from "@fncts/base/control/Eval/run";
16
- import * as tsplus_module_15 from "@fncts/base/data/Exit/api";
17
- import * as tsplus_module_16 from "@fncts/base/data/Maybe/destructors";
18
- import * as tsplus_module_17 from "@fncts/base/data/exceptions";
19
- import * as tsplus_module_18 from "@fncts/base/data/Trace/constructors";
20
- import * as tsplus_module_19 from "@fncts/base/collection/immutable/Conc/api/empty";
21
- import * as tsplus_module_20 from "@fncts/base/collection/immutable/List/api";
22
- import * as tsplus_module_21 from "@fncts/base/collection/immutable/ImmutableArray/constructors";
23
- import * as tsplus_module_22 from "@fncts/base/collection/immutable/ImmutableArray/api";
24
- import * as tsplus_module_23 from "@fncts/base/data/Exit/constructors";
25
- export const async = async_1;
26
- export const zipRight = zipRight_1;
11
+ import * as tsplus_module_10 from "@fncts/base/data/Exit/constructors";
12
+ import * as tsplus_module_11 from "@fncts/base/collection/immutable/Conc/api";
13
+ import * as tsplus_module_12 from "@fncts/base/collection/Iterable/api";
14
+ import * as tsplus_module_13 from "@fncts/base/collection/immutable/Conc/constructors";
15
+ import * as tsplus_module_14 from "@fncts/base/data/Maybe/definition";
16
+ import * as tsplus_module_15 from "@fncts/base/control/Eval/run";
17
+ import * as tsplus_module_16 from "@fncts/base/data/Exit/api";
18
+ import * as tsplus_module_17 from "@fncts/base/data/Maybe/destructors";
19
+ import * as tsplus_module_18 from "@fncts/base/data/exceptions";
20
+ import * as tsplus_module_19 from "@fncts/base/data/Trace/constructors";
21
+ import * as tsplus_module_20 from "@fncts/base/collection/immutable/Conc/api/empty";
22
+ import * as tsplus_module_21 from "@fncts/base/collection/immutable/List/api";
23
+ import * as tsplus_module_22 from "@fncts/base/collection/immutable/ReadonlyArray/constructors";
27
24
  export const as = as_1;
28
25
  export const asJust = asJust_1;
29
26
  export const asUnit = asUnit_1;
30
- export const catchTagWith = catchTagWith_1;
27
+ export const async = async_1;
31
28
  export const catchAll = catchAll_1;
32
29
  export const catchAllCause = catchAllCause_1;
33
- export const flatMap = flatMap_1;
30
+ export const catchTagWith = catchTagWith_1;
34
31
  export const collectIO = collectIO_1;
35
32
  export const defer = defer_1;
36
33
  export const either = either_1;
37
34
  export const eventually = eventually_1;
38
35
  export const fail = fail_1;
39
- export const failNow = failNow_1;
40
- export const refailCause = refailCause_1;
41
- export const failCauseNow = failCauseNow_1;
42
36
  export const failCause = failCause_1;
37
+ export const failCauseNow = failCauseNow_1;
38
+ export const failNow = failNow_1;
43
39
  export const fiberIdWith = fiberIdWith_1;
44
40
  export const filter = filter_1;
45
41
  export const filterMapWithIndex = filterMapWithIndex_1;
46
42
  export const filterOrElse = filterOrElse_1;
43
+ export const flatMap = flatMap_1;
47
44
  export const foldLeft = foldLeft_1;
48
45
  export const foreach = foreach_1;
49
- export const foreachWithIndexDiscard = foreachWithIndexDiscard_1;
50
46
  export const foreachDiscard = foreachDiscard_1;
47
+ export const foreachWithIndexDiscard = foreachWithIndexDiscard_1;
51
48
  export const forever = forever_1;
52
49
  export const fromPromiseCatch = fromPromiseCatch_1;
53
50
  export const getOrFailWith = getOrFailWith_1;
@@ -59,21 +56,21 @@ export const loop = loop_1;
59
56
  export const map = map_1;
60
57
  export const mapError = mapError_1;
61
58
  export const mapErrorCause = mapErrorCause_1;
59
+ export const match = match_1;
62
60
  export const matchCauseIO = matchCauseIO_1;
63
61
  export const matchIO = matchIO_1;
64
- export const match = match_1;
62
+ export const refailCause = refailCause_1;
65
63
  export const orElse = orElse_1;
66
64
  export const orHaltWith = orHaltWith_1;
67
65
  export const refineOrHaltWith = refineOrHaltWith_1;
68
66
  export const rejectIO = rejectIO_1;
69
- export const repeatN_ = repeatN_1;
70
67
  export const repeatUntilIO = repeatUntilIO_1;
71
68
  export const repeatWhileIO = repeatWhileIO_1;
72
69
  export const retryUntilIO = retryUntilIO_1;
73
70
  export const retryWhileIO = retryWhileIO_1;
74
71
  export const sandbox = sandbox_1;
75
- export const succeedNow = succeedNow_1;
76
72
  export const succeed = succeed_1;
73
+ export const succeedNow = succeedNow_1;
77
74
  export const summarized = summarized_1;
78
75
  export const swap = swap_1;
79
76
  export const swapWith = swapWith_1;
@@ -81,27 +78,17 @@ export const tryCatch = tryCatch_1;
81
78
  export const tryOrElse = tryOrElse_1;
82
79
  export const unrefineWith = unrefineWith_1;
83
80
  export const unsandbox = unsandbox_1;
81
+ export const stackTrace = stackTrace_1;
84
82
  export const whenIO = whenIO_1;
83
+ export const whileLoop = whileLoop_1;
85
84
  export const withFiberRuntime = withFiberRuntime_1;
86
- export const stackTrace = stackTrace_1;
85
+ export const zipRight = zipRight_1;
87
86
  export const zipWith = zipWith_1;
88
87
  export const gen = gen_1;
89
88
  import { IOError } from "@fncts/base/data/exceptions";
90
89
  import { identity, pipe, tuple } from "@fncts/base/data/function";
91
90
  import { showWithOptions } from "@fncts/base/data/Showable";
92
91
  import { IOPrimitive } from "@fncts/io/IO/definition";
93
- /**
94
- * Imports an asynchronous side-effect into a `IO`
95
- *
96
- * @tsplus static fncts.io.IOOps async
97
- */
98
- function async_1(register, blockingOn = tsplus_module_1.none, __tsplusTrace) {
99
- const io = new IOPrimitive(3 /* IOTag.Async */);
100
- io.i0 = register;
101
- io.i1 = () => blockingOn;
102
- io.trace = __tsplusTrace;
103
- return io;
104
- }
105
92
  /**
106
93
  * Attempts to convert defects into a failure, throwing away all information
107
94
  * about the cause of the failure.
@@ -109,27 +96,7 @@ function async_1(register, blockingOn = tsplus_module_1.none, __tsplusTrace) {
109
96
  * @tsplus pipeable fncts.io.IO absorbWith
110
97
  */
111
98
  export function absorbWith(f, __tsplusTrace) {
112
- return ma => matchIO_1(cause => failNow_1(tsplus_module_2.squashWith(f)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(sandbox_1(ma, __tsplusTrace));
113
- }
114
- /**
115
- * @tsplus pipeable fncts.io.IO zipLeft
116
- * @tsplus pipeable-operator fncts.io.IO <
117
- */
118
- export function zipLeft(fb, __tsplusTrace) {
119
- return self => {
120
- return flatMap_1(a => map_1(() => a, __tsplusTrace)(fb), __tsplusTrace)(self);
121
- };
122
- }
123
- /**
124
- * Combine two effectful actions, keeping only the result of the second
125
- *
126
- * @tsplus pipeable fncts.io.IO zipRight
127
- * @tsplus pipeable-operator fncts.io.IO >
128
- */
129
- function zipRight_1(fb, __tsplusTrace) {
130
- return self => {
131
- return flatMap_1(() => fb, __tsplusTrace)(self);
132
- };
99
+ return ma => matchIO_1(cause => failNow_1(tsplus_module_1.squashWith(f)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(sandbox_1(ma, __tsplusTrace));
133
100
  }
134
101
  /**
135
102
  * @tsplus pipeable fncts.io.IO as
@@ -144,16 +111,16 @@ function as_1(b, __tsplusTrace) {
144
111
  *
145
112
  * @tsplus getter fncts.io.IO asJust
146
113
  */
147
- function asJust_1(ma, __tsplusTrace) {
148
- return map_1(tsplus_module_3.just, __tsplusTrace)(ma);
114
+ function asJust_1(self, __tsplusTrace) {
115
+ return map_1(tsplus_module_2.just, __tsplusTrace)(self);
149
116
  }
150
117
  /**
151
118
  * Maps the error value of this IO to an optional value.
152
119
  *
153
120
  * @tsplus getter fncts.io.IO asJustError
154
121
  */
155
- export function asJustError(ma, __tsplusTrace) {
156
- return mapError_1(tsplus_module_3.just, __tsplusTrace)(ma);
122
+ export function asJustError(self, __tsplusTrace) {
123
+ return mapError_1(tsplus_module_2.just, __tsplusTrace)(self);
157
124
  }
158
125
  /**
159
126
  * @tsplus getter fncts.io.IO asUnit
@@ -161,15 +128,27 @@ export function asJustError(ma, __tsplusTrace) {
161
128
  function asUnit_1(self, __tsplusTrace) {
162
129
  return as_1(() => undefined, __tsplusTrace)(self);
163
130
  }
131
+ /**
132
+ * Imports an asynchronous side-effect into a `IO`
133
+ *
134
+ * @tsplus static fncts.io.IOOps async
135
+ */
136
+ function async_1(register, blockingOn = tsplus_module_3.none, __tsplusTrace) {
137
+ const io = new IOPrimitive(3 /* IOTag.Async */);
138
+ io.i0 = register;
139
+ io.i1 = () => blockingOn;
140
+ io.trace = __tsplusTrace;
141
+ return io;
142
+ }
164
143
  /**
165
144
  * Returns an IO whose failure and success channels have been mapped by
166
145
  * the specified pair of functions, `f` and `g`.
167
146
  *
168
147
  * @tsplus pipeable fncts.io.IO bimap
169
148
  */
170
- export function bimap(f, g, __tsplusTrace) {
149
+ export function bimap(onFailure, onSuccess, __tsplusTrace) {
171
150
  return self => {
172
- return matchIO_1(e => failNow_1(f(e), __tsplusTrace), a => succeedNow_1(g(a), __tsplusTrace), __tsplusTrace)(self);
151
+ return matchIO_1(e => failNow_1(onFailure(e), __tsplusTrace), a => succeedNow_1(onSuccess(a), __tsplusTrace), __tsplusTrace)(self);
173
152
  };
174
153
  }
175
154
  /**
@@ -180,22 +159,7 @@ export function bimap(f, g, __tsplusTrace) {
180
159
  */
181
160
  export function bitap(onFailure, onSuccess, __tsplusTrace) {
182
161
  return self => {
183
- return matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(onFailure(e)), () => failCauseNow_1(cause, __tsplusTrace))(tsplus_module_2.failureOrCause(cause)), a => zipRight_1(succeedNow_1(a, __tsplusTrace), __tsplusTrace)(onSuccess(a)), __tsplusTrace)(self);
184
- };
185
- }
186
- /**
187
- * Recovers from the specified error
188
- *
189
- * @tsplus pipeable fncts.io.IO catch
190
- */
191
- function catchTagWith_1(tag, k, f, __tsplusTrace) {
192
- return ma => {
193
- return catchAll_1(e => {
194
- if (tsplus_module_5.isObject(e) && tag in e && e[tag] === k) {
195
- return f(e);
196
- }
197
- return failNow_1(e, __tsplusTrace);
198
- }, __tsplusTrace)(ma);
162
+ return matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(onFailure(e)), () => failCauseNow_1(cause, __tsplusTrace))(tsplus_module_1.failureOrCause(cause)), a => zipRight_1(succeedNow_1(a, __tsplusTrace), __tsplusTrace)(onSuccess(a)), __tsplusTrace)(self);
199
163
  };
200
164
  }
201
165
  /**
@@ -203,9 +167,9 @@ function catchTagWith_1(tag, k, f, __tsplusTrace) {
203
167
  *
204
168
  * @tsplus pipeable fncts.io.IO catchAll
205
169
  */
206
- function catchAll_1(f, __tsplusTrace) {
207
- return ma => {
208
- return matchIO_1(f, succeedNow_1, __tsplusTrace)(ma);
170
+ function catchAll_1(onFailure, __tsplusTrace) {
171
+ return self => {
172
+ return matchIO_1(onFailure, succeedNow_1, __tsplusTrace)(self);
209
173
  };
210
174
  }
211
175
  /**
@@ -214,17 +178,17 @@ function catchAll_1(f, __tsplusTrace) {
214
178
  *
215
179
  * @tsplus pipeable fncts.io.IO catchAllCause
216
180
  */
217
- function catchAllCause_1(f, __tsplusTrace) {
218
- return ma => matchCauseIO_1(f, succeedNow_1, __tsplusTrace)(ma);
181
+ function catchAllCause_1(onFailure, __tsplusTrace) {
182
+ return self => matchCauseIO_1(onFailure, succeedNow_1, __tsplusTrace)(self);
219
183
  }
220
184
  /**
221
185
  * Recovers from some or all of the error cases.
222
186
  *
223
187
  * @tsplus pipeable fncts.io.IO catchJust
224
188
  */
225
- export function catchJust(f, __tsplusTrace) {
226
- return ma => {
227
- return matchCauseIO_1(cause => tsplus_module_4.match(e => tsplus_module_6.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(f(e)), failCauseNow_1)(tsplus_module_2.failureOrCause(cause)), succeedNow_1, __tsplusTrace)(ma);
189
+ export function catchJust(onFailure, __tsplusTrace) {
190
+ return self => {
191
+ return matchCauseIO_1(cause => tsplus_module_4.match(e => tsplus_module_5.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(onFailure(e)), failCauseNow_1)(tsplus_module_1.failureOrCause(cause)), succeedNow_1, __tsplusTrace)(self);
228
192
  };
229
193
  }
230
194
  /**
@@ -232,9 +196,9 @@ export function catchJust(f, __tsplusTrace) {
232
196
  *
233
197
  * @tsplus pipeable fncts.io.IO catchJustCause
234
198
  */
235
- export function catchJustCause(f, __tsplusTrace) {
236
- return ma => {
237
- return matchCauseIO_1(cause => tsplus_module_6.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(f(cause)), succeedNow_1, __tsplusTrace)(ma);
199
+ export function catchJustCause(onFailure, __tsplusTrace) {
200
+ return self => {
201
+ return matchCauseIO_1(cause => tsplus_module_5.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(onFailure(cause)), succeedNow_1, __tsplusTrace)(self);
238
202
  };
239
203
  }
240
204
  /**
@@ -247,9 +211,9 @@ export function catchJustCause(f, __tsplusTrace) {
247
211
  *
248
212
  * @tsplus pipeable fncts.io.IO catchJustDefect
249
213
  */
250
- export function catchJustDefect(f, __tsplusTrace) {
251
- return ma => {
252
- return catchAll_1(a => a, __tsplusTrace)(unrefineWith_1(f, failNow_1, __tsplusTrace)(ma));
214
+ export function catchJustDefect(onFailure, __tsplusTrace) {
215
+ return self => {
216
+ return catchAll_1(a => a, __tsplusTrace)(unrefineWith_1(onFailure, failNow_1, __tsplusTrace)(self));
253
217
  };
254
218
  }
255
219
  /**
@@ -257,23 +221,38 @@ export function catchJustDefect(f, __tsplusTrace) {
257
221
  *
258
222
  * @tsplus pipeable IO catchTag
259
223
  */
260
- export function catchTag(k, f, __tsplusTrace) {
261
- return ma => {
262
- return catchTagWith_1("_tag", k, f, __tsplusTrace)(ma);
224
+ export function catchTag(tag, onFailure, __tsplusTrace) {
225
+ return self => {
226
+ return catchTagWith_1("_tag", tag, onFailure, __tsplusTrace)(self);
227
+ };
228
+ }
229
+ /**
230
+ * Recovers from the specified error
231
+ *
232
+ * @tsplus pipeable fncts.io.IO catch
233
+ */
234
+ function catchTagWith_1(tagKey, tag, onFailure, __tsplusTrace) {
235
+ return self => {
236
+ return catchAll_1(e => {
237
+ if (tsplus_module_6.isObject(e) && tagKey in e && e[tagKey] === tag) {
238
+ return onFailure(e);
239
+ }
240
+ return failNow_1(e, __tsplusTrace);
241
+ }, __tsplusTrace)(self);
263
242
  };
264
243
  }
265
244
  /**
266
245
  * @tsplus getter fncts.io.IO cause
267
246
  */
268
- export function cause(ma, __tsplusTrace) {
269
- return matchCauseIO_1(succeedNow_1, () => succeedNow_1(tsplus_module_2.empty(), __tsplusTrace), __tsplusTrace)(ma);
247
+ export function cause(self, __tsplusTrace) {
248
+ return matchCauseIO_1(succeedNow_1, () => succeedNow_1(tsplus_module_1.empty(), __tsplusTrace), __tsplusTrace)(self);
270
249
  }
271
250
  /**
272
251
  * @tsplus pipeable fncts.io.IO causeAsError
273
252
  */
274
253
  export function causeAsError(__tsplusTrace) {
275
- return ma => {
276
- return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(ma);
254
+ return self => {
255
+ return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(self);
277
256
  };
278
257
  }
279
258
  /**
@@ -285,46 +264,28 @@ export function causeAsError(__tsplusTrace) {
285
264
  export function checkInterruptible(f, __tsplusTrace) {
286
265
  return withFiberRuntime_1((_, status) => f(tsplus_module_8.fromBoolean(tsplus_module_7.interruption(status.runtimeFlags))), __tsplusTrace);
287
266
  }
288
- /**
289
- * Returns an IO that models the execution of this effect, followed by
290
- * the passing of its value to the specified continuation function `f`,
291
- * followed by the effect that it returns.
292
- *
293
- * @tsplus pipeable fncts.io.IO flatMap
294
- */
295
- function flatMap_1(f, __tsplusTrace) {
296
- return ma => {
297
- const io = new IOPrimitive(5 /* IOTag.OnSuccess */);
298
- io.i0 = ma;
299
- io.i1 = f;
300
- io.trace = __tsplusTrace;
301
- return io;
302
- };
303
- }
304
- /**
305
- * @tsplus pipeable fncts.io.IO flatMapError
306
- */
307
- export function flatMapError(f, __tsplusTrace) {
308
- return ma => {
309
- return swapWith_1(effect => flatMap_1(f, __tsplusTrace)(effect), __tsplusTrace)(ma);
310
- };
311
- }
312
267
  /**
313
268
  * @tsplus pipeable fncts.io.IO collect
314
269
  */
315
270
  export function collect(f, pf, __tsplusTrace) {
316
- return ma => {
317
- return collectIO_1(f, a => tsplus_module_6.map(succeedNow_1)(pf(a)), __tsplusTrace)(ma);
271
+ return self => {
272
+ return collectIO_1(f, a => tsplus_module_5.map(succeedNow_1)(pf(a)), __tsplusTrace)(self);
318
273
  };
319
274
  }
320
275
  /**
321
276
  * @tsplus pipeable fncts.io.IO collectIO
322
277
  */
323
- function collectIO_1(f, pf, __tsplusTrace) {
324
- return ma => {
325
- return flatMap_1(a => tsplus_module_6.getOrElse(() => fail_1(f, __tsplusTrace))(pf(a)), __tsplusTrace)(ma);
278
+ function collectIO_1(onNothing, pf, __tsplusTrace) {
279
+ return self => {
280
+ return flatMap_1(a => tsplus_module_5.getOrElse(() => fail_1(onNothing, __tsplusTrace))(pf(a)), __tsplusTrace)(self);
326
281
  };
327
282
  }
283
+ /**
284
+ * @tsplus static fncts.io.IOOps if
285
+ */
286
+ export function cond(b, onTrue, onFalse, __tsplusTrace) {
287
+ return ifIO_1(onTrue, onFalse, __tsplusTrace)(succeedNow_1(b, __tsplusTrace));
288
+ }
328
289
  /**
329
290
  * @tsplus static fncts.io.IOOps condIO
330
291
  */
@@ -340,7 +301,11 @@ export function condIO(b, onTrue, onFalse, __tsplusTrace) {
340
301
  * @tsplus static fncts.io.IOOps defer
341
302
  */
342
303
  function defer_1(io, __tsplusTrace) {
343
- return flatMap_1(identity, __tsplusTrace)(succeed_1(io, __tsplusTrace));
304
+ const out = new IOPrimitive(5 /* IOTag.OnSuccess */);
305
+ out.i0 = unit_1;
306
+ out.i1 = io;
307
+ out.trace = __tsplusTrace;
308
+ return out;
344
309
  }
345
310
  /**
346
311
  * Returns a lazily constructed effect, whose construction may itself require effects.
@@ -353,7 +318,7 @@ export function deferTry(io, __tsplusTrace) {
353
318
  try {
354
319
  return io();
355
320
  } catch (u) {
356
- throw new IOError(tsplus_module_2.fail(u));
321
+ throw new IOError(tsplus_module_1.fail(u));
357
322
  }
358
323
  }, __tsplusTrace);
359
324
  }
@@ -370,7 +335,7 @@ export function deferTryCatch(io, onThrow, __tsplusTrace) {
370
335
  try {
371
336
  return io();
372
337
  } catch (u) {
373
- throw new IOError(tsplus_module_2.fail(onThrow(u)));
338
+ throw new IOError(tsplus_module_1.fail(onThrow(u)));
374
339
  }
375
340
  }, __tsplusTrace);
376
341
  }
@@ -379,51 +344,52 @@ export function deferTryCatch(io, onThrow, __tsplusTrace) {
379
344
  *
380
345
  * @tsplus getter fncts.io.IO either
381
346
  */
382
- function either_1(ma, __tsplusTrace) {
383
- return match_1(tsplus_module_9.left, tsplus_module_9.right, __tsplusTrace)(ma);
347
+ function either_1(self, __tsplusTrace) {
348
+ return match_1(tsplus_module_9.left, tsplus_module_9.right, __tsplusTrace)(self);
384
349
  }
385
350
  /**
386
351
  * @tsplus pipeable fncts.io.IO errorAsCause
387
352
  */
388
353
  export function errorAsCause(__tsplusTrace) {
389
- return ma => {
390
- return matchIO_1(failCauseNow_1, succeedNow_1, __tsplusTrace)(ma);
354
+ return self => {
355
+ return matchIO_1(failCauseNow_1, succeedNow_1, __tsplusTrace)(self);
391
356
  };
392
357
  }
393
358
  /**
394
359
  * @tsplus getter fncts.io.IO eventually
395
360
  */
396
- function eventually_1(ma, __tsplusTrace) {
397
- return orElse_1(() => eventually_1(ma, __tsplusTrace), __tsplusTrace)(ma);
361
+ function eventually_1(self, __tsplusTrace) {
362
+ return orElse_1(() => eventually_1(self, __tsplusTrace), __tsplusTrace)(self);
363
+ }
364
+ /**
365
+ * @tsplus pipeable fncts.io.IO exitWith
366
+ */
367
+ export function exitWith(f, __tsplusTrace) {
368
+ return self => {
369
+ return matchCauseIO_1(cause => f(tsplus_module_10.failCause(cause, __tsplusTrace)), a => f(tsplus_module_10.succeed(a, __tsplusTrace)), __tsplusTrace)(self);
370
+ };
398
371
  }
399
372
  /**
400
373
  * @tsplus pipeable fncts.io.IO extend
401
374
  */
402
375
  export function extend(f, __tsplusTrace) {
403
- return wa => {
404
- return matchIO_1(failNow_1, _ => succeed_1(() => f(wa), __tsplusTrace), __tsplusTrace)(wa);
376
+ return self => {
377
+ return matchIO_1(failNow_1, _ => succeed_1(() => f(self), __tsplusTrace), __tsplusTrace)(self);
405
378
  };
406
379
  }
407
380
  /**
408
381
  * @tsplus static fncts.io.IOOps fail
409
382
  */
410
383
  function fail_1(e, __tsplusTrace) {
411
- return failCause_1(() => tsplus_module_2.fail(e()), __tsplusTrace);
412
- }
413
- /**
414
- * @tsplus static fncts.io.IOOps failNow
415
- */
416
- function failNow_1(e, __tsplusTrace) {
417
- return failCause_1(() => tsplus_module_2.fail(e), __tsplusTrace);
384
+ return failCause_1(() => tsplus_module_1.fail(e()), __tsplusTrace);
418
385
  }
419
386
  /**
420
- * @tsplus static fncts.io.IOOps refailCause
387
+ * Returns an effect that models failure with the specified lazily-evaluated `Cause`.
388
+ *
389
+ * @tsplus static fncts.io.IOOps failCause
421
390
  */
422
- function refailCause_1(cause, __tsplusTrace) {
423
- const io = new IOPrimitive(1 /* IOTag.Fail */);
424
- io.i0 = () => cause;
425
- io.trace = __tsplusTrace;
426
- return io;
391
+ function failCause_1(cause, __tsplusTrace) {
392
+ return flatMap_1(trace => refailCause_1(() => tsplus_module_1.traced(cause(), trace), __tsplusTrace), __tsplusTrace)(stackTrace_1(__tsplusTrace));
427
393
  }
428
394
  /**
429
395
  * Creates a `IO` that has failed with the specified `Cause`
@@ -437,24 +403,22 @@ function failCauseNow_1(cause, __tsplusTrace) {
437
403
  return io;
438
404
  }
439
405
  /**
440
- * Returns an effect that models failure with the specified lazily-evaluated `Cause`.
441
- *
442
- * @tsplus static fncts.io.IOOps failCause
406
+ * @tsplus static fncts.io.IOOps failNow
443
407
  */
444
- function failCause_1(cause, __tsplusTrace) {
445
- return flatMap_1(trace => refailCause_1(tsplus_module_2.traced(cause(), trace), __tsplusTrace), __tsplusTrace)(stackTrace_1(__tsplusTrace));
408
+ function failNow_1(e, __tsplusTrace) {
409
+ return failCause_1(() => tsplus_module_1.fail(e), __tsplusTrace);
446
410
  }
447
411
  /**
448
412
  * Returns the `FiberId` of the `Fiber` on which this `IO` is running
449
413
  *
450
414
  * @tsplus static fncts.io.IOOps fiberId
451
415
  */
452
- export const fiberId = /*#__PURE__*/fiberIdWith_1(id => succeedNow_1(id, fileName_1 + ":503:87"));
416
+ export const fiberId = /*#__PURE__*/fiberIdWith_1(id => succeedNow_1(id, fileName_1 + ":435:87"));
453
417
  /**
454
418
  * @tsplus static fncts.io.IOOps fiberIdWith
455
419
  */
456
420
  function fiberIdWith_1(f) {
457
- return withFiberRuntime_1(fiber => f(fiber.id), fileName_1 + ":509:29");
421
+ return withFiberRuntime_1(fiber => f(fiber.id), fileName_1 + ":441:29");
458
422
  }
459
423
  /**
460
424
  * Filters the collection using the specified effectual predicate.
@@ -462,7 +426,7 @@ function fiberIdWith_1(f) {
462
426
  * @tsplus static fncts.io.IOOps filter
463
427
  */
464
428
  function filter_1(as, f, __tsplusTrace) {
465
- return map_1(b => b.result(), __tsplusTrace)(tsplus_module_11.foldLeft(succeedNow_1(tsplus_module_10.builder(), __tsplusTrace), (eff, a) => zipWith_1(f(a), (builder, p) => {
429
+ return map_1(b => b.result(), __tsplusTrace)(tsplus_module_12.foldLeft(succeedNow_1(tsplus_module_11.builder(), __tsplusTrace), (eff, a) => zipWith_1(f(a), (builder, p) => {
466
430
  if (p) {
467
431
  builder.append(a);
468
432
  }
@@ -481,8 +445,8 @@ export function filterMap(as, f, __tsplusTrace) {
481
445
  function filterMapWithIndex_1(as, f, __tsplusTrace) {
482
446
  return defer_1(() => {
483
447
  const bs = [];
484
- return as_1(() => tsplus_module_12.from(bs), __tsplusTrace)(foreachWithIndexDiscard_1(as, (i, a) => map_1(b => {
485
- if (tsplus_module_13.isJust(b)) {
448
+ return as_1(() => tsplus_module_13.from(bs), __tsplusTrace)(foreachWithIndexDiscard_1(as, (i, a) => map_1(b => {
449
+ if (tsplus_module_14.isJust(b)) {
486
450
  bs.push(b.value);
487
451
  }
488
452
  }, __tsplusTrace)(f(i, a)), __tsplusTrace));
@@ -507,18 +471,42 @@ export function filterOrFail(predicate, failWith, __tsplusTrace) {
507
471
  return filterOrElse_1(predicate, a => failNow_1(failWith(a), __tsplusTrace), __tsplusTrace)(fa);
508
472
  };
509
473
  }
474
+ export function filterOrHalt(predicate, haltWith, __tsplusTrace) {
475
+ return fa => {
476
+ return filterOrElse_1(predicate, a => haltNow_1(haltWith(a), __tsplusTrace), __tsplusTrace)(fa);
477
+ };
478
+ }
510
479
  /**
511
480
  * Returns an `IO` that yields the value of the first
512
481
  * `IO` to succeed.
513
482
  *
514
483
  * @tsplus static fncts.io.IOOps firstSuccess
515
484
  */
516
- export function firstSuccess(mas, __tsplusTrace) {
517
- return mas.reduce((b, a) => orElse_1(() => a, __tsplusTrace)(b));
485
+ export function firstSuccess(ios, __tsplusTrace) {
486
+ return ios.reduce((b, a) => orElse_1(() => a, __tsplusTrace)(b));
518
487
  }
519
- export function filterOrHalt(predicate, haltWith, __tsplusTrace) {
520
- return fa => {
521
- return filterOrElse_1(predicate, a => haltNow_1(haltWith(a), __tsplusTrace), __tsplusTrace)(fa);
488
+ /**
489
+ * Returns an IO that models the execution of this effect, followed by
490
+ * the passing of its value to the specified continuation function `f`,
491
+ * followed by the effect that it returns.
492
+ *
493
+ * @tsplus pipeable fncts.io.IO flatMap
494
+ */
495
+ function flatMap_1(f, __tsplusTrace) {
496
+ return self => {
497
+ const io = new IOPrimitive(5 /* IOTag.OnSuccess */);
498
+ io.i0 = self;
499
+ io.i1 = f;
500
+ io.trace = __tsplusTrace;
501
+ return io;
502
+ };
503
+ }
504
+ /**
505
+ * @tsplus pipeable fncts.io.IO flatMapError
506
+ */
507
+ export function flatMapError(f, __tsplusTrace) {
508
+ return self => {
509
+ return swapWith_1(effect => flatMap_1(f, __tsplusTrace)(effect), __tsplusTrace)(self);
522
510
  };
523
511
  }
524
512
  /**
@@ -531,33 +519,32 @@ export function flatten(self, __tsplusTrace) {
531
519
  * Folds an `Iterable<A>` using an effectful function f, working sequentially from left to right.
532
520
  *
533
521
  * @tsplus static fncts.io.IOOps foldLeft
522
+ * @tsplus fluent fncts.Iterable foldLeftIO
534
523
  */
535
524
  function foldLeft_1(as, b, f, __tsplusTrace) {
536
- return tsplus_module_11.foldLeft(succeedNow_1(b, __tsplusTrace), (acc, el) => flatMap_1(a => f(a, el), __tsplusTrace)(acc))(as);
525
+ return tsplus_module_12.foldLeft(succeedNow_1(b, __tsplusTrace), (acc, el) => flatMap_1(a => f(a, el), __tsplusTrace)(acc))(as);
537
526
  }
538
527
  /**
539
528
  * Combines an array of `IO`s using a `Monoid`
540
529
  *
541
530
  * @tsplus static fncts.io.IOOps foldMap
531
+ * @tsplus fluent fncts.Iterable foldMapIO
542
532
  */
543
- export function foldMap(as, f, /** @tsplus auto */M) {
544
- return foldLeft_1(as, M.nat, (m, a) => map_1(a => M.combine(f(a))(m), fileName_1 + ":683:48")(a), fileName_1 + ":683:21");
545
- }
546
- function foldRightLoop(iterator, b, f, __tsplusTrace) {
547
- const next = iterator.next();
548
- return next.done ? b : f(next.value, foldRightLoop(iterator, b, f, __tsplusTrace));
533
+ export function foldMap(ios, f, /** @tsplus auto */M) {
534
+ return foldLeft_1(ios, M.nat, (m, a) => map_1(a => M.combine(f(a))(m), fileName_1 + ":645:49")(a), fileName_1 + ":645:21");
549
535
  }
550
536
  /**
551
537
  * Performs a right-associative fold of an `Iterable<A>`
552
538
  *
553
539
  * @tsplus static fncts.io.IOOps foldRight
540
+ * @tsplus fluent fncts.Iterable foldRightIO
554
541
  */
555
542
  export function foldRight(as, b, f, __tsplusTrace) {
556
543
  return foldRightLoop(as[Symbol.iterator](), b, f, __tsplusTrace);
557
544
  }
558
- function foreachWithIndexDiscardLoop(iterator, f, i = 0, __tsplusTrace) {
545
+ function foldRightLoop(iterator, b, f, __tsplusTrace) {
559
546
  const next = iterator.next();
560
- return next.done ? unit_1 : flatMap_1(() => foreachWithIndexDiscardLoop(iterator, f, i + 1, __tsplusTrace), __tsplusTrace)(f(i, next.value));
547
+ return next.done ? b : f(next.value, foldRightLoop(iterator, b, f, __tsplusTrace));
561
548
  }
562
549
  /**
563
550
  * Applies the function `f` to each element of the `Iterable<A>` and
@@ -567,16 +554,27 @@ function foreachWithIndexDiscardLoop(iterator, f, i = 0, __tsplusTrace) {
567
554
  * If you do not need the results, see `foreachUnit` for a more efficient implementation.
568
555
  *
569
556
  * @tsplus static fncts.io.IOOps foreach
557
+ * @tsplus fluent fncts.Iterable foreachIO
570
558
  */
571
559
  function foreach_1(as, f, __tsplusTrace) {
572
560
  return defer_1(() => {
573
561
  const acc = [];
574
- return as_1(() => tsplus_module_12.from(acc), __tsplusTrace)(foreachWithIndexDiscard_1(as, (_, a) => flatMap_1(b => {
562
+ return as_1(() => tsplus_module_13.from(acc), __tsplusTrace)(foreachWithIndexDiscard_1(as, (_, a) => flatMap_1(b => {
575
563
  acc.push(b);
576
564
  return unit_1;
577
565
  }, __tsplusTrace)(f(a)), __tsplusTrace));
578
566
  }, __tsplusTrace);
579
567
  }
568
+ /**
569
+ * Applies the function `f` to each element of the `Iterable<A>` and runs
570
+ * produced IOs sequentially.
571
+ *
572
+ * @tsplus static fncts.io.IOOps foreachDiscard
573
+ * @tsplus fluent fncts.Iterable foreachDiscardIO
574
+ */
575
+ function foreachDiscard_1(as, f, __tsplusTrace) {
576
+ return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)), __tsplusTrace);
577
+ }
580
578
  /**
581
579
  * Applies the function `f` to each element of the `Iterable<A>` and
582
580
  * returns the results in a new `Conc<B>`.
@@ -585,11 +583,12 @@ function foreach_1(as, f, __tsplusTrace) {
585
583
  * If you do not need the results, see `foreachUnit` for a more efficient implementation.
586
584
  *
587
585
  * @tsplus static fncts.io.IOOps foreachWithIndex
586
+ * @tsplus fluent fncts.Iterable foreachWithIndexIO
588
587
  */
589
588
  export function foreachWithIndex(as, f, __tsplusTrace) {
590
589
  return defer_1(() => {
591
590
  const acc = [];
592
- return as_1(() => tsplus_module_12.from(acc), __tsplusTrace)(foreachWithIndexDiscard_1(as, (i, a) => flatMap_1(b => {
591
+ return as_1(() => tsplus_module_13.from(acc), __tsplusTrace)(foreachWithIndexDiscard_1(as, (i, a) => flatMap_1(b => {
593
592
  acc.push(b);
594
593
  return unit_1;
595
594
  }, __tsplusTrace)(f(i, a)), __tsplusTrace));
@@ -597,18 +596,14 @@ export function foreachWithIndex(as, f, __tsplusTrace) {
597
596
  }
598
597
  /**
599
598
  * @tsplus static fncts.io.IOOps foreachWithIndexDiscard
599
+ * @tsplus fluent fncts.Iterable foreachWithIndexDiscardIO
600
600
  */
601
601
  function foreachWithIndexDiscard_1(as, f, __tsplusTrace) {
602
602
  return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), f), __tsplusTrace);
603
603
  }
604
- /**
605
- * Applies the function `f` to each element of the `Iterable<A>` and runs
606
- * produced IOs sequentially.
607
- *
608
- * @tsplus static fncts.io.IOOps foreachDiscard
609
- */
610
- function foreachDiscard_1(as, f, __tsplusTrace) {
611
- return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)), __tsplusTrace);
604
+ function foreachWithIndexDiscardLoop(iterator, f, i = 0, __tsplusTrace) {
605
+ const next = iterator.next();
606
+ return next.done ? unit_1 : flatMap_1(() => foreachWithIndexDiscardLoop(iterator, f, i + 1, __tsplusTrace), __tsplusTrace)(f(i, next.value));
612
607
  }
613
608
  /**
614
609
  * Repeats this effect forever (until the first failure).
@@ -642,7 +637,7 @@ export function fromEitherNow(either, __tsplusTrace) {
642
637
  * @tsplus getter fncts.Eval toIO
643
638
  */
644
639
  export function fromEval(computation, __tsplusTrace) {
645
- return succeed_1(() => tsplus_module_14.run(computation), __tsplusTrace);
640
+ return succeed_1(() => tsplus_module_15.run(computation), __tsplusTrace);
646
641
  }
647
642
  /**
648
643
  * Creates a `IO` from an exit value
@@ -650,7 +645,7 @@ export function fromEval(computation, __tsplusTrace) {
650
645
  * @tsplus static fncts.io.IOOps fromExit
651
646
  */
652
647
  export function fromExit(exit, __tsplusTrace) {
653
- return defer_1(() => tsplus_module_15.match(failCauseNow_1, succeedNow_1)(exit()), __tsplusTrace);
648
+ return defer_1(() => tsplus_module_16.match(failCauseNow_1, succeedNow_1)(exit()), __tsplusTrace);
654
649
  }
655
650
  /**
656
651
  * Creates a `IO` from an exit value
@@ -659,7 +654,7 @@ export function fromExit(exit, __tsplusTrace) {
659
654
  * @tsplus getter fncts.Exit toIO
660
655
  */
661
656
  export function fromExitNow(exit, __tsplusTrace) {
662
- return tsplus_module_15.match(failCauseNow_1, succeedNow_1)(exit);
657
+ return tsplus_module_16.match(failCauseNow_1, succeedNow_1)(exit);
663
658
  }
664
659
  /**
665
660
  * Lifts a `Maybe` into an `IO` but preserves the error as a `Maybe` in the error channel, making it easier to compose
@@ -668,14 +663,23 @@ export function fromExitNow(exit, __tsplusTrace) {
668
663
  * @tsplus static fncts.io.IOOps fromMaybe
669
664
  */
670
665
  export function fromMaybe(maybe, __tsplusTrace) {
671
- return flatMap_1(m => tsplus_module_16.match(() => failNow_1(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), succeedNow_1)(m), __tsplusTrace)(succeed_1(maybe, __tsplusTrace));
666
+ return flatMap_1(m => tsplus_module_17.match(() => failNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), succeedNow_1)(m), __tsplusTrace)(succeed_1(maybe, __tsplusTrace));
672
667
  }
673
668
  /**
674
669
  * @tsplus static fncts.io.IOOps fromMaybeNow
675
670
  * @tsplus getter fncts.Maybe toIO
676
671
  */
677
672
  export function fromMaybeNow(maybe, __tsplusTrace) {
678
- return tsplus_module_16.match(() => failNow_1(new tsplus_module_17.NoSuchElementError("IO.fromMaybeNow"), __tsplusTrace), succeedNow_1)(maybe);
673
+ return tsplus_module_17.match(() => failNow_1(new tsplus_module_18.NoSuchElementError("IO.fromMaybeNow"), __tsplusTrace), succeedNow_1)(maybe);
674
+ }
675
+ /**
676
+ * Create an IO that when executed will construct `promise` and wait for its result,
677
+ * errors will produce failure as `unknown`
678
+ *
679
+ * @tsplus static fncts.io.IOOps fromPromise
680
+ */
681
+ export function fromPromise(promise, __tsplusTrace) {
682
+ return fromPromiseCatch_1(promise, identity, __tsplusTrace);
679
683
  }
680
684
  /**
681
685
  * Create an IO that when executed will construct `promise` and wait for its result,
@@ -688,15 +692,6 @@ function fromPromiseCatch_1(promise, onReject, __tsplusTrace) {
688
692
  promise().then(a => k(succeedNow_1(a, __tsplusTrace))).catch(e => k(failNow_1(onReject(e), __tsplusTrace)));
689
693
  });
690
694
  }
691
- /**
692
- * Create an IO that when executed will construct `promise` and wait for its result,
693
- * errors will produce failure as `unknown`
694
- *
695
- * @tsplus static fncts.io.IOOps fromPromise
696
- */
697
- export function fromPromise(promise, __tsplusTrace) {
698
- return fromPromiseCatch_1(promise, identity, __tsplusTrace);
699
- }
700
695
  /**
701
696
  * Like fromPromise but produces a defect in case of errors
702
697
  *
@@ -713,7 +708,13 @@ export function fromPromiseHalt(promise, __tsplusTrace) {
713
708
  * @tsplus getter fncts.io.IO get
714
709
  */
715
710
  export function get(ma, __tsplusTrace) {
716
- return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_2.map(tsplus_module_3.just)(cause), __tsplusTrace), ma => tsplus_module_16.match(() => failNow_1(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), succeedNow_1)(ma), __tsplusTrace)(ma);
711
+ return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_1.map(tsplus_module_2.just)(cause), __tsplusTrace), ma => tsplus_module_17.match(() => failNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), succeedNow_1)(ma), __tsplusTrace)(ma);
712
+ }
713
+ /**
714
+ * @tsplus static fncts.io.IOOps getFiberRefs
715
+ */
716
+ export function getFiberRefs(__tsplusTrace) {
717
+ return withFiberRuntime_1(fiberState => succeed_1(() => fiberState.getFiberRefs(), __tsplusTrace), __tsplusTrace);
717
718
  }
718
719
  /**
719
720
  * Extracts the optional value, or returns the given 'orElse'.
@@ -722,7 +723,7 @@ export function get(ma, __tsplusTrace) {
722
723
  */
723
724
  export function getOrElse(orElse, __tsplusTrace) {
724
725
  return ma => {
725
- return map_1(ma => tsplus_module_6.getOrElse(orElse)(ma), __tsplusTrace)(ma);
726
+ return map_1(ma => tsplus_module_5.getOrElse(orElse)(ma), __tsplusTrace)(ma);
726
727
  };
727
728
  }
728
729
  /**
@@ -732,17 +733,9 @@ export function getOrElse(orElse, __tsplusTrace) {
732
733
  */
733
734
  export function getOrElseIO(orElse, __tsplusTrace) {
734
735
  return ma => {
735
- return flatMap_1(mab => tsplus_module_6.getOrElse(orElse)(tsplus_module_6.map(succeedNow_1)(mab)), __tsplusTrace)(ma);
736
+ return flatMap_1(mab => tsplus_module_5.getOrElse(orElse)(tsplus_module_5.map(succeedNow_1)(mab)), __tsplusTrace)(ma);
736
737
  };
737
738
  }
738
- /**
739
- * Lifts a Maybe into an IO. If the option is `Nothing`, fail with `onNothing`.
740
- *
741
- * @tsplus static fncts.io.IOOps getOrFailWith
742
- */
743
- function getOrFailWith_1(maybe, onNothing, __tsplusTrace) {
744
- return defer_1(() => tsplus_module_16.match(() => fail_1(onNothing, __tsplusTrace), succeedNow_1)(maybe), __tsplusTrace);
745
- }
746
739
  /**
747
740
  * Lifts a Maybe into a IO, if the Maybe is `Nothing` it fails with Unit.
748
741
  *
@@ -752,10 +745,12 @@ export function getOrFailUnit(option, __tsplusTrace) {
752
745
  return getOrFailWith_1(option, () => undefined, __tsplusTrace);
753
746
  }
754
747
  /**
755
- * @tsplus static fncts.io.IOOps getFiberRefs
748
+ * Lifts a Maybe into an IO. If the option is `Nothing`, fail with `onNothing`.
749
+ *
750
+ * @tsplus static fncts.io.IOOps getOrFailWith
756
751
  */
757
- export function getFiberRefs(__tsplusTrace) {
758
- return withFiberRuntime_1(fiberState => succeed_1(() => fiberState.getFiberRefs(), __tsplusTrace), __tsplusTrace);
752
+ function getOrFailWith_1(maybe, onNothing, __tsplusTrace) {
753
+ return defer_1(() => tsplus_module_17.match(() => fail_1(onNothing, __tsplusTrace), succeedNow_1)(maybe), __tsplusTrace);
759
754
  }
760
755
  /**
761
756
  * Creates an `IO` that halts with the specified lazily-evaluated defect.
@@ -765,7 +760,7 @@ export function getFiberRefs(__tsplusTrace) {
765
760
  * @tsplus static fncts.io.IOOps halt
766
761
  */
767
762
  export function halt(e, __tsplusTrace) {
768
- return failCause_1(() => tsplus_module_2.halt(e(), tsplus_module_18.none), __tsplusTrace);
763
+ return failCause_1(() => tsplus_module_1.halt(e(), tsplus_module_19.none), __tsplusTrace);
769
764
  }
770
765
  /**
771
766
  * Creates an `IO` that halts with the specified defect
@@ -775,7 +770,7 @@ export function halt(e, __tsplusTrace) {
775
770
  * @tsplus static fncts.io.IOOps haltNow
776
771
  */
777
772
  function haltNow_1(e, __tsplusTrace) {
778
- return failCauseNow_1(tsplus_module_2.halt(e, tsplus_module_18.none), __tsplusTrace);
773
+ return failCauseNow_1(tsplus_module_1.halt(e, tsplus_module_19.none), __tsplusTrace);
779
774
  }
780
775
  /**
781
776
  * @tsplus pipeable fncts.io.IO ifIO
@@ -786,32 +781,26 @@ function ifIO_1(onFalse, onTrue, __tsplusTrace) {
786
781
  };
787
782
  }
788
783
  /**
789
- * @tsplus static fncts.io.IOOps if
784
+ * @tsplus getter fncts.io.IO ignore
790
785
  */
791
- export function cond(b, onTrue, onFalse, __tsplusTrace) {
792
- return ifIO_1(onTrue, onFalse, __tsplusTrace)(succeedNow_1(b, __tsplusTrace));
793
- }
794
- /**
795
- * @tsplus getter fncts.io.IO ignore
796
- */
797
- export function ignore(fa, __tsplusTrace) {
798
- return match_1(() => undefined, () => undefined, __tsplusTrace)(fa);
786
+ export function ignore(self, __tsplusTrace) {
787
+ return match_1(() => undefined, () => undefined, __tsplusTrace)(self);
799
788
  }
800
789
  /**
801
790
  * Folds a `IO` to a boolean describing whether or not it is a failure
802
791
  *
803
792
  * @tsplus getter fncts.io.IO isFailure
804
793
  */
805
- export function isFailure(ma, __tsplusTrace) {
806
- return match_1(() => true, () => false, __tsplusTrace)(ma);
794
+ export function isFailure(self, __tsplusTrace) {
795
+ return match_1(() => true, () => false, __tsplusTrace)(self);
807
796
  }
808
797
  /**
809
798
  * Folds a `IO` to a boolean describing whether or not it is a success
810
799
  *
811
800
  * @tsplus getter fncts.io.IO isSuccess
812
801
  */
813
- export function isSuccess(ma, __tsplusTrace) {
814
- return match_1(() => false, () => true, __tsplusTrace)(ma);
802
+ export function isSuccess(self, __tsplusTrace) {
803
+ return match_1(() => false, () => true, __tsplusTrace)(self);
815
804
  }
816
805
  /**
817
806
  * Iterates with the specified effectual function. The moral equivalent of:
@@ -831,6 +820,12 @@ export function isSuccess(ma, __tsplusTrace) {
831
820
  function iterate_1(initial, cont, body, __tsplusTrace) {
832
821
  return cont(initial) ? flatMap_1(a => iterate_1(a, cont, body, __tsplusTrace), __tsplusTrace)(body(initial)) : succeedNow_1(initial, __tsplusTrace);
833
822
  }
823
+ /**
824
+ * @tsplus getter fncts.io.IO just
825
+ */
826
+ export function just(self) {
827
+ return matchIO_1(e => fail_1(() => tsplus_module_2.just(e, fileName_1 + ":1034:24"), fileName_1 + ":1034:19"), a => tsplus_module_17.match(() => fail_1(() => tsplus_module_2.nothing(fileName_1 + ":1035:41"), fileName_1 + ":1035:33"), succeedNow_1)(a), fileName_1 + ":1033:22")(self);
828
+ }
834
829
  /**
835
830
  * Returns an IO with the value on the left part.
836
831
  *
@@ -839,27 +834,15 @@ function iterate_1(initial, cont, body, __tsplusTrace) {
839
834
  export function left(a, __tsplusTrace) {
840
835
  return flatMap_1(a => succeedNow_1(tsplus_module_9.left(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(succeed_1(a, __tsplusTrace));
841
836
  }
842
- /**
843
- * @tsplus getter fncts.io.IO just
844
- */
845
- export function just(self) {
846
- return matchIO_1(e => fail_1(() => tsplus_module_3.just(e, fileName_1 + ":1088:24"), fileName_1 + ":1088:19"), a => tsplus_module_16.match(() => fail_1(() => tsplus_module_3.nothing(fileName_1 + ":1089:41"), fileName_1 + ":1089:33"), succeedNow_1)(a), fileName_1 + ":1087:22")(self);
847
- }
848
837
  /**
849
838
  * @tsplus static fncts.io.IOOps log
850
839
  */
851
840
  function log_1(message, __tsplusTrace) {
852
841
  return withFiberRuntime_1(fiber => {
853
- fiber.log(message, tsplus_module_2.empty(), tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace);
842
+ fiber.log(message, tsplus_module_1.empty(), tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace);
854
843
  return unit_1;
855
844
  }, __tsplusTrace);
856
845
  }
857
- /**
858
- * @tsplus static fncts.io.IOOps show
859
- */
860
- export function show(message, options, __tsplusTrace) {
861
- return log_1(() => showWithOptions(message, options), __tsplusTrace);
862
- }
863
846
  /**
864
847
  * Loops with the specified effectual function, collecting the results into a
865
848
  * list. The moral equivalent of:
@@ -880,9 +863,9 @@ export function show(message, options, __tsplusTrace) {
880
863
  */
881
864
  function loop_1(initial, cont, inc, body, __tsplusTrace) {
882
865
  if (cont(initial)) {
883
- return flatMap_1(a => map_1(as => tsplus_module_10.prepend(a)(as), __tsplusTrace)(loop_1(inc(initial), cont, inc, body, __tsplusTrace)), __tsplusTrace)(body(initial));
866
+ return flatMap_1(a => map_1(as => tsplus_module_11.prepend(a)(as), __tsplusTrace)(loop_1(inc(initial), cont, inc, body, __tsplusTrace)), __tsplusTrace)(body(initial));
884
867
  } else {
885
- return succeedNow_1(tsplus_module_19.empty(), __tsplusTrace);
868
+ return succeedNow_1(tsplus_module_20.empty(), __tsplusTrace);
886
869
  }
887
870
  }
888
871
  /**
@@ -913,8 +896,8 @@ export function loopUnit(initial, cont, inc, body, __tsplusTrace) {
913
896
  * @tsplus pipeable fncts.io.IO map
914
897
  */
915
898
  function map_1(f, __tsplusTrace) {
916
- return fa => {
917
- return flatMap_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(fa);
899
+ return self => {
900
+ return flatMap_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(self);
918
901
  };
919
902
  }
920
903
  /**
@@ -927,16 +910,10 @@ function map_1(f, __tsplusTrace) {
927
910
  * @tsplus pipeable fncts.io.IO mapError
928
911
  */
929
912
  function mapError_1(f, __tsplusTrace) {
930
- return fea => {
931
- return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_2.map(f)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(fea);
913
+ return self => {
914
+ return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_1.map(f)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
932
915
  };
933
916
  }
934
- /**
935
- * @tsplus static fncts.io.IOOps mapTryCatch
936
- */
937
- export function mapTryCatch(io, f, onThrow, __tsplusTrace) {
938
- return flatMap_1(a => tryCatch_1(() => f(a), onThrow, __tsplusTrace), __tsplusTrace)(io);
939
- }
940
917
  /**
941
918
  * Returns an IO with its full cause of failure mapped using
942
919
  * the specified function. This can be used to transform errors
@@ -945,8 +922,29 @@ export function mapTryCatch(io, f, onThrow, __tsplusTrace) {
945
922
  * @tsplus pipeable fncts.io.IO mapErrorCause
946
923
  */
947
924
  function mapErrorCause_1(f, __tsplusTrace) {
948
- return ma => {
949
- return matchCauseIO_1(cause => failCauseNow_1(f(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(ma);
925
+ return self => {
926
+ return matchCauseIO_1(cause => failCauseNow_1(f(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
927
+ };
928
+ }
929
+ /**
930
+ * @tsplus static fncts.io.IOOps mapTryCatch
931
+ * @tsplus pipeable fncts.io.IO mapTryCatch
932
+ */
933
+ export function mapTryCatch(f, onThrow, __tsplusTrace) {
934
+ return self => {
935
+ return flatMap_1(a => tryCatch_1(() => f(a), onThrow, __tsplusTrace), __tsplusTrace)(self);
936
+ };
937
+ }
938
+ /**
939
+ * Folds over the failure value or the success value to yield an IO that
940
+ * does not fail, but succeeds with the value returned by the left or right
941
+ * function passed to `match_`.
942
+ *
943
+ * @tsplus pipeable fncts.io.IO match
944
+ */
945
+ function match_1(onFailure, onSuccess, __tsplusTrace) {
946
+ return self => {
947
+ return matchIO_1(e => succeedNow_1(onFailure(e), __tsplusTrace), a => succeedNow_1(onSuccess(a), __tsplusTrace), __tsplusTrace)(self);
950
948
  };
951
949
  }
952
950
  /**
@@ -979,19 +977,7 @@ function matchCauseIO_1(onFailure, onSuccess, __tsplusTrace) {
979
977
  */
980
978
  function matchIO_1(onFailure, onSuccess, __tsplusTrace) {
981
979
  return self => {
982
- return matchCauseIO_1(cause => tsplus_module_4.match(onFailure, failCauseNow_1)(tsplus_module_2.failureOrCause(cause)), onSuccess, __tsplusTrace)(self);
983
- };
984
- }
985
- /**
986
- * Folds over the failure value or the success value to yield an IO that
987
- * does not fail, but succeeds with the value returned by the left or right
988
- * function passed to `match_`.
989
- *
990
- * @tsplus pipeable fncts.io.IO match
991
- */
992
- function match_1(onFailure, onSuccess, __tsplusTrace) {
993
- return self => {
994
- return matchIO_1(e => succeedNow_1(onFailure(e), __tsplusTrace), a => succeedNow_1(onSuccess(a), __tsplusTrace), __tsplusTrace)(self);
980
+ return matchCauseIO_1(cause => tsplus_module_4.match(onFailure, failCauseNow_1)(tsplus_module_1.failureOrCause(cause)), onSuccess, __tsplusTrace)(self);
995
981
  };
996
982
  }
997
983
  /**
@@ -1000,42 +986,109 @@ function match_1(onFailure, onSuccess, __tsplusTrace) {
1000
986
  * @tsplus pipeable fncts.io.IO matchTraceIO
1001
987
  */
1002
988
  export function matchTraceIO(onFailure, onSuccess, __tsplusTrace) {
1003
- return ma => {
1004
- return matchCauseIO_1(cause => tsplus_module_4.match(([e, trace]) => onFailure(e, trace), failCauseNow_1)(tsplus_module_2.failureTraceOrCause(cause)), onSuccess, __tsplusTrace)(ma);
989
+ return self => {
990
+ return matchCauseIO_1(cause => tsplus_module_4.match(([e, trace]) => onFailure(e, trace), failCauseNow_1)(tsplus_module_1.failureTraceOrCause(cause)), onSuccess, __tsplusTrace)(self);
1005
991
  };
1006
992
  }
1007
993
  /**
1008
994
  * @tsplus getter fncts.io.IO maybe
1009
995
  */
1010
- export function maybe(io, __tsplusTrace) {
1011
- return match_1(() => tsplus_module_3.nothing(__tsplusTrace), tsplus_module_3.just, __tsplusTrace)(io);
996
+ export function maybe(self, __tsplusTrace) {
997
+ return match_1(() => tsplus_module_2.nothing(__tsplusTrace), tsplus_module_2.just, __tsplusTrace)(self);
1012
998
  }
1013
999
  /**
1014
1000
  * @tsplus getter fncts.io.IO merge
1015
1001
  */
1016
- export function merge(io, __tsplusTrace) {
1017
- return matchIO_1(succeedNow_1, succeedNow_1, __tsplusTrace)(io);
1002
+ export function merge(self, __tsplusTrace) {
1003
+ return matchIO_1(succeedNow_1, succeedNow_1, __tsplusTrace)(self);
1018
1004
  }
1019
1005
  /**
1020
1006
  * Merges an `Iterable<IO>` to a single IO, working sequentially.
1021
1007
  *
1022
1008
  * @tsplus static fncts.io.IOOps mergeAll
1023
1009
  */
1024
- export function mergeAll(fas, b, f, __tsplusTrace) {
1025
- return tsplus_module_11.foldLeft(succeed_1(() => b, __tsplusTrace), (b, a) => zipWith_1(a, f, __tsplusTrace)(b))(fas);
1010
+ export function mergeAll(ios, b, f, __tsplusTrace) {
1011
+ return tsplus_module_12.foldLeft(succeed_1(() => b, __tsplusTrace), (b, a) => zipWith_1(a, f, __tsplusTrace)(b))(ios);
1012
+ }
1013
+ /**
1014
+ * @tsplus static fncts.io.IOOps refailCause
1015
+ */
1016
+ function refailCause_1(cause, __tsplusTrace) {
1017
+ const io = new IOPrimitive(1 /* IOTag.Fail */);
1018
+ io.i0 = cause;
1019
+ io.trace = __tsplusTrace;
1020
+ return io;
1021
+ }
1022
+ /**
1023
+ * @tsplus static fncts.io.IOOps refailCauseNow
1024
+ */
1025
+ export function refailCauseNow(cause, __tsplusTrace) {
1026
+ const io = new IOPrimitive(1 /* IOTag.Fail */);
1027
+ io.i0 = () => cause;
1028
+ io.trace = __tsplusTrace;
1029
+ return io;
1030
+ }
1031
+ /**
1032
+ * @tsplus static fncts.io.IOOps show
1033
+ */
1034
+ export function show(message, options, __tsplusTrace) {
1035
+ return log_1(() => showWithOptions(message, options), __tsplusTrace);
1026
1036
  }
1027
1037
  /**
1028
1038
  * @tsplus static fncts.io.IOOps nothing
1029
1039
  */
1030
- const nothing_1 = /*#__PURE__*/succeedNow_1(/*#__PURE__*/tsplus_module_3.nothing(fileName_1 + ":1338:45"), fileName_1 + ":1338:37");
1040
+ const nothing_1 = /*#__PURE__*/succeedNow_1(/*#__PURE__*/tsplus_module_2.nothing(fileName_1 + ":1311:45"), fileName_1 + ":1311:37");
1031
1041
  export const nothing = nothing_1;
1042
+ /**
1043
+ * Returns an `IO` that submerges an `Either` into the `IO`.
1044
+ *
1045
+ * @tsplus getter fncts.io.IO absolve
1046
+ */
1047
+ export function absolve(self, __tsplusTrace) {
1048
+ return flatMap_1(ea => tsplus_module_4.match(failNow_1, succeedNow_1)(ea), __tsplusTrace)(self);
1049
+ }
1050
+ /**
1051
+ * @tsplus static fncts.io.IOOps attempt
1052
+ */
1053
+ export function attempt(effect, __tsplusTrace) {
1054
+ return defer_1(() => {
1055
+ try {
1056
+ return tsplus_module_10.succeed(effect(), __tsplusTrace);
1057
+ } catch (u) {
1058
+ return withFiberRuntime_1(fiberState => {
1059
+ if (!fiberState.isFatal(u)) {
1060
+ throw new IOError(tsplus_module_1.fail(u));
1061
+ } else {
1062
+ throw u;
1063
+ }
1064
+ }, __tsplusTrace);
1065
+ }
1066
+ }, __tsplusTrace);
1067
+ }
1068
+ /**
1069
+ * Exposes all parallel errors in a single call
1070
+ *
1071
+ * @tsplus pipeable fncts.io.IO concurrentErrors
1072
+ */
1073
+ export function concurrentErrors(__tsplusTrace) {
1074
+ return self => {
1075
+ return matchCauseIO_1(cause => {
1076
+ const f = tsplus_module_1.failures(cause);
1077
+ if (tsplus_module_21.length(f) === 0) {
1078
+ return failCauseNow_1(cause, __tsplusTrace);
1079
+ } else {
1080
+ return failNow_1(f, __tsplusTrace);
1081
+ }
1082
+ }, succeedNow_1, __tsplusTrace)(self);
1083
+ };
1084
+ }
1032
1085
  /**
1033
1086
  * Converts an option on errors into an option on values.
1034
1087
  *
1035
1088
  * @tsplus getter fncts.io.IO optional
1036
1089
  */
1037
- export function optional(ma, __tsplusTrace) {
1038
- return matchIO_1(me => tsplus_module_16.match(() => succeedNow_1(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), failNow_1)(me), a => succeedNow_1(tsplus_module_3.just(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(ma);
1090
+ export function optional(self, __tsplusTrace) {
1091
+ return matchIO_1(me => tsplus_module_17.match(() => succeedNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), failNow_1)(me), a => succeedNow_1(tsplus_module_2.just(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
1039
1092
  }
1040
1093
  /**
1041
1094
  * Returns the logical disjunction of the `Boolean` value returned by this
@@ -1046,17 +1099,17 @@ export function optional(ma, __tsplusTrace) {
1046
1099
  * @tsplus pipeable fncts.io.IO or
1047
1100
  * @tsplus pipeable-operator fncts.io.IO ||
1048
1101
  */
1049
- export function or(mb, __tsplusTrace) {
1050
- return ma => {
1051
- return flatMap_1(b => b ? succeedNow_1(true, __tsplusTrace) : mb, __tsplusTrace)(ma);
1102
+ export function or(or, __tsplusTrace) {
1103
+ return self => {
1104
+ return flatMap_1(b => b ? succeedNow_1(true, __tsplusTrace) : or, __tsplusTrace)(self);
1052
1105
  };
1053
1106
  }
1054
1107
  /**
1055
1108
  * @tsplus pipeable fncts.io.IO orElse
1056
1109
  */
1057
1110
  function orElse_1(that, __tsplusTrace) {
1058
- return ma => {
1059
- return tryOrElse_1(that, succeedNow_1, __tsplusTrace)(ma);
1111
+ return self => {
1112
+ return tryOrElse_1(that, succeedNow_1, __tsplusTrace)(self);
1060
1113
  };
1061
1114
  }
1062
1115
  /**
@@ -1071,61 +1124,44 @@ export function orElseEither(that, __tsplusTrace) {
1071
1124
  * @tsplus pipeable fncts.io.IO orElseFail
1072
1125
  */
1073
1126
  export function orElseFail(e, __tsplusTrace) {
1074
- return ma => {
1075
- return orElse_1(() => fail_1(e, __tsplusTrace), __tsplusTrace)(ma);
1127
+ return self => {
1128
+ return orElse_1(() => fail_1(e, __tsplusTrace), __tsplusTrace)(self);
1076
1129
  };
1077
1130
  }
1078
1131
  /**
1079
1132
  * @tsplus pipeable fncts.io.IO orElseMaybe
1080
1133
  */
1081
1134
  export function orElseMaybe(that, __tsplusTrace) {
1082
- return ma => {
1083
- return catchAll_1(me => tsplus_module_16.match(that, e => fail_1(() => tsplus_module_3.just(e, __tsplusTrace), __tsplusTrace))(me), __tsplusTrace)(ma);
1135
+ return self => {
1136
+ return catchAll_1(me => tsplus_module_17.match(that, e => fail_1(() => tsplus_module_2.just(e, __tsplusTrace), __tsplusTrace))(me), __tsplusTrace)(self);
1084
1137
  };
1085
1138
  }
1086
1139
  /**
1087
1140
  * @tsplus pipeable fncts.io.IO orElseSucceed
1088
1141
  */
1089
1142
  export function orElseSucceed(a, __tsplusTrace) {
1090
- return ma => {
1091
- return orElse_1(() => succeed_1(a, __tsplusTrace), __tsplusTrace)(ma);
1143
+ return self => {
1144
+ return orElse_1(() => succeed_1(a, __tsplusTrace), __tsplusTrace)(self);
1092
1145
  };
1093
1146
  }
1094
1147
  /**
1095
1148
  * @tsplus getter fncts.io.IO orHalt
1096
1149
  */
1097
- export function orHalt(ma, __tsplusTrace) {
1098
- return orHaltWith_1(identity, __tsplusTrace)(ma);
1150
+ export function orHalt(self, __tsplusTrace) {
1151
+ return orHaltWith_1(identity, __tsplusTrace)(self);
1099
1152
  }
1100
1153
  /**
1101
1154
  * @tsplus getter fncts.io.IO orHaltKeep
1102
1155
  */
1103
- export function orHaltKeep(ma, __tsplusTrace) {
1104
- return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_2.flatMap(tsplus_module_2.halt)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(ma);
1156
+ export function orHaltKeep(self, __tsplusTrace) {
1157
+ return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_1.flatMap(tsplus_module_1.halt)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
1105
1158
  }
1106
1159
  /**
1107
1160
  * @tsplus pipeable fncts.io.IO orHaltWith
1108
1161
  */
1109
1162
  function orHaltWith_1(f, __tsplusTrace) {
1110
- return ma => {
1111
- return matchIO_1(e => haltNow_1(f(e), __tsplusTrace), succeedNow_1, __tsplusTrace)(ma);
1112
- };
1113
- }
1114
- /**
1115
- * Exposes all parallel errors in a single call
1116
- *
1117
- * @tsplus pipeable fncts.io.IO concurrentErrors
1118
- */
1119
- export function concurrentErrors(__tsplusTrace) {
1120
- return io => {
1121
- return matchCauseIO_1(cause => {
1122
- const f = tsplus_module_2.failures(cause);
1123
- if (tsplus_module_20.length(f) === 0) {
1124
- return failCauseNow_1(cause, __tsplusTrace);
1125
- } else {
1126
- return failNow_1(f, __tsplusTrace);
1127
- }
1128
- }, succeedNow_1, __tsplusTrace)(io);
1163
+ return self => {
1164
+ return matchIO_1(e => haltNow_1(f(e), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
1129
1165
  };
1130
1166
  }
1131
1167
  /**
@@ -1135,7 +1171,7 @@ export function concurrentErrors(__tsplusTrace) {
1135
1171
  * @tsplus static fncts.io.IOOps partition
1136
1172
  */
1137
1173
  export function partition(as, f, __tsplusTrace) {
1138
- return map_1(c => tsplus_module_10.separate(c), __tsplusTrace)(foreach_1(as, a => either_1(f(a), __tsplusTrace), __tsplusTrace));
1174
+ return map_1(c => tsplus_module_11.separate(c), __tsplusTrace)(foreach_1(as, a => either_1(f(a), __tsplusTrace), __tsplusTrace));
1139
1175
  }
1140
1176
  /**
1141
1177
  * Keeps some of the errors, and terminates the fiber with the rest
@@ -1143,8 +1179,8 @@ export function partition(as, f, __tsplusTrace) {
1143
1179
  * @tsplus pipeable fncts.io.IO refineOrHalt
1144
1180
  */
1145
1181
  export function refineOrHalt(pf, __tsplusTrace) {
1146
- return fa => {
1147
- return refineOrHaltWith_1(pf, identity, __tsplusTrace)(fa);
1182
+ return self => {
1183
+ return refineOrHaltWith_1(pf, identity, __tsplusTrace)(self);
1148
1184
  };
1149
1185
  }
1150
1186
  /**
@@ -1154,8 +1190,8 @@ export function refineOrHalt(pf, __tsplusTrace) {
1154
1190
  * @tsplus pipeable fncts.io.IO refineOrHaltWith
1155
1191
  */
1156
1192
  function refineOrHaltWith_1(pf, f, __tsplusTrace) {
1157
- return fa => {
1158
- return catchAll_1(e => tsplus_module_16.match(() => haltNow_1(f(e), __tsplusTrace), failNow_1)(pf(e)), __tsplusTrace)(fa);
1193
+ return self => {
1194
+ return catchAll_1(e => tsplus_module_17.match(() => haltNow_1(f(e), __tsplusTrace), failNow_1)(pf(e)), __tsplusTrace)(self);
1159
1195
  };
1160
1196
  }
1161
1197
  /**
@@ -1165,8 +1201,8 @@ function refineOrHaltWith_1(pf, f, __tsplusTrace) {
1165
1201
  * @tsplus pipeable fncts.io.IO reject
1166
1202
  */
1167
1203
  export function reject(pf, __tsplusTrace) {
1168
- return fa => {
1169
- return rejectIO_1(a => tsplus_module_6.map(failNow_1)(pf(a)), __tsplusTrace)(fa);
1204
+ return self => {
1205
+ return rejectIO_1(a => tsplus_module_5.map(failNow_1)(pf(a)), __tsplusTrace)(self);
1170
1206
  };
1171
1207
  }
1172
1208
  /**
@@ -1177,8 +1213,8 @@ export function reject(pf, __tsplusTrace) {
1177
1213
  * @tsplus pipeable fncts.io.IO rejectIO
1178
1214
  */
1179
1215
  function rejectIO_1(pf, __tsplusTrace) {
1180
- return fa => {
1181
- return flatMap_1(a => tsplus_module_16.match(() => succeedNow_1(a, __tsplusTrace), io => flatMap_1(failNow_1, __tsplusTrace)(io))(pf(a)), __tsplusTrace)(fa);
1216
+ return self => {
1217
+ return flatMap_1(a => tsplus_module_17.match(() => succeedNow_1(a, __tsplusTrace), io => flatMap_1(failNow_1, __tsplusTrace)(io))(pf(a)), __tsplusTrace)(self);
1182
1218
  };
1183
1219
  }
1184
1220
  /**
@@ -1186,9 +1222,18 @@ function rejectIO_1(pf, __tsplusTrace) {
1186
1222
  *
1187
1223
  * @tsplus pipeable fncts.io.IO repeatN
1188
1224
  */
1189
- function repeatN_1(n, __tsplusTrace) {
1190
- return ma => {
1191
- return flatMap_1(a => n <= 0 ? succeed_1(() => a, __tsplusTrace) : repeatN_1(n - 1, __tsplusTrace)(ma), __tsplusTrace)(ma);
1225
+ export function repeatN_(n, __tsplusTrace) {
1226
+ return self => {
1227
+ return flatMap_1(a => {
1228
+ let i = n;
1229
+ let s = a;
1230
+ return as_1(() => s, __tsplusTrace)(whileLoop_1(() => i > 0, () => {
1231
+ i -= 1;
1232
+ return self;
1233
+ }, a => {
1234
+ s = a;
1235
+ }));
1236
+ }, __tsplusTrace)(self);
1192
1237
  };
1193
1238
  }
1194
1239
  /**
@@ -1197,8 +1242,8 @@ function repeatN_1(n, __tsplusTrace) {
1197
1242
  * @tsplus pipeable fncts.io.IO repeatUntil
1198
1243
  */
1199
1244
  export function repeatUntil(f, __tsplusTrace) {
1200
- return ma => {
1201
- return repeatUntilIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(ma);
1245
+ return self => {
1246
+ return repeatUntilIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(self);
1202
1247
  };
1203
1248
  }
1204
1249
  /**
@@ -1207,8 +1252,8 @@ export function repeatUntil(f, __tsplusTrace) {
1207
1252
  * @tsplus pipeable fncts.io.IO repeatUntilIO
1208
1253
  */
1209
1254
  function repeatUntilIO_1(f, __tsplusTrace) {
1210
- return ma => {
1211
- return flatMap_1(a => flatMap_1(b => b ? succeed_1(() => a, __tsplusTrace) : repeatUntilIO_1(f, __tsplusTrace)(ma), __tsplusTrace)(f(a)), __tsplusTrace)(ma);
1255
+ return self => {
1256
+ return flatMap_1(a => flatMap_1(b => b ? succeed_1(() => a, __tsplusTrace) : repeatUntilIO_1(f, __tsplusTrace)(self), __tsplusTrace)(f(a)), __tsplusTrace)(self);
1212
1257
  };
1213
1258
  }
1214
1259
  /**
@@ -1217,8 +1262,8 @@ function repeatUntilIO_1(f, __tsplusTrace) {
1217
1262
  * @tsplus pipeable fncts.io.IO repeatWhile
1218
1263
  */
1219
1264
  export function repeatWhile(f, __tsplusTrace) {
1220
- return ma => {
1221
- return repeatWhileIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(ma);
1265
+ return self => {
1266
+ return repeatWhileIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(self);
1222
1267
  };
1223
1268
  }
1224
1269
  /**
@@ -1227,8 +1272,8 @@ export function repeatWhile(f, __tsplusTrace) {
1227
1272
  * @tsplus pipeable fncts.io.IO repeatWhileIO
1228
1273
  */
1229
1274
  function repeatWhileIO_1(f, __tsplusTrace) {
1230
- return ma => {
1231
- return flatMap_1(a => flatMap_1(b => b ? repeatWhileIO_1(f, __tsplusTrace)(ma) : succeed_1(() => a, __tsplusTrace), __tsplusTrace)(f(a)), __tsplusTrace)(ma);
1275
+ return self => {
1276
+ return flatMap_1(a => flatMap_1(b => b ? repeatWhileIO_1(f, __tsplusTrace)(self) : succeed_1(() => a, __tsplusTrace), __tsplusTrace)(f(a)), __tsplusTrace)(self);
1232
1277
  };
1233
1278
  }
1234
1279
  /**
@@ -1236,15 +1281,15 @@ function repeatWhileIO_1(f, __tsplusTrace) {
1236
1281
  */
1237
1282
  export function replicate(n, __tsplusTrace) {
1238
1283
  return self => {
1239
- return tsplus_module_22.map(() => self)(tsplus_module_21.range(0, n));
1284
+ return tsplus_module_22.range(0, n).map(() => self);
1240
1285
  };
1241
1286
  }
1242
1287
  /**
1243
1288
  * @tsplus pipeable fncts.io.IO require
1244
1289
  */
1245
1290
  export function require(error, __tsplusTrace) {
1246
- return ma => {
1247
- return flatMap_1(ma => tsplus_module_16.match(() => fail_1(error, __tsplusTrace), succeedNow_1)(ma), __tsplusTrace)(ma);
1291
+ return self => {
1292
+ return flatMap_1(ma => tsplus_module_17.match(() => fail_1(error, __tsplusTrace), succeedNow_1)(ma), __tsplusTrace)(self);
1248
1293
  };
1249
1294
  }
1250
1295
  /**
@@ -1253,16 +1298,16 @@ export function require(error, __tsplusTrace) {
1253
1298
  *
1254
1299
  * @tsplus getter fncts.io.IO result
1255
1300
  */
1256
- export function result(ma, __tsplusTrace) {
1257
- return matchCauseIO_1(cause => succeedNow_1(tsplus_module_23.failCause(cause, __tsplusTrace), __tsplusTrace), a => succeedNow_1(tsplus_module_23.succeed(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(ma);
1301
+ export function result(self, __tsplusTrace) {
1302
+ return matchCauseIO_1(cause => succeedNow_1(tsplus_module_10.failCause(cause, __tsplusTrace), __tsplusTrace), a => succeedNow_1(tsplus_module_10.succeed(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
1258
1303
  }
1259
1304
  /**
1260
1305
  * Recover from the unchecked failure of the `IO`. (opposite of `orHalt`)
1261
1306
  *
1262
1307
  * @tsplus getter fncts.io.IO resurrect
1263
1308
  */
1264
- export function resurrect(io, __tsplusTrace) {
1265
- return unrefineWith_1(tsplus_module_3.just, identity, __tsplusTrace)(io);
1309
+ export function resurrect(self, __tsplusTrace) {
1310
+ return unrefineWith_1(tsplus_module_2.just, identity, __tsplusTrace)(self);
1266
1311
  }
1267
1312
  /**
1268
1313
  * Retries this effect until its error satisfies the specified predicate.
@@ -1270,8 +1315,8 @@ export function resurrect(io, __tsplusTrace) {
1270
1315
  * @tsplus pipeable fncts.io.IO retryUntil
1271
1316
  */
1272
1317
  export function retryUntil(f, __tsplusTrace) {
1273
- return fa => {
1274
- return retryUntilIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(fa);
1318
+ return self => {
1319
+ return retryUntilIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(self);
1275
1320
  };
1276
1321
  }
1277
1322
  /**
@@ -1280,8 +1325,8 @@ export function retryUntil(f, __tsplusTrace) {
1280
1325
  * @tsplus pipeable fncts.io.IO retryUntilIO
1281
1326
  */
1282
1327
  function retryUntilIO_1(f, __tsplusTrace) {
1283
- return fa => {
1284
- return catchAll_1(e => flatMap_1(b => b ? failNow_1(e, __tsplusTrace) : retryUntilIO_1(f, __tsplusTrace)(fa), __tsplusTrace)(f(e)), __tsplusTrace)(fa);
1328
+ return self => {
1329
+ return catchAll_1(e => flatMap_1(b => b ? failNow_1(e, __tsplusTrace) : retryUntilIO_1(f, __tsplusTrace)(self), __tsplusTrace)(f(e)), __tsplusTrace)(self);
1285
1330
  };
1286
1331
  }
1287
1332
  /**
@@ -1290,8 +1335,8 @@ function retryUntilIO_1(f, __tsplusTrace) {
1290
1335
  * @tsplus pipeable fncts.io.IO retryWhile
1291
1336
  */
1292
1337
  export function retryWhile(f, __tsplusTrace) {
1293
- return fa => {
1294
- return retryWhileIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(fa);
1338
+ return self => {
1339
+ return retryWhileIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(self);
1295
1340
  };
1296
1341
  }
1297
1342
  /**
@@ -1300,8 +1345,8 @@ export function retryWhile(f, __tsplusTrace) {
1300
1345
  * @tsplus pipeable fncts.io.IO retryWhileIO
1301
1346
  */
1302
1347
  function retryWhileIO_1(f, __tsplusTrace) {
1303
- return fa => {
1304
- return catchAll_1(e => flatMap_1(b => b ? retryWhileIO_1(f, __tsplusTrace)(fa) : fail_1(() => e, __tsplusTrace), __tsplusTrace)(f(e)), __tsplusTrace)(fa);
1348
+ return self => {
1349
+ return catchAll_1(e => flatMap_1(b => b ? retryWhileIO_1(f, __tsplusTrace)(self) : fail_1(() => e, __tsplusTrace), __tsplusTrace)(f(e)), __tsplusTrace)(self);
1305
1350
  };
1306
1351
  }
1307
1352
  /**
@@ -1309,15 +1354,15 @@ function retryWhileIO_1(f, __tsplusTrace) {
1309
1354
  *
1310
1355
  * @tsplus getter fncts.io.IO sandbox
1311
1356
  */
1312
- function sandbox_1(fa, __tsplusTrace) {
1313
- return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(fa);
1357
+ function sandbox_1(self, __tsplusTrace) {
1358
+ return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(self);
1314
1359
  }
1315
1360
  /**
1316
1361
  * @tsplus pipeable fncts.io.IO sandboxWith
1317
1362
  */
1318
1363
  export function sandboxWith(f, __tsplusTrace) {
1319
- return ma => {
1320
- return unsandbox_1(f(sandbox_1(ma, __tsplusTrace)), __tsplusTrace);
1364
+ return self => {
1365
+ return unsandbox_1(f(sandbox_1(self, __tsplusTrace)), __tsplusTrace);
1321
1366
  };
1322
1367
  }
1323
1368
  /**
@@ -1332,17 +1377,6 @@ export function sequenceIterable(as, __tsplusTrace) {
1332
1377
  export function sequenceIterableDiscard(as, __tsplusTrace) {
1333
1378
  return foreachDiscard_1(as, identity, __tsplusTrace);
1334
1379
  }
1335
- /**
1336
- * Creates a `IO` that has succeeded with a pure value
1337
- *
1338
- * @tsplus static fncts.io.IOOps succeedNow
1339
- */
1340
- function succeedNow_1(value, __tsplusTrace) {
1341
- const io = new IOPrimitive(0 /* IOTag.SucceedNow */);
1342
- io.i0 = value;
1343
- io.trace = __tsplusTrace;
1344
- return io;
1345
- }
1346
1380
  /**
1347
1381
  * Imports a total synchronous effect into a pure `IO` value.
1348
1382
  * The effect must not throw any exceptions. If you wonder if the effect
@@ -1357,6 +1391,17 @@ function succeed_1(effect, __tsplusTrace) {
1357
1391
  io.trace = __tsplusTrace;
1358
1392
  return io;
1359
1393
  }
1394
+ /**
1395
+ * Creates a `IO` that has succeeded with a pure value
1396
+ *
1397
+ * @tsplus static fncts.io.IOOps succeedNow
1398
+ */
1399
+ function succeedNow_1(value, __tsplusTrace) {
1400
+ const io = new IOPrimitive(0 /* IOTag.SucceedNow */);
1401
+ io.i0 = value;
1402
+ io.trace = __tsplusTrace;
1403
+ return io;
1404
+ }
1360
1405
  /**
1361
1406
  * @tsplus pipeable fncts.io.IO summarized
1362
1407
  */
@@ -1375,8 +1420,8 @@ function summarized_1(summary, f, __tsplusTrace) {
1375
1420
  *
1376
1421
  * @tsplus getter fncts.io.IO swap
1377
1422
  */
1378
- function swap_1(pab, __tsplusTrace) {
1379
- return matchIO_1(succeedNow_1, failNow_1, __tsplusTrace)(pab);
1423
+ function swap_1(self, __tsplusTrace) {
1424
+ return matchIO_1(succeedNow_1, failNow_1, __tsplusTrace)(self);
1380
1425
  }
1381
1426
  /**
1382
1427
  * Swaps the error/value parameters, applies the function `f` and flips the parameters back
@@ -1384,61 +1429,7 @@ function swap_1(pab, __tsplusTrace) {
1384
1429
  * @tsplus pipeable fncts.io.IO swapWith
1385
1430
  */
1386
1431
  function swapWith_1(f, __tsplusTrace) {
1387
- return fa => swap_1(f(swap_1(fa, __tsplusTrace)), __tsplusTrace);
1388
- }
1389
- /**
1390
- * A more powerful variation of `timed` that allows specifying the clock.
1391
- *
1392
- * @tsplus pipeable fncts.io.IO timedWith
1393
- */
1394
- export function timedWith(msTime, __tsplusTrace) {
1395
- return ma => summarized_1(msTime, (start, end) => end - start, __tsplusTrace)(ma);
1396
- }
1397
- /**
1398
- * @tsplus static fncts.io.IOOps attempt
1399
- */
1400
- export function attempt(effect, __tsplusTrace) {
1401
- return defer_1(() => {
1402
- try {
1403
- return tsplus_module_23.succeed(effect(), __tsplusTrace);
1404
- } catch (u) {
1405
- return withFiberRuntime_1(fiberState => {
1406
- if (!fiberState.isFatal(u)) {
1407
- throw new IOError(tsplus_module_2.fail(u));
1408
- } else {
1409
- throw u;
1410
- }
1411
- }, __tsplusTrace);
1412
- }
1413
- }, __tsplusTrace);
1414
- }
1415
- /**
1416
- * Creates a `IO` that has succeeded with a pure value
1417
- *
1418
- * @tsplus static fncts.io.IOOps tryCatch
1419
- */
1420
- function tryCatch_1(effect, onThrow, __tsplusTrace) {
1421
- return defer_1(() => {
1422
- try {
1423
- return tsplus_module_23.succeed(effect(), __tsplusTrace);
1424
- } catch (u) {
1425
- return withFiberRuntime_1(fiberState => {
1426
- if (!fiberState.isFatal(u)) {
1427
- throw new IOError(tsplus_module_2.fail(onThrow(u)));
1428
- } else {
1429
- throw u;
1430
- }
1431
- }, __tsplusTrace);
1432
- }
1433
- }, __tsplusTrace);
1434
- }
1435
- /**
1436
- * Returns an `IO` that submerges an `Either` into the `IO`.
1437
- *
1438
- * @tsplus getter fncts.io.IO absolve
1439
- */
1440
- export function absolve(ma, __tsplusTrace) {
1441
- return flatMap_1(ea => tsplus_module_4.match(failNow_1, succeedNow_1)(ea), __tsplusTrace)(ma);
1432
+ return self => swap_1(f(swap_1(self, __tsplusTrace)), __tsplusTrace);
1442
1433
  }
1443
1434
  /**
1444
1435
  * Composes computations in sequence, using the return value of one computation as input for the next
@@ -1460,8 +1451,8 @@ export function tap(f, __tsplusTrace) {
1460
1451
  * @tsplus pipeable fncts.io.IO tapCause
1461
1452
  */
1462
1453
  export function tapCause(f, __tsplusTrace) {
1463
- return ma => {
1464
- return matchCauseIO_1(c => flatMap_1(() => failCauseNow_1(c, __tsplusTrace), __tsplusTrace)(f(c)), succeedNow_1, __tsplusTrace)(ma);
1454
+ return self => {
1455
+ return matchCauseIO_1(c => flatMap_1(() => failCauseNow_1(c, __tsplusTrace), __tsplusTrace)(f(c)), succeedNow_1, __tsplusTrace)(self);
1465
1456
  };
1466
1457
  }
1467
1458
  /**
@@ -1470,7 +1461,7 @@ export function tapCause(f, __tsplusTrace) {
1470
1461
  * @tsplus pipeable fncts.io.IO tapError
1471
1462
  */
1472
1463
  export function tapError(f, __tsplusTrace) {
1473
- return self => matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(f(e)), _ => failCauseNow_1(cause, __tsplusTrace))(tsplus_module_2.failureOrCause(cause)), succeedNow_1, __tsplusTrace)(self);
1464
+ return self => matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(f(e)), _ => failCauseNow_1(cause, __tsplusTrace))(tsplus_module_1.failureOrCause(cause)), succeedNow_1, __tsplusTrace)(self);
1474
1465
  }
1475
1466
  /**
1476
1467
  * Returns an effect that effectually "peeks" at the cause of the failure of
@@ -1483,18 +1474,46 @@ export function tapErrorCause(f, __tsplusTrace) {
1483
1474
  return matchCauseIO_1(cause => zipRight_1(failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(f(cause)), succeedNow_1, __tsplusTrace)(self);
1484
1475
  };
1485
1476
  }
1477
+ /**
1478
+ * A more powerful variation of `timed` that allows specifying the clock.
1479
+ *
1480
+ * @tsplus pipeable fncts.io.IO timedWith
1481
+ */
1482
+ export function timedWith(msTime, __tsplusTrace) {
1483
+ return self => summarized_1(msTime, (start, end) => end - start, __tsplusTrace)(self);
1484
+ }
1485
+ /**
1486
+ * Creates a `IO` that has succeeded with a pure value
1487
+ *
1488
+ * @tsplus static fncts.io.IOOps tryCatch
1489
+ */
1490
+ function tryCatch_1(effect, onThrow, __tsplusTrace) {
1491
+ return defer_1(() => {
1492
+ try {
1493
+ return tsplus_module_10.succeed(effect(), __tsplusTrace);
1494
+ } catch (u) {
1495
+ return withFiberRuntime_1(fiberState => {
1496
+ if (!fiberState.isFatal(u)) {
1497
+ throw new IOError(tsplus_module_1.fail(onThrow(u)));
1498
+ } else {
1499
+ throw u;
1500
+ }
1501
+ }, __tsplusTrace);
1502
+ }
1503
+ }, __tsplusTrace);
1504
+ }
1486
1505
  /**
1487
1506
  * @tsplus pipeable fncts.io.IO tryOrElse
1488
1507
  */
1489
1508
  function tryOrElse_1(that, onSuccess, __tsplusTrace) {
1490
- return ma => {
1491
- return matchCauseIO_1(cause => tsplus_module_16.match(that, failCauseNow_1)(tsplus_module_2.keepDefects(cause)), onSuccess, __tsplusTrace)(ma);
1509
+ return self => {
1510
+ return matchCauseIO_1(cause => tsplus_module_17.match(that, failCauseNow_1)(tsplus_module_1.keepDefects(cause)), onSuccess, __tsplusTrace)(self);
1492
1511
  };
1493
1512
  }
1494
1513
  /**
1495
1514
  * @tsplus static fncts.io.IOOps unit
1496
1515
  */
1497
- const unit_1 = /*#__PURE__*/succeedNow_1(undefined, fileName_1 + ":1880:45");
1516
+ const unit_1 = /*#__PURE__*/succeedNow_1(undefined, fileName_1 + ":1866:45");
1498
1517
  export const unit = unit_1;
1499
1518
  /**
1500
1519
  * Converts an option on errors into an option on values.
@@ -1502,7 +1521,7 @@ export const unit = unit_1;
1502
1521
  * @tsplus getter fncts.io.IO unjust
1503
1522
  */
1504
1523
  export function unjust(self, __tsplusTrace) {
1505
- return matchIO_1(e => tsplus_module_16.match(() => succeedNow_1(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), failNow_1)(e), a => succeedNow_1(tsplus_module_3.just(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
1524
+ return matchIO_1(e => tsplus_module_17.match(() => succeedNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), failNow_1)(e), a => succeedNow_1(tsplus_module_2.just(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
1506
1525
  }
1507
1526
  /**
1508
1527
  * Takes some fiber failures and converts them into errors, using the
@@ -1511,8 +1530,8 @@ export function unjust(self, __tsplusTrace) {
1511
1530
  * @tsplus pipeable fncts.io.IO unrefineWith
1512
1531
  */
1513
1532
  function unrefineWith_1(pf, f, __tsplusTrace) {
1514
- return fa => {
1515
- return catchAllCause_1(cause => tsplus_module_16.match(() => failCauseNow_1(tsplus_module_2.map(f)(cause), __tsplusTrace), failNow_1)(tsplus_module_2.find(c => tsplus_module_2.isHalt(c) ? pf(c.value) : tsplus_module_3.nothing(__tsplusTrace))(cause)), __tsplusTrace)(fa);
1533
+ return self => {
1534
+ return catchAllCause_1(cause => tsplus_module_17.match(() => failCauseNow_1(tsplus_module_1.map(f)(cause), __tsplusTrace), failNow_1)(tsplus_module_1.find(c => tsplus_module_1.isHalt(c) ? pf(c.value) : tsplus_module_2.nothing(__tsplusTrace))(cause)), __tsplusTrace)(self);
1516
1535
  };
1517
1536
  }
1518
1537
  /**
@@ -1520,8 +1539,8 @@ function unrefineWith_1(pf, f, __tsplusTrace) {
1520
1539
  *
1521
1540
  * @tsplus getter fncts.io.IO unsandbox
1522
1541
  */
1523
- function unsandbox_1(ma, __tsplusTrace) {
1524
- return mapErrorCause_1(cause => tsplus_module_2.flatten(cause), __tsplusTrace)(ma);
1542
+ function unsandbox_1(self, __tsplusTrace) {
1543
+ return mapErrorCause_1(cause => tsplus_module_1.flatten(cause), __tsplusTrace)(self);
1525
1544
  }
1526
1545
  /**
1527
1546
  * Updates the `FiberRef` values for the fiber running this effect using the
@@ -1539,12 +1558,27 @@ export function updateFiberRefs(f, __tsplusTrace) {
1539
1558
  * @tsplus fluent fncts.io.IO __call
1540
1559
  */
1541
1560
  export const via = pipe;
1561
+ /**
1562
+ * @tsplus static fncts.io.IOOps stackTrace
1563
+ */
1564
+ function stackTrace_1(__tsplusTrace) {
1565
+ return withFiberRuntime_1(state => succeedNow_1(state.generateStackTrace(), __tsplusTrace), __tsplusTrace);
1566
+ }
1567
+ /**
1568
+ * @tsplus static fncts.io.IOOps updateRuntimeFlags
1569
+ */
1570
+ export function updateRuntimeFlags(patch, __tsplusTrace) {
1571
+ const io = new IOPrimitive(6 /* IOTag.UpdateRuntimeFlags */);
1572
+ io.i0 = patch;
1573
+ io.trace = __tsplusTrace;
1574
+ return io;
1575
+ }
1542
1576
  /**
1543
1577
  * @tsplus pipeable fncts.io.IO when
1544
1578
  */
1545
1579
  export function when(b, __tsplusTrace) {
1546
- return ma => {
1547
- return whenIO_1(succeed_1(b, __tsplusTrace), __tsplusTrace)(ma);
1580
+ return self => {
1581
+ return whenIO_1(succeed_1(b, __tsplusTrace), __tsplusTrace)(self);
1548
1582
  };
1549
1583
  }
1550
1584
  /**
@@ -1554,33 +1588,26 @@ export function when(b, __tsplusTrace) {
1554
1588
  * @tsplus static fncts.io.IOOps whenIO
1555
1589
  */
1556
1590
  function whenIO_1(mb, __tsplusTrace) {
1557
- return ma => {
1558
- return flatMap_1(b => b ? asJust_1(ma, __tsplusTrace) : nothing_1, __tsplusTrace)(mb);
1591
+ return self => {
1592
+ return flatMap_1(b => b ? asJust_1(self, __tsplusTrace) : nothing_1, __tsplusTrace)(mb);
1559
1593
  };
1560
1594
  }
1561
1595
  /**
1562
- * @tsplus static fncts.io.IOOps withFiberRuntime
1596
+ * @tsplus static fncts.io.IOOps whileLoop
1563
1597
  */
1564
- function withFiberRuntime_1(onState, __tsplusTrace) {
1565
- const io = new IOPrimitive(10 /* IOTag.Stateful */);
1566
- io.i0 = onState;
1567
- io.trace = __tsplusTrace;
1598
+ function whileLoop_1(check, body, process, __tsPlusTrace) {
1599
+ const io = new IOPrimitive(9 /* IOTag.WhileLoop */);
1600
+ io.i0 = check;
1601
+ io.i1 = body;
1602
+ io.i2 = process;
1568
1603
  return io;
1569
1604
  }
1570
1605
  /**
1571
- * @tsplus static fncts.io.IOOps updateRuntimeFlags
1572
- */
1573
- export function updateRuntimeFlags(patch, __tsplusTrace) {
1574
- const io = new IOPrimitive(7 /* IOTag.UpdateRuntimeFlags */);
1575
- io.i0 = patch;
1576
- io.trace = __tsplusTrace;
1577
- return io;
1578
- }
1579
- /**
1580
- * @tsplus static fncts.io.IOOps stackTrace
1606
+ * @tsplus static fncts.io.IOOps withFiberRuntime
1581
1607
  */
1582
- function stackTrace_1(__tsplusTrace) {
1583
- const io = new IOPrimitive(9 /* IOTag.GenerateStackTrace */);
1608
+ function withFiberRuntime_1(onState, __tsplusTrace) {
1609
+ const io = new IOPrimitive(8 /* IOTag.Stateful */);
1610
+ io.i0 = onState;
1584
1611
  io.trace = __tsplusTrace;
1585
1612
  return io;
1586
1613
  }
@@ -1591,7 +1618,7 @@ function stackTrace_1(__tsplusTrace) {
1591
1618
  *
1592
1619
  * @tsplus static fncts.io.IOOps yieldNow
1593
1620
  */
1594
- const yieldNow_1 = /*#__PURE__*/new IOPrimitive(12 /* IOTag.YieldNow */);
1621
+ const yieldNow_1 = /*#__PURE__*/new IOPrimitive(10 /* IOTag.YieldNow */);
1595
1622
  export const yieldNow = yieldNow_1;
1596
1623
  /**
1597
1624
  * @tsplus pipeable fncts.io.IO zip
@@ -1601,6 +1628,26 @@ export function zip(that, __tsplusTrace) {
1601
1628
  return zipWith_1(that, tuple, __tsplusTrace)(self);
1602
1629
  };
1603
1630
  }
1631
+ /**
1632
+ * @tsplus pipeable fncts.io.IO zipLeft
1633
+ * @tsplus pipeable-operator fncts.io.IO <
1634
+ */
1635
+ export function zipLeft(fb, __tsplusTrace) {
1636
+ return self => {
1637
+ return flatMap_1(a => map_1(() => a, __tsplusTrace)(fb), __tsplusTrace)(self);
1638
+ };
1639
+ }
1640
+ /**
1641
+ * Combine two effectful actions, keeping only the result of the second
1642
+ *
1643
+ * @tsplus pipeable fncts.io.IO zipRight
1644
+ * @tsplus pipeable-operator fncts.io.IO >
1645
+ */
1646
+ function zipRight_1(fb, __tsplusTrace) {
1647
+ return self => {
1648
+ return flatMap_1(() => fb, __tsplusTrace)(self);
1649
+ };
1650
+ }
1604
1651
  /**
1605
1652
  * @tsplus pipeable fncts.io.IO zipWith
1606
1653
  */
@@ -1609,6 +1656,12 @@ function zipWith_1(that, f, __tsplusTrace) {
1609
1656
  return flatMap_1(a => map_1(b => f(a, b), __tsplusTrace)(that), __tsplusTrace)(self);
1610
1657
  };
1611
1658
  }
1659
+ /**
1660
+ * @internal
1661
+ */
1662
+ export const __adapter = _ => {
1663
+ return _;
1664
+ };
1612
1665
  export class GenIO {
1613
1666
  constructor(effect, _trace) {
1614
1667
  this.effect = effect;
@@ -1618,12 +1671,6 @@ export class GenIO {
1618
1671
  return yield this;
1619
1672
  }
1620
1673
  }
1621
- /**
1622
- * @internal
1623
- */
1624
- export const __adapter = _ => {
1625
- return _;
1626
- };
1627
1674
  const adapter = (_, __tsplusTrace) => {
1628
1675
  return new GenIO(__adapter(_), __tsplusTrace);
1629
1676
  };