@fncts/io 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (482) 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/interrupt.d.ts +19 -19
  16. package/IO/api/onTermination.d.ts +0 -1
  17. package/IO/api/sequenceT.d.ts +19 -3
  18. package/IO/api.d.ts +17 -1
  19. package/IO/definition.d.ts +40 -26
  20. package/IO.d.ts +0 -1
  21. package/Layer/definition.d.ts +17 -13
  22. package/Logger/definition.d.ts +10 -6
  23. package/MVar/api.d.ts +101 -0
  24. package/MVar/definition.d.ts +43 -0
  25. package/MVar.d.ts +2 -0
  26. package/Push/api.d.ts +7 -4
  27. package/Push/definition.d.ts +10 -3
  28. package/Push/internal.d.ts +1 -1
  29. package/Queue/api/dimapIO.d.ts +17 -13
  30. package/Queue/definition.d.ts +26 -18
  31. package/Ref/Derived.d.ts +3 -1
  32. package/Ref/Synchronized/constructors.d.ts +6 -1
  33. package/Ref/Synchronized/definition.d.ts +4 -2
  34. package/Ref/definition.d.ts +36 -25
  35. package/Ref.d.ts +0 -1
  36. package/RefSubject/definition.d.ts +17 -11
  37. package/Reloadable/definition.d.ts +5 -1
  38. package/STM/api/atomically.d.ts +9 -0
  39. package/STM/api.d.ts +12 -6
  40. package/STM/definition.d.ts +28 -15
  41. package/STM/internal/Entry.d.ts +2 -2
  42. package/STM/internal/TryCommit.d.ts +2 -2
  43. package/STM/internal/Versioned.d.ts +1 -1
  44. package/STM.d.ts +1 -0
  45. package/Schedule/definition.d.ts +7 -3
  46. package/Scope/definition.d.ts +1 -1
  47. package/ScopedRef/definition.d.ts +1 -1
  48. package/State/api.d.ts +1 -1
  49. package/State/definition.d.ts +5 -2
  50. package/State/internal.d.ts +6 -2
  51. package/Stream/definition.d.ts +26 -5
  52. package/Stream/internal/Handoff.d.ts +21 -15
  53. package/Stream/internal/SinkEndReason.d.ts +2 -2
  54. package/Subject/Atomic.d.ts +8 -4
  55. package/SupervisorPatch.d.ts +1 -1
  56. package/TExit/definition.d.ts +5 -5
  57. package/TRef/definition.d.ts +16 -14
  58. package/TRef.d.ts +0 -1
  59. package/_cjs/Cached/definition.cjs +4 -2
  60. package/_cjs/Cached/definition.cjs.map +1 -1
  61. package/_cjs/Cached/internal.cjs +7 -6
  62. package/_cjs/Cached/internal.cjs.map +1 -1
  63. package/_cjs/Channel/api/mapOutConcurrentIO.cjs +1 -1
  64. package/_cjs/Channel/api/mergeAllWith.cjs +1 -1
  65. package/_cjs/Channel/api.cjs +20 -20
  66. package/_cjs/Channel/api.cjs.map +1 -1
  67. package/_cjs/Channel/definition.cjs +13 -3
  68. package/_cjs/Channel/definition.cjs.map +1 -1
  69. package/_cjs/Channel/internal/ChannelExecutor.cjs +11 -6
  70. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  71. package/_cjs/Channel/internal/MergeDecision.cjs +7 -3
  72. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -1
  73. package/_cjs/CountdownLatch.cjs +4 -2
  74. package/_cjs/CountdownLatch.cjs.map +1 -1
  75. package/_cjs/Differ/definition.cjs +3 -1
  76. package/_cjs/Differ/definition.cjs.map +1 -1
  77. package/_cjs/Fiber/FiberRuntime.cjs +96 -89
  78. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  79. package/_cjs/Fiber/definition.cjs +8 -4
  80. package/_cjs/Fiber/definition.cjs.map +1 -1
  81. package/_cjs/FiberRef/definition.cjs +8 -4
  82. package/_cjs/FiberRef/definition.cjs.map +1 -1
  83. package/_cjs/Future/api.cjs +17 -6
  84. package/_cjs/Future/api.cjs.map +1 -1
  85. package/_cjs/Hub/api.cjs +5 -5
  86. package/_cjs/Hub/api.cjs.map +1 -1
  87. package/_cjs/Hub/definition.cjs +9 -7
  88. package/_cjs/Hub/definition.cjs.map +1 -1
  89. package/_cjs/Hub/internal.cjs +6 -6
  90. package/_cjs/Hub/internal.cjs.map +1 -1
  91. package/_cjs/IO/api/asyncIO.cjs +1 -1
  92. package/_cjs/IO/api/asyncIO.cjs.map +1 -1
  93. package/_cjs/IO/api/asyncInterrupt.cjs +2 -2
  94. package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
  95. package/_cjs/IO/api/bracketExit.cjs +1 -1
  96. package/_cjs/IO/api/bracketExit.cjs.map +1 -1
  97. package/_cjs/IO/api/foreachConcurrent.cjs +2 -2
  98. package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
  99. package/_cjs/IO/api/forkIn.cjs +1 -1
  100. package/_cjs/IO/api/forkIn.cjs.map +1 -1
  101. package/_cjs/IO/api/forkScoped.cjs +1 -1
  102. package/_cjs/IO/api/forkScoped.cjs.map +1 -1
  103. package/_cjs/IO/api/fulfill.cjs +1 -1
  104. package/_cjs/IO/api/fulfill.cjs.map +1 -1
  105. package/_cjs/IO/api/interrupt.cjs +52 -43
  106. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  107. package/_cjs/IO/api/onTermination.cjs +7 -6
  108. package/_cjs/IO/api/onTermination.cjs.map +1 -1
  109. package/_cjs/IO/api/race.cjs +1 -1
  110. package/_cjs/IO/api/race.cjs.map +1 -1
  111. package/_cjs/IO/api/sequenceT.cjs +1 -1
  112. package/_cjs/IO/api/sequenceT.cjs.map +1 -1
  113. package/_cjs/IO/api/zipConcurrent.cjs +1 -1
  114. package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
  115. package/_cjs/IO/api.cjs +79 -53
  116. package/_cjs/IO/api.cjs.map +1 -1
  117. package/_cjs/IO/definition.cjs +26 -21
  118. package/_cjs/IO/definition.cjs.map +1 -1
  119. package/_cjs/IO.cjs +0 -11
  120. package/_cjs/IO.cjs.map +1 -1
  121. package/_cjs/Layer/MemoMap.cjs +30 -31
  122. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  123. package/_cjs/Layer/api.cjs +1 -1
  124. package/_cjs/Layer/api.cjs.map +1 -1
  125. package/_cjs/Layer/definition.cjs +12 -10
  126. package/_cjs/Layer/definition.cjs.map +1 -1
  127. package/_cjs/Logger/definition.cjs +3 -1
  128. package/_cjs/Logger/definition.cjs.map +1 -1
  129. package/_cjs/MVar/api.cjs +170 -0
  130. package/_cjs/MVar/api.cjs.map +1 -0
  131. package/_cjs/MVar/definition.cjs +28 -0
  132. package/_cjs/MVar/definition.cjs.map +1 -0
  133. package/_cjs/MVar.cjs +28 -0
  134. package/_cjs/MVar.cjs.map +1 -0
  135. package/_cjs/Push/api.cjs +39 -36
  136. package/_cjs/Push/api.cjs.map +1 -1
  137. package/_cjs/Push/definition.cjs +9 -2
  138. package/_cjs/Push/definition.cjs.map +1 -1
  139. package/_cjs/Push/internal.cjs +4 -2
  140. package/_cjs/Push/internal.cjs.map +1 -1
  141. package/_cjs/Queue/api/dimapIO.cjs +10 -10
  142. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  143. package/_cjs/Queue/api/filterInputIO.cjs +4 -4
  144. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  145. package/_cjs/Queue/api/filterOutputIO.cjs +7 -7
  146. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  147. package/_cjs/Queue/definition.cjs +3 -1
  148. package/_cjs/Queue/definition.cjs.map +1 -1
  149. package/_cjs/Queue/internal.cjs +2 -2
  150. package/_cjs/Queue/internal.cjs.map +1 -1
  151. package/_cjs/Queue/strategy.cjs +2 -2
  152. package/_cjs/Queue/strategy.cjs.map +1 -1
  153. package/_cjs/Ref/Derived.cjs +8 -4
  154. package/_cjs/Ref/Derived.cjs.map +1 -1
  155. package/_cjs/Ref/Synchronized/constructors.cjs +16 -7
  156. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
  157. package/_cjs/Ref/Synchronized/definition.cjs +16 -12
  158. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  159. package/_cjs/Ref/definition.cjs +3 -2
  160. package/_cjs/Ref/definition.cjs.map +1 -1
  161. package/_cjs/Ref.cjs +0 -11
  162. package/_cjs/Ref.cjs.map +1 -1
  163. package/_cjs/RefSubject/Synchronized/api.cjs +1 -1
  164. package/_cjs/RefSubject/definition.cjs +9 -5
  165. package/_cjs/RefSubject/definition.cjs.map +1 -1
  166. package/_cjs/Reloadable/definition.cjs +4 -2
  167. package/_cjs/Reloadable/definition.cjs.map +1 -1
  168. package/_cjs/STM/api/atomically.cjs +55 -0
  169. package/_cjs/STM/api/atomically.cjs.map +1 -0
  170. package/_cjs/STM/api.cjs +65 -91
  171. package/_cjs/STM/api.cjs.map +1 -1
  172. package/_cjs/STM/definition.cjs +32 -19
  173. package/_cjs/STM/definition.cjs.map +1 -1
  174. package/_cjs/STM/driver.cjs +3 -3
  175. package/_cjs/STM/driver.cjs.map +1 -1
  176. package/_cjs/STM/internal/Entry.cjs +6 -3
  177. package/_cjs/STM/internal/Entry.cjs.map +1 -1
  178. package/_cjs/STM/internal/TryCommit.cjs +5 -2
  179. package/_cjs/STM/internal/TryCommit.cjs.map +1 -1
  180. package/_cjs/STM/internal/Versioned.cjs +3 -1
  181. package/_cjs/STM/internal/Versioned.cjs.map +1 -1
  182. package/_cjs/STM.cjs +11 -0
  183. package/_cjs/STM.cjs.map +1 -1
  184. package/_cjs/Schedule/definition.cjs +3 -1
  185. package/_cjs/Schedule/definition.cjs.map +1 -1
  186. package/_cjs/Scope/api.cjs +1 -2
  187. package/_cjs/Scope/api.cjs.map +1 -1
  188. package/_cjs/Scope/definition.cjs +5 -3
  189. package/_cjs/Scope/definition.cjs.map +1 -1
  190. package/_cjs/ScopedRef/api.cjs +2 -2
  191. package/_cjs/ScopedRef/api.cjs.map +1 -1
  192. package/_cjs/ScopedRef/definition.cjs +3 -1
  193. package/_cjs/ScopedRef/definition.cjs.map +1 -1
  194. package/_cjs/State/api.cjs +2 -2
  195. package/_cjs/State/api.cjs.map +1 -1
  196. package/_cjs/State/definition.cjs +4 -2
  197. package/_cjs/State/definition.cjs.map +1 -1
  198. package/_cjs/State/internal.cjs +7 -3
  199. package/_cjs/State/internal.cjs.map +1 -1
  200. package/_cjs/Stream/api.cjs +1 -1
  201. package/_cjs/Stream/definition.cjs +4 -2
  202. package/_cjs/Stream/definition.cjs.map +1 -1
  203. package/_cjs/Stream/internal/Handoff.cjs +37 -37
  204. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  205. package/_cjs/Stream/internal/SinkEndReason.cjs +6 -3
  206. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  207. package/_cjs/Subject/Atomic.cjs +6 -4
  208. package/_cjs/Subject/Atomic.cjs.map +1 -1
  209. package/_cjs/SubscriptionRef.cjs +1 -1
  210. package/_cjs/SupervisorPatch.cjs +3 -1
  211. package/_cjs/SupervisorPatch.cjs.map +1 -1
  212. package/_cjs/TExit/definition.cjs +25 -24
  213. package/_cjs/TExit/definition.cjs.map +1 -1
  214. package/_cjs/TFuture/constructors.cjs +1 -1
  215. package/_cjs/TReentrantLock/api.cjs +10 -9
  216. package/_cjs/TReentrantLock/api.cjs.map +1 -1
  217. package/_cjs/TRef/constructors.cjs +1 -1
  218. package/_cjs/TRef/definition.cjs +21 -21
  219. package/_cjs/TRef/definition.cjs.map +1 -1
  220. package/_cjs/TRef.cjs +0 -11
  221. package/_cjs/TRef.cjs.map +1 -1
  222. package/_cjs/TSemaphore/api.cjs +2 -2
  223. package/_cjs/TSemaphore/api.cjs.map +1 -1
  224. package/_cjs/TSemaphore/constructors.cjs +1 -1
  225. package/_cjs/internal/IsFatal.cjs +3 -1
  226. package/_cjs/internal/IsFatal.cjs.map +1 -1
  227. package/_mjs/Cached/definition.mjs +4 -2
  228. package/_mjs/Cached/definition.mjs.map +1 -1
  229. package/_mjs/Cached/internal.mjs +3 -5
  230. package/_mjs/Cached/internal.mjs.map +1 -1
  231. package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
  232. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  233. package/_mjs/Channel/api.mjs +15 -14
  234. package/_mjs/Channel/api.mjs.map +1 -1
  235. package/_mjs/Channel/definition.mjs +9 -1
  236. package/_mjs/Channel/definition.mjs.map +1 -1
  237. package/_mjs/Channel/internal/ChannelExecutor.mjs +11 -6
  238. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  239. package/_mjs/Channel/internal/MergeDecision.mjs +4 -1
  240. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -1
  241. package/_mjs/CountdownLatch.mjs +3 -1
  242. package/_mjs/CountdownLatch.mjs.map +1 -1
  243. package/_mjs/Differ/definition.mjs +3 -1
  244. package/_mjs/Differ/definition.mjs.map +1 -1
  245. package/_mjs/Fiber/FiberRuntime.mjs +97 -90
  246. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  247. package/_mjs/Fiber/definition.mjs +5 -2
  248. package/_mjs/Fiber/definition.mjs.map +1 -1
  249. package/_mjs/FiberRef/definition.mjs +6 -3
  250. package/_mjs/FiberRef/definition.mjs.map +1 -1
  251. package/_mjs/Future/api.mjs +17 -6
  252. package/_mjs/Future/api.mjs.map +1 -1
  253. package/_mjs/Hub/api.mjs +6 -6
  254. package/_mjs/Hub/api.mjs.map +1 -1
  255. package/_mjs/Hub/definition.mjs +5 -4
  256. package/_mjs/Hub/definition.mjs.map +1 -1
  257. package/_mjs/Hub/internal.mjs +6 -6
  258. package/_mjs/Hub/internal.mjs.map +1 -1
  259. package/_mjs/IO/api/asyncIO.mjs +1 -1
  260. package/_mjs/IO/api/asyncIO.mjs.map +1 -1
  261. package/_mjs/IO/api/asyncInterrupt.mjs +2 -2
  262. package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
  263. package/_mjs/IO/api/bracketExit.mjs +1 -1
  264. package/_mjs/IO/api/bracketExit.mjs.map +1 -1
  265. package/_mjs/IO/api/foreachConcurrent.mjs +2 -2
  266. package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
  267. package/_mjs/IO/api/forkIn.mjs +1 -1
  268. package/_mjs/IO/api/forkIn.mjs.map +1 -1
  269. package/_mjs/IO/api/forkScoped.mjs +1 -1
  270. package/_mjs/IO/api/forkScoped.mjs.map +1 -1
  271. package/_mjs/IO/api/fulfill.mjs +1 -1
  272. package/_mjs/IO/api/fulfill.mjs.map +1 -1
  273. package/_mjs/IO/api/interrupt.mjs +46 -38
  274. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  275. package/_mjs/IO/api/onTermination.mjs +7 -6
  276. package/_mjs/IO/api/onTermination.mjs.map +1 -1
  277. package/_mjs/IO/api/race.mjs +1 -1
  278. package/_mjs/IO/api/race.mjs.map +1 -1
  279. package/_mjs/IO/api/sequenceT.mjs +1 -1
  280. package/_mjs/IO/api/sequenceT.mjs.map +1 -1
  281. package/_mjs/IO/api/zipConcurrent.mjs +1 -1
  282. package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
  283. package/_mjs/IO/api.mjs +73 -50
  284. package/_mjs/IO/api.mjs.map +1 -1
  285. package/_mjs/IO/definition.mjs +23 -19
  286. package/_mjs/IO/definition.mjs.map +1 -1
  287. package/_mjs/IO.mjs +0 -1
  288. package/_mjs/IO.mjs.map +1 -1
  289. package/_mjs/Layer/MemoMap.mjs +28 -29
  290. package/_mjs/Layer/MemoMap.mjs.map +1 -1
  291. package/_mjs/Layer/api.mjs +2 -2
  292. package/_mjs/Layer/api.mjs.map +1 -1
  293. package/_mjs/Layer/definition.mjs +9 -8
  294. package/_mjs/Layer/definition.mjs.map +1 -1
  295. package/_mjs/Logger/definition.mjs +1 -0
  296. package/_mjs/Logger/definition.mjs.map +1 -1
  297. package/_mjs/MVar/api.mjs +150 -0
  298. package/_mjs/MVar/api.mjs.map +1 -0
  299. package/_mjs/MVar/definition.mjs +18 -0
  300. package/_mjs/MVar/definition.mjs.map +1 -0
  301. package/_mjs/MVar.mjs +4 -0
  302. package/_mjs/MVar.mjs.map +1 -0
  303. package/_mjs/Push/api.mjs +39 -36
  304. package/_mjs/Push/api.mjs.map +1 -1
  305. package/_mjs/Push/definition.mjs +5 -0
  306. package/_mjs/Push/definition.mjs.map +1 -1
  307. package/_mjs/Push/internal.mjs +4 -2
  308. package/_mjs/Push/internal.mjs.map +1 -1
  309. package/_mjs/Queue/api/dimapIO.mjs +11 -11
  310. package/_mjs/Queue/api/dimapIO.mjs.map +1 -1
  311. package/_mjs/Queue/api/filterInputIO.mjs +5 -5
  312. package/_mjs/Queue/api/filterInputIO.mjs.map +1 -1
  313. package/_mjs/Queue/api/filterOutputIO.mjs +8 -8
  314. package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -1
  315. package/_mjs/Queue/definition.mjs +1 -0
  316. package/_mjs/Queue/definition.mjs.map +1 -1
  317. package/_mjs/Queue/internal.mjs +2 -2
  318. package/_mjs/Queue/internal.mjs.map +1 -1
  319. package/_mjs/Queue/strategy.mjs +2 -2
  320. package/_mjs/Queue/strategy.mjs.map +1 -1
  321. package/_mjs/Ref/Derived.mjs +6 -3
  322. package/_mjs/Ref/Derived.mjs.map +1 -1
  323. package/_mjs/Ref/Synchronized/constructors.mjs +15 -7
  324. package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -1
  325. package/_mjs/Ref/Synchronized/definition.mjs +13 -10
  326. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  327. package/_mjs/Ref/definition.mjs +1 -1
  328. package/_mjs/Ref/definition.mjs.map +1 -1
  329. package/_mjs/Ref.mjs +0 -1
  330. package/_mjs/Ref.mjs.map +1 -1
  331. package/_mjs/RefSubject/Synchronized/api.mjs +1 -1
  332. package/_mjs/RefSubject/definition.mjs +10 -3
  333. package/_mjs/RefSubject/definition.mjs.map +1 -1
  334. package/_mjs/Reloadable/definition.mjs +2 -1
  335. package/_mjs/Reloadable/definition.mjs.map +1 -1
  336. package/_mjs/STM/api/atomically.mjs +47 -0
  337. package/_mjs/STM/api/atomically.mjs.map +1 -0
  338. package/_mjs/STM/api.mjs +61 -88
  339. package/_mjs/STM/api.mjs.map +1 -1
  340. package/_mjs/STM/definition.mjs +27 -17
  341. package/_mjs/STM/definition.mjs.map +1 -1
  342. package/_mjs/STM/driver.mjs +3 -3
  343. package/_mjs/STM/driver.mjs.map +1 -1
  344. package/_mjs/STM/internal/Entry.mjs +5 -2
  345. package/_mjs/STM/internal/Entry.mjs.map +1 -1
  346. package/_mjs/STM/internal/TryCommit.mjs +6 -2
  347. package/_mjs/STM/internal/TryCommit.mjs.map +1 -1
  348. package/_mjs/STM/internal/Versioned.mjs +3 -1
  349. package/_mjs/STM/internal/Versioned.mjs.map +1 -1
  350. package/_mjs/STM.mjs +1 -0
  351. package/_mjs/STM.mjs.map +1 -1
  352. package/_mjs/Schedule/definition.mjs +1 -0
  353. package/_mjs/Schedule/definition.mjs.map +1 -1
  354. package/_mjs/Scope/api.mjs +1 -2
  355. package/_mjs/Scope/api.mjs.map +1 -1
  356. package/_mjs/Scope/definition.mjs +4 -2
  357. package/_mjs/Scope/definition.mjs.map +1 -1
  358. package/_mjs/ScopedRef/api.mjs +2 -2
  359. package/_mjs/ScopedRef/api.mjs.map +1 -1
  360. package/_mjs/ScopedRef/definition.mjs +3 -1
  361. package/_mjs/ScopedRef/definition.mjs.map +1 -1
  362. package/_mjs/State/api.mjs +1 -1
  363. package/_mjs/State/api.mjs.map +1 -1
  364. package/_mjs/State/definition.mjs +4 -1
  365. package/_mjs/State/definition.mjs.map +1 -1
  366. package/_mjs/State/internal.mjs +5 -2
  367. package/_mjs/State/internal.mjs.map +1 -1
  368. package/_mjs/Stream/api.mjs +1 -1
  369. package/_mjs/Stream/definition.mjs +2 -1
  370. package/_mjs/Stream/definition.mjs.map +1 -1
  371. package/_mjs/Stream/internal/Handoff.mjs +40 -32
  372. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  373. package/_mjs/Stream/internal/SinkEndReason.mjs +6 -2
  374. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  375. package/_mjs/Subject/Atomic.mjs +4 -2
  376. package/_mjs/Subject/Atomic.mjs.map +1 -1
  377. package/_mjs/SubscriptionRef.mjs +1 -1
  378. package/_mjs/SupervisorPatch.mjs +3 -1
  379. package/_mjs/SupervisorPatch.mjs.map +1 -1
  380. package/_mjs/TExit/definition.mjs +25 -24
  381. package/_mjs/TExit/definition.mjs.map +1 -1
  382. package/_mjs/TFuture/constructors.mjs +1 -1
  383. package/_mjs/TReentrantLock/api.mjs +10 -9
  384. package/_mjs/TReentrantLock/api.mjs.map +1 -1
  385. package/_mjs/TRef/constructors.mjs +1 -1
  386. package/_mjs/TRef/definition.mjs +19 -20
  387. package/_mjs/TRef/definition.mjs.map +1 -1
  388. package/_mjs/TRef.mjs +0 -1
  389. package/_mjs/TRef.mjs.map +1 -1
  390. package/_mjs/TSemaphore/api.mjs +2 -2
  391. package/_mjs/TSemaphore/api.mjs.map +1 -1
  392. package/_mjs/TSemaphore/constructors.mjs +1 -1
  393. package/_mjs/internal/IsFatal.mjs +3 -1
  394. package/_mjs/internal/IsFatal.mjs.map +1 -1
  395. package/_src/Cached/definition.ts +6 -4
  396. package/_src/Cached/internal.ts +4 -4
  397. package/_src/Channel/api.ts +14 -15
  398. package/_src/Channel/definition.ts +37 -14
  399. package/_src/Channel/internal/ChannelExecutor.ts +14 -3
  400. package/_src/Channel/internal/MergeDecision.ts +11 -6
  401. package/_src/CountdownLatch.ts +1 -1
  402. package/_src/Differ/definition.ts +2 -4
  403. package/_src/Fiber/FiberRuntime.ts +54 -50
  404. package/_src/Fiber/definition.ts +15 -8
  405. package/_src/FiberRef/definition.ts +9 -4
  406. package/_src/FiberRefs/api.ts +1 -1
  407. package/_src/FiberRefs/definition.ts +1 -1
  408. package/_src/Future/api.ts +14 -5
  409. package/_src/Hub/api.ts +9 -7
  410. package/_src/Hub/definition.ts +30 -15
  411. package/_src/IO/api/interrupt.ts +72 -55
  412. package/_src/IO/api/onTermination.ts +8 -7
  413. package/_src/IO/api/sequenceT.ts +4 -6
  414. package/_src/IO/api.ts +23 -1
  415. package/_src/IO/definition.ts +36 -27
  416. package/_src/IO.ts +0 -1
  417. package/_src/Layer/MemoMap.ts +1 -1
  418. package/_src/Layer/api.ts +2 -2
  419. package/_src/Layer/definition.ts +18 -13
  420. package/_src/Logger/definition.ts +9 -4
  421. package/_src/MVar/api.ts +185 -0
  422. package/_src/MVar/definition.ts +45 -0
  423. package/_src/MVar.ts +4 -0
  424. package/_src/Push/api.ts +7 -4
  425. package/_src/Push/definition.ts +12 -3
  426. package/_src/Push/internal.ts +2 -2
  427. package/_src/Queue/api/dimapIO.ts +24 -13
  428. package/_src/Queue/api/filterInputIO.ts +9 -7
  429. package/_src/Queue/api/filterOutputIO.ts +9 -7
  430. package/_src/Queue/definition.ts +27 -18
  431. package/_src/Ref/Derived.ts +4 -1
  432. package/_src/Ref/Synchronized/constructors.ts +9 -0
  433. package/_src/Ref/Synchronized/definition.ts +5 -2
  434. package/_src/Ref/definition.ts +36 -25
  435. package/_src/Ref.ts +0 -1
  436. package/_src/RefSubject/definition.ts +19 -12
  437. package/_src/Reloadable/definition.ts +6 -1
  438. package/_src/STM/api/atomically.ts +43 -0
  439. package/_src/STM/api.ts +20 -38
  440. package/_src/STM/definition.ts +33 -20
  441. package/_src/STM/driver.ts +3 -3
  442. package/_src/STM/internal/Entry.ts +2 -2
  443. package/_src/STM/internal/TryCommit.ts +4 -4
  444. package/_src/STM/internal/Versioned.ts +1 -1
  445. package/_src/STM.ts +1 -0
  446. package/_src/Schedule/definition.ts +8 -3
  447. package/_src/Scope/definition.ts +2 -2
  448. package/_src/ScopedRef/definition.ts +1 -1
  449. package/_src/State/api.ts +1 -1
  450. package/_src/State/definition.ts +6 -3
  451. package/_src/State/internal.ts +8 -3
  452. package/_src/Stream/definition.ts +17 -5
  453. package/_src/Stream/internal/Handoff.ts +31 -24
  454. package/_src/Stream/internal/SinkEndReason.ts +2 -2
  455. package/_src/Subject/Atomic.ts +8 -4
  456. package/_src/SupervisorPatch.ts +1 -1
  457. package/_src/TExit/definition.ts +11 -12
  458. package/_src/TRef/definition.ts +18 -14
  459. package/_src/TRef.ts +0 -1
  460. package/_src/global.ts +4 -0
  461. package/_src/internal/IsFatal.ts +1 -1
  462. package/global.d.ts +4 -0
  463. package/internal/IsFatal.d.ts +1 -1
  464. package/package.json +2 -2
  465. package/IO/api/onExit.d.ts +0 -7
  466. package/Ref/symbols.d.ts +0 -30
  467. package/TRef/symbols.d.ts +0 -20
  468. package/_cjs/IO/api/onExit.cjs +0 -19
  469. package/_cjs/IO/api/onExit.cjs.map +0 -1
  470. package/_cjs/Ref/symbols.cjs +0 -37
  471. package/_cjs/Ref/symbols.cjs.map +0 -1
  472. package/_cjs/TRef/symbols.cjs +0 -27
  473. package/_cjs/TRef/symbols.cjs.map +0 -1
  474. package/_mjs/IO/api/onExit.mjs +0 -11
  475. package/_mjs/IO/api/onExit.mjs.map +0 -1
  476. package/_mjs/Ref/symbols.mjs +0 -25
  477. package/_mjs/Ref/symbols.mjs.map +0 -1
  478. package/_mjs/TRef/symbols.mjs +0 -17
  479. package/_mjs/TRef/symbols.mjs.map +0 -1
  480. package/_src/IO/api/onExit.ts +0 -11
  481. package/_src/Ref/symbols.ts +0 -29
  482. 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
