@fncts/io 0.0.10 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (439) hide show
  1. package/Cached/api.d.ts +2 -3
  2. package/Channel/api/interruptWhen.d.ts +1 -1
  3. package/Channel/api/mapOutIOC.d.ts +1 -1
  4. package/Channel/api/mergeAll.d.ts +1 -1
  5. package/Channel/api/mergeAllUnboundedWith.d.ts +1 -1
  6. package/Channel/api/mergeAllWith.d.ts +1 -1
  7. package/Channel/api/mergeMap.d.ts +1 -1
  8. package/Channel/api/mergeWith.d.ts +1 -1
  9. package/Channel/api/runScoped.d.ts +1 -2
  10. package/Channel/api/toPull.d.ts +1 -2
  11. package/Channel/api/zipC.d.ts +3 -3
  12. package/Channel/api.d.ts +48 -49
  13. package/Channel/core-api.d.ts +10 -10
  14. package/Channel/definition.d.ts +12 -12
  15. package/Channel/internal/MergeDecision.d.ts +1 -1
  16. package/Channel/internal/SingleProducerAsyncInput.d.ts +1 -1
  17. package/Clock/api.d.ts +1 -1
  18. package/Fiber/FiberContext.d.ts +3 -3
  19. package/Fiber/api/awaitAll.d.ts +1 -1
  20. package/Fiber/api/evalOnIO.d.ts +1 -1
  21. package/Fiber/api/joinAll.d.ts +1 -1
  22. package/Fiber/definition.d.ts +1 -1
  23. package/FiberRef/api/locallyScoped.d.ts +1 -2
  24. package/FiberRef/api/locallyScopedWith.d.ts +1 -2
  25. package/FiberRef/constructors.d.ts +1 -2
  26. package/FiberRef/unsafe.d.ts +6 -0
  27. package/Future/api.d.ts +1 -1
  28. package/Future/constructors.d.ts +1 -1
  29. package/Hub/api.d.ts +6 -7
  30. package/Hub/definition.d.ts +6 -7
  31. package/Hub/internal.d.ts +0 -1
  32. package/IO/api/acquireRelease.d.ts +1 -2
  33. package/IO/api/acquireReleaseExit.d.ts +1 -2
  34. package/IO/api/acquireReleaseInterruptible.d.ts +1 -2
  35. package/IO/api/acquireReleaseInterruptibleExit.d.ts +1 -2
  36. package/IO/api/addFinalizer.d.ts +1 -2
  37. package/IO/api/addFinalizerExit.d.ts +1 -2
  38. package/IO/api/bracket.d.ts +1 -1
  39. package/IO/api/bracketExit.d.ts +1 -1
  40. package/IO/api/clockWith.d.ts +1 -1
  41. package/IO/api/concurrentFinalizers.d.ts +1 -2
  42. package/IO/api/consoleWith.d.ts +1 -1
  43. package/IO/api/core-scope.d.ts +1 -1
  44. package/IO/api/ensuringChildren.d.ts +1 -1
  45. package/IO/api/environment.d.ts +8 -10
  46. package/IO/api/forkScoped.d.ts +1 -2
  47. package/IO/api/interrupt.d.ts +3 -3
  48. package/IO/api/onExit.d.ts +1 -1
  49. package/IO/api/onTermination.d.ts +1 -1
  50. package/IO/api/provideSomeLayer.d.ts +1 -1
  51. package/IO/api/race.d.ts +1 -1
  52. package/IO/api/raceFirst.d.ts +1 -1
  53. package/IO/api/randomWith.d.ts +1 -1
  54. package/IO/api/repeat.d.ts +3 -3
  55. package/IO/api/retry.d.ts +3 -3
  56. package/IO/api/schedule.d.ts +2 -2
  57. package/IO/api/scope.d.ts +1 -2
  58. package/IO/api/scopeWith.d.ts +1 -2
  59. package/IO/api/scoped.d.ts +2 -3
  60. package/IO/api/sequenceT.d.ts +3 -3
  61. package/IO/api/stateful.d.ts +1 -2
  62. package/IO/api/withEarlyRelease.d.ts +1 -2
  63. package/IO/api/withFinalizer.d.ts +1 -2
  64. package/IO/api/withFinalizerExit.d.ts +1 -2
  65. package/IO/api/zipC.d.ts +2 -2
  66. package/IO/api.d.ts +50 -50
  67. package/IO/definition.d.ts +28 -24
  68. package/IO/runtime.d.ts +23 -10
  69. package/IOEnv/definition.d.ts +2 -3
  70. package/IOEnv/live.d.ts +1 -1
  71. package/IOSpec.d.ts +1 -2
  72. package/Layer/MemoMap.d.ts +2 -3
  73. package/Layer/api.d.ts +30 -32
  74. package/Layer/definition.d.ts +7 -8
  75. package/Queue/api/dimapIO.d.ts +3 -3
  76. package/Queue/api/filterInputIO.d.ts +4 -4
  77. package/Queue/api/filterOutputIO.d.ts +6 -6
  78. package/Queue/api/zipWithIO.d.ts +9 -9
  79. package/Queue/definition.d.ts +7 -7
  80. package/Queue/internal.d.ts +1 -1
  81. package/Random/api.d.ts +4 -4
  82. package/Random/live.d.ts +1 -1
  83. package/Ref/Atomic/Atomic.d.ts +3 -3
  84. package/Ref/Derived.d.ts +3 -3
  85. package/Ref/DerivedAll.d.ts +3 -3
  86. package/Ref/Synchronized/api.d.ts +15 -15
  87. package/Ref/Synchronized/definition.d.ts +2 -2
  88. package/Ref/api/get.d.ts +1 -1
  89. package/Ref/api/modify.d.ts +9 -9
  90. package/Ref/api/set.d.ts +1 -1
  91. package/Ref/definition.d.ts +13 -13
  92. package/STM/api/core-api.d.ts +4 -4
  93. package/STM/api/core-constructors.d.ts +7 -7
  94. package/STM/api.d.ts +27 -39
  95. package/STM/definition.d.ts +9 -8
  96. package/STM/driver.d.ts +1 -1
  97. package/STM/internal/Journal.d.ts +4 -3
  98. package/Schedule/Decision.d.ts +10 -4
  99. package/Schedule/Driver.d.ts +3 -3
  100. package/Schedule/api.d.ts +55 -43
  101. package/Schedule/definition.d.ts +1 -1
  102. package/Scope/Finalizer/definition.d.ts +2 -2
  103. package/Scope/ReleaseMap/api.d.ts +1 -1
  104. package/Scope/ReleaseMap/definition.d.ts +1 -1
  105. package/Scope/api.d.ts +3 -4
  106. package/ScopedRef/api.d.ts +1 -2
  107. package/ScopedRef/definition.d.ts +1 -2
  108. package/Sink/api.d.ts +255 -75
  109. package/State/api.d.ts +1 -2
  110. package/Stream/api/zipAllWith.d.ts +1 -1
  111. package/Stream/api/zipWith.d.ts +1 -1
  112. package/Stream/api/zipWithChunks.d.ts +1 -1
  113. package/Stream/api.d.ts +91 -93
  114. package/Stream/definition.d.ts +3 -3
  115. package/Stream/internal/Take.d.ts +1 -1
  116. package/Supervisor/constructors.d.ts +2 -2
  117. package/TFuture/api.d.ts +1 -1
  118. package/TFuture/definition.d.ts +1 -1
  119. package/TReentrantLock/api.d.ts +2 -3
  120. package/TRef/api.d.ts +11 -11
  121. package/TRef/constructors.d.ts +2 -2
  122. package/TSemaphore/api.d.ts +2 -2
  123. package/TSemaphore/definition.d.ts +1 -1
  124. package/_cjs/Cached/api.cjs.map +1 -1
  125. package/_cjs/Channel/api/mapOutIOC.cjs +1 -1
  126. package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
  127. package/_cjs/Channel/api/mergeAllWith.cjs +3 -3
  128. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  129. package/_cjs/Channel/api.cjs.map +1 -1
  130. package/_cjs/Channel/definition.cjs.map +1 -1
  131. package/_cjs/Clock/live.cjs.map +1 -1
  132. package/_cjs/Fiber/FiberContext.cjs +5 -7
  133. package/_cjs/Fiber/FiberContext.cjs.map +1 -1
  134. package/_cjs/FiberRef/unsafe.cjs +9 -1
  135. package/_cjs/FiberRef/unsafe.cjs.map +1 -1
  136. package/_cjs/Future/api.cjs.map +1 -1
  137. package/_cjs/Hub/api.cjs +1 -1
  138. package/_cjs/Hub/api.cjs.map +1 -1
  139. package/_cjs/Hub/internal.cjs +4 -12
  140. package/_cjs/Hub/internal.cjs.map +1 -1
  141. package/_cjs/IO/api/addFinalizerExit.cjs +4 -8
  142. package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
  143. package/_cjs/IO/api/ensuringChildren.cjs +1 -1
  144. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
  145. package/_cjs/IO/api/environment.cjs +2 -3
  146. package/_cjs/IO/api/environment.cjs.map +1 -1
  147. package/_cjs/IO/api/interrupt.cjs +1 -1
  148. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  149. package/_cjs/IO/api/memoize.cjs +4 -8
  150. package/_cjs/IO/api/memoize.cjs.map +1 -1
  151. package/_cjs/IO/api/provideSomeLayer.cjs +1 -2
  152. package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
  153. package/_cjs/IO/api/scope.cjs +1 -1
  154. package/_cjs/IO/api/scope.cjs.map +1 -1
  155. package/_cjs/IO/api/scoped.cjs.map +1 -1
  156. package/_cjs/IO/api/withChildren.cjs +1 -1
  157. package/_cjs/IO/api/withChildren.cjs.map +1 -1
  158. package/_cjs/IO/api.cjs +1 -1
  159. package/_cjs/IO/api.cjs.map +1 -1
  160. package/_cjs/IO/definition.cjs +5 -8
  161. package/_cjs/IO/definition.cjs.map +1 -1
  162. package/_cjs/IO/runtime.cjs +69 -21
  163. package/_cjs/IO/runtime.cjs.map +1 -1
  164. package/_cjs/Layer/MemoMap.cjs +22 -38
  165. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  166. package/_cjs/Layer/api.cjs +6 -4
  167. package/_cjs/Layer/api.cjs.map +1 -1
  168. package/_cjs/Layer/definition.cjs.map +1 -1
  169. package/_cjs/Queue/internal.cjs +2 -2
  170. package/_cjs/Queue/internal.cjs.map +1 -1
  171. package/_cjs/Queue/strategy.cjs +1 -5
  172. package/_cjs/Queue/strategy.cjs.map +1 -1
  173. package/_cjs/Ref/Atomic/Atomic.cjs.map +1 -1
  174. package/_cjs/Ref/Derived.cjs.map +1 -1
  175. package/_cjs/Ref/DerivedAll.cjs.map +1 -1
  176. package/_cjs/Ref/Synchronized/constructors.cjs +7 -11
  177. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
  178. package/_cjs/STM/api/core-constructors.cjs.map +1 -1
  179. package/_cjs/STM/api.cjs +59 -78
  180. package/_cjs/STM/api.cjs.map +1 -1
  181. package/_cjs/STM/definition.cjs.map +1 -1
  182. package/_cjs/STM/driver.cjs +7 -5
  183. package/_cjs/STM/driver.cjs.map +1 -1
  184. package/_cjs/STM/internal/Journal.cjs +20 -22
  185. package/_cjs/STM/internal/Journal.cjs.map +1 -1
  186. package/_cjs/Schedule/Decision.cjs +17 -0
  187. package/_cjs/Schedule/Decision.cjs.map +1 -1
  188. package/_cjs/Schedule/api/driver.cjs +22 -21
  189. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  190. package/_cjs/Schedule/api.cjs +91 -66
  191. package/_cjs/Schedule/api.cjs.map +1 -1
  192. package/_cjs/Scope/Finalizer/definition.cjs +4 -6
  193. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  194. package/_cjs/Scope/ReleaseMap/definition.cjs +2 -4
  195. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  196. package/_cjs/Scope/api.cjs +2 -12
  197. package/_cjs/Scope/api.cjs.map +1 -1
  198. package/_cjs/ScopedRef/api.cjs +14 -22
  199. package/_cjs/ScopedRef/api.cjs.map +1 -1
  200. package/_cjs/Sink/api.cjs +424 -131
  201. package/_cjs/Sink/api.cjs.map +1 -1
  202. package/_cjs/Stream/api.cjs +94 -94
  203. package/_cjs/Stream/api.cjs.map +1 -1
  204. package/_cjs/Supervisor/constructors.cjs +14 -8
  205. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  206. package/_cjs/TFuture/definition.cjs +2 -4
  207. package/_cjs/TFuture/definition.cjs.map +1 -1
  208. package/_cjs/TSemaphore/api.cjs +7 -7
  209. package/_cjs/TSemaphore/api.cjs.map +1 -1
  210. package/_cjs/TSemaphore/definition.cjs +2 -4
  211. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  212. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +38 -0
  213. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -0
  214. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +38 -0
  215. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -0
  216. package/_cjs/internal/Scheduler.cjs +64 -14
  217. package/_cjs/internal/Scheduler.cjs.map +1 -1
  218. package/_mjs/Cached/api.mjs.map +1 -1
  219. package/_mjs/Channel/api/mapOutIOC.mjs +1 -1
  220. package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
  221. package/_mjs/Channel/api/mergeAllWith.mjs +3 -3
  222. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
  223. package/_mjs/Channel/api.mjs.map +1 -1
  224. package/_mjs/Channel/definition.mjs.map +1 -1
  225. package/_mjs/Clock/live.mjs.map +1 -1
  226. package/_mjs/Fiber/FiberContext.mjs +5 -6
  227. package/_mjs/Fiber/FiberContext.mjs.map +1 -1
  228. package/_mjs/FiberRef/unsafe.mjs +6 -0
  229. package/_mjs/FiberRef/unsafe.mjs.map +1 -1
  230. package/_mjs/Future/api.mjs.map +1 -1
  231. package/_mjs/Hub/api.mjs +1 -1
  232. package/_mjs/Hub/api.mjs.map +1 -1
  233. package/_mjs/Hub/internal.mjs +4 -12
  234. package/_mjs/Hub/internal.mjs.map +1 -1
  235. package/_mjs/IO/api/addFinalizerExit.mjs +4 -8
  236. package/_mjs/IO/api/addFinalizerExit.mjs.map +1 -1
  237. package/_mjs/IO/api/ensuringChildren.mjs +1 -1
  238. package/_mjs/IO/api/ensuringChildren.mjs.map +1 -1
  239. package/_mjs/IO/api/environment.mjs +2 -3
  240. package/_mjs/IO/api/environment.mjs.map +1 -1
  241. package/_mjs/IO/api/interrupt.mjs +1 -1
  242. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  243. package/_mjs/IO/api/memoize.mjs +4 -8
  244. package/_mjs/IO/api/memoize.mjs.map +1 -1
  245. package/_mjs/IO/api/provideSomeLayer.mjs +1 -2
  246. package/_mjs/IO/api/provideSomeLayer.mjs.map +1 -1
  247. package/_mjs/IO/api/scope.mjs +1 -1
  248. package/_mjs/IO/api/scope.mjs.map +1 -1
  249. package/_mjs/IO/api/scoped.mjs.map +1 -1
  250. package/_mjs/IO/api/withChildren.mjs +1 -1
  251. package/_mjs/IO/api/withChildren.mjs.map +1 -1
  252. package/_mjs/IO/api.mjs +1 -1
  253. package/_mjs/IO/api.mjs.map +1 -1
  254. package/_mjs/IO/definition.mjs +3 -5
  255. package/_mjs/IO/definition.mjs.map +1 -1
  256. package/_mjs/IO/runtime.mjs +61 -18
  257. package/_mjs/IO/runtime.mjs.map +1 -1
  258. package/_mjs/Layer/MemoMap.mjs +22 -38
  259. package/_mjs/Layer/MemoMap.mjs.map +1 -1
  260. package/_mjs/Layer/api.mjs +5 -4
  261. package/_mjs/Layer/api.mjs.map +1 -1
  262. package/_mjs/Layer/definition.mjs.map +1 -1
  263. package/_mjs/Queue/internal.mjs +2 -2
  264. package/_mjs/Queue/internal.mjs.map +1 -1
  265. package/_mjs/Queue/strategy.mjs +1 -5
  266. package/_mjs/Queue/strategy.mjs.map +1 -1
  267. package/_mjs/Ref/Atomic/Atomic.mjs.map +1 -1
  268. package/_mjs/Ref/Derived.mjs.map +1 -1
  269. package/_mjs/Ref/DerivedAll.mjs.map +1 -1
  270. package/_mjs/Ref/Synchronized/constructors.mjs +7 -11
  271. package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -1
  272. package/_mjs/STM/api/core-constructors.mjs.map +1 -1
  273. package/_mjs/STM/api.mjs +52 -72
  274. package/_mjs/STM/api.mjs.map +1 -1
  275. package/_mjs/STM/definition.mjs.map +1 -1
  276. package/_mjs/STM/driver.mjs +6 -5
  277. package/_mjs/STM/driver.mjs.map +1 -1
  278. package/_mjs/STM/internal/Journal.mjs +20 -21
  279. package/_mjs/STM/internal/Journal.mjs.map +1 -1
  280. package/_mjs/Schedule/Decision.mjs +9 -0
  281. package/_mjs/Schedule/Decision.mjs.map +1 -1
  282. package/_mjs/Schedule/api/driver.mjs +20 -20
  283. package/_mjs/Schedule/api/driver.mjs.map +1 -1
  284. package/_mjs/Schedule/api.mjs +84 -63
  285. package/_mjs/Schedule/api.mjs.map +1 -1
  286. package/_mjs/Scope/Finalizer/definition.mjs +4 -5
  287. package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
  288. package/_mjs/Scope/ReleaseMap/definition.mjs +2 -3
  289. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  290. package/_mjs/Scope/api.mjs +2 -12
  291. package/_mjs/Scope/api.mjs.map +1 -1
  292. package/_mjs/ScopedRef/api.mjs +14 -22
  293. package/_mjs/ScopedRef/api.mjs.map +1 -1
  294. package/_mjs/Sink/api.mjs +414 -129
  295. package/_mjs/Sink/api.mjs.map +1 -1
  296. package/_mjs/Stream/api.mjs +94 -94
  297. package/_mjs/Stream/api.mjs.map +1 -1
  298. package/_mjs/Supervisor/constructors.mjs +9 -6
  299. package/_mjs/Supervisor/constructors.mjs.map +1 -1
  300. package/_mjs/TFuture/definition.mjs +2 -3
  301. package/_mjs/TFuture/definition.mjs.map +1 -1
  302. package/_mjs/TSemaphore/api.mjs +4 -4
  303. package/_mjs/TSemaphore/api.mjs.map +1 -1
  304. package/_mjs/TSemaphore/definition.mjs +2 -3
  305. package/_mjs/TSemaphore/definition.mjs.map +1 -1
  306. package/_mjs/collection/immutable/Conc/dropUntilIO.mjs +26 -0
  307. package/_mjs/collection/immutable/Conc/dropUntilIO.mjs.map +1 -0
  308. package/_mjs/collection/immutable/Conc/dropWhileIO.mjs +26 -0
  309. package/_mjs/collection/immutable/Conc/dropWhileIO.mjs.map +1 -0
  310. package/_mjs/internal/Scheduler.mjs +62 -15
  311. package/_mjs/internal/Scheduler.mjs.map +1 -1
  312. package/_src/Cached/api.ts +3 -3
  313. package/_src/Channel/api/interruptWhen.ts +1 -1
  314. package/_src/Channel/api/mapOutIOC.ts +2 -2
  315. package/_src/Channel/api/mergeAll.ts +1 -1
  316. package/_src/Channel/api/mergeAllUnboundedWith.ts +1 -1
  317. package/_src/Channel/api/mergeAllWith.ts +3 -3
  318. package/_src/Channel/api/mergeMap.ts +1 -1
  319. package/_src/Channel/api/mergeWith.ts +9 -9
  320. package/_src/Channel/api/runScoped.ts +1 -1
  321. package/_src/Channel/api/toPull.ts +1 -1
  322. package/_src/Channel/api/zipC.ts +3 -3
  323. package/_src/Channel/api.ts +69 -69
  324. package/_src/Channel/core-api.ts +11 -11
  325. package/_src/Channel/definition.ts +12 -12
  326. package/_src/Channel/internal/MergeDecision.ts +1 -1
  327. package/_src/Clock/live.ts +1 -1
  328. package/_src/Fiber/FiberContext.ts +10 -8
  329. package/_src/Fiber/api/awaitAll.ts +1 -1
  330. package/_src/Fiber/api/evalOnIO.ts +1 -1
  331. package/_src/Fiber/api/joinAll.ts +1 -1
  332. package/_src/Fiber/definition.ts +1 -1
  333. package/_src/FiberRef/api/locallyScoped.ts +1 -1
  334. package/_src/FiberRef/api/locallyScopedWith.ts +1 -1
  335. package/_src/FiberRef/constructors.ts +2 -2
  336. package/_src/FiberRef/unsafe.ts +7 -0
  337. package/_src/Future/api.ts +3 -3
  338. package/_src/Future/constructors.ts +1 -1
  339. package/_src/Hub/api.ts +11 -11
  340. package/_src/Hub/definition.ts +6 -6
  341. package/_src/Hub/internal.ts +15 -15
  342. package/_src/IO/api/acquireRelease.ts +1 -1
  343. package/_src/IO/api/acquireReleaseExit.ts +1 -1
  344. package/_src/IO/api/acquireReleaseInterruptible.ts +1 -1
  345. package/_src/IO/api/acquireReleaseInterruptibleExit.ts +1 -1
  346. package/_src/IO/api/addFinalizer.ts +1 -1
  347. package/_src/IO/api/addFinalizerExit.ts +5 -7
  348. package/_src/IO/api/bracket.ts +1 -1
  349. package/_src/IO/api/bracketExit.ts +1 -1
  350. package/_src/IO/api/concurrentFinalizers.ts +1 -1
  351. package/_src/IO/api/core-scope.ts +1 -1
  352. package/_src/IO/api/ensuringChildren.ts +2 -2
  353. package/_src/IO/api/environment.ts +9 -11
  354. package/_src/IO/api/forkScoped.ts +1 -1
  355. package/_src/IO/api/interrupt.ts +3 -3
  356. package/_src/IO/api/memoize.ts +3 -3
  357. package/_src/IO/api/onExit.ts +1 -1
  358. package/_src/IO/api/onTermination.ts +1 -1
  359. package/_src/IO/api/provideSomeLayer.ts +1 -2
  360. package/_src/IO/api/race.ts +1 -1
  361. package/_src/IO/api/raceFirst.ts +1 -1
  362. package/_src/IO/api/repeat.ts +4 -4
  363. package/_src/IO/api/retry.ts +4 -4
  364. package/_src/IO/api/schedule.ts +3 -3
  365. package/_src/IO/api/scope.ts +1 -1
  366. package/_src/IO/api/scopeWith.ts +1 -1
  367. package/_src/IO/api/scoped.ts +2 -2
  368. package/_src/IO/api/sequenceT.ts +1 -1
  369. package/_src/IO/api/stateful.ts +1 -1
  370. package/_src/IO/api/withChildren.ts +1 -1
  371. package/_src/IO/api/withEarlyRelease.ts +1 -1
  372. package/_src/IO/api/withFinalizer.ts +1 -1
  373. package/_src/IO/api/withFinalizerExit.ts +1 -1
  374. package/_src/IO/api/zipC.ts +2 -2
  375. package/_src/IO/api.ts +48 -48
  376. package/_src/IO/definition.ts +29 -24
  377. package/_src/IO/runtime.ts +66 -12
  378. package/_src/IOEnv/definition.ts +1 -1
  379. package/_src/Layer/MemoMap.ts +19 -19
  380. package/_src/Layer/api.ts +38 -38
  381. package/_src/Layer/definition.ts +5 -5
  382. package/_src/Queue/api/dimapIO.ts +10 -10
  383. package/_src/Queue/api/filterInputIO.ts +4 -4
  384. package/_src/Queue/api/filterOutputIO.ts +6 -6
  385. package/_src/Queue/api/zipWithIO.ts +10 -10
  386. package/_src/Queue/definition.ts +7 -7
  387. package/_src/Queue/internal.ts +7 -7
  388. package/_src/Queue/strategy.ts +4 -4
  389. package/_src/Random/api.ts +1 -1
  390. package/_src/Ref/Atomic/Atomic.ts +3 -3
  391. package/_src/Ref/Derived.ts +3 -3
  392. package/_src/Ref/DerivedAll.ts +3 -3
  393. package/_src/Ref/Synchronized/api.ts +15 -15
  394. package/_src/Ref/Synchronized/constructors.ts +4 -4
  395. package/_src/Ref/Synchronized/definition.ts +2 -2
  396. package/_src/Ref/api/get.ts +2 -2
  397. package/_src/Ref/api/modify.ts +9 -9
  398. package/_src/Ref/api/set.ts +1 -1
  399. package/_src/Ref/definition.ts +13 -13
  400. package/_src/STM/api/core-api.ts +6 -6
  401. package/_src/STM/api/core-constructors.ts +7 -7
  402. package/_src/STM/api.ts +58 -89
  403. package/_src/STM/definition.ts +6 -6
  404. package/_src/STM/driver.ts +3 -3
  405. package/_src/STM/internal/Journal.ts +25 -16
  406. package/_src/Schedule/Decision.ts +10 -3
  407. package/_src/Schedule/Driver.ts +2 -2
  408. package/_src/Schedule/api/driver.ts +6 -6
  409. package/_src/Schedule/api.ts +97 -77
  410. package/_src/Schedule/definition.ts +1 -1
  411. package/_src/Scope/Finalizer/definition.ts +2 -2
  412. package/_src/Scope/ReleaseMap/api.ts +1 -1
  413. package/_src/Scope/ReleaseMap/definition.ts +1 -1
  414. package/_src/Scope/api.ts +11 -11
  415. package/_src/ScopedRef/api.ts +12 -17
  416. package/_src/ScopedRef/definition.ts +1 -1
  417. package/_src/Sink/api.ts +441 -86
  418. package/_src/State/api.ts +1 -1
  419. package/_src/Stream/api/zipAllWith.ts +2 -2
  420. package/_src/Stream/api/zipWith.ts +1 -1
  421. package/_src/Stream/api/zipWithChunks.ts +2 -2
  422. package/_src/Stream/api.ts +150 -149
  423. package/_src/Stream/definition.ts +3 -3
  424. package/_src/Stream/internal/Take.ts +1 -1
  425. package/_src/Supervisor/constructors.ts +7 -3
  426. package/_src/TFuture/api.ts +1 -1
  427. package/_src/TFuture/definition.ts +1 -1
  428. package/_src/TReentrantLock/api.ts +2 -2
  429. package/_src/TRef/api.ts +11 -11
  430. package/_src/TRef/constructors.ts +2 -2
  431. package/_src/TSemaphore/api.ts +2 -2
  432. package/_src/TSemaphore/definition.ts +1 -1
  433. package/_src/collection/immutable/Conc/dropUntilIO.ts +24 -0
  434. package/_src/collection/immutable/Conc/dropWhileIO.ts +26 -0
  435. package/_src/internal/Scheduler.ts +59 -15
  436. package/collection/immutable/Conc/dropUntilIO.d.ts +7 -0
  437. package/collection/immutable/Conc/dropWhileIO.d.ts +7 -0
  438. package/internal/Scheduler.d.ts +18 -1
  439. package/package.json +3 -3
