@fncts/io 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1688) hide show
  1. package/Cached/api.d.ts +27 -0
  2. package/Cached/definition.d.ts +18 -0
  3. package/Cached/internal.d.ts +10 -0
  4. package/Cached.d.ts +3 -0
  5. package/CancellerState.d.ts +42 -0
  6. package/Channel/ChildExecutorDecision/api.d.ts +6 -0
  7. package/Channel/ChildExecutorDecision/definition.d.ts +35 -0
  8. package/Channel/ChildExecutorDecision.d.ts +2 -0
  9. package/Channel/UpstreamPullRequest/api.d.ts +16 -0
  10. package/Channel/UpstreamPullRequest/definition.d.ts +20 -0
  11. package/Channel/UpstreamPullRequest.d.ts +2 -0
  12. package/Channel/UpstreamPullStrategy/definition.d.ts +26 -0
  13. package/Channel/UpstreamPullStrategy.d.ts +1 -0
  14. package/Channel/api/interruptWhen.d.ts +23 -0
  15. package/Channel/api/mapOutIOC.d.ts +8 -0
  16. package/Channel/api/mergeAll.d.ts +7 -0
  17. package/Channel/api/mergeAllUnboundedWith.d.ts +6 -0
  18. package/Channel/api/mergeAllWith.d.ts +11 -0
  19. package/Channel/api/mergeMap.d.ts +7 -0
  20. package/Channel/api/mergeWith.d.ts +14 -0
  21. package/Channel/api/run.d.ts +8 -0
  22. package/Channel/api/runCollect.d.ts +8 -0
  23. package/Channel/api/runDrain.d.ts +8 -0
  24. package/Channel/api/runScoped.d.ts +10 -0
  25. package/Channel/api/toPull.d.ts +11 -0
  26. package/Channel/api/zipC.d.ts +16 -0
  27. package/Channel/api.d.ts +420 -0
  28. package/Channel/core-api.d.ts +78 -0
  29. package/Channel/definition.d.ts +164 -0
  30. package/Channel/internal/AsyncInputConsumer.d.ts +8 -0
  31. package/Channel/internal/AsyncInputProducer.d.ts +8 -0
  32. package/Channel/internal/ChannelExecutor.d.ts +51 -0
  33. package/Channel/internal/ChannelState.d.ts +44 -0
  34. package/Channel/internal/MergeDecision.d.ts +51 -0
  35. package/Channel/internal/MergeState.d.ts +50 -0
  36. package/Channel/internal/SingleProducerAsyncInput.d.ts +71 -0
  37. package/Channel.d.ts +3 -0
  38. package/Clock/api.d.ts +11 -0
  39. package/Clock/definition.d.ts +14 -0
  40. package/Clock/live.d.ts +7 -0
  41. package/Clock.d.ts +3 -0
  42. package/Console/api.d.ts +11 -0
  43. package/Console/definition.d.ts +15 -0
  44. package/Console/live.d.ts +11 -0
  45. package/Console.d.ts +3 -0
  46. package/Fiber/FiberContext.d.ts +145 -0
  47. package/Fiber/api/await.d.ts +8 -0
  48. package/Fiber/api/awaitAll.d.ts +10 -0
  49. package/Fiber/api/children.d.ts +8 -0
  50. package/Fiber/api/collectAll.d.ts +11 -0
  51. package/Fiber/api/evalOn.d.ts +7 -0
  52. package/Fiber/api/evalOnIO.d.ts +9 -0
  53. package/Fiber/api/fromIO.d.ts +8 -0
  54. package/Fiber/api/id.d.ts +7 -0
  55. package/Fiber/api/inheritRefs.d.ts +7 -0
  56. package/Fiber/api/interrupt.d.ts +11 -0
  57. package/Fiber/api/interruptAll.d.ts +15 -0
  58. package/Fiber/api/interruptAs.d.ts +9 -0
  59. package/Fiber/api/interruptFork.d.ts +10 -0
  60. package/Fiber/api/join.d.ts +12 -0
  61. package/Fiber/api/joinAll.d.ts +11 -0
  62. package/Fiber/api/location.d.ts +7 -0
  63. package/Fiber/api/mapFiber.d.ts +9 -0
  64. package/Fiber/api/mapIO.d.ts +14 -0
  65. package/Fiber/api/poll.d.ts +9 -0
  66. package/Fiber/api/zipWith.d.ts +9 -0
  67. package/Fiber/constructors.d.ts +29 -0
  68. package/Fiber/definition.d.ts +102 -0
  69. package/Fiber.d.ts +23 -0
  70. package/FiberDescriptor.d.ts +18 -0
  71. package/FiberRef/api/locallyScoped.d.ts +9 -0
  72. package/FiberRef/api/locallyScopedWith.d.ts +9 -0
  73. package/FiberRef/api.d.ts +89 -0
  74. package/FiberRef/constructors.d.ts +63 -0
  75. package/FiberRef/definition.d.ts +41 -0
  76. package/FiberRef.d.ts +5 -0
  77. package/FiberRefs/api.d.ts +15 -0
  78. package/FiberRefs/definition.d.ts +14 -0
  79. package/FiberRefs/join.d.ts +8 -0
  80. package/FiberRefs.d.ts +3 -0
  81. package/FiberScope/constructors.d.ts +16 -0
  82. package/FiberScope/definition.d.ts +24 -0
  83. package/FiberScope.d.ts +2 -0
  84. package/FiberState/api.d.ts +7 -0
  85. package/FiberState/constructors.d.ts +22 -0
  86. package/FiberState/definition.d.ts +38 -0
  87. package/FiberState.d.ts +3 -0
  88. package/FiberStatus/constructors.d.ts +22 -0
  89. package/FiberStatus/definition.d.ts +59 -0
  90. package/FiberStatus.d.ts +2 -0
  91. package/Future/api.d.ts +113 -0
  92. package/Future/constructors.d.ts +21 -0
  93. package/Future/definition.d.ts +27 -0
  94. package/Future.d.ts +3 -0
  95. package/Hub/api.d.ts +191 -0
  96. package/Hub/definition.d.ts +89 -0
  97. package/Hub/internal.d.ts +97 -0
  98. package/Hub.d.ts +2 -0
  99. package/IO/api/acquireRelease.d.ts +10 -0
  100. package/IO/api/acquireReleaseExit.d.ts +11 -0
  101. package/IO/api/acquireReleaseInterruptible.d.ts +9 -0
  102. package/IO/api/acquireReleaseInterruptibleExit.d.ts +10 -0
  103. package/IO/api/addFinalizer.d.ts +9 -0
  104. package/IO/api/addFinalizerExit.d.ts +9 -0
  105. package/IO/api/bracket.d.ts +26 -0
  106. package/IO/api/bracketExit.d.ts +14 -0
  107. package/IO/api/clockWith.d.ts +12 -0
  108. package/IO/api/concurrency.d.ts +35 -0
  109. package/IO/api/concurrentFinalizers.d.ts +8 -0
  110. package/IO/api/consoleWith.d.ts +12 -0
  111. package/IO/api/core-scope.d.ts +77 -0
  112. package/IO/api/environment.d.ts +74 -0
  113. package/IO/api/foreachC.d.ts +29 -0
  114. package/IO/api/foreachExec.d.ts +12 -0
  115. package/IO/api/forkAll.d.ts +10 -0
  116. package/IO/api/forkIn.d.ts +9 -0
  117. package/IO/api/forkScoped.d.ts +8 -0
  118. package/IO/api/fulfill.d.ts +10 -0
  119. package/IO/api/interrupt.d.ts +108 -0
  120. package/IO/api/memoize.d.ts +6 -0
  121. package/IO/api/onExit.d.ts +7 -0
  122. package/IO/api/once.d.ts +6 -0
  123. package/IO/api/provideLayer.d.ts +7 -0
  124. package/IO/api/provideSomeLayer.d.ts +13 -0
  125. package/IO/api/race.d.ts +13 -0
  126. package/IO/api/raceFirst.d.ts +16 -0
  127. package/IO/api/randomWith.d.ts +12 -0
  128. package/IO/api/repeat.d.ts +20 -0
  129. package/IO/api/retry.d.ts +19 -0
  130. package/IO/api/schedule.d.ts +13 -0
  131. package/IO/api/scope.d.ts +8 -0
  132. package/IO/api/scopeWith.d.ts +8 -0
  133. package/IO/api/scoped.d.ts +14 -0
  134. package/IO/api/sequenceT.d.ts +10 -0
  135. package/IO/api/sleep.d.ts +6 -0
  136. package/IO/api/stateful.d.ts +10 -0
  137. package/IO/api/withChildren.d.ts +7 -0
  138. package/IO/api/withFinalizer.d.ts +8 -0
  139. package/IO/api/withFinalizerExit.d.ts +9 -0
  140. package/IO/api/withRuntimeConfig.d.ts +10 -0
  141. package/IO/api/zipC.d.ts +6 -0
  142. package/IO/api/zipWithC.d.ts +9 -0
  143. package/IO/api.d.ts +1130 -0
  144. package/IO/definition.d.ts +338 -0
  145. package/IO/runtime.d.ts +43 -0
  146. package/IO.d.ts +47 -0
  147. package/IOEnv/definition.d.ts +16 -0
  148. package/IOEnv/live.d.ts +6 -0
  149. package/IOEnv/services.d.ts +8 -0
  150. package/IOEnv.d.ts +3 -0
  151. package/IOSpec.d.ts +3 -0
  152. package/InterruptStatus/constructors.d.ts +16 -0
  153. package/InterruptStatus/definition.d.ts +12 -0
  154. package/InterruptStatus.d.ts +2 -0
  155. package/Layer/MemoMap.d.ts +43 -0
  156. package/Layer/api.d.ts +209 -0
  157. package/Layer/definition.d.ts +75 -0
  158. package/Layer.d.ts +3 -0
  159. package/LogLevel.d.ts +74 -0
  160. package/LogSpan.d.ts +14 -0
  161. package/Logger/api.d.ts +14 -0
  162. package/Logger/constructors.d.ts +10 -0
  163. package/Logger/definition.d.ts +18 -0
  164. package/Logger.d.ts +3 -0
  165. package/Queue/api/dimapIO.d.ts +41 -0
  166. package/Queue/api/filterInputIO.d.ts +32 -0
  167. package/Queue/api/filterOutputIO.d.ts +31 -0
  168. package/Queue/api/operations.d.ts +82 -0
  169. package/Queue/api/poll.d.ts +9 -0
  170. package/Queue/api/takeBetween.d.ts +11 -0
  171. package/Queue/api/zipWithIO.d.ts +44 -0
  172. package/Queue/api.d.ts +7 -0
  173. package/Queue/constructors.d.ts +22 -0
  174. package/Queue/definition.d.ts +129 -0
  175. package/Queue/internal.d.ts +12 -0
  176. package/Queue/strategy.d.ts +33 -0
  177. package/Queue.d.ts +5 -0
  178. package/Random/api.d.ts +42 -0
  179. package/Random/definition.d.ts +21 -0
  180. package/Random/live.d.ts +20 -0
  181. package/Random.d.ts +3 -0
  182. package/Ref/Atomic/Atomic.d.ts +18 -0
  183. package/Ref/Atomic/api.d.ts +53 -0
  184. package/Ref/Atomic.d.ts +2 -0
  185. package/Ref/Derived.d.ts +14 -0
  186. package/Ref/DerivedAll.d.ts +14 -0
  187. package/Ref/Synchronized/api.d.ts +100 -0
  188. package/Ref/Synchronized/constructors.d.ts +7 -0
  189. package/Ref/Synchronized/definition.d.ts +41 -0
  190. package/Ref/api/collect.d.ts +11 -0
  191. package/Ref/api/dimap.d.ts +56 -0
  192. package/Ref/api/filter.d.ts +20 -0
  193. package/Ref/api/get.d.ts +9 -0
  194. package/Ref/api/match.d.ts +13 -0
  195. package/Ref/api/matchAll.d.ts +11 -0
  196. package/Ref/api/modify.d.ts +79 -0
  197. package/Ref/api/set.d.ts +10 -0
  198. package/Ref/api.d.ts +23 -0
  199. package/Ref/constructors.d.ts +13 -0
  200. package/Ref/definition.d.ts +74 -0
  201. package/Ref.d.ts +9 -0
  202. package/RuntimeConfig.d.ts +34 -0
  203. package/STM/api/core-api.d.ts +35 -0
  204. package/STM/api/core-constructors.d.ts +45 -0
  205. package/STM/api.d.ts +379 -0
  206. package/STM/definition.d.ts +105 -0
  207. package/STM/driver.d.ts +15 -0
  208. package/STM/internal/CommitState.d.ts +47 -0
  209. package/STM/internal/Entry.d.ts +37 -0
  210. package/STM/internal/Journal.d.ts +101 -0
  211. package/STM/internal/TryCommit.d.ts +21 -0
  212. package/STM/internal/Versioned.d.ts +7 -0
  213. package/STM.d.ts +5 -0
  214. package/Schedule/Decision.d.ts +38 -0
  215. package/Schedule/Driver.d.ts +19 -0
  216. package/Schedule/Interval.d.ts +71 -0
  217. package/Schedule/api/driver.d.ts +7 -0
  218. package/Schedule/api.d.ts +359 -0
  219. package/Schedule/definition.d.ts +51 -0
  220. package/Schedule.d.ts +5 -0
  221. package/Scope/Finalizer/definition.d.ts +26 -0
  222. package/Scope/Finalizer.d.ts +1 -0
  223. package/Scope/ReleaseMap/api/releaseAll.d.ts +9 -0
  224. package/Scope/ReleaseMap/api.d.ts +30 -0
  225. package/Scope/ReleaseMap/constructors.d.ts +12 -0
  226. package/Scope/ReleaseMap/definition.d.ts +38 -0
  227. package/Scope/ReleaseMap.d.ts +3 -0
  228. package/Scope/api.d.ts +61 -0
  229. package/Scope/definition.d.ts +32 -0
  230. package/Scope.d.ts +2 -0
  231. package/ScopedRef/api.d.ts +9 -0
  232. package/ScopedRef/definition.d.ts +14 -0
  233. package/ScopedRef.d.ts +2 -0
  234. package/Sink/api.d.ts +35 -0
  235. package/Sink/definition.d.ts +15 -0
  236. package/Sink.d.ts +2 -0
  237. package/State/api.d.ts +25 -0
  238. package/State/definition.d.ts +14 -0
  239. package/State/internal.d.ts +10 -0
  240. package/State.d.ts +2 -0
  241. package/Stream/api/zipAllWith.d.ts +10 -0
  242. package/Stream/api/zipWith.d.ts +6 -0
  243. package/Stream/api/zipWithChunks.d.ts +11 -0
  244. package/Stream/api.d.ts +1087 -0
  245. package/Stream/definition.d.ts +38 -0
  246. package/Stream/internal/DebounceState.d.ts +61 -0
  247. package/Stream/internal/Handoff.d.ts +111 -0
  248. package/Stream/internal/Pull.d.ts +48 -0
  249. package/Stream/internal/SinkEndReason.d.ts +39 -0
  250. package/Stream/internal/Take.d.ts +128 -0
  251. package/Stream/internal/util.d.ts +3 -0
  252. package/Stream.d.ts +2 -0
  253. package/Supervisor/api.d.ts +10 -0
  254. package/Supervisor/constructors.d.ts +34 -0
  255. package/Supervisor/definition.d.ts +35 -0
  256. package/Supervisor.d.ts +3 -0
  257. package/TExit/constructors.d.ts +32 -0
  258. package/TExit/definition.d.ts +90 -0
  259. package/TExit.d.ts +2 -0
  260. package/TFuture/api.d.ts +29 -0
  261. package/TFuture/constructors.d.ts +16 -0
  262. package/TFuture/definition.d.ts +22 -0
  263. package/TFuture.d.ts +3 -0
  264. package/TRef/api.d.ts +85 -0
  265. package/TRef/constructors.d.ts +32 -0
  266. package/TRef/definition.d.ts +87 -0
  267. package/TRef.d.ts +3 -0
  268. package/TSemaphore/api.d.ts +38 -0
  269. package/TSemaphore/constructors.d.ts +13 -0
  270. package/TSemaphore/definition.d.ts +20 -0
  271. package/TSemaphore.d.ts +3 -0
  272. package/TxnId.d.ts +12 -0
  273. package/_cjs/Cached/api.cjs +85 -0
  274. package/_cjs/Cached/api.cjs.map +1 -0
  275. package/_cjs/Cached/definition.cjs +33 -0
  276. package/_cjs/Cached/definition.cjs.map +1 -0
  277. package/_cjs/Cached/internal.cjs +18 -0
  278. package/_cjs/Cached/internal.cjs.map +1 -0
  279. package/_cjs/Cached.cjs +45 -0
  280. package/_cjs/Cached.cjs.map +1 -0
  281. package/_cjs/CancellerState.cjs +64 -0
  282. package/_cjs/CancellerState.cjs.map +1 -0
  283. package/_cjs/Channel/ChildExecutorDecision/api.cjs +29 -0
  284. package/_cjs/Channel/ChildExecutorDecision/api.cjs.map +1 -0
  285. package/_cjs/Channel/ChildExecutorDecision/definition.cjs +39 -0
  286. package/_cjs/Channel/ChildExecutorDecision/definition.cjs.map +1 -0
  287. package/_cjs/Channel/ChildExecutorDecision.cjs +32 -0
  288. package/_cjs/Channel/ChildExecutorDecision.cjs.map +1 -0
  289. package/_cjs/Channel/UpstreamPullRequest/api.cjs +44 -0
  290. package/_cjs/Channel/UpstreamPullRequest/api.cjs.map +1 -0
  291. package/_cjs/Channel/UpstreamPullRequest/definition.cjs +29 -0
  292. package/_cjs/Channel/UpstreamPullRequest/definition.cjs.map +1 -0
  293. package/_cjs/Channel/UpstreamPullRequest.cjs +32 -0
  294. package/_cjs/Channel/UpstreamPullRequest.cjs.map +1 -0
  295. package/_cjs/Channel/UpstreamPullStrategy/definition.cjs +33 -0
  296. package/_cjs/Channel/UpstreamPullStrategy/definition.cjs.map +1 -0
  297. package/_cjs/Channel/UpstreamPullStrategy.cjs +19 -0
  298. package/_cjs/Channel/UpstreamPullStrategy.cjs.map +1 -0
  299. package/_cjs/Channel/api/interruptWhen.cjs +54 -0
  300. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -0
  301. package/_cjs/Channel/api/mapOutIOC.cjs +63 -0
  302. package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -0
  303. package/_cjs/Channel/api/mergeAll.cjs +20 -0
  304. package/_cjs/Channel/api/mergeAll.cjs.map +1 -0
  305. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +20 -0
  306. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -0
  307. package/_cjs/Channel/api/mergeAllWith.cjs +97 -0
  308. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -0
  309. package/_cjs/Channel/api/mergeMap.cjs +22 -0
  310. package/_cjs/Channel/api/mergeMap.cjs.map +1 -0
  311. package/_cjs/Channel/api/mergeWith.cjs +98 -0
  312. package/_cjs/Channel/api/mergeWith.cjs.map +1 -0
  313. package/_cjs/Channel/api/run.cjs +24 -0
  314. package/_cjs/Channel/api/run.cjs.map +1 -0
  315. package/_cjs/Channel/api/runCollect.cjs +22 -0
  316. package/_cjs/Channel/api/runCollect.cjs.map +1 -0
  317. package/_cjs/Channel/api/runDrain.cjs +24 -0
  318. package/_cjs/Channel/api/runDrain.cjs.map +1 -0
  319. package/_cjs/Channel/api/runScoped.cjs +70 -0
  320. package/_cjs/Channel/api/runScoped.cjs.map +1 -0
  321. package/_cjs/Channel/api/toPull.cjs +63 -0
  322. package/_cjs/Channel/api/toPull.cjs.map +1 -0
  323. package/_cjs/Channel/api/zipC.cjs +51 -0
  324. package/_cjs/Channel/api/zipC.cjs.map +1 -0
  325. package/_cjs/Channel/api.cjs +875 -0
  326. package/_cjs/Channel/api.cjs.map +1 -0
  327. package/_cjs/Channel/core-api.cjs +149 -0
  328. package/_cjs/Channel/core-api.cjs.map +1 -0
  329. package/_cjs/Channel/definition.cjs +262 -0
  330. package/_cjs/Channel/definition.cjs.map +1 -0
  331. package/_cjs/Channel/internal/AsyncInputConsumer.cjs +6 -0
  332. package/_cjs/Channel/internal/AsyncInputConsumer.cjs.map +1 -0
  333. package/_cjs/Channel/internal/AsyncInputProducer.cjs +6 -0
  334. package/_cjs/Channel/internal/AsyncInputProducer.cjs.map +1 -0
  335. package/_cjs/Channel/internal/ChannelExecutor.cjs +954 -0
  336. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -0
  337. package/_cjs/Channel/internal/ChannelState.cjs +100 -0
  338. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -0
  339. package/_cjs/Channel/internal/MergeDecision.cjs +85 -0
  340. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -0
  341. package/_cjs/Channel/internal/MergeState.cjs +73 -0
  342. package/_cjs/Channel/internal/MergeState.cjs.map +1 -0
  343. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +276 -0
  344. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -0
  345. package/_cjs/Channel.cjs +45 -0
  346. package/_cjs/Channel.cjs.map +1 -0
  347. package/_cjs/Clock/api.cjs +30 -0
  348. package/_cjs/Clock/api.cjs.map +1 -0
  349. package/_cjs/Clock/definition.cjs +27 -0
  350. package/_cjs/Clock/definition.cjs.map +1 -0
  351. package/_cjs/Clock/live.cjs +45 -0
  352. package/_cjs/Clock/live.cjs.map +1 -0
  353. package/_cjs/Clock.cjs +45 -0
  354. package/_cjs/Clock.cjs.map +1 -0
  355. package/_cjs/Console/api.cjs +29 -0
  356. package/_cjs/Console/api.cjs.map +1 -0
  357. package/_cjs/Console/definition.cjs +27 -0
  358. package/_cjs/Console/definition.cjs.map +1 -0
  359. package/_cjs/Console/live.cjs +40 -0
  360. package/_cjs/Console/live.cjs.map +1 -0
  361. package/_cjs/Console.cjs +45 -0
  362. package/_cjs/Console.cjs.map +1 -0
  363. package/_cjs/Fiber/FiberContext.cjs +1219 -0
  364. package/_cjs/Fiber/FiberContext.cjs.map +1 -0
  365. package/_cjs/Fiber/api/await.cjs +15 -0
  366. package/_cjs/Fiber/api/await.cjs.map +1 -0
  367. package/_cjs/Fiber/api/awaitAll.cjs +28 -0
  368. package/_cjs/Fiber/api/awaitAll.cjs.map +1 -0
  369. package/_cjs/Fiber/api/children.cjs +15 -0
  370. package/_cjs/Fiber/api/children.cjs.map +1 -0
  371. package/_cjs/Fiber/api/collectAll.cjs +61 -0
  372. package/_cjs/Fiber/api/collectAll.cjs.map +1 -0
  373. package/_cjs/Fiber/api/evalOn.cjs +28 -0
  374. package/_cjs/Fiber/api/evalOn.cjs.map +1 -0
  375. package/_cjs/Fiber/api/evalOnIO.cjs +33 -0
  376. package/_cjs/Fiber/api/evalOnIO.cjs.map +1 -0
  377. package/_cjs/Fiber/api/fromIO.cjs +26 -0
  378. package/_cjs/Fiber/api/fromIO.cjs.map +1 -0
  379. package/_cjs/Fiber/api/id.cjs +15 -0
  380. package/_cjs/Fiber/api/id.cjs.map +1 -0
  381. package/_cjs/Fiber/api/inheritRefs.cjs +15 -0
  382. package/_cjs/Fiber/api/inheritRefs.cjs.map +1 -0
  383. package/_cjs/Fiber/api/interrupt.cjs +27 -0
  384. package/_cjs/Fiber/api/interrupt.cjs.map +1 -0
  385. package/_cjs/Fiber/api/interruptAll.cjs +42 -0
  386. package/_cjs/Fiber/api/interruptAll.cjs.map +1 -0
  387. package/_cjs/Fiber/api/interruptAs.cjs +15 -0
  388. package/_cjs/Fiber/api/interruptAs.cjs.map +1 -0
  389. package/_cjs/Fiber/api/interruptFork.cjs +28 -0
  390. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -0
  391. package/_cjs/Fiber/api/join.cjs +29 -0
  392. package/_cjs/Fiber/api/join.cjs.map +1 -0
  393. package/_cjs/Fiber/api/joinAll.cjs +30 -0
  394. package/_cjs/Fiber/api/joinAll.cjs.map +1 -0
  395. package/_cjs/Fiber/api/location.cjs +21 -0
  396. package/_cjs/Fiber/api/location.cjs.map +1 -0
  397. package/_cjs/Fiber/api/mapFiber.cjs +31 -0
  398. package/_cjs/Fiber/api/mapFiber.cjs.map +1 -0
  399. package/_cjs/Fiber/api/mapIO.cjs +57 -0
  400. package/_cjs/Fiber/api/mapIO.cjs.map +1 -0
  401. package/_cjs/Fiber/api/poll.cjs +15 -0
  402. package/_cjs/Fiber/api/poll.cjs.map +1 -0
  403. package/_cjs/Fiber/api/zipWith.cjs +50 -0
  404. package/_cjs/Fiber/api/zipWith.cjs.map +1 -0
  405. package/_cjs/Fiber/constructors.cjs +70 -0
  406. package/_cjs/Fiber/constructors.cjs.map +1 -0
  407. package/_cjs/Fiber/definition.cjs +48 -0
  408. package/_cjs/Fiber/definition.cjs.map +1 -0
  409. package/_cjs/Fiber.cjs +305 -0
  410. package/_cjs/Fiber.cjs.map +1 -0
  411. package/_cjs/FiberDescriptor.cjs +26 -0
  412. package/_cjs/FiberDescriptor.cjs.map +1 -0
  413. package/_cjs/FiberRef/api/locallyScoped.cjs +26 -0
  414. package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -0
  415. package/_cjs/FiberRef/api/locallyScopedWith.cjs +24 -0
  416. package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -0
  417. package/_cjs/FiberRef/api.cjs +182 -0
  418. package/_cjs/FiberRef/api.cjs.map +1 -0
  419. package/_cjs/FiberRef/constructors.cjs +116 -0
  420. package/_cjs/FiberRef/constructors.cjs.map +1 -0
  421. package/_cjs/FiberRef/definition.cjs +76 -0
  422. package/_cjs/FiberRef/definition.cjs.map +1 -0
  423. package/_cjs/FiberRef.cjs +71 -0
  424. package/_cjs/FiberRef.cjs.map +1 -0
  425. package/_cjs/FiberRefs/api.cjs +31 -0
  426. package/_cjs/FiberRefs/api.cjs.map +1 -0
  427. package/_cjs/FiberRefs/definition.cjs +24 -0
  428. package/_cjs/FiberRefs/definition.cjs.map +1 -0
  429. package/_cjs/FiberRefs/join.cjs +110 -0
  430. package/_cjs/FiberRefs/join.cjs.map +1 -0
  431. package/_cjs/FiberRefs.cjs +45 -0
  432. package/_cjs/FiberRefs.cjs.map +1 -0
  433. package/_cjs/FiberScope/constructors.cjs +28 -0
  434. package/_cjs/FiberScope/constructors.cjs.map +1 -0
  435. package/_cjs/FiberScope/definition.cjs +60 -0
  436. package/_cjs/FiberScope/definition.cjs.map +1 -0
  437. package/_cjs/FiberScope.cjs +32 -0
  438. package/_cjs/FiberScope.cjs.map +1 -0
  439. package/_cjs/FiberState/api.cjs +26 -0
  440. package/_cjs/FiberState/api.cjs.map +1 -0
  441. package/_cjs/FiberState/constructors.cjs +44 -0
  442. package/_cjs/FiberState/constructors.cjs.map +1 -0
  443. package/_cjs/FiberState/definition.cjs +46 -0
  444. package/_cjs/FiberState/definition.cjs.map +1 -0
  445. package/_cjs/FiberState.cjs +45 -0
  446. package/_cjs/FiberState.cjs.map +1 -0
  447. package/_cjs/FiberStatus/constructors.cjs +42 -0
  448. package/_cjs/FiberStatus/constructors.cjs.map +1 -0
  449. package/_cjs/FiberStatus/definition.cjs +107 -0
  450. package/_cjs/FiberStatus/definition.cjs.map +1 -0
  451. package/_cjs/FiberStatus.cjs +32 -0
  452. package/_cjs/FiberStatus.cjs.map +1 -0
  453. package/_cjs/Future/api.cjs +292 -0
  454. package/_cjs/Future/api.cjs.map +1 -0
  455. package/_cjs/Future/constructors.cjs +55 -0
  456. package/_cjs/Future/constructors.cjs.map +1 -0
  457. package/_cjs/Future/definition.cjs +45 -0
  458. package/_cjs/Future/definition.cjs.map +1 -0
  459. package/_cjs/Future.cjs +45 -0
  460. package/_cjs/Future.cjs.map +1 -0
  461. package/_cjs/Hub/api.cjs +456 -0
  462. package/_cjs/Hub/api.cjs.map +1 -0
  463. package/_cjs/Hub/definition.cjs +28 -0
  464. package/_cjs/Hub/definition.cjs.map +1 -0
  465. package/_cjs/Hub/internal.cjs +449 -0
  466. package/_cjs/Hub/internal.cjs.map +1 -0
  467. package/_cjs/Hub.cjs +32 -0
  468. package/_cjs/Hub.cjs.map +1 -0
  469. package/_cjs/IO/api/acquireRelease.cjs +23 -0
  470. package/_cjs/IO/api/acquireRelease.cjs.map +1 -0
  471. package/_cjs/IO/api/acquireReleaseExit.cjs +25 -0
  472. package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -0
  473. package/_cjs/IO/api/acquireReleaseInterruptible.cjs +20 -0
  474. package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -0
  475. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +22 -0
  476. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -0
  477. package/_cjs/IO/api/addFinalizer.cjs +20 -0
  478. package/_cjs/IO/api/addFinalizer.cjs.map +1 -0
  479. package/_cjs/IO/api/addFinalizerExit.cjs +32 -0
  480. package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -0
  481. package/_cjs/IO/api/bracket.cjs +40 -0
  482. package/_cjs/IO/api/bracket.cjs.map +1 -0
  483. package/_cjs/IO/api/bracketExit.cjs +37 -0
  484. package/_cjs/IO/api/bracketExit.cjs.map +1 -0
  485. package/_cjs/IO/api/clockWith.cjs +40 -0
  486. package/_cjs/IO/api/clockWith.cjs.map +1 -0
  487. package/_cjs/IO/api/concurrency.cjs +72 -0
  488. package/_cjs/IO/api/concurrency.cjs.map +1 -0
  489. package/_cjs/IO/api/concurrentFinalizers.cjs +28 -0
  490. package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -0
  491. package/_cjs/IO/api/consoleWith.cjs +40 -0
  492. package/_cjs/IO/api/consoleWith.cjs.map +1 -0
  493. package/_cjs/IO/api/core-scope.cjs +168 -0
  494. package/_cjs/IO/api/core-scope.cjs.map +1 -0
  495. package/_cjs/IO/api/environment.cjs +153 -0
  496. package/_cjs/IO/api/environment.cjs.map +1 -0
  497. package/_cjs/IO/api/foreachC.cjs +152 -0
  498. package/_cjs/IO/api/foreachC.cjs.map +1 -0
  499. package/_cjs/IO/api/foreachExec.cjs +33 -0
  500. package/_cjs/IO/api/foreachExec.cjs.map +1 -0
  501. package/_cjs/IO/api/forkAll.cjs +25 -0
  502. package/_cjs/IO/api/forkAll.cjs.map +1 -0
  503. package/_cjs/IO/api/forkIn.cjs +33 -0
  504. package/_cjs/IO/api/forkIn.cjs.map +1 -0
  505. package/_cjs/IO/api/forkScoped.cjs +30 -0
  506. package/_cjs/IO/api/forkScoped.cjs.map +1 -0
  507. package/_cjs/IO/api/fulfill.cjs +32 -0
  508. package/_cjs/IO/api/fulfill.cjs.map +1 -0
  509. package/_cjs/IO/api/interrupt.cjs +204 -0
  510. package/_cjs/IO/api/interrupt.cjs.map +1 -0
  511. package/_cjs/IO/api/memoize.cjs +30 -0
  512. package/_cjs/IO/api/memoize.cjs.map +1 -0
  513. package/_cjs/IO/api/onExit.cjs +22 -0
  514. package/_cjs/IO/api/onExit.cjs.map +1 -0
  515. package/_cjs/IO/api/once.cjs +24 -0
  516. package/_cjs/IO/api/once.cjs.map +1 -0
  517. package/_cjs/IO/api/provideLayer.cjs +30 -0
  518. package/_cjs/IO/api/provideLayer.cjs.map +1 -0
  519. package/_cjs/IO/api/provideSomeLayer.cjs +37 -0
  520. package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -0
  521. package/_cjs/IO/api/race.cjs +47 -0
  522. package/_cjs/IO/api/race.cjs.map +1 -0
  523. package/_cjs/IO/api/raceFirst.cjs +35 -0
  524. package/_cjs/IO/api/raceFirst.cjs.map +1 -0
  525. package/_cjs/IO/api/randomWith.cjs +40 -0
  526. package/_cjs/IO/api/randomWith.cjs.map +1 -0
  527. package/_cjs/IO/api/repeat.cjs +59 -0
  528. package/_cjs/IO/api/repeat.cjs.map +1 -0
  529. package/_cjs/IO/api/retry.cjs +56 -0
  530. package/_cjs/IO/api/retry.cjs.map +1 -0
  531. package/_cjs/IO/api/schedule.cjs +43 -0
  532. package/_cjs/IO/api/schedule.cjs.map +1 -0
  533. package/_cjs/IO/api/scope.cjs +23 -0
  534. package/_cjs/IO/api/scope.cjs.map +1 -0
  535. package/_cjs/IO/api/scopeWith.cjs +24 -0
  536. package/_cjs/IO/api/scopeWith.cjs.map +1 -0
  537. package/_cjs/IO/api/scoped.cjs +36 -0
  538. package/_cjs/IO/api/scoped.cjs.map +1 -0
  539. package/_cjs/IO/api/sequenceT.cjs +24 -0
  540. package/_cjs/IO/api/sequenceT.cjs.map +1 -0
  541. package/_cjs/IO/api/sleep.cjs +20 -0
  542. package/_cjs/IO/api/sleep.cjs.map +1 -0
  543. package/_cjs/IO/api/stateful.cjs +24 -0
  544. package/_cjs/IO/api/stateful.cjs.map +1 -0
  545. package/_cjs/IO/api/withChildren.cjs +24 -0
  546. package/_cjs/IO/api/withChildren.cjs.map +1 -0
  547. package/_cjs/IO/api/withFinalizer.cjs +20 -0
  548. package/_cjs/IO/api/withFinalizer.cjs.map +1 -0
  549. package/_cjs/IO/api/withFinalizerExit.cjs +22 -0
  550. package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -0
  551. package/_cjs/IO/api/withRuntimeConfig.cjs +27 -0
  552. package/_cjs/IO/api/withRuntimeConfig.cjs.map +1 -0
  553. package/_cjs/IO/api/zipC.cjs +22 -0
  554. package/_cjs/IO/api/zipC.cjs.map +1 -0
  555. package/_cjs/IO/api/zipWithC.cjs +40 -0
  556. package/_cjs/IO/api/zipWithC.cjs.map +1 -0
  557. package/_cjs/IO/api.cjs +2142 -0
  558. package/_cjs/IO/api.cjs.map +1 -0
  559. package/_cjs/IO/definition.cjs +558 -0
  560. package/_cjs/IO/definition.cjs.map +1 -0
  561. package/_cjs/IO/runtime.cjs +144 -0
  562. package/_cjs/IO/runtime.cjs.map +1 -0
  563. package/_cjs/IO.cjs +617 -0
  564. package/_cjs/IO.cjs.map +1 -0
  565. package/_cjs/IOEnv/definition.cjs +34 -0
  566. package/_cjs/IOEnv/definition.cjs.map +1 -0
  567. package/_cjs/IOEnv/live.cjs +31 -0
  568. package/_cjs/IOEnv/live.cjs.map +1 -0
  569. package/_cjs/IOEnv/services.cjs +21 -0
  570. package/_cjs/IOEnv/services.cjs.map +1 -0
  571. package/_cjs/IOEnv.cjs +45 -0
  572. package/_cjs/IOEnv.cjs.map +1 -0
  573. package/_cjs/InterruptStatus/constructors.cjs +36 -0
  574. package/_cjs/InterruptStatus/constructors.cjs.map +1 -0
  575. package/_cjs/InterruptStatus/definition.cjs +30 -0
  576. package/_cjs/InterruptStatus/definition.cjs.map +1 -0
  577. package/_cjs/InterruptStatus.cjs +32 -0
  578. package/_cjs/InterruptStatus.cjs.map +1 -0
  579. package/_cjs/Layer/MemoMap.cjs +215 -0
  580. package/_cjs/Layer/MemoMap.cjs.map +1 -0
  581. package/_cjs/Layer/api.cjs +426 -0
  582. package/_cjs/Layer/api.cjs.map +1 -0
  583. package/_cjs/Layer/definition.cjs +137 -0
  584. package/_cjs/Layer/definition.cjs.map +1 -0
  585. package/_cjs/Layer.cjs +45 -0
  586. package/_cjs/Layer.cjs.map +1 -0
  587. package/_cjs/LogLevel.cjs +111 -0
  588. package/_cjs/LogLevel.cjs.map +1 -0
  589. package/_cjs/LogSpan.cjs +43 -0
  590. package/_cjs/LogSpan.cjs.map +1 -0
  591. package/_cjs/Logger/api.cjs +37 -0
  592. package/_cjs/Logger/api.cjs.map +1 -0
  593. package/_cjs/Logger/constructors.cjs +80 -0
  594. package/_cjs/Logger/constructors.cjs.map +1 -0
  595. package/_cjs/Logger/definition.cjs +20 -0
  596. package/_cjs/Logger/definition.cjs.map +1 -0
  597. package/_cjs/Logger.cjs +45 -0
  598. package/_cjs/Logger.cjs.map +1 -0
  599. package/_cjs/Queue/api/dimapIO.cjs +120 -0
  600. package/_cjs/Queue/api/dimapIO.cjs.map +1 -0
  601. package/_cjs/Queue/api/filterInputIO.cjs +84 -0
  602. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -0
  603. package/_cjs/Queue/api/filterOutputIO.cjs +89 -0
  604. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -0
  605. package/_cjs/Queue/api/operations.cjs +147 -0
  606. package/_cjs/Queue/api/operations.cjs.map +1 -0
  607. package/_cjs/Queue/api/poll.cjs +29 -0
  608. package/_cjs/Queue/api/poll.cjs.map +1 -0
  609. package/_cjs/Queue/api/takeBetween.cjs +59 -0
  610. package/_cjs/Queue/api/takeBetween.cjs.map +1 -0
  611. package/_cjs/Queue/api/zipWithIO.cjs +99 -0
  612. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -0
  613. package/_cjs/Queue/api.cjs +97 -0
  614. package/_cjs/Queue/api.cjs.map +1 -0
  615. package/_cjs/Queue/constructors.cjs +55 -0
  616. package/_cjs/Queue/constructors.cjs.map +1 -0
  617. package/_cjs/Queue/definition.cjs +29 -0
  618. package/_cjs/Queue/definition.cjs.map +1 -0
  619. package/_cjs/Queue/internal.cjs +255 -0
  620. package/_cjs/Queue/internal.cjs.map +1 -0
  621. package/_cjs/Queue/strategy.cjs +172 -0
  622. package/_cjs/Queue/strategy.cjs.map +1 -0
  623. package/_cjs/Queue.cjs +71 -0
  624. package/_cjs/Queue.cjs.map +1 -0
  625. package/_cjs/Random/api.cjs +76 -0
  626. package/_cjs/Random/api.cjs.map +1 -0
  627. package/_cjs/Random/definition.cjs +28 -0
  628. package/_cjs/Random/definition.cjs.map +1 -0
  629. package/_cjs/Random/live.cjs +57 -0
  630. package/_cjs/Random/live.cjs.map +1 -0
  631. package/_cjs/Random.cjs +45 -0
  632. package/_cjs/Random.cjs.map +1 -0
  633. package/_cjs/Ref/Atomic/Atomic.cjs +64 -0
  634. package/_cjs/Ref/Atomic/Atomic.cjs.map +1 -0
  635. package/_cjs/Ref/Atomic/api.cjs +154 -0
  636. package/_cjs/Ref/Atomic/api.cjs.map +1 -0
  637. package/_cjs/Ref/Atomic.cjs +32 -0
  638. package/_cjs/Ref/Atomic.cjs.map +1 -0
  639. package/_cjs/Ref/Derived.cjs +55 -0
  640. package/_cjs/Ref/Derived.cjs.map +1 -0
  641. package/_cjs/Ref/DerivedAll.cjs +55 -0
  642. package/_cjs/Ref/DerivedAll.cjs.map +1 -0
  643. package/_cjs/Ref/Synchronized/api.cjs +197 -0
  644. package/_cjs/Ref/Synchronized/api.cjs.map +1 -0
  645. package/_cjs/Ref/Synchronized/constructors.cjs +38 -0
  646. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -0
  647. package/_cjs/Ref/Synchronized/definition.cjs +88 -0
  648. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -0
  649. package/_cjs/Ref/api/collect.cjs +31 -0
  650. package/_cjs/Ref/api/collect.cjs.map +1 -0
  651. package/_cjs/Ref/api/dimap.cjs +110 -0
  652. package/_cjs/Ref/api/dimap.cjs.map +1 -0
  653. package/_cjs/Ref/api/filter.cjs +45 -0
  654. package/_cjs/Ref/api/filter.cjs.map +1 -0
  655. package/_cjs/Ref/api/get.cjs +20 -0
  656. package/_cjs/Ref/api/get.cjs.map +1 -0
  657. package/_cjs/Ref/api/match.cjs +26 -0
  658. package/_cjs/Ref/api/match.cjs.map +1 -0
  659. package/_cjs/Ref/api/matchAll.cjs +24 -0
  660. package/_cjs/Ref/api/matchAll.cjs.map +1 -0
  661. package/_cjs/Ref/api/modify.cjs +240 -0
  662. package/_cjs/Ref/api/modify.cjs.map +1 -0
  663. package/_cjs/Ref/api/set.cjs +21 -0
  664. package/_cjs/Ref/api/set.cjs.map +1 -0
  665. package/_cjs/Ref/api.cjs +158 -0
  666. package/_cjs/Ref/api.cjs.map +1 -0
  667. package/_cjs/Ref/constructors.cjs +35 -0
  668. package/_cjs/Ref/constructors.cjs.map +1 -0
  669. package/_cjs/Ref/definition.cjs +23 -0
  670. package/_cjs/Ref/definition.cjs.map +1 -0
  671. package/_cjs/Ref.cjs +123 -0
  672. package/_cjs/Ref.cjs.map +1 -0
  673. package/_cjs/RuntimeConfig.cjs +55 -0
  674. package/_cjs/RuntimeConfig.cjs.map +1 -0
  675. package/_cjs/STM/api/core-api.cjs +83 -0
  676. package/_cjs/STM/api/core-api.cjs.map +1 -0
  677. package/_cjs/STM/api/core-constructors.cjs +90 -0
  678. package/_cjs/STM/api/core-constructors.cjs.map +1 -0
  679. package/_cjs/STM/api.cjs +758 -0
  680. package/_cjs/STM/api.cjs.map +1 -0
  681. package/_cjs/STM/definition.cjs +213 -0
  682. package/_cjs/STM/definition.cjs.map +1 -0
  683. package/_cjs/STM/driver.cjs +184 -0
  684. package/_cjs/STM/driver.cjs.map +1 -0
  685. package/_cjs/STM/internal/CommitState.cjs +89 -0
  686. package/_cjs/STM/internal/CommitState.cjs.map +1 -0
  687. package/_cjs/STM/internal/Entry.cjs +89 -0
  688. package/_cjs/STM/internal/Entry.cjs.map +1 -0
  689. package/_cjs/STM/internal/Journal.cjs +414 -0
  690. package/_cjs/STM/internal/Journal.cjs.map +1 -0
  691. package/_cjs/STM/internal/TryCommit.cjs +35 -0
  692. package/_cjs/STM/internal/TryCommit.cjs.map +1 -0
  693. package/_cjs/STM/internal/Versioned.cjs +19 -0
  694. package/_cjs/STM/internal/Versioned.cjs.map +1 -0
  695. package/_cjs/STM.cjs +71 -0
  696. package/_cjs/STM.cjs.map +1 -0
  697. package/_cjs/Schedule/Decision.cjs +67 -0
  698. package/_cjs/Schedule/Decision.cjs.map +1 -0
  699. package/_cjs/Schedule/Driver.cjs +32 -0
  700. package/_cjs/Schedule/Driver.cjs.map +1 -0
  701. package/_cjs/Schedule/Interval.cjs +154 -0
  702. package/_cjs/Schedule/Interval.cjs.map +1 -0
  703. package/_cjs/Schedule/api/driver.cjs +50 -0
  704. package/_cjs/Schedule/api/driver.cjs.map +1 -0
  705. package/_cjs/Schedule/api.cjs +790 -0
  706. package/_cjs/Schedule/api.cjs.map +1 -0
  707. package/_cjs/Schedule/definition.cjs +41 -0
  708. package/_cjs/Schedule/definition.cjs.map +1 -0
  709. package/_cjs/Schedule.cjs +71 -0
  710. package/_cjs/Schedule.cjs.map +1 -0
  711. package/_cjs/Scope/Finalizer/definition.cjs +24 -0
  712. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -0
  713. package/_cjs/Scope/Finalizer.cjs +19 -0
  714. package/_cjs/Scope/Finalizer.cjs.map +1 -0
  715. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +46 -0
  716. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -0
  717. package/_cjs/Scope/ReleaseMap/api.cjs +110 -0
  718. package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -0
  719. package/_cjs/Scope/ReleaseMap/constructors.cjs +39 -0
  720. package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -0
  721. package/_cjs/Scope/ReleaseMap/definition.cjs +39 -0
  722. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -0
  723. package/_cjs/Scope/ReleaseMap.cjs +45 -0
  724. package/_cjs/Scope/ReleaseMap.cjs.map +1 -0
  725. package/_cjs/Scope/api.cjs +178 -0
  726. package/_cjs/Scope/api.cjs.map +1 -0
  727. package/_cjs/Scope/definition.cjs +45 -0
  728. package/_cjs/Scope/definition.cjs.map +1 -0
  729. package/_cjs/Scope.cjs +32 -0
  730. package/_cjs/Scope.cjs.map +1 -0
  731. package/_cjs/ScopedRef/api.cjs +73 -0
  732. package/_cjs/ScopedRef/api.cjs.map +1 -0
  733. package/_cjs/ScopedRef/definition.cjs +23 -0
  734. package/_cjs/ScopedRef/definition.cjs.map +1 -0
  735. package/_cjs/ScopedRef.cjs +32 -0
  736. package/_cjs/ScopedRef.cjs.map +1 -0
  737. package/_cjs/Sink/api.cjs +102 -0
  738. package/_cjs/Sink/api.cjs.map +1 -0
  739. package/_cjs/Sink/definition.cjs +25 -0
  740. package/_cjs/Sink/definition.cjs.map +1 -0
  741. package/_cjs/Sink.cjs +32 -0
  742. package/_cjs/Sink.cjs.map +1 -0
  743. package/_cjs/State/api.cjs +76 -0
  744. package/_cjs/State/api.cjs.map +1 -0
  745. package/_cjs/State/definition.cjs +30 -0
  746. package/_cjs/State/definition.cjs.map +1 -0
  747. package/_cjs/State/internal.cjs +18 -0
  748. package/_cjs/State/internal.cjs.map +1 -0
  749. package/_cjs/State.cjs +32 -0
  750. package/_cjs/State.cjs.map +1 -0
  751. package/_cjs/Stream/api/zipAllWith.cjs +127 -0
  752. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -0
  753. package/_cjs/Stream/api/zipWith.cjs +22 -0
  754. package/_cjs/Stream/api/zipWith.cjs.map +1 -0
  755. package/_cjs/Stream/api/zipWithChunks.cjs +100 -0
  756. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -0
  757. package/_cjs/Stream/api.cjs +2517 -0
  758. package/_cjs/Stream/api.cjs.map +1 -0
  759. package/_cjs/Stream/definition.cjs +55 -0
  760. package/_cjs/Stream/definition.cjs.map +1 -0
  761. package/_cjs/Stream/internal/DebounceState.cjs +99 -0
  762. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -0
  763. package/_cjs/Stream/internal/Handoff.cjs +222 -0
  764. package/_cjs/Stream/internal/Handoff.cjs.map +1 -0
  765. package/_cjs/Stream/internal/Pull.cjs +89 -0
  766. package/_cjs/Stream/internal/Pull.cjs.map +1 -0
  767. package/_cjs/Stream/internal/SinkEndReason.cjs +87 -0
  768. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -0
  769. package/_cjs/Stream/internal/Take.cjs +249 -0
  770. package/_cjs/Stream/internal/Take.cjs.map +1 -0
  771. package/_cjs/Stream/internal/util.cjs +34 -0
  772. package/_cjs/Stream/internal/util.cjs.map +1 -0
  773. package/_cjs/Stream.cjs +32 -0
  774. package/_cjs/Stream.cjs.map +1 -0
  775. package/_cjs/Supervisor/api.cjs +56 -0
  776. package/_cjs/Supervisor/api.cjs.map +1 -0
  777. package/_cjs/Supervisor/constructors.cjs +92 -0
  778. package/_cjs/Supervisor/constructors.cjs.map +1 -0
  779. package/_cjs/Supervisor/definition.cjs +89 -0
  780. package/_cjs/Supervisor/definition.cjs.map +1 -0
  781. package/_cjs/Supervisor.cjs +45 -0
  782. package/_cjs/Supervisor.cjs.map +1 -0
  783. package/_cjs/TExit/constructors.cjs +59 -0
  784. package/_cjs/TExit/constructors.cjs.map +1 -0
  785. package/_cjs/TExit/definition.cjs +214 -0
  786. package/_cjs/TExit/definition.cjs.map +1 -0
  787. package/_cjs/TExit.cjs +32 -0
  788. package/_cjs/TExit.cjs.map +1 -0
  789. package/_cjs/TFuture/api.cjs +76 -0
  790. package/_cjs/TFuture/api.cjs.map +1 -0
  791. package/_cjs/TFuture/constructors.cjs +42 -0
  792. package/_cjs/TFuture/constructors.cjs.map +1 -0
  793. package/_cjs/TFuture/definition.cjs +16 -0
  794. package/_cjs/TFuture/definition.cjs.map +1 -0
  795. package/_cjs/TFuture.cjs +45 -0
  796. package/_cjs/TFuture.cjs.map +1 -0
  797. package/_cjs/TRef/api.cjs +372 -0
  798. package/_cjs/TRef/api.cjs.map +1 -0
  799. package/_cjs/TRef/constructors.cjs +98 -0
  800. package/_cjs/TRef/constructors.cjs.map +1 -0
  801. package/_cjs/TRef/definition.cjs +101 -0
  802. package/_cjs/TRef/definition.cjs.map +1 -0
  803. package/_cjs/TRef.cjs +45 -0
  804. package/_cjs/TRef.cjs.map +1 -0
  805. package/_cjs/TSemaphore/api.cjs +104 -0
  806. package/_cjs/TSemaphore/api.cjs.map +1 -0
  807. package/_cjs/TSemaphore/constructors.cjs +34 -0
  808. package/_cjs/TSemaphore/constructors.cjs.map +1 -0
  809. package/_cjs/TSemaphore/definition.cjs +16 -0
  810. package/_cjs/TSemaphore/definition.cjs.map +1 -0
  811. package/_cjs/TSemaphore.cjs +45 -0
  812. package/_cjs/TSemaphore.cjs.map +1 -0
  813. package/_cjs/TxnId.cjs +21 -0
  814. package/_cjs/TxnId.cjs.map +1 -0
  815. package/_cjs/collection/immutable/Conc/findIO.cjs +54 -0
  816. package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -0
  817. package/_cjs/collection/immutable/Conc/mapIO.cjs +29 -0
  818. package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -0
  819. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +53 -0
  820. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -0
  821. package/_cjs/collection/immutable/Conc.cjs +45 -0
  822. package/_cjs/collection/immutable/Conc.cjs.map +1 -0
  823. package/_cjs/data/Exit/foreachIO.cjs +29 -0
  824. package/_cjs/data/Exit/foreachIO.cjs.map +1 -0
  825. package/_cjs/internal/HashedPair.cjs +37 -0
  826. package/_cjs/internal/HashedPair.cjs.map +1 -0
  827. package/_cjs/internal/Hub.cjs +758 -0
  828. package/_cjs/internal/Hub.cjs.map +1 -0
  829. package/_cjs/internal/MutableQueue.cjs +315 -0
  830. package/_cjs/internal/MutableQueue.cjs.map +1 -0
  831. package/_cjs/internal/Scheduler.cjs +33 -0
  832. package/_cjs/internal/Scheduler.cjs.map +1 -0
  833. package/_cjs/internal/StackTraceBuilder.cjs +36 -0
  834. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -0
  835. package/_mjs/Cached/api.mjs +57 -0
  836. package/_mjs/Cached/api.mjs.map +1 -0
  837. package/_mjs/Cached/definition.mjs +22 -0
  838. package/_mjs/Cached/definition.mjs.map +1 -0
  839. package/_mjs/Cached/internal.mjs +8 -0
  840. package/_mjs/Cached/internal.mjs.map +1 -0
  841. package/_mjs/Cached.mjs +5 -0
  842. package/_mjs/Cached.mjs.map +1 -0
  843. package/_mjs/CancellerState.mjs +44 -0
  844. package/_mjs/CancellerState.mjs.map +1 -0
  845. package/_mjs/Channel/ChildExecutorDecision/api.mjs +22 -0
  846. package/_mjs/Channel/ChildExecutorDecision/api.mjs.map +1 -0
  847. package/_mjs/Channel/ChildExecutorDecision/definition.mjs +25 -0
  848. package/_mjs/Channel/ChildExecutorDecision/definition.mjs.map +1 -0
  849. package/_mjs/Channel/ChildExecutorDecision.mjs +4 -0
  850. package/_mjs/Channel/ChildExecutorDecision.mjs.map +1 -0
  851. package/_mjs/Channel/UpstreamPullRequest/api.mjs +34 -0
  852. package/_mjs/Channel/UpstreamPullRequest/api.mjs.map +1 -0
  853. package/_mjs/Channel/UpstreamPullRequest/definition.mjs +16 -0
  854. package/_mjs/Channel/UpstreamPullRequest/definition.mjs.map +1 -0
  855. package/_mjs/Channel/UpstreamPullRequest.mjs +4 -0
  856. package/_mjs/Channel/UpstreamPullRequest.mjs.map +1 -0
  857. package/_mjs/Channel/UpstreamPullStrategy/definition.mjs +21 -0
  858. package/_mjs/Channel/UpstreamPullStrategy/definition.mjs.map +1 -0
  859. package/_mjs/Channel/UpstreamPullStrategy.mjs +3 -0
  860. package/_mjs/Channel/UpstreamPullStrategy.mjs.map +1 -0
  861. package/_mjs/Channel/api/interruptWhen.mjs +35 -0
  862. package/_mjs/Channel/api/interruptWhen.mjs.map +1 -0
  863. package/_mjs/Channel/api/mapOutIOC.mjs +32 -0
  864. package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -0
  865. package/_mjs/Channel/api/mergeAll.mjs +9 -0
  866. package/_mjs/Channel/api/mergeAll.mjs.map +1 -0
  867. package/_mjs/Channel/api/mergeAllUnboundedWith.mjs +9 -0
  868. package/_mjs/Channel/api/mergeAllUnboundedWith.mjs.map +1 -0
  869. package/_mjs/Channel/api/mergeAllWith.mjs +58 -0
  870. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -0
  871. package/_mjs/Channel/api/mergeMap.mjs +10 -0
  872. package/_mjs/Channel/api/mergeMap.mjs.map +1 -0
  873. package/_mjs/Channel/api/mergeWith.mjs +74 -0
  874. package/_mjs/Channel/api/mergeWith.mjs.map +1 -0
  875. package/_mjs/Channel/api/run.mjs +12 -0
  876. package/_mjs/Channel/api/run.mjs.map +1 -0
  877. package/_mjs/Channel/api/runCollect.mjs +10 -0
  878. package/_mjs/Channel/api/runCollect.mjs.map +1 -0
  879. package/_mjs/Channel/api/runDrain.mjs +12 -0
  880. package/_mjs/Channel/api/runDrain.mjs.map +1 -0
  881. package/_mjs/Channel/api/runScoped.mjs +55 -0
  882. package/_mjs/Channel/api/runScoped.mjs.map +1 -0
  883. package/_mjs/Channel/api/toPull.mjs +46 -0
  884. package/_mjs/Channel/api/toPull.mjs.map +1 -0
  885. package/_mjs/Channel/api/zipC.mjs +30 -0
  886. package/_mjs/Channel/api/zipC.mjs.map +1 -0
  887. package/_mjs/Channel/api.mjs +727 -0
  888. package/_mjs/Channel/api.mjs.map +1 -0
  889. package/_mjs/Channel/core-api.mjs +123 -0
  890. package/_mjs/Channel/core-api.mjs.map +1 -0
  891. package/_mjs/Channel/definition.mjs +195 -0
  892. package/_mjs/Channel/definition.mjs.map +1 -0
  893. package/_mjs/Channel/internal/AsyncInputConsumer.mjs +2 -0
  894. package/_mjs/Channel/internal/AsyncInputConsumer.mjs.map +1 -0
  895. package/_mjs/Channel/internal/AsyncInputProducer.mjs +2 -0
  896. package/_mjs/Channel/internal/AsyncInputProducer.mjs.map +1 -0
  897. package/_mjs/Channel/internal/ChannelExecutor.mjs +913 -0
  898. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -0
  899. package/_mjs/Channel/internal/ChannelState.mjs +67 -0
  900. package/_mjs/Channel/internal/ChannelState.mjs.map +1 -0
  901. package/_mjs/Channel/internal/MergeDecision.mjs +61 -0
  902. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -0
  903. package/_mjs/Channel/internal/MergeState.mjs +51 -0
  904. package/_mjs/Channel/internal/MergeState.mjs.map +1 -0
  905. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +234 -0
  906. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -0
  907. package/_mjs/Channel.mjs +5 -0
  908. package/_mjs/Channel.mjs.map +1 -0
  909. package/_mjs/Clock/api.mjs +15 -0
  910. package/_mjs/Clock/api.mjs.map +1 -0
  911. package/_mjs/Clock/definition.mjs +13 -0
  912. package/_mjs/Clock/definition.mjs.map +1 -0
  913. package/_mjs/Clock/live.mjs +30 -0
  914. package/_mjs/Clock/live.mjs.map +1 -0
  915. package/_mjs/Clock.mjs +5 -0
  916. package/_mjs/Clock.mjs.map +1 -0
  917. package/_mjs/Console/api.mjs +16 -0
  918. package/_mjs/Console/api.mjs.map +1 -0
  919. package/_mjs/Console/definition.mjs +13 -0
  920. package/_mjs/Console/definition.mjs.map +1 -0
  921. package/_mjs/Console/live.mjs +23 -0
  922. package/_mjs/Console/live.mjs.map +1 -0
  923. package/_mjs/Console.mjs +5 -0
  924. package/_mjs/Console.mjs.map +1 -0
  925. package/_mjs/Fiber/FiberContext.mjs +1141 -0
  926. package/_mjs/Fiber/FiberContext.mjs.map +1 -0
  927. package/_mjs/Fiber/api/await.mjs +8 -0
  928. package/_mjs/Fiber/api/await.mjs.map +1 -0
  929. package/_mjs/Fiber/api/awaitAll.mjs +14 -0
  930. package/_mjs/Fiber/api/awaitAll.mjs.map +1 -0
  931. package/_mjs/Fiber/api/children.mjs +8 -0
  932. package/_mjs/Fiber/api/children.mjs.map +1 -0
  933. package/_mjs/Fiber/api/collectAll.mjs +31 -0
  934. package/_mjs/Fiber/api/collectAll.mjs.map +1 -0
  935. package/_mjs/Fiber/api/evalOn.mjs +17 -0
  936. package/_mjs/Fiber/api/evalOn.mjs.map +1 -0
  937. package/_mjs/Fiber/api/evalOnIO.mjs +17 -0
  938. package/_mjs/Fiber/api/evalOnIO.mjs.map +1 -0
  939. package/_mjs/Fiber/api/fromIO.mjs +13 -0
  940. package/_mjs/Fiber/api/fromIO.mjs.map +1 -0
  941. package/_mjs/Fiber/api/id.mjs +8 -0
  942. package/_mjs/Fiber/api/id.mjs.map +1 -0
  943. package/_mjs/Fiber/api/inheritRefs.mjs +8 -0
  944. package/_mjs/Fiber/api/inheritRefs.mjs.map +1 -0
  945. package/_mjs/Fiber/api/interrupt.mjs +15 -0
  946. package/_mjs/Fiber/api/interrupt.mjs.map +1 -0
  947. package/_mjs/Fiber/api/interruptAll.mjs +25 -0
  948. package/_mjs/Fiber/api/interruptAll.mjs.map +1 -0
  949. package/_mjs/Fiber/api/interruptAs.mjs +8 -0
  950. package/_mjs/Fiber/api/interruptAs.mjs.map +1 -0
  951. package/_mjs/Fiber/api/interruptFork.mjs +15 -0
  952. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -0
  953. package/_mjs/Fiber/api/join.mjs +17 -0
  954. package/_mjs/Fiber/api/join.mjs.map +1 -0
  955. package/_mjs/Fiber/api/joinAll.mjs +16 -0
  956. package/_mjs/Fiber/api/joinAll.mjs.map +1 -0
  957. package/_mjs/Fiber/api/location.mjs +10 -0
  958. package/_mjs/Fiber/api/location.mjs.map +1 -0
  959. package/_mjs/Fiber/api/mapFiber.mjs +16 -0
  960. package/_mjs/Fiber/api/mapFiber.mjs.map +1 -0
  961. package/_mjs/Fiber/api/mapIO.mjs +33 -0
  962. package/_mjs/Fiber/api/mapIO.mjs.map +1 -0
  963. package/_mjs/Fiber/api/poll.mjs +8 -0
  964. package/_mjs/Fiber/api/poll.mjs.map +1 -0
  965. package/_mjs/Fiber/api/zipWith.mjs +26 -0
  966. package/_mjs/Fiber/api/zipWith.mjs.map +1 -0
  967. package/_mjs/Fiber/constructors.mjs +45 -0
  968. package/_mjs/Fiber/constructors.mjs.map +1 -0
  969. package/_mjs/Fiber/definition.mjs +27 -0
  970. package/_mjs/Fiber/definition.mjs.map +1 -0
  971. package/_mjs/Fiber.mjs +27 -0
  972. package/_mjs/Fiber.mjs.map +1 -0
  973. package/_mjs/FiberDescriptor.mjs +17 -0
  974. package/_mjs/FiberDescriptor.mjs.map +1 -0
  975. package/_mjs/FiberRef/api/locallyScoped.mjs +12 -0
  976. package/_mjs/FiberRef/api/locallyScoped.mjs.map +1 -0
  977. package/_mjs/FiberRef/api/locallyScopedWith.mjs +11 -0
  978. package/_mjs/FiberRef/api/locallyScopedWith.mjs.map +1 -0
  979. package/_mjs/FiberRef/api.mjs +139 -0
  980. package/_mjs/FiberRef/api.mjs.map +1 -0
  981. package/_mjs/FiberRef/constructors.mjs +82 -0
  982. package/_mjs/FiberRef/constructors.mjs.map +1 -0
  983. package/_mjs/FiberRef/definition.mjs +50 -0
  984. package/_mjs/FiberRef/definition.mjs.map +1 -0
  985. package/_mjs/FiberRef.mjs +9 -0
  986. package/_mjs/FiberRef.mjs.map +1 -0
  987. package/_mjs/FiberRefs/api.mjs +17 -0
  988. package/_mjs/FiberRefs/api.mjs.map +1 -0
  989. package/_mjs/FiberRefs/definition.mjs +14 -0
  990. package/_mjs/FiberRefs/definition.mjs.map +1 -0
  991. package/_mjs/FiberRefs/join.mjs +90 -0
  992. package/_mjs/FiberRefs/join.mjs.map +1 -0
  993. package/_mjs/FiberRefs.mjs +5 -0
  994. package/_mjs/FiberRefs.mjs.map +1 -0
  995. package/_mjs/FiberScope/constructors.mjs +18 -0
  996. package/_mjs/FiberScope/constructors.mjs.map +1 -0
  997. package/_mjs/FiberScope/definition.mjs +41 -0
  998. package/_mjs/FiberScope/definition.mjs.map +1 -0
  999. package/_mjs/FiberScope.mjs +4 -0
  1000. package/_mjs/FiberScope.mjs.map +1 -0
  1001. package/_mjs/FiberState/api.mjs +15 -0
  1002. package/_mjs/FiberState/api.mjs.map +1 -0
  1003. package/_mjs/FiberState/constructors.mjs +26 -0
  1004. package/_mjs/FiberState/constructors.mjs.map +1 -0
  1005. package/_mjs/FiberState/definition.mjs +26 -0
  1006. package/_mjs/FiberState/definition.mjs.map +1 -0
  1007. package/_mjs/FiberState.mjs +5 -0
  1008. package/_mjs/FiberState.mjs.map +1 -0
  1009. package/_mjs/FiberStatus/constructors.mjs +28 -0
  1010. package/_mjs/FiberStatus/constructors.mjs.map +1 -0
  1011. package/_mjs/FiberStatus/definition.mjs +88 -0
  1012. package/_mjs/FiberStatus/definition.mjs.map +1 -0
  1013. package/_mjs/FiberStatus.mjs +4 -0
  1014. package/_mjs/FiberStatus.mjs.map +1 -0
  1015. package/_mjs/Future/api.mjs +249 -0
  1016. package/_mjs/Future/api.mjs.map +1 -0
  1017. package/_mjs/Future/constructors.mjs +36 -0
  1018. package/_mjs/Future/constructors.mjs.map +1 -0
  1019. package/_mjs/Future/definition.mjs +30 -0
  1020. package/_mjs/Future/definition.mjs.map +1 -0
  1021. package/_mjs/Future.mjs +5 -0
  1022. package/_mjs/Future.mjs.map +1 -0
  1023. package/_mjs/Hub/api.mjs +384 -0
  1024. package/_mjs/Hub/api.mjs.map +1 -0
  1025. package/_mjs/Hub/definition.mjs +15 -0
  1026. package/_mjs/Hub/definition.mjs.map +1 -0
  1027. package/_mjs/Hub/internal.mjs +400 -0
  1028. package/_mjs/Hub/internal.mjs.map +1 -0
  1029. package/_mjs/Hub.mjs +4 -0
  1030. package/_mjs/Hub.mjs.map +1 -0
  1031. package/_mjs/IO/api/acquireRelease.mjs +11 -0
  1032. package/_mjs/IO/api/acquireRelease.mjs.map +1 -0
  1033. package/_mjs/IO/api/acquireReleaseExit.mjs +12 -0
  1034. package/_mjs/IO/api/acquireReleaseExit.mjs.map +1 -0
  1035. package/_mjs/IO/api/acquireReleaseInterruptible.mjs +9 -0
  1036. package/_mjs/IO/api/acquireReleaseInterruptible.mjs.map +1 -0
  1037. package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs +10 -0
  1038. package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs.map +1 -0
  1039. package/_mjs/IO/api/addFinalizer.mjs +9 -0
  1040. package/_mjs/IO/api/addFinalizer.mjs.map +1 -0
  1041. package/_mjs/IO/api/addFinalizerExit.mjs +17 -0
  1042. package/_mjs/IO/api/addFinalizerExit.mjs.map +1 -0
  1043. package/_mjs/IO/api/bracket.mjs +29 -0
  1044. package/_mjs/IO/api/bracket.mjs.map +1 -0
  1045. package/_mjs/IO/api/bracketExit.mjs +22 -0
  1046. package/_mjs/IO/api/bracketExit.mjs.map +1 -0
  1047. package/_mjs/IO/api/clockWith.mjs +21 -0
  1048. package/_mjs/IO/api/clockWith.mjs.map +1 -0
  1049. package/_mjs/IO/api/concurrency.mjs +49 -0
  1050. package/_mjs/IO/api/concurrency.mjs.map +1 -0
  1051. package/_mjs/IO/api/concurrentFinalizers.mjs +13 -0
  1052. package/_mjs/IO/api/concurrentFinalizers.mjs.map +1 -0
  1053. package/_mjs/IO/api/consoleWith.mjs +21 -0
  1054. package/_mjs/IO/api/consoleWith.mjs.map +1 -0
  1055. package/_mjs/IO/api/core-scope.mjs +130 -0
  1056. package/_mjs/IO/api/core-scope.mjs.map +1 -0
  1057. package/_mjs/IO/api/environment.mjs +116 -0
  1058. package/_mjs/IO/api/environment.mjs.map +1 -0
  1059. package/_mjs/IO/api/foreachC.mjs +119 -0
  1060. package/_mjs/IO/api/foreachC.mjs.map +1 -0
  1061. package/_mjs/IO/api/foreachExec.mjs +18 -0
  1062. package/_mjs/IO/api/foreachExec.mjs.map +1 -0
  1063. package/_mjs/IO/api/forkAll.mjs +13 -0
  1064. package/_mjs/IO/api/forkAll.mjs.map +1 -0
  1065. package/_mjs/IO/api/forkIn.mjs +18 -0
  1066. package/_mjs/IO/api/forkIn.mjs.map +1 -0
  1067. package/_mjs/IO/api/forkScoped.mjs +15 -0
  1068. package/_mjs/IO/api/forkScoped.mjs.map +1 -0
  1069. package/_mjs/IO/api/fulfill.mjs +18 -0
  1070. package/_mjs/IO/api/fulfill.mjs.map +1 -0
  1071. package/_mjs/IO/api/interrupt.mjs +171 -0
  1072. package/_mjs/IO/api/interrupt.mjs.map +1 -0
  1073. package/_mjs/IO/api/memoize.mjs +16 -0
  1074. package/_mjs/IO/api/memoize.mjs.map +1 -0
  1075. package/_mjs/IO/api/onExit.mjs +10 -0
  1076. package/_mjs/IO/api/onExit.mjs.map +1 -0
  1077. package/_mjs/IO/api/once.mjs +11 -0
  1078. package/_mjs/IO/api/once.mjs.map +1 -0
  1079. package/_mjs/IO/api/provideLayer.mjs +14 -0
  1080. package/_mjs/IO/api/provideLayer.mjs.map +1 -0
  1081. package/_mjs/IO/api/provideSomeLayer.mjs +21 -0
  1082. package/_mjs/IO/api/provideSomeLayer.mjs.map +1 -0
  1083. package/_mjs/IO/api/race.mjs +29 -0
  1084. package/_mjs/IO/api/race.mjs.map +1 -0
  1085. package/_mjs/IO/api/raceFirst.mjs +22 -0
  1086. package/_mjs/IO/api/raceFirst.mjs.map +1 -0
  1087. package/_mjs/IO/api/randomWith.mjs +21 -0
  1088. package/_mjs/IO/api/randomWith.mjs.map +1 -0
  1089. package/_mjs/IO/api/repeat.mjs +38 -0
  1090. package/_mjs/IO/api/repeat.mjs.map +1 -0
  1091. package/_mjs/IO/api/retry.mjs +36 -0
  1092. package/_mjs/IO/api/retry.mjs.map +1 -0
  1093. package/_mjs/IO/api/schedule.mjs +27 -0
  1094. package/_mjs/IO/api/schedule.mjs.map +1 -0
  1095. package/_mjs/IO/api/scope.mjs +9 -0
  1096. package/_mjs/IO/api/scope.mjs.map +1 -0
  1097. package/_mjs/IO/api/scopeWith.mjs +11 -0
  1098. package/_mjs/IO/api/scopeWith.mjs.map +1 -0
  1099. package/_mjs/IO/api/scoped.mjs +20 -0
  1100. package/_mjs/IO/api/scoped.mjs.map +1 -0
  1101. package/_mjs/IO/api/sequenceT.mjs +11 -0
  1102. package/_mjs/IO/api/sequenceT.mjs.map +1 -0
  1103. package/_mjs/IO/api/sleep.mjs +9 -0
  1104. package/_mjs/IO/api/sleep.mjs.map +1 -0
  1105. package/_mjs/IO/api/stateful.mjs +11 -0
  1106. package/_mjs/IO/api/stateful.mjs.map +1 -0
  1107. package/_mjs/IO/api/withChildren.mjs +11 -0
  1108. package/_mjs/IO/api/withChildren.mjs.map +1 -0
  1109. package/_mjs/IO/api/withFinalizer.mjs +9 -0
  1110. package/_mjs/IO/api/withFinalizer.mjs.map +1 -0
  1111. package/_mjs/IO/api/withFinalizerExit.mjs +10 -0
  1112. package/_mjs/IO/api/withFinalizerExit.mjs.map +1 -0
  1113. package/_mjs/IO/api/withRuntimeConfig.mjs +14 -0
  1114. package/_mjs/IO/api/withRuntimeConfig.mjs.map +1 -0
  1115. package/_mjs/IO/api/zipC.mjs +10 -0
  1116. package/_mjs/IO/api/zipC.mjs.map +1 -0
  1117. package/_mjs/IO/api/zipWithC.mjs +23 -0
  1118. package/_mjs/IO/api/zipWithC.mjs.map +1 -0
  1119. package/_mjs/IO/api.mjs +1804 -0
  1120. package/_mjs/IO/api.mjs.map +1 -0
  1121. package/_mjs/IO/definition.mjs +444 -0
  1122. package/_mjs/IO/definition.mjs.map +1 -0
  1123. package/_mjs/IO/runtime.mjs +97 -0
  1124. package/_mjs/IO/runtime.mjs.map +1 -0
  1125. package/_mjs/IO.mjs +51 -0
  1126. package/_mjs/IO.mjs.map +1 -0
  1127. package/_mjs/IOEnv/definition.mjs +14 -0
  1128. package/_mjs/IOEnv/definition.mjs.map +1 -0
  1129. package/_mjs/IOEnv/live.mjs +13 -0
  1130. package/_mjs/IOEnv/live.mjs.map +1 -0
  1131. package/_mjs/IOEnv/services.mjs +8 -0
  1132. package/_mjs/IOEnv/services.mjs.map +1 -0
  1133. package/_mjs/IOEnv.mjs +5 -0
  1134. package/_mjs/IOEnv.mjs.map +1 -0
  1135. package/_mjs/InterruptStatus/constructors.mjs +21 -0
  1136. package/_mjs/InterruptStatus/constructors.mjs.map +1 -0
  1137. package/_mjs/InterruptStatus/definition.mjs +21 -0
  1138. package/_mjs/InterruptStatus/definition.mjs.map +1 -0
  1139. package/_mjs/InterruptStatus.mjs +4 -0
  1140. package/_mjs/InterruptStatus.mjs.map +1 -0
  1141. package/_mjs/Layer/MemoMap.mjs +171 -0
  1142. package/_mjs/Layer/MemoMap.mjs.map +1 -0
  1143. package/_mjs/Layer/api.mjs +338 -0
  1144. package/_mjs/Layer/api.mjs.map +1 -0
  1145. package/_mjs/Layer/definition.mjs +104 -0
  1146. package/_mjs/Layer/definition.mjs.map +1 -0
  1147. package/_mjs/Layer.mjs +5 -0
  1148. package/_mjs/Layer.mjs.map +1 -0
  1149. package/_mjs/LogLevel.mjs +85 -0
  1150. package/_mjs/LogLevel.mjs.map +1 -0
  1151. package/_mjs/LogSpan.mjs +32 -0
  1152. package/_mjs/LogSpan.mjs.map +1 -0
  1153. package/_mjs/Logger/api.mjs +23 -0
  1154. package/_mjs/Logger/api.mjs.map +1 -0
  1155. package/_mjs/Logger/constructors.mjs +63 -0
  1156. package/_mjs/Logger/constructors.mjs.map +1 -0
  1157. package/_mjs/Logger/definition.mjs +11 -0
  1158. package/_mjs/Logger/definition.mjs.map +1 -0
  1159. package/_mjs/Logger.mjs +5 -0
  1160. package/_mjs/Logger.mjs.map +1 -0
  1161. package/_mjs/Queue/api/dimapIO.mjs +97 -0
  1162. package/_mjs/Queue/api/dimapIO.mjs.map +1 -0
  1163. package/_mjs/Queue/api/filterInputIO.mjs +63 -0
  1164. package/_mjs/Queue/api/filterInputIO.mjs.map +1 -0
  1165. package/_mjs/Queue/api/filterOutputIO.mjs +68 -0
  1166. package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -0
  1167. package/_mjs/Queue/api/operations.mjs +122 -0
  1168. package/_mjs/Queue/api/operations.mjs.map +1 -0
  1169. package/_mjs/Queue/api/poll.mjs +15 -0
  1170. package/_mjs/Queue/api/poll.mjs.map +1 -0
  1171. package/_mjs/Queue/api/takeBetween.mjs +44 -0
  1172. package/_mjs/Queue/api/takeBetween.mjs.map +1 -0
  1173. package/_mjs/Queue/api/zipWithIO.mjs +75 -0
  1174. package/_mjs/Queue/api/zipWithIO.mjs.map +1 -0
  1175. package/_mjs/Queue/api.mjs +9 -0
  1176. package/_mjs/Queue/api.mjs.map +1 -0
  1177. package/_mjs/Queue/constructors.mjs +34 -0
  1178. package/_mjs/Queue/constructors.mjs.map +1 -0
  1179. package/_mjs/Queue/definition.mjs +17 -0
  1180. package/_mjs/Queue/definition.mjs.map +1 -0
  1181. package/_mjs/Queue/internal.mjs +224 -0
  1182. package/_mjs/Queue/internal.mjs.map +1 -0
  1183. package/_mjs/Queue/strategy.mjs +147 -0
  1184. package/_mjs/Queue/strategy.mjs.map +1 -0
  1185. package/_mjs/Queue.mjs +7 -0
  1186. package/_mjs/Queue.mjs.map +1 -0
  1187. package/_mjs/Random/api.mjs +52 -0
  1188. package/_mjs/Random/api.mjs.map +1 -0
  1189. package/_mjs/Random/definition.mjs +13 -0
  1190. package/_mjs/Random/definition.mjs.map +1 -0
  1191. package/_mjs/Random/live.mjs +40 -0
  1192. package/_mjs/Random/live.mjs.map +1 -0
  1193. package/_mjs/Random.mjs +5 -0
  1194. package/_mjs/Random.mjs.map +1 -0
  1195. package/_mjs/Ref/Atomic/Atomic.mjs +47 -0
  1196. package/_mjs/Ref/Atomic/Atomic.mjs.map +1 -0
  1197. package/_mjs/Ref/Atomic/api.mjs +124 -0
  1198. package/_mjs/Ref/Atomic/api.mjs.map +1 -0
  1199. package/_mjs/Ref/Atomic.mjs +4 -0
  1200. package/_mjs/Ref/Atomic.mjs.map +1 -0
  1201. package/_mjs/Ref/Derived.mjs +35 -0
  1202. package/_mjs/Ref/Derived.mjs.map +1 -0
  1203. package/_mjs/Ref/DerivedAll.mjs +35 -0
  1204. package/_mjs/Ref/DerivedAll.mjs.map +1 -0
  1205. package/_mjs/Ref/Synchronized/api.mjs +155 -0
  1206. package/_mjs/Ref/Synchronized/api.mjs.map +1 -0
  1207. package/_mjs/Ref/Synchronized/constructors.mjs +20 -0
  1208. package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -0
  1209. package/_mjs/Ref/Synchronized/definition.mjs +66 -0
  1210. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -0
  1211. package/_mjs/Ref/api/collect.mjs +17 -0
  1212. package/_mjs/Ref/api/collect.mjs.map +1 -0
  1213. package/_mjs/Ref/api/dimap.mjs +84 -0
  1214. package/_mjs/Ref/api/dimap.mjs.map +1 -0
  1215. package/_mjs/Ref/api/filter.mjs +29 -0
  1216. package/_mjs/Ref/api/filter.mjs.map +1 -0
  1217. package/_mjs/Ref/api/get.mjs +13 -0
  1218. package/_mjs/Ref/api/get.mjs.map +1 -0
  1219. package/_mjs/Ref/api/match.mjs +18 -0
  1220. package/_mjs/Ref/api/match.mjs.map +1 -0
  1221. package/_mjs/Ref/api/matchAll.mjs +16 -0
  1222. package/_mjs/Ref/api/matchAll.mjs.map +1 -0
  1223. package/_mjs/Ref/api/modify.mjs +205 -0
  1224. package/_mjs/Ref/api/modify.mjs.map +1 -0
  1225. package/_mjs/Ref/api/set.mjs +14 -0
  1226. package/_mjs/Ref/api/set.mjs.map +1 -0
  1227. package/_mjs/Ref/api.mjs +34 -0
  1228. package/_mjs/Ref/api.mjs.map +1 -0
  1229. package/_mjs/Ref/constructors.mjs +19 -0
  1230. package/_mjs/Ref/constructors.mjs.map +1 -0
  1231. package/_mjs/Ref/definition.mjs +10 -0
  1232. package/_mjs/Ref/definition.mjs.map +1 -0
  1233. package/_mjs/Ref.mjs +13 -0
  1234. package/_mjs/Ref.mjs.map +1 -0
  1235. package/_mjs/RuntimeConfig.mjs +34 -0
  1236. package/_mjs/RuntimeConfig.mjs.map +1 -0
  1237. package/_mjs/STM/api/core-api.mjs +61 -0
  1238. package/_mjs/STM/api/core-api.mjs.map +1 -0
  1239. package/_mjs/STM/api/core-constructors.mjs +68 -0
  1240. package/_mjs/STM/api/core-constructors.mjs.map +1 -0
  1241. package/_mjs/STM/api.mjs +633 -0
  1242. package/_mjs/STM/api.mjs.map +1 -0
  1243. package/_mjs/STM/definition.mjs +148 -0
  1244. package/_mjs/STM/definition.mjs.map +1 -0
  1245. package/_mjs/STM/driver.mjs +166 -0
  1246. package/_mjs/STM/driver.mjs.map +1 -0
  1247. package/_mjs/STM/internal/CommitState.mjs +68 -0
  1248. package/_mjs/STM/internal/CommitState.mjs.map +1 -0
  1249. package/_mjs/STM/internal/Entry.mjs +70 -0
  1250. package/_mjs/STM/internal/Entry.mjs.map +1 -0
  1251. package/_mjs/STM/internal/Journal.mjs +377 -0
  1252. package/_mjs/STM/internal/Journal.mjs.map +1 -0
  1253. package/_mjs/STM/internal/TryCommit.mjs +22 -0
  1254. package/_mjs/STM/internal/TryCommit.mjs.map +1 -0
  1255. package/_mjs/STM/internal/Versioned.mjs +9 -0
  1256. package/_mjs/STM/internal/Versioned.mjs.map +1 -0
  1257. package/_mjs/STM.mjs +9 -0
  1258. package/_mjs/STM.mjs.map +1 -0
  1259. package/_mjs/Schedule/Decision.mjs +48 -0
  1260. package/_mjs/Schedule/Decision.mjs.map +1 -0
  1261. package/_mjs/Schedule/Driver.mjs +21 -0
  1262. package/_mjs/Schedule/Driver.mjs.map +1 -0
  1263. package/_mjs/Schedule/Interval.mjs +114 -0
  1264. package/_mjs/Schedule/Interval.mjs.map +1 -0
  1265. package/_mjs/Schedule/api/driver.mjs +30 -0
  1266. package/_mjs/Schedule/api/driver.mjs.map +1 -0
  1267. package/_mjs/Schedule/api.mjs +642 -0
  1268. package/_mjs/Schedule/api.mjs.map +1 -0
  1269. package/_mjs/Schedule/definition.mjs +32 -0
  1270. package/_mjs/Schedule/definition.mjs.map +1 -0
  1271. package/_mjs/Schedule.mjs +7 -0
  1272. package/_mjs/Schedule.mjs.map +1 -0
  1273. package/_mjs/Scope/Finalizer/definition.mjs +9 -0
  1274. package/_mjs/Scope/Finalizer/definition.mjs.map +1 -0
  1275. package/_mjs/Scope/Finalizer.mjs +3 -0
  1276. package/_mjs/Scope/Finalizer.mjs.map +1 -0
  1277. package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs +26 -0
  1278. package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs.map +1 -0
  1279. package/_mjs/Scope/ReleaseMap/api.mjs +84 -0
  1280. package/_mjs/Scope/ReleaseMap/api.mjs.map +1 -0
  1281. package/_mjs/Scope/ReleaseMap/constructors.mjs +21 -0
  1282. package/_mjs/Scope/ReleaseMap/constructors.mjs.map +1 -0
  1283. package/_mjs/Scope/ReleaseMap/definition.mjs +21 -0
  1284. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -0
  1285. package/_mjs/Scope/ReleaseMap.mjs +5 -0
  1286. package/_mjs/Scope/ReleaseMap.mjs.map +1 -0
  1287. package/_mjs/Scope/api.mjs +140 -0
  1288. package/_mjs/Scope/api.mjs.map +1 -0
  1289. package/_mjs/Scope/definition.mjs +25 -0
  1290. package/_mjs/Scope/definition.mjs.map +1 -0
  1291. package/_mjs/Scope.mjs +4 -0
  1292. package/_mjs/Scope.mjs.map +1 -0
  1293. package/_mjs/ScopedRef/api.mjs +50 -0
  1294. package/_mjs/ScopedRef/api.mjs.map +1 -0
  1295. package/_mjs/ScopedRef/definition.mjs +13 -0
  1296. package/_mjs/ScopedRef/definition.mjs.map +1 -0
  1297. package/_mjs/ScopedRef.mjs +4 -0
  1298. package/_mjs/ScopedRef.mjs.map +1 -0
  1299. package/_mjs/Sink/api.mjs +76 -0
  1300. package/_mjs/Sink/api.mjs.map +1 -0
  1301. package/_mjs/Sink/definition.mjs +16 -0
  1302. package/_mjs/Sink/definition.mjs.map +1 -0
  1303. package/_mjs/Sink.mjs +4 -0
  1304. package/_mjs/Sink.mjs.map +1 -0
  1305. package/_mjs/State/api.mjs +53 -0
  1306. package/_mjs/State/api.mjs.map +1 -0
  1307. package/_mjs/State/definition.mjs +19 -0
  1308. package/_mjs/State/definition.mjs.map +1 -0
  1309. package/_mjs/State/internal.mjs +8 -0
  1310. package/_mjs/State/internal.mjs.map +1 -0
  1311. package/_mjs/State.mjs +4 -0
  1312. package/_mjs/State.mjs.map +1 -0
  1313. package/_mjs/Stream/api/zipAllWith.mjs +106 -0
  1314. package/_mjs/Stream/api/zipAllWith.mjs.map +1 -0
  1315. package/_mjs/Stream/api/zipWith.mjs +10 -0
  1316. package/_mjs/Stream/api/zipWith.mjs.map +1 -0
  1317. package/_mjs/Stream/api/zipWithChunks.mjs +83 -0
  1318. package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -0
  1319. package/_mjs/Stream/api.mjs +2178 -0
  1320. package/_mjs/Stream/api.mjs.map +1 -0
  1321. package/_mjs/Stream/definition.mjs +41 -0
  1322. package/_mjs/Stream/definition.mjs.map +1 -0
  1323. package/_mjs/Stream/internal/DebounceState.mjs +72 -0
  1324. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -0
  1325. package/_mjs/Stream/internal/Handoff.mjs +162 -0
  1326. package/_mjs/Stream/internal/Handoff.mjs.map +1 -0
  1327. package/_mjs/Stream/internal/Pull.mjs +56 -0
  1328. package/_mjs/Stream/internal/Pull.mjs.map +1 -0
  1329. package/_mjs/Stream/internal/SinkEndReason.mjs +66 -0
  1330. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -0
  1331. package/_mjs/Stream/internal/Take.mjs +191 -0
  1332. package/_mjs/Stream/internal/Take.mjs.map +1 -0
  1333. package/_mjs/Stream/internal/util.mjs +19 -0
  1334. package/_mjs/Stream/internal/util.mjs.map +1 -0
  1335. package/_mjs/Stream.mjs +4 -0
  1336. package/_mjs/Stream.mjs.map +1 -0
  1337. package/_mjs/Supervisor/api.mjs +44 -0
  1338. package/_mjs/Supervisor/api.mjs.map +1 -0
  1339. package/_mjs/Supervisor/constructors.mjs +69 -0
  1340. package/_mjs/Supervisor/constructors.mjs.map +1 -0
  1341. package/_mjs/Supervisor/definition.mjs +74 -0
  1342. package/_mjs/Supervisor/definition.mjs.map +1 -0
  1343. package/_mjs/Supervisor.mjs +5 -0
  1344. package/_mjs/Supervisor.mjs.map +1 -0
  1345. package/_mjs/TExit/constructors.mjs +40 -0
  1346. package/_mjs/TExit/constructors.mjs.map +1 -0
  1347. package/_mjs/TExit/definition.mjs +173 -0
  1348. package/_mjs/TExit/definition.mjs.map +1 -0
  1349. package/_mjs/TExit.mjs +4 -0
  1350. package/_mjs/TExit.mjs.map +1 -0
  1351. package/_mjs/TFuture/api.mjs +47 -0
  1352. package/_mjs/TFuture/api.mjs.map +1 -0
  1353. package/_mjs/TFuture/constructors.mjs +23 -0
  1354. package/_mjs/TFuture/constructors.mjs.map +1 -0
  1355. package/_mjs/TFuture/definition.mjs +3 -0
  1356. package/_mjs/TFuture/definition.mjs.map +1 -0
  1357. package/_mjs/TFuture.mjs +5 -0
  1358. package/_mjs/TFuture.mjs.map +1 -0
  1359. package/_mjs/TRef/api.mjs +327 -0
  1360. package/_mjs/TRef/api.mjs.map +1 -0
  1361. package/_mjs/TRef/constructors.mjs +72 -0
  1362. package/_mjs/TRef/constructors.mjs.map +1 -0
  1363. package/_mjs/TRef/definition.mjs +71 -0
  1364. package/_mjs/TRef/definition.mjs.map +1 -0
  1365. package/_mjs/TRef.mjs +5 -0
  1366. package/_mjs/TRef.mjs.map +1 -0
  1367. package/_mjs/TSemaphore/api.mjs +74 -0
  1368. package/_mjs/TSemaphore/api.mjs.map +1 -0
  1369. package/_mjs/TSemaphore/constructors.mjs +19 -0
  1370. package/_mjs/TSemaphore/constructors.mjs.map +1 -0
  1371. package/_mjs/TSemaphore/definition.mjs +3 -0
  1372. package/_mjs/TSemaphore/definition.mjs.map +1 -0
  1373. package/_mjs/TSemaphore.mjs +5 -0
  1374. package/_mjs/TSemaphore.mjs.map +1 -0
  1375. package/_mjs/TxnId.mjs +11 -0
  1376. package/_mjs/TxnId.mjs.map +1 -0
  1377. package/_mjs/collection/immutable/Conc/findIO.mjs +40 -0
  1378. package/_mjs/collection/immutable/Conc/findIO.mjs.map +1 -0
  1379. package/_mjs/collection/immutable/Conc/mapIO.mjs +16 -0
  1380. package/_mjs/collection/immutable/Conc/mapIO.mjs.map +1 -0
  1381. package/_mjs/collection/immutable/Conc/takeWhileIO.mjs +39 -0
  1382. package/_mjs/collection/immutable/Conc/takeWhileIO.mjs.map +1 -0
  1383. package/_mjs/collection/immutable/Conc.mjs +5 -0
  1384. package/_mjs/collection/immutable/Conc.mjs.map +1 -0
  1385. package/_mjs/data/Exit/foreachIO.mjs +15 -0
  1386. package/_mjs/data/Exit/foreachIO.mjs.map +1 -0
  1387. package/_mjs/internal/HashedPair.mjs +20 -0
  1388. package/_mjs/internal/HashedPair.mjs.map +1 -0
  1389. package/_mjs/internal/Hub.mjs +723 -0
  1390. package/_mjs/internal/Hub.mjs.map +1 -0
  1391. package/_mjs/internal/MutableQueue.mjs +276 -0
  1392. package/_mjs/internal/MutableQueue.mjs.map +1 -0
  1393. package/_mjs/internal/Scheduler.mjs +18 -0
  1394. package/_mjs/internal/Scheduler.mjs.map +1 -0
  1395. package/_mjs/internal/StackTraceBuilder.mjs +21 -0
  1396. package/_mjs/internal/StackTraceBuilder.mjs.map +1 -0
  1397. package/_src/Cached/api.ts +54 -0
  1398. package/_src/Cached/definition.ts +23 -0
  1399. package/_src/Cached/internal.ts +10 -0
  1400. package/_src/Cached.ts +5 -0
  1401. package/_src/CancellerState.ts +47 -0
  1402. package/_src/Channel/ChildExecutorDecision/api.ts +23 -0
  1403. package/_src/Channel/ChildExecutorDecision/definition.ts +48 -0
  1404. package/_src/Channel/ChildExecutorDecision.ts +4 -0
  1405. package/_src/Channel/UpstreamPullRequest/api.ts +36 -0
  1406. package/_src/Channel/UpstreamPullRequest/definition.ts +21 -0
  1407. package/_src/Channel/UpstreamPullRequest.ts +4 -0
  1408. package/_src/Channel/UpstreamPullStrategy/definition.ts +38 -0
  1409. package/_src/Channel/UpstreamPullStrategy.ts +3 -0
  1410. package/_src/Channel/api/interruptWhen.ts +37 -0
  1411. package/_src/Channel/api/mapOutIOC.ts +63 -0
  1412. package/_src/Channel/api/mergeAll.ts +21 -0
  1413. package/_src/Channel/api/mergeAllUnboundedWith.ts +30 -0
  1414. package/_src/Channel/api/mergeAllWith.ts +141 -0
  1415. package/_src/Channel/api/mergeMap.ts +27 -0
  1416. package/_src/Channel/api/mergeWith.ts +200 -0
  1417. package/_src/Channel/api/run.ts +10 -0
  1418. package/_src/Channel/api/runCollect.ts +8 -0
  1419. package/_src/Channel/api/runDrain.ts +10 -0
  1420. package/_src/Channel/api/runScoped.ts +45 -0
  1421. package/_src/Channel/api/toPull.ts +38 -0
  1422. package/_src/Channel/api/zipC.ts +104 -0
  1423. package/_src/Channel/api.ts +1258 -0
  1424. package/_src/Channel/core-api.ts +230 -0
  1425. package/_src/Channel/definition.ts +322 -0
  1426. package/_src/Channel/internal/AsyncInputConsumer.ts +6 -0
  1427. package/_src/Channel/internal/AsyncInputProducer.ts +6 -0
  1428. package/_src/Channel/internal/ChannelExecutor.ts +1078 -0
  1429. package/_src/Channel/internal/ChannelState.ts +61 -0
  1430. package/_src/Channel/internal/MergeDecision.ts +65 -0
  1431. package/_src/Channel/internal/MergeState.ts +63 -0
  1432. package/_src/Channel/internal/SingleProducerAsyncInput.ts +186 -0
  1433. package/_src/Channel.ts +5 -0
  1434. package/_src/Clock/api.ts +11 -0
  1435. package/_src/Clock/definition.ts +13 -0
  1436. package/_src/Clock/live.ts +21 -0
  1437. package/_src/Clock.ts +5 -0
  1438. package/_src/Console/api.ts +13 -0
  1439. package/_src/Console/definition.ts +14 -0
  1440. package/_src/Console/live.ts +18 -0
  1441. package/_src/Console.ts +5 -0
  1442. package/_src/Fiber/FiberContext.ts +1101 -0
  1443. package/_src/Fiber/api/await.ts +7 -0
  1444. package/_src/Fiber/api/awaitAll.ts +8 -0
  1445. package/_src/Fiber/api/children.ts +7 -0
  1446. package/_src/Fiber/api/collectAll.ts +32 -0
  1447. package/_src/Fiber/api/evalOn.ts +12 -0
  1448. package/_src/Fiber/api/evalOnIO.ts +18 -0
  1449. package/_src/Fiber/api/fromIO.ts +8 -0
  1450. package/_src/Fiber/api/id.ts +7 -0
  1451. package/_src/Fiber/api/inheritRefs.ts +7 -0
  1452. package/_src/Fiber/api/interrupt.ts +11 -0
  1453. package/_src/Fiber/api/interruptAll.ts +17 -0
  1454. package/_src/Fiber/api/interruptAs.ts +7 -0
  1455. package/_src/Fiber/api/interruptFork.ts +10 -0
  1456. package/_src/Fiber/api/join.ts +13 -0
  1457. package/_src/Fiber/api/joinAll.ts +12 -0
  1458. package/_src/Fiber/api/location.ts +7 -0
  1459. package/_src/Fiber/api/mapFiber.ts +9 -0
  1460. package/_src/Fiber/api/mapIO.ts +31 -0
  1461. package/_src/Fiber/api/poll.ts +7 -0
  1462. package/_src/Fiber/api/zipWith.ts +25 -0
  1463. package/_src/Fiber/constructors.ts +43 -0
  1464. package/_src/Fiber/definition.ts +128 -0
  1465. package/_src/Fiber.ts +28 -0
  1466. package/_src/FiberDescriptor.ts +19 -0
  1467. package/_src/FiberRef/api/locallyScoped.ts +9 -0
  1468. package/_src/FiberRef/api/locallyScopedWith.ts +6 -0
  1469. package/_src/FiberRef/api.ts +135 -0
  1470. package/_src/FiberRef/constructors.ts +98 -0
  1471. package/_src/FiberRef/definition.ts +64 -0
  1472. package/_src/FiberRef.ts +10 -0
  1473. package/_src/FiberRefs/api.ts +15 -0
  1474. package/_src/FiberRefs/definition.ts +11 -0
  1475. package/_src/FiberRefs/join.ts +67 -0
  1476. package/_src/FiberRefs.ts +5 -0
  1477. package/_src/FiberScope/constructors.ts +19 -0
  1478. package/_src/FiberScope/definition.ts +38 -0
  1479. package/_src/FiberScope.ts +4 -0
  1480. package/_src/FiberState/api.ts +12 -0
  1481. package/_src/FiberState/constructors.ts +33 -0
  1482. package/_src/FiberState/definition.ts +44 -0
  1483. package/_src/FiberState.ts +5 -0
  1484. package/_src/FiberStatus/constructors.ts +35 -0
  1485. package/_src/FiberStatus/definition.ts +87 -0
  1486. package/_src/FiberStatus.ts +4 -0
  1487. package/_src/Future/api.ts +204 -0
  1488. package/_src/Future/constructors.ts +28 -0
  1489. package/_src/Future/definition.ts +24 -0
  1490. package/_src/Future.ts +5 -0
  1491. package/_src/Hub/api.ts +434 -0
  1492. package/_src/Hub/definition.ts +102 -0
  1493. package/_src/Hub/internal.ts +493 -0
  1494. package/_src/Hub.ts +4 -0
  1495. package/_src/IO/api/acquireRelease.ts +10 -0
  1496. package/_src/IO/api/acquireReleaseExit.ts +11 -0
  1497. package/_src/IO/api/acquireReleaseInterruptible.ts +10 -0
  1498. package/_src/IO/api/acquireReleaseInterruptibleExit.ts +10 -0
  1499. package/_src/IO/api/addFinalizer.ts +9 -0
  1500. package/_src/IO/api/addFinalizerExit.ts +12 -0
  1501. package/_src/IO/api/bracket.ts +30 -0
  1502. package/_src/IO/api/bracketExit.ts +32 -0
  1503. package/_src/IO/api/clockWith.ts +11 -0
  1504. package/_src/IO/api/concurrency.ts +42 -0
  1505. package/_src/IO/api/concurrentFinalizers.ts +11 -0
  1506. package/_src/IO/api/consoleWith.ts +13 -0
  1507. package/_src/IO/api/core-scope.ts +138 -0
  1508. package/_src/IO/api/environment.ts +126 -0
  1509. package/_src/IO/api/foreachC.ts +178 -0
  1510. package/_src/IO/api/foreachExec.ts +19 -0
  1511. package/_src/IO/api/forkAll.ts +9 -0
  1512. package/_src/IO/api/forkIn.ts +15 -0
  1513. package/_src/IO/api/forkScoped.ts +11 -0
  1514. package/_src/IO/api/fulfill.ts +10 -0
  1515. package/_src/IO/api/interrupt.ts +169 -0
  1516. package/_src/IO/api/memoize.ts +10 -0
  1517. package/_src/IO/api/onExit.ts +12 -0
  1518. package/_src/IO/api/once.ts +6 -0
  1519. package/_src/IO/api/provideLayer.ts +12 -0
  1520. package/_src/IO/api/provideSomeLayer.ts +23 -0
  1521. package/_src/IO/api/race.ts +32 -0
  1522. package/_src/IO/api/raceFirst.ts +17 -0
  1523. package/_src/IO/api/randomWith.ts +11 -0
  1524. package/_src/IO/api/repeat.ts +49 -0
  1525. package/_src/IO/api/retry.ts +42 -0
  1526. package/_src/IO/api/schedule.ts +31 -0
  1527. package/_src/IO/api/scope.ts +4 -0
  1528. package/_src/IO/api/scopeWith.ts +6 -0
  1529. package/_src/IO/api/scoped.ts +13 -0
  1530. package/_src/IO/api/sequenceT.ts +12 -0
  1531. package/_src/IO/api/sleep.ts +6 -0
  1532. package/_src/IO/api/stateful.ts +15 -0
  1533. package/_src/IO/api/withChildren.ts +13 -0
  1534. package/_src/IO/api/withFinalizer.ts +9 -0
  1535. package/_src/IO/api/withFinalizerExit.ts +9 -0
  1536. package/_src/IO/api/withRuntimeConfig.ts +16 -0
  1537. package/_src/IO/api/zipC.ts +8 -0
  1538. package/_src/IO/api/zipWithC.ts +41 -0
  1539. package/_src/IO/api.ts +2126 -0
  1540. package/_src/IO/definition.ts +429 -0
  1541. package/_src/IO/runtime.ts +99 -0
  1542. package/_src/IO.ts +52 -0
  1543. package/_src/IOEnv/definition.ts +20 -0
  1544. package/_src/IOEnv/live.ts +8 -0
  1545. package/_src/IOEnv/services.ts +10 -0
  1546. package/_src/IOEnv.ts +5 -0
  1547. package/_src/InterruptStatus/constructors.ts +16 -0
  1548. package/_src/InterruptStatus/definition.ts +17 -0
  1549. package/_src/InterruptStatus.ts +4 -0
  1550. package/_src/Layer/MemoMap.ts +170 -0
  1551. package/_src/Layer/api.ts +378 -0
  1552. package/_src/Layer/definition.ts +111 -0
  1553. package/_src/Layer.ts +5 -0
  1554. package/_src/LogLevel.ts +79 -0
  1555. package/_src/LogSpan.ts +27 -0
  1556. package/_src/Logger/api.ts +24 -0
  1557. package/_src/Logger/constructors.ts +59 -0
  1558. package/_src/Logger/definition.ts +22 -0
  1559. package/_src/Logger.ts +5 -0
  1560. package/_src/Queue/api/dimapIO.ts +120 -0
  1561. package/_src/Queue/api/filterInputIO.ts +73 -0
  1562. package/_src/Queue/api/filterOutputIO.ts +74 -0
  1563. package/_src/Queue/api/operations.ts +121 -0
  1564. package/_src/Queue/api/poll.ts +11 -0
  1565. package/_src/Queue/api/takeBetween.ts +40 -0
  1566. package/_src/Queue/api/zipWithIO.ts +96 -0
  1567. package/_src/Queue/api.ts +9 -0
  1568. package/_src/Queue/constructors.ts +33 -0
  1569. package/_src/Queue/definition.ts +134 -0
  1570. package/_src/Queue/internal.ts +240 -0
  1571. package/_src/Queue/strategy.ts +177 -0
  1572. package/_src/Queue.ts +7 -0
  1573. package/_src/Random/api.ts +51 -0
  1574. package/_src/Random/definition.ts +21 -0
  1575. package/_src/Random/live.ts +36 -0
  1576. package/_src/Random.ts +5 -0
  1577. package/_src/Ref/Atomic/Atomic.ts +56 -0
  1578. package/_src/Ref/Atomic/api.ts +120 -0
  1579. package/_src/Ref/Atomic.ts +4 -0
  1580. package/_src/Ref/Derived.ts +71 -0
  1581. package/_src/Ref/DerivedAll.ts +75 -0
  1582. package/_src/Ref/Synchronized/api.ts +234 -0
  1583. package/_src/Ref/Synchronized/constructors.ts +12 -0
  1584. package/_src/Ref/Synchronized/definition.ts +126 -0
  1585. package/_src/Ref/api/collect.ts +18 -0
  1586. package/_src/Ref/api/dimap.ts +108 -0
  1587. package/_src/Ref/api/filter.ts +33 -0
  1588. package/_src/Ref/api/get.ts +14 -0
  1589. package/_src/Ref/api/match.ts +24 -0
  1590. package/_src/Ref/api/matchAll.ts +23 -0
  1591. package/_src/Ref/api/modify.ts +225 -0
  1592. package/_src/Ref/api/set.ts +15 -0
  1593. package/_src/Ref/api.ts +39 -0
  1594. package/_src/Ref/constructors.ts +15 -0
  1595. package/_src/Ref/definition.ts +104 -0
  1596. package/_src/Ref.ts +14 -0
  1597. package/_src/RuntimeConfig.ts +37 -0
  1598. package/_src/STM/api/core-api.ts +60 -0
  1599. package/_src/STM/api/core-constructors.ts +65 -0
  1600. package/_src/STM/api.ts +685 -0
  1601. package/_src/STM/definition.ts +155 -0
  1602. package/_src/STM/driver.ts +131 -0
  1603. package/_src/STM/internal/CommitState.ts +75 -0
  1604. package/_src/STM/internal/Entry.ts +76 -0
  1605. package/_src/STM/internal/Journal.ts +341 -0
  1606. package/_src/STM/internal/TryCommit.ts +23 -0
  1607. package/_src/STM/internal/Versioned.ts +7 -0
  1608. package/_src/STM.ts +10 -0
  1609. package/_src/Schedule/Decision.ts +51 -0
  1610. package/_src/Schedule/Driver.ts +24 -0
  1611. package/_src/Schedule/Interval.ts +103 -0
  1612. package/_src/Schedule/api/driver.ts +38 -0
  1613. package/_src/Schedule/api.ts +887 -0
  1614. package/_src/Schedule/definition.ts +60 -0
  1615. package/_src/Schedule.ts +7 -0
  1616. package/_src/Scope/Finalizer/definition.ts +26 -0
  1617. package/_src/Scope/Finalizer.ts +3 -0
  1618. package/_src/Scope/ReleaseMap/api/releaseAll.ts +28 -0
  1619. package/_src/Scope/ReleaseMap/api.ts +86 -0
  1620. package/_src/Scope/ReleaseMap/constructors.ts +17 -0
  1621. package/_src/Scope/ReleaseMap/definition.ts +37 -0
  1622. package/_src/Scope/ReleaseMap.ts +5 -0
  1623. package/_src/Scope/api.ts +117 -0
  1624. package/_src/Scope/definition.ts +31 -0
  1625. package/_src/Scope.ts +4 -0
  1626. package/_src/ScopedRef/api.ts +50 -0
  1627. package/_src/ScopedRef/definition.ts +13 -0
  1628. package/_src/ScopedRef.ts +4 -0
  1629. package/_src/Sink/api.ts +88 -0
  1630. package/_src/Sink/definition.ts +12 -0
  1631. package/_src/Sink.ts +4 -0
  1632. package/_src/State/api.ts +49 -0
  1633. package/_src/State/definition.ts +19 -0
  1634. package/_src/State/internal.ts +10 -0
  1635. package/_src/State.ts +4 -0
  1636. package/_src/Stream/api/zipAllWith.ts +135 -0
  1637. package/_src/Stream/api/zipWith.ts +12 -0
  1638. package/_src/Stream/api/zipWithChunks.ts +89 -0
  1639. package/_src/Stream/api.ts +2931 -0
  1640. package/_src/Stream/definition.ts +42 -0
  1641. package/_src/Stream/internal/DebounceState.ts +79 -0
  1642. package/_src/Stream/internal/Handoff.ts +174 -0
  1643. package/_src/Stream/internal/Pull.ts +58 -0
  1644. package/_src/Stream/internal/SinkEndReason.ts +59 -0
  1645. package/_src/Stream/internal/Take.ts +192 -0
  1646. package/_src/Stream/internal/util.ts +19 -0
  1647. package/_src/Stream.ts +4 -0
  1648. package/_src/Supervisor/api.ts +36 -0
  1649. package/_src/Supervisor/constructors.ts +65 -0
  1650. package/_src/Supervisor/definition.ts +70 -0
  1651. package/_src/Supervisor.ts +5 -0
  1652. package/_src/TExit/constructors.ts +39 -0
  1653. package/_src/TExit/definition.ts +147 -0
  1654. package/_src/TExit.ts +4 -0
  1655. package/_src/TFuture/api.ts +42 -0
  1656. package/_src/TFuture/constructors.ts +14 -0
  1657. package/_src/TFuture/definition.ts +23 -0
  1658. package/_src/TFuture.ts +5 -0
  1659. package/_src/TRef/api.ts +312 -0
  1660. package/_src/TRef/constructors.ts +69 -0
  1661. package/_src/TRef/definition.ts +230 -0
  1662. package/_src/TRef.ts +5 -0
  1663. package/_src/TSemaphore/api.ts +68 -0
  1664. package/_src/TSemaphore/constructors.ts +14 -0
  1665. package/_src/TSemaphore/definition.ts +21 -0
  1666. package/_src/TSemaphore.ts +5 -0
  1667. package/_src/TxnId.ts +19 -0
  1668. package/_src/collection/immutable/Conc/findIO.ts +37 -0
  1669. package/_src/collection/immutable/Conc/mapIO.ts +13 -0
  1670. package/_src/collection/immutable/Conc/takeWhileIO.ts +32 -0
  1671. package/_src/collection/immutable/Conc.ts +5 -0
  1672. package/_src/data/Exit/foreachIO.ts +15 -0
  1673. package/_src/internal/HashedPair.ts +15 -0
  1674. package/_src/internal/Hub.ts +754 -0
  1675. package/_src/internal/MutableQueue.ts +295 -0
  1676. package/_src/internal/Scheduler.ts +15 -0
  1677. package/_src/internal/StackTraceBuilder.ts +16 -0
  1678. package/collection/immutable/Conc/findIO.d.ts +8 -0
  1679. package/collection/immutable/Conc/mapIO.d.ts +7 -0
  1680. package/collection/immutable/Conc/takeWhileIO.d.ts +7 -0
  1681. package/collection/immutable/Conc.d.ts +3 -0
  1682. package/data/Exit/foreachIO.d.ts +9 -0
  1683. package/internal/HashedPair.d.ts +9 -0
  1684. package/internal/Hub.d.ts +121 -0
  1685. package/internal/MutableQueue.d.ts +125 -0
  1686. package/internal/Scheduler.d.ts +1 -0
  1687. package/internal/StackTraceBuilder.d.ts +8 -0
  1688. package/package.json +17 -0