@@ -29,7 +29,6 @@ export * from "./IO/api/fulfill.js";
29
29
  export * from "./IO/api/interrupt.js";
30
30
  export * from "./IO/api/memoize.js";
31
31
  export * from "./IO/api/once.js";
32
- export * from "./IO/api/onExit.js";
33
32
  export * from "./IO/api/onTermination.js";
34
33
  export * from "./IO/api/provideLayer.js";
35
34
  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.
package/Ref/Derived.d.ts CHANGED
@@ -4,9 +4,11 @@ import type { Atomic } from "./Atomic.js";
4
4
  import type { PRef } from "./definition.js";
5
5
  import { IO } from "@fncts/io/IO";
6
6
  import { RefInternal } from "./definition.js";
7
+ export declare const DerivedTypeId: unique symbol;
8
+ export type DerivedTypeId = typeof DerivedTypeId;
7
9
  export declare class Derived<EA, EB, A, B> extends RefInternal<never, never, EA, EB, A, B> {
8
10
  readonly use: <X>(f: <S>(value: Atomic<S>, getEither: (s: S) => Either<EB, B>, setEither: (a: A) => Either<EA, S>) => X) => X;
9
- readonly _tag = "Derived";
11
+ readonly [DerivedTypeId]: DerivedTypeId;
10
12
  constructor(use: <X>(f: <S>(value: Atomic<S>, getEither: (s: S) => Either<EB, B>, setEither: (a: A) => Either<EA, S>) => X) => X);
11
13
  match<EC, ED, C, D>(ea: (_: EA) => EC, eb: (_: EB) => ED, ca: (_: C) => Either<EC, A>, bd: (_: B) => Either<ED, D>): PRef<never, never, EC, ED, C, D>;
12
14
  matchAll<EC, ED, C, D>(ea: (_: EA) => EC, eb: (_: EB) => ED, ec: (_: EB) => EC, ca: (_: C) => (_: B) => Either<EC, A>, bd: (_: B) => Either<ED, D>): PRef<never, never, EC, ED, C, D>;