@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
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>;
@@ -1,6 +1,11 @@
1
+ import { Ref } from "@fncts/io/Ref/definition";
1
2
  import { Lazy } from "@fncts/base/data/function/definition";
2
3
  import { UIO } from "@fncts/io/IO/definition";
3
- import { Ref } from "@fncts/io/Ref/definition";
4
+ /**
5
+ * @tsplus static fncts.io.Ref.SynchronizedOps unsafeMake
6
+ * @tsplus location "@fncts/io/Ref/Synchronized/constructors"
7
+ */
8
+ export declare function unsafeMakeSynchronized<A>(a: A, __tsplusTrace?: string): Ref.Synchronized<A>;
4
9
  /**
5
10
  * @tsplus static fncts.io.Ref.SynchronizedOps make
6
11
  * @tsplus location "@fncts/io/Ref/Synchronized/constructors"
@@ -3,11 +3,13 @@ import { Either } from "@fncts/base/data/Either/definition";
3
3
  import type { PRef } from "../definition.js";
4
4
  import { IO } from "@fncts/io/IO";
5
5
  import { RefInternal } from "../definition.js";
6
+ export declare const SynchronizedTypeId: unique symbol;
7
+ export type SynchronizedTypeId = typeof SynchronizedTypeId;
6
8
  /**
7
9
  * @tsplus type fncts.io.Ref.Synchronized
8
10
  */
9
11
  export interface PSynchronized<RA, RB, EA, EB, A, B> extends PRef<RA, RB, EA, EB, A, B> {
10
- readonly _tag: "Synchronized";
12
+ readonly [SynchronizedTypeId]: SynchronizedTypeId;
11
13
  }
12
14
  /**
13
15
  * @tsplus type fncts.io.Ref.SynchronizedOps
@@ -26,7 +28,7 @@ export declare class PSynchronizedInternal<RA, RB, EA, EB, A, B> extends RefInte
26
28
  readonly semaphore: TSemaphore;
27
29
  readonly unsafeGet: IO<RB, EB, B>;
28
30
  readonly unsafeSet: (a: A) => IO<RA, EA, void>;
29
- readonly _tag = "Synchronized";
31
+ readonly [SynchronizedTypeId]: SynchronizedTypeId;
30
32
  constructor(semaphore: TSemaphore, unsafeGet: IO<RB, EB, B>, unsafeSet: (a: A) => IO<RA, EA, void>);
31
33
  get get(): IO<RB, EB, B>;
32
34
  set(a: A, __tsplusTrace?: string): IO<RA, EA, void>;
@@ -2,7 +2,8 @@ import { IO } from "@fncts/io/IO/definition";
2
2
  import { Either } from "@fncts/base/data/Either/definition";
3
3
  import type { Atomic as Atomic_ } from "./Atomic.js";
4
4
  import type * as Synchro from "./Synchronized/definition.js";
5
- import { _A, _B, _EA, _EB, _RA, _RB } from "./symbols.js";
5
+ export declare const RefVariance: unique symbol;
6
+ export type RefVariance = typeof RefVariance;
6
7
  export declare const RefTypeId: unique symbol;
7
8
  export type RefTypeId = typeof RefTypeId;
8
9
  /**
@@ -10,12 +11,14 @@ export type RefTypeId = typeof RefTypeId;
10
11
  */
11
12
  export interface PRef<RA, RB, EA, EB, A, B> {
12
13
  readonly [RefTypeId]: RefTypeId;
13
- readonly [_RA]: () => RA;
14
- readonly [_RB]: () => RB;
15
- readonly [_EA]: () => EA;
16
- readonly [_EB]: () => EB;
17
- readonly [_A]: (_: A) => void;
18
- readonly [_B]: () => B;
14
+ readonly [RefVariance]: {
15
+ readonly _RA: (_: never) => RA;
16
+ readonly _RB: (_: never) => RB;
17
+ readonly _EA: (_: never) => EA;
18
+ readonly _EB: (_: never) => EB;
19
+ readonly _A: (_: A) => void;
20
+ readonly _B: (_: never) => B;
21
+ };
19
22
  }