@@ -0,0 +1,2517 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.absolve = absolve;
7
+ exports.acquireReleaseExit_ = acquireReleaseExit_;
8
+ exports.acquireRelease_ = acquireRelease_;
9
+ exports.aggregateAsyncWithin_ = exports.aggregateAsyncWithinEither_ = void 0;
10
+ exports.aggregateAsync_ = aggregateAsync_;
11
+ exports.apFirst_ = apFirst_;
12
+ exports.apSecond_ = void 0;
13
+ exports.as_ = as_;
14
+ exports.async = async;
15
+ exports.asyncIO = asyncIO;
16
+ exports.asyncMaybe = exports.asyncInterrupt = void 0;
17
+ exports.bimap_ = bimap_;
18
+ exports.broadcastDynamic_ = broadcastDynamic_;
19
+ exports.broadcast_ = broadcast_;
20
+ exports.broadcastedQueues_ = exports.broadcastedQueuesDynamic_ = void 0;
21
+ exports.bufferChunks_ = bufferChunks_;
22
+ exports.bufferUnbounded = bufferUnbounded;
23
+ exports.buffer_ = buffer_;
24
+ exports.catchAll_ = exports.catchAllCause_ = void 0;
25
+ exports.catchJustCause_ = catchJustCause_;
26
+ exports.catchJust_ = catchJust_;
27
+ exports.changesWith_ = changesWith_;
28
+ exports.chunks = chunks;
29
+ exports.collectWhileIO_ = collectWhileIO_;
30
+ exports.collectWhile_ = collectWhile_;
31
+ exports.combineChunks_ = combineChunks_;
32
+ exports.combine_ = combine_;
33
+ exports.concat_ = void 0;
34
+ exports.contramapEnvironment_ = contramapEnvironment_;
35
+ exports.crossWith_ = void 0;
36
+ exports.cross_ = cross_;
37
+ exports.debounce_ = debounce_;
38
+ exports.defaultIfEmpty_ = defaultIfEmpty_;
39
+ exports.distributedWithDynamic_ = void 0;
40
+ exports.distributedWith_ = distributedWith_;
41
+ exports.drain = drain;
42
+ exports.dropUntil_ = dropUntil_;
43
+ exports.drop_ = exports.dropWhile_ = void 0;
44
+ exports.either = either;
45
+ exports.empty = void 0;
46
+ exports.endWhen_ = endWhen_;
47
+ exports.environment = exports.ensuring_ = void 0;
48
+ exports.environmentWith = environmentWith;
49
+ exports.environmentWithIO = environmentWithIO;
50
+ exports.environmentWithStream = environmentWithStream;
51
+ exports.fail = fail;
52
+ exports.failCause = failCause;
53
+ exports.failNow = exports.failCauseNow = void 0;
54
+ exports.filterIO_ = filterIO_;
55
+ exports.filterMapIO_ = filterMapIO_;
56
+ exports.filterMap_ = void 0;
57
+ exports.filter_ = filter_;
58
+ exports.findIO_ = findIO_;
59
+ exports.find_ = find_;
60
+ exports.forever = exports.flattenTake = exports.flattenExitOption = exports.flattenChunks = exports.flatten = exports.flatMap_ = void 0;
61
+ exports.fromAsyncIterable = fromAsyncIterable;
62
+ exports.fromIOMaybe = exports.fromIO = exports.fromChunkNow = exports.fromChunk = void 0;
63
+ exports.fromIterable = fromIterable;
64
+ exports.fromIterableSingle = fromIterableSingle;
65
+ exports.halt = exports.fromQueue_ = exports.fromQueueWithShutdown = exports.fromPull = void 0;
66
+ exports.haltNow = haltNow;
67
+ exports.haltWhenFuture_ = haltWhenFuture_;
68
+ exports.haltWhen_ = haltWhen_;
69
+ exports.interleaveWith_ = void 0;
70
+ exports.interleave_ = interleave_;
71
+ exports.interruptWhenFuture_ = interruptWhenFuture_;
72
+ exports.interruptWhen_ = interruptWhen_;
73
+ exports.intersperse_ = intersperse_;
74
+ exports.mapAccumIO_ = exports.loopOnPartialChunks_ = exports.loopOnPartialChunksElements_ = exports.loopOnChunks_ = void 0;
75
+ exports.mapAccum_ = mapAccum_;
76
+ exports.mapChunksIO_ = mapChunksIO_;
77
+ exports.mapChunks_ = void 0;
78
+ exports.mapConcatChunkIO_ = mapConcatChunkIO_;
79
+ exports.mapConcatChunk_ = void 0;
80
+ exports.mapConcatIO_ = mapConcatIO_;
81
+ exports.mapConcat_ = mapConcat_;
82
+ exports.mapErrorCause_ = mapErrorCause_;
83
+ exports.mapError_ = void 0;
84
+ exports.mapIOC_ = mapIOC_;
85
+ exports.mergeEither_ = exports.map_ = exports.mapIO_ = void 0;
86
+ exports.mergeMapIO_ = mergeMapIO_;
87
+ exports.mergeMap_ = void 0;
88
+ exports.mergeWithHandler = mergeWithHandler;
89
+ exports.mergeWith_ = void 0;
90
+ exports.onError_ = onError_;
91
+ exports.orElseEither_ = orElseEither_;
92
+ exports.orElseFail_ = orElseFail_;
93
+ exports.orElseOptional_ = orElseOptional_;
94
+ exports.orElseSucceed_ = orElseSucceed_;
95
+ exports.provideLayer_ = exports.provideEnvironment_ = exports.pipeThrough_ = exports.orElse_ = void 0;
96
+ exports.provideSomeLayer_ = provideSomeLayer_;
97
+ exports.rechunk_ = rechunk_;
98
+ exports.repeatIO = repeatIO;
99
+ exports.repeatIOChunk = repeatIOChunk;
100
+ exports.repeatIOMaybe = exports.repeatIOChunkMaybe = void 0;
101
+ exports.repeatValue = repeatValue;
102
+ exports.runCollect = runCollect;
103
+ exports.runDrain = runDrain;
104
+ exports.scanReduceIO_ = exports.scanIO_ = exports.run_ = exports.runScoped_ = exports.runIntoQueueScoped_ = exports.runIntoHubScoped_ = exports.runIntoElementsScoped_ = exports.runForeachScoped_ = void 0;
105
+ exports.scanReduce_ = scanReduce_;
106
+ exports.scan_ = scan_;
107
+ exports.scoped = void 0;
108
+ exports.succeed = succeed;
109
+ exports.succeedNow = void 0;
110
+ exports.takeUntilIO_ = takeUntilIO_;
111
+ exports.takeUntil_ = takeUntil_;
112
+ exports.take_ = take_;
113
+ exports.tap_ = tap_;
114
+ exports.throttleEnforceIO_ = void 0;
115
+ exports.throttleEnforce_ = throttleEnforce_;
116
+ exports.toPull = exports.toHub_ = void 0;
117
+ exports.toQueueDropping_ = toQueueDropping_;
118
+ exports.toQueueOfElements_ = void 0;
119
+ exports.toQueueSliding_ = toQueueSliding_;
120
+ exports.toQueue_ = exports.toQueueUnbounded = void 0;
121
+ exports.unfold = unfold;
122
+ exports.unwrapScoped = exports.unwrap = exports.unfoldIO = exports.unfoldChunkIO = exports.unfoldChunk = void 0;
123
+ exports.zipWithLatest_ = zipWithLatest_;
124
+
125
+ var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api"));
126
+
127
+ var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Schedule/api"));
128
+
129
+ var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
130
+
131
+ var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/destructors"));
132
+
133
+ var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/Handoff"));
134
+
135
+ var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Ref/constructors"));
136
+
137
+ var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api/empty"));
138
+
139
+ var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Schedule/api/driver"));
140
+
141
+ var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/sequenceT"));
142
+
143
+ var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api"));
144
+
145
+ var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/core-api"));
146
+
147
+ var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api"));
148
+
149
+ var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Ref/api/set"));
150
+
151
+ var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Ref/api/modify"));
152
+
153
+ var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
154
+
155
+ var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/destructors"));
156
+
157
+ var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/constructors"));
158
+
159
+ var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/constructors"));
160
+
161
+ var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/SinkEndReason"));
162
+
163
+ var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/interrupt"));
164
+
165
+ var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/forkScoped"));
166
+
167
+ var tsplus_module_22 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/core-scope"));
168
+
169
+ var tsplus_module_23 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/runScoped"));
170
+
171
+ var tsplus_module_24 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/Take"));
172
+
173
+ var tsplus_module_25 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Queue/api/operations"));
174
+
175
+ var tsplus_module_26 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/runtime"));
176
+
177
+ var tsplus_module_27 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Queue/constructors"));
178
+
179
+ var tsplus_module_28 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/acquireRelease"));
180
+
181
+ var tsplus_module_29 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/acquireReleaseExit"));
182
+
183
+ var tsplus_module_30 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Hub/api"));
184
+
185
+ var tsplus_module_31 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api/replicate"));
186
+
187
+ var tsplus_module_32 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/api"));
188
+
189
+ var tsplus_module_33 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/api"));
190
+
191
+ var tsplus_module_34 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/constructors"));
192
+
193
+ var tsplus_module_35 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Ref/api/get"));
194
+
195
+ var tsplus_module_36 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/api"));
196
+
197
+ var tsplus_module_37 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/constructors"));
198
+
199
+ var tsplus_module_38 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/DebounceState"));
200
+
201
+ var tsplus_module_39 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/join"));
202
+
203
+ var tsplus_module_40 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Clock/api"));
204
+
205
+ var tsplus_module_41 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashMap/api"));
206
+
207
+ var tsplus_module_42 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/TSemaphore/api"));
208
+
209
+ var tsplus_module_43 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/STM/api"));
210
+
211
+ var tsplus_module_44 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/TSemaphore/constructors"));
212
+
213
+ var tsplus_module_45 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Sink/api"));
214
+
215
+ var tsplus_module_46 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Predicate/api"));
216
+
217
+ var tsplus_module_47 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/poll"));
218
+
219
+ var tsplus_module_48 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
220
+
221
+ var tsplus_module_49 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/collection/immutable/Conc/findIO"));
222
+
223
+ var tsplus_module_50 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/definition"));
224
+
225
+ var tsplus_module_51 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/Pull"));
226
+
227
+ var tsplus_module_52 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Queue/api/takeBetween"));
228
+
229
+ var tsplus_module_53 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/interruptWhen"));
230
+
231
+ var tsplus_module_54 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/collection/immutable/Conc/mapIO"));
232
+
233
+ var tsplus_module_55 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mapOutIOC"));
234
+
235
+ var tsplus_module_56 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mergeMap"));
236
+
237
+ var tsplus_module_57 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/internal/MergeDecision"));
238
+
239
+ var tsplus_module_58 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mergeWith"));
240
+
241
+ var tsplus_module_59 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/MemoMap"));
242
+
243
+ var tsplus_module_60 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/api"));
244
+
245
+ var tsplus_module_61 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/runDrain"));
246
+
247
+ var tsplus_module_62 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/exceptions"));
248
+
249
+ var tsplus_module_63 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/collection/immutable/Conc/takeWhileIO"));
250
+
251
+ var tsplus_module_64 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/toPull"));
252
+
253
+ var _function = /*#__PURE__*/require("@fncts/base/data/function");
254
+
255
+ var _definition2 = /*#__PURE__*/require("./definition.js");
256
+
257
+ var _SinkEndReason2 = /*#__PURE__*/require("./internal/SinkEndReason.js");
258
+
259
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
260
+
261
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
262
+
263
+ const fileName_1 = "(@fncts/io) src/Stream/api.ts";
264
+ const aggregateAsyncWithin_ = aggregateAsyncWithin_1;
265
+ exports.aggregateAsyncWithin_ = aggregateAsyncWithin_;
266
+ const aggregateAsyncWithinEither_ = aggregateAsyncWithinEither_1;
267
+ exports.aggregateAsyncWithinEither_ = aggregateAsyncWithinEither_;
268
+ const apSecond_ = apSecond_1;
269
+ exports.apSecond_ = apSecond_;
270
+ const asyncInterrupt = asyncInterrupt_1;
271
+ exports.asyncInterrupt = asyncInterrupt;
272
+ const asyncMaybe = asyncMaybe_1;
273
+ exports.asyncMaybe = asyncMaybe;
274
+ const broadcastedQueues_ = broadcastedQueues_1;
275
+ exports.broadcastedQueues_ = broadcastedQueues_;
276
+ const broadcastedQueuesDynamic_ = broadcastedQueuesDynamic_1;
277
+ exports.broadcastedQueuesDynamic_ = broadcastedQueuesDynamic_;
278
+ const catchAll_ = catchAll_1;
279
+ exports.catchAll_ = catchAll_;
280
+ const catchAllCause_ = catchAllCause_1;
281
+ exports.catchAllCause_ = catchAllCause_;
282
+ const flatMap_ = flatMap_1;
283
+ exports.flatMap_ = flatMap_;
284
+ const concat_ = concat_1;
285
+ exports.concat_ = concat_;
286
+ const crossWith_ = crossWith_1;
287
+ exports.crossWith_ = crossWith_;
288
+ const distributedWithDynamic_ = distributedWithDynamic_1;
289
+ exports.distributedWithDynamic_ = distributedWithDynamic_;
290
+ const drop_ = drop_1;
291
+ exports.drop_ = drop_;
292
+ const dropWhile_ = dropWhile_1;
293
+ exports.dropWhile_ = dropWhile_;
294
+ const ensuring_ = ensuring_1;
295
+ exports.ensuring_ = ensuring_;
296
+ const environment = environment_1;
297
+ exports.environment = environment;
298
+ const failNow = failNow_1;
299
+ exports.failNow = failNow;
300
+ const failCauseNow = failCauseNow_1;
301
+ exports.failCauseNow = failCauseNow;
302
+ const filterMap_ = filterMap_1;
303
+ exports.filterMap_ = filterMap_;
304
+ const flatten = flatten_1;
305
+ exports.flatten = flatten;
306
+ const flattenExitOption = flattenExitOption_1;
307
+ exports.flattenExitOption = flattenExitOption;
308
+ const flattenTake = flattenTake_1;
309
+ exports.flattenTake = flattenTake;
310
+ const flattenChunks = flattenChunks_1;
311
+ exports.flattenChunks = flattenChunks;
312
+ const forever = forever_1;
313
+ exports.forever = forever;
314
+ const fromChunkNow = fromChunkNow_1;
315
+ exports.fromChunkNow = fromChunkNow;
316
+ const fromChunk = fromChunk_1;
317
+ exports.fromChunk = fromChunk;
318
+ const scoped = scoped_1;
319
+ exports.scoped = scoped;
320
+ const fromIO = fromIO_1;
321
+ exports.fromIO = fromIO;
322
+ const fromIOMaybe = fromIOMaybe_1;
323
+ exports.fromIOMaybe = fromIOMaybe;
324
+ const fromPull = fromPull_1;
325
+ exports.fromPull = fromPull;
326
+ const fromQueue_ = fromQueue_1;
327
+ exports.fromQueue_ = fromQueue_;
328
+ const fromQueueWithShutdown = fromQueueWithShutdown_1;
329
+ exports.fromQueueWithShutdown = fromQueueWithShutdown;
330
+ const halt = halt_1;
331
+ exports.halt = halt;
332
+ const interleaveWith_ = interleaveWith_1;
333
+ exports.interleaveWith_ = interleaveWith_;
334
+ const loopOnChunks_ = loopOnChunks_1;
335
+ exports.loopOnChunks_ = loopOnChunks_;
336
+ const loopOnPartialChunks_ = loopOnPartialChunks_1;
337
+ exports.loopOnPartialChunks_ = loopOnPartialChunks_;
338
+ const loopOnPartialChunksElements_ = loopOnPartialChunksElements_1;
339
+ exports.loopOnPartialChunksElements_ = loopOnPartialChunksElements_;
340
+ const map_ = map_1;
341
+ exports.map_ = map_;
342
+ const mapAccumIO_ = mapAccumIO_1;
343
+ exports.mapAccumIO_ = mapAccumIO_;
344
+ const mapChunks_ = mapChunks_1;
345
+ exports.mapChunks_ = mapChunks_;
346
+ const mapConcatChunk_ = mapConcatChunk_1;
347
+ exports.mapConcatChunk_ = mapConcatChunk_;
348
+ const mapError_ = mapError_1;
349
+ exports.mapError_ = mapError_;
350
+ const mapIO_ = mapIO_1;
351
+ exports.mapIO_ = mapIO_;
352
+ const mergeMap_ = mergeMap_1;
353
+ exports.mergeMap_ = mergeMap_;
354
+ const mergeEither_ = mergeEither_1;
355
+ exports.mergeEither_ = mergeEither_;
356
+ const mergeWith_ = mergeWith_1;
357
+ exports.mergeWith_ = mergeWith_;
358
+ const orElse_ = orElse_1;
359
+ exports.orElse_ = orElse_;
360
+ const pipeThrough_ = pipeThrough_1;
361
+ exports.pipeThrough_ = pipeThrough_;
362
+ const provideEnvironment_ = provideEnvironment_1;
363
+ exports.provideEnvironment_ = provideEnvironment_;
364
+ const provideLayer_ = provideLayer_1;
365
+ exports.provideLayer_ = provideLayer_;
366
+ const repeatIOMaybe = repeatIOMaybe_1;
367
+ exports.repeatIOMaybe = repeatIOMaybe;
368
+ const repeatIOChunkMaybe = repeatIOChunkMaybe_1;
369
+ exports.repeatIOChunkMaybe = repeatIOChunkMaybe;
370
+ const run_ = run_1;
371
+ exports.run_ = run_;
372
+ const runForeachScoped_ = runForeachScoped_1;
373
+ exports.runForeachScoped_ = runForeachScoped_;
374
+ const runIntoElementsScoped_ = runIntoElementsScoped_1;
375
+ exports.runIntoElementsScoped_ = runIntoElementsScoped_;
376
+ const runIntoQueueScoped_ = runIntoQueueScoped_1;
377
+ exports.runIntoQueueScoped_ = runIntoQueueScoped_;
378
+ const runIntoHubScoped_ = runIntoHubScoped_1;
379
+ exports.runIntoHubScoped_ = runIntoHubScoped_;
380
+ const runScoped_ = runScoped_1;
381
+ exports.runScoped_ = runScoped_;
382
+ const scanIO_ = scanIO_1;
383
+ exports.scanIO_ = scanIO_;
384
+ const scanReduceIO_ = scanReduceIO_1;
385
+ exports.scanReduceIO_ = scanReduceIO_;
386
+ const succeedNow = succeedNow_1;
387
+ exports.succeedNow = succeedNow;
388
+ const throttleEnforceIO_ = throttleEnforceIO_1;
389
+ exports.throttleEnforceIO_ = throttleEnforceIO_;
390
+ const toHub_ = toHub_1;
391
+ exports.toHub_ = toHub_;
392
+ const toPull = toPull_1;
393
+ exports.toPull = toPull;
394
+ const toQueue_ = toQueue_1;
395
+ exports.toQueue_ = toQueue_;
396
+ const toQueueOfElements_ = toQueueOfElements_1;
397
+ exports.toQueueOfElements_ = toQueueOfElements_;
398
+ const toQueueUnbounded = toQueueUnbounded_1;
399
+ exports.toQueueUnbounded = toQueueUnbounded;
400
+ const unfoldChunkIO = unfoldChunkIO_1;
401
+ exports.unfoldChunkIO = unfoldChunkIO;
402
+ const unfoldIO = unfoldIO_1;
403
+ exports.unfoldIO = unfoldIO;
404
+ const unfoldChunk = unfoldChunk_1;
405
+ exports.unfoldChunk = unfoldChunk;
406
+ const unwrap = unwrap_1;
407
+ exports.unwrap = unwrap;
408
+ const unwrapScoped = unwrapScoped_1;
409
+ exports.unwrapScoped = unwrapScoped;
410
+
411
+ /**
412
+ * Submerges the error case of an `Either` into the `Stream`.
413
+ *
414
+ * @tsplus getter fncts.io.Stream absolve
415
+ */
416
+ function absolve(self) {
417
+ return mapIO_1(self, either => tsplus_module_1.fromEither(() => either, fileName_1 + ":24:46"));
418
+ }
419
+ /**
420
+ * Aggregates elements of this stream using the provided sink for as long
421
+ * as the downstream operators on the stream are busy.
422
+ *
423
+ * This operator divides the stream into two asynchronous "islands". Operators upstream
424
+ * of this operator run on one fiber, while downstream operators run on another. Whenever
425
+ * the downstream fiber is busy processing elements, the upstream fiber will feed elements
426
+ * into the sink until it signals completion.
427
+ *
428
+ * Any sink can be used here, but see `Sink.foldWeightedM` and `Sink.foldUntilM` for
429
+ * sinks that cover the common usecases.
430
+ *
431
+ * @tsplus fluent fncts.io.Stream aggregateAsync
432
+ */
433
+
434
+
435
+ function aggregateAsync_(stream, sink) {
436
+ return aggregateAsyncWithin_1(stream, sink, tsplus_module_2.forever);
437
+ }
438
+ /**
439
+ * Like `aggregateAsyncWithinEither`, but only returns the `Right` results.
440
+ *
441
+ * @tsplus fluent fncts.io.Stream aggregateAsyncWithin
442
+ */
443
+
444
+
445
+ function aggregateAsyncWithin_1(stream, sink, schedule) {
446
+ return filterMap_1(aggregateAsyncWithinEither_1(stream, sink, schedule), cb => tsplus_module_4.match_(cb, () => tsplus_module_3.nothing(), tsplus_module_3.just));
447
+ }
448
+ /**
449
+ * Aggregates elements using the provided sink until it completes, or until the
450
+ * delay signalled by the schedule has passed.
451
+ *
452
+ * This operator divides the stream into two asynchronous islands. Operators upstream
453
+ * of this operator run on one fiber, while downstream operators run on another. Elements
454
+ * will be aggregated by the sink until the downstream fiber pulls the aggregated value,
455
+ * or until the schedule's delay has passed.
456
+ *
457
+ * Aggregated elements will be fed into the schedule to determine the delays between
458
+ * pulls.
459
+ *
460
+ * @tsplus fluent fncts.io.Stream aggregateAsyncWithinEither
461
+ */
462
+
463
+
464
+ function aggregateAsyncWithinEither_1(stream, sink, schedule) {
465
+ const deps = tsplus_module_9.sequenceT(tsplus_module_5.make(), tsplus_module_6.make(() => new _SinkEndReason2.SinkEnd()), tsplus_module_6.make(() => tsplus_module_7.empty()), tsplus_module_8.driver(schedule));
466
+ return flatMap_1(fromIO_1(deps), ([handoff, sinkEndReason, sinkLeftovers, scheduleDriver]) => {
467
+ const handoffProducer = tsplus_module_10.readWithCause(_in => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_5.emit(_in))), handoffProducer), cause => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_5.halt(cause))), _ => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_5.end(new _SinkEndReason2.UpstreamEnd()))));
468
+ const handoffConsumer = tsplus_module_10.unwrap(tsplus_module_1.flatMap_(tsplus_module_14.getAndSet_(sinkLeftovers, tsplus_module_7.empty()), leftovers => {
469
+ if (tsplus_module_12.isEmpty(leftovers)) {
470
+ return tsplus_module_1.succeedNow(tsplus_module_11.apSecond_(tsplus_module_10.writeNow(leftovers), handoffConsumer), fileName_1 + ":100:31");
471
+ } else {
472
+ return tsplus_module_1.map_(tsplus_module_5.take(handoff), signal => tsplus_module_5.matchSignal_(signal, {
473
+ Emit: ({
474
+ els
475
+ }) => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(els), handoffConsumer),
476
+ Halt: ({
477
+ error
478
+ }) => tsplus_module_11.failCause(() => error),
479
+ End: ({
480
+ reason
481
+ }) => tsplus_module_10.fromIO(tsplus_module_13.set_(sinkEndReason, reason))
482
+ }), fileName_1 + ":102:34");
483
+ }
484
+ }, fileName_1 + ":98:55"));
485
+
486
+ const scheduledAggregator = lastB => {
487
+ const timeout = tsplus_module_1.matchCauseIO_(scheduleDriver.next(lastB, fileName_1 + ":116:42"), _ => tsplus_module_4.match_(tsplus_module_15.failureOrCause(_), () => tsplus_module_5.offer(handoff, tsplus_module_5.end(new _SinkEndReason2.ScheduleTimeout())), cause => tsplus_module_5.offer(handoff, tsplus_module_5.halt(cause))), c => tsplus_module_5.offer(handoff, tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd(c))), fileName_1 + ":116:62");
488
+ return tsplus_module_11.flatMap_(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_21.forkScoped(timeout), fiber => {
489
+ return tsplus_module_11.flatMap_(tsplus_module_10.doneCollect(tsplus_module_10.pipeToOrFail_(handoffConsumer, sink.channel)), ([leftovers, b]) => {
490
+ return tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_1.apSecond_(tsplus_module_20.interrupt(fiber), tsplus_module_13.set_(sinkLeftovers, tsplus_module_12.flatten(leftovers)), fileName_1 + ":128:59")), tsplus_module_10.unwrap(tsplus_module_14.modify_(sinkEndReason, reason => tsplus_module_19.matchSinkEndReason_(reason, {
491
+ ScheduleEnd: ({
492
+ c
493
+ }) => (0, _function.tuple)(tsplus_module_10.as_(tsplus_module_10.writeNow(tsplus_module_18.from([tsplus_module_17.right(b), tsplus_module_17.left(c)])), () => tsplus_module_3.just(b)), new _SinkEndReason2.SinkEnd()),
494
+ ScheduleTimeout: () => (0, _function.tuple)(tsplus_module_10.as_(tsplus_module_10.writeNow(tsplus_module_18.single(tsplus_module_17.right(b))), () => tsplus_module_3.just(b)), new _SinkEndReason2.SinkEnd()),
495
+ SinkEnd: () => (0, _function.tuple)(tsplus_module_10.as_(tsplus_module_10.writeNow(tsplus_module_18.single(tsplus_module_17.right(b))), () => tsplus_module_3.just(b)), new _SinkEndReason2.SinkEnd()),
496
+ UpstreamEnd: () => (0, _function.tuple)(tsplus_module_10.as_(tsplus_module_10.writeNow(tsplus_module_18.single(tsplus_module_17.right(b))), () => tsplus_module_3.nothing()), new _SinkEndReason2.UpstreamEnd())
497
+ }))));
498
+ });
499
+ }, fileName_1 + ":126:31")), _ => tsplus_module_16.match_(_, () => tsplus_module_10.unit, () => scheduledAggregator(_)));
500
+ };
501
+
502
+ return apSecond_1(scoped_1(tsplus_module_22.forkDaemon(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(stream.channel, handoffProducer)))), new _definition2.Stream(scheduledAggregator(tsplus_module_3.nothing())));
503
+ });
504
+ }
505
+ /**
506
+ * Composes this stream with the specified stream to create a cartesian product of elements,
507
+ * but keeps only elements from this stream.
508
+ * The `that` stream would be run multiple times, for every element in the `this` stream.
509
+ *
510
+ * @tsplus fluent fncts.io.Stream apFirst
511
+ */
512
+
513
+
514
+ function apFirst_(stream, that) {
515
+ return crossWith_1(stream, that, (a, _) => a);
516
+ }
517
+ /**
518
+ * Composes this stream with the specified stream to create a cartesian product of elements,
519
+ * but keeps only elements from the other stream.
520
+ * The `that` stream would be run multiple times, for every element in the `this` stream.
521
+ *
522
+ * @tsplus fluent fncts.io.Stream apSecond
523
+ */
524
+
525
+
526
+ function apSecond_1(stream, that) {
527
+ return crossWith_1(stream, that, (_, b) => b);
528
+ }
529
+ /**
530
+ * Maps the success values of this stream to the specified constant value.
531
+ *
532
+ * @tsplus fluent fncts.io.Stream as
533
+ */
534
+
535
+
536
+ function as_(stream, b) {
537
+ return map_1(stream, () => b());
538
+ }
539
+ /**
540
+ * @tsplus static fncts.io.StreamOps asyncInterrupt
541
+ */
542
+
543
+
544
+ function asyncInterrupt_1(register, outputBuffer = 16) {
545
+ return unwrapScoped_1(tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeBounded(outputBuffer), queue => tsplus_module_25.shutdown(queue)), output => tsplus_module_1.flatMap_(tsplus_module_26.runtime(fileName_1 + ":208:40"), runtime => tsplus_module_1.map_(tsplus_module_1.succeed(() => register((k, cb) => {
546
+ const effect = tsplus_module_1.flatMap_(tsplus_module_24.fromPull(k), a => tsplus_module_25.offer_(output, a), fileName_1 + ":212:52");
547
+ return runtime.unsafeRunAsyncWith(effect, cb || _function.constVoid, fileName_1 + ":213:46");
548
+ }), fileName_1 + ":210:19"), eitherStream => tsplus_module_4.match_(eitherStream, canceler => {
549
+ const loop = tsplus_module_10.unwrap(tsplus_module_1.match_(tsplus_module_1.flatMap_(tsplus_module_25.take(output), take => tsplus_module_24.done(take), fileName_1 + ":221:23"), maybeError => tsplus_module_16.match_(maybeError, () => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow), as => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(as), loop), fileName_1 + ":222:21"));
550
+ return ensuring_1(new _definition2.Stream(loop), canceler);
551
+ }, stream => unwrap_1(tsplus_module_1.as_(tsplus_module_25.shutdown(output), () => stream))), fileName_1 + ":209:29"), fileName_1 + ":208:29"), fileName_1 + ":207:29"));
552
+ }
553
+ /**
554
+ * Creates a stream from an asynchronous callback that can be called multiple times.
555
+ * The registration of the callback can possibly return the stream synchronously.
556
+ * The optionality of the error type `E` can be used to signal the end of the stream,
557
+ * by setting it to `None`.
558
+ *
559
+ * @tsplus static fncts.io.StreamOps asyncMaybe
560
+ */
561
+
562
+
563
+ function asyncMaybe_1(register, outputBuffer = 16) {
564
+ return asyncInterrupt_1(k => tsplus_module_16.match_(register(k), () => tsplus_module_17.left(tsplus_module_1.unit), tsplus_module_17.right), outputBuffer);
565
+ }
566
+ /**
567
+ * @tsplus static fncts.io.StreamOps async
568
+ */
569
+
570
+
571
+ function async(register, outputBuffer = 16) {
572
+ return asyncMaybe_1(cb => {
573
+ register(cb);
574
+ return tsplus_module_3.nothing();
575
+ }, outputBuffer);
576
+ }
577
+ /**
578
+ * @tsplus static fncts.io.StreamOps asyncIO
579
+ */
580
+
581
+
582
+ function asyncIO(register, outputBuffer = 16) {
583
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeBounded(outputBuffer), _ => tsplus_module_25.shutdown(_)), output => tsplus_module_1.flatMap_(tsplus_module_26.runtime(fileName_1 + ":278:37"), runtime => tsplus_module_1.map_(register((k, cb) => runtime.unsafeRunAsyncWith(tsplus_module_1.flatMap_(tsplus_module_24.fromPull(k), a => tsplus_module_25.offer_(output, a), fileName_1 + ":282:39"), cb || _function.constVoid, fileName_1 + ":281:39")), () => {
584
+ const loop = tsplus_module_10.unwrap(tsplus_module_1.matchCauseIO_(tsplus_module_1.flatMap_(tsplus_module_25.take(output), take => tsplus_module_24.done(take), fileName_1 + ":289:21"), cause => tsplus_module_1.as_(tsplus_module_25.shutdown(output), () => tsplus_module_4.match_(tsplus_module_15.failureOrCause(cause), maybeError => tsplus_module_16.match_(maybeError, () => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow), tsplus_module_11.failCauseNow)), as => tsplus_module_1.succeed(() => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(as), loop), fileName_1 + ":298:33"), fileName_1 + ":290:26"));
585
+ return loop;
586
+ }), fileName_1 + ":278:26"), fileName_1 + ":277:26")));
587
+ }
588
+ /**
589
+ * Returns a stream whose failure and success channels have been mapped by
590
+ * the specified pair of functions, `f` and `g`.
591
+ */
592
+
593
+
594
+ function bimap_(stream, f, g) {
595
+ return map_1(mapError_1(stream, f), g);
596
+ }
597
+ /**
598
+ * Creates a stream from a single value that will get cleaned up after the
599
+ * stream is consumed
600
+ *
601
+ * @tsplus static fncts.io.StreamOps acquireRelease
602
+ */
603
+
604
+
605
+ function acquireRelease_(acquire, release) {
606
+ return scoped_1(tsplus_module_28.acquireRelease(() => acquire, release));
607
+ }
608
+ /**
609
+ * Creates a stream from a single value that will get cleaned up after the
610
+ * stream is consumed
611
+ *
612
+ * @tsplus static fncts.io.StreamOps acquireReleaseExit
613
+ */
614
+
615
+
616
+ function acquireReleaseExit_(acquire, release) {
617
+ return scoped_1(tsplus_module_29.acquireReleaseExit(() => acquire, release, fileName_1 + ":338:45"));
618
+ }
619
+ /**
620
+ * Fan out the stream, producing a list of streams that have the same elements as this stream.
621
+ * The driver stream will only ever advance of the `maximumLag` chunks before the
622
+ * slowest downstream stream.
623
+ *
624
+ * @tsplus fluent fncts.io.Stream broadcast
625
+ */
626
+
627
+
628
+ function broadcast_(stream, n, maximumLag) {
629
+ return tsplus_module_1.map_(broadcastedQueues_1(stream, n, maximumLag), c => tsplus_module_12.map_(c, hub => flattenTake_1(fromQueueWithShutdown_1(hub))), fileName_1 + ":355:9");
630
+ }
631
+ /**
632
+ * Fan out the stream, producing a dynamic number of streams that have the same elements as this stream.
633
+ * The driver stream will only ever advance of the `maximumLag` chunks before the
634
+ * slowest downstream stream.
635
+ *
636
+ * @tsplus fluent fncts.io.Stream broadcastDynamic
637
+ */
638
+
639
+
640
+ function broadcastDynamic_(stream, maximumLag) {
641
+ return tsplus_module_1.map_(broadcastedQueuesDynamic_1(stream, maximumLag), scoped => flattenTake_1(flatMap_1(scoped_1(scoped), fromQueue_1)), fileName_1 + ":371:9");
642
+ }
643
+ /**
644
+ * Converts the stream to a managed list of queues. Every value will be replicated to every queue with the
645
+ * slowest queue being allowed to buffer `maximumLag` chunks before the driver is backpressured.
646
+ *
647
+ * Queues can unsubscribe from upstream by shutting down.
648
+ *
649
+ * @tsplus fluent fncts.io.Stream broadcastedQueues
650
+ */
651
+
652
+
653
+ function broadcastedQueues_1(stream, n, maximumLag) {
654
+ return tsplus_module_1.flatMap_(tsplus_module_30.makeBounded(maximumLag), hub => tsplus_module_1.flatMap_(tsplus_module_1.sequenceIterable(tsplus_module_31.replicate(n, tsplus_module_30.subscribe(hub))), queues => tsplus_module_1.map_(tsplus_module_1.fork(runIntoHubScoped_1(stream, hub)), () => queues), fileName_1 + ":389:21"), fileName_1 + ":388:21");
655
+ }
656
+ /**
657
+ * Converts the stream to a managed dynamic amount of queues. Every chunk will be replicated to every queue with the
658
+ * slowest queue being allowed to buffer `maximumLag` chunks before the driver is backpressured.
659
+ *
660
+ * Queues can unsubscribe from upstream by shutting down.
661
+ *
662
+ * @tsplus fluent fncts.io.Stream broadcastedQueuesDynamic
663
+ */
664
+
665
+
666
+ function broadcastedQueuesDynamic_1(stream, maximumLag) {
667
+ return tsplus_module_1.map_(toHub_1(stream, maximumLag), hub => tsplus_module_30.subscribe(hub), fileName_1 + ":407:38");
668
+ }
669
+ /**
670
+ * Allows a faster producer to progress independently of a slower consumer by buffering
671
+ * up to `capacity` elements in a queue.
672
+ *
673
+ * @tsplus fluent fncts.io.Stream buffer
674
+ */
675
+
676
+
677
+ function buffer_(stream, capacity) {
678
+ const queue = toQueueOfElements_1(stream, capacity);
679
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(queue, queue => {
680
+ const process = tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_25.take(queue)), exit => tsplus_module_32.match_(exit, cause => tsplus_module_16.match_(tsplus_module_15.flipCauseOption(cause), () => tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow), value => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(tsplus_module_18.single(value)), process)));
681
+ return process;
682
+ }, fileName_1 + ":420:16")));
683
+ }
684
+ /**
685
+ * @tsplus fluent fncts.io.Stream bufferChunks
686
+ */
687
+
688
+
689
+ function bufferChunks_(stream, capacity) {
690
+ const queue = toQueue_1(stream, capacity);
691
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(queue, queue => {
692
+ const process = tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_25.take(queue)), take => tsplus_module_24.match_(take, tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(value), process)));
693
+ return process;
694
+ }, fileName_1 + ":442:16")));
695
+ }
696
+ /**
697
+ * Allows a faster producer to progress independently of a slower consumer by buffering
698
+ * elements into an unbounded queue.
699
+ *
700
+ * @tsplus getter fncts.io.Stream bufferUnbounded
701
+ */
702
+
703
+
704
+ function bufferUnbounded(stream) {
705
+ const queue = toQueueUnbounded_1(stream);
706
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(queue, queue => {
707
+ const process = tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_25.take(queue)), take => tsplus_module_24.match_(take, tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(value), process)));
708
+ return process;
709
+ }, fileName_1 + ":467:16")));
710
+ }
711
+
712
+ function bufferSignalProducer(queue, ref) {
713
+ const terminate = take => tsplus_module_10.fromIO(tsplus_module_1.flatMap_(tsplus_module_35.get(ref), latch => tsplus_module_1.flatMap_(tsplus_module_33.wait(latch), () => tsplus_module_1.flatMap_(tsplus_module_34.make(), p => tsplus_module_1.flatMap_(tsplus_module_25.offer_(queue, (0, _function.tuple)(take, p)), () => tsplus_module_1.flatMap_(tsplus_module_13.set_(ref, p), () => tsplus_module_1.map_(tsplus_module_33.wait(p), () => void 0), fileName_1 + ":493:10"), fileName_1 + ":492:10"), fileName_1 + ":491:20"), fileName_1 + ":490:10"), fileName_1 + ":489:24"));
714
+
715
+ return tsplus_module_10.readWith(inp => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_1.flatMap_(tsplus_module_34.make(), p => tsplus_module_1.flatMap_(tsplus_module_25.offer_(queue, (0, _function.tuple)(tsplus_module_24.chunk(inp), p)), added => tsplus_module_1.map_(tsplus_module_1.when_(tsplus_module_13.set_(ref, p), () => added, fileName_1 + ":503:28"), () => void 0), fileName_1 + ":502:26"), fileName_1 + ":501:26")), bufferSignalProducer(queue, ref)), e => terminate(tsplus_module_24.fail(e)), () => terminate(tsplus_module_24.end));
716
+ }
717
+
718
+ function bufferSignalConsumer(queue) {
719
+ const process = tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_25.take(queue)), ([take, promise]) => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_33.succeed_(promise, undefined)), tsplus_module_24.match_(take, tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(value), process))));
720
+ return process;
721
+ }
722
+ /**
723
+ * Switches over to the stream produced by the provided function in case this one
724
+ * fails with a typed error.
725
+ *
726
+ * @tsplus fluent fncts.io.Stream catchAll
727
+ */
728
+
729
+
730
+ function catchAll_1(stream, f) {
731
+ return catchAllCause_1(stream, cause => tsplus_module_4.match_(tsplus_module_15.failureOrCause(cause), f, failCauseNow_1));
732
+ }
733
+ /**
734
+ * Switches over to the stream produced by the provided function in case this one
735
+ * fails. Allows recovery from all causes of failure, including interruption if the
736
+ * stream is uninterruptible.
737
+ *
738
+ * @tsplus fluent fncts.io.Stream catchAllCause
739
+ */
740
+
741
+
742
+ function catchAllCause_1(stream, f) {
743
+ const channel = tsplus_module_10.catchAllCause_(stream.channel, cause => f(cause).channel);
744
+ return new _definition2.Stream(channel);
745
+ }
746
+ /**
747
+ * Switches over to the stream produced by the provided function in case this one
748
+ * fails with some typed error.
749
+ *
750
+ * @tsplus fluent fncts.io.Stream catchJust
751
+ */
752
+
753
+
754
+ function catchJust_(stream, pf) {
755
+ return catchAll_1(stream, e => tsplus_module_36.getOrElse_(pf(e), () => failNow_1(e)));
756
+ }
757
+ /**
758
+ * Switches over to the stream produced by the provided function in case this one
759
+ * fails with some errors. Allows recovery from all causes of failure, including interruption if the
760
+ * stream is uninterruptible.
761
+ *
762
+ * @tsplus fluent fncts.io.Stream catchJustCause
763
+ */
764
+
765
+
766
+ function catchJustCause_(stream, pf) {
767
+ return catchAllCause_1(stream, cause => tsplus_module_36.getOrElse_(pf(cause), () => failCauseNow_1(cause)));
768
+ }
769
+ /**
770
+ * Returns a stream made of the concatenation in strict order of all the streams
771
+ * produced by passing each element of this stream to `f`
772
+ *
773
+ * @tsplus fluent fncts.io.Stream flatMap
774
+ */
775
+
776
+
777
+ function flatMap_1(stream, f) {
778
+ return new _definition2.Stream(tsplus_module_10.concatMap_(stream.channel, as => tsplus_module_12.foldLeft_(tsplus_module_12.map_(as, a => f(a).channel), tsplus_module_10.unit, (s, a) => tsplus_module_11.flatMap_(s, () => a))));
779
+ }
780
+ /**
781
+ * Exposes the underlying chunks of the stream as a stream of chunks of elements
782
+ *
783
+ * @tsplus getter fncts.io.Stream chunks
784
+ */
785
+
786
+
787
+ function chunks(stream) {
788
+ return mapChunks_1(stream, tsplus_module_18.single);
789
+ }
790
+
791
+ function changesWithWriter(f, last) {
792
+ return tsplus_module_10.readWithCause(chunk => {
793
+ const [newLast, newChunk] = tsplus_module_12.foldLeft_(chunk, [last, tsplus_module_7.empty()], ([maybeLast, os], o1) => tsplus_module_16.match_(maybeLast, () => [tsplus_module_3.just(o1), tsplus_module_12.append_(os, o1)], o => f(o, o1) ? [tsplus_module_3.just(o1), os] : [tsplus_module_3.just(o1), tsplus_module_12.append_(os, o1)]));
794
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(newChunk), changesWithWriter(f, newLast));
795
+ }, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit);
796
+ }
797
+ /**
798
+ * Returns a new stream that only emits elements that are not equal to the
799
+ * previous element emitted, using the specified function to determine
800
+ * whether two elements are equal.
801
+ *
802
+ * @tsplus fluent fncts.io.Stream changesWith
803
+ */
804
+
805
+
806
+ function changesWith_(stream, f) {
807
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, changesWithWriter(f, tsplus_module_3.nothing())));
808
+ }
809
+ /**
810
+ * Transforms all elements of the stream for as long as the specified partial function is defined.
811
+ *
812
+ * @tsplus fluent fncts.io.Stream collectWhile
813
+ */
814
+
815
+
816
+ function collectWhile_(stream, pf) {
817
+ const loop = tsplus_module_10.readWith(inp => {
818
+ const mapped = tsplus_module_12.collectWhile_(inp, pf);
819
+
820
+ if (mapped.length === inp.length) {
821
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(mapped), loop);
822
+ } else {
823
+ return tsplus_module_10.writeNow(mapped);
824
+ }
825
+ }, tsplus_module_10.failNow, tsplus_module_11.succeedNow);
826
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, loop));
827
+ }
828
+ /**
829
+ * Effectfully transforms all elements of the stream for as long as the specified partial function is defined.
830
+ */
831
+
832
+
833
+ function collectWhileIO_(stream, pf) {
834
+ return loopOnPartialChunks_1(stream, (chunk, emit) => {
835
+ const pfJust = a => tsplus_module_16.match_(pf(a), () => tsplus_module_1.succeedNow(false, fileName_1 + ":675:28"), effect => tsplus_module_1.as_(tsplus_module_1.flatMap_(effect, emit, fileName_1 + ":676:35"), () => true));
836
+
837
+ const loop = chunk => {
838
+ if (tsplus_module_12.isEmpty(chunk)) {
839
+ return tsplus_module_1.succeedNow(true, fileName_1 + ":681:29");
840
+ } else {
841
+ return tsplus_module_1.flatMap_(pfJust(tsplus_module_12.unsafeHead(chunk)), cont => cont ? loop(tsplus_module_12.unsafeTail(chunk)) : tsplus_module_1.succeedNow(false, fileName_1 + ":683:105"), fileName_1 + ":683:48");
842
+ }
843
+ };
844
+
845
+ return loop(chunk);
846
+ });
847
+ }
848
+
849
+ function combineProducer(handoff, latch) {
850
+ return tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.take(latch)), tsplus_module_10.readWithCause(value => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_37.succeed(value))), combineProducer(handoff, latch)), cause => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_37.failCause(tsplus_module_15.map_(cause, tsplus_module_3.just)))), () => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_37.fail(tsplus_module_3.nothing()))), combineProducer(handoff, latch))));
851
+ }
852
+ /**
853
+ * Combines the elements from this stream and the specified stream by repeatedly applying the
854
+ * function `f` to extract an element using both sides and conceptually "offer"
855
+ * it to the destination stream. `f` can maintain some internal state to control
856
+ * the combining process, with the initial state being specified by `s`.
857
+ *
858
+ * Where possible, prefer `Stream#combineChunks` for a more efficient implementation.
859
+ *
860
+ * @tsplus fluent fncts.io.Stream combine
861
+ */
862
+
863
+
864
+ function combine_(stream, that, s, f) {
865
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_1.flatMap_(tsplus_module_5.make(), left => tsplus_module_1.flatMap_(tsplus_module_5.make(), right => tsplus_module_1.flatMap_(tsplus_module_5.make(), latchL => tsplus_module_1.flatMap_(tsplus_module_5.make(), latchR => tsplus_module_1.flatMap_(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(tsplus_module_10.concatMap_(stream.channel, tsplus_module_10.writeChunk), combineProducer(left, latchL)))), () => tsplus_module_1.map_(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(tsplus_module_10.concatMap_(that.channel, tsplus_module_10.writeChunk), combineProducer(right, latchR)))), () => (0, _function.tuple)(left, right, latchL, latchR)), fileName_1 + ":731:10"), fileName_1 + ":730:25"), fileName_1 + ":729:25"), fileName_1 + ":728:25"), fileName_1 + ":727:25"), ([left, right, latchL, latchR]) => {
866
+ const pullLeft = tsplus_module_1.flatMap_(tsplus_module_1.apSecond_(tsplus_module_5.offer(latchL, undefined), tsplus_module_5.take(left), fileName_1 + ":735:59"), tsplus_module_1.fromExitNow, fileName_1 + ":735:78");
867
+ const pullRight = tsplus_module_1.flatMap_(tsplus_module_1.apSecond_(tsplus_module_5.offer(latchR, undefined), tsplus_module_5.take(right), fileName_1 + ":736:59"), tsplus_module_1.fromExitNow, fileName_1 + ":736:79");
868
+ return unfoldIO_1(s, s => tsplus_module_1.flatMap_(f(s, pullLeft, pullRight), exit => tsplus_module_1.optional(tsplus_module_1.fromExitNow(exit, fileName_1 + ":737:100")), fileName_1 + ":737:75")).channel;
869
+ }, fileName_1 + ":734:13")));
870
+ }
871
+
872
+ function combineChunksProducer(handoff, latch) {
873
+ return tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.take(latch)), tsplus_module_10.readWithCause(chunk => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_24.chunk(chunk))), combineChunksProducer(handoff, latch)), cause => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_24.failCause(cause))), () => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_24.end)), combineChunksProducer(handoff, latch))));
874
+ }
875
+ /**
876
+ * Combines the chunks from this stream and the specified stream by repeatedly applying the
877
+ * function `f` to extract a chunk using both sides and conceptually "offer"
878
+ * it to the destination stream. `f` can maintain some internal state to control
879
+ * the combining process, with the initial state being specified by `s`.
880
+ *
881
+ * @tsplus fluent fncts.io.Stream combineChunks
882
+ */
883
+
884
+
885
+ function combineChunks_(stream, that, s, f) {
886
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_1.flatMap_(tsplus_module_5.make(), left => tsplus_module_1.flatMap_(tsplus_module_5.make(), right => tsplus_module_1.flatMap_(tsplus_module_5.make(), latchL => tsplus_module_1.flatMap_(tsplus_module_5.make(), latchR => tsplus_module_1.flatMap_(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(stream.channel, combineChunksProducer(left, latchL)))), () => tsplus_module_1.map_(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(that.channel, combineChunksProducer(right, latchR)))), () => (0, _function.tuple)(left, right, latchL, latchR)), fileName_1 + ":782:10"), fileName_1 + ":781:25"), fileName_1 + ":780:25"), fileName_1 + ":779:25"), fileName_1 + ":778:25"), ([left, right, latchL, latchR]) => {
887
+ const pullLeft = tsplus_module_1.flatMap_(tsplus_module_1.apSecond_(tsplus_module_5.offer(latchL, undefined), tsplus_module_5.take(left), fileName_1 + ":788:20"), take => tsplus_module_24.done(take), fileName_1 + ":789:19");
888
+ const pullRight = tsplus_module_1.flatMap_(tsplus_module_1.apSecond_(tsplus_module_5.offer(latchR, undefined), tsplus_module_5.take(right), fileName_1 + ":792:20"), take => tsplus_module_24.done(take), fileName_1 + ":793:19");
889
+ return unfoldChunkIO_1(s, s => tsplus_module_1.flatMap_(f(s, pullLeft, pullRight), exit => tsplus_module_1.optional(tsplus_module_1.fromExit(() => exit, fileName_1 + ":794:102")), fileName_1 + ":794:80")).channel;
890
+ }, fileName_1 + ":785:13")));
891
+ }
892
+ /**
893
+ * Concatenates the specified stream with this stream, resulting in a stream
894
+ * that emits the elements from this stream and then the elements from the specified stream.
895
+ *
896
+ * @tsplus fluent fncts.io.Stream concat
897
+ */
898
+
899
+
900
+ function concat_1(stream, that) {
901
+ return new _definition2.Stream(tsplus_module_11.apSecond_(stream.channel, that.channel));
902
+ }
903
+ /**
904
+ * Composes this stream with the specified stream to create a cartesian product of elements.
905
+ * The `that` stream would be run multiple times, for every element in the `this` stream.
906
+ *
907
+ * @tsplus fluent fncts.io.Stream cross
908
+ */
909
+
910
+
911
+ function cross_(stream, that) {
912
+ return new _definition2.Stream(tsplus_module_10.concatMap_(stream.channel, as => tsplus_module_10.mapOut_(that.channel, bs => tsplus_module_12.flatMap_(as, a => tsplus_module_12.map_(bs, b => (0, _function.tuple)(a, b))))));
913
+ }
914
+ /**
915
+ * Composes this stream with the specified stream to create a cartesian product of elements
916
+ * with a specified function.
917
+ * The `fb` stream would be run multiple times, for every element in the `fa` stream.
918
+ *
919
+ * @tsplus fluent fncts.io.Stream crossWith
920
+ */
921
+
922
+
923
+ function crossWith_1(fa, fb, f) {
924
+ return flatMap_1(fa, a => map_1(fb, b => f(a, b)));
925
+ }
926
+ /**
927
+ * Provides some of the environment required to run this effect,
928
+ * leaving the remainder `R0`.
929
+ *
930
+ * @tsplus fluent fncts.io.Stream contramapEnvironment
931
+ */
932
+
933
+
934
+ function contramapEnvironment_(ra, f) {
935
+ return flatMap_1(environment_1(), r0 => provideEnvironment_1(ra, f(r0)));
936
+ }
937
+ /**
938
+ * @tsplus fluent fncts.io.Stream debounce
939
+ */
940
+
941
+
942
+ function debounce_(stream, duration) {
943
+ return unwrap_1(tsplus_module_22.transplant(grafter => tsplus_module_1.map_(tsplus_module_5.make(), handoff => {
944
+ function enqueue(last) {
945
+ return tsplus_module_1.map_(grafter(tsplus_module_1.fork(tsplus_module_1.as_(tsplus_module_40.sleep(duration, fileName_1 + ":866:37"), () => last))), f => consumer(tsplus_module_38.previous(f)), fileName_1 + ":866:66");
946
+ }
947
+
948
+ const producer = tsplus_module_10.readWithCause(inp => tsplus_module_16.match_(tsplus_module_12.last(inp), () => producer, last => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_5.emit(tsplus_module_18.single(last)))), producer)), cause => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_5.halt(cause))), () => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_5.end(new _SinkEndReason2.UpstreamEnd()))));
949
+
950
+ function consumer(state) {
951
+ return tsplus_module_10.unwrap(tsplus_module_38.match_(state, {
952
+ NotStarted: () => tsplus_module_1.map_(tsplus_module_5.take(handoff), signal => tsplus_module_5.matchSignal_(signal, {
953
+ Emit: ({
954
+ els
955
+ }) => tsplus_module_10.unwrap(enqueue(els)),
956
+ Halt: ({
957
+ error
958
+ }) => tsplus_module_11.failCauseNow(error),
959
+ End: () => tsplus_module_10.unit
960
+ }), fileName_1 + ":881:33"),
961
+ Current: ({
962
+ fiber
963
+ }) => tsplus_module_1.map_(tsplus_module_39.join(fiber), signal => tsplus_module_5.matchSignal_(signal, {
964
+ Emit: ({
965
+ els
966
+ }) => tsplus_module_10.unwrap(enqueue(els)),
967
+ Halt: ({
968
+ error
969
+ }) => tsplus_module_11.failCauseNow(error),
970
+ End: () => tsplus_module_10.unit
971
+ }), fileName_1 + ":889:31"),
972
+ Previous: ({
973
+ fiber
974
+ }) => tsplus_module_22.raceWith_(tsplus_module_39.join(fiber), () => tsplus_module_5.take(handoff), (ex, current) => tsplus_module_32.match_(ex, cause => tsplus_module_1.as_(tsplus_module_20.interrupt(current), () => tsplus_module_11.failCauseNow(cause)), chunk => tsplus_module_1.succeedNow(tsplus_module_11.apSecond_(tsplus_module_10.writeNow(chunk), consumer(tsplus_module_38.current(current))), fileName_1 + ":903:38")), (ex, previous) => tsplus_module_32.match_(ex, cause => tsplus_module_1.as_(tsplus_module_20.interrupt(previous), () => tsplus_module_11.failCauseNow(cause)), signal => tsplus_module_5.matchSignal_(signal, {
975
+ Emit: ({
976
+ els
977
+ }) => tsplus_module_1.apSecond_(tsplus_module_20.interrupt(previous), enqueue(els), fileName_1 + ":910:73"),
978
+ Halt: ({
979
+ error
980
+ }) => tsplus_module_1.as_(tsplus_module_20.interrupt(previous), () => tsplus_module_11.failCauseNow(error)),
981
+ End: () => tsplus_module_1.map_(tsplus_module_39.join(previous), chunk => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(chunk), tsplus_module_10.unit), fileName_1 + ":912:55")
982
+ })), fileName_1 + ":897:36")
983
+ }));
984
+ }
985
+
986
+ return apSecond_1(scoped_1(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(stream.channel, producer)))), new _definition2.Stream(consumer(tsplus_module_38.notStarted)));
987
+ }, fileName_1 + ":864:26"), fileName_1 + ":862:18"));
988
+ }
989
+
990
+ function defaultIfEmptyWriter(fb) {
991
+ return tsplus_module_10.readWith(i => tsplus_module_12.isEmpty(i) ? defaultIfEmptyWriter(fb) : tsplus_module_11.apSecond_(tsplus_module_10.writeNow(i), tsplus_module_10.id()), tsplus_module_10.failNow, () => fb.channel);
992
+ }
993
+ /**
994
+ * Switches to the provided stream in case this one is empty.
995
+ *
996
+ * @tsplus fluent fncts.io.Stream defaultIfEmpty
997
+ */
998
+
999
+
1000
+ function defaultIfEmpty_(fa, fb) {
1001
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(fa.channel, defaultIfEmptyWriter(fb)));
1002
+ }
1003
+ /**
1004
+ * More powerful version of `broadcast`. Allows to provide a function that determines what
1005
+ * queues should receive which elements. The decide function will receive the indices of the queues
1006
+ * in the resulting list.
1007
+ *
1008
+ * @tsplus fluent fncts.io.Stream distributedWith
1009
+ */
1010
+
1011
+
1012
+ function distributedWith_(self, n, maximumLag, decide) {
1013
+ return tsplus_module_1.flatMap_(tsplus_module_34.make(), p => tsplus_module_1.flatMap_(distributedWithDynamic_1(self, maximumLag, a => tsplus_module_1.flatMap_(tsplus_module_33.wait(p), f => f(a), fileName_1 + ":968:31"), () => tsplus_module_1.unit), next => tsplus_module_1.flatMap_(tsplus_module_1.sequenceIterable(tsplus_module_12.map_(tsplus_module_18.range(0, n), id => tsplus_module_1.map_(next, ([key, queue]) => [[key, id], queue], fileName_1 + ":973:48"))), entries => {
1014
+ const [mappings, queues] = tsplus_module_12.foldRight_(entries, [tsplus_module_41.makeDefault(), tsplus_module_7.empty()], ([mapping, queue], [mappings, queues]) => [tsplus_module_41.set_(mappings, mapping[0], mapping[1]), tsplus_module_12.append_(queues, queue)]);
1015
+ return tsplus_module_1.as_(tsplus_module_33.succeed_(p, a => tsplus_module_1.map_(decide(a), f => key => f(tsplus_module_36.toUndefined(tsplus_module_41.get_(mappings, key))), fileName_1 + ":979:48")), () => queues);
1016
+ }, fileName_1 + ":974:18"), fileName_1 + ":971:15"), fileName_1 + ":964:77");
1017
+ }
1018
+ /**
1019
+ * More powerful version of `ZStream#distributedWith`. This returns a function that will produce
1020
+ * new queues and corresponding indices.
1021
+ * You can also provide a function that will be executed after the final events are enqueued in all queues.
1022
+ * Shutdown of the queues is handled by the driver.
1023
+ * Downstream users can also shutdown queues manually. In this case the driver will
1024
+ * continue but no longer backpressure on them.
1025
+ *
1026
+ * @tsplus fluent fncts.io.Stream distributedWithDynamic
1027
+ */
1028
+
1029
+
1030
+ function distributedWithDynamic_1(self, maximumLag, decide, done = () => tsplus_module_1.unit) {
1031
+ const offer = queuesRef => a => tsplus_module_1.flatMap_(decide(a), shouldProcess => tsplus_module_1.flatMap_(tsplus_module_35.get(queuesRef), queues => tsplus_module_1.flatMap_(tsplus_module_1.foldLeft_(queues, tsplus_module_7.empty(), (b, [id, queue]) => {
1032
+ if (shouldProcess(id)) {
1033
+ return tsplus_module_1.matchCauseIO_(tsplus_module_25.offer_(queue, tsplus_module_37.succeed(a)), c => tsplus_module_15.interrupted(c) ? tsplus_module_1.succeedNow(tsplus_module_12.append_(b, id), fileName_1 + ":1009:52") : tsplus_module_1.failCauseNow(c, fileName_1 + ":1009:84"), () => tsplus_module_1.succeedNow(b, fileName_1 + ":1010:34"), fileName_1 + ":1008:61");
1034
+ } else {
1035
+ return tsplus_module_1.succeedNow(b, fileName_1 + ":1013:33");
1036
+ }
1037
+ }, fileName_1 + ":1006:20"), ids => tsplus_module_12.isNonEmpty(ids) ? tsplus_module_14.update_(queuesRef, map => tsplus_module_41.removeMany_(map, ids)) : tsplus_module_1.unit, fileName_1 + ":1015:19"), fileName_1 + ":1004:30"), fileName_1 + ":1003:30");
1038
+
1039
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_6.make(() => tsplus_module_41.makeDefault()), ref => tsplus_module_1.flatMap_(tsplus_module_35.get(ref), qs => tsplus_module_1.foreach_(tsplus_module_41.values(qs), q => tsplus_module_25.shutdown(q), fileName_1 + ":1022:43"), fileName_1 + ":1022:24")), queuesRef => tsplus_module_1.map_(tsplus_module_1.flatMap_(tsplus_module_43.atomically(tsplus_module_44.make(1)), queuesLock => tsplus_module_1.flatMap_(tsplus_module_6.make(() => tsplus_module_1.flatMap_(tsplus_module_27.makeBounded(maximumLag), queue => tsplus_module_1.flatMap_(tsplus_module_1.succeed(() => Symbol(), fileName_1 + ":1033:41"), id => tsplus_module_1.map_(tsplus_module_14.update_(queuesRef, map => tsplus_module_41.set_(map, id, queue)), () => (0, _function.tuple)(id, queue)), fileName_1 + ":1033:30"), fileName_1 + ":1032:30")), newQueue => {
1040
+ const finalize = endTake => tsplus_module_42.withPermitSelf(queuesLock)(tsplus_module_1.asUnit(tsplus_module_1.flatMap_(tsplus_module_13.set_(newQueue, tsplus_module_1.flatMap_(tsplus_module_27.makeBounded(1), queue => tsplus_module_1.flatMap_(tsplus_module_25.offer_(queue, endTake), () => {
1041
+ const id = Symbol();
1042
+ return tsplus_module_1.map_(tsplus_module_14.update_(queuesRef, map => tsplus_module_41.set_(map, id, queue)), () => (0, _function.tuple)(id, queue));
1043
+ }, fileName_1 + ":1045:20"), fileName_1 + ":1044:34")), () => tsplus_module_1.flatMap_(tsplus_module_1.map_(tsplus_module_35.get(queuesRef), map => tsplus_module_41.values(map), fileName_1 + ":1053:53"), queues => tsplus_module_1.flatMap_(tsplus_module_1.foreach_(queues, queue => tsplus_module_1.catchJustCause_(tsplus_module_25.offer_(queue, endTake), c => tsplus_module_15.interrupted(c) ? tsplus_module_3.just(tsplus_module_1.unit) : tsplus_module_3.nothing()), fileName_1 + ":1055:31"), () => tsplus_module_1.map_(done(endTake), () => void 0), fileName_1 + ":1054:20"), fileName_1 + ":1053:35"), fileName_1 + ":1051:23")));
1044
+
1045
+ return tsplus_module_1.map_(tsplus_module_1.fork(tsplus_module_1.matchCauseIO_(runForeachScoped_1(self, offer(queuesRef)), cause => finalize(tsplus_module_37.failCause(tsplus_module_15.map_(cause, tsplus_module_3.just))), () => finalize(tsplus_module_37.fail(tsplus_module_3.nothing())), fileName_1 + ":1067:63")), () => tsplus_module_42.withPermitSelf(queuesLock)(tsplus_module_1.flatten(tsplus_module_35.get(newQueue))));
1046
+ }, fileName_1 + ":1029:29"), fileName_1 + ":1028:29"), add => add, fileName_1 + ":1026:18"), fileName_1 + ":1020:24");
1047
+ }
1048
+ /**
1049
+ * Converts this stream to a stream that executes its effects but emits no
1050
+ * elements. Useful for sequencing effects using streams.
1051
+ *
1052
+ * @tsplus getter fncts.io.Stream drain
1053
+ */
1054
+
1055
+
1056
+ function drain(fa) {
1057
+ return new _definition2.Stream(tsplus_module_10.drain(fa.channel));
1058
+ }
1059
+
1060
+ function dropLoop(r) {
1061
+ return tsplus_module_10.readWith(inp => {
1062
+ const dropped = tsplus_module_12.drop_(inp, r);
1063
+ const leftover = Math.max(0, r - inp.length);
1064
+ const more = tsplus_module_12.isEmpty(inp) || leftover > 0;
1065
+ return more ? dropLoop(leftover) : tsplus_module_11.apSecond_(tsplus_module_10.write(() => dropped), tsplus_module_10.id());
1066
+ }, tsplus_module_10.failNow, () => tsplus_module_10.unit);
1067
+ }
1068
+ /**
1069
+ * Drops the specified number of elements from this stream.
1070
+ *
1071
+ * @tsplus fluent fncts.io.Stream drop
1072
+ */
1073
+
1074
+
1075
+ function drop_1(stream, n) {
1076
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, dropLoop(n)));
1077
+ }
1078
+ /**
1079
+ * Drops all elements of the stream for as long as the specified predicate
1080
+ * evaluates to `true`.
1081
+ *
1082
+ * @tsplus fluent fncts.io.Stream dropWhile
1083
+ */
1084
+
1085
+
1086
+ function dropWhile_1(stream, p) {
1087
+ return pipeThrough_1(stream, tsplus_module_45.dropWhile(p));
1088
+ }
1089
+ /**
1090
+ * Drops all elements of the stream until the specified predicate evaluates
1091
+ * to `true`.
1092
+ *
1093
+ * @tsplus fluent fncts.io.Stream dropUntil
1094
+ */
1095
+
1096
+
1097
+ function dropUntil_(stream, p) {
1098
+ return drop_1(dropWhile_1(stream, tsplus_module_46.invert(p)), 1);
1099
+ }
1100
+ /**
1101
+ * Returns a stream whose failures and successes have been lifted into an
1102
+ * `Either`. The resulting stream cannot fail, because the failures have
1103
+ * been exposed as part of the `Either` success case.
1104
+ *
1105
+ * @note the stream will end as soon as the first error occurs.
1106
+ *
1107
+ * @tsplus getter fncts.io.Stream either
1108
+ */
1109
+
1110
+
1111
+ function either(stream) {
1112
+ return catchAll_1(map_1(stream, tsplus_module_17.right), e => succeedNow_1(tsplus_module_17.left(e)));
1113
+ }
1114
+ /**
1115
+ * @tsplus static fncts.io.StreamOps empty
1116
+ */
1117
+
1118
+
1119
+ const empty_1 = /*#__PURE__*/fromChunkNow_1( /*#__PURE__*/tsplus_module_7.empty());
1120
+ const empty = empty_1;
1121
+ exports.empty = empty;
1122
+
1123
+ function endWhenWriter(fiber) {
1124
+ return tsplus_module_10.unwrap(tsplus_module_1.map_(tsplus_module_47.poll(fiber), maybeExit => tsplus_module_16.match_(maybeExit, () => tsplus_module_10.readWith(inp => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(inp), endWhenWriter(fiber)), tsplus_module_10.failNow, () => tsplus_module_10.unit), exit => tsplus_module_32.match_(exit, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit)), fileName_1 + ":1155:19"));
1125
+ }
1126
+ /**
1127
+ * Halts the evaluation of this stream when the provided IO completes. The given IO
1128
+ * will be forked as part of the returned stream, and its success will be discarded.
1129
+ *
1130
+ * An element in the process of being pulled will not be interrupted when the IO
1131
+ * completes. See `interruptWhen` for this behavior.
1132
+ *
1133
+ * If the IO completes with a failure, the stream will emit that failure.
1134
+ *
1135
+ * @tsplus fluent fncts.io.Stream endWhen
1136
+ */
1137
+
1138
+
1139
+ function endWhen_(stream, io) {
1140
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_21.forkScoped(io), fiber => tsplus_module_10.pipeTo_(stream.channel, endWhenWriter(fiber)), fileName_1 + ":1181:59")));
1141
+ }
1142
+ /**
1143
+ * @tsplus fluent fncts.io.Stream ensuring
1144
+ */
1145
+
1146
+
1147
+ function ensuring_1(self, finalizer) {
1148
+ return new _definition2.Stream(tsplus_module_10.ensuring_(self.channel, finalizer));
1149
+ }
1150
+ /**
1151
+ * @tsplus static fncts.io.StreamOps environment
1152
+ */
1153
+
1154
+
1155
+ function environment_1() {
1156
+ return fromIO_1(tsplus_module_48.environment(fileName_1 + ":1195:38"));
1157
+ }
1158
+ /**
1159
+ * Accesses the environment of the stream.
1160
+ *
1161
+ * @tsplus static fncts.io.StreamOps environmentWith
1162
+ */
1163
+
1164
+
1165
+ function environmentWith(f) {
1166
+ return map_1(environment_1(), f);
1167
+ }
1168
+ /**
1169
+ * Accesses the environment of the stream in the context of an effect.
1170
+ *
1171
+ * @tsplus static fncts.io.StreamOps environmentWithIO
1172
+ */
1173
+
1174
+
1175
+ function environmentWithIO(f) {
1176
+ return mapIO_1(environment_1(), f);
1177
+ }
1178
+ /**
1179
+ * Accesses the environment of the stream in the context of a stream.
1180
+ *
1181
+ * @tsplus static fncts.io.StreamOps environmentWithStream
1182
+ */
1183
+
1184
+
1185
+ function environmentWithStream(f) {
1186
+ return flatMap_1(environment_1(), f);
1187
+ }
1188
+ /**
1189
+ * Halt a stream with the specified error
1190
+ *
1191
+ * @tsplus static fncts.io.StreamOps failNow
1192
+ */
1193
+
1194
+
1195
+ function failNow_1(error) {
1196
+ return new _definition2.Stream(tsplus_module_10.failNow(error));
1197
+ }
1198
+ /**
1199
+ * Halt a stream with the specified error
1200
+ *
1201
+ * @tsplus static fncts.io.StreamOps fail
1202
+ */
1203
+
1204
+
1205
+ function fail(error) {
1206
+ return new _definition2.Stream(tsplus_module_10.fail(error));
1207
+ }
1208
+ /**
1209
+ * The stream that always halts with `cause`.
1210
+ *
1211
+ * @tsplus static fncts.io.StreamOps failCauseNow
1212
+ */
1213
+
1214
+
1215
+ function failCauseNow_1(cause) {
1216
+ return fromIO_1(tsplus_module_1.failCauseNow(cause, fileName_1 + ":1249:39"));
1217
+ }
1218
+ /**
1219
+ * The stream that always halts with `cause`.
1220
+ *
1221
+ * @tsplus static fncts.io.StreamOps failCause
1222
+ */
1223
+
1224
+
1225
+ function failCause(cause) {
1226
+ return fromIO_1(tsplus_module_1.failCause(cause, fileName_1 + ":1258:36"));
1227
+ }
1228
+
1229
+ function filter_(fa, predicate) {
1230
+ return mapChunks_1(fa, chunk => tsplus_module_12.filter_(chunk, predicate));
1231
+ }
1232
+ /**
1233
+ * @tsplus fluent fncts.io.Stream filterIO
1234
+ */
1235
+
1236
+
1237
+ function filterIO_(fa, f) {
1238
+ return loopOnPartialChunksElements_1(fa, (a, emit) => tsplus_module_1.flatMap_(f(a), r => r ? emit(a) : tsplus_module_1.unit, fileName_1 + ":1277:66"));
1239
+ }
1240
+ /**
1241
+ * @tsplus fluent fncts.io.Stream filterMap
1242
+ */
1243
+
1244
+
1245
+ function filterMap_1(fa, f) {
1246
+ return mapChunks_1(fa, chunk => tsplus_module_12.filterMap_(chunk, f));
1247
+ }
1248
+ /**
1249
+ * @tsplus fluent fncts.io.Stream filterMapIO
1250
+ */
1251
+
1252
+
1253
+ function filterMapIO_(fa, f) {
1254
+ return loopOnPartialChunksElements_1(fa, (a, emit) => tsplus_module_1.flatMap_(f(a), maybeB => tsplus_module_16.match_(maybeB, () => tsplus_module_1.unit, emit), fileName_1 + ":1294:66"));
1255
+ }
1256
+ /**
1257
+ * Finds the first element emitted by this stream that satisfies the provided predicate.
1258
+ *
1259
+ * @tsplus fluent fncts.io.Stream find
1260
+ */
1261
+
1262
+
1263
+ function find_(stream, p) {
1264
+ const loop = tsplus_module_10.readWith(inp => tsplus_module_16.match_(tsplus_module_12.find_(inp, p), () => loop, a => tsplus_module_10.writeNow(tsplus_module_18.single(a))), tsplus_module_10.failNow, () => tsplus_module_10.unit);
1265
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, loop));
1266
+ }
1267
+ /**
1268
+ * Finds the first element emitted by this stream that satisfies the provided effectful predicate.
1269
+ *
1270
+ * @tsplus fluent fncts.io.Stream findIO
1271
+ */
1272
+
1273
+
1274
+ function findIO_(stream, f) {
1275
+ const loop = tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(tsplus_module_1.map_(tsplus_module_49.findIO_(inp, f), maybeA => tsplus_module_16.match_(maybeA, () => loop, a => tsplus_module_10.writeNow(tsplus_module_18.single(a))), fileName_1 + ":1327:26")), tsplus_module_10.failNow, () => tsplus_module_10.unit);
1276
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, loop));
1277
+ }
1278
+ /**
1279
+ * Flattens this stream-of-streams into a stream made of the concatenation in
1280
+ * strict order of all the streams.
1281
+ *
1282
+ * @tsplus getter fncts.io.Stream flatten
1283
+ */
1284
+
1285
+
1286
+ function flatten_1(self) {
1287
+ return flatMap_1(self, _function.identity);
1288
+ }
1289
+ /**
1290
+ * Unwraps `Exit` values that also signify end-of-stream by failing with `None`.
1291
+ *
1292
+ * For `Exit<E, A>` values that do not signal end-of-stream, prefer:
1293
+ *
1294
+ * @tsplus getter fncts.io.Stream flattenExitOption
1295
+ */
1296
+
1297
+
1298
+ function flattenExitOption_1(stream) {
1299
+ const processChunk = (chunk, cont) => {
1300
+ const [toEmit, rest] = tsplus_module_12.splitWhere_(chunk, _ => !tsplus_module_50.isSuccess(_));
1301
+ const next = tsplus_module_16.match_(tsplus_module_12.head(rest), () => cont, exit => tsplus_module_32.match_(exit, cause => tsplus_module_16.match_(tsplus_module_15.flipCauseOption(cause), () => tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow), () => tsplus_module_11.endNow(undefined)));
1302
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(tsplus_module_12.filterMap_(toEmit, exit => tsplus_module_32.match_(exit, () => tsplus_module_3.nothing(), tsplus_module_3.just))), next);
1303
+ };
1304
+
1305
+ const process = tsplus_module_10.readWithCause(chunk => processChunk(chunk, process), tsplus_module_11.failCauseNow, _ => tsplus_module_11.endNow(undefined));
1306
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, process));
1307
+ }
1308
+ /**
1309
+ * Unwraps `Exit` values and flatten chunks that also signify end-of-stream by failing with `None`.
1310
+ *
1311
+ * @tsplus getter fncts.io.Stream flattenTake
1312
+ */
1313
+
1314
+
1315
+ function flattenTake_1(stream) {
1316
+ return flattenChunks_1(flattenExitOption_1(map_1(stream, take => take.exit)));
1317
+ }
1318
+ /**
1319
+ * Submerges the chunks carried by this stream into the stream's structure, while
1320
+ * still preserving them.
1321
+ *
1322
+ * @tsplus getter fncts.io.Stream flattenChunks
1323
+ */
1324
+
1325
+
1326
+ function flattenChunks_1(stream) {
1327
+ return new _definition2.Stream(tsplus_module_10.mapOut_(stream.channel, c => tsplus_module_12.flatten(c)));
1328
+ }
1329
+ /**
1330
+ * Repeats this stream forever.
1331
+ *
1332
+ * @tsplus getter fncts.io.Stream forever
1333
+ */
1334
+
1335
+
1336
+ function forever_1(stream) {
1337
+ return new _definition2.Stream(tsplus_module_10.repeated(stream.channel));
1338
+ }
1339
+ /**
1340
+ * Creates a stream from a `Chunk` of values
1341
+ *
1342
+ * @tsplus static fncts.io.StreamOps fromChunkNow
1343
+ */
1344
+
1345
+
1346
+ function fromChunkNow_1(c) {
1347
+ return new _definition2.Stream(tsplus_module_10.defer(() => tsplus_module_12.isEmpty(c) ? tsplus_module_10.unit : tsplus_module_10.writeNow(c)));
1348
+ }
1349
+ /**
1350
+ * Creates a stream from a `Chunk` of values
1351
+ *
1352
+ * @tsplus static fncts.io.StreamOps fromChunk
1353
+ */
1354
+
1355
+
1356
+ function fromChunk_1(c) {
1357
+ return new _definition2.Stream(tsplus_module_10.unwrap(tsplus_module_1.succeedNow(tsplus_module_10.write(c), fileName_1 + ":1427:49")));
1358
+ }
1359
+ /**
1360
+ * Creates a single-valued stream from a managed resource
1361
+ *
1362
+ * @tsplus static fncts.io.StreamOps scoped
1363
+ */
1364
+
1365
+
1366
+ function scoped_1(stream) {
1367
+ return new _definition2.Stream(tsplus_module_10.scoped(() => tsplus_module_1.map_(stream, tsplus_module_18.single, fileName_1 + ":1436:46")));
1368
+ }
1369
+ /**
1370
+ * Creates a stream from an effect producing a value of type `A`
1371
+ *
1372
+ * @tsplus static fncts.io.StreamOps fromIO
1373
+ */
1374
+
1375
+
1376
+ function fromIO_1(fa) {
1377
+ return fromIOMaybe_1(tsplus_module_1.mapError_(fa, tsplus_module_3.just, fileName_1 + ":1445:40"));
1378
+ }
1379
+ /**
1380
+ * Creates a stream from an effect producing a value of type `A` or an empty Stream
1381
+ *
1382
+ * @tsplus static fncts.io.StreamOps fromIOMaybe
1383
+ */
1384
+
1385
+
1386
+ function fromIOMaybe_1(fa) {
1387
+ return new _definition2.Stream(tsplus_module_10.unwrap(tsplus_module_1.match_(fa, maybeError => tsplus_module_16.match_(maybeError, () => tsplus_module_10.unit, tsplus_module_10.failNow), a => tsplus_module_10.writeNow(tsplus_module_18.single(a)), fileName_1 + ":1456:15")));
1388
+ }
1389
+
1390
+ function fromAsyncIterableLoop(iterator) {
1391
+ return tsplus_module_10.unwrap(tsplus_module_1.async(k => {
1392
+ iterator.next().then(result => result.done ? k(tsplus_module_1.succeedNow(tsplus_module_11.end(() => undefined), fileName_1 + ":1473:30")) : k(tsplus_module_1.succeedNow(tsplus_module_11.apSecond_(tsplus_module_10.writeNow(tsplus_module_18.single(result.value)), fromAsyncIterableLoop(iterator)), fileName_1 + ":1474:30")));
1393
+ }));
1394
+ }
1395
+ /**
1396
+ * @tsplus static fncts.io.StreamOps fromAsyncIterable
1397
+ */
1398
+
1399
+
1400
+ function fromAsyncIterable(iterable) {
1401
+ return new _definition2.Stream(fromAsyncIterableLoop(iterable[Symbol.asyncIterator]()));
1402
+ }
1403
+ /**
1404
+ * @tsplus static fncts.io.StreamOps fromIterable
1405
+ */
1406
+
1407
+
1408
+ function fromIterable(iterable, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE) {
1409
+ return unwrap_1(tsplus_module_1.succeed(() => {
1410
+ const loop = iterator => tsplus_module_10.unwrap(tsplus_module_1.succeed(() => {
1411
+ let result = iterator.next();
1412
+
1413
+ if (result.done) {
1414
+ return tsplus_module_10.unit;
1415
+ }
1416
+
1417
+ if (maxChunkSize === 1) {
1418
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(tsplus_module_18.single(result.value)), loop(iterator));
1419
+ } else {
1420
+ const out = Array(maxChunkSize);
1421
+ out[0] = result.value;
1422
+ let count = 1;
1423
+
1424
+ while (count < maxChunkSize && !(result = iterator.next()).done) {
1425
+ out[count] = result.value;
1426
+ count++;
1427
+ }
1428
+
1429
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(tsplus_module_18.from(out)), loop(iterator));
1430
+ }
1431
+ }, fileName_1 + ":1495:21"));
1432
+
1433
+ return new _definition2.Stream(loop(iterable[Symbol.iterator]()));
1434
+ }, fileName_1 + ":1492:15"));
1435
+ }
1436
+ /**
1437
+ * @tsplus static fncts.io.StreamOps fromIterableSingle
1438
+ */
1439
+
1440
+
1441
+ function fromIterableSingle(iterable) {
1442
+ return flatMap_1(fromIO_1(tsplus_module_1.succeed(() => iterable[Symbol.iterator](), fileName_1 + ":1523:34")), iterator => repeatIOMaybe_1(tsplus_module_1.defer(() => {
1443
+ const value = iterator.next();
1444
+
1445
+ if (value.done) {
1446
+ return tsplus_module_1.failNow(tsplus_module_3.nothing(), fileName_1 + ":1528:28");
1447
+ } else {
1448
+ return tsplus_module_1.succeedNow(value.value, fileName_1 + ":1530:31");
1449
+ }
1450
+ }, fileName_1 + ":1525:15")));
1451
+ }
1452
+ /**
1453
+ * @tsplus static fncts.io.StreamOps fromPull
1454
+ */
1455
+
1456
+
1457
+ function fromPull_1(scopedPull) {
1458
+ return unwrapScoped_1(tsplus_module_1.map_(scopedPull, pull => repeatIOChunkMaybe_1(pull), fileName_1 + ":1541:44"));
1459
+ }
1460
+ /**
1461
+ * Creates a stream from a `Queue` of values
1462
+ *
1463
+ * @tsplus static fncts.io.StreamOps fromQueue
1464
+ */
1465
+
1466
+
1467
+ function fromQueue_1(queue, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE) {
1468
+ return repeatIOChunkMaybe_1(tsplus_module_1.catchAllCause_(tsplus_module_1.map_(tsplus_module_52.takeBetween_(queue, 1, maxChunkSize), tsplus_module_18.from, fileName_1 + ":1556:11"), c => tsplus_module_1.flatMap_(tsplus_module_25.isShutdown(queue), down => {
1469
+ if (down && tsplus_module_15.interrupted(c)) {
1470
+ return tsplus_module_51.end;
1471
+ } else {
1472
+ return tsplus_module_51.failCause(c);
1473
+ }
1474
+ }, fileName_1 + ":1558:33"), fileName_1 + ":1557:21"));
1475
+ }
1476
+ /**
1477
+ * @tsplus static fncts.io.StreamOps fromQueueWithShutdown
1478
+ */
1479
+
1480
+
1481
+ function fromQueueWithShutdown_1(queue, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE) {
1482
+ return ensuring_1(fromQueue_1(queue, maxChunkSize), tsplus_module_25.shutdown(queue));
1483
+ }
1484
+ /**
1485
+ * Halt a stream with the specified exception
1486
+ *
1487
+ * @tsplus static fncts.io.StreamOps haltNow
1488
+ */
1489
+
1490
+
1491
+ function haltNow(u) {
1492
+ return new _definition2.Stream(tsplus_module_10.halt(() => u));
1493
+ }
1494
+ /**
1495
+ * Halt a stream with the specified exception
1496
+ *
1497
+ * @tsplus static fncts.io.StreamOps halt
1498
+ */
1499
+
1500
+
1501
+ function halt_1(u) {
1502
+ return new _definition2.Stream(tsplus_module_10.halt(u));
1503
+ }
1504
+
1505
+ function haltWhenWriter(fiber) {
1506
+ return tsplus_module_10.unwrap(tsplus_module_1.map_(tsplus_module_47.poll(fiber), maybeExit => tsplus_module_16.match_(maybeExit, () => tsplus_module_10.readWith(i => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(i), haltWhenWriter(fiber)), tsplus_module_10.failNow, () => tsplus_module_10.unit), exit => tsplus_module_32.match_(exit, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit)), fileName_1 + ":1601:19"));
1507
+ }
1508
+ /**
1509
+ * Halts the evaluation of this stream when the provided IO completes. The
1510
+ * given IO will be forked as part of the returned stream, and its success
1511
+ * will be discarded.
1512
+ *
1513
+ * An element in the process of being pulled will not be interrupted when the
1514
+ * IO completes. See `interruptWhen` for this behavior.
1515
+ *
1516
+ * If the IO completes with a failure, the stream will emit that failure.
1517
+ *
1518
+ * @tsplus fluent fncts.io.Stream haltWhen
1519
+ */
1520
+
1521
+
1522
+ function haltWhen_(fa, io) {
1523
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_21.forkScoped(io), fiber => tsplus_module_10.pipeTo_(fa.channel, haltWhenWriter(fiber)), fileName_1 + ":1628:59")));
1524
+ }
1525
+
1526
+ function haltWhenFutureWriter(future) {
1527
+ return tsplus_module_10.unwrap(tsplus_module_1.map_(tsplus_module_33.poll(future), maybeIO => tsplus_module_16.match_(maybeIO, () => tsplus_module_10.readWith(i => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(i), haltWhenFutureWriter(future)), tsplus_module_10.failNow, () => tsplus_module_10.unit), io => tsplus_module_10.unwrap(tsplus_module_1.match_(io, tsplus_module_10.failNow, () => tsplus_module_10.unit, fileName_1 + ":1643:40"))), fileName_1 + ":1635:20"));
1528
+ }
1529
+ /**
1530
+ * Halts the evaluation of this stream when the provided promise resolves.
1531
+ *
1532
+ * If the promise completes with a failure, the stream will emit that failure.
1533
+ *
1534
+ * @tsplus fluent fncts.io.Stream haltWhen
1535
+ */
1536
+
1537
+
1538
+ function haltWhenFuture_(fa, future) {
1539
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(fa.channel, haltWhenFutureWriter(future)));
1540
+ }
1541
+ /**
1542
+ * @tsplus fluent fncts.io.Stream interleave
1543
+ */
1544
+
1545
+
1546
+ function interleave_(sa, sb) {
1547
+ return interleaveWith_1(sa, sb, forever_1(fromChunk_1(() => tsplus_module_18.make(true, false))));
1548
+ }
1549
+
1550
+ function interleaveWithProducer(handoff) {
1551
+ return tsplus_module_10.readWithCause(value => tsplus_module_11.apSecond_(tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_24.single(value))), interleaveWithProducer(handoff)), cause => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_24.failCause(cause))), () => tsplus_module_10.fromIO(tsplus_module_5.offer(handoff, tsplus_module_24.end)));
1552
+ }
1553
+ /**
1554
+ * Combines this stream and the specified stream deterministically using the
1555
+ * stream of boolean values `b` to control which stream to pull from next.
1556
+ * `true` indicates to pull from this stream and `false` indicates to pull
1557
+ * from the specified stream. Only consumes as many elements as requested by
1558
+ * `b`. If either this stream or the specified stream are exhausted further
1559
+ * requests for values from that stream will be ignored.
1560
+ *
1561
+ * @tsplus fluent fncts.io.Stream interleaveWith
1562
+ */
1563
+
1564
+
1565
+ function interleaveWith_1(sa, sb, b) {
1566
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_1.flatMap_(tsplus_module_5.make(), left => tsplus_module_1.flatMap_(tsplus_module_5.make(), right => tsplus_module_1.flatMap_(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(tsplus_module_10.concatMap_(sa.channel, tsplus_module_10.writeChunk), interleaveWithProducer(left)))), () => tsplus_module_1.map_(tsplus_module_1.fork(tsplus_module_23.runScoped(tsplus_module_10.pipeTo_(tsplus_module_10.concatMap_(sb.channel, tsplus_module_10.writeChunk), interleaveWithProducer(right)))), () => (0, _function.tuple)(left, right)), fileName_1 + ":1698:10"), fileName_1 + ":1697:24"), fileName_1 + ":1696:24"), ([left, right]) => {
1567
+ const process = (leftDone, rightDone) => tsplus_module_10.readWithCause(b => {
1568
+ if (b && !leftDone) {
1569
+ return tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_5.take(left)), take => tsplus_module_24.match_(take, rightDone ? tsplus_module_10.unit : process(true, rightDone), tsplus_module_11.failCauseNow, chunk => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(chunk), process(leftDone, rightDone))));
1570
+ }
1571
+
1572
+ if (!b && !rightDone) {
1573
+ return tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_5.take(right)), take => tsplus_module_24.match_(take, leftDone ? tsplus_module_10.unit : process(leftDone, true), tsplus_module_11.failCauseNow, chunk => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(chunk), process(leftDone, rightDone))));
1574
+ }
1575
+
1576
+ return process(leftDone, rightDone);
1577
+ }, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit);
1578
+
1579
+ return tsplus_module_10.pipeTo_(tsplus_module_10.concatMap_(b.channel, tsplus_module_10.writeChunk), process(false, false));
1580
+ }, fileName_1 + ":1701:13")));
1581
+ }
1582
+
1583
+ function intersperseWriter(middle, isFirst) {
1584
+ return tsplus_module_10.readWith(inp => {
1585
+ const builder = tsplus_module_12.builder();
1586
+ let flagResult = isFirst;
1587
+ tsplus_module_12.forEach_(inp, a => {
1588
+ if (flagResult) {
1589
+ flagResult = false;
1590
+ builder.append(a);
1591
+ } else {
1592
+ builder.append(middle);
1593
+ builder.append(a);
1594
+ }
1595
+ });
1596
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(builder.result()), intersperseWriter(middle, flagResult));
1597
+ }, tsplus_module_10.failNow, () => tsplus_module_10.unit);
1598
+ }
1599
+ /**
1600
+ * Intersperse stream with provided element
1601
+ */
1602
+
1603
+
1604
+ function intersperse_(stream, middle) {
1605
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, intersperseWriter(middle, true)));
1606
+ }
1607
+ /**
1608
+ * Interrupts the evaluation of this stream when the provided IO completes. The given
1609
+ * IO will be forked as part of this stream, and its success will be discarded. This
1610
+ * combinator will also interrupt any in-progress element being pulled from upstream.
1611
+ *
1612
+ * If the IO completes with a failure before the stream completes, the returned stream
1613
+ * will emit that failure.
1614
+ *
1615
+ * @tsplus fluent fncts.io.Stream interruptWhen
1616
+ */
1617
+
1618
+
1619
+ function interruptWhen_(stream, io) {
1620
+ return new _definition2.Stream(tsplus_module_53.interruptWhen_(stream.channel, io));
1621
+ }
1622
+ /**
1623
+ * @tsplus fluent fncts.io.Stream interruptWhen
1624
+ */
1625
+
1626
+
1627
+ function interruptWhenFuture_(fa, future) {
1628
+ return new _definition2.Stream(tsplus_module_53.interruptWhenFuture_(fa.channel, future));
1629
+ }
1630
+ /**
1631
+ * Loops over the stream chunks concatenating the result of f
1632
+ *
1633
+ * @tsplus fluent fncts.io.Stream loopOnChunks
1634
+ */
1635
+
1636
+
1637
+ function loopOnChunks_1(stream, f) {
1638
+ const loop = tsplus_module_10.readWithCause(chunk => tsplus_module_11.flatMap_(f(chunk), cont => cont ? loop : tsplus_module_11.endNow(false)), tsplus_module_11.failCauseNow, _ => tsplus_module_11.succeedNow(false));
1639
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, loop));
1640
+ }
1641
+ /**
1642
+ * Loops on chunks emitting partially
1643
+ *
1644
+ * @tsplus fluent fncts.io.Stream loopOnPartialChunks
1645
+ */
1646
+
1647
+
1648
+ function loopOnPartialChunks_1(stream, f) {
1649
+ return loopOnChunks_1(stream, chunk => tsplus_module_10.unwrap(tsplus_module_1.defer(() => {
1650
+ let outputChunk = tsplus_module_7.empty();
1651
+ return tsplus_module_1.catchAll_(tsplus_module_1.map_(f(chunk, a => tsplus_module_1.succeed(() => {
1652
+ outputChunk = tsplus_module_12.append_(outputChunk, a);
1653
+ }, fileName_1 + ":1822:21")), cont => tsplus_module_11.apSecond_(tsplus_module_10.write(() => outputChunk), tsplus_module_11.endNow(cont)), fileName_1 + ":1826:15"), failure => tsplus_module_1.succeed(() => {
1654
+ if (tsplus_module_12.isEmpty(outputChunk)) {
1655
+ return tsplus_module_10.failNow(failure);
1656
+ } else {
1657
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(outputChunk), tsplus_module_10.failNow(failure));
1658
+ }
1659
+ }, fileName_1 + ":1828:23"), fileName_1 + ":1827:20");
1660
+ }, fileName_1 + ":1819:15")));
1661
+ }
1662
+ /**
1663
+ * Loops on chunks elements emitting partially
1664
+ *
1665
+ * @tsplus fluent fncts.io.Stream loopOnPartialChunksElements
1666
+ */
1667
+
1668
+
1669
+ function loopOnPartialChunksElements_1(stream, f) {
1670
+ return loopOnPartialChunks_1(stream, (as, emit) => tsplus_module_1.as_(tsplus_module_54.mapIO_(as, a => f(a, emit)), () => true));
1671
+ }
1672
+ /**
1673
+ * Transforms the elements of this stream using the supplied function.
1674
+ *
1675
+ * @tsplus fluent fncts.io.Stream map
1676
+ */
1677
+
1678
+
1679
+ function map_1(stream, f) {
1680
+ return new _definition2.Stream(tsplus_module_10.mapOut_(stream.channel, as => tsplus_module_12.map_(as, f)));
1681
+ }
1682
+
1683
+ function mapAccumAccumulator(currS, f) {
1684
+ return tsplus_module_10.readWith(inp => {
1685
+ const [bs, nextS] = tsplus_module_12.mapAccum_(inp, currS, f);
1686
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(bs), mapAccumAccumulator(nextS, f));
1687
+ }, tsplus_module_10.failNow, () => tsplus_module_10.unit);
1688
+ }
1689
+ /**
1690
+ * Statefully maps over the elements of this stream to produce new elements.
1691
+ *
1692
+ * @tsplus fluent fncts.io.Stream mapAccum
1693
+ */
1694
+
1695
+
1696
+ function mapAccum_(stream, s, f) {
1697
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, mapAccumAccumulator(s, f)));
1698
+ }
1699
+
1700
+ function mapAccumIOAccumulator(s, f) {
1701
+ return tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(tsplus_module_1.defer(() => {
1702
+ const outputChunk = tsplus_module_12.builder();
1703
+
1704
+ const emit = b => tsplus_module_1.succeed(() => {
1705
+ outputChunk.append(b);
1706
+ }, fileName_1 + ":1899:23");
1707
+
1708
+ return tsplus_module_1.match_(tsplus_module_1.foldLeft_(inp, s, (s1, a) => tsplus_module_1.flatMap_(f(s1, a), ([b, s2]) => tsplus_module_1.as_(emit(b), () => s2), fileName_1 + ":1902:65"), fileName_1 + ":1902:29"), e => {
1709
+ const partialResult = outputChunk.result();
1710
+ return tsplus_module_12.isNonEmpty(partialResult) ? tsplus_module_11.apSecond_(tsplus_module_10.writeNow(partialResult), tsplus_module_10.failNow(e)) : tsplus_module_10.failNow(e);
1711
+ }, s => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(outputChunk.result()), mapAccumIOAccumulator(s, f)), fileName_1 + ":1902:101");
1712
+ }, fileName_1 + ":1896:17")), tsplus_module_10.failNow, () => tsplus_module_10.unit);
1713
+ }
1714
+ /**
1715
+ * Statefully and effectfully maps over the elements of this stream to produce
1716
+ * new elements.
1717
+ *
1718
+ * @tsplus fluent fncts.io.Stream mapAccumIO
1719
+ */
1720
+
1721
+
1722
+ function mapAccumIO_1(stream, s, f) {
1723
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, mapAccumIOAccumulator(s, f)));
1724
+ }
1725
+ /**
1726
+ * Transforms the chunks emitted by this stream.
1727
+ *
1728
+ * @tsplus fluent fncts.io.Stream mapChunks
1729
+ */
1730
+
1731
+
1732
+ function mapChunks_1(stream, f) {
1733
+ return new _definition2.Stream(tsplus_module_10.mapOut_(stream.channel, f));
1734
+ }
1735
+ /**
1736
+ * Effectfully transforms the chunks emitted by this stream.
1737
+ *
1738
+ * @tsplus fluent fncts.io.Stream mapChunksIO
1739
+ */
1740
+
1741
+
1742
+ function mapChunksIO_(stream, f) {
1743
+ return new _definition2.Stream(tsplus_module_10.mapOutIO_(stream.channel, f));
1744
+ }
1745
+ /**
1746
+ * Maps each element to an iterable, and flattens the iterables into the
1747
+ * output of this stream.
1748
+ *
1749
+ * @tsplus fluent fncts.io.Stream mapConcat
1750
+ */
1751
+
1752
+
1753
+ function mapConcat_(stream, f) {
1754
+ return mapConcatChunk_1(stream, a => tsplus_module_18.from(f(a)));
1755
+ }
1756
+ /**
1757
+ * Maps each element to a chunk, and flattens the chunks into the output of
1758
+ * this stream.
1759
+ *
1760
+ * @tsplus fluent fncts.io.Stream mapConcatChunk
1761
+ */
1762
+
1763
+
1764
+ function mapConcatChunk_1(stream, f) {
1765
+ return mapChunks_1(stream, c => tsplus_module_12.flatMap_(c, f));
1766
+ }
1767
+ /**
1768
+ * Effectfully maps each element to a chunk, and flattens the chunks into
1769
+ * the output of this stream.
1770
+ *
1771
+ * @tsplus fluent fncts.io.Stream mapConcatChunkIO
1772
+ */
1773
+
1774
+
1775
+ function mapConcatChunkIO_(stream, f) {
1776
+ return mapConcatChunk_1(mapIO_1(stream, f), _function.identity);
1777
+ }
1778
+ /**
1779
+ * Effectfully maps each element to an iterable, and flattens the iterables into
1780
+ * the output of this stream.
1781
+ *
1782
+ * @tsplus fluent fncts.io.Stream mapConcatIO
1783
+ */
1784
+
1785
+
1786
+ function mapConcatIO_(stream, f) {
1787
+ return mapConcatChunk_1(mapIO_1(stream, a => tsplus_module_1.map_(f(a), tsplus_module_18.from, fileName_1 + ":1996:38")), _function.identity);
1788
+ }
1789
+ /**
1790
+ * Transforms the errors emitted by this stream using `f`.
1791
+ *
1792
+ * @tsplus fluent fncts.io.Stream mapError
1793
+ */
1794
+
1795
+
1796
+ function mapError_1(stream, f) {
1797
+ return new _definition2.Stream(tsplus_module_10.mapError_(stream.channel, f));
1798
+ }
1799
+ /**
1800
+ * Transforms the full causes of failures emitted by this stream.
1801
+ *
1802
+ * @tsplus fluent fncts.io.Stream mapErrorCause
1803
+ */
1804
+
1805
+
1806
+ function mapErrorCause_(fa, f) {
1807
+ return new _definition2.Stream(tsplus_module_10.mapErrorCause_(fa.channel, f));
1808
+ }
1809
+ /**
1810
+ * Maps over elements of the stream with the specified effectful function.
1811
+ *
1812
+ * @tsplus fluent fncts.io.Stream mapIO
1813
+ */
1814
+
1815
+
1816
+ function mapIO_1(stream, f) {
1817
+ return loopOnPartialChunksElements_1(stream, (a, emit) => tsplus_module_1.flatMap_(f(a), emit, fileName_1 + ":2026:70"));
1818
+ }
1819
+ /**
1820
+ * Maps over elements of the stream with the specified effectful function,
1821
+ * executing up to `n` invocations of `f` concurrently. Transformed elements
1822
+ * will be emitted in the original order.
1823
+ *
1824
+ * @note This combinator destroys the chunking structure. It's recommended to use chunkN afterwards.
1825
+ *
1826
+ * @tsplus fluent fncts.io.Stream mapIOC
1827
+ */
1828
+
1829
+
1830
+ function mapIOC_(stream, n, f) {
1831
+ return new _definition2.Stream(tsplus_module_10.mapOut_(tsplus_module_55.mapOutIOC_(tsplus_module_10.concatMap_(stream.channel, tsplus_module_10.writeChunk), n, f), tsplus_module_18.single));
1832
+ }
1833
+ /**
1834
+ * Maps each element of this stream to another stream and returns the
1835
+ * non-deterministic merge of those streams, executing up to `n` inner streams
1836
+ * concurrently. Up to `bufferSize` elements of the produced streams may be
1837
+ * buffered in memory by this operator.
1838
+ *
1839
+ * @tsplus fluent fncts.io.Stream mergeMap
1840
+ */
1841
+
1842
+
1843
+ function mergeMap_1(ma, f, n, bufferSize = 16) {
1844
+ return new _definition2.Stream(tsplus_module_56.mergeMap_(tsplus_module_10.concatMap_(ma.channel, tsplus_module_10.writeChunk), a => f(a).channel, n, bufferSize));
1845
+ }
1846
+ /**
1847
+ * Maps over elements of the stream with the specified effectful function,
1848
+ * executing up to `n` invocations of `f` concurrently. The element order
1849
+ * is not enforced by this combinator, and elements may be reordered.
1850
+ *
1851
+ * @tsplus fluent fncts.io.Stream mergeMapIO
1852
+ */
1853
+
1854
+
1855
+ function mergeMapIO_(stream, f, n, bufferSize = 16) {
1856
+ return mergeMap_1(stream, a => fromIO_1(f(a)), n, bufferSize);
1857
+ }
1858
+ /**
1859
+ * @tsplus fluent fncts.io.Stream mergeEither
1860
+ */
1861
+
1862
+
1863
+ function mergeEither_1(fa, fb) {
1864
+ return mergeWith_1(fa, fb, tsplus_module_17.left, tsplus_module_17.right);
1865
+ }
1866
+
1867
+ function mergeWithHandler(terminate) {
1868
+ return exit => terminate || !tsplus_module_50.isSuccess(exit) ? tsplus_module_57.done(tsplus_module_1.fromExitNow(exit, fileName_1 + ":2093:71")) : tsplus_module_57.wait(tsplus_module_1.fromExitNow);
1869
+ }
1870
+ /**
1871
+ * @tsplus fluent fncts.io.Stream mergeWith
1872
+ */
1873
+
1874
+
1875
+ function mergeWith_1(sa, sb, l, r, strategy = "Both") {
1876
+ return new _definition2.Stream(tsplus_module_58.mergeWith_(map_1(sa, l).channel, map_1(sb, r).channel, mergeWithHandler(strategy === "Either" || strategy === "Left"), mergeWithHandler(strategy === "Either" || strategy === "Right")));
1877
+ }
1878
+ /**
1879
+ * Runs the specified effect if this stream fails, providing the error to the effect if it exists.
1880
+ *
1881
+ * Note: Unlike `IO.onError`, there is no guarantee that the provided effect will not be interrupted.
1882
+ *
1883
+ * @tsplus fluent fncts.io.Stream onError
1884
+ */
1885
+
1886
+
1887
+ function onError_(stream, cleanup) {
1888
+ return catchAllCause_1(stream, cause => fromIO_1(tsplus_module_1.apSecond_(cleanup(cause), tsplus_module_1.failCauseNow(cause, fileName_1 + ":2130:88"), fileName_1 + ":2130:72")));
1889
+ }
1890
+ /**
1891
+ * Switches to the provided stream in case this one fails with a typed error.
1892
+ *
1893
+ * See also Stream#catchAll
1894
+ *
1895
+ * @tsplus fluent fncts.io.Stream orElse
1896
+ */
1897
+
1898
+
1899
+ function orElse_1(stream, that) {
1900
+ return new _definition2.Stream(tsplus_module_10.orElse_(stream.channel, that().channel));
1901
+ }
1902
+ /**
1903
+ * Switches to the provided stream in case this one fails with a typed error.
1904
+ *
1905
+ * See also ZStream#catchAll
1906
+ *
1907
+ * @tsplus fluent fncts.io.Stream orElseEither
1908
+ */
1909
+
1910
+
1911
+ function orElseEither_(stream, that) {
1912
+ return orElse_1(map_1(stream, tsplus_module_17.left), () => map_1(that(), tsplus_module_17.right));
1913
+ }
1914
+ /**
1915
+ * Fails with given error in case this one fails with a typed error.
1916
+ *
1917
+ * See also Stream#catchAll
1918
+ *
1919
+ * @tsplus fluent fncts.io.Stream orElseFail
1920
+ */
1921
+
1922
+
1923
+ function orElseFail_(stream, e) {
1924
+ return orElse_1(stream, () => failNow_1(e()));
1925
+ }
1926
+ /**
1927
+ * Switches to the provided stream in case this one fails with the `None` value.
1928
+ *
1929
+ * See also Stream#catchAll.
1930
+ */
1931
+
1932
+
1933
+ function orElseOptional_(stream, that) {
1934
+ return catchAll_1(stream, maybeError => tsplus_module_16.match_(maybeError, () => that(), e => failNow_1(tsplus_module_3.just(e))));
1935
+ }
1936
+ /**
1937
+ * Succeeds with the specified value if this one fails with a typed error.
1938
+ *
1939
+ * @tsplus fluent fncts.io.Stream orElseSucceed
1940
+ */
1941
+
1942
+
1943
+ function orElseSucceed_(stream, a) {
1944
+ return orElse_1(stream, () => succeedNow_1(a()));
1945
+ }
1946
+ /**
1947
+ * @tsplus fluent fncts.io.Stream pipeThrough
1948
+ */
1949
+
1950
+
1951
+ function pipeThrough_1(ma, sa) {
1952
+ return new _definition2.Stream(tsplus_module_10.pipeToOrFail_(ma.channel, sa.channel));
1953
+ }
1954
+ /**
1955
+ * Provides the stream with its required environment, which eliminates
1956
+ * its dependency on `R`.
1957
+ *
1958
+ * @tsplus fluent fncts.io.Stream provideEnvironment
1959
+ */
1960
+
1961
+
1962
+ function provideEnvironment_1(ra, r) {
1963
+ return new _definition2.Stream(tsplus_module_10.provideEnvironment_(ra.channel, r));
1964
+ }
1965
+ /**
1966
+ * @tsplus fluent fncts.io.Stream provideLayer
1967
+ */
1968
+
1969
+
1970
+ function provideLayer_1(self, layer, __tsplusTrace) {
1971
+ return new _definition2.Stream(tsplus_module_10.unwrapScoped(tsplus_module_1.map_(tsplus_module_59.build(layer), r => tsplus_module_10.provideEnvironment_(self.channel, r), __tsplusTrace)));
1972
+ }
1973
+ /**
1974
+ * @tsplus fluent fncts.io.Stream provideSomeLayer
1975
+ */
1976
+
1977
+
1978
+ function provideSomeLayer_(self, layer, __tsplusTrace) {
1979
+ // @ts-expect-error
1980
+ return provideLayer_1(self, tsplus_module_60.and_(tsplus_module_60.environment(), layer), __tsplusTrace);
1981
+ }
1982
+
1983
+ class Rechunker {
1984
+ constructor(n) {
1985
+ this.n = n;
1986
+ this.builder = [];
1987
+ this.pos = 0;
1988
+ }
1989
+
1990
+ write(elem) {
1991
+ this.builder.push(elem);
1992
+ this.pos += 1;
1993
+
1994
+ if (this.pos === this.n) {
1995
+ const result = this.builder;
1996
+ this.builder = [];
1997
+ this.pos = 0;
1998
+ return tsplus_module_18.from(result);
1999
+ }
2000
+
2001
+ return null;
2002
+ }
2003
+
2004
+ emitOfNotEmpty() {
2005
+ if (this.pos !== 0) {
2006
+ return tsplus_module_10.writeNow(tsplus_module_18.from(this.builder));
2007
+ } else {
2008
+ return tsplus_module_10.unit;
2009
+ }
2010
+ }
2011
+
2012
+ get isEmpty() {
2013
+ return this.pos === 0;
2014
+ }
2015
+
2016
+ }
2017
+
2018
+ function rechunkProcess(rechunker, target) {
2019
+ return tsplus_module_10.readWithCause(chunk => {
2020
+ if (chunk.length === target && rechunker.isEmpty) {
2021
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(chunk), rechunkProcess(rechunker, target));
2022
+ } else if (chunk.length > 0) {
2023
+ const chunks = [];
2024
+ let result = null;
2025
+ let i = 0;
2026
+
2027
+ while (i < chunk.length) {
2028
+ while (i < chunk.length && result === null) {
2029
+ result = rechunker.write(tsplus_module_12.unsafeGet_(chunk, i));
2030
+ i += 1;
2031
+ }
2032
+
2033
+ if (result !== null) {
2034
+ chunks.push(result);
2035
+ result = null;
2036
+ }
2037
+ }
2038
+
2039
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeAll(chunks), rechunkProcess(rechunker, target));
2040
+ } else {
2041
+ return rechunkProcess(rechunker, target);
2042
+ }
2043
+ }, cause => tsplus_module_11.apSecond_(rechunker.emitOfNotEmpty(), tsplus_module_11.failCauseNow(cause)), () => rechunker.emitOfNotEmpty());
2044
+ }
2045
+ /**
2046
+ * Re-chunks the elements of the stream into chunks of
2047
+ * `n` elements each.
2048
+ * The last chunk might contain less than `n` elements
2049
+ *
2050
+ * @tsplus fluent fncts.io.Stream rechunk
2051
+ */
2052
+
2053
+
2054
+ function rechunk_(stream, n) {
2055
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, rechunkProcess(new Rechunker(n), n)));
2056
+ }
2057
+ /**
2058
+ * Repeats the provided value infinitely.
2059
+ *
2060
+ * @tsplus static fncts.io.StreamOps repeatValue
2061
+ */
2062
+
2063
+
2064
+ function repeatValue(a) {
2065
+ return new _definition2.Stream(tsplus_module_10.repeated(tsplus_module_10.writeNow(tsplus_module_18.single(a))));
2066
+ }
2067
+ /**
2068
+ * Creates a stream from an effect producing a value of type `A` which repeats forever.
2069
+ *
2070
+ * @tsplus static fncts.io.StreamOps repeatIO
2071
+ */
2072
+
2073
+
2074
+ function repeatIO(fa) {
2075
+ return repeatIOMaybe_1(tsplus_module_1.mapError_(fa, tsplus_module_3.just, fileName_1 + ":2335:42"));
2076
+ }
2077
+ /**
2078
+ * Creates a stream from an effect producing values of type `A` until it fails with None.
2079
+ *
2080
+ * @tsplus static fncts.io.StreamOps repeatIOMaybe
2081
+ */
2082
+
2083
+
2084
+ function repeatIOMaybe_1(fa) {
2085
+ return repeatIOChunkMaybe_1(tsplus_module_1.map_(fa, tsplus_module_18.single, fileName_1 + ":2344:35"));
2086
+ }
2087
+ /**
2088
+ * Creates a stream from an effect producing chunks of `A` values which repeats forever.
2089
+ *
2090
+ * @tsplus static fncts.io.StreamOps repeatIOChunk
2091
+ */
2092
+
2093
+
2094
+ function repeatIOChunk(fa) {
2095
+ return repeatIOChunkMaybe_1(tsplus_module_1.mapError_(fa, tsplus_module_3.just, fileName_1 + ":2353:40"));
2096
+ }
2097
+ /**
2098
+ * Creates a stream from an effect producing chunks of `A` values until it fails with None.
2099
+ *
2100
+ * @tsplus static fncts.io.StreamOps repeatIOChunkMaybe
2101
+ */
2102
+
2103
+
2104
+ function repeatIOChunkMaybe_1(fa) {
2105
+ return unfoldChunkIO_1(undefined, _ => tsplus_module_1.catchAll_(tsplus_module_1.map_(fa, chunk => tsplus_module_3.just((0, _function.tuple)(chunk, undefined)), fileName_1 + ":2364:11"), maybeError => tsplus_module_16.match_(maybeError, () => tsplus_module_1.succeedNow(tsplus_module_3.nothing(), fileName_1 + ":2365:69"), tsplus_module_1.failNow), fileName_1 + ":2365:16"));
2106
+ }
2107
+ /**
2108
+ * Runs the sink on the stream to produce either the sink's result or an error.
2109
+ *
2110
+ * @tsplus fluent fncts.io.Stream run
2111
+ */
2112
+
2113
+
2114
+ function run_1(stream, sink) {
2115
+ return tsplus_module_61.runDrain(tsplus_module_10.pipeToOrFail_(stream.channel, sink.channel));
2116
+ }
2117
+ /**
2118
+ * Runs the stream and collects all of its elements to a chunk.
2119
+ *
2120
+ * @tsplus getter fncts.io.Stream runCollect
2121
+ */
2122
+
2123
+
2124
+ function runCollect(stream) {
2125
+ return run_1(stream, tsplus_module_45.collectAll());
2126
+ }
2127
+ /**
2128
+ * Runs the stream and collects ignore its elements.
2129
+ *
2130
+ * @tsplus getter fncts.io.Stream runDrain
2131
+ */
2132
+
2133
+
2134
+ function runDrain(stream) {
2135
+ return run_1(stream, tsplus_module_45.drain);
2136
+ }
2137
+ /**
2138
+ * @tsplus fluent fncts.io.Stream runForeachScoped
2139
+ */
2140
+
2141
+
2142
+ function runForeachScoped_1(self, f) {
2143
+ return runScoped_1(self, tsplus_module_45.foreach(f));
2144
+ }
2145
+ /**
2146
+ * Like `into`, but provides the result as a `Managed` to allow for scope
2147
+ * composition.
2148
+ *
2149
+ * @tsplus fluent fncts.io.Stream runIntoElementsScoped
2150
+ */
2151
+
2152
+
2153
+ function runIntoElementsScoped_1(stream, queue) {
2154
+ const writer = tsplus_module_10.readWith(inp => tsplus_module_11.apSecond_(tsplus_module_12.foldLeft_(inp, tsplus_module_10.unit, (channel, a) => tsplus_module_11.apSecond_(channel, tsplus_module_10.writeNow(tsplus_module_37.succeed(a)))), writer), err => tsplus_module_10.writeNow(tsplus_module_37.fail(tsplus_module_3.just(err))), () => tsplus_module_10.writeNow(tsplus_module_37.fail(tsplus_module_3.nothing())));
2155
+ return tsplus_module_1.asUnit(tsplus_module_23.runScoped(tsplus_module_10.drain(tsplus_module_10.mapOutIO_(tsplus_module_10.pipeTo_(stream.channel, writer), exit => tsplus_module_25.offer_(queue, exit)))));
2156
+ }
2157
+ /**
2158
+ * Like `Stream#into`, but provides the result as a `Managed` to allow for scope
2159
+ * composition.
2160
+ *
2161
+ * @tsplus fluent fncts.io.Stream runIntoQueueScoped
2162
+ */
2163
+
2164
+
2165
+ function runIntoQueueScoped_1(stream, queue) {
2166
+ const writer = tsplus_module_10.readWithCause(inp => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(tsplus_module_24.chunk(inp)), writer), cause => tsplus_module_10.writeNow(tsplus_module_24.failCause(cause)), _ => tsplus_module_10.writeNow(tsplus_module_24.end));
2167
+ return tsplus_module_1.asUnit(tsplus_module_23.runScoped(tsplus_module_10.drain(tsplus_module_10.mapOutIO_(tsplus_module_10.pipeTo_(stream.channel, writer), take => tsplus_module_25.offer_(queue, take)))));
2168
+ }
2169
+ /**
2170
+ * Like `Stream#runIntoHub`, but provides the result as a `Managed` to allow for scope
2171
+ * composition.
2172
+ *
2173
+ * @tsplus fluent fncts.io.Stream runIntoHubScoped
2174
+ */
2175
+
2176
+
2177
+ function runIntoHubScoped_1(stream, hub) {
2178
+ return runIntoQueueScoped_1(stream, tsplus_module_30.toQueue(hub));
2179
+ }
2180
+ /**
2181
+ * Runs the sink on the stream to produce either the sink's result or an error.
2182
+ *
2183
+ * @tsplus fluent fncts.io.Stream runScoped
2184
+ */
2185
+
2186
+
2187
+ function runScoped_1(stream, sink) {
2188
+ return tsplus_module_23.runScoped(tsplus_module_10.drain(tsplus_module_10.pipeToOrFail_(stream.channel, sink.channel)));
2189
+ }
2190
+ /**
2191
+ * Statefully maps over the elements of this stream to produce all intermediate results
2192
+ * of type `B` given an initial B.
2193
+ *
2194
+ * @tsplus fluent fncts.io.Stream scan
2195
+ */
2196
+
2197
+
2198
+ function scan_(sa, b, f) {
2199
+ return scanIO_1(sa, b, (b, a) => tsplus_module_1.succeedNow(f(b, a), fileName_1 + ":2484:46"));
2200
+ }
2201
+ /**
2202
+ * Statefully and effectfully maps over the elements of this stream to produce all
2203
+ * intermediate results of type `B` given an initial B.
2204
+ *
2205
+ * @tsplus fluent fncts.io.Stream scanIO
2206
+ */
2207
+
2208
+
2209
+ function scanIO_1(sa, b, f) {
2210
+ return concat_1(succeedNow_1(b), mapAccumIO_1(sa, b, (b, a) => tsplus_module_1.map_(f(b, a), b => [b, b], fileName_1 + ":2498:76")));
2211
+ }
2212
+ /**
2213
+ * Statefully maps over the elements of this stream to produce all
2214
+ * intermediate results.
2215
+ *
2216
+ * @tsplus fluent fncts.io.Stream scanReduce
2217
+ */
2218
+
2219
+
2220
+ function scanReduce_(fa, f) {
2221
+ return scanReduceIO_1(fa, (b, a) => tsplus_module_1.succeedNow(f(b, a), fileName_1 + ":2508:49"));
2222
+ }
2223
+ /**
2224
+ * Statefully and effectfully maps over the elements of this stream to produce
2225
+ * all intermediate results.
2226
+ *
2227
+ * @tsplus fluent fncts.io.Stream scanReduceIO
2228
+ */
2229
+
2230
+
2231
+ function scanReduceIO_1(fa, f) {
2232
+ return mapAccumIO_1(fa, tsplus_module_3.nothing(), (s, a) => tsplus_module_16.match_(s, () => tsplus_module_1.succeedNow([a, tsplus_module_3.just(a)], fileName_1 + ":2523:26"), b => tsplus_module_1.map_(f(b, a), b => [b, tsplus_module_3.just(b)], fileName_1 + ":2524:25")));
2233
+ }
2234
+ /**
2235
+ * Creates a single-valued pure stream
2236
+ *
2237
+ * @tsplus static fncts.io.StreamOps succeedNow
2238
+ */
2239
+
2240
+
2241
+ function succeedNow_1(o) {
2242
+ return fromChunkNow_1(tsplus_module_18.single(o));
2243
+ }
2244
+ /**
2245
+ * Creates a single-valued pure stream
2246
+ *
2247
+ * @tsplus static fncts.io.StreamOps succeed
2248
+ */
2249
+
2250
+
2251
+ function succeed(a) {
2252
+ return fromChunk_1(() => tsplus_module_18.single(a()));
2253
+ }
2254
+
2255
+ function takeLoop(n) {
2256
+ return tsplus_module_10.readWithCause(inp => {
2257
+ const taken = tsplus_module_12.take_(inp, n);
2258
+ const left = Math.max(n - taken.length, 0);
2259
+
2260
+ if (left > 0) {
2261
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(taken), takeLoop(left));
2262
+ } else {
2263
+ return tsplus_module_10.writeNow(taken);
2264
+ }
2265
+ }, tsplus_module_11.failCauseNow, tsplus_module_11.endNow);
2266
+ }
2267
+ /**
2268
+ * Takes the specified number of elements from this stream.
2269
+ *
2270
+ * @tsplus fluent fncts.io.Stream take
2271
+ */
2272
+
2273
+
2274
+ function take_(stream, n) {
2275
+ if (n <= 0) {
2276
+ return empty_1;
2277
+ }
2278
+
2279
+ if (!Number.isInteger(n)) {
2280
+ return halt_1(() => new tsplus_module_62.IllegalArgumentError(`${n} should be an integer`, "Stream.take"));
2281
+ }
2282
+
2283
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(stream.channel, takeLoop(n)));
2284
+ }
2285
+ /**
2286
+ * @tsplus fluent fncts.io.Stream takeUntilIO
2287
+ */
2288
+
2289
+
2290
+ function takeUntilIO_(ma, f) {
2291
+ return loopOnPartialChunks_1(ma, (chunk, emit) => tsplus_module_1.map_(tsplus_module_63.takeWhileIO_(chunk, v => tsplus_module_1.apSecond_(emit(v), tsplus_module_1.map_(f(v), b => !b, fileName_1 + ":2587:52"), fileName_1 + ":2587:43")), taken => tsplus_module_12.isEmpty(tsplus_module_12.take_(tsplus_module_12.drop_(taken, taken.length), 1)), fileName_1 + ":2588:11"));
2292
+ }
2293
+
2294
+ function takeUntilLoop(p) {
2295
+ return tsplus_module_10.readWith(chunk => {
2296
+ const taken = tsplus_module_12.takeWhile_(chunk, tsplus_module_46.invert(p));
2297
+ const last = tsplus_module_12.take_(tsplus_module_12.drop_(chunk, taken.length), 1);
2298
+
2299
+ if (tsplus_module_12.isEmpty(last)) {
2300
+ return tsplus_module_11.apSecond_(tsplus_module_10.writeNow(taken), takeUntilLoop(p));
2301
+ } else {
2302
+ return tsplus_module_10.writeNow(tsplus_module_12.concat_(taken, last));
2303
+ }
2304
+ }, tsplus_module_10.failNow, tsplus_module_11.succeedNow);
2305
+ }
2306
+ /**
2307
+ * Takes all elements of the stream until the specified predicate evaluates
2308
+ * to `true`.
2309
+ *
2310
+ * @tsplus fluent fncts.io.Stream takeUntil
2311
+ */
2312
+
2313
+
2314
+ function takeUntil_(fa, p) {
2315
+ return new _definition2.Stream(tsplus_module_10.pipeTo_(fa.channel, takeUntilLoop(p)));
2316
+ }
2317
+ /**
2318
+ * @tsplus fluent fncts.io.Stream tap
2319
+ */
2320
+
2321
+
2322
+ function tap_(ma, f) {
2323
+ return mapIO_1(ma, a => tsplus_module_1.as_(f(a), () => a));
2324
+ }
2325
+ /**
2326
+ * Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket
2327
+ * algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate
2328
+ * tokens up to a `units + burst` threshold. Chunks that do not meet the bandwidth constraints are dropped.
2329
+ * The weight of each chunk is determined by the `costFn` function.
2330
+ *
2331
+ * @tsplus fluent fncts.io.Stream throttleEnforce
2332
+ */
2333
+
2334
+
2335
+ function throttleEnforce_(sa, costFn, units, duration, burst = 0) {
2336
+ return throttleEnforceIO_1(sa, chunk => tsplus_module_1.succeedNow(costFn(chunk), fileName_1 + ":2640:55"), units, duration, burst);
2337
+ }
2338
+
2339
+ function throttleEnforceIOLoop(costFn, units, duration, burst, tokens, timestamp) {
2340
+ return tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(tsplus_module_1.zipWith_(costFn(inp), tsplus_module_40.currentTime, (weight, current) => {
2341
+ const elapsed = current - timestamp;
2342
+ const cycles = elapsed / duration;
2343
+
2344
+ const available = (() => {
2345
+ const sum = tokens + cycles * units;
2346
+ const max = units + burst < 0 ? Number.MAX_SAFE_INTEGER : units + burst;
2347
+ return sum < 0 ? max : Math.min(sum, max);
2348
+ })();
2349
+
2350
+ return weight <= available ? tsplus_module_11.apSecond_(tsplus_module_10.writeNow(inp), throttleEnforceIOLoop(costFn, units, duration, burst, available - weight, current)) : throttleEnforceIOLoop(costFn, units, duration, burst, available - weight, current);
2351
+ })), tsplus_module_10.failNow, () => tsplus_module_10.unit);
2352
+ }
2353
+ /**
2354
+ * Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket
2355
+ * algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate
2356
+ * tokens up to a `units + burst` threshold. Chunks that do not meet the bandwidth constraints are dropped.
2357
+ * The weight of each chunk is determined by the `costFn` effectful function.
2358
+ *
2359
+ * @tsplus fluent fncts.io.Stream throttleEnforceIO
2360
+ */
2361
+
2362
+
2363
+ function throttleEnforceIO_1(sa, costFn, units, duration, burst = 0) {
2364
+ return new _definition2.Stream(tsplus_module_11.flatMap_(tsplus_module_10.fromIO(tsplus_module_40.currentTime), current => tsplus_module_10.pipeTo_(sa.channel, throttleEnforceIOLoop(costFn, units, duration, burst, units, current))));
2365
+ }
2366
+ /**
2367
+ * Converts the stream to a managed hub of chunks. After the managed hub is used,
2368
+ * the hub will never again produce values and should be discarded.
2369
+ *
2370
+ * @tsplus fluent fncts.io.Stream toHub
2371
+ */
2372
+
2373
+
2374
+ function toHub_1(stream, capacity) {
2375
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_30.makeBounded(capacity), _ => tsplus_module_30.shutdown(_)), hub => tsplus_module_1.map_(tsplus_module_1.fork(runIntoHubScoped_1(stream, hub)), () => hub), fileName_1 + ":2706:18");
2376
+ }
2377
+ /**
2378
+ * Interpret the stream as a managed pull
2379
+ *
2380
+ * @tsplus getter fncts.io.Stream toPull
2381
+ */
2382
+
2383
+
2384
+ function toPull_1(stream) {
2385
+ return tsplus_module_1.map_(tsplus_module_64.toPull(stream.channel), io => tsplus_module_1.flatMap_(tsplus_module_1.mapError_(io, tsplus_module_3.just, fileName_1 + ":2719:16"), r => tsplus_module_4.match_(r, () => tsplus_module_1.failNow(tsplus_module_3.nothing(), fileName_1 + ":2719:68"), tsplus_module_1.succeedNow), fileName_1 + ":2719:36"), fileName_1 + ":2718:35");
2386
+ }
2387
+ /**
2388
+ * Converts the stream to a managed queue of chunks. After the managed queue is used,
2389
+ * the queue will never again produce values and should be discarded.
2390
+ *
2391
+ * @tsplus fluent fncts.io.Stream toQueue
2392
+ */
2393
+
2394
+
2395
+ function toQueue_1(stream, capacity = 2) {
2396
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeBounded(capacity), _ => tsplus_module_25.shutdown(_)), queue => tsplus_module_1.map_(tsplus_module_1.fork(runIntoQueueScoped_1(stream, queue)), () => queue), fileName_1 + ":2731:20");
2397
+ }
2398
+ /**
2399
+ * @tsplus fluent fncts.io.Stream toQueueDropping
2400
+ */
2401
+
2402
+
2403
+ function toQueueDropping_(stream, capacity = 2) {
2404
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeDropping(capacity), _ => tsplus_module_25.shutdown(_)), queue => tsplus_module_1.map_(tsplus_module_1.fork(runIntoQueueScoped_1(stream, queue)), () => queue), fileName_1 + ":2745:20");
2405
+ }
2406
+ /**
2407
+ * @tsplus fluent fncts.io.Stream toQueueOfElements
2408
+ */
2409
+
2410
+
2411
+ function toQueueOfElements_1(stream, capacity = 2) {
2412
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeBounded(capacity), _ => tsplus_module_25.shutdown(_)), queue => tsplus_module_1.map_(tsplus_module_1.fork(runIntoElementsScoped_1(stream, queue)), () => queue), fileName_1 + ":2759:20");
2413
+ }
2414
+ /**
2415
+ * @tsplus fluent fncts.io.Stream toQueueSliding
2416
+ */
2417
+
2418
+
2419
+ function toQueueSliding_(stream, capacity = 2) {
2420
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeSliding(capacity), _ => tsplus_module_25.shutdown(_)), queue => tsplus_module_1.map_(tsplus_module_1.fork(runIntoQueueScoped_1(stream, queue)), () => queue), fileName_1 + ":2773:20");
2421
+ }
2422
+ /**
2423
+ * Converts the stream into an unbounded managed queue. After the managed queue
2424
+ * is used, the queue will never again produce values and should be discarded.
2425
+ *
2426
+ * @tsplus getter fncts.io.Stream toQueueUnbounded
2427
+ */
2428
+
2429
+
2430
+ function toQueueUnbounded_1(stream) {
2431
+ return tsplus_module_1.flatMap_(tsplus_module_28.acquireRelease(() => tsplus_module_27.makeUnbounded(), _ => tsplus_module_25.shutdown(_)), queue => tsplus_module_1.map_(tsplus_module_1.fork(runIntoQueueScoped_1(stream, queue)), () => queue), fileName_1 + ":2787:20");
2432
+ }
2433
+
2434
+ function unfoldChunkIOLoop(s, f) {
2435
+ return tsplus_module_10.unwrap(tsplus_module_1.map_(f(s), m => tsplus_module_16.match_(m, () => tsplus_module_10.unit, ([as, s]) => tsplus_module_11.flatMap_(tsplus_module_10.writeNow(as), () => unfoldChunkIOLoop(s, f))), fileName_1 + ":2798:13"));
2436
+ }
2437
+ /**
2438
+ * Creates a stream by effectfully peeling off the "layers" of a value of type `S`
2439
+ *
2440
+ * @tsplus static fncts.io.StreamOps unfoldChunkIO
2441
+ */
2442
+
2443
+
2444
+ function unfoldChunkIO_1(s, f) {
2445
+ return new _definition2.Stream(unfoldChunkIOLoop(s, f));
2446
+ }
2447
+ /**
2448
+ * Creates a stream by effectfully peeling off the "layers" of a value of type `S`
2449
+ *
2450
+ * @tsplus static fncts.io.StreamOps unfoldIO
2451
+ */
2452
+
2453
+
2454
+ function unfoldIO_1(s, f) {
2455
+ return unfoldChunkIO_1(s, _ => tsplus_module_1.map_(f(_), m => tsplus_module_36.map_(m, ([a, s]) => (0, _function.tuple)(tsplus_module_18.single(a), s)), fileName_1 + ":2822:42"));
2456
+ }
2457
+
2458
+ function unfoldChunkLoop(s, f) {
2459
+ return tsplus_module_16.match_(f(s), () => tsplus_module_10.unit, ([as, s]) => tsplus_module_11.flatMap_(tsplus_module_10.writeNow(as), () => unfoldChunkLoop(s, f)));
2460
+ }
2461
+ /**
2462
+ * @tsplus static fncts.io.StreamOps unfoldChunk
2463
+ */
2464
+
2465
+
2466
+ function unfoldChunk_1(s, f) {
2467
+ return new _definition2.Stream(tsplus_module_10.defer(() => unfoldChunkLoop(s, f)));
2468
+ }
2469
+ /**
2470
+ * @tsplus static fncts.io.StreamOps unfold
2471
+ */
2472
+
2473
+
2474
+ function unfold(s, f) {
2475
+ return unfoldChunk_1(s, s => tsplus_module_36.map_(f(s), ([a, s]) => (0, _function.tuple)(tsplus_module_18.single(a), s)));
2476
+ }
2477
+ /**
2478
+ * Creates a stream produced from an IO
2479
+ *
2480
+ * @tsplus static fncts.io.StreamOps unwrap
2481
+ */
2482
+
2483
+
2484
+ function unwrap_1(stream) {
2485
+ return flatten_1(fromIO_1(stream));
2486
+ }
2487
+ /**
2488
+ * Creates a stream produced from a managed
2489
+ *
2490
+ * @tsplus static fncts.io.StreamOps unwrapScoped
2491
+ */
2492
+
2493
+
2494
+ function unwrapScoped_1(stream) {
2495
+ return flatten_1(scoped_1(stream));
2496
+ }
2497
+ /**
2498
+ * Zips the two streams so that when a value is emitted by either of the two
2499
+ * streams, it is combined with the latest value from the other stream to
2500
+ * produce a result.
2501
+ *
2502
+ * Note: tracking the latest value is done on a per-chunk basis. That means
2503
+ * that emitted elements that are not the last value in chunks will never be
2504
+ * used for zipping.
2505
+ *
2506
+ * @tsplus fluent fncts.io.Stream zipWithLatest
2507
+ */
2508
+
2509
+
2510
+ function zipWithLatest_(fa, fb, f) {
2511
+ function pullNonEmpty(pull) {
2512
+ return tsplus_module_1.flatMap_(pull, chunk => tsplus_module_12.isNonEmpty(chunk) ? pullNonEmpty(pull) : tsplus_module_1.succeedNow(chunk, fileName_1 + ":2886:90"), fileName_1 + ":2886:24");
2513
+ }
2514
+
2515
+ return fromPull_1(tsplus_module_1.flatMap_(tsplus_module_1.map_(toPull_1(fa), pullNonEmpty, fileName_1 + ":2890:36"), left => tsplus_module_1.flatMap_(tsplus_module_1.map_(toPull_1(fb), pullNonEmpty, fileName_1 + ":2891:36"), right => toPull_1(flatMap_1(fromIOMaybe_1(tsplus_module_22.raceWith_(left, () => right, (leftDone, rightFiber) => tsplus_module_1.zipWith_(tsplus_module_1.fromExitNow(leftDone, fileName_1 + ":2896:53"), tsplus_module_39.join(rightFiber), (l, r) => (0, _function.tuple)(l, r, true)), (rightDone, leftFiber) => tsplus_module_1.zipWith_(tsplus_module_1.fromExitNow(rightDone, fileName_1 + ":2897:53"), tsplus_module_39.join(leftFiber), (r, l) => (0, _function.tuple)(l, r, false)), fileName_1 + ":2894:24")), ([l, r, leftFirst]) => flatMap_1(fromIO_1(tsplus_module_6.make(() => (0, _function.tuple)(tsplus_module_12.unsafeGet_(l, l.length - 1), tsplus_module_12.unsafeGet_(r, r.length - 1)))), latest => concat_1(fromChunk_1(() => leftFirst ? tsplus_module_12.map_(r, b => f(tsplus_module_12.unsafeGet_(l, l.length - 1), b)) : tsplus_module_12.map_(l, a => f(a, tsplus_module_12.unsafeGet_(r, r.length - 1)))), flatMap_1(mapIO_1(mergeEither_1(repeatIOMaybe_1(left), repeatIOMaybe_1(right)), ab => tsplus_module_4.match_(ab, leftChunk => tsplus_module_14.modify_(latest, ([_, rightLatest]) => (0, _function.tuple)(tsplus_module_12.map_(leftChunk, a => f(a, rightLatest)), (0, _function.tuple)(tsplus_module_12.unsafeGet_(leftChunk, leftChunk.length - 1), rightLatest))), rightChunk => tsplus_module_14.modify_(latest, ([leftLatest, _]) => (0, _function.tuple)(tsplus_module_12.map_(rightChunk, b => f(leftLatest, b)), (0, _function.tuple)(leftLatest, tsplus_module_12.unsafeGet_(rightChunk, rightChunk.length - 1)))))), fromChunkNow_1))))), fileName_1 + ":2891:22"), fileName_1 + ":2890:22"));
2516
+ }
2517
+ //# sourceMappingURL=api.cjs.map