@fncts/io 0.0.22 → 0.0.24

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 (486) hide show
  1. package/Cached/definition.d.ts +6 -4
  2. package/Cached/internal.d.ts +4 -4
  3. package/Channel/api.d.ts +4 -4
  4. package/Channel/definition.d.ts +35 -14
  5. package/Channel/internal/ChannelExecutor.d.ts +1 -0
  6. package/Channel/internal/MergeDecision.d.ts +10 -6
  7. package/CountdownLatch.d.ts +1 -1
  8. package/Differ/definition.d.ts +2 -4
  9. package/Fiber/FiberRuntime.d.ts +9 -11
  10. package/Fiber/definition.d.ts +12 -6
  11. package/FiberRef/definition.d.ts +6 -2
  12. package/FiberRefs/api.d.ts +1 -1
  13. package/FiberRefs/definition.d.ts +1 -1
  14. package/Hub/definition.d.ts +29 -15
  15. package/IO/api/descriptor.d.ts +12 -0
  16. package/IO/api/interrupt.d.ts +19 -19
  17. package/IO/api/onTermination.d.ts +0 -1
  18. package/IO/api/sequenceT.d.ts +19 -3
  19. package/IO/api.d.ts +5 -0
  20. package/IO/definition.d.ts +40 -26
  21. package/IO.d.ts +1 -1
  22. package/Layer/definition.d.ts +17 -13
  23. package/Logger/definition.d.ts +10 -6
  24. package/MVar/api.d.ts +101 -0
  25. package/MVar/definition.d.ts +43 -0
  26. package/MVar.d.ts +2 -0
  27. package/Push/api.d.ts +7 -4
  28. package/Push/definition.d.ts +10 -3
  29. package/Push/internal.d.ts +1 -1
  30. package/Queue/api/dimapIO.d.ts +17 -13
  31. package/Queue/definition.d.ts +26 -18
  32. package/Ref/Derived.d.ts +3 -1
  33. package/Ref/Synchronized/constructors.d.ts +6 -1
  34. package/Ref/Synchronized/definition.d.ts +4 -2
  35. package/Ref/definition.d.ts +36 -25
  36. package/Ref.d.ts +0 -1
  37. package/RefSubject/definition.d.ts +17 -11
  38. package/Reloadable/definition.d.ts +5 -1
  39. package/STM/api/atomically.d.ts +9 -0
  40. package/STM/api.d.ts +12 -6
  41. package/STM/definition.d.ts +28 -15
  42. package/STM/internal/Entry.d.ts +2 -2
  43. package/STM/internal/TryCommit.d.ts +2 -2
  44. package/STM/internal/Versioned.d.ts +1 -1
  45. package/STM.d.ts +1 -0
  46. package/Schedule/definition.d.ts +7 -3
  47. package/Scope/definition.d.ts +1 -1
  48. package/ScopedRef/definition.d.ts +1 -1
  49. package/State/api.d.ts +1 -1
  50. package/State/definition.d.ts +5 -2
  51. package/State/internal.d.ts +6 -2
  52. package/Stream/definition.d.ts +26 -5
  53. package/Stream/internal/Handoff.d.ts +21 -15
  54. package/Stream/internal/SinkEndReason.d.ts +2 -2
  55. package/Subject/Atomic.d.ts +8 -4
  56. package/SupervisorPatch.d.ts +1 -1
  57. package/TExit/definition.d.ts +5 -5
  58. package/TRef/definition.d.ts +16 -14
  59. package/TRef.d.ts +0 -1
  60. package/_cjs/Cached/definition.cjs +4 -2
  61. package/_cjs/Cached/definition.cjs.map +1 -1
  62. package/_cjs/Cached/internal.cjs +7 -6
  63. package/_cjs/Cached/internal.cjs.map +1 -1
  64. package/_cjs/Channel/api/mapOutConcurrentIO.cjs +1 -1
  65. package/_cjs/Channel/api/mergeAllWith.cjs +1 -1
  66. package/_cjs/Channel/api.cjs +20 -20
  67. package/_cjs/Channel/api.cjs.map +1 -1
  68. package/_cjs/Channel/definition.cjs +13 -3
  69. package/_cjs/Channel/definition.cjs.map +1 -1
  70. package/_cjs/Channel/internal/ChannelExecutor.cjs +11 -6
  71. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  72. package/_cjs/Channel/internal/MergeDecision.cjs +7 -3
  73. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -1
  74. package/_cjs/CountdownLatch.cjs +4 -2
  75. package/_cjs/CountdownLatch.cjs.map +1 -1
  76. package/_cjs/Differ/definition.cjs +3 -1
  77. package/_cjs/Differ/definition.cjs.map +1 -1
  78. package/_cjs/Fiber/FiberRuntime.cjs +96 -89
  79. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  80. package/_cjs/Fiber/definition.cjs +8 -4
  81. package/_cjs/Fiber/definition.cjs.map +1 -1
  82. package/_cjs/FiberRef/definition.cjs +8 -4
  83. package/_cjs/FiberRef/definition.cjs.map +1 -1
  84. package/_cjs/Future/api.cjs +17 -6
  85. package/_cjs/Future/api.cjs.map +1 -1
  86. package/_cjs/Hub/api.cjs +5 -5
  87. package/_cjs/Hub/api.cjs.map +1 -1
  88. package/_cjs/Hub/definition.cjs +9 -7
  89. package/_cjs/Hub/definition.cjs.map +1 -1
  90. package/_cjs/Hub/internal.cjs +6 -6
  91. package/_cjs/Hub/internal.cjs.map +1 -1
  92. package/_cjs/IO/api/asyncIO.cjs +1 -1
  93. package/_cjs/IO/api/asyncIO.cjs.map +1 -1
  94. package/_cjs/IO/api/asyncInterrupt.cjs +2 -2
  95. package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
  96. package/_cjs/IO/api/bracketExit.cjs +1 -1
  97. package/_cjs/IO/api/bracketExit.cjs.map +1 -1
  98. package/_cjs/IO/api/{onExit.cjs → descriptor.cjs} +20 -9
  99. package/_cjs/IO/api/descriptor.cjs.map +1 -0
  100. package/_cjs/IO/api/foreachConcurrent.cjs +2 -2
  101. package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
  102. package/_cjs/IO/api/forkIn.cjs +1 -1
  103. package/_cjs/IO/api/forkIn.cjs.map +1 -1
  104. package/_cjs/IO/api/forkScoped.cjs +1 -1
  105. package/_cjs/IO/api/forkScoped.cjs.map +1 -1
  106. package/_cjs/IO/api/fulfill.cjs +1 -1
  107. package/_cjs/IO/api/fulfill.cjs.map +1 -1
  108. package/_cjs/IO/api/interrupt.cjs +52 -43
  109. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  110. package/_cjs/IO/api/onTermination.cjs +7 -6
  111. package/_cjs/IO/api/onTermination.cjs.map +1 -1
  112. package/_cjs/IO/api/race.cjs +1 -1
  113. package/_cjs/IO/api/race.cjs.map +1 -1
  114. package/_cjs/IO/api/sequenceT.cjs +1 -1
  115. package/_cjs/IO/api/sequenceT.cjs.map +1 -1
  116. package/_cjs/IO/api/zipConcurrent.cjs +1 -1
  117. package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
  118. package/_cjs/IO/api.cjs +13 -5
  119. package/_cjs/IO/api.cjs.map +1 -1
  120. package/_cjs/IO/definition.cjs +26 -21
  121. package/_cjs/IO/definition.cjs.map +1 -1
  122. package/_cjs/IO.cjs +11 -11
  123. package/_cjs/Layer/MemoMap.cjs +30 -31
  124. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  125. package/_cjs/Layer/api.cjs +1 -1
  126. package/_cjs/Layer/api.cjs.map +1 -1
  127. package/_cjs/Layer/definition.cjs +12 -10
  128. package/_cjs/Layer/definition.cjs.map +1 -1
  129. package/_cjs/Logger/definition.cjs +3 -1
  130. package/_cjs/Logger/definition.cjs.map +1 -1
  131. package/_cjs/MVar/api.cjs +170 -0
  132. package/_cjs/MVar/api.cjs.map +1 -0
  133. package/_cjs/MVar/definition.cjs +28 -0
  134. package/_cjs/MVar/definition.cjs.map +1 -0
  135. package/_cjs/MVar.cjs +28 -0
  136. package/_cjs/MVar.cjs.map +1 -0
  137. package/_cjs/Push/api.cjs +39 -36
  138. package/_cjs/Push/api.cjs.map +1 -1
  139. package/_cjs/Push/definition.cjs +9 -2
  140. package/_cjs/Push/definition.cjs.map +1 -1
  141. package/_cjs/Push/internal.cjs +4 -2
  142. package/_cjs/Push/internal.cjs.map +1 -1
  143. package/_cjs/Queue/api/dimapIO.cjs +10 -10
  144. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  145. package/_cjs/Queue/api/filterInputIO.cjs +4 -4
  146. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  147. package/_cjs/Queue/api/filterOutputIO.cjs +7 -7
  148. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  149. package/_cjs/Queue/definition.cjs +3 -1
  150. package/_cjs/Queue/definition.cjs.map +1 -1
  151. package/_cjs/Queue/internal.cjs +2 -2
  152. package/_cjs/Queue/internal.cjs.map +1 -1
  153. package/_cjs/Queue/strategy.cjs +2 -2
  154. package/_cjs/Queue/strategy.cjs.map +1 -1
  155. package/_cjs/Ref/Derived.cjs +8 -4
  156. package/_cjs/Ref/Derived.cjs.map +1 -1
  157. package/_cjs/Ref/Synchronized/constructors.cjs +16 -7
  158. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
  159. package/_cjs/Ref/Synchronized/definition.cjs +16 -12
  160. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  161. package/_cjs/Ref/definition.cjs +3 -2
  162. package/_cjs/Ref/definition.cjs.map +1 -1
  163. package/_cjs/Ref.cjs +0 -11
  164. package/_cjs/Ref.cjs.map +1 -1
  165. package/_cjs/RefSubject/Synchronized/api.cjs +1 -1
  166. package/_cjs/RefSubject/definition.cjs +9 -5
  167. package/_cjs/RefSubject/definition.cjs.map +1 -1
  168. package/_cjs/Reloadable/definition.cjs +4 -2
  169. package/_cjs/Reloadable/definition.cjs.map +1 -1
  170. package/_cjs/STM/api/atomically.cjs +55 -0
  171. package/_cjs/STM/api/atomically.cjs.map +1 -0
  172. package/_cjs/STM/api.cjs +65 -91
  173. package/_cjs/STM/api.cjs.map +1 -1
  174. package/_cjs/STM/definition.cjs +32 -19
  175. package/_cjs/STM/definition.cjs.map +1 -1
  176. package/_cjs/STM/driver.cjs +3 -3
  177. package/_cjs/STM/driver.cjs.map +1 -1
  178. package/_cjs/STM/internal/Entry.cjs +6 -3
  179. package/_cjs/STM/internal/Entry.cjs.map +1 -1
  180. package/_cjs/STM/internal/TryCommit.cjs +5 -2
  181. package/_cjs/STM/internal/TryCommit.cjs.map +1 -1
  182. package/_cjs/STM/internal/Versioned.cjs +3 -1
  183. package/_cjs/STM/internal/Versioned.cjs.map +1 -1
  184. package/_cjs/STM.cjs +11 -0
  185. package/_cjs/STM.cjs.map +1 -1
  186. package/_cjs/Schedule/definition.cjs +3 -1
  187. package/_cjs/Schedule/definition.cjs.map +1 -1
  188. package/_cjs/Scope/api.cjs +1 -2
  189. package/_cjs/Scope/api.cjs.map +1 -1
  190. package/_cjs/Scope/definition.cjs +5 -3
  191. package/_cjs/Scope/definition.cjs.map +1 -1
  192. package/_cjs/ScopedRef/api.cjs +2 -2
  193. package/_cjs/ScopedRef/api.cjs.map +1 -1
  194. package/_cjs/ScopedRef/definition.cjs +3 -1
  195. package/_cjs/ScopedRef/definition.cjs.map +1 -1
  196. package/_cjs/State/api.cjs +2 -2
  197. package/_cjs/State/api.cjs.map +1 -1
  198. package/_cjs/State/definition.cjs +4 -2
  199. package/_cjs/State/definition.cjs.map +1 -1
  200. package/_cjs/State/internal.cjs +7 -3
  201. package/_cjs/State/internal.cjs.map +1 -1
  202. package/_cjs/Stream/api.cjs +1 -1
  203. package/_cjs/Stream/definition.cjs +4 -2
  204. package/_cjs/Stream/definition.cjs.map +1 -1
  205. package/_cjs/Stream/internal/Handoff.cjs +37 -37
  206. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  207. package/_cjs/Stream/internal/SinkEndReason.cjs +6 -3
  208. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  209. package/_cjs/Subject/Atomic.cjs +6 -4
  210. package/_cjs/Subject/Atomic.cjs.map +1 -1
  211. package/_cjs/SubscriptionRef.cjs +1 -1
  212. package/_cjs/SupervisorPatch.cjs +3 -1
  213. package/_cjs/SupervisorPatch.cjs.map +1 -1
  214. package/_cjs/TExit/definition.cjs +25 -24
  215. package/_cjs/TExit/definition.cjs.map +1 -1
  216. package/_cjs/TFuture/constructors.cjs +1 -1
  217. package/_cjs/TReentrantLock/api.cjs +10 -9
  218. package/_cjs/TReentrantLock/api.cjs.map +1 -1
  219. package/_cjs/TRef/constructors.cjs +1 -1
  220. package/_cjs/TRef/definition.cjs +21 -21
  221. package/_cjs/TRef/definition.cjs.map +1 -1
  222. package/_cjs/TRef.cjs +0 -11
  223. package/_cjs/TRef.cjs.map +1 -1
  224. package/_cjs/TSemaphore/api.cjs +2 -2
  225. package/_cjs/TSemaphore/api.cjs.map +1 -1
  226. package/_cjs/TSemaphore/constructors.cjs +1 -1
  227. package/_cjs/internal/IsFatal.cjs +3 -1
  228. package/_cjs/internal/IsFatal.cjs.map +1 -1
  229. package/_mjs/Cached/definition.mjs +4 -2
  230. package/_mjs/Cached/definition.mjs.map +1 -1
  231. package/_mjs/Cached/internal.mjs +3 -5
  232. package/_mjs/Cached/internal.mjs.map +1 -1
  233. package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
  234. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  235. package/_mjs/Channel/api.mjs +15 -14
  236. package/_mjs/Channel/api.mjs.map +1 -1
  237. package/_mjs/Channel/definition.mjs +9 -1
  238. package/_mjs/Channel/definition.mjs.map +1 -1
  239. package/_mjs/Channel/internal/ChannelExecutor.mjs +11 -6
  240. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  241. package/_mjs/Channel/internal/MergeDecision.mjs +4 -1
  242. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -1
  243. package/_mjs/CountdownLatch.mjs +3 -1
  244. package/_mjs/CountdownLatch.mjs.map +1 -1
  245. package/_mjs/Differ/definition.mjs +3 -1
  246. package/_mjs/Differ/definition.mjs.map +1 -1
  247. package/_mjs/Fiber/FiberRuntime.mjs +97 -90
  248. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  249. package/_mjs/Fiber/definition.mjs +5 -2
  250. package/_mjs/Fiber/definition.mjs.map +1 -1
  251. package/_mjs/FiberRef/definition.mjs +6 -3
  252. package/_mjs/FiberRef/definition.mjs.map +1 -1
  253. package/_mjs/Future/api.mjs +17 -6
  254. package/_mjs/Future/api.mjs.map +1 -1
  255. package/_mjs/Hub/api.mjs +6 -6
  256. package/_mjs/Hub/api.mjs.map +1 -1
  257. package/_mjs/Hub/definition.mjs +5 -4
  258. package/_mjs/Hub/definition.mjs.map +1 -1
  259. package/_mjs/Hub/internal.mjs +6 -6
  260. package/_mjs/Hub/internal.mjs.map +1 -1
  261. package/_mjs/IO/api/asyncIO.mjs +1 -1
  262. package/_mjs/IO/api/asyncIO.mjs.map +1 -1
  263. package/_mjs/IO/api/asyncInterrupt.mjs +2 -2
  264. package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
  265. package/_mjs/IO/api/bracketExit.mjs +1 -1
  266. package/_mjs/IO/api/bracketExit.mjs.map +1 -1
  267. package/_mjs/IO/api/descriptor.mjs +20 -0
  268. package/_mjs/IO/api/descriptor.mjs.map +1 -0
  269. package/_mjs/IO/api/foreachConcurrent.mjs +2 -2
  270. package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
  271. package/_mjs/IO/api/forkIn.mjs +1 -1
  272. package/_mjs/IO/api/forkIn.mjs.map +1 -1
  273. package/_mjs/IO/api/forkScoped.mjs +1 -1
  274. package/_mjs/IO/api/forkScoped.mjs.map +1 -1
  275. package/_mjs/IO/api/fulfill.mjs +1 -1
  276. package/_mjs/IO/api/fulfill.mjs.map +1 -1
  277. package/_mjs/IO/api/interrupt.mjs +46 -38
  278. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  279. package/_mjs/IO/api/onTermination.mjs +7 -6
  280. package/_mjs/IO/api/onTermination.mjs.map +1 -1
  281. package/_mjs/IO/api/race.mjs +1 -1
  282. package/_mjs/IO/api/race.mjs.map +1 -1
  283. package/_mjs/IO/api/sequenceT.mjs +1 -1
  284. package/_mjs/IO/api/sequenceT.mjs.map +1 -1
  285. package/_mjs/IO/api/zipConcurrent.mjs +1 -1
  286. package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
  287. package/_mjs/IO/api.mjs +10 -3
  288. package/_mjs/IO/api.mjs.map +1 -1
  289. package/_mjs/IO/definition.mjs +23 -19
  290. package/_mjs/IO/definition.mjs.map +1 -1
  291. package/_mjs/IO.mjs +1 -1
  292. package/_mjs/IO.mjs.map +1 -1
  293. package/_mjs/Layer/MemoMap.mjs +28 -29
  294. package/_mjs/Layer/MemoMap.mjs.map +1 -1
  295. package/_mjs/Layer/api.mjs +2 -2
  296. package/_mjs/Layer/api.mjs.map +1 -1
  297. package/_mjs/Layer/definition.mjs +9 -8
  298. package/_mjs/Layer/definition.mjs.map +1 -1
  299. package/_mjs/Logger/definition.mjs +1 -0
  300. package/_mjs/Logger/definition.mjs.map +1 -1
  301. package/_mjs/MVar/api.mjs +150 -0
  302. package/_mjs/MVar/api.mjs.map +1 -0
  303. package/_mjs/MVar/definition.mjs +18 -0
  304. package/_mjs/MVar/definition.mjs.map +1 -0
  305. package/_mjs/MVar.mjs +4 -0
  306. package/_mjs/MVar.mjs.map +1 -0
  307. package/_mjs/Push/api.mjs +39 -36
  308. package/_mjs/Push/api.mjs.map +1 -1
  309. package/_mjs/Push/definition.mjs +5 -0
  310. package/_mjs/Push/definition.mjs.map +1 -1
  311. package/_mjs/Push/internal.mjs +4 -2
  312. package/_mjs/Push/internal.mjs.map +1 -1
  313. package/_mjs/Queue/api/dimapIO.mjs +11 -11
  314. package/_mjs/Queue/api/dimapIO.mjs.map +1 -1
  315. package/_mjs/Queue/api/filterInputIO.mjs +5 -5
  316. package/_mjs/Queue/api/filterInputIO.mjs.map +1 -1
  317. package/_mjs/Queue/api/filterOutputIO.mjs +8 -8
  318. package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -1
  319. package/_mjs/Queue/definition.mjs +1 -0
  320. package/_mjs/Queue/definition.mjs.map +1 -1
  321. package/_mjs/Queue/internal.mjs +2 -2
  322. package/_mjs/Queue/internal.mjs.map +1 -1
  323. package/_mjs/Queue/strategy.mjs +2 -2
  324. package/_mjs/Queue/strategy.mjs.map +1 -1
  325. package/_mjs/Ref/Derived.mjs +6 -3
  326. package/_mjs/Ref/Derived.mjs.map +1 -1
  327. package/_mjs/Ref/Synchronized/constructors.mjs +15 -7
  328. package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -1
  329. package/_mjs/Ref/Synchronized/definition.mjs +13 -10
  330. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  331. package/_mjs/Ref/definition.mjs +1 -1
  332. package/_mjs/Ref/definition.mjs.map +1 -1
  333. package/_mjs/Ref.mjs +0 -1
  334. package/_mjs/Ref.mjs.map +1 -1
  335. package/_mjs/RefSubject/Synchronized/api.mjs +1 -1
  336. package/_mjs/RefSubject/definition.mjs +10 -3
  337. package/_mjs/RefSubject/definition.mjs.map +1 -1
  338. package/_mjs/Reloadable/definition.mjs +2 -1
  339. package/_mjs/Reloadable/definition.mjs.map +1 -1
  340. package/_mjs/STM/api/atomically.mjs +47 -0
  341. package/_mjs/STM/api/atomically.mjs.map +1 -0
  342. package/_mjs/STM/api.mjs +61 -88
  343. package/_mjs/STM/api.mjs.map +1 -1
  344. package/_mjs/STM/definition.mjs +27 -17
  345. package/_mjs/STM/definition.mjs.map +1 -1
  346. package/_mjs/STM/driver.mjs +3 -3
  347. package/_mjs/STM/driver.mjs.map +1 -1
  348. package/_mjs/STM/internal/Entry.mjs +5 -2
  349. package/_mjs/STM/internal/Entry.mjs.map +1 -1
  350. package/_mjs/STM/internal/TryCommit.mjs +6 -2
  351. package/_mjs/STM/internal/TryCommit.mjs.map +1 -1
  352. package/_mjs/STM/internal/Versioned.mjs +3 -1
  353. package/_mjs/STM/internal/Versioned.mjs.map +1 -1
  354. package/_mjs/STM.mjs +1 -0
  355. package/_mjs/STM.mjs.map +1 -1
  356. package/_mjs/Schedule/definition.mjs +1 -0
  357. package/_mjs/Schedule/definition.mjs.map +1 -1
  358. package/_mjs/Scope/api.mjs +1 -2
  359. package/_mjs/Scope/api.mjs.map +1 -1
  360. package/_mjs/Scope/definition.mjs +4 -2
  361. package/_mjs/Scope/definition.mjs.map +1 -1
  362. package/_mjs/ScopedRef/api.mjs +2 -2
  363. package/_mjs/ScopedRef/api.mjs.map +1 -1
  364. package/_mjs/ScopedRef/definition.mjs +3 -1
  365. package/_mjs/ScopedRef/definition.mjs.map +1 -1
  366. package/_mjs/State/api.mjs +1 -1
  367. package/_mjs/State/api.mjs.map +1 -1
  368. package/_mjs/State/definition.mjs +4 -1
  369. package/_mjs/State/definition.mjs.map +1 -1
  370. package/_mjs/State/internal.mjs +5 -2
  371. package/_mjs/State/internal.mjs.map +1 -1
  372. package/_mjs/Stream/api.mjs +1 -1
  373. package/_mjs/Stream/definition.mjs +2 -1
  374. package/_mjs/Stream/definition.mjs.map +1 -1
  375. package/_mjs/Stream/internal/Handoff.mjs +40 -32
  376. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  377. package/_mjs/Stream/internal/SinkEndReason.mjs +6 -2
  378. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  379. package/_mjs/Subject/Atomic.mjs +4 -2
  380. package/_mjs/Subject/Atomic.mjs.map +1 -1
  381. package/_mjs/SubscriptionRef.mjs +1 -1
  382. package/_mjs/SupervisorPatch.mjs +3 -1
  383. package/_mjs/SupervisorPatch.mjs.map +1 -1
  384. package/_mjs/TExit/definition.mjs +25 -24
  385. package/_mjs/TExit/definition.mjs.map +1 -1
  386. package/_mjs/TFuture/constructors.mjs +1 -1
  387. package/_mjs/TReentrantLock/api.mjs +10 -9
  388. package/_mjs/TReentrantLock/api.mjs.map +1 -1
  389. package/_mjs/TRef/constructors.mjs +1 -1
  390. package/_mjs/TRef/definition.mjs +19 -20
  391. package/_mjs/TRef/definition.mjs.map +1 -1
  392. package/_mjs/TRef.mjs +0 -1
  393. package/_mjs/TRef.mjs.map +1 -1
  394. package/_mjs/TSemaphore/api.mjs +2 -2
  395. package/_mjs/TSemaphore/api.mjs.map +1 -1
  396. package/_mjs/TSemaphore/constructors.mjs +1 -1
  397. package/_mjs/internal/IsFatal.mjs +3 -1
  398. package/_mjs/internal/IsFatal.mjs.map +1 -1
  399. package/_src/Cached/definition.ts +6 -4
  400. package/_src/Cached/internal.ts +4 -4
  401. package/_src/Channel/api.ts +14 -15
  402. package/_src/Channel/definition.ts +37 -14
  403. package/_src/Channel/internal/ChannelExecutor.ts +14 -3
  404. package/_src/Channel/internal/MergeDecision.ts +11 -6
  405. package/_src/CountdownLatch.ts +1 -1
  406. package/_src/Differ/definition.ts +2 -4
  407. package/_src/Fiber/FiberRuntime.ts +54 -50
  408. package/_src/Fiber/definition.ts +15 -8
  409. package/_src/FiberRef/definition.ts +9 -4
  410. package/_src/FiberRefs/api.ts +1 -1
  411. package/_src/FiberRefs/definition.ts +1 -1
  412. package/_src/Future/api.ts +14 -5
  413. package/_src/Hub/api.ts +9 -7
  414. package/_src/Hub/definition.ts +30 -15
  415. package/_src/IO/api/descriptor.ts +14 -0
  416. package/_src/IO/api/interrupt.ts +72 -55
  417. package/_src/IO/api/onTermination.ts +8 -7
  418. package/_src/IO/api/sequenceT.ts +4 -6
  419. package/_src/IO/api.ts +8 -1
  420. package/_src/IO/definition.ts +36 -27
  421. package/_src/IO.ts +1 -1
  422. package/_src/Layer/MemoMap.ts +1 -1
  423. package/_src/Layer/api.ts +2 -2
  424. package/_src/Layer/definition.ts +18 -13
  425. package/_src/Logger/definition.ts +9 -4
  426. package/_src/MVar/api.ts +185 -0
  427. package/_src/MVar/definition.ts +45 -0
  428. package/_src/MVar.ts +4 -0
  429. package/_src/Push/api.ts +7 -4
  430. package/_src/Push/definition.ts +12 -3
  431. package/_src/Push/internal.ts +2 -2
  432. package/_src/Queue/api/dimapIO.ts +24 -13
  433. package/_src/Queue/api/filterInputIO.ts +9 -7
  434. package/_src/Queue/api/filterOutputIO.ts +9 -7
  435. package/_src/Queue/definition.ts +27 -18
  436. package/_src/Ref/Derived.ts +4 -1
  437. package/_src/Ref/Synchronized/constructors.ts +9 -0
  438. package/_src/Ref/Synchronized/definition.ts +5 -2
  439. package/_src/Ref/definition.ts +36 -25
  440. package/_src/Ref.ts +0 -1
  441. package/_src/RefSubject/definition.ts +19 -12
  442. package/_src/Reloadable/definition.ts +6 -1
  443. package/_src/STM/api/atomically.ts +43 -0
  444. package/_src/STM/api.ts +20 -38
  445. package/_src/STM/definition.ts +33 -20
  446. package/_src/STM/driver.ts +3 -3
  447. package/_src/STM/internal/Entry.ts +2 -2
  448. package/_src/STM/internal/TryCommit.ts +4 -4
  449. package/_src/STM/internal/Versioned.ts +1 -1
  450. package/_src/STM.ts +1 -0
  451. package/_src/Schedule/definition.ts +8 -3
  452. package/_src/Scope/definition.ts +2 -2
  453. package/_src/ScopedRef/definition.ts +1 -1
  454. package/_src/State/api.ts +1 -1
  455. package/_src/State/definition.ts +6 -3
  456. package/_src/State/internal.ts +8 -3
  457. package/_src/Stream/definition.ts +17 -5
  458. package/_src/Stream/internal/Handoff.ts +31 -24
  459. package/_src/Stream/internal/SinkEndReason.ts +2 -2
  460. package/_src/Subject/Atomic.ts +8 -4
  461. package/_src/SupervisorPatch.ts +1 -1
  462. package/_src/TExit/definition.ts +11 -12
  463. package/_src/TRef/definition.ts +18 -14
  464. package/_src/TRef.ts +0 -1
  465. package/_src/global.ts +4 -0
  466. package/_src/internal/IsFatal.ts +1 -1
  467. package/global.d.ts +4 -0
  468. package/internal/IsFatal.d.ts +1 -1
  469. package/package.json +2 -2
  470. package/IO/api/onExit.d.ts +0 -7
  471. package/Ref/symbols.d.ts +0 -30
  472. package/TRef/symbols.d.ts +0 -20
  473. package/_cjs/IO/api/onExit.cjs.map +0 -1
  474. package/_cjs/Ref/symbols.cjs +0 -37
  475. package/_cjs/Ref/symbols.cjs.map +0 -1
  476. package/_cjs/TRef/symbols.cjs +0 -27
  477. package/_cjs/TRef/symbols.cjs.map +0 -1
  478. package/_mjs/IO/api/onExit.mjs +0 -11
  479. package/_mjs/IO/api/onExit.mjs.map +0 -1
  480. package/_mjs/Ref/symbols.mjs +0 -25
  481. package/_mjs/Ref/symbols.mjs.map +0 -1
  482. package/_mjs/TRef/symbols.mjs +0 -17
  483. package/_mjs/TRef/symbols.mjs.map +0 -1
  484. package/_src/IO/api/onExit.ts +0 -11
  485. package/_src/Ref/symbols.ts +0 -29
  486. package/_src/TRef/symbols.ts +0 -19