20
23
  export type Ref<A> = PRef<never, never, never, never, A, A>;
21
24
  export type ERef<E, A> = PRef<unknown, unknown, E, E, A, A>;
@@ -36,34 +39,42 @@ export interface RefOps {
36
39
  }
37
40
  export declare const Ref: RefOps;
38
41
  export interface ReadableRef<RB, EB, B> {
39
- readonly [_RB]: () => RB;
40
- readonly [_EB]: () => EB;
41
- readonly [_B]: () => B;
42
+ readonly [RefVariance]: {
43
+ readonly _RB: (_: never) => RB;
44
+ readonly _EB: (_: never) => EB;
45
+ readonly _B: (_: never) => B;
46
+ };
42
47
  readonly get: IO<RB, EB, B>;
43
48
  }
44
49
  export interface WritableRef<RA, EA, A> {
45
- readonly [_RA]: () => RA;
46
- readonly [_EA]: () => EA;
47
- readonly [_A]: (_: A) => void;
50
+ readonly [RefVariance]: {
51
+ readonly _RA: (_: never) => RA;
52
+ readonly _EA: (_: never) => EA;
53
+ readonly _A: (_: A) => void;
54
+ };
48
55
  set(a: A, __tsplusTrace?: string): IO<RA, EA, void>;
49
56
  }
50
57
  export interface ModifiableRef<RA, RB, EA, EB, A, B> {
51
- readonly [_RA]: () => RA;
52
- readonly [_RB]: () => RB;
53
- readonly [_EA]: () => EA;
54
- readonly [_EB]: () => EB;
55
- readonly [_A]: (_: A) => void;
56
- readonly [_B]: () => B;
58
+ readonly [RefVariance]: {
59
+ readonly _RA: (_: never) => RA;
60
+ readonly _RB: (_: never) => RB;
61
+ readonly _EA: (_: never) => EA;
62
+ readonly _EB: (_: never) => EB;
63
+ readonly _A: (_: A) => void;
64
+ readonly _B: (_: never) => B;
65
+ };
57
66
  modify<C>(f: (b: B) => readonly [C, A], __tsplusTrace?: string): IO<RA | RB, EA | EB, C>;
58
67
  }
59
68
  export declare abstract class RefInternal<RA, RB, EA, EB, A, B> implements PRef<RA, RB, EA, EB, A, B>, ReadableRef<RB, EB, B>, WritableRef<RA, EA, A>, ModifiableRef<RA, RB, EA, EB, A, B> {
60
69
  readonly [RefTypeId]: RefTypeId;
61
- [_RA]: () => RA;
62
- [_RB]: () => RB;
63
- [_EA]: () => EA;
64
- [_EB]: () => EB;
65
- [_A]: (_: A) => void;
66
- [_B]: () => B;
70
+ [RefVariance]: {
71
+ readonly _RA: (_: never) => RA;
72
+ readonly _RB: (_: never) => RB;
73
+ readonly _EA: (_: never) => EA;
74
+ readonly _EB: (_: never) => EB;
75
+ readonly _A: (_: A) => void;
76
+ readonly _B: (_: never) => B;
77
+ };
67
78
  /**
68
79
  * Folds over the error and value types of the `Ref`. This is a highly
69
80
  * polymorphic method that is capable of arbitrarily transforming the error
package/Ref.d.ts CHANGED
@@ -4,7 +4,6 @@ export * from "./Ref/constructors.js";
4
4
  export * from "./Ref/definition.js";
5
5
  export * from "./Ref/Derived.js";
6
6
  export * from "./Ref/DerivedAll.js";
7
- export * from "./Ref/symbols.js";
8
7
  export * from "./Ref/Synchronized.js";
9
8
  export * from "./Ref/Synchronized/api.js";
10
9
  export * from "./Ref/Synchronized/constructors.js";
@@ -1,4 +1,3 @@
1
- import { Ref } from "@fncts/io/Ref/definition";
2
1
  import { IO } from "@fncts/io/IO/definition";
3
2
  import { Scope } from "@fncts/io/Scope/definition";
4
3
  import { Cause } from "@fncts/base/data/Cause/definition";
@@ -6,11 +5,13 @@ import type { Emitter } from "../Push.js";
6
5
  import type { Push } from "../Push.js";
7
6
  import type { ModifiableRef, ReadableRef, WritableRef } from "../Ref.js";
8
7
  import type { SynchronizedRefSubject } from "@fncts/io/RefSubject/Synchronized/definition";
8
+ import { PushTypeId } from "../Push.js";
9
+ import { PushVariance } from "../Push.js";
10
+ import { RefVariance } from "../Ref.js";
9
11
  /**
10
12
  * @tsplus type fncts.io.Push.RefSubject
11
13
  */
12
14
  export interface RefSubject<out R, in out E, in A, out B> extends Push<R, E, B>, Emitter<R, E, A> {
13
- readonly _A: (_: A) => B;
14
15
  }
15
16
  /**
16
17
  * @tsplus type fncts.io.Push.RefSubjectOps
@@ -22,15 +23,20 @@ export declare namespace RefSubject {
22
23
  type Synchronized<R, E, A, B> = SynchronizedRefSubject<R, E, A, B>;
23
24
  }
24
25
  export declare abstract class RefSubjectInternal<R, E, A, B> implements ReadableRef<R, never, B>, WritableRef<R, never, A>, ModifiableRef<R, R, never, never, A, B>, Push<R, E, B>, Emitter<R, E, A> {
25
- [Ref._RA]: () => R;
26
- [Ref._RB]: () => R;
27
- [Ref._EA]: () => never;
28
- [Ref._EB]: () => never;
29
- [Ref._A]: (_: A) => void;
30
- [Ref._B]: () => B;
31
- _R: (_: never) => R;
32
- _E: (_: never) => E;
33
- _A: (_: A) => B;
26
+ readonly [PushTypeId]: PushTypeId;
27
+ [RefVariance]: {
28
+ readonly _RA: (_: never) => R;
29
+ readonly _RB: (_: never) => R;
30
+ readonly _EA: (_: never) => never;
31
+ readonly _EB: (_: never) => never;
32
+ readonly _A: (_: A) => void;
33
+ readonly _B: (_: never) => B;
34
+ };
35
+ [PushVariance]: {
36
+ readonly _R: (_: never) => R;
37
+ readonly _E: (_: never) => E;
38
+ readonly _A: (_: A) => B;
39
+ };
34
40
  abstract get get(): IO<R, never, B>;
35
41
  abstract set(value: A): IO<R, never, void>;
36
42
  abstract modify<C>(f: (b: B) => readonly [C, A], __tsplusTrace?: string): IO<R, never, C>;
@@ -1,6 +1,8 @@
1
1
  import { ScopedRef } from "@fncts/io/ScopedRef/definition";
2
2
  import { IO, UIO } from "@fncts/io/IO/definition";
3
3
  import { Tag } from "@fncts/base/data/Tag/definition";
4
+ export declare const ReloadableVariance: unique symbol;
5
+ export type ReloadableVariance = typeof ReloadableVariance;
4
6
  /**
5
7
  * @tsplus type fncts.io.Reloadable
6
8
  * @tsplus companion fncts.io.ReloadableOps
@@ -8,7 +10,9 @@ import { Tag } from "@fncts/base/data/Tag/definition";
8
10
  export declare class Reloadable<Service> {
9
11
  readonly scopedRef: ScopedRef<Service>;
10
12
  readonly reload: IO<never, unknown, void>;
11
- _Service: (_: never) => Service;
13
+ [ReloadableVariance]: {
14
+ readonly _Service: (_: never) => Service;
15
+ };
12
16
  constructor(scopedRef: ScopedRef<Service>, reload: IO<never, unknown, void>);
13
17
  get get(): UIO<Service>;
14
18
  get reloadFork(): UIO<void>;
@@ -0,0 +1,9 @@
1
+ import { STM } from "@fncts/io/STM/definition";
2
+ import { IO } from "@fncts/io/IO/definition";
3
+ import { Environment } from "@fncts/base/data/Environment/definition";
4
+ /**
5
+ * @tsplus static fncts.io.STMOps atomically
6
+ * @tsplus getter fncts.io.STM commit
7
+ * @tsplus location "@fncts/io/STM/api/atomically"
8
+ */
9
+ export declare function atomically<R, E, A>(stm: STM<R, E, A>, __tsplusTrace?: string): IO<R, E, A>;
package/STM/api.d.ts CHANGED
@@ -56,12 +56,6 @@ export declare function environmentWith<R, A>(f: (r: Environment<R>) => A, __tsp
56
56
  * @tsplus location "@fncts/io/STM/api"
57
57
  */
58
58
  export declare function environmentWithSTM<R0, R, E, A>(f: (r: Environment<R0>) => STM<R, E, A>, __tsplusTrace?: string): STM<R0 | R, E, A>;
59
- /**
60
- * @tsplus static fncts.io.STMOps atomically
61
- * @tsplus getter fncts.io.STM commit
62
- * @tsplus location "@fncts/io/STM/api"
63
- */
64
- export declare function atomically<R, E, A>(stm: STM<R, E, A>, __tsplusTrace?: string): IO<R, E, A>;
65
59
  /**
66
60
  * Returns an `STM` effect whose failure and success channels have been mapped by
67
61
  * the specified pair of functions, `f` and `g`.
@@ -372,3 +366,15 @@ export declare const unit: STM<never, never, void>;
372
366
  * @tsplus location "@fncts/io/STM/api"
373
367
  */
374
368
  export declare function zipWith<A, R1, E1, B, C>(that: STM<R1, E1, B>, f: (a: A, b: B) => C, __tsplusTrace?: string): <R, E>(self: STM<R, E, A>) => STM<R1 | R, E1 | E, C>;
369
+ /**
370
+ * @tsplus pipeable fncts.io.STM zipLeft
371
+ * @tsplus opipeable-operator fncts.io.STM <
372
+ * @tsplus location "@fncts/io/STM/api"
373
+ */
374
+ export declare function zipLeft<R1, E1, B>(that: STM<R1, E1, B>, __tsplusTrace?: string): <R, E, A>(self: STM<R, E, A>) => STM<R1 | R, E1 | E, A>;
375
+ /**
376
+ * @tsplus pipeable fncts.io.STM zipRight
377
+ * @tsplus pipeable-operator fncts.io.STM >
378
+ * @tsplus location "@fncts/io/STM/api"
379
+ */
380
+ export declare function zipRight<R1, E1, B>(that: STM<R1, E1, B>, __tsplusTrace?: string): <R, E, A>(self: STM<R, E, A>) => STM<R1 | R, E1 | E, B>;
@@ -2,6 +2,7 @@ import { FiberId } from "@fncts/base/data/FiberId/definition";
2
2
  import { Environment } from "@fncts/base/data/Environment/definition";
3
3
  import type { Journal } from "./internal/Journal.js";
4
4
  import type { _A, _E, _R } from "@fncts/base/types";
5
+ import { IOOpCode, IOTypeId, IOVariance } from "@fncts/io/IO/definition";
5
6
  export declare const enum STMTag {
6
7
  Effect = "Effect",
7
8
  OnFailure = "OnFailure",
@@ -11,6 +12,8 @@ export declare const enum STMTag {
11
12
  SucceedNow = "SucceedNow",
12
13
  ContramapEnvironment = "ContramapEnvironment"
13
14
  }
15
+ export declare const STMVariance: unique symbol;
16
+ export type STMVariance = typeof STMVariance;
14
17
  export declare const STMTypeId: unique symbol;
15
18
  export type STMTypeId = typeof STMTypeId;
16
19
  /**
@@ -18,10 +21,20 @@ export type STMTypeId = typeof STMTypeId;
18
21
  * @tsplus companion fncts.io.STMOps
19
22
  */
20
23
  export declare abstract class STM<R, E, A> {
21
- readonly _typeId: STMTypeId;
22
- readonly _R: () => R;
23
- readonly _E: () => E;
24
- readonly _A: () => A;
24
+ readonly [IOTypeId]: IOTypeId;
25
+ readonly ioOpCode = IOOpCode.Commit;
26
+ readonly trace?: string;
27
+ readonly [STMTypeId]: STMTypeId;
28
+ [IOVariance]: {
29
+ _R: () => R;
30
+ _E: () => E;
31
+ _A: () => A;
32
+ };
33
+ [STMVariance]: {
34
+ _R: () => R;
35
+ _E: () => E;
36
+ _A: () => A;
37
+ };
25
38
  }
26
39
  /**
27
40
  * @tsplus unify fncts.io.STM
@@ -34,43 +47,43 @@ export interface USTM<A> extends STM<never, never, A> {
34
47
  }
35
48
  export declare class Effect<R, E, A> extends STM<R, E, A> {
36
49
  readonly f: (journal: Journal, fiberId: FiberId, r: Environment<R>) => A;
37
- readonly _tag = STMTag.Effect;
50
+ readonly stmOpCode = STMTag.Effect;
38
51
  constructor(f: (journal: Journal, fiberId: FiberId, r: Environment<R>) => A);
39
52
  }
40
53
  export declare class OnFailure<R, E, A, E1> extends STM<R, E1, A> {
41
54
  readonly stm: STM<R, E, A>;
42
55
  readonly onFailure: (e: E) => STM<R, E1, A>;
43
- readonly _tag = STMTag.OnFailure;
56
+ readonly stmOpCode = STMTag.OnFailure;
44
57
  constructor(stm: STM<R, E, A>, onFailure: (e: E) => STM<R, E1, A>);
45
58
  apply(a: A): STM<R, E, A>;
46
59
  }
47
60
  export declare class OnRetry<R, E, A> extends STM<R, E, A> {
48
61
  readonly stm: STM<R, E, A>;
49
62
  readonly onRetry: STM<R, E, A>;
50
- readonly _tag = STMTag.OnRetry;
63
+ readonly stmOpCode = STMTag.OnRetry;
51
64
  constructor(stm: STM<R, E, A>, onRetry: STM<R, E, A>);
52
65
  apply(a: A): STM<R, E, A>;
53
66
  }
54
67
  export declare class OnSuccess<R, E, A, B> extends STM<R, E, B> {
55
68
  readonly stm: STM<R, E, A>;
56
69
  readonly apply: (a: A) => STM<R, E, B>;
57
- readonly _tag = STMTag.OnSuccess;
70
+ readonly stmOpCode = STMTag.OnSuccess;
58
71
  constructor(stm: STM<R, E, A>, apply: (a: A) => STM<R, E, B>);
59
72
  }
60
73
  export declare class Succeed<A> extends STM<never, never, A> {
61
74
  readonly a: () => A;
62
- readonly _tag = STMTag.Succeed;
75
+ readonly stmOpCode = STMTag.Succeed;
63
76
  constructor(a: () => A);
64
77
  }
65
78
  export declare class SucceedNow<A> extends STM<never, never, A> {
66
79
  readonly a: A;
67
- readonly _tag = STMTag.SucceedNow;
80
+ readonly stmOpCode = STMTag.SucceedNow;
68
81
  constructor(a: A);
69
82
  }
70
83
  export declare class ContramapEnvironment<R, E, A, R0> extends STM<R0, E, A> {
71
84
  readonly stm: STM<R, E, A>;
72
85
  readonly f: (_: Environment<R0>) => Environment<R>;
73
- readonly _tag = STMTag.ContramapEnvironment;
86
+ readonly stmOpCode = STMTag.ContramapEnvironment;
74
87
  constructor(stm: STM<R, E, A>, f: (_: Environment<R0>) => Environment<R>);
75
88
  }
76
89
  export declare function concrete<R, E, A>(_: STM<R, E, A>): asserts _ is Effect<R, E, A> | OnFailure<R, unknown, A, E> | OnSuccess<R, E, unknown, A> | OnRetry<R, E, A> | Succeed<A> | SucceedNow<A> | ContramapEnvironment<unknown, E, A, R>;
@@ -78,7 +91,7 @@ export declare const FailExceptionTypeId: unique symbol;
78
91
  export type FailExceptionTypeId = typeof FailExceptionTypeId;
79
92
  export declare class FailException<E> {
80
93
  readonly e: E;
81
- readonly _typeId: FailExceptionTypeId;
94
+ readonly [FailExceptionTypeId]: FailExceptionTypeId;
82
95
  constructor(e: E);
83
96
  }
84
97
  export declare function isFailException(u: unknown): u is FailException<unknown>;
@@ -86,7 +99,7 @@ export declare const HaltExceptionTypeId: unique symbol;
86
99
  export type HaltExceptionTypeId = typeof HaltExceptionTypeId;
87
100
  export declare class HaltException<E> {
88
101
  readonly e: E;
89
- readonly _typeId: HaltExceptionTypeId;
102
+ readonly [HaltExceptionTypeId]: HaltExceptionTypeId;
90
103
  constructor(e: E);
91
104
  }
92
105
  export declare function isHaltException(u: unknown): u is HaltException<unknown>;
@@ -94,13 +107,13 @@ export declare const InterruptExceptionTypeId: unique symbol;
94
107
  export type InterruptExceptionTypeId = typeof InterruptExceptionTypeId;
95
108
  export declare class InterruptException {
96
109
  readonly fiberId: FiberId;
97
- readonly _typeId: InterruptExceptionTypeId;
110
+ readonly [InterruptExceptionTypeId]: InterruptExceptionTypeId;
98
111
  constructor(fiberId: FiberId);
99
112
  }
100
113
  export declare function isInterruptException(u: unknown): u is InterruptException;
101
114
  export declare const RetryExceptionTypeId: unique symbol;
102
115
  export type RetryExceptionTypeId = typeof RetryExceptionTypeId;
103
116
  export declare class RetryException {
104
- readonly _typeId: RetryExceptionTypeId;
117
+ readonly [RetryExceptionTypeId]: RetryExceptionTypeId;
105
118
  }
106
119
  export declare function isRetryException(u: unknown): u is RetryException;
@@ -8,7 +8,7 @@ export type EntryTypeId = typeof EntryTypeId;
8
8
  */
9
9
  export declare class Entry {
10
10
  readonly use: <X>(f: <S>(entry: ConcreteEntry<S>) => X) => X;
11
- readonly _typeId: EntryTypeId;
11
+ readonly [EntryTypeId]: EntryTypeId;
12
12
  constructor(use: <X>(f: <S>(entry: ConcreteEntry<S>) => X) => X);
13
13
  }
14
14
  /**
@@ -24,7 +24,7 @@ export declare class ConcreteEntry<S> {
24
24
  protected newValue: S;
25
25
  readonly isNew: boolean;
26
26
  private _isChanged;
27
- readonly _typeId: ConcreteEntryTypeId;
27
+ readonly [ConcreteEntryTypeId]: ConcreteEntryTypeId;
28
28
  constructor(tref: Atomic<S>, expected: Versioned<S>, newValue: S, isNew: boolean, _isChanged: boolean);
29
29
  unsafeSet(value: unknown): void;
30
30
  unsafeGet<B>(): B;
@@ -9,13 +9,13 @@ export declare const enum TryCommitTag {
9
9
  }
10
10
  export declare class Done<E, A> {
11
11
  readonly exit: Exit<E, A>;
12
- readonly _typeId: TryCommitTypeId;
12
+ readonly [TryCommitTypeId]: TryCommitTypeId;
13
13
  readonly _tag = TryCommitTag.Done;
14
14
  constructor(exit: Exit<E, A>);
15
15
  }
16
16
  export declare class Suspend {
17
17
  readonly journal: Journal;
18
- readonly _typeId: TryCommitTypeId;
18
+ readonly [TryCommitTypeId]: TryCommitTypeId;
19
19
  readonly _tag = TryCommitTag.Suspend;
20
20
  constructor(journal: Journal);
21
21
  }
@@ -2,6 +2,6 @@ export declare const VersionedTypeId: unique symbol;
2
2
  export type VersionedTypeId = typeof VersionedTypeId;
3
3
  export declare class Versioned<A> {
4
4
  readonly value: A;
5
- readonly _typeId: VersionedTypeId;
5
+ readonly [VersionedTypeId]: VersionedTypeId;
6
6
  constructor(value: A);
7
7
  }
package/STM.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./STM/api.js";
2
2
  export * from "./STM/definition.js";
3
3
  export * from "./STM/driver.js";
4
+ export * from "./STM/api/atomically.js";
4
5
  export * from "./STM/api/core-api.js";
5
6
  export * from "./STM/api/core-constructors.js";
@@ -1,6 +1,8 @@
1
1
  import { IO } from "@fncts/io/IO/definition";
2
2
  import type { Decision } from "./Decision.js";
3
3
  import type { Driver as Driver_ } from "./Driver.js";
4
+ export declare const ScheduleVariance: unique symbol;
5
+ export type ScheduleVariance = typeof ScheduleVariance;
4
6
  /**
5
7
  * A `Schedule<Env, In, Out>` defines a recurring schedule, which consumes
6
8
  * values of type `In`, and which returns values of type `Out`.
@@ -32,9 +34,11 @@ import type { Driver as Driver_ } from "./Driver.js";
32
34
  * @tsplus companion fncts.io.ScheduleOps
33
35
  */
34
36
  export declare abstract class Schedule<Env, In, Out> {
35
- readonly _Env: () => Env;
36
- readonly _In: (_: In) => void;
37
- readonly _Out: () => Out;
37
+ [ScheduleVariance]: {
38
+ readonly _Env: (_: never) => Env;
39
+ readonly _In: (_: In) => void;
40
+ readonly _Out: (_: never) => Out;
41
+ };
38
42
  readonly _State: unknown;
39
43
  abstract readonly initial: this["_State"];
40
44
  abstract step(now: number, inp: In, state: this["_State"], __tsplusTrace?: string): IO<Env, never, readonly [this["_State"], Out, Decision]>;
@@ -9,7 +9,7 @@ export type ScopeTypeId = typeof ScopeTypeId;
9
9
  * @tsplus companion fncts.io.ScopeOps
10
10
  */
11
11
  export declare abstract class Scope {
12
- readonly _typeId: ScopeTypeId;
12
+ readonly [ScopeTypeId]: ScopeTypeId;
13
13
  abstract addFinalizerExit(finalizer: Finalizer): UIO<void>;
14
14
  abstract fork: UIO<Scope.Closeable>;
15
15
  }
@@ -7,7 +7,7 @@ export type ScopedRefTypeId = typeof ScopedRefTypeId;
7
7
  * @tsplus companion fncts.io.ScopedRefOps
8
8
  */
9
9
  export declare abstract class ScopedRef<A> {
10
- readonly _typeId: ScopedRefTypeId;
10
+ readonly [ScopedRefTypeId]: ScopedRefTypeId;
11
11
  abstract set<R, E>(acquire: IO<R | Scope, E, A>, __tsplusTrace?: string): IO<Exclude<R, Scope>, E, void>;
12
12
  abstract get: UIO<A>;
13
13
  }
package/State/api.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { State } from "./definition.js";
6
6
  * @tsplus getter fncts.io.State get
7
7
  * @tsplus location "@fncts/io/State/api"
8
8
  */
9
- export declare function get_<S>(self: State<S>, __tsplusTrace?: string): UIO<S>;
9
+ export declare function get<S>(self: State<S>, __tsplusTrace?: string): UIO<S>;
10
10
  /**
11
11
  * @tsplus static fncts.io.StateOps initial
12
12
  * @tsplus location "@fncts/io/State/api"
@@ -1,12 +1,15 @@
1
1
  import type { StateInternal } from "./internal.js";
2
+ import { StateVariance } from "./internal.js";
2
3
  import { StateTypeId } from "./internal.js";
3
4
  /**
4
5
  * @tsplus type fncts.io.State
5
6
  * @tsplus companion fncts.io.StateOps
6
7
  */
7
8
  export declare abstract class State<S> {
8
- readonly _A: () => S;
9
- readonly _typeId: StateTypeId;
9
+ readonly [StateTypeId]: StateTypeId;
10
+ [StateVariance]: {
11
+ readonly _S: (_: S) => S;
12
+ };
10
13
  }
11
14
  /**
12
15
  * @tsplus macro remove
@@ -1,9 +1,13 @@
1
1
  import { UIO } from "@fncts/io/IO/definition";
2
+ export declare const StateVariance: unique symbol;
3
+ export type StateVariance = typeof StateVariance;
2
4
  export declare const StateTypeId: unique symbol;
3
5
  export type StateTypeId = typeof StateTypeId;
4
6
  export declare abstract class StateInternal<S> {
5
- _A: () => S;
6
- readonly _typeId: StateTypeId;
7
+ readonly [StateTypeId]: StateTypeId;
8
+ [StateVariance]: {
9
+ readonly _S: (_: S) => S;
10
+ };
7
11
  abstract get: UIO<S>;
8
12
  abstract set(s: S, __tsplusTrace?: string): UIO<void>;
9
13
  abstract update(f: (s: S) => S, __tsplusTrace?: string): UIO<void>;
@@ -1,6 +1,7 @@
1
1
  import { Channel } from "@fncts/io/Channel";
2
2
  import { Conc } from "@fncts/base/collection/immutable/Conc";
3
- import type { _A, _E, _R } from "@fncts/base/types";
3
+ export declare const StreamVariance: unique symbol;
4
+ export type StreamVariance = typeof StreamVariance;
4
5
  export declare const StreamTypeId: unique symbol;
5
6
  export type StreamTypeId = typeof StreamTypeId;
6
7
  /**
@@ -26,13 +27,33 @@ export type StreamTypeId = typeof StreamTypeId;
26
27
  export declare class Stream<R, E, A> {
27
28
  readonly channel: Channel<R, unknown, unknown, unknown, E, Conc<A>, unknown>;
28
29
  readonly [StreamTypeId]: StreamTypeId;
29
- _R: () => R;
30
- _E: () => E;
31
- _A: () => A;
30
+ [StreamVariance]: {
31
+ readonly _R: (_: never) => R;
32
+ readonly _E: (_: never) => E;
33
+ readonly _A: (_: never) => A;
34
+ };
32
35
  constructor(channel: Channel<R, unknown, unknown, unknown, E, Conc<A>, unknown>);
33
36
  }
34
37
  /**
35
38
  * @tsplus unify fncts.io.Stream
36
39
  */
37
- export declare function unifyStream<X extends Stream<any, any, any>>(_: X): Stream<_R<X>, _E<X>, _A<X>>;
40
+ export declare function unifyStream<X extends Stream<any, any, any>>(_: X): Stream<[
41
+ X
42
+ ] extends [{
43
+ [StreamVariance]: {
44
+ _R: (_: never) => infer R;
45
+ };
46
+ }] ? R : never, [
47
+ X
48
+ ] extends [{
49
+ [StreamVariance]: {
50
+ _E: (_: never) => infer E;
51
+ };
52
+ }] ? E : never, [
53
+ X
54
+ ] extends [{
55
+ [StreamVariance]: {
56
+ _A: (_: never) => infer A;
57
+ };
58
+ }] ? A : never>;
38
59
  export declare const DEFAULT_CHUNK_SIZE = 4096;