package/STM/api.d.ts CHANGED
@@ -2,8 +2,8 @@ import { Lazy } from "@fncts/base/data/function";
2
2
  import { Maybe } from "@fncts/base/data/Maybe";
3
3
  import { Either } from "@fncts/base/data/Either";
4
4
  import { FiberId } from "@fncts/base/data/FiberId";
5
- import { IO } from "@fncts/io/IO/definition";
6
5
  import { Environment } from "@fncts/base/data/Environment";
6
+ import { IO } from "@fncts/io/IO/definition";
7
7
  import { Refinement } from "@fncts/base/data/Refinement";
8
8
  import { Predicate } from "@fncts/base/data/Predicate";
9
9
  import type { Journal } from "./internal/Journal.js";
@@ -37,25 +37,25 @@ export declare function absolve<R, E, E1, A>(z: STM<R, E, Either<E1, A>>): STM<R
37
37
  * @tsplus static fncts.io.STMOps Effect
38
38
  * @tsplus location "@fncts/io/STM/api"
39
39
  */
40
- export declare function makeEffect<R, E, A>(f: (journal: Journal, fiberId: FiberId, r: R) => A): STM<R, E, A>;
40
+ export declare function makeEffect<R, E, A>(f: (journal: Journal, fiberId: FiberId, r: Environment<R>) => A): STM<R, E, A>;
41
41
  /**
42
42
  * Retrieves the environment inside an stm.
43
43
  * @tsplus static fncts.io.STMOps environment
44
44
  * @tsplus location "@fncts/io/STM/api"
45
45
  */
46
- export declare function environment<R>(): STM<R, never, R>;
46
+ export declare function environment<R>(): STM<R, never, Environment<R>>;
47
47
  /**
48
48
  * Accesses the environment of the transaction.
49
49
  * @tsplus static fncts.io.STMOps environmentWith
50
50
  * @tsplus location "@fncts/io/STM/api"
51
51
  */
52
- export declare function environmentWith<R, A>(f: (r: R) => A): STM<R, never, A>;
52
+ export declare function environmentWith<R, A>(f: (r: Environment<R>) => A): STM<R, never, A>;
53
53
  /**
54
54
  * Accesses the environment of the transaction to perform a transaction.
55
55
  * @tsplus static fncts.io.STMOps environmentWithSTM
56
56
  * @tsplus location "@fncts/io/STM/api"
57
57
  */
58
- export declare function environmentWithSTM<R0, R, E, A>(f: (r: R0) => STM<R, E, A>): STM<R & R0, E, A>;
58
+ export declare function environmentWithSTM<R0, R, E, A>(f: (r: Environment<R0>) => STM<R, E, A>): STM<R0 | R, E, A>;
59
59
  /**
60
60
  * @tsplus static fncts.io.STMOps atomically
61
61
  * @tsplus getter fncts.io.STM commit
@@ -74,7 +74,7 @@ export declare function bimap_<R, E, A, E1, B>(stm: STM<R, E, A>, g: (e: E) => E
74
74
  */
75
75
  export declare function catch_<N extends keyof E, K extends E[N] & string, E, R, A, R1, E1, A1>(stm: STM<R, E, A>, tag: N, k: K, f: (e: Extract<E, {
76
76
  [n in N]: K;
77
- }>) => STM<R1, E1, A1>): STM<R & R1, Exclude<E, {
77
+ }>) => STM<R1, E1, A1>): STM<R | R1, Exclude<E, {
78
78
  [n in N]: K;
79
79
  }> | E1, A | A1>;
80
80
  /**
@@ -82,7 +82,7 @@ export declare function catch_<N extends keyof E, K extends E[N] & string, E, R,
82
82
  * @tsplus fluent fncts.io.STM catchJust
83
83
  * @tsplus location "@fncts/io/STM/api"
84
84
  */
85
- export declare function catchJust_<R, E, A, R1, E1, B>(stm: STM<R, E, A>, f: (e: E) => Maybe<STM<R1, E1, B>>): STM<R1 & R, E | E1, A | B>;
85
+ export declare function catchJust_<R, E, A, R1, E1, B>(stm: STM<R, E, A>, f: (e: E) => Maybe<STM<R1, E1, B>>): STM<R1 | R, E | E1, A | B>;
86
86
  /**
87
87
  * Recovers from specified error.
88
88
  * @tsplus fluent fncts.io.STM catchTag
@@ -92,7 +92,7 @@ export declare function catchTag_<K extends E["_tag"] & string, E extends {
92
92
  _tag: string;
93
93
  }, R, A, R1, E1, A1>(stm: STM<R, E, A>, k: K, f: (e: Extract<E, {
94
94
  _tag: K;
95
- }>) => STM<R1, E1, A1>): STM<R & R1, Exclude<E, {
95
+ }>) => STM<R1, E1, A1>): STM<R | R1, Exclude<E, {
96
96
  _tag: K;
97
97
  }> | E1, A | A1>;
98
98
  /**
@@ -101,13 +101,13 @@ export declare function catchTag_<K extends E["_tag"] & string, E extends {
101
101
  * @tsplus fluent fncts.io.STM flatMapError
102
102
  * @tsplus location "@fncts/io/STM/api"
103
103
  */
104
- export declare function chainError_<R, E, A, R2, E2>(stm: STM<R, E, A>, f: (e: E) => STM<R2, never, E2>): STM<R2 & R, E2, A>;
104
+ export declare function chainError_<R, E, A, R2, E2>(stm: STM<R, E, A>, f: (e: E) => STM<R2, never, E2>): STM<R2 | R, E2, A>;
105
105
  /**
106
106
  * Checks the condition, and if it's true, returns unit, otherwise, retries.
107
107
  * @tsplus static fncts.io.STMOps check
108
108
  * @tsplus location "@fncts/io/STM/api"
109
109
  */
110
- export declare function check(predicate: () => boolean): STM<unknown, never, void>;
110
+ export declare function check(predicate: () => boolean): STM<never, never, void>;
111
111
  /**
112
112
  * Commits this transaction atomically, regardless of whether the transaction
113
113
  * is a success or a failure.
@@ -126,7 +126,7 @@ export declare function continueOrFail_<R, E, E1, A, A2>(fa: STM<R, E, A>, e: La
126
126
  * @tsplus fluent fncts.io.STM continueOrFailSTM
127
127
  * @tsplus location "@fncts/io/STM/api"
128
128
  */
129
- export declare function continueOrFailSTM_<R, E, E1, A, R2, E2, A2>(fa: STM<R, E, A>, e: Lazy<E1>, pf: (a: A) => Maybe<STM<R2, E2, A2>>): STM<R2 & R, E | E1 | E2, A2>;
129
+ export declare function continueOrFailSTM_<R, E, E1, A, R2, E2, A2>(fa: STM<R, E, A>, e: Lazy<E1>, pf: (a: A) => Maybe<STM<R2, E2, A2>>): STM<R2 | R, E | E1 | E2, A2>;
130
130
  /**
131
131
  * Fail with `e` if the supplied `PartialFunction` does not match, otherwise
132
132
  * succeed with the returned value.
@@ -140,7 +140,7 @@ export declare function continueOrRetry_<R, E, A, A2>(fa: STM<R, E, A>, pf: (a:
140
140
  * @tsplus fluent fncts.io.STM continueOrRetrySTM
141
141
  * @tsplus location "@fncts/io/STM/api"
142
142
  */
143
- export declare function continueOrRetrySTM_<R, E, A, R2, E2, A2>(fa: STM<R, E, A>, pf: (a: A) => Maybe<STM<R2, E2, A2>>): STM<R2 & R, E | E2, A2>;
143
+ export declare function continueOrRetrySTM_<R, E, A, R2, E2, A2>(fa: STM<R, E, A>, pf: (a: A) => Maybe<STM<R2, E2, A2>>): STM<R2 | R, E | E2, A2>;
144
144
  /**
145
145
  * Suspends creation of the specified transaction lazily.
146
146
  * @tsplus static fncts.io.STMOps defer
@@ -171,14 +171,14 @@ export declare function filterMap_<R, E, A, B>(stm: STM<R, E, A>, f: (a: A) => M
171
171
  * @tsplus fluent fncts.io.STM filterMapSTM
172
172
  * @tsplus location "@fncts/io/STM/api"
173
173
  */
174
- export declare function filterMapSTM_<R, E, A, R1, E1, B>(self: STM<R, E, A>, f: (a: A) => Maybe<STM<R1, E1, B>>): STM<R & R1, E | E1, B>;
174
+ export declare function filterMapSTM_<R, E, A, R1, E1, B>(self: STM<R, E, A>, f: (a: A) => Maybe<STM<R1, E1, B>>): STM<R | R1, E | E1, B>;
175
175
  /**
176
176
  * Applies `or` if the predicate fails.
177
177
  * @tsplus fluent fncts.io.STM filterOrElse
178
178
  * @tsplus location "@fncts/io/STM/api"
179
179
  */
180
- export declare function filterOrElse_<R, E, A, B extends A, R2, E2, A2>(fa: STM<R, E, A>, p: Refinement<A, B>, or: (a: Exclude<A, B>) => STM<R2, E2, A2>): STM<R & R2, E | E2, B | A2>;
181
- export declare function filterOrElse_<R, E, A, R2, E2, A2>(fa: STM<R, E, A>, p: Predicate<A>, or: (a: A) => STM<R2, E2, A2>): STM<R & R2, E | E2, A | A2>;
180
+ export declare function filterOrElse_<R, E, A, B extends A, R2, E2, A2>(fa: STM<R, E, A>, p: Refinement<A, B>, or: (a: Exclude<A, B>) => STM<R2, E2, A2>): STM<R | R2, E | E2, B | A2>;
181
+ export declare function filterOrElse_<R, E, A, R2, E2, A2>(fa: STM<R, E, A>, p: Predicate<A>, or: (a: A) => STM<R2, E2, A2>): STM<R | R2, E | E2, A | A2>;
182
182
  /**
183
183
  * Fails with `failWith` if the predicate fails.
184
184
  * @tsplus fluent fncts.io.STM filterOrFail
@@ -198,7 +198,7 @@ export declare function filterOrHalt_<R, E, A>(fa: STM<R, E, A>, p: Predicate<A>
198
198
  * @tsplus getter fncts.io.STM flatten
199
199
  * @tsplus location "@fncts/io/STM/api"
200
200
  */
201
- export declare function flatten<R, E, R1, E1, B>(stm: STM<R, E, STM<R1, E1, B>>): STM<R1 & R, E | E1, B>;
201
+ export declare function flatten<R, E, R1, E1, B>(stm: STM<R, E, STM<R1, E1, B>>): STM<R1 | R, E | E1, B>;
202
202
  /**
203
203
  * Unwraps the optional error, defaulting to the provided value.
204
204
  * @tsplus fluent fncts.io.STM flattenErrorOption
@@ -217,13 +217,13 @@ export declare function foreach_<A, R, E, B>(it: Iterable<A>, f: (a: A) => STM<R
217
217
  * @tsplus static fncts.io.STMOps fromEither
218
218
  * @tsplus location "@fncts/io/STM/api"
219
219
  */
220
- export declare function fromEither<E, A>(e: Lazy<Either<E, A>>): STM<unknown, E, A>;
220
+ export declare function fromEither<E, A>(e: Lazy<Either<E, A>>): STM<never, E, A>;
221
221
  /**
222
222
  * Lifts an `Either` into a `STM`.
223
223
  * @tsplus static fncts.io.STMOps fromEitherNow
224
224
  * @tsplus location "@fncts/io/STM/api"
225
225
  */
226
- export declare function fromEitherNow<E, A>(e: Either<E, A>): STM<unknown, E, A>;
226
+ export declare function fromEitherNow<E, A>(e: Either<E, A>): STM<never, E, A>;
227
227
  /**
228
228
  * Unwraps the optional success of this effect, but can fail with an None value.
229
229
  */
@@ -234,26 +234,26 @@ export declare function get<R, E, A>(stm: STM<R, E, Maybe<A>>): STM<R, Maybe<E>,
234
234
  * @tsplus fluent fncts.io.STM provideEnvironment
235
235
  * @tsplus location "@fncts/io/STM/api"
236
236
  */
237
- export declare function provideEnvironment_<R, E, A>(stm: STM<R, E, A>, r: R): STM<unknown, E, A>;
237
+ export declare function provideEnvironment_<R, E, A>(stm: STM<R, E, A>, r: Environment<R>): STM<never, E, A>;
238
238
  /**
239
239
  * Provides some of the environment required to run this effect,
240
240
  * leaving the remainder `R0`.
241
241
  * @tsplus fluent fncts.io.STM contramapEnvironment
242
242
  * @tsplus location "@fncts/io/STM/api"
243
243
  */
244
- export declare function contramapEnvironment_<R, E, A, R0>(self: STM<R, E, A>, f: (r: R0) => R): STM<R0, E, A>;
244
+ export declare function contramapEnvironment_<R, E, A, R0>(self: STM<R, E, A>, f: (r: Environment<R0>) => Environment<R>): STM<R0, E, A>;
245
245
  /**
246
246
  * Halts the fiber running the effect.
247
247
  * @tsplus static fncts.io.STMOps halt
248
248
  * @tsplus location "@fncts/io/STM/api"
249
249
  */
250
- export declare function halt(u: Lazy<unknown>): STM<unknown, never, never>;
250
+ export declare function halt(u: Lazy<unknown>): STM<never, never, never>;
251
251
  /**
252
252
  * Halts the fiber running the effect.
253
253
  * @tsplus static fncts.io.STMOps haltNow
254
254
  * @tsplus location "@fncts/io/STM/api"
255
255
  */
256
- export declare function haltNow(u: unknown): STM<unknown, never, never>;
256
+ export declare function haltNow(u: unknown): STM<never, never, never>;
257
257
  /**
258
258
  * Returns a successful effect with the head of the list if the list is
259
259
  * non-empty or fails with the error `None` if the list is empty.
@@ -266,7 +266,7 @@ export declare function head<R, E, A>(stm: STM<R, E, Iterable<A>>): STM<R, Maybe
266
266
  * @tsplus static fncts.io.STMOps interrupt
267
267
  * @tsplus location "@fncts/io/STM/api"
268
268
  */
269
- export declare const interrupt: STM<unknown, never, never>;
269
+ export declare const interrupt: STM<never, never, never>;
270
270
  /**
271
271
  * Returns whether this effect is a failure.
272
272
  * @tsplus getter fncts.io.STM isFailure
@@ -279,18 +279,6 @@ export declare function isFailure<R, E, A>(stm: STM<R, E, A>): STM<R, never, boo
279
279
  * @tsplus location "@fncts/io/STM/api"
280
280
  */
281
281
  export declare function isSuccess<R, E, A>(stm: STM<R, E, A>): STM<R, never, boolean>;
282
- /**
283
- * Depending on provided environment returns either this one or the other effect.
284
- * @tsplus fluent fncts.io.STM join
285
- * @tsplus location "@fncts/io/STM/api"
286
- */
287
- export declare function join_<R, E, A, R1, E1, A1>(stm: STM<R, E, A>, that: STM<R1, E1, A1>): STM<Either<R, R1>, E | E1, A | A1>;
288
- /**
289
- * Depending on provided environment returns either this one or the other effect.
290
- * @tsplus fluent fncts.io.STM joinEither
291
- * @tsplus location "@fncts/io/STM/api"
292
- */
293
- export declare function joinEither_<R, E, A, R1, E1, A1>(stm: STM<R, E, A>, that: STM<R1, E1, A1>): STM<Either<R, R1>, E | E1, Either<A, A1>>;
294
282
  /**
295
283
  * Returns a successful effect if the value is `Left`, or fails with the error `None`.
296
284
  * @tsplus getter fncts.io.STM left
@@ -364,23 +352,23 @@ export declare function swapWith_<R, E, A, R2, E2, A2>(stm: STM<R, E, A>, f: (st
364
352
  * @tsplus fluent fncts.io.STM tap
365
353
  * @tsplus location "@fncts/io/STM/api"
366
354
  */
367
- export declare function tap_<R, E, A, R1, E1, B>(stm: STM<R, E, A>, f: (a: A) => STM<R1, E1, B>): STM<R1 & R, E | E1, A>;
355
+ export declare function tap_<R, E, A, R1, E1, B>(stm: STM<R, E, A>, f: (a: A) => STM<R1, E1, B>): STM<R1 | R, E | E1, A>;
368
356
  /**
369
357
  * Returns an effect with the value on the left part.
370
358
  * @tsplus static fncts.io.STMOps toLeft
371
359
  * @tsplus location "@fncts/io/STM/api"
372
360
  */
373
- export declare function toLeft<A>(a: Lazy<A>): STM<unknown, never, Either<A, never>>;
361
+ export declare function toLeft<A>(a: Lazy<A>): STM<never, never, Either<A, never>>;
374
362
  /**
375
363
  * Returns an `STM` effect that succeeds with `Unit`.
376
364
  * @tsplus static fncts.io.STMOps unit
377
365
  * @tsplus location "@fncts/io/STM/api"
378
366
  */
379
- export declare const unit: STM<unknown, never, void>;
367
+ export declare const unit: STM<never, never, void>;
380
368
  /**
381
369
  * Sequentially zips this value with the specified one, combining the values
382
370
  * using the specified combiner function.
383
371
  * @tsplus fluent fncts.io.STM zipWith
384
372
  * @tsplus location "@fncts/io/STM/api"
385
373
  */
386
- export declare function zipWith_<R, E, A, R1, E1, B, C>(self: STM<R, E, A>, that: STM<R1, E1, B>, f: (a: A, b: B) => C): STM<R & R1, E | E1, C>;
374
+ export declare function zipWith_<R, E, A, R1, E1, B, C>(self: STM<R, E, A>, that: STM<R1, E1, B>, f: (a: A, b: B) => C): STM<R | R1, E | E1, C>;
@@ -1,4 +1,5 @@
1
1
  import { FiberId } from "@fncts/base/data/FiberId";
2
+ import { Environment } from "@fncts/base/data/Environment";
2
3
  import type { Journal } from "./internal/Journal.js";
3
4
  import type { _A, _E, _R } from "@fncts/base/types";
4
5
  export declare const enum STMTag {
@@ -18,7 +19,7 @@ export declare type STMTypeId = typeof STMTypeId;
18
19
  */
19
20
  export declare abstract class STM<R, E, A> {
20
21
  readonly _typeId: STMTypeId;
21
- readonly _R: (_: R) => void;
22
+ readonly _R: () => R;
22
23
  readonly _E: () => E;
23
24
  readonly _A: () => A;
24
25
  }
@@ -29,12 +30,12 @@ export declare function unifySTM<X extends STM<any, any, any>>(self: X): STM<_R<
29
30
  /**
30
31
  * @tsplus type fncts.io.STM
31
32
  */
32
- export interface USTM<A> extends STM<unknown, never, A> {
33
+ export interface USTM<A> extends STM<never, never, A> {
33
34
  }
34
35
  export declare class Effect<R, E, A> extends STM<R, E, A> {
35
- readonly f: (journal: Journal, fiberId: FiberId, r: R) => A;
36
+ readonly f: (journal: Journal, fiberId: FiberId, r: Environment<R>) => A;
36
37
  readonly _tag = STMTag.Effect;
37
- constructor(f: (journal: Journal, fiberId: FiberId, r: R) => A);
38
+ constructor(f: (journal: Journal, fiberId: FiberId, r: Environment<R>) => A);
38
39
  }
39
40
  export declare class OnFailure<R, E, A, E1> extends STM<R, E1, A> {
40
41
  readonly stm: STM<R, E, A>;
@@ -56,21 +57,21 @@ export declare class OnSuccess<R, E, A, B> extends STM<R, E, B> {
56
57
  readonly _tag = STMTag.OnSuccess;
57
58
  constructor(stm: STM<R, E, A>, apply: (a: A) => STM<R, E, B>);
58
59
  }
59
- export declare class Succeed<A> extends STM<unknown, never, A> {
60
+ export declare class Succeed<A> extends STM<never, never, A> {
60
61
  readonly a: () => A;
61
62
  readonly _tag = STMTag.Succeed;
62
63
  constructor(a: () => A);
63
64
  }
64
- export declare class SucceedNow<A> extends STM<unknown, never, A> {
65
+ export declare class SucceedNow<A> extends STM<never, never, A> {
65
66
  readonly a: A;
66
67
  readonly _tag = STMTag.SucceedNow;
67
68
  constructor(a: A);
68
69
  }
69
70
  export declare class ContramapEnvironment<R, E, A, R0> extends STM<R0, E, A> {
70
71
  readonly stm: STM<R, E, A>;
71
- readonly f: (_: R0) => R;
72
+ readonly f: (_: Environment<R0>) => Environment<R>;
72
73
  readonly _tag = STMTag.ContramapEnvironment;
73
- constructor(stm: STM<R, E, A>, f: (_: R0) => R);
74
+ constructor(stm: STM<R, E, A>, f: (_: Environment<R0>) => Environment<R>);
74
75
  }
75
76
  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>;
76
77
  export declare const FailExceptionTypeId: unique symbol;
package/STM/driver.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { STM } from "@fncts/io/STM/definition";
2
- import { FiberId } from "@fncts/base/data/FiberId";
3
2
  import { Environment } from "@fncts/base/data/Environment";
3
+ import { FiberId } from "@fncts/base/data/FiberId";
4
4
  import { TExit } from "@fncts/io/TExit/definition";
5
5
  import type { Journal } from "./internal/Journal.js";
6
6
  export declare class STMDriver<R, E, A> {
@@ -6,6 +6,7 @@ import { IO } from "@fncts/io/IO/definition";
6
6
  import type { Entry } from "./Entry.js";
7
7
  import type { TryCommit } from "./TryCommit.js";
8
8
  import type { AtomicReference } from "@fncts/base/internal/AtomicReference";
9
+ import type { Scheduler } from "@fncts/io/internal/Scheduler";
9
10
  import type { Atomic } from "@fncts/io/TRef";
10
11
  import type { TxnId } from "@fncts/io/TxnId";
11
12
  import { CommitState } from "./CommitState.js";
@@ -72,7 +73,7 @@ export declare function execTodos(todos: Map<TxnId, Todo>): void;
72
73
  * @tsplus fluent fncts.io.Journal completeTodos
73
74
  * @tsplus location "@fncts/io/STM/internal/Journal"
74
75
  */
75
- export declare function completeTodos<E, A>(journal: Journal, exit: Exit<E, A>): Done<E, A>;
76
+ export declare function completeTodos<E, A>(journal: Journal, exit: Exit<E, A>, scheduler: Scheduler): Done<E, A>;
76
77
  /**
77
78
  * For the given transaction id, adds the specified todo effect to all
78
79
  * `TRef` values.
@@ -84,8 +85,8 @@ export declare function addTodo(journal: Journal, txnId: TxnId, todoEffect: Todo
84
85
  * Finds all the new todo targets that are not already tracked in the `oldJournal`.
85
86
  */
86
87
  export declare function untrackedTodoTargets(oldJournal: Journal, newJournal: Journal): Journal;
87
- export declare function tryCommitSync<R, E, A>(fiberId: FiberId, stm: STM<R, E, A>, r: Environment<R>): TryCommit<E, A>;
88
- export declare function tryCommitAsync<R, E, A>(journal: Journal | undefined, fiberId: FiberId, stm: STM<R, E, A>, txnId: TxnId, state: AtomicReference<CommitState<E, A>>, r: Environment<R>): (k: (_: IO<R, E, A>) => unknown) => void;
88
+ export declare function tryCommitSync<R, E, A>(fiberId: FiberId, stm: STM<R, E, A>, r: Environment<R>, scheduler: Scheduler): TryCommit<E, A>;
89
+ export declare function tryCommitAsync<R, E, A>(journal: Journal | undefined, fiberId: FiberId, stm: STM<R, E, A>, txnId: TxnId, state: AtomicReference<CommitState<E, A>>, r: Environment<R>, scheduler: Scheduler): (k: (_: IO<R, E, A>) => unknown) => void;
89
90
  /**
90
91
  * Determines if the journal is valid.
91
92
  * @tsplus getter fncts.io.Journal isValid
@@ -1,12 +1,13 @@
1
+ import { Intervals } from "@fncts/base/data/Intervals";
1
2
  import { Interval } from "@fncts/base/data/Interval";
2
3
  export declare const enum DecisionTag {
3
4
  Continue = "Continue",
4
5
  Done = "Done"
5
6
  }
6
7
  export declare class Continue {
7
- readonly interval: Interval;
8
+ readonly interval: Intervals;
8
9
  readonly _tag = DecisionTag.Continue;
9
- constructor(interval: Interval);
10
+ constructor(interval: Intervals);
10
11
  }
11
12
  export declare class Done {
12
13
  readonly _tag = DecisionTag.Done;
@@ -30,9 +31,14 @@ export declare const done: Decision;
30
31
  * @tsplus static fncts.io.Schedule.DecisionOps Continue
31
32
  * @tsplus location "@fncts/io/Schedule/Decision"
32
33
  */
33
- export declare function continue_(interval: Interval): Decision;
34
+ export declare function continue_(interval: Intervals): Decision;
35
+ /**
36
+ * @tsplus static fncts.io.Schedule.DecisionOps continueWith
37
+ * @tsplus location "@fncts/io/Schedule/Decision"
38
+ */
39
+ export declare function continueWith(interval: Interval): Decision;
34
40
  /**
35
41
  * @tsplus fluent fncts.io.Schedule.Decision match
36
42
  * @tsplus location "@fncts/io/Schedule/Decision"
37
43
  */
38
- export declare function match_<A, B>(self: Decision, onDone: () => A, onContinue: (interval: Interval) => B): A | B;
44
+ export declare function match_<A, B>(self: Decision, onDone: () => A, onContinue: (interval: Intervals) => B): A | B;
@@ -7,13 +7,13 @@ import { NoSuchElementError } from "@fncts/base/data/exceptions";
7
7
  */
8
8
  export declare class Driver<State, Env, In, Out> {
9
9
  readonly next: (inp: In, __tsplusTrace?: string) => IO<Env, Nothing, Out>;
10
- readonly last: IO<unknown, NoSuchElementError, Out>;
10
+ readonly last: IO<never, NoSuchElementError, Out>;
11
11
  readonly reset: UIO<void>;
12
12
  readonly state: UIO<State>;
13
- constructor(next: (inp: In, __tsplusTrace?: string) => IO<Env, Nothing, Out>, last: IO<unknown, NoSuchElementError, Out>, reset: UIO<void>, state: UIO<State>);
13
+ constructor(next: (inp: In, __tsplusTrace?: string) => IO<Env, Nothing, Out>, last: IO<never, NoSuchElementError, Out>, reset: UIO<void>, state: UIO<State>);
14
14
  }
15
15
  /**
16
16
  * @tsplus static fncts.io.Schedule.DriverOps __call
17
17
  * @tsplus location "@fncts/io/Schedule/Driver"
18
18
  */
19
- export declare function makeDriver<State, Env, In, Out>(next: (inp: In, __tsplusTrace?: string) => IO<Env, Nothing, Out>, last: IO<unknown, NoSuchElementError, Out>, reset: UIO<void>, state: UIO<State>): Driver<State, Env, In, Out>;
19
+ export declare function makeDriver<State, Env, In, Out>(next: (inp: In, __tsplusTrace?: string) => IO<Env, Nothing, Out>, last: IO<never, NoSuchElementError, Out>, reset: UIO<void>, state: UIO<State>): Driver<State, Env, In, Out>;