@@ -2,11 +2,14 @@ import { HKT } from "@fncts/typelevel/HKT";
2
2
  import { FiberId } from "@fncts/base/data/FiberId/definition";
3
3
  import { Cause } from "@fncts/base/data/Cause/definition";
4
4
  import { Lazy } from "@fncts/base/data/function/definition";
5
+ import { STM } from "@fncts/io/STM/definition";
5
6
  import type { FiberRuntime } from "../Fiber/FiberRuntime.js";
6
7
  import type { Running } from "../FiberStatus.js";
7
8
  import type { RuntimeFlagsPatch } from "../RuntimeFlags.js";
8
9
  import type { Trace } from "@fncts/base/data/Trace";
9
10
  import { RuntimeFlags } from "../RuntimeFlags.js";
11
+ export declare const IOVariance: unique symbol;
12
+ export type IOVariance = typeof IOVariance;
10
13
  export declare const IOTypeId: unique symbol;
11
14
  export type IOTypeId = typeof IOTypeId;
12
15
  export interface IOF extends HKT {
@@ -22,10 +25,12 @@ export interface IOF extends HKT {
22
25
  * @tsplus companion fncts.io.IOOps
23
26
  */
24
27
  export declare abstract class IO<R, E, A> {
25
- readonly _typeId: IOTypeId;
26
- _R: () => R;
27
- _E: () => E;
28
- _A: () => A;
28
+ readonly [IOTypeId]: IOTypeId;
29
+ [IOVariance]: {
30
+ _R: () => R;
31
+ _E: () => E;
32
+ _A: () => A;
33
+ };
29
34
  }
30
35
  /**
31
36
  * @tsplus type fncts.io.IOAspects
@@ -43,20 +48,26 @@ export declare const IOAspects: IOAspects;
43
48
  export declare function unifyIO<X extends IO<any, any, any>>(self: X): IO<[
44
49
  X
45
50
  ] extends [{
46
- _R: () => infer R;
51
+ [IOVariance]: {
52
+ _R: () => infer R;
53
+ };
47
54
  }] ? R : never, [
48
55
  X
49
56
  ] extends [{
50
- _E: () => infer E;
57
+ [IOVariance]: {
58
+ _E: () => infer E;
59
+ };
51
60
  }] ? E : never, [
52
61
  X
53
62
  ] extends [{
54
- _A: () => infer A;
63
+ [IOVariance]: {
64
+ _A: () => infer A;
65
+ };
55
66
  }] ? A : never>;
56
67
  export type UIO<A> = IO<never, never, A>;
57
68
  export type URIO<R, A> = IO<R, never, A>;
58
69
  export type FIO<E, A> = IO<never, E, A>;
59
- export declare const enum IOTag {
70
+ export declare const enum IOOpCode {
60
71
  SucceedNow = 0,
61
72
  Fail = 1,
62
73
  Sync = 2,
@@ -69,20 +80,23 @@ export declare const enum IOTag {
69
80
  GenerateStackTrace = 9,
70
81
  Stateful = 10,
71
82
  WhileLoop = 11,
72
- YieldNow = 12
83
+ YieldNow = 12,
84
+ Commit = 13,
85
+ RevertFlags = 14,
86
+ UpdateTrace = 15
73
87
  }
74
88
  export declare function isIO(u: unknown): u is IO<any, any, any>;
75
89
  export declare class Sync<A> extends IO<never, never, A> {
76
90
  readonly evaluate: () => A;
77
91
  readonly trace?: string | undefined;
78
- readonly _tag = IOTag.Sync;
92
+ readonly ioOpCode = IOOpCode.Sync;
79
93
  constructor(evaluate: () => A, trace?: string | undefined);
80
94
  }
81
95
  export declare class Async<R, E, A> extends IO<R, E, A> {
82
96
  readonly registerCallback: (f: (_: IO<R, E, A>) => void) => any;
83
97
  readonly blockingOn: () => FiberId;
84
98
  readonly trace?: string | undefined;
85
- readonly _tag = IOTag.Async;
99
+ readonly ioOpCode = IOOpCode.Async;
86
100
  constructor(registerCallback: (f: (_: IO<R, E, A>) => void) => any, blockingOn: () => FiberId, trace?: string | undefined);
87
101
  }
88
102
  /**
@@ -93,7 +107,7 @@ export declare class OnSuccessAndFailure<R, E, A, R1, E1, B, R2, E2, C> extends
93
107
  readonly failureK: (cause: Cause<E>) => IO<R1, E1, B>;
94
108
  readonly successK: (a: A) => IO<R2, E2, C>;
95
109
  readonly trace?: string | undefined;
96
- readonly _tag = IOTag.OnSuccessAndFailure;
110
+ readonly ioOpCode = IOOpCode.OnSuccessAndFailure;
97
111
  constructor(first: IO<R, E, A>, failureK: (cause: Cause<E>) => IO<R1, E1, B>, successK: (a: A) => IO<R2, E2, C>, trace?: string | undefined);
98
112
  onFailure(c: Cause<E>): IO<R | R1 | R2, E1 | E2, B | C>;
99
113
  onSuccess(a: A): IO<R | R1 | R2, E1 | E2, B | C>;
@@ -102,7 +116,7 @@ export declare class OnFailure<R, E, A, R1, E1, B> extends IO<R | R1, E1, A | B>
102
116
  readonly first: IO<R, E, A>;
103
117
  readonly failureK: (cause: Cause<E>) => IO<R1, E1, B>;
104
118
  readonly trace?: string | undefined;
105
- readonly _tag = IOTag.OnFailure;
119
+ readonly ioOpCode = IOOpCode.OnFailure;
106
120
  constructor(first: IO<R, E, A>, failureK: (cause: Cause<E>) => IO<R1, E1, B>, trace?: string | undefined);
107
121
  onFailure(c: Cause<E>): IO<R | R1, E1, A | B>;
108
122
  onSuccess(a: A): IO<R | R1, E1, A | B>;
@@ -114,7 +128,7 @@ export declare class OnSuccess<R, R1, E, E1, A, A1> extends IO<R | R1, E | E1, A
114
128
  readonly first: IO<R, E, A>;
115
129
  readonly successK: (a: A) => IO<R1, E1, A1>;
116
130
  readonly trace?: string | undefined;
117
- readonly _tag = IOTag.OnSuccess;
131
+ readonly ioOpCode = IOOpCode.OnSuccess;
118
132
  constructor(first: IO<R, E, A>, successK: (a: A) => IO<R1, E1, A1>, trace?: string | undefined);
119
133
  onFailure(c: Cause<E>): IO<R | R1, E | E1, A1>;
120
134
  onSuccess(a: A): IO<R | R1, E | E1, A1>;
@@ -125,19 +139,19 @@ export declare class OnSuccess<R, R1, E, E1, A, A1> extends IO<R | R1, E | E1, A
125
139
  export declare class SucceedNow<A> extends IO<never, never, A> {
126
140
  readonly value: A;
127
141
  readonly trace?: string | undefined;
128
- readonly _tag = IOTag.SucceedNow;
142
+ readonly ioOpCode = IOOpCode.SucceedNow;
129
143
  constructor(value: A, trace?: string | undefined);
130
144
  }
131
145
  export declare class UpdateRuntimeFlags extends IO<never, never, void> {
132
146
  readonly update: RuntimeFlags.Patch;
133
147
  readonly trace?: string | undefined;
134
- readonly _tag = IOTag.UpdateRuntimeFlags;
148
+ readonly ioOpCode = IOOpCode.UpdateRuntimeFlags;
135
149
  constructor(update: RuntimeFlags.Patch, trace?: string | undefined);
136
150
  }
137
151
  export declare class Interruptible<R, E, A> extends IO<R, E, A> {
138
152
  readonly effect: IO<R, E, A>;
139
153
  readonly trace?: string | undefined;
140
- readonly _tag = IOTag.UpdateRuntimeFlagsWithin;
154
+ readonly ioOpCode = IOOpCode.UpdateRuntimeFlagsWithin;
141
155
  constructor(effect: IO<R, E, A>, trace?: string | undefined);
142
156
  readonly update: RuntimeFlags.Patch;
143
157
  scope(oldRuntimeFlags: RuntimeFlags): IO<R, E, A>;
@@ -145,7 +159,7 @@ export declare class Interruptible<R, E, A> extends IO<R, E, A> {
145
159
  export declare class Uninterruptible<R, E, A> extends IO<R, E, A> {
146
160
  readonly effect: IO<R, E, A>;
147
161
  readonly trace?: string | undefined;
148
- readonly _tag = IOTag.UpdateRuntimeFlagsWithin;
162
+ readonly ioOpCode = IOOpCode.UpdateRuntimeFlagsWithin;
149
163
  constructor(effect: IO<R, E, A>, trace?: string | undefined);
150
164
  readonly update: RuntimeFlags.Patch;
151
165
  scope(oldRuntimeFlags: RuntimeFlags): IO<R, E, A>;
@@ -154,19 +168,19 @@ export declare class Dynamic<R, E, A> extends IO<R, E, A> {
154
168
  readonly update: RuntimeFlagsPatch;
155
169
  readonly f: (oldRuntimeFlags: RuntimeFlags) => IO<R, E, A>;
156
170
  readonly trace?: string | undefined;
157
- readonly _tag = IOTag.UpdateRuntimeFlagsWithin;
171
+ readonly ioOpCode = IOOpCode.UpdateRuntimeFlagsWithin;
158
172
  constructor(update: RuntimeFlagsPatch, f: (oldRuntimeFlags: RuntimeFlags) => IO<R, E, A>, trace?: string | undefined);
159
173
  scope(oldRuntimeFlags: RuntimeFlags): IO<R, E, A>;
160
174
  }
161
175
  export declare class GenerateStackTrace extends IO<never, never, Trace> {
162
176
  readonly trace?: string | undefined;
163
- readonly _tag = IOTag.GenerateStackTrace;
177
+ readonly ioOpCode = IOOpCode.GenerateStackTrace;
164
178
  constructor(trace?: string | undefined);
165
179
  }
166
180
  export declare class Stateful<R, E, A> extends IO<R, E, A> {
167
181
  readonly onState: (fiber: FiberRuntime<E, A>, status: Running) => IO<R, E, A>;
168
182
  readonly trace?: string | undefined;
169
- readonly _tag = IOTag.Stateful;
183
+ readonly ioOpCode = IOOpCode.Stateful;
170
184
  constructor(onState: (fiber: FiberRuntime<E, A>, status: Running) => IO<R, E, A>, trace?: string | undefined);
171
185
  }
172
186
  export declare class WhileLoop<R, E, A> extends IO<R, E, void> {
@@ -174,12 +188,12 @@ export declare class WhileLoop<R, E, A> extends IO<R, E, void> {
174
188
  readonly body: () => IO<R, E, A>;
175
189
  readonly process: (a: A) => any;
176
190
  readonly trace?: string | undefined;
177
- readonly _tag = IOTag.WhileLoop;
191
+ readonly ioOpCode = IOOpCode.WhileLoop;
178
192
  constructor(check: () => boolean, body: () => IO<R, E, A>, process: (a: A) => any, trace?: string | undefined);
179
193
  }
180
194
  export declare class YieldNow extends IO<never, never, void> {
181
195
  readonly trace?: string | undefined;
182
- readonly _tag = IOTag.YieldNow;
196
+ readonly ioOpCode = IOOpCode.YieldNow;
183
197
  constructor(trace?: string | undefined);
184
198
  }
185
199
  /**
@@ -188,10 +202,10 @@ export declare class YieldNow extends IO<never, never, void> {
188
202
  export declare class Fail<E> extends IO<never, E, never> {
189
203
  readonly cause: Lazy<Cause<E>>;
190
204
  readonly trace?: string | undefined;
191
- readonly _tag = IOTag.Fail;
205
+ readonly ioOpCode = IOOpCode.Fail;
192
206
  constructor(cause: Lazy<Cause<E>>, trace?: string | undefined);
193
207
  }
194
- export type Concrete = OnSuccessAndFailure<any, any, any, any, any, any, any, any, any> | OnFailure<any, any, any, any, any, any> | OnSuccess<any, any, any, any, any, any> | UpdateRuntimeFlagsWithin | Sync<any> | Async<any, any, any> | SucceedNow<any> | UpdateRuntimeFlags | GenerateStackTrace | Stateful<any, any, any> | WhileLoop<any, any, any> | YieldNow | Fail<any>;
208
+ export type Concrete = OnSuccessAndFailure<any, any, any, any, any, any, any, any, any> | OnFailure<any, any, any, any, any, any> | OnSuccess<any, any, any, any, any, any> | UpdateRuntimeFlagsWithin | Sync<any> | Async<any, any, any> | SucceedNow<any> | UpdateRuntimeFlags | GenerateStackTrace | Stateful<any, any, any> | WhileLoop<any, any, any> | YieldNow | Fail<any> | STM<any, any, any>;
195
209
  /**
196
210
  * @tsplus static fncts.io.IOOps concrete
197
211
  * @tsplus macro identity
@@ -205,7 +219,7 @@ export declare const IOErrorTypeId: unique symbol;
205
219
  export type IOErrorTypeId = typeof IOErrorTypeId;
206
220
  export declare class IOError<E> {
207
221
  readonly cause: Cause<E>;
208
- readonly _typeId: IOErrorTypeId;
222
+ readonly [IOErrorTypeId]: IOErrorTypeId;
209
223
  constructor(cause: Cause<E>);
210
224
  }
211
225
  export declare function isIOError(u: unknown): u is IOError<unknown>;
package/IO.d.ts CHANGED
@@ -17,6 +17,7 @@ export * from "./IO/api/concurrentFinalizers.js";
17
17
  export * from "./IO/api/consoleWith.js";
18
18
  export * from "./IO/api/core-scope.js";
19
19
  export * from "./IO/api/delay.js";
20
+ export * from "./IO/api/descriptor.js";
20
21
  export * from "./IO/api/ensuringChildren.js";
21
22
  export * from "./IO/api/environment.js";
22
23
  export * from "./IO/api/foreachConcurrent.js";
@@ -29,7 +30,6 @@ export * from "./IO/api/fulfill.js";
29
30
  export * from "./IO/api/interrupt.js";
30
31
  export * from "./IO/api/memoize.js";
31
32
  export * from "./IO/api/once.js";
32
- export * from "./IO/api/onExit.js";
33
33
  export * from "./IO/api/onTermination.js";
34
34
  export * from "./IO/api/provideLayer.js";
35
35
  export * from "./IO/api/provideSomeLayer.js";
@@ -2,6 +2,8 @@ import { Cause } from "@fncts/base/data/Cause/definition";
2
2
  import { Environment } from "@fncts/base/data/Environment/definition";
3
3
  import { Scope } from "@fncts/io/Scope/definition";
4
4
  import { IO } from "@fncts/io/IO/definition";
5
+ export declare const LayerVariance: unique symbol;
6
+ export type LayerVariance = typeof LayerVariance;
5
7
  export declare const LayerHash: unique symbol;
6
8
  export type LayerHash = typeof LayerHash;
7
9
  /**
@@ -9,26 +11,28 @@ export type LayerHash = typeof LayerHash;
9
11
  * @tsplus companion fncts.io.LayerOps
10
12
  */
11
13
  export declare abstract class Layer<RIn, E, ROut> {
12
- readonly _R: () => RIn;
13
- readonly _E: () => E;
14
- readonly _A: () => ROut;
14
+ [LayerVariance]: {
15
+ readonly _RIn: (_: never) => RIn;
16
+ readonly _E: (_: never) => E;
17
+ readonly _ROut: (_: never) => ROut;
18
+ };
15
19
  [LayerHash]: PropertyKey;
16
20
  setKey(hash: PropertyKey): this;
17
21
  }
18
- export type Concrete = Fold<any, any, any, any, any, any, any, any, any> | Fresh<any, any, any> | FromScoped<any, any, any> | Defer<any, any, any> | To<any, any, any, any, any> | ZipWith<any, any, any, any, any, any, any> | ZipWithC<any, any, any, any, any, any, any>;
22
+ export type Concrete = Fold<any, any, any, any, any, any, any, any, any> | Fresh<any, any, any> | FromScoped<any, any, any> | Defer<any, any, any> | To<any, any, any, any, any> | ZipWith<any, any, any, any, any, any, any> | ZipWithConcurrent<any, any, any, any, any, any, any>;
19
23
  /**
20
24
  * @tsplus fluent fncts.io.Layer concrete
21
25
  * @tsplus location "@fncts/io/Layer/definition"
22
26
  */
23
27
  export declare function concrete(self: Layer<any, any, any>): asserts self is Concrete;
24
28
  export declare const enum LayerTag {
25
- Fold = "Fold",
26
- Fresh = "Fresh",
27
- Scoped = "Scoped",
28
- Defer = "Defer",
29
- To = "To",
30
- ZipWith = "ZipWith",
31
- ZipWithC = "ZipWithC"
29
+ Fold = 0,
30
+ Fresh = 1,
31
+ Scoped = 2,
32
+ Defer = 3,
33
+ To = 4,
34
+ ZipWith = 5,
35
+ ZipWithConcurrent = 6
32
36
  }
33
37
  export declare class Fold<RIn, E, ROut, RIn1, E1, ROut1, RIn2, E2, ROut2> extends Layer<RIn & RIn1 & RIn2, E1 | E2, ROut1 | ROut2> {
34
38
  readonly self: Layer<RIn, E, ROut>;
@@ -71,11 +75,11 @@ export declare class ZipWith<RIn, E, ROut, RIn1, E1, ROut1, ROut2> extends Layer
71
75
  readonly _tag = LayerTag.ZipWith;
72
76
  constructor(self: Layer<RIn, E, ROut>, that: Layer<RIn1, E1, ROut1>, f: (a: Environment<ROut>, b: Environment<ROut1>) => Environment<ROut2>, trace?: string | undefined);
73
77
  }
74
- export declare class ZipWithC<RIn, E, ROut, RIn1, E1, ROut1, ROut2> extends Layer<RIn | RIn1, E | E1, ROut2> {
78
+ export declare class ZipWithConcurrent<RIn, E, ROut, RIn1, E1, ROut1, ROut2> extends Layer<RIn | RIn1, E | E1, ROut2> {
75
79
  readonly self: Layer<RIn, E, ROut>;
76
80
  readonly that: Layer<RIn1, E1, ROut1>;
77
81
  readonly f: (a: Environment<ROut>, b: Environment<ROut1>) => Environment<ROut2>;
78
82
  readonly trace?: string | undefined;
79
- readonly _tag = LayerTag.ZipWithC;
83
+ readonly _tag = LayerTag.ZipWithConcurrent;
80
84
  constructor(self: Layer<RIn, E, ROut>, that: Layer<RIn1, E1, ROut1>, f: (a: Environment<ROut>, b: Environment<ROut1>) => Environment<ROut2>, trace?: string | undefined);
81
85
  }
@@ -4,15 +4,19 @@ import { LogLevel } from "@fncts/io/LogLevel";
4
4
  import { Cause } from "@fncts/base/data/Cause/definition";
5
5
  import { HashMap } from "@fncts/base/collection/immutable/HashMap/definition";
6
6
  import { FiberRef } from "@fncts/io/FiberRef/definition";
7
- import { List } from "@fncts/base/collection/immutable/List/definition";
7
+ import { Cons, List } from "@fncts/base/collection/immutable/List/definition";
8
8
  import type { LogSpan } from "@fncts/io/LogSpan";
9
+ export declare const LoggerVariance: unique symbol;
10
+ export type LoggerVariance = typeof LoggerVariance;
9
11
  /**
10
12
  * @tsplus type fncts.io.Logger
11
13
  * @tsplus companion fncts.io.LoggerOps
12
14
  */
13
- export declare class Logger<Message, Output> {
14
- readonly log: (trace: TraceElement, fiberId: FiberId, logLevel: LogLevel, message: () => Message, cause: Cause<any>, context: HashMap<FiberRef<unknown>, unknown>, spans: List<LogSpan>, annotations: HashMap<string, string>) => Output;
15
- readonly _Message: (_: Message) => void;
16
- readonly _Output: () => Output;
17
- constructor(log: (trace: TraceElement, fiberId: FiberId, logLevel: LogLevel, message: () => Message, cause: Cause<any>, context: HashMap<FiberRef<unknown>, unknown>, spans: List<LogSpan>, annotations: HashMap<string, string>) => Output);
15
+ export declare class Logger<in Message, out Output> {
16
+ readonly log: (trace: TraceElement, fiberId: FiberId, logLevel: LogLevel, message: () => Message, cause: Cause<any>, context: HashMap<FiberRef<any>, Cons<readonly [FiberId.Runtime, unknown]>>, spans: List<LogSpan>, annotations: HashMap<string, string>) => Output;
17
+ LoggerVariance: {
18
+ readonly _Message: (_: Message) => void;
19
+ readonly _Output: (_: never) => Output;
20
+ };
21
+ constructor(log: (trace: TraceElement, fiberId: FiberId, logLevel: LogLevel, message: () => Message, cause: Cause<any>, context: HashMap<FiberRef<any>, Cons<readonly [FiberId.Runtime, unknown]>>, spans: List<LogSpan>, annotations: HashMap<string, string>) => Output);
18
22
  }
package/MVar/api.d.ts ADDED
@@ -0,0 +1,101 @@
1
+ import { UIO } from "@fncts/io/IO/definition";
2
+ import { Maybe } from "@fncts/base/data/Maybe/definition";
3
+ import type { MVar } from "./definition";
4
+ /**
5
+ * @tsplus static fncts.io.MVarOps empty
6
+ * @tsplus location "@fncts/io/MVar/api"
7
+ */
8
+ export declare function empty<A>(): UIO<MVar<A>>;
9
+ /**
10
+ * @tsplus static fncts.io.MVarOps make
11
+ * @tsplus static fncts.io.MVarOps __call
12
+ * @tsplus location "@fncts/io/MVar/api"
13
+ */
14
+ export declare function make<A>(value: A): UIO<MVar<A>>;
15
+ /**
16
+ * Check whether the `MVar` is empty.
17
+ *
18
+ * Notice that the boolean value returned is just a snapshot of the state of
19
+ * the `MVar`. By the time you get to react on its result, the `MVar` may have
20
+ * been filled (or emptied) - so be extremely careful when using this
21
+ * operation. Use `tryTake` instead if possible.
22
+ * @tsplus getter fncts.io.MVar isEmpty
23
+ * @tsplus location "@fncts/io/MVar/api"
24
+ */
25
+ export declare function isEmpty<A>(self: MVar<A>): UIO<boolean>;
26
+ /**
27
+ * A slight variation on `update` that allows a value to be returned (`b`) in
28
+ * addition to the modified value of the `MVar`.
29
+ * @tsplus fluent fncts.io.MVar modify
30
+ * @tsplus location "@fncts/io/MVar/api"
31
+ */
32
+ export declare function modify<A, B>(self: MVar<A>, f: (a: A) => readonly [B, A]): UIO<B>;
33
+ /**
34
+ * Put a value into an `MVar`. If the `MVar` is currently full, `put` will
35
+ * wait until it becomes empty.
36
+ * @tsplus fluent fncts.io.MVar put
37
+ * @tsplus location "@fncts/io/MVar/api"
38
+ */
39
+ export declare function put<A>(self: MVar<A>, value: A): UIO<void>;
40
+ /**
41
+ * Atomically read the contents of an `MVar`. If the `MVar` is currently
42
+ * empty, `read` will wait until it is full. `read` is guaranteed to receive
43
+ * the next `put`.
44
+ * @tsplus getter fncts.io.MVar read
45
+ * @tsplus location "@fncts/io/MVar/api"
46
+ */
47
+ export declare function read<A>(self: MVar<A>): UIO<A>;
48
+ /**
49
+ * Take a value from an `MVar`, put a new value into the `MVar` and return the
50
+ * value taken.
51
+ * @tsplus fluent fncts.io.MVar swap
52
+ * @tsplus location "@fncts/io/MVar/api"
53
+ */
54
+ export declare function swap<A>(self: MVar<A>, value: A): UIO<A>;
55
+ /**
56
+ * Return the contents of the `MVar`. If the `MVar` is currently empty, `take`
57
+ * will wait until it is full. After a `take`, the `MVar` is left empty.
58
+ * @tsplus getter fncts.io.MVar take
59
+ * @tsplus location "@fncts/io/MVar/api"
60
+ */
61
+ export declare function take<A>(self: MVar<A>): UIO<A>;
62
+ /**
63
+ * A non-blocking version of `put`. The `tryPut` function attempts to put the
64
+ * value into the `MVar`, returning `true` if it was successful, or
65
+ * `false` otherwise.
66
+ * @tsplus fluent fncts.io.MVar tryPut
67
+ * @tsplus location "@fncts/io/MVar/api"
68
+ */
69
+ export declare function tryPut<A>(self: MVar<A>, value: A): UIO<boolean>;
70
+ /**
71
+ * A non-blocking version of `read`. The `tryRead` function returns
72
+ * immediately, with `None` if the `MVar` was empty, or `Some(x)` if the
73
+ * `MVar` was full with contents `x`.
74
+ * @tsplus getter fncts.io.MVar tryRead
75
+ * @tsplus location "@fncts/io/MVar/api"
76
+ */
77
+ export declare function tryRead<A>(self: MVar<A>): UIO<Maybe<A>>;
78
+ /**
79
+ * A non-blocking version of `take`. The `tryTake` action returns immediately,
80
+ * with `None` if the `MVar` was empty, or `Some(x)` if the `MVar` was full
81
+ * with contents `x`. After `tryTake`, the `MVar` is left empty.
82
+ * @tsplus getter fncts.io.MVar tryTake
83
+ * @tsplus location "@fncts/io/MVar/api"
84
+ */
85
+ export declare function tryTake<A>(self: MVar<A>): UIO<Maybe<A>>;
86
+ /**
87
+ * Replaces the contents of an `MVar` with the result of `f(a)`.
88
+ * @tsplus fluent fncts.io.MVar update
89
+ * @tsplus location "@fncts/io/MVar/api"
90
+ */
91
+ export declare function update<A>(self: MVar<A>, f: (a: A) => A): UIO<void>;
92
+ /**
93
+ * @tsplus static fncts.io.MVarOps unsafeEmpty
94
+ * @tsplus location "@fncts/io/MVar/api"
95
+ */
96
+ export declare function unsafeEmpty<A>(): MVar<A>;
97
+ /**
98
+ * @tsplus static fncts.io.MVarOps unsafeMake
99
+ * @tsplus location "@fncts/io/MVar/api"
100
+ */
101
+ export declare function unsafeMake<A>(value: A): MVar<A>;
@@ -0,0 +1,43 @@
1
+ import { TRef } from "@fncts/io/TRef/definition";
2
+ import { Maybe } from "@fncts/base/data/Maybe/definition";
3
+ export declare const MVarVariance: unique symbol;
4
+ export type MVarVariance = typeof MVarVariance;
5
+ export declare const MVarTypeId: unique symbol;
6
+ export type MVarTypeId = typeof MVarTypeId;
7
+ /**
8
+ * An `MVar<A>` is a mutable location that is either empty or contains a value
9
+ * of type `A`. It has two fundamental operations: `put` which fills an `MVar`
10
+ * if it is empty and blocks otherwise, and `take` which empties an `MVar` if it
11
+ * is full and blocks otherwise. They can be used in multiple different ways:
12
+ *
13
+ * - As synchronized mutable variables,
14
+ * - As channels, with `take` and `put` as `receive` and `send`, and
15
+ * - As a binary semaphore `MVar<void>`, with `take` and `put` as `wait` and
16
+ * `signal`.
17
+ *
18
+ * They were introduced in the paper "Concurrent Haskell" by Simon Peyton Jones,
19
+ * Andrew Gordon and Sigbjorn Finne.
20
+ *
21
+ * @tsplus type fncts.io.MVar
22
+ * @tsplus companion fncts.io.MVarOps
23
+ */
24
+ export interface MVar<in out A> {
25
+ readonly [MVarVariance]: {
26
+ _A: (_: A) => A;
27
+ };
28
+ readonly [MVarTypeId]: MVarTypeId;
29
+ }
30
+ export declare class MVarInternal<in out A> implements MVar<A> {
31
+ readonly content: TRef<Maybe<A>>;
32
+ readonly [MVarTypeId]: MVarTypeId;
33
+ [MVarVariance]: {
34
+ _A: (_: A) => A;
35
+ };
36
+ constructor(content: TRef<Maybe<A>>);
37
+ }
38
+ /**
39
+ * @tsplus static fncts.io.MVarOps concrete
40
+ * @tsplus macro remove
41
+ * @tsplus location "@fncts/io/MVar/definition"
42
+ */
43
+ export declare function concrete<A>(_: MVar<A>): asserts _ is MVarInternal<A>;
package/MVar.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./MVar/api.js";
2
+ export * from "./MVar/definition.js";
package/Push/api.d.ts CHANGED
@@ -12,7 +12,7 @@ import { FiberId } from "@fncts/base/data/FiberId/definition";
12
12
  import { Conc } from "@fncts/base/collection/immutable/Conc";
13
13
  import type { _A, _E, _R } from "@fncts/base/types";
14
14
  import { AtomicReference } from "@fncts/base/internal/AtomicReference";
15
- import { Emitter, Push } from "./definition.js";
15
+ import { Emitter, Push, PushTypeId, PushVariance } from "./definition.js";
16
16
  /**
17
17
  * @tsplus pipeable fncts.io.Push as
18
18
  * @tsplus location "@fncts/io/Push/api"
@@ -93,9 +93,12 @@ interface MulticastObserver<E, A> {
93
93
  }
94
94
  export declare class Multicast<R, E, A> implements Push<R, E, A>, Emitter<never, E, A> {
95
95
  readonly push: Push<R, E, A>;
96
- _R: () => R;
97
- _E: () => E;
98
- _A: () => A;
96
+ readonly [PushTypeId]: PushTypeId;
97
+ [PushVariance]: {
98
+ readonly _R: (_: never) => R;
99
+ readonly _E: (_: never) => E;
100
+ readonly _A: (_: never) => A;
101
+ };
99
102
  protected observers: Array<MulticastObserver<E, A>>;
100
103
  protected fiber: Fiber<never, unknown> | undefined;
101
104
  constructor(push: Push<R, E, A>);
@@ -1,15 +1,22 @@
1
1
  import { IO } from "@fncts/io/IO/definition";
2
2
  import { Scope } from "@fncts/io/Scope/definition";
3
3
  import { Cause } from "@fncts/base/data/Cause/definition";
4
+ export declare const PushVariance: unique symbol;
5
+ export type PushVariance = typeof PushVariance;
6
+ export declare const PushTypeId: unique symbol;
7
+ export type PushTypeId = typeof PushTypeId;
4
8
  /**
5
9
  * @tsplus type fncts.io.Push
6
10
  * @tsplus companion fncts.io.PushOps
7
11
  */
8
12
  export declare class Push<R, E, A> {
9
13
  readonly run: <R1>(emitter: Emitter<R1, E, A>) => IO<R | R1 | Scope, never, unknown>;
10
- _R: (_: never) => R;
11
- _E: (_: never) => E;
12
- _A: (_: never) => A;
14
+ readonly [PushTypeId]: PushTypeId;
15
+ [PushVariance]: {
16
+ readonly _R: (_: never) => R;
17
+ readonly _E: (_: never) => E;
18
+ readonly _A: (_: never) => A;
19
+ };
13
20
  constructor(run: <R1>(emitter: Emitter<R1, E, A>) => IO<R | R1 | Scope, never, unknown>);
14
21
  }
15
22
  /**
@@ -4,7 +4,7 @@ export declare function withCountdownLatch<R, E, A, R1, E1, B>(n: number, f: (la
4
4
  export declare const EarlyExitTypeId: unique symbol;
5
5
  export type EarlyExitTypeId = typeof EarlyExitTypeId;
6
6
  export declare class EarlyExit {
7
- readonly _typeId: EarlyExitTypeId;
7
+ readonly [EarlyExitTypeId]: EarlyExitTypeId;
8
8
  }
9
9
  export declare function isEarlyExit(u: unknown): u is EarlyExit;
10
10
  export declare const earlyExit: import("../IO").UIO<never>;
@@ -3,7 +3,7 @@ import { Conc } from "@fncts/base/collection/immutable/Conc";
3
3
  import { PQueue } from "@fncts/io/Queue/definition";
4
4
  import type { UIO } from "@fncts/io/IO";
5
5
  import type { PDequeue, PDequeueInternal, PEnqueue, PEnqueueInternal } from "@fncts/io/Queue/definition";
6
- import { DequeueTypeId, EnqueueTypeId, QueueTypeId } from "@fncts/io/Queue/definition";
6
+ import { DequeueTypeId, EnqueueTypeId, QueueTypeId, QueueVariance } from "@fncts/io/Queue/definition";
7
7
  /**
8
8
  * Transforms elements enqueued into and dequeued from this queue with the
9
9
  * specified effectual functions.
@@ -47,12 +47,14 @@ declare class ContramapIO<RA, RB, EA, EB, A, B, RC, EC, C> implements PEnqueueIn
47
47
  readonly f: (c: C) => IO<RC, EC, A>;
48
48
  readonly [EnqueueTypeId]: EnqueueTypeId;
49
49
  readonly [QueueTypeId]: QueueTypeId;
50
- _RA: () => RA | RC;
51
- _RB: () => RB;
52
- _EA: () => EA | EC;
53
- _EB: () => EB;
54
- _A: (_: C) => void;
55
- _B: () => B;
50
+ [QueueVariance]: {
51
+ readonly _RA: (_: never) => RA | RC;
52
+ readonly _RB: (_: never) => RB;
53
+ readonly _EA: (_: never) => EA | EC;
54
+ readonly _EB: (_: never) => EB;
55
+ readonly _A: (_: C) => void;
56
+ readonly _B: (_: never) => B;
57
+ };
56
58
  constructor(queue: PEnqueueInternal<RA, RB, EA, EB, A, B>, f: (c: C) => IO<RC, EC, A>);
57
59
  awaitShutdown: UIO<void>;
58
60
  capacity: number;
@@ -73,12 +75,14 @@ declare class MapIO<RA, RB, EA, EB, A, B, RC, EC, C> implements PDequeueInternal
73
75
  readonly f: (b: B) => IO<RC, EC, C>;
74
76
  readonly [DequeueTypeId]: DequeueTypeId;
75
77
  readonly [QueueTypeId]: QueueTypeId;
76
- _RA: () => RA;
77
- _RB: () => RB | RC;
78
- _EA: () => EA;
79
- _EB: () => EB | EC;
80
- _A: (_: A) => void;
81
- _B: () => C;
78
+ [QueueVariance]: {
79
+ readonly _RA: (_: never) => RA;
80
+ readonly _RB: (_: never) => RB | RC;
81
+ readonly _EA: (_: never) => EA;
82
+ readonly _EB: (_: never) => EB | EC;
83
+ readonly _A: (_: A) => void;
84
+ readonly _B: (_: never) => C;
85
+ };
82
86
  constructor(queue: PDequeueInternal<RA, RB, EA, EB, A, B>, f: (b: B) => IO<RC, EC, C>);
83
87
  awaitShutdown: UIO<void>;
84
88
  capacity: number;
@@ -4,6 +4,8 @@ export declare const EnqueueTypeId: unique symbol;
4
4
  export type EnqueueTypeId = typeof EnqueueTypeId;
5
5
  export declare const DequeueTypeId: unique symbol;
6
6
  export type DequeueTypeId = typeof DequeueTypeId;
7
+ export declare const QueueVariance: unique symbol;
8
+ export type QueueVariance = typeof QueueVariance;
7
9
  export declare const QueueTypeId: unique symbol;
8
10
  export type QueueTypeId = typeof QueueTypeId;
9
11
  /**
@@ -22,12 +24,14 @@ export interface PQueue<RA, RB, EA, EB, A, B> extends PEnqueue<RA, RB, EA, EB, A
22
24
  */
23
25
  export interface PQueueCommon<RA, RB, EA, EB, A, B> {
24
26
  readonly [QueueTypeId]: QueueTypeId;
25
- readonly _RA: () => RA;
26
- readonly _RB: () => RB;
27
- readonly _EA: () => EA;
28
- readonly _EB: () => EB;
29
- readonly _A: (_: A) => void;
30
- readonly _B: () => B;
27
+ readonly [QueueVariance]: {
28
+ readonly _RA: (_: never) => RA;
29
+ readonly _RB: (_: never) => RB;
30
+ readonly _EA: (_: never) => EA;
31
+ readonly _EB: (_: never) => EB;
32
+ readonly _A: (_: A) => void;
33
+ readonly _B: (_: never) => B;
34
+ };
31
35
  }
32
36
  /**
33
37
  * @tsplus type fncts.io.Queue
@@ -67,12 +71,14 @@ export declare abstract class QueueInternal<RA, RB, EA, EB, A, B> implements PQu
67
71
  readonly [QueueTypeId]: QueueTypeId;
68
72
  readonly [DequeueTypeId]: DequeueTypeId;
69
73
  readonly [EnqueueTypeId]: EnqueueTypeId;
70
- readonly _RA: () => RA;
71
- readonly _RB: () => RB;
72
- readonly _EA: () => EA;
73
- readonly _EB: () => EB;
74
- readonly _A: (_: A) => void;
75
- readonly _B: () => B;
74
+ [QueueVariance]: {
75
+ readonly _RA: (_: never) => RA;
76
+ readonly _RB: (_: never) => RB;
77
+ readonly _EA: (_: never) => EA;
78
+ readonly _EB: (_: never) => EB;
79
+ readonly _A: (_: A) => void;
80
+ readonly _B: (_: never) => B;
81
+ };
76
82
  /**
77
83
  * Waits until the queue is shutdown.
78
84
  * The `IO` returned by this method will not resume until the queue has been shutdown.
@@ -156,13 +162,15 @@ export declare namespace Queue {
156
162
  }
157
163
  }
158
164
  export interface PQueueCommonInternal<RA, RB, EA, EB, A, B> {
159
- readonly _RA: () => RA;
160
- readonly _RB: () => RB;
161
- readonly _EA: () => EA;
162
- readonly _EB: () => EB;
163
- readonly _A: (_: A) => void;
164
- readonly _B: () => B;
165
165
  readonly [QueueTypeId]: QueueTypeId;
166
+ readonly [QueueVariance]: {
167
+ readonly _RA: (_: never) => RA;
168
+ readonly _RB: (_: never) => RB;
169
+ readonly _EA: (_: never) => EA;
170
+ readonly _EB: (_: never) => EB;
171
+ readonly _A: (_: A) => void;
172
+ readonly _B: (_: never) => B;
173
+ };
166
174
  /**
167
175
  * Waits until the queue is shutdown.
168
176
  * The `IO` returned by this method will not resume until the queue has been shutdown.