@fncts/io 0.0.48 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (675) hide show
  1. package/Cached/api.d.ts +1 -1
  2. package/Channel/api.d.ts +80 -80
  3. package/Channel/core-api.d.ts +26 -26
  4. package/Console/definition.d.ts +1 -0
  5. package/CountdownLatch.d.ts +1 -0
  6. package/Fiber/FiberMessage.d.ts +6 -28
  7. package/Fiber/FiberRuntime.d.ts +108 -77
  8. package/Fiber/api/interruptAs.d.ts +2 -2
  9. package/Fiber/definition.d.ts +2 -0
  10. package/FiberScope/definition.d.ts +3 -0
  11. package/FiberSet.d.ts +2 -1
  12. package/Future/State.d.ts +59 -0
  13. package/Future/api.d.ts +8 -3
  14. package/Future/constructors.d.ts +1 -1
  15. package/Future/definition.d.ts +1 -17
  16. package/Future.d.ts +1 -0
  17. package/Hub/api.d.ts +15 -15
  18. package/IO/api/array.d.ts +22 -0
  19. package/IO/api/awaitAllChildren.d.ts +6 -0
  20. package/IO/api/cachedInvalidate.d.ts +15 -0
  21. package/IO/api/forkDaemon.d.ts +1 -1
  22. package/IO/api/onTermination.d.ts +1 -2
  23. package/IO/api/transplant.d.ts +11 -1
  24. package/IO/api.d.ts +247 -225
  25. package/IO/definition.d.ts +12 -25
  26. package/IO.d.ts +3 -1
  27. package/Random/definition.d.ts +1 -0
  28. package/Ref/Synchronized/api.d.ts +1 -1
  29. package/Semaphore/Reservation.d.ts +15 -0
  30. package/Semaphore/constructors.d.ts +13 -0
  31. package/Semaphore/definition.d.ts +29 -0
  32. package/Semaphore.d.ts +3 -40
  33. package/Stream/api.d.ts +164 -164
  34. package/_cjs/Cached/api.cjs +1 -2
  35. package/_cjs/Cached/api.cjs.map +1 -1
  36. package/_cjs/Cached/internal.cjs +1 -2
  37. package/_cjs/Cached/internal.cjs.map +1 -1
  38. package/_cjs/Channel/api/interruptWhen.cjs +1 -2
  39. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  40. package/_cjs/Channel/api/mapOutConcurrentIO.cjs +2 -3
  41. package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
  42. package/_cjs/Channel/api/mergeAll.cjs +1 -2
  43. package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
  44. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +1 -2
  45. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
  46. package/_cjs/Channel/api/mergeAllWith.cjs +2 -3
  47. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  48. package/_cjs/Channel/api/mergeMap.cjs +1 -2
  49. package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
  50. package/_cjs/Channel/api/mergeWith.cjs +1 -2
  51. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  52. package/_cjs/Channel/api/run.cjs +1 -2
  53. package/_cjs/Channel/api/run.cjs.map +1 -1
  54. package/_cjs/Channel/api/runCollect.cjs +1 -2
  55. package/_cjs/Channel/api/runCollect.cjs.map +1 -1
  56. package/_cjs/Channel/api/runDrain.cjs +1 -2
  57. package/_cjs/Channel/api/runDrain.cjs.map +1 -1
  58. package/_cjs/Channel/api/runScoped.cjs +3 -4
  59. package/_cjs/Channel/api/runScoped.cjs.map +1 -1
  60. package/_cjs/Channel/api/toPull.cjs +2 -3
  61. package/_cjs/Channel/api/toPull.cjs.map +1 -1
  62. package/_cjs/Channel/api/zipConcurrent.cjs +1 -2
  63. package/_cjs/Channel/api/zipConcurrent.cjs.map +1 -1
  64. package/_cjs/Channel/api.cjs +206 -207
  65. package/_cjs/Channel/api.cjs.map +1 -1
  66. package/_cjs/Channel/core-api.cjs +43 -42
  67. package/_cjs/Channel/core-api.cjs.map +1 -1
  68. package/_cjs/Channel/internal/ChannelExecutor.cjs +4 -5
  69. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  70. package/_cjs/Channel/internal/ChannelState.cjs +1 -2
  71. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
  72. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +1 -2
  73. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  74. package/_cjs/Clock/api.cjs +1 -2
  75. package/_cjs/Clock/api.cjs.map +1 -1
  76. package/_cjs/Clock/definition.cjs +1 -2
  77. package/_cjs/Clock/definition.cjs.map +1 -1
  78. package/_cjs/Clock/live.cjs +1 -2
  79. package/_cjs/Clock/live.cjs.map +1 -1
  80. package/_cjs/Console/api.cjs +1 -2
  81. package/_cjs/Console/api.cjs.map +1 -1
  82. package/_cjs/Console/definition.cjs +2 -2
  83. package/_cjs/Console/definition.cjs.map +1 -1
  84. package/_cjs/Console/live.cjs +1 -2
  85. package/_cjs/Console/live.cjs.map +1 -1
  86. package/_cjs/CountdownLatch.cjs +3 -3
  87. package/_cjs/CountdownLatch.cjs.map +1 -1
  88. package/_cjs/Differ/api.cjs +1 -2
  89. package/_cjs/Differ/api.cjs.map +1 -1
  90. package/_cjs/Fiber/FiberMessage.cjs +3 -24
  91. package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
  92. package/_cjs/Fiber/FiberRuntime.cjs +879 -636
  93. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  94. package/_cjs/Fiber/api/awaitAll.cjs +1 -2
  95. package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
  96. package/_cjs/Fiber/api/collectAll.cjs +2 -3
  97. package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
  98. package/_cjs/Fiber/api/fromIO.cjs +1 -2
  99. package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
  100. package/_cjs/Fiber/api/interrupt.cjs +2 -3
  101. package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
  102. package/_cjs/Fiber/api/interruptAll.cjs +2 -3
  103. package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
  104. package/_cjs/Fiber/api/interruptAs.cjs +5 -10
  105. package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
  106. package/_cjs/Fiber/api/interruptFork.cjs +2 -3
  107. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  108. package/_cjs/Fiber/api/join.cjs +1 -2
  109. package/_cjs/Fiber/api/join.cjs.map +1 -1
  110. package/_cjs/Fiber/api/joinAll.cjs +1 -2
  111. package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
  112. package/_cjs/Fiber/api/mapFiber.cjs +1 -2
  113. package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
  114. package/_cjs/Fiber/api/mapIO.cjs +2 -3
  115. package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
  116. package/_cjs/Fiber/api/zipWith.cjs +2 -3
  117. package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
  118. package/_cjs/Fiber/constructors.cjs +2 -3
  119. package/_cjs/Fiber/constructors.cjs.map +1 -1
  120. package/_cjs/Fiber/definition.cjs +6 -4
  121. package/_cjs/Fiber/definition.cjs.map +1 -1
  122. package/_cjs/FiberRef/api/locallyScoped.cjs +1 -2
  123. package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
  124. package/_cjs/FiberRef/api/locallyScopedWith.cjs +1 -2
  125. package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
  126. package/_cjs/FiberRef/constructors.cjs +1 -2
  127. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  128. package/_cjs/FiberRef/definition.cjs +1 -2
  129. package/_cjs/FiberRef/definition.cjs.map +1 -1
  130. package/_cjs/FiberRef/operations.cjs +1 -2
  131. package/_cjs/FiberRef/operations.cjs.map +1 -1
  132. package/_cjs/FiberRef/unsafe.cjs +1 -2
  133. package/_cjs/FiberRef/unsafe.cjs.map +1 -1
  134. package/_cjs/FiberRefs/Patch.cjs +1 -2
  135. package/_cjs/FiberRefs/Patch.cjs.map +1 -1
  136. package/_cjs/FiberRefs/api.cjs +1 -2
  137. package/_cjs/FiberRefs/api.cjs.map +1 -1
  138. package/_cjs/FiberRefs/definition.cjs +1 -2
  139. package/_cjs/FiberRefs/definition.cjs.map +1 -1
  140. package/_cjs/FiberScope/definition.cjs +29 -6
  141. package/_cjs/FiberScope/definition.cjs.map +1 -1
  142. package/_cjs/FiberSet.cjs +16 -15
  143. package/_cjs/FiberSet.cjs.map +1 -1
  144. package/_cjs/FiberStatus/definition.cjs +1 -2
  145. package/_cjs/FiberStatus/definition.cjs.map +1 -1
  146. package/_cjs/Future/State.cjs +108 -0
  147. package/_cjs/Future/State.cjs.map +1 -0
  148. package/_cjs/Future/api.cjs +71 -64
  149. package/_cjs/Future/api.cjs.map +1 -1
  150. package/_cjs/Future/constructors.cjs +3 -4
  151. package/_cjs/Future/constructors.cjs.map +1 -1
  152. package/_cjs/Future/definition.cjs +1 -15
  153. package/_cjs/Future/definition.cjs.map +1 -1
  154. package/_cjs/Future.cjs +11 -0
  155. package/_cjs/Future.cjs.map +1 -1
  156. package/_cjs/Hub/api.cjs +56 -57
  157. package/_cjs/Hub/api.cjs.map +1 -1
  158. package/_cjs/Hub/internal.cjs +1 -2
  159. package/_cjs/Hub/internal.cjs.map +1 -1
  160. package/_cjs/IO/api/acquireRelease.cjs +1 -2
  161. package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
  162. package/_cjs/IO/api/acquireReleaseExit.cjs +1 -2
  163. package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
  164. package/_cjs/IO/api/acquireReleaseInterruptible.cjs +1 -2
  165. package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -1
  166. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +1 -2
  167. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
  168. package/_cjs/IO/api/addFinalizer.cjs +1 -2
  169. package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
  170. package/_cjs/IO/api/addFinalizerExit.cjs +1 -2
  171. package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
  172. package/_cjs/IO/api/all.cjs +1 -2
  173. package/_cjs/IO/api/all.cjs.map +1 -1
  174. package/_cjs/IO/api/array.cjs +51 -0
  175. package/_cjs/IO/api/array.cjs.map +1 -0
  176. package/_cjs/IO/api/asyncIO.cjs +1 -2
  177. package/_cjs/IO/api/asyncIO.cjs.map +1 -1
  178. package/_cjs/IO/api/asyncInterrupt.cjs +1 -2
  179. package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
  180. package/_cjs/IO/api/awaitAllChildren.cjs +17 -0
  181. package/_cjs/IO/api/awaitAllChildren.cjs.map +1 -0
  182. package/_cjs/IO/api/blocking.cjs +1 -2
  183. package/_cjs/IO/api/blocking.cjs.map +1 -1
  184. package/_cjs/IO/api/bracket.cjs +1 -2
  185. package/_cjs/IO/api/bracket.cjs.map +1 -1
  186. package/_cjs/IO/api/bracketExit.cjs +1 -2
  187. package/_cjs/IO/api/bracketExit.cjs.map +1 -1
  188. package/_cjs/IO/api/cachedInvalidate.cjs +47 -0
  189. package/_cjs/IO/api/cachedInvalidate.cjs.map +1 -0
  190. package/_cjs/IO/api/clockWith.cjs +1 -2
  191. package/_cjs/IO/api/clockWith.cjs.map +1 -1
  192. package/_cjs/IO/api/concurrency.cjs +1 -2
  193. package/_cjs/IO/api/concurrency.cjs.map +1 -1
  194. package/_cjs/IO/api/concurrentFinalizers.cjs +1 -2
  195. package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
  196. package/_cjs/IO/api/consoleWith.cjs +1 -2
  197. package/_cjs/IO/api/consoleWith.cjs.map +1 -1
  198. package/_cjs/IO/api/daemonChildren.cjs +1 -2
  199. package/_cjs/IO/api/daemonChildren.cjs.map +1 -1
  200. package/_cjs/IO/api/delay.cjs +1 -2
  201. package/_cjs/IO/api/delay.cjs.map +1 -1
  202. package/_cjs/IO/api/descriptor.cjs +1 -2
  203. package/_cjs/IO/api/descriptor.cjs.map +1 -1
  204. package/_cjs/IO/api/diffFiberRefs.cjs +1 -2
  205. package/_cjs/IO/api/diffFiberRefs.cjs.map +1 -1
  206. package/_cjs/IO/api/disconnect.cjs +2 -3
  207. package/_cjs/IO/api/disconnect.cjs.map +1 -1
  208. package/_cjs/IO/api/ensuringChildren.cjs +1 -2
  209. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
  210. package/_cjs/IO/api/environment.cjs +1 -2
  211. package/_cjs/IO/api/environment.cjs.map +1 -1
  212. package/_cjs/IO/api/foreachConcurrent.cjs +36 -30
  213. package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
  214. package/_cjs/IO/api/foreachExec.cjs +1 -2
  215. package/_cjs/IO/api/foreachExec.cjs.map +1 -1
  216. package/_cjs/IO/api/fork.cjs +2 -3
  217. package/_cjs/IO/api/fork.cjs.map +1 -1
  218. package/_cjs/IO/api/forkAll.cjs +1 -2
  219. package/_cjs/IO/api/forkAll.cjs.map +1 -1
  220. package/_cjs/IO/api/forkDaemon.cjs +5 -6
  221. package/_cjs/IO/api/forkDaemon.cjs.map +1 -1
  222. package/_cjs/IO/api/forkIn.cjs +1 -2
  223. package/_cjs/IO/api/forkIn.cjs.map +1 -1
  224. package/_cjs/IO/api/forkScoped.cjs +1 -2
  225. package/_cjs/IO/api/forkScoped.cjs.map +1 -1
  226. package/_cjs/IO/api/fulfill.cjs +1 -2
  227. package/_cjs/IO/api/fulfill.cjs.map +1 -1
  228. package/_cjs/IO/api/interrupt.cjs +4 -5
  229. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  230. package/_cjs/IO/api/memoize.cjs +1 -2
  231. package/_cjs/IO/api/memoize.cjs.map +1 -1
  232. package/_cjs/IO/api/onTermination.cjs +2 -3
  233. package/_cjs/IO/api/onTermination.cjs.map +1 -1
  234. package/_cjs/IO/api/once.cjs +1 -2
  235. package/_cjs/IO/api/once.cjs.map +1 -1
  236. package/_cjs/IO/api/patchFiberRefs.cjs +1 -2
  237. package/_cjs/IO/api/patchFiberRefs.cjs.map +1 -1
  238. package/_cjs/IO/api/provideLayer.cjs +1 -2
  239. package/_cjs/IO/api/provideLayer.cjs.map +1 -1
  240. package/_cjs/IO/api/provideScope.cjs +1 -2
  241. package/_cjs/IO/api/provideScope.cjs.map +1 -1
  242. package/_cjs/IO/api/provideSomeLayer.cjs +1 -2
  243. package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
  244. package/_cjs/IO/api/provideSomeRuntime.cjs +1 -2
  245. package/_cjs/IO/api/provideSomeRuntime.cjs.map +1 -1
  246. package/_cjs/IO/api/race.cjs +2 -3
  247. package/_cjs/IO/api/race.cjs.map +1 -1
  248. package/_cjs/IO/api/raceFirst.cjs +1 -2
  249. package/_cjs/IO/api/raceFirst.cjs.map +1 -1
  250. package/_cjs/IO/api/raceWith.cjs +1 -2
  251. package/_cjs/IO/api/raceWith.cjs.map +1 -1
  252. package/_cjs/IO/api/randomWith.cjs +1 -2
  253. package/_cjs/IO/api/randomWith.cjs.map +1 -1
  254. package/_cjs/IO/api/repeat.cjs +1 -2
  255. package/_cjs/IO/api/repeat.cjs.map +1 -1
  256. package/_cjs/IO/api/retry.cjs +1 -2
  257. package/_cjs/IO/api/retry.cjs.map +1 -1
  258. package/_cjs/IO/api/schedule.cjs +1 -2
  259. package/_cjs/IO/api/schedule.cjs.map +1 -1
  260. package/_cjs/IO/api/scope.cjs +1 -2
  261. package/_cjs/IO/api/scope.cjs.map +1 -1
  262. package/_cjs/IO/api/scopeWith.cjs +1 -2
  263. package/_cjs/IO/api/scopeWith.cjs.map +1 -1
  264. package/_cjs/IO/api/scoped.cjs +1 -2
  265. package/_cjs/IO/api/scoped.cjs.map +1 -1
  266. package/_cjs/IO/api/sleep.cjs +1 -2
  267. package/_cjs/IO/api/sleep.cjs.map +1 -1
  268. package/_cjs/IO/api/stateful.cjs +1 -2
  269. package/_cjs/IO/api/stateful.cjs.map +1 -1
  270. package/_cjs/IO/api/supervised.cjs +1 -2
  271. package/_cjs/IO/api/supervised.cjs.map +1 -1
  272. package/_cjs/IO/api/timeout.cjs +9 -11
  273. package/_cjs/IO/api/timeout.cjs.map +1 -1
  274. package/_cjs/IO/api/transplant.cjs +22 -7
  275. package/_cjs/IO/api/transplant.cjs.map +1 -1
  276. package/_cjs/IO/api/whenFiberRef.cjs +1 -2
  277. package/_cjs/IO/api/whenFiberRef.cjs.map +1 -1
  278. package/_cjs/IO/api/whenRef.cjs +1 -2
  279. package/_cjs/IO/api/whenRef.cjs.map +1 -1
  280. package/_cjs/IO/api/withChildren.cjs +1 -2
  281. package/_cjs/IO/api/withChildren.cjs.map +1 -1
  282. package/_cjs/IO/api/withEarlyRelease.cjs +1 -2
  283. package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
  284. package/_cjs/IO/api/withFinalizer.cjs +1 -2
  285. package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
  286. package/_cjs/IO/api/withFinalizerExit.cjs +1 -2
  287. package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
  288. package/_cjs/IO/api/zipConcurrent.cjs +5 -6
  289. package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
  290. package/_cjs/IO/api.cjs +522 -473
  291. package/_cjs/IO/api.cjs.map +1 -1
  292. package/_cjs/IO/definition.cjs +2 -3
  293. package/_cjs/IO/definition.cjs.map +1 -1
  294. package/_cjs/IO/runtime.cjs +9 -10
  295. package/_cjs/IO/runtime.cjs.map +1 -1
  296. package/_cjs/IO.cjs +33 -11
  297. package/_cjs/IO.cjs.map +1 -1
  298. package/_cjs/IOEnv/definition.cjs +1 -2
  299. package/_cjs/IOEnv/definition.cjs.map +1 -1
  300. package/_cjs/IOEnv/live.cjs +1 -2
  301. package/_cjs/IOEnv/live.cjs.map +1 -1
  302. package/_cjs/IOEnv/services.cjs +1 -2
  303. package/_cjs/IOEnv/services.cjs.map +1 -1
  304. package/_cjs/Layer/MemoMap.cjs +1 -2
  305. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  306. package/_cjs/Layer/api.cjs +1 -2
  307. package/_cjs/Layer/api.cjs.map +1 -1
  308. package/_cjs/Logger/api.cjs +1 -2
  309. package/_cjs/Logger/api.cjs.map +1 -1
  310. package/_cjs/Logger/constructors.cjs +1 -2
  311. package/_cjs/Logger/constructors.cjs.map +1 -1
  312. package/_cjs/MVar/api.cjs +1 -2
  313. package/_cjs/MVar/api.cjs.map +1 -1
  314. package/_cjs/Push/api.cjs +2 -3
  315. package/_cjs/Push/api.cjs.map +1 -1
  316. package/_cjs/Push/internal.cjs +1 -2
  317. package/_cjs/Push/internal.cjs.map +1 -1
  318. package/_cjs/Queue/api/dimapIO.cjs +1 -2
  319. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  320. package/_cjs/Queue/api/filterInputIO.cjs +1 -2
  321. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  322. package/_cjs/Queue/api/filterOutputIO.cjs +1 -2
  323. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  324. package/_cjs/Queue/api/poll.cjs +1 -2
  325. package/_cjs/Queue/api/poll.cjs.map +1 -1
  326. package/_cjs/Queue/api/takeBetween.cjs +1 -2
  327. package/_cjs/Queue/api/takeBetween.cjs.map +1 -1
  328. package/_cjs/Queue/api/takeN.cjs +1 -2
  329. package/_cjs/Queue/api/takeN.cjs.map +1 -1
  330. package/_cjs/Queue/api/zipWithIO.cjs +1 -2
  331. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
  332. package/_cjs/Queue/constructors.cjs +1 -2
  333. package/_cjs/Queue/constructors.cjs.map +1 -1
  334. package/_cjs/Queue/internal.cjs +1 -2
  335. package/_cjs/Queue/internal.cjs.map +1 -1
  336. package/_cjs/Queue/strategy.cjs +1 -2
  337. package/_cjs/Queue/strategy.cjs.map +1 -1
  338. package/_cjs/Random/api.cjs +1 -2
  339. package/_cjs/Random/api.cjs.map +1 -1
  340. package/_cjs/Random/definition.cjs +2 -2
  341. package/_cjs/Random/definition.cjs.map +1 -1
  342. package/_cjs/Random/live.cjs +1 -2
  343. package/_cjs/Random/live.cjs.map +1 -1
  344. package/_cjs/Ref/Atomic.cjs +1 -2
  345. package/_cjs/Ref/Atomic.cjs.map +1 -1
  346. package/_cjs/Ref/Derived.cjs +1 -2
  347. package/_cjs/Ref/Derived.cjs.map +1 -1
  348. package/_cjs/Ref/DerivedAll.cjs +1 -2
  349. package/_cjs/Ref/DerivedAll.cjs.map +1 -1
  350. package/_cjs/Ref/Synchronized/api.cjs +2 -3
  351. package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
  352. package/_cjs/Ref/Synchronized/constructors.cjs +2 -3
  353. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
  354. package/_cjs/Ref/Synchronized/definition.cjs +2 -3
  355. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  356. package/_cjs/Ref/api/collect.cjs +1 -2
  357. package/_cjs/Ref/api/collect.cjs.map +1 -1
  358. package/_cjs/Ref/api/dimap.cjs +1 -2
  359. package/_cjs/Ref/api/dimap.cjs.map +1 -1
  360. package/_cjs/Ref/api/filter.cjs +1 -2
  361. package/_cjs/Ref/api/filter.cjs.map +1 -1
  362. package/_cjs/Ref/api/modify.cjs +1 -2
  363. package/_cjs/Ref/api/modify.cjs.map +1 -1
  364. package/_cjs/Ref/api.cjs +1 -2
  365. package/_cjs/Ref/api.cjs.map +1 -1
  366. package/_cjs/Ref/constructors.cjs +1 -2
  367. package/_cjs/Ref/constructors.cjs.map +1 -1
  368. package/_cjs/RefSubject/Atomic.cjs +1 -2
  369. package/_cjs/RefSubject/Atomic.cjs.map +1 -1
  370. package/_cjs/RefSubject/Synchronized/api.cjs +1 -2
  371. package/_cjs/RefSubject/Synchronized/api.cjs.map +1 -1
  372. package/_cjs/RefSubject/Synchronized/definition.cjs +1 -2
  373. package/_cjs/RefSubject/Synchronized/definition.cjs.map +1 -1
  374. package/_cjs/RefSubject/api.cjs +1 -2
  375. package/_cjs/RefSubject/api.cjs.map +1 -1
  376. package/_cjs/Reloadable/api.cjs +1 -2
  377. package/_cjs/Reloadable/api.cjs.map +1 -1
  378. package/_cjs/Reloadable/constructors.cjs +1 -2
  379. package/_cjs/Reloadable/constructors.cjs.map +1 -1
  380. package/_cjs/Reloadable/definition.cjs +1 -2
  381. package/_cjs/Reloadable/definition.cjs.map +1 -1
  382. package/_cjs/RuntimeFlags/Patch.cjs +1 -2
  383. package/_cjs/RuntimeFlags/Patch.cjs.map +1 -1
  384. package/_cjs/RuntimeFlags/RuntimeFlags.cjs +1 -2
  385. package/_cjs/RuntimeFlags/RuntimeFlags.cjs.map +1 -1
  386. package/_cjs/STM/api/atomically.cjs +1 -2
  387. package/_cjs/STM/api/atomically.cjs.map +1 -1
  388. package/_cjs/STM/api/core-api.cjs +1 -2
  389. package/_cjs/STM/api/core-api.cjs.map +1 -1
  390. package/_cjs/STM/api.cjs +1 -2
  391. package/_cjs/STM/api.cjs.map +1 -1
  392. package/_cjs/STM/definition.cjs +2 -3
  393. package/_cjs/STM/definition.cjs.map +1 -1
  394. package/_cjs/STM/driver.cjs +1 -2
  395. package/_cjs/STM/driver.cjs.map +1 -1
  396. package/_cjs/STM/internal/CommitState.cjs +1 -2
  397. package/_cjs/STM/internal/CommitState.cjs.map +1 -1
  398. package/_cjs/STM/internal/Journal.cjs +1 -2
  399. package/_cjs/STM/internal/Journal.cjs.map +1 -1
  400. package/_cjs/Schedule/Decision.cjs +1 -2
  401. package/_cjs/Schedule/Decision.cjs.map +1 -1
  402. package/_cjs/Schedule/api/driver.cjs +1 -2
  403. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  404. package/_cjs/Schedule/api.cjs +1 -2
  405. package/_cjs/Schedule/api.cjs.map +1 -1
  406. package/_cjs/Scope/Finalizer/definition.cjs +1 -2
  407. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  408. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -2
  409. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
  410. package/_cjs/Scope/ReleaseMap/api.cjs +1 -2
  411. package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
  412. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -2
  413. package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
  414. package/_cjs/Scope/ReleaseMap/definition.cjs +1 -2
  415. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  416. package/_cjs/Scope/api.cjs +1 -2
  417. package/_cjs/Scope/api.cjs.map +1 -1
  418. package/_cjs/Scope/definition.cjs +1 -2
  419. package/_cjs/Scope/definition.cjs.map +1 -1
  420. package/_cjs/ScopedRef/api.cjs +2 -3
  421. package/_cjs/ScopedRef/api.cjs.map +1 -1
  422. package/_cjs/Semaphore/Reservation.cjs +24 -0
  423. package/_cjs/Semaphore/Reservation.cjs.map +1 -0
  424. package/_cjs/Semaphore/constructors.cjs +25 -0
  425. package/_cjs/Semaphore/constructors.cjs.map +1 -0
  426. package/_cjs/Semaphore/definition.cjs +149 -0
  427. package/_cjs/Semaphore/definition.cjs.map +1 -0
  428. package/_cjs/Semaphore.cjs +31 -138
  429. package/_cjs/Semaphore.cjs.map +1 -1
  430. package/_cjs/Sink/api.cjs +1 -2
  431. package/_cjs/Sink/api.cjs.map +1 -1
  432. package/_cjs/State/api.cjs +1 -2
  433. package/_cjs/State/api.cjs.map +1 -1
  434. package/_cjs/Stream/api/zipAllWith.cjs +1 -2
  435. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
  436. package/_cjs/Stream/api/zipWith.cjs +1 -2
  437. package/_cjs/Stream/api/zipWith.cjs.map +1 -1
  438. package/_cjs/Stream/api/zipWithChunks.cjs +1 -2
  439. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
  440. package/_cjs/Stream/api.cjs +702 -703
  441. package/_cjs/Stream/api.cjs.map +1 -1
  442. package/_cjs/Stream/internal/Handoff.cjs +1 -2
  443. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  444. package/_cjs/Stream/internal/Pull.cjs +1 -2
  445. package/_cjs/Stream/internal/Pull.cjs.map +1 -1
  446. package/_cjs/Stream/internal/Take.cjs +1 -2
  447. package/_cjs/Stream/internal/Take.cjs.map +1 -1
  448. package/_cjs/Stream/internal/util.cjs +1 -2
  449. package/_cjs/Stream/internal/util.cjs.map +1 -1
  450. package/_cjs/Subject/Atomic.cjs +1 -2
  451. package/_cjs/Subject/Atomic.cjs.map +1 -1
  452. package/_cjs/Subject/api.cjs +1 -2
  453. package/_cjs/Subject/api.cjs.map +1 -1
  454. package/_cjs/SubscriptionRef.cjs +2 -3
  455. package/_cjs/SubscriptionRef.cjs.map +1 -1
  456. package/_cjs/Supervisor/api.cjs +1 -2
  457. package/_cjs/Supervisor/api.cjs.map +1 -1
  458. package/_cjs/Supervisor/constructors.cjs +1 -2
  459. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  460. package/_cjs/Supervisor/definition.cjs +1 -2
  461. package/_cjs/Supervisor/definition.cjs.map +1 -1
  462. package/_cjs/SupervisorPatch.cjs +1 -2
  463. package/_cjs/SupervisorPatch.cjs.map +1 -1
  464. package/_cjs/TExit/definition.cjs +1 -2
  465. package/_cjs/TExit/definition.cjs.map +1 -1
  466. package/_cjs/TFuture/api.cjs +1 -2
  467. package/_cjs/TFuture/api.cjs.map +1 -1
  468. package/_cjs/TFuture/constructors.cjs +1 -2
  469. package/_cjs/TFuture/constructors.cjs.map +1 -1
  470. package/_cjs/TFuture/definition.cjs +1 -2
  471. package/_cjs/TFuture/definition.cjs.map +1 -1
  472. package/_cjs/TReentrantLock/api.cjs +1 -2
  473. package/_cjs/TReentrantLock/api.cjs.map +1 -1
  474. package/_cjs/TReentrantLock/definition.cjs +1 -2
  475. package/_cjs/TReentrantLock/definition.cjs.map +1 -1
  476. package/_cjs/TRef/api.cjs +1 -2
  477. package/_cjs/TRef/api.cjs.map +1 -1
  478. package/_cjs/TRef/constructors.cjs +1 -2
  479. package/_cjs/TRef/constructors.cjs.map +1 -1
  480. package/_cjs/TRef/definition.cjs +1 -2
  481. package/_cjs/TRef/definition.cjs.map +1 -1
  482. package/_cjs/TSemaphore/api.cjs +1 -2
  483. package/_cjs/TSemaphore/api.cjs.map +1 -1
  484. package/_cjs/TSemaphore/constructors.cjs +1 -2
  485. package/_cjs/TSemaphore/constructors.cjs.map +1 -1
  486. package/_cjs/TSemaphore/definition.cjs +1 -2
  487. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  488. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +1 -2
  489. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
  490. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +1 -2
  491. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
  492. package/_cjs/collection/immutable/Conc/filterIO.cjs +1 -2
  493. package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
  494. package/_cjs/collection/immutable/Conc/findIO.cjs +1 -2
  495. package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
  496. package/_cjs/collection/immutable/Conc/mapIO.cjs +1 -2
  497. package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
  498. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +1 -2
  499. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
  500. package/_cjs/data/Exit/foreachIO.cjs +1 -2
  501. package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
  502. package/_cjs/internal/HashedPair.cjs +1 -2
  503. package/_cjs/internal/HashedPair.cjs.map +1 -1
  504. package/_cjs/internal/Hub.cjs +1 -2
  505. package/_cjs/internal/Hub.cjs.map +1 -1
  506. package/_cjs/internal/MutableQueue.cjs +1 -2
  507. package/_cjs/internal/MutableQueue.cjs.map +1 -1
  508. package/_cjs/internal/Scheduler.cjs +1 -2
  509. package/_cjs/internal/Scheduler.cjs.map +1 -1
  510. package/_cjs/internal/StackTraceBuilder.cjs +1 -2
  511. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
  512. package/_mjs/Cached/api.mjs.map +1 -1
  513. package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
  514. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  515. package/_mjs/Channel/api/runScoped.mjs +2 -2
  516. package/_mjs/Channel/api/runScoped.mjs.map +1 -1
  517. package/_mjs/Channel/api/toPull.mjs +1 -1
  518. package/_mjs/Channel/api/toPull.mjs.map +1 -1
  519. package/_mjs/Channel/api.mjs +205 -205
  520. package/_mjs/Channel/api.mjs.map +1 -1
  521. package/_mjs/Channel/core-api.mjs +43 -42
  522. package/_mjs/Channel/core-api.mjs.map +1 -1
  523. package/_mjs/Channel/internal/ChannelExecutor.mjs +3 -3
  524. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  525. package/_mjs/Console/definition.mjs +1 -0
  526. package/_mjs/Console/definition.mjs.map +1 -1
  527. package/_mjs/CountdownLatch.mjs +2 -1
  528. package/_mjs/CountdownLatch.mjs.map +1 -1
  529. package/_mjs/Fiber/FiberMessage.mjs +2 -20
  530. package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
  531. package/_mjs/Fiber/FiberRuntime.mjs +877 -633
  532. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  533. package/_mjs/Fiber/api/collectAll.mjs +1 -1
  534. package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
  535. package/_mjs/Fiber/api/interrupt.mjs +1 -1
  536. package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
  537. package/_mjs/Fiber/api/interruptAll.mjs +1 -1
  538. package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
  539. package/_mjs/Fiber/api/interruptAs.mjs +4 -7
  540. package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
  541. package/_mjs/Fiber/api/interruptFork.mjs +1 -1
  542. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  543. package/_mjs/Fiber/api/mapIO.mjs +1 -1
  544. package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
  545. package/_mjs/Fiber/api/zipWith.mjs +1 -1
  546. package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
  547. package/_mjs/Fiber/constructors.mjs +1 -1
  548. package/_mjs/Fiber/constructors.mjs.map +1 -1
  549. package/_mjs/Fiber/definition.mjs +5 -2
  550. package/_mjs/Fiber/definition.mjs.map +1 -1
  551. package/_mjs/FiberScope/definition.mjs +28 -4
  552. package/_mjs/FiberScope/definition.mjs.map +1 -1
  553. package/_mjs/FiberSet.mjs +14 -12
  554. package/_mjs/FiberSet.mjs.map +1 -1
  555. package/_mjs/Future/State.mjs +96 -0
  556. package/_mjs/Future/State.mjs.map +1 -0
  557. package/_mjs/Future/api.mjs +67 -61
  558. package/_mjs/Future/api.mjs.map +1 -1
  559. package/_mjs/Future/constructors.mjs +3 -3
  560. package/_mjs/Future/constructors.mjs.map +1 -1
  561. package/_mjs/Future/definition.mjs +0 -12
  562. package/_mjs/Future/definition.mjs.map +1 -1
  563. package/_mjs/Future.mjs +1 -0
  564. package/_mjs/Future.mjs.map +1 -1
  565. package/_mjs/Hub/api.mjs +55 -55
  566. package/_mjs/Hub/api.mjs.map +1 -1
  567. package/_mjs/IO/api/array.mjs +42 -0
  568. package/_mjs/IO/api/array.mjs.map +1 -0
  569. package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
  570. package/_mjs/IO/api/awaitAllChildren.mjs +10 -0
  571. package/_mjs/IO/api/awaitAllChildren.mjs.map +1 -0
  572. package/_mjs/IO/api/cachedInvalidate.mjs +39 -0
  573. package/_mjs/IO/api/cachedInvalidate.mjs.map +1 -0
  574. package/_mjs/IO/api/disconnect.mjs +1 -1
  575. package/_mjs/IO/api/disconnect.mjs.map +1 -1
  576. package/_mjs/IO/api/foreachConcurrent.mjs +35 -28
  577. package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
  578. package/_mjs/IO/api/fork.mjs +1 -1
  579. package/_mjs/IO/api/fork.mjs.map +1 -1
  580. package/_mjs/IO/api/forkDaemon.mjs +4 -4
  581. package/_mjs/IO/api/forkDaemon.mjs.map +1 -1
  582. package/_mjs/IO/api/interrupt.mjs +3 -3
  583. package/_mjs/IO/api/onTermination.mjs +1 -1
  584. package/_mjs/IO/api/onTermination.mjs.map +1 -1
  585. package/_mjs/IO/api/race.mjs +1 -1
  586. package/_mjs/IO/api/race.mjs.map +1 -1
  587. package/_mjs/IO/api/timeout.mjs +8 -9
  588. package/_mjs/IO/api/timeout.mjs.map +1 -1
  589. package/_mjs/IO/api/transplant.mjs +19 -5
  590. package/_mjs/IO/api/transplant.mjs.map +1 -1
  591. package/_mjs/IO/api/zipConcurrent.mjs +4 -4
  592. package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
  593. package/_mjs/IO/api.mjs +515 -468
  594. package/_mjs/IO/api.mjs.map +1 -1
  595. package/_mjs/IO/definition.mjs +1 -1
  596. package/_mjs/IO/definition.mjs.map +1 -1
  597. package/_mjs/IO/runtime.mjs +8 -8
  598. package/_mjs/IO/runtime.mjs.map +1 -1
  599. package/_mjs/IO.mjs +3 -1
  600. package/_mjs/IO.mjs.map +1 -1
  601. package/_mjs/IOEnv/definition.mjs.map +1 -1
  602. package/_mjs/Push/api.mjs +1 -1
  603. package/_mjs/Random/definition.mjs +1 -0
  604. package/_mjs/Random/definition.mjs.map +1 -1
  605. package/_mjs/Ref/Synchronized/api.mjs +1 -1
  606. package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
  607. package/_mjs/Ref/Synchronized/constructors.mjs +1 -1
  608. package/_mjs/Ref/Synchronized/definition.mjs +1 -1
  609. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  610. package/_mjs/STM/definition.mjs +1 -1
  611. package/_mjs/ScopedRef/api.mjs +1 -1
  612. package/_mjs/ScopedRef/api.mjs.map +1 -1
  613. package/_mjs/Semaphore/Reservation.mjs +16 -0
  614. package/_mjs/Semaphore/Reservation.mjs.map +1 -0
  615. package/_mjs/Semaphore/constructors.mjs +17 -0
  616. package/_mjs/Semaphore/constructors.mjs.map +1 -0
  617. package/_mjs/Semaphore/definition.mjs +141 -0
  618. package/_mjs/Semaphore/definition.mjs.map +1 -0
  619. package/_mjs/Semaphore.mjs +4 -133
  620. package/_mjs/Semaphore.mjs.map +1 -1
  621. package/_mjs/Stream/api.mjs +701 -701
  622. package/_mjs/Stream/api.mjs.map +1 -1
  623. package/_mjs/SubscriptionRef.mjs +1 -1
  624. package/_src/Cached/api.ts +3 -3
  625. package/_src/Channel/api/toPull.ts +1 -1
  626. package/_src/Channel/api.ts +273 -272
  627. package/_src/Channel/core-api.ts +57 -55
  628. package/_src/Channel/internal/ChannelExecutor.ts +3 -3
  629. package/_src/Console/definition.ts +1 -0
  630. package/_src/CountdownLatch.ts +2 -0
  631. package/_src/Fiber/FiberMessage.ts +3 -28
  632. package/_src/Fiber/FiberRuntime.ts +988 -616
  633. package/_src/Fiber/api/interruptAs.ts +4 -3
  634. package/_src/Fiber/constructors.ts +1 -1
  635. package/_src/Fiber/definition.ts +4 -0
  636. package/_src/FiberScope/definition.ts +40 -2
  637. package/_src/FiberSet.ts +6 -2
  638. package/_src/Future/State.ts +128 -0
  639. package/_src/Future/api.ts +62 -51
  640. package/_src/Future/constructors.ts +4 -2
  641. package/_src/Future/definition.ts +2 -17
  642. package/_src/Future.ts +4 -3
  643. package/_src/Hub/api.ts +61 -61
  644. package/_src/IO/api/addFinalizerExit.ts +4 -4
  645. package/_src/IO/api/array.ts +49 -0
  646. package/_src/IO/api/asyncInterrupt.ts +1 -1
  647. package/_src/IO/api/awaitAllChildren.ts +6 -0
  648. package/_src/IO/api/cachedInvalidate.ts +42 -0
  649. package/_src/IO/api/foreachConcurrent.ts +39 -23
  650. package/_src/IO/api/fork.ts +1 -1
  651. package/_src/IO/api/forkDaemon.ts +2 -2
  652. package/_src/IO/api/memoize.ts +3 -3
  653. package/_src/IO/api/onTermination.ts +2 -2
  654. package/_src/IO/api/transplant.ts +26 -3
  655. package/_src/IO/api/zipConcurrent.ts +2 -2
  656. package/_src/IO/api.ts +547 -525
  657. package/_src/IO/definition.ts +4 -28
  658. package/_src/IO/runtime.ts +0 -1
  659. package/_src/IO.ts +65 -63
  660. package/_src/IOEnv/definition.ts +1 -4
  661. package/_src/Random/definition.ts +1 -0
  662. package/_src/Ref/Synchronized/api.ts +2 -2
  663. package/_src/Ref/Synchronized/definition.ts +1 -1
  664. package/_src/Semaphore/Reservation.ts +15 -0
  665. package/_src/Semaphore/constructors.ts +14 -0
  666. package/_src/Semaphore/definition.ts +180 -0
  667. package/_src/Semaphore.ts +5 -159
  668. package/_src/Stream/api.ts +679 -679
  669. package/package.json +4 -4
  670. package/IO/api/sequenceT.d.ts +0 -26
  671. package/_cjs/IO/api/sequenceT.cjs +0 -18
  672. package/_cjs/IO/api/sequenceT.cjs.map +0 -1
  673. package/_mjs/IO/api/sequenceT.mjs +0 -10
  674. package/_mjs/IO/api/sequenceT.mjs.map +0 -1
  675. package/_src/IO/api/sequenceT.ts +0 -16
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @tsplus fluent fncts.io.Fiber interruptAsFork
3
3
  */
4
- export function interruptAsFork<E, A>(self: Fiber<E, A>, fiberId: FiberId): UIO<void> {
4
+ export function interruptAsFork<E, A>(self: Fiber<E, A>, fiberId: FiberId, __tsplusTrace?: string): UIO<void> {
5
5
  self.concrete();
6
6
  return self.interruptAsFork(fiberId);
7
7
  }
@@ -9,6 +9,7 @@ export function interruptAsFork<E, A>(self: Fiber<E, A>, fiberId: FiberId): UIO<
9
9
  /**
10
10
  * @tsplus fluent fncts.io.Fiber interruptAs
11
11
  */
12
- export function interruptAs<E, A>(self: Fiber<E, A>, fiberId: FiberId): UIO<Exit<E, A>> {
13
- return self.interruptAsFork(fiberId) > self.await;
12
+ export function interruptAs<E, A>(self: Fiber<E, A>, fiberId: FiberId, __tsplusTrace?: string): UIO<Exit<E, A>> {
13
+ self.concrete();
14
+ return self.interruptAs(fiberId);
14
15
  }
@@ -10,7 +10,7 @@ export function done<E, A>(exit: Exit<E, A>, __tsplusTrace?: string): Fiber<E, A
10
10
  IO.succeedNow(Conc()),
11
11
  IO.unit,
12
12
  IO.succeedNow(Just(exit)),
13
- () => IO.succeedNow(exit),
13
+ () => IO.unit,
14
14
  );
15
15
  }
16
16
 
@@ -56,6 +56,8 @@ export interface FiberCommon<E, A> extends Fiber<E, A> {
56
56
  */
57
57
  readonly interruptAsFork: (fiberId: FiberId) => UIO<void>;
58
58
 
59
+ readonly interruptAs: (fiberId: FiberId) => UIO<Exit<E, A>>;
60
+
59
61
  /**
60
62
  * Tentatively observes the fiber, but returns immediately if it is not already done.
61
63
  */
@@ -114,6 +116,8 @@ export class SyntheticFiber<E, A> implements FiberCommon<E, A> {
114
116
  ) {
115
117
  this.await = wait;
116
118
  }
119
+
120
+ interruptAs = (fiberId: FiberId): UIO<Exit<E, A>> => this.interruptAsFork(fiberId) > this.await;
117
121
  }
118
122
 
119
123
  export type ConcreteFiber<E, A> = Fiber.Runtime<E, A> | Fiber.Synthetic<E, A>;
@@ -18,6 +18,11 @@ export abstract class FiberScope {
18
18
  runtimeFlags: RuntimeFlags,
19
19
  child: FiberRuntime<any, any>,
20
20
  ): void;
21
+ abstract unsafeAddAll(
22
+ currentFiber: FiberRuntime<any, any>,
23
+ runtimeFlags: RuntimeFlags,
24
+ children: Iterable<FiberRuntime<any, any>>,
25
+ ): void;
21
26
  }
22
27
 
23
28
  export class Global extends FiberScope {
@@ -29,6 +34,17 @@ export class Global extends FiberScope {
29
34
  Fiber._roots.add(child);
30
35
  }
31
36
  }
37
+ unsafeAddAll(
38
+ _currentFiber: FiberRuntime<any, any>,
39
+ runtimeFlags: RuntimeFlags,
40
+ children: Iterable<FiberRuntime<any, any>>,
41
+ ): void {
42
+ if (runtimeFlags.fiberRoots) {
43
+ for (const child of children) {
44
+ Fiber._roots.add(child);
45
+ }
46
+ }
47
+ }
32
48
  }
33
49
 
34
50
  export class Local extends FiberScope {
@@ -44,10 +60,32 @@ export class Local extends FiberScope {
44
60
  if (currentFiber === parent) {
45
61
  parent.addChild(child);
46
62
  } else {
47
- parent.tell(FiberMessage.Stateful((parentFiber) => parentFiber.addChild(child)));
63
+ parent.tellAddChild(child);
48
64
  }
49
65
  } else {
50
- child.tell(FiberMessage.InterruptSignal(Cause.interrupt(currentFiber.id)));
66
+ child.tellInterrupt(Cause.interrupt(currentFiber.id));
67
+ }
68
+ }
69
+ unsafeAddAll(
70
+ currentFiber: FiberRuntime<any, any>,
71
+ _runtimeFlags: RuntimeFlags,
72
+ children: Iterable<FiberRuntime<any, any>>,
73
+ ): void {
74
+ if (children.isNonEmpty) {
75
+ const parent = this.parentRef.deref();
76
+
77
+ if (parent != null) {
78
+ if (currentFiber === parent) {
79
+ parent.addChildren(children);
80
+ } else {
81
+ parent.tellAddChildren(children);
82
+ }
83
+ } else {
84
+ const cause = Cause.interrupt(currentFiber.id);
85
+ for (const child of children) {
86
+ child.tellInterrupt(cause);
87
+ }
88
+ }
51
89
  }
52
90
  }
53
91
  }
package/_src/FiberSet.ts CHANGED
@@ -5,12 +5,16 @@ export type FiberSetTypeId = typeof FiberSetTypeId;
5
5
  * @tsplus type fncts.io.FiberSet
6
6
  * @tsplus companion fncts.io.FiberSetOps
7
7
  */
8
- export class FiberSet<E, A> {
8
+ export class FiberSet<E, A> implements Iterable<Fiber<E, A>> {
9
9
  readonly [FiberSetTypeId]: FiberSetTypeId = FiberSetTypeId;
10
10
  constructor(
11
11
  readonly backing: Set<Fiber.Runtime<E, A>>,
12
12
  readonly future: Future<unknown, never>,
13
13
  ) {}
14
+
15
+ [Symbol.iterator](): Iterator<Fiber<E, A>> {
16
+ return this.backing[Symbol.iterator]();
17
+ }
14
18
  }
15
19
 
16
20
  /**
@@ -111,5 +115,5 @@ export function join<E, A>(self: FiberSet<E, A>): FIO<E, never> {
111
115
  * @tsplus getter fncts.io.FiberSet clear
112
116
  */
113
117
  export function clear<E, A>(self: FiberSet<E, A>): UIO<void> {
114
- return IO.foreach(self.backing, (fiber) => fiber.interrupt) > IO(self.backing.clear());
118
+ return IO.foreach(self.backing, (fiber) => fiber.interruptFork) > IO(self.backing.clear());
115
119
  }
@@ -0,0 +1,128 @@
1
+ export type FutureState<E, A> = Done<E, A> | Pending<E, A>;
2
+
3
+ export const enum FutureStateTag {
4
+ Link,
5
+ Empty,
6
+ Done,
7
+ }
8
+
9
+ export abstract class Pending<E, A> {
10
+ abstract size: number;
11
+ abstract complete(io: FIO<E, A>): void;
12
+ abstract add(waiter: (io: FIO<E, A>) => any): Pending<E, A>;
13
+ abstract remove(waiter: (io: FIO<E, A>) => any): Pending<E, A>;
14
+ }
15
+
16
+ export type Concrete<E, A> = Empty | Link<E, A> | Done<E, A>;
17
+ export type ConcretePending<E, A> = Empty | Link<E, A>;
18
+
19
+ /**
20
+ * @tsplus fluent fncts.io.Future.State concrete
21
+ * @tsplus macro remove
22
+ */
23
+ export function concrete<E, A>(self: State<E, A>): asserts self is Concrete<E, A> {}
24
+
25
+ /**
26
+ * @tsplus fluent fncts.io.Future.State concretePending
27
+ * @tsplus macro remove
28
+ */
29
+ export function concretePending<E, A>(self: Pending<E, A>): asserts self is ConcretePending<E, A> {}
30
+
31
+ export class Empty extends Pending<never, never> {
32
+ readonly _tag = FutureStateTag.Empty;
33
+ size: number = 0;
34
+ complete(_: FIO<never, never>): void {
35
+ return;
36
+ }
37
+ add(waiter: (io: FIO<never, never>) => any): Pending<never, never> {
38
+ return new Link(waiter, this, 1);
39
+ }
40
+ remove(_: (io: FIO<never, never>) => any): Pending<never, never> {
41
+ return this;
42
+ }
43
+ }
44
+
45
+ /**
46
+ * @tsplus static fncts.io.Future.State Empty
47
+ */
48
+ export const _Empty = new Empty();
49
+
50
+ export class Link<E, A> extends Pending<E, A> {
51
+ readonly _tag = FutureStateTag.Link;
52
+
53
+ constructor(
54
+ readonly waiter: (io: FIO<E, A>) => any,
55
+ readonly ws: Pending<E, A>,
56
+ readonly size: number,
57
+ ) {
58
+ super();
59
+ }
60
+
61
+ add(waiter: (io: FIO<E, A>) => any): Pending<E, A> {
62
+ return new Link(waiter, this, this.size + 1);
63
+ }
64
+
65
+ complete(io: FIO<E, A>): void {
66
+ if (this.size === 1) {
67
+ return this.waiter(io);
68
+ } else {
69
+ let current = this as ConcretePending<E, A>;
70
+
71
+ while (current._tag !== FutureStateTag.Empty) {
72
+ current.waiter(io);
73
+ current = current.ws as ConcretePending<E, A>;
74
+ }
75
+ }
76
+ }
77
+
78
+ remove(waiter: (io: FIO<E, A>) => any): Pending<E, A> {
79
+ if (this.size === 1) {
80
+ if (waiter === this.waiter) {
81
+ return this.ws;
82
+ } else {
83
+ return this;
84
+ }
85
+ } else {
86
+ const arr = materialize(this, this.size);
87
+ let i = this.size - 1;
88
+ let acc: Pending<E, A> = State.Empty;
89
+
90
+ while (i >= 0) {
91
+ if (arr[i] !== this.waiter) {
92
+ acc = acc.add(arr[i]) as Pending<E, A>;
93
+ }
94
+ i -= 1;
95
+ }
96
+
97
+ return acc;
98
+ }
99
+ }
100
+ }
101
+
102
+ function materialize<E, A>(self: Pending<E, A>, size: number): Array<(io: FIO<E, A>) => any> {
103
+ const array = new Array<(io: FIO<E, A>) => any>(size);
104
+ let current = self;
105
+ let i = size - 1;
106
+
107
+ while (i >= 0) {
108
+ concretePending(current);
109
+ if (current._tag === FutureStateTag.Link) {
110
+ array[i] = current.waiter;
111
+ current = current.ws;
112
+ }
113
+ i -= 1;
114
+ }
115
+
116
+ return array;
117
+ }
118
+
119
+ export class Done<E, A> {
120
+ readonly _tag = FutureStateTag.Done;
121
+ constructor(readonly value: FIO<E, A>) {}
122
+ }
123
+
124
+ /**
125
+ * @tsplus type fncts.io.Future.State
126
+ * @tsplus companion fncts.io.Future.State
127
+ */
128
+ export type State<E, A> = Done<E, A> | Pending<E, A>;
@@ -1,6 +1,7 @@
1
+ import type { Pending } from "./State.js";
1
2
  import type { Canceler } from "@fncts/io/IO";
2
3
 
3
- import { Done, FutureStateTag, Pending } from "@fncts/io/Future/definition";
4
+ import { Done, FutureStateTag } from "./State.js";
4
5
 
5
6
  /**
6
7
  * Exits the future with the specified exit, which will be propagated to all
@@ -42,7 +43,7 @@ export function failCause<E>(cause: Cause<E>, __tsplusTrace?: string) {
42
43
  * Completes the future with the result of the specified effect. If the
43
44
  * future has already been completed, the method will produce false.
44
45
  *
45
- * Note that `Future.completeWith` will be much faster, so consider using
46
+ * Note that `Future.fulfillWith` will be much faster, so consider using
46
47
  * that if you do not need to memoize the result of the specified effect.
47
48
  *
48
49
  * @tsplus pipeable fncts.io.Future fulfill
@@ -64,27 +65,13 @@ export function fulfill<R, E, A>(io: IO<R, E, A>, __tsplusTrace?: string) {
64
65
  * case te meaning of the "exactly once" guarantee of `Future` is that the
65
66
  * future can be completed with exactly one effect. For a version that
66
67
  * completes the future with the result of an IO see
67
- * `Future.complete`.
68
+ * `Future.fulfill`.
68
69
  *
69
70
  * @tsplus pipeable fncts.io.Future fulfillWith
70
71
  */
71
72
  export function fulfillWith<E, A>(io: FIO<E, A>, __tsplusTrace?: string) {
72
73
  return (future: Future<E, A>): UIO<boolean> => {
73
- return IO.succeed(() => {
74
- switch (future.state._tag) {
75
- case FutureStateTag.Done: {
76
- return false;
77
- }
78
- case FutureStateTag.Pending: {
79
- const state = future.state;
80
- future.state = new Done(io);
81
- state.joiners.reverse.forEach((f) => {
82
- f(io);
83
- });
84
- return true;
85
- }
86
- }
87
- });
74
+ return IO(future.unsafeFulfill(io));
88
75
  };
89
76
  }
90
77
 
@@ -122,6 +109,25 @@ export function interruptAs(id: FiberId, __tsplusTrace?: string) {
122
109
  };
123
110
  }
124
111
 
112
+ function interruptJoiner<E, A>(
113
+ future: Future<E, A>,
114
+ joiner: (a: FIO<E, A>) => void,
115
+ __tsplusTrace?: string,
116
+ ): Canceler<never> {
117
+ return IO.succeed(() => {
118
+ future.state.concrete();
119
+ switch (future.state._tag) {
120
+ case FutureStateTag.Done: {
121
+ break;
122
+ }
123
+ default: {
124
+ future.state = future.state.remove(joiner);
125
+ break;
126
+ }
127
+ }
128
+ });
129
+ }
130
+
125
131
  /**
126
132
  * Checks for completion of this Future. Produces true if this future has
127
133
  * already been completed with a value or an error and false otherwise.
@@ -129,6 +135,7 @@ export function interruptAs(id: FiberId, __tsplusTrace?: string) {
129
135
  * @tsplus getter fncts.io.Future isDone
130
136
  */
131
137
  export function isDone<E, A>(future: Future<E, A>, __tsplusTrace?: string): UIO<boolean> {
138
+ future.state.concrete();
132
139
  return IO.succeed(future.state._tag === FutureStateTag.Done);
133
140
  }
134
141
 
@@ -139,12 +146,13 @@ export function isDone<E, A>(future: Future<E, A>, __tsplusTrace?: string): UIO<
139
146
  * @tsplus getter fncts.io.Future poll
140
147
  */
141
148
  export function poll<E, A>(future: Future<E, A>, __tsplusTrace?: string): UIO<Maybe<FIO<E, A>>> {
142
- return IO.succeed(() => {
149
+ return IO(() => {
150
+ future.state.concrete();
143
151
  switch (future.state._tag) {
144
152
  case FutureStateTag.Done: {
145
153
  return Just(future.state.value);
146
154
  }
147
- case FutureStateTag.Pending: {
155
+ default: {
148
156
  return Nothing();
149
157
  }
150
158
  }
@@ -177,12 +185,28 @@ export function succeedVoid_(a: void, __tsplusTrace?: string) {
177
185
  */
178
186
  export function unsafeDone<E, A>(io: FIO<E, A>, __tsplusTrace?: string) {
179
187
  return (future: Future<E, A>): void => {
180
- if (future.state._tag === FutureStateTag.Pending) {
181
- const state = future.state;
182
- future.state = new Done(io);
183
- state.joiners.reverse.forEach((f) => {
184
- f(io);
185
- });
188
+ future.unsafeFulfill(io);
189
+ };
190
+ }
191
+
192
+ /**
193
+ * @tsplus pipeable fncts.io.Future unsafeFulfill
194
+ */
195
+ export function unsafeFulfill<E, A>(io: FIO<E, A>) {
196
+ return (future: Future<E, A>): boolean => {
197
+ future.state.concrete();
198
+
199
+ switch (future.state._tag) {
200
+ case FutureStateTag.Link:
201
+ case FutureStateTag.Empty: {
202
+ const pending: Pending<E, A> = future.state;
203
+ future.state = new Done(io);
204
+ pending.complete(io);
205
+ return true;
206
+ }
207
+ default: {
208
+ return false;
209
+ }
186
210
  }
187
211
  };
188
212
  }
@@ -191,8 +215,8 @@ export function unsafeDone<E, A>(io: FIO<E, A>, __tsplusTrace?: string) {
191
215
  * @tsplus pipeable fncts.io.Future unsafeSucceed
192
216
  */
193
217
  export function unsafeSucceed<A>(a: A, __tsplusTrace?: string) {
194
- return (future: Future<never, A>): void => {
195
- future.unsafeDone(IO.succeedNow(a));
218
+ return (future: Future<never, A>): boolean => {
219
+ return future.unsafeFulfill(IO.succeedNow(a));
196
220
  };
197
221
  }
198
222
 
@@ -204,40 +228,27 @@ export function unsafeSucceed<A>(a: A, __tsplusTrace?: string) {
204
228
  */
205
229
  export function wait<E, A>(future: Future<E, A>, __tsplusTrace?: string): IO<never, E, A> {
206
230
  return IO.defer(() => {
231
+ future.state.concrete();
207
232
  switch (future.state._tag) {
208
233
  case FutureStateTag.Done: {
209
234
  return future.state.value;
210
235
  }
211
- case FutureStateTag.Pending: {
236
+ default: {
212
237
  return IO.asyncInterrupt<never, E, A>((k) => {
238
+ future.state.concrete();
213
239
  switch (future.state._tag) {
214
240
  case FutureStateTag.Done: {
215
- return Either.right(future.state.value);
241
+ k(future.state.value);
242
+ break;
216
243
  }
217
- case FutureStateTag.Pending: {
218
- future.state = new Pending(future.state.joiners.prepend(k));
219
- return Either.left(interruptJoiner(future, k));
244
+ default: {
245
+ future.state = future.state.add(k);
246
+ break;
220
247
  }
221
248
  }
222
- }, future.blockingOn);
223
- }
224
- }
225
- });
226
- }
227
249
 
228
- function interruptJoiner<E, A>(
229
- future: Future<E, A>,
230
- joiner: (a: FIO<E, A>) => void,
231
- __tsplusTrace?: string,
232
- ): Canceler<never> {
233
- return IO.succeed(() => {
234
- switch (future.state._tag) {
235
- case FutureStateTag.Pending: {
236
- future.state = new Pending(future.state.joiners.filter((j) => j !== joiner));
237
- break;
238
- }
239
- case FutureStateTag.Done: {
240
- break;
250
+ return Either.left(interruptJoiner(future, k));
251
+ }, future.blockingOn);
241
252
  }
242
253
  }
243
254
  });
@@ -1,4 +1,6 @@
1
- import { Future, Pending } from "@fncts/io/Future/definition";
1
+ import { Future } from "@fncts/io/Future/definition";
2
+
3
+ import { State } from "./State.js";
2
4
 
3
5
  /**
4
6
  * Makes a new future to be completed by the fiber creating the future.
@@ -24,5 +26,5 @@ export function makeAs<E, A>(fiberId: FiberId, __tsplusTrace?: string) {
24
26
  * @tsplus static fncts.io.FutureOps unsafeMake
25
27
  */
26
28
  export function unsafeMake<E, A>(fiberId: FiberId) {
27
- return new Future<E, A>(new Pending(List.empty()), fiberId);
29
+ return new Future<E, A>(State.Empty, fiberId);
28
30
  }
@@ -1,3 +1,5 @@
1
+ import type { State } from "./State.js";
2
+
1
3
  export const FutureTypeId = Symbol.for("fncts.io.Future");
2
4
  export type FutureTypeId = typeof FutureTypeId;
3
5
 
@@ -24,20 +26,3 @@ export declare namespace Future {
24
26
  type ErrorOf<X> = [X] extends [{ [FutureVariance]: { _E: (_: infer E) => infer E } }] ? E : never;
25
27
  type ValueOf<X> = [X] extends [{ [FutureVariance]: { _A: (_: infer A) => infer A } }] ? A : never;
26
28
  }
27
-
28
- export const enum FutureStateTag {
29
- Done,
30
- Pending,
31
- }
32
-
33
- export class Pending<E, A> {
34
- readonly _tag = FutureStateTag.Pending;
35
- constructor(readonly joiners: List<(_: FIO<E, A>) => void>) {}
36
- }
37
-
38
- export class Done<E, A> {
39
- readonly _tag = FutureStateTag.Done;
40
- constructor(readonly value: FIO<E, A>) {}
41
- }
42
-
43
- export type State<E, A> = Done<E, A> | Pending<E, A>;
package/_src/Future.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // codegen:start { preset: barrel, include: Future/*.ts }
2
- export * from "./Future/api.js";
3
- export * from "./Future/constructors.js";
4
- export * from "./Future/definition.js";
2
+ export * from "./Future/api.js"
3
+ export * from "./Future/constructors.js"
4
+ export * from "./Future/definition.js"
5
+ export * from "./Future/State.js"
5
6
  // codegen:end
package/_src/Hub/api.ts CHANGED
@@ -48,6 +48,21 @@ export function contramapIO<A, RC, EC, C>(f: (c: C) => IO<RC, EC, A>, __tsplusTr
48
48
  };
49
49
  }
50
50
 
51
+ /**
52
+ * Transforms messages published to and taken from the hub using the
53
+ * specified functions.
54
+ *
55
+ * @tsplus pipeable fncts.io.Hub dimap
56
+ */
57
+ export function dimap<A, B, C, D>(f: (c: C) => A, g: (b: B) => D, __tsplusTrace?: string) {
58
+ return <RA, RB, EA, EB>(self: PHub<RA, RB, EA, EB, A, B>): PHub<RA, RB, EA, EB, C, D> => {
59
+ return self.dimapIO(
60
+ (c) => IO.succeedNow(f(c)),
61
+ (b) => IO.succeedNow(g(b)),
62
+ );
63
+ };
64
+ }
65
+
51
66
  class DimapIO<RA, RB, RC, RD, EA, EB, EC, ED, A, B, C, D> extends PHubInternal<
52
67
  RC | RA,
53
68
  RD | RB,
@@ -78,21 +93,6 @@ class DimapIO<RA, RB, RC, RD, EA, EB, EC, ED, A, B, C, D> extends PHubInternal<
78
93
  publishAll = (cs: Iterable<C>) => IO.foreach(cs, this.f).flatMap((as) => this.source.publishAll(as));
79
94
  }
80
95
 
81
- /**
82
- * Transforms messages published to and taken from the hub using the
83
- * specified functions.
84
- *
85
- * @tsplus pipeable fncts.io.Hub dimap
86
- */
87
- export function dimap<A, B, C, D>(f: (c: C) => A, g: (b: B) => D, __tsplusTrace?: string) {
88
- return <RA, RB, EA, EB>(self: PHub<RA, RB, EA, EB, A, B>): PHub<RA, RB, EA, EB, C, D> => {
89
- return self.dimapIO(
90
- (c) => IO.succeedNow(f(c)),
91
- (b) => IO.succeedNow(g(b)),
92
- );
93
- };
94
- }
95
-
96
96
  /**
97
97
  * Transforms messages published to and taken from the hub using the
98
98
  * specified effectual functions.
@@ -110,6 +110,17 @@ export function dimapIO<A, B, RC, EC, C, RD, ED, D>(
110
110
  };
111
111
  }
112
112
 
113
+ /**
114
+ * Filters messages published to the hub using the specified function.
115
+ *
116
+ * @tsplus pipeable fncts.io.Hub filterInput
117
+ */
118
+ export function filterInput<A>(f: (a: A) => boolean, __tsplusTrace?: string) {
119
+ return <RA, RB, EA, EB, B>(self: PHub<RA, RB, EA, EB, A, B>) => {
120
+ return self.filterInputIO((a) => IO.succeedNow(f(a)));
121
+ };
122
+ }
123
+
113
124
  class FilterInputIO<RA, RA1, RB, EA, EA1, EB, A, B> extends PHubInternal<RA | RA1, RB, EA | EA1, EB, A, B> {
114
125
  constructor(
115
126
  readonly source: PHubInternal<RA, RB, EA, EB, A, B>,
@@ -145,13 +156,13 @@ export function filterInputIO<A, R1, E1>(f: (a: A) => IO<R1, E1, boolean>, __tsp
145
156
  }
146
157
 
147
158
  /**
148
- * Filters messages published to the hub using the specified function.
159
+ * Filters messages taken from the hub using the specified function.
149
160
  *
150
- * @tsplus pipeable fncts.io.Hub filterInput
161
+ * @tsplus pipeable fncts.io.Hub filterOutput
151
162
  */
152
- export function filterInput<A>(f: (a: A) => boolean, __tsplusTrace?: string) {
153
- return <RA, RB, EA, EB, B>(self: PHub<RA, RB, EA, EB, A, B>) => {
154
- return self.filterInputIO((a) => IO.succeedNow(f(a)));
163
+ export function filterOutput<B>(f: (b: B) => boolean, __tsplusTrace?: string) {
164
+ return <RA, RB, EA, EB, A>(self: PHub<RA, RB, EA, EB, A, B>): PHub<RA, RB, EA, EB, A, B> => {
165
+ return self.filterOutputIO((b) => IO.succeedNow(f(b)));
155
166
  };
156
167
  }
157
168
 
@@ -188,17 +199,6 @@ export function filterOutputIO<B, R1, E1>(f: (a: B) => IO<R1, E1, boolean>, __ts
188
199
  };
189
200
  }
190
201
 
191
- /**
192
- * Filters messages taken from the hub using the specified function.
193
- *
194
- * @tsplus pipeable fncts.io.Hub filterOutput
195
- */
196
- export function filterOutput<B>(f: (b: B) => boolean, __tsplusTrace?: string) {
197
- return <RA, RB, EA, EB, A>(self: PHub<RA, RB, EA, EB, A, B>): PHub<RA, RB, EA, EB, A, B> => {
198
- return self.filterOutputIO((b) => IO.succeedNow(f(b)));
199
- };
200
- }
201
-
202
202
  /**
203
203
  * Checks whether the hub is shut down.
204
204
  *
@@ -287,28 +287,6 @@ export function mapIO<B, RC, EC, C>(f: (b: B) => IO<RC, EC, C>, __tsplusTrace?:
287
287
  };
288
288
  }
289
289
 
290
- class ToQueue<RA, RB, EA, EB, A, B> implements PEnqueue<RA, RB, EA, EB, A, B> {
291
- readonly [QueueTypeId]: QueueTypeId = QueueTypeId;
292
- readonly [EnqueueTypeId]: EnqueueTypeId = EnqueueTypeId;
293
- declare [QueueVariance]: {
294
- readonly _RA: (_: never) => RA;
295
- readonly _RB: (_: never) => RB;
296
- readonly _EA: (_: never) => EA;
297
- readonly _EB: (_: never) => EB;
298
- readonly _A: (_: A) => void;
299
- readonly _B: (_: never) => B;
300
- };
301
- constructor(readonly source: PHubInternal<RA, RB, EA, EB, A, B>) {}
302
- awaitShutdown = this.source.awaitShutdown;
303
- capacity = this.source.capacity;
304
- isShutdown = this.source.isShutdown;
305
- shutdown = this.source.shutdown;
306
- size = this.source.size;
307
- offer = (a: A): IO<RA, EA, boolean> => this.source.publish(a);
308
- offerAll = (as: Iterable<A>): IO<RA, EA, boolean> => this.source.publishAll(as);
309
- takeUpTo = (): IO<never, never, Conc<never>> => IO.succeedNow(Conc.empty());
310
- }
311
-
312
290
  /**
313
291
  * Publishes a message to the hub, returning whether the message was
314
292
  * published to the hub.
@@ -345,6 +323,16 @@ export function shutdown<RA, RB, EA, EB, A, B>(self: PHub<RA, RB, EA, EB, A, B>,
345
323
  return self.shutdown;
346
324
  }
347
325
 
326
+ /**
327
+ * The current number of messages in the hub.
328
+ *
329
+ * @tsplus getter fncts.io.Hub size
330
+ */
331
+ export function size<RA, RB, EA, EB, A, B>(self: PHub<RA, RB, EA, EB, A, B>, __tsplusTrace?: string): UIO<number> {
332
+ concrete(self);
333
+ return self.size;
334
+ }
335
+
348
336
  /**
349
337
  * Subscribes to receive messages from the hub. The resulting subscription
350
338
  * can be evaluated multiple times within the scope of the managed to take a
@@ -360,14 +348,26 @@ export function subscribe<RA, RB, EA, EB, A, B>(
360
348
  return self.subscribe;
361
349
  }
362
350
 
363
- /**
364
- * The current number of messages in the hub.
365
- *
366
- * @tsplus getter fncts.io.Hub size
367
- */
368
- export function size<RA, RB, EA, EB, A, B>(self: PHub<RA, RB, EA, EB, A, B>, __tsplusTrace?: string): UIO<number> {
369
- concrete(self);
370
- return self.size;
351
+ class ToQueue<RA, RB, EA, EB, A, B> implements PEnqueue<RA, RB, EA, EB, A, B> {
352
+ readonly [QueueTypeId]: QueueTypeId = QueueTypeId;
353
+ readonly [EnqueueTypeId]: EnqueueTypeId = EnqueueTypeId;
354
+ declare [QueueVariance]: {
355
+ readonly _RA: (_: never) => RA;
356
+ readonly _RB: (_: never) => RB;
357
+ readonly _EA: (_: never) => EA;
358
+ readonly _EB: (_: never) => EB;
359
+ readonly _A: (_: A) => void;
360
+ readonly _B: (_: never) => B;
361
+ };
362
+ constructor(readonly source: PHubInternal<RA, RB, EA, EB, A, B>) {}
363
+ awaitShutdown = this.source.awaitShutdown;
364
+ capacity = this.source.capacity;
365
+ isShutdown = this.source.isShutdown;
366
+ shutdown = this.source.shutdown;
367
+ size = this.source.size;
368
+ offer = (a: A): IO<RA, EA, boolean> => this.source.publish(a);
369
+ offerAll = (as: Iterable<A>): IO<RA, EA, boolean> => this.source.publishAll(as);
370
+ takeUpTo = (): IO<never, never, Conc<never>> => IO.succeedNow(Conc.empty());
371
371
  }
372
372
 
373
373
  /**