@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/Sink/api.d.ts CHANGED
@@ -7,9 +7,8 @@ import { IO } from "@fncts/io/IO/definition";
7
7
  import { Environment } from "@fncts/base/data/Environment";
8
8
  import { Cause } from "@fncts/base/data/Cause";
9
9
  import { Maybe } from "@fncts/base/data/Maybe";
10
- import { Has } from "@fncts/base/typeclass/Has";
11
- import { Scope } from "@fncts/io/Scope/definition";
12
10
  import { Either } from "@fncts/base/data/Either";
11
+ import { Scope } from "@fncts/io/Scope/definition";
13
12
  import { Queue } from "@fncts/io/Queue/definition";
14
13
  import { Hub } from "@fncts/io/Hub/definition";
15
14
  import { Exit } from "@fncts/base/data/Exit";
@@ -18,239 +17,324 @@ import { Ref } from "@fncts/io/Ref";
18
17
  import { Duration } from "@fncts/base/data/Duration";
19
18
  import { MergeDecision } from "../Channel/internal/MergeDecision.js";
20
19
  /**
20
+ * Like {@link zip }, but keeps only the result from this sink
21
21
  * @tsplus fluent fncts.io.Sink apFirst
22
22
  * @tsplus location "@fncts/io/Sink/api"
23
23
  */
24
- export declare function apFirst<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z>;
24
+ export declare function apFirst<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R | R1, E | E1, In & In1, L | L1, Z>;
25
25
  /**
26
+ * Like {@link zipC }, but keeps only the result from this sink
26
27
  * @tsplus fluent fncts.io.Sink apFirstC
27
28
  * @tsplus location "@fncts/io/Sink/api"
28
29
  */
29
- export declare function apFirstC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z>;
30
+ export declare function apFirstC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R | R1, E | E1, In & In1, L | L1, Z>;
30
31
  /**
32
+ * Like {@link zip }, but keeps only the result from the `that` sink
31
33
  * @tsplus fluent fncts.io.Sink apSecond
32
34
  * @tsplus location "@fncts/io/Sink/api"
33
35
  */
34
- export declare function apSecond<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z1>;
36
+ export declare function apSecond<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Z1>;
35
37
  /**
38
+ * Like {@link zipC }, but keeps only the result from the `that` sink
36
39
  * @tsplus fluent fncts.io.Sink apSecondC
37
40
  * @tsplus location "@fncts/io/Sink/api"
38
41
  */
39
- export declare function apSecondC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z1>;
42
+ export declare function apSecondC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Z1>;
40
43
  /**
44
+ * Replaces this sink's result with the provided value.
41
45
  * @tsplus fluent fncts.io.Sink as
42
46
  * @tsplus location "@fncts/io/Sink/api"
43
47
  */
44
- export declare function as<R, E, In, L, Z, Z1>(self: Sink<R, E, In, L, Z>, z: Lazy<Z1>): Sink<R, E, In, L, Z1>;
48
+ export declare function as<R, E, In, L, Z, Z1>(self: Sink<R, E, In, L, Z>, z: Lazy<Z1>, __tsplusTrace?: string): Sink<R, E, In, L, Z1>;
45
49
  /**
50
+ * Repeatedly runs the sink and accumulates its results into a chunk
46
51
  * @tsplus fluent fncts.io.Sink collectAll
47
52
  * @tsplus location "@fncts/io/Sink/api"
48
53
  */
49
54
  export declare function collectAll<R, E, In extends L, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, L, Conc<Z>>;
50
55
  /**
56
+ * Repeatedly runs the sink for as long as its results satisfy the predicate
57
+ * `p`. The sink's results will be accumulated using the stepping function
58
+ * `f`.
51
59
  * @tsplus fluent fncts.io.Sink collectAllWhileWith
52
60
  * @tsplus location "@fncts/io/Sink/api"
53
61
  */
54
62
  export declare function collectAllWhileWith<R, E, In extends L, L, Z, S>(self: Sink<R, E, In, L, Z>, z: Lazy<S>, p: Predicate<Z>, f: (s: S, z: Z) => S, __tsplusTrace?: string): Sink<R, E, In, L, S>;
55
63
  /**
64
+ * Collects the leftovers from the stream when the sink succeeds and returns
65
+ * them as part of the sink's result
56
66
  * @tsplus getter fncts.io.Sink collectLeftover
57
67
  * @tsplus location "@fncts/io/Sink/api"
58
68
  */
59
69
  export declare function collectLeftover<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, never, readonly [Z, Conc<L>]>;
60
70
  /**
71
+ * Transforms this sink's input elements.
61
72
  * @tsplus fluent fncts.io.Sink contramap
62
73
  * @tsplus location "@fncts/io/Sink/api"
63
74
  */
64
- export declare function contramap<R, E, In, L, Z, In1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => In): Sink<R, E, In1, L, Z>;
75
+ export declare function contramap<R, E, In, L, Z, In1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => In, __tsplusTrace?: string): Sink<R, E, In1, L, Z>;
65
76
  /**
77
+ * Transforms this sink's input chunks. `f` must preserve chunking-invariance
66
78
  * @tsplus fluent fncts.io.Sink contramapChunks
67
79
  * @tsplus location "@fncts/io/Sink/api"
68
80
  */
69
- export declare function contramapChunks<R, E, In, L, Z, In1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => Conc<In>): Sink<R, E, In1, L, Z>;
81
+ export declare function contramapChunks<R, E, In, L, Z, In1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => Conc<In>, __tsplusTrace?: string): Sink<R, E, In1, L, Z>;
70
82
  /**
83
+ * Effectfully transforms this sink's input chunks. `f` must preserve
84
+ * chunking-invariance
71
85
  * @tsplus fluent fncts.io.Sink contramapChunksIO
72
86
  * @tsplus location "@fncts/io/Sink/api"
73
87
  */
74
- export declare function contramapChunksIO<R, E, In, L, Z, R1, E1, In1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => IO<R1, E1, Conc<In>>): Sink<R & R1, E | E1, In1, L, Z>;
88
+ export declare function contramapChunksIO<R, E, In, L, Z, R1, E1, In1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => IO<R1, E1, Conc<In>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In1, L, Z>;
75
89
  /**
90
+ * Effectfully transforms this sink's input elements.
76
91
  * @tsplus fluent fncts.io.Sink contramapIO
77
92
  * @tsplus location "@fncts/io/Sink/api"
78
93
  */
79
- export declare function contramapIO<R, E, In, L, Z, R1, E1, In1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => IO<R1, E1, In>): Sink<R & R1, E | E1, In1, L, Z>;
94
+ export declare function contramapIO<R, E, In, L, Z, R1, E1, In1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => IO<R1, E1, In>, __tsplusTrace?: string): Sink<R | R1, E | E1, In1, L, Z>;
80
95
  /**
96
+ * Transforms both inputs and result of this sink using the provided
97
+ * functions.
81
98
  * @tsplus fluent fncts.io.Sink dimap
82
99
  * @tsplus location "@fncts/io/Sink/api"
83
100
  */
84
- export declare function dimap<R, E, In, L, Z, In1, Z1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => In, g: (z: Z) => Z1): Sink<R, E, In1, L, Z1>;
101
+ export declare function dimap<R, E, In, L, Z, In1, Z1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => In, g: (z: Z) => Z1, __tsplusTrace?: string): Sink<R, E, In1, L, Z1>;
85
102
  /**
103
+ * Transforms both input chunks and result of this sink using the provided
104
+ * functions.
86
105
  * @tsplus fluent fncts.io.Sink dimapChunks
87
106
  * @tsplus location "@fncts/io/Sink/api"
88
107
  */
89
- export declare function dimapChunks<R, E, In, L, Z, In1, Z1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => Conc<In>, g: (z: Z) => Z1): Sink<R, E, In1, L, Z1>;
108
+ export declare function dimapChunks<R, E, In, L, Z, In1, Z1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => Conc<In>, g: (z: Z) => Z1, __tsplusTrace?: string): Sink<R, E, In1, L, Z1>;
90
109
  /**
110
+ * Effectfully transforms both input chunks and result of this sink using the
111
+ * provided functions. `f` and `g` must preserve chunking-invariance
91
112
  * @tsplus fluent fncts.io.Sink dimapChunksIO
92
113
  * @tsplus location "@fncts/io/Sink/api"
93
114
  */
94
- export declare function dimapChunksIO<R, E, In, L, Z, R1, E1, In1, R2, E2, Z1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => IO<R1, E1, Conc<In>>, g: (z: Z) => IO<R2, E2, Z1>): Sink<R & R1 & R2, E | E1 | E2, In1, L, Z1>;
115
+ export declare function dimapChunksIO<R, E, In, L, Z, R1, E1, In1, R2, E2, Z1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => IO<R1, E1, Conc<In>>, g: (z: Z) => IO<R2, E2, Z1>, __tsplusTrace?: string): Sink<R | R1 | R2, E | E1 | E2, In1, L, Z1>;
95
116
  /**
117
+ * Effectfully transforms both inputs and result of this sink using the
118
+ * provided functions.
96
119
  * @tsplus fluent fncts.io.Sink dimapIO
97
120
  * @tsplus location "@fncts/io/Sink/api"
98
121
  */
99
- export declare function dimapIO<R, E, In, L, Z, R1, E1, In1, R2, E2, Z1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => IO<R1, E1, In>, g: (z: Z) => IO<R2, E2, Z1>): Sink<R & R1 & R2, E | E1 | E2, In1, L, Z1>;
122
+ export declare function dimapIO<R, E, In, L, Z, R1, E1, In1, R2, E2, Z1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => IO<R1, E1, In>, g: (z: Z) => IO<R2, E2, Z1>, __tsplusTrace?: string): Sink<R | R1 | R2, E | E1 | E2, In1, L, Z1>;
100
123
  /**
124
+ * Returns a lazily constructed sink that may require effects for its
125
+ * creation.
101
126
  * @tsplus static fncts.io.SinkOps defer
102
127
  * @tsplus location "@fncts/io/Sink/api"
103
128
  */
104
- export declare function defer<R, E, In, L, Z>(sink: Lazy<Sink<R, E, In, L, Z>>): Sink<R, E, In, L, Z>;
129
+ export declare function defer<R, E, In, L, Z>(sink: Lazy<Sink<R, E, In, L, Z>>, __tsplusTrace?: string): Sink<R, E, In, L, Z>;
105
130
  /**
106
131
  * A sink that ignores all of its inputs.
107
132
  * @tsplus static fncts.io.SinkOps drain
108
133
  * @tsplus location "@fncts/io/Sink/api"
109
134
  */
110
- export declare const drain: Sink<unknown, never, unknown, never, void>;
135
+ export declare const drain: Sink<never, never, unknown, never, void>;
136
+ /**
137
+ * Drops incoming elements until the predicate `p` is satisfied.
138
+ * @tsplus static fncts.io.SinkOps dropUntil
139
+ * @tsplus location "@fncts/io/Sink/api"
140
+ */
141
+ export declare function makeDropUntil<In>(p: Predicate<In>, __tsplusTrace?: string): Sink<never, never, In, In, void>;
142
+ /**
143
+ * Drops incoming elements until the effectful predicate `p` is satisfied.
144
+ * @tsplus static fncts.io.SinkOps dropUntilIO
145
+ * @tsplus location "@fncts/io/Sink/api"
146
+ */
147
+ export declare function makeDropUntilIO<R, E, In>(p: (inp: In) => IO<R, E, boolean>, __tsplusTrace?: string): Sink<R, E, In, In, void>;
111
148
  /**
149
+ * Drops incoming elements as long as the predicate `p` is satisfied.
112
150
  * @tsplus static fncts.io.SinkOps dropWhile
113
151
  * @tsplus location "@fncts/io/Sink/api"
114
152
  */
115
- export declare function dropWhile<Err, In>(predicate: Predicate<In>): Sink<unknown, never, In, In, any>;
153
+ export declare function makeDropWhile<Err, In>(predicate: Predicate<In>, __tsplusTrace?: string): Sink<never, never, In, In, any>;
154
+ /**
155
+ * Drops incoming elements as long as the effectful predicate `p` is
156
+ * satisfied.
157
+ * @tsplus static fncts.io.SinkOps dropWhileIO
158
+ * @tsplus location "@fncts/io/Sink/api"
159
+ */
160
+ export declare function dropWhileIO<R, E, In>(p: (inp: In) => IO<R, E, boolean>, __tsplusTrace?: string): Sink<R, E, In, In, void>;
116
161
  /**
162
+ * Accesses the whole environment of the sink.
117
163
  * @tsplus static fncts.io.SinkOps environment
118
164
  * @tsplus location "@fncts/io/Sink/api"
119
165
  */
120
166
  export declare function environment<R>(__tsplusTrace?: string): Sink<R, never, unknown, never, Environment<R>>;
121
167
  /**
168
+ * Accesses the environment of the sink.
122
169
  * @tsplus static fncts.io.SinkOps environmentWith
123
170
  * @tsplus location "@fncts/io/Sink/api"
124
171
  */
125
172
  export declare function environmentWith<R, Z>(f: (r: Environment<R>) => Z, __tsplusTrace?: string): Sink<R, never, unknown, never, Z>;
126
173
  /**
174
+ * Accesses the environment of the sink in the context of an effect.
127
175
  * @tsplus static fncts.io.SinkOps environmentWithIO
128
176
  * @tsplus location "@fncts/io/Sink/api"
129
177
  */
130
- export declare function environmentWithIO<R, R1, E, Z>(f: (r: Environment<R>) => IO<R1, E, Z>, __tsplusTrace?: string): Sink<R & R1, E, unknown, never, Z>;
178
+ export declare function environmentWithIO<R, R1, E, Z>(f: (r: Environment<R>) => IO<R1, E, Z>, __tsplusTrace?: string): Sink<R | R1, E, unknown, never, Z>;
131
179
  /**
180
+ * Accesses the environment of the sink in the context of a sink.
132
181
  * @tsplus static fncts.io.SinkOps environmentWithSink
133
182
  * @tsplus location "@fncts/io/Sink/api"
134
183
  */
135
- export declare function environmentWithSink<R, R1, E, In, L, Z>(f: (r: Environment<R>) => Sink<R1, E, In, L, Z>, __tsplusTrace?: string): Sink<R & R1, E, In, L, Z>;
184
+ export declare function environmentWithSink<R, R1, E, In, L, Z>(f: (r: Environment<R>) => Sink<R1, E, In, L, Z>, __tsplusTrace?: string): Sink<R | R1, E, In, L, Z>;
136
185
  /**
186
+ * A sink that always fails with the specified error.
137
187
  * @tsplus static fncts.io.SinkOps fail
138
188
  * @tsplus location "@fncts/io/Sink/api"
139
189
  */
140
- export declare function fail<E>(e: Lazy<E>): Sink<unknown, E, unknown, never, never>;
190
+ export declare function fail<E>(e: Lazy<E>, __tsplusTrace?: string): Sink<never, E, unknown, never, never>;
141
191
  /**
192
+ * Creates a sink halting with a specified cause.
142
193
  * @tsplus static fncts.io.SinkOps failCause
143
194
  * @tsplus location "@fncts/io/Sink/api"
144
195
  */
145
- export declare function failCause<E>(cause: Lazy<Cause<E>>, __tsplusTrace?: string): Sink<unknown, E, unknown, never, never>;
196
+ export declare function failCause<E>(cause: Lazy<Cause<E>>, __tsplusTrace?: string): Sink<never, E, unknown, never, never>;
146
197
  /**
198
+ * Creates a sink halting with a specified cause.
147
199
  * @tsplus static fncts.io.SinkOps failCauseNow
148
200
  * @tsplus location "@fncts/io/Sink/api"
149
201
  */
150
- export declare function failCauseNow<E>(cause: Cause<E>, __tsplusTrace?: string): Sink<unknown, E, unknown, never, never>;
202
+ export declare function failCauseNow<E>(cause: Cause<E>, __tsplusTrace?: string): Sink<never, E, unknown, never, never>;
151
203
  /**
204
+ * A sink that always fails with the specified error.
152
205
  * @tsplus static fncts.io.SinkOps failNow
153
206
  * @tsplus location "@fncts/io/Sink/api"
154
207
  */
155
- export declare function failNow<E>(e: E, __tsplusTrace?: string): Sink<unknown, E, unknown, never, never>;
208
+ export declare function failNow<E>(e: E, __tsplusTrace?: string): Sink<never, E, unknown, never, never>;
156
209
  /**
210
+ * Filters the sink's input with the given predicate
157
211
  * @tsplus static fncts.io.SinkOps filterInput
158
212
  * @tsplus location "@fncts/io/Sink/api"
159
213
  */
160
214
  export declare function filterInput<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, p: Predicate<In>, __tsplusTrace?: string): Sink<R, E, In, L, Z>;
161
215
  /**
216
+ * Filters the sink's input with the given IO predicate
162
217
  * @tsplus static fncts.io.SinkOps filterInputIO
163
218
  * @tsplus location "@fncts/io/Sink/api"
164
219
  */
165
- export declare function filterInputIO<R, E, In, L, Z, R1, E1>(self: Sink<R, E, In, L, Z>, p: (inp: In) => IO<R1, E1, boolean>, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, Z>;
220
+ export declare function filterInputIO<R, E, In, L, Z, R1, E1>(self: Sink<R, E, In, L, Z>, p: (inp: In) => IO<R1, E1, boolean>, __tsplusTrace?: string): Sink<R | R1, E | E1, In, L, Z>;
166
221
  /**
222
+ * Creates a sink that produces values until one verifies the predicate `f`.
167
223
  * @tsplus fluent fncts.io.Sink findIO
168
224
  * @tsplus location "@fncts/io/Sink/api"
169
225
  */
170
- export declare function findIO<R, E, In extends L, L, Z, R1, E1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => IO<R1, E1, boolean>, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, Maybe<Z>>;
226
+ export declare function findIO<R, E, In extends L, L, Z, R1, E1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => IO<R1, E1, boolean>, __tsplusTrace?: string): Sink<R | R1, E | E1, In, L, Maybe<Z>>;
171
227
  /**
228
+ * Runs this sink until it yields a result, then uses that result to create
229
+ * another sink from the provided function which will continue to run until it
230
+ * yields a result.
231
+ *
232
+ * This function essentially runs sinks in sequence.
172
233
  * @tsplus fluent fncts.io.Sink flatMap
173
234
  * @tsplus location "@fncts/io/Sink/api"
174
235
  */
175
- export declare function flatMap<R, E, In, L, Z, R1, E1, In1 extends In, L1, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => Sink<R1, E1, In1, L1, Z1>, __tsplusTrace?: string): Sink<R & R1, E | E1, In1, L | L1, Z1>;
236
+ export declare function flatMap<R, E, In, L, Z, R1, E1, In1 extends In, L1, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => Sink<R1, E1, In1, L1, Z1>, __tsplusTrace?: string): Sink<R | R1, E | E1, In1, L | L1, Z1>;
176
237
  /**
238
+ * Creates a sink from a {@link Channel }
177
239
  * @tsplus static fncts.io.SinkOps fromChannel
178
240
  * @tsplus static fncts.io.SinkOps __call
179
241
  * @tsplus location "@fncts/io/Sink/api"
180
242
  */
181
243
  export declare function fromChannel<R, E, In, L, Z>(channel: Channel<R, never, Conc<In>, unknown, E, Conc<L>, Z>): Sink<R, E, In, L, Z>;
182
244
  /**
245
+ * Creates a sink from a chunk processing function.
183
246
  * @tsplus static fncts.io.SinkOps fromPush
184
247
  * @tsplus location "@fncts/io/Sink/api"
185
248
  */
186
- export declare function fromPush<R, E, In, L, Z, R1>(push: IO<Has<Scope> & R, never, (_: Maybe<Conc<In>>) => IO<R1, readonly [Either<E, Z>, Conc<L>], void>>, __tsplusTrace?: string): Sink<R & R1, E, In, L, Z>;
249
+ export declare function fromPush<R, E, In, L, Z, R1>(push: IO<R, never, (_: Maybe<Conc<In>>) => IO<R1, readonly [Either<E, Z>, Conc<L>], void>>, __tsplusTrace?: string): Sink<Exclude<R, Scope> | R1, E, In, L, Z>;
187
250
  /**
251
+ * Create a sink which enqueues each element into the specified queue.
188
252
  * @tsplus static fncts.io.SinkOps fromQueue
189
253
  * @tsplus location "@fncts/io/Sink/api"
190
254
  */
191
- export declare function fromQueue<In>(queue: Lazy<Queue.Enqueue<In>>): Sink<unknown, never, In, never, void>;
255
+ export declare function fromQueue<In>(queue: Lazy<Queue.Enqueue<In>>, __tsplusTrace?: string): Sink<never, never, In, never, void>;
192
256
  /**
257
+ * Create a sink which enqueues each element into the specified queue. The
258
+ * queue will be shutdown once the stream is closed.
193
259
  * @tsplus static fncts.io.SinkOps fromQueueWithShutdown
194
260
  * @tsplus location "@fncts/io/Sink/api"
195
261
  */
196
- export declare function fromQueueWithShutdown<In>(queue: Lazy<Queue.Enqueue<In>>): Sink<unknown, never, In, never, void>;
262
+ export declare function fromQueueWithShutdown<In>(queue: Lazy<Queue.Enqueue<In>>, __tsplusTrace?: string): Sink<never, never, In, never, void>;
197
263
  /**
264
+ * Create a sink which publishes each element to the specified hub.
198
265
  * @tsplus static fncts.io.SinkOps fromHub
199
266
  * @tsplus location "@fncts/io/Sink/api"
200
267
  */
201
- export declare function fromHub<In>(hub: Lazy<Hub<In>>): Sink<unknown, never, In, never, void>;
268
+ export declare function fromHub<In>(hub: Lazy<Hub<In>>, __tsplusTrace?: string): Sink<never, never, In, never, void>;
202
269
  /**
270
+ * Create a sink which publishes each element to the specified hub. The hub
271
+ * will be shutdown once the stream is closed.
203
272
  * @tsplus static fncts.io.SinkOps fromHubWithShutdown
204
273
  * @tsplus location "@fncts/io/Sink/api"
205
274
  */
206
- export declare function fromHubWithShutdown<In>(hub: Lazy<Hub<In>>): Sink<unknown, never, In, never, void>;
275
+ export declare function fromHubWithShutdown<In>(hub: Lazy<Hub<In>>, __tsplusTrace?: string): Sink<never, never, In, never, void>;
207
276
  /**
277
+ * Creates a single-value sink produced from an effect
208
278
  * @tsplus static fncts.io.SinkOps fromIO
209
279
  * @tsplus location "@fncts/io/Sink/api"
210
280
  */
211
- export declare function fromIO<R, E, Z>(b: Lazy<IO<R, E, Z>>): Sink<R, E, unknown, never, Z>;
281
+ export declare function fromIO<R, E, Z>(b: Lazy<IO<R, E, Z>>, __tsplusTrace?: string): Sink<R, E, unknown, never, Z>;
212
282
  /**
283
+ * Creates a sink halting with the specified unchecked value.
213
284
  * @tsplus static fncts.io.SinkOps halt
214
285
  * @tsplus location "@fncts/io/Sink/api"
215
286
  */
216
- export declare function halt(defect: Lazy<unknown>, __tsplusTrace?: string): Sink<unknown, never, unknown, never, never>;
287
+ export declare function halt(defect: Lazy<unknown>, __tsplusTrace?: string): Sink<never, never, unknown, never, never>;
217
288
  /**
289
+ * Creates a sink halting with the specified unchecked value.
218
290
  * @tsplus static fncts.io.SinkOps haltNow
219
291
  * @tsplus location "@fncts/io/Sink/api"
220
292
  */
221
- export declare function haltNow(defect: unknown, __tsplusTrace?: string): Sink<unknown, never, unknown, never, never>;
293
+ export declare function haltNow(defect: unknown, __tsplusTrace?: string): Sink<never, never, unknown, never, never>;
222
294
  /**
295
+ * Creates a sink containing the first value.
223
296
  * @tsplus static fncts.io.SinkOps head
224
297
  * @tsplus location "@fncts/io/Sink/api"
225
298
  */
226
- export declare function head<In>(__tsplusTrace?: string): Sink<unknown, never, In, In, Maybe<In>>;
299
+ export declare function head<In>(__tsplusTrace?: string): Sink<never, never, In, In, Maybe<In>>;
227
300
  /**
301
+ * Drains the remaining elements from the stream after the sink finishes
228
302
  * @tsplus getter fncts.io.Sink ignoreLeftover
229
303
  * @tsplus location "@fncts/io/Sink/api"
230
304
  */
231
305
  export declare function ignoreLeftover<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, never, Z>;
232
306
  /**
307
+ * Creates a sink containing the last value.
233
308
  * @tsplus static fncts.io.SinkOps last
234
309
  * @tsplus location "@fncts/io/Sink/api"
235
310
  */
236
- export declare function last<In>(__tsplusTrace?: string): Sink<unknown, never, In, In, Maybe<In>>;
311
+ export declare function last<In>(__tsplusTrace?: string): Sink<never, never, In, In, Maybe<In>>;
237
312
  /**
313
+ * Creates a sink that does not consume any input but provides the given chunk
314
+ * as its leftovers
238
315
  * @tsplus static fncts.io.SinkOps leftover
239
316
  * @tsplus location "@fncts/io/Sink/api"
240
317
  */
241
- export declare function leftover<L>(c: Lazy<Conc<L>>, __tsplusTrace?: string): Sink<unknown, never, unknown, L, void>;
318
+ export declare function leftover<L>(c: Lazy<Conc<L>>, __tsplusTrace?: string): Sink<never, never, unknown, L, void>;
242
319
  /**
320
+ * Logs the specified message at the current log level.
243
321
  * @tsplus static fncts.io.SinkOps log
244
322
  * @tsplus location "@fncts/io/Sink/api"
245
323
  */
246
- export declare function log(message: Lazy<string>, __tsplusTrace?: string): Sink<unknown, never, unknown, never, void>;
324
+ export declare function log(message: Lazy<string>, __tsplusTrace?: string): Sink<never, never, unknown, never, void>;
247
325
  /**
248
326
  * A sink that collects all of its inputs into a chunk.
249
327
  * @tsplus static fncts.io.SinkOps collectAll
250
328
  * @tsplus location "@fncts/io/Sink/api"
251
329
  */
252
- export declare function makeCollectAll<In>(): Sink<unknown, never, In, never, Conc<In>>;
253
- export declare function makeCollectAllN<In>(n: Lazy<number>): Sink<unknown, never, In, In, Conc<In>>;
330
+ export declare function makeCollectAll<In>(): Sink<never, never, In, never, Conc<In>>;
331
+ /**
332
+ * A sink that collects first `n` elements into a chunk. Note that the chunk
333
+ * is preallocated and must fit in memory.
334
+ * @tsplus static fncts.io.SinkOps collectAllN
335
+ * @tsplus location "@fncts/io/Sink/api"
336
+ */
337
+ export declare function makeCollectAllN<In>(n: Lazy<number>): Sink<never, never, In, In, Conc<In>>;
254
338
  /**
255
339
  * A sink that executes the provided effectful function for every element fed to it.
256
340
  * @tsplus static fncts.io.SinkOps foreach
@@ -258,6 +342,8 @@ export declare function makeCollectAllN<In>(n: Lazy<number>): Sink<unknown, neve
258
342
  */
259
343
  export declare function makeForeach<R, Err, In>(f: (inp: In) => IO<R, Err, any>, __tsplusTrace?: string): Sink<R, Err, In, In, void>;
260
344
  /**
345
+ * A sink that executes the provided effectful function for every chunk fed to
346
+ * it.
261
347
  * @tsplus static fncts.io.SinkOps foreachChunk
262
348
  * @tsplus location "@fncts/io/Sink/api"
263
349
  */
@@ -270,80 +356,146 @@ export declare function makeForeachChunk<R, E, In>(f: (inp: Conc<In>) => IO<R, E
270
356
  */
271
357
  export declare function makeForeachWhile<R, Err, In>(f: (_: In) => IO<R, Err, boolean>, __tsplusTrace?: string): Sink<R, Err, In, In, void>;
272
358
  /**
359
+ * A sink that executes the provided effectful function for every chunk fed to
360
+ * it until `f` evaluates to `false`.
273
361
  * @tsplus static fncts.io.SinkOps foreachChunkWhile
274
362
  * @tsplus location "@fncts/io/Sink/api"
275
363
  */
276
364
  export declare function makeForeachChunkWhile<R, E, In>(f: (chunk: Conc<In>) => IO<R, E, boolean>, __tsplusTrace?: string): Sink<R, E, In, In, void>;
277
365
  /**
366
+ * A sink that folds its inputs with the provided function, termination
367
+ * predicate and initial state.
278
368
  * @tsplus static fncts.io.SinkOps fold
279
369
  * @tsplus location "@fncts/io/Sink/api"
280
370
  */
281
- export declare function makeFold<In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<unknown, never, In, In, S>;
371
+ export declare function makeFold<In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<never, never, In, In, S>;
282
372
  /**
373
+ * Creates a sink that folds elements of type `In` into a structure of type
374
+ * `S` until `max` elements have been folded.
375
+ *
376
+ * Like {@link foldWeighted }, but with a constant cost function of 1.
283
377
  * @tsplus static fncts.io.SinkOps foldUntil
284
378
  * @tsplus location "@fncts/io/Sink/api"
285
379
  */
286
- export declare function makeFoldUntil<In, S>(z: Lazy<S>, max: Lazy<number>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<unknown, never, In, In, S>;
380
+ export declare function makeFoldUntil<In, S>(z: Lazy<S>, max: Lazy<number>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<never, never, In, In, S>;
287
381
  /**
382
+ * A sink that folds its input chunks with the provided function, termination
383
+ * predicate and initial state. `contFn` condition is checked only for the
384
+ * initial value and at the end of processing of each chunk. `f` and `contFn`
385
+ * must preserve chunking-invariance.
288
386
  * @tsplus static fncts.io.SinkOps foldChunks
289
387
  * @tsplus location "@fncts/io/Sink/api"
290
388
  */
291
- export declare function makeFoldChunks<In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: Conc<In>) => S): Sink<unknown, never, In, never, S>;
389
+ export declare function makeFoldChunks<In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: Conc<In>) => S, __tsplusTrace?: string): Sink<never, never, In, never, S>;
292
390
  /**
391
+ * A sink that effectfully folds its input chunks with the provided function,
392
+ * termination predicate and initial state. `contFn` condition is checked only
393
+ * for the initial value and at the end of processing of each chunk. `f` and
394
+ * `contFn` must preserve chunking-invariance.
293
395
  * @tsplus static fncts.io.SinkOps foldChunksIO
294
396
  * @tsplus location "@fncts/io/Sink/api"
295
397
  */
296
- export declare function makeFoldChunksIO<Env, Err, In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: Conc<In>) => IO<Env, Err, S>): Sink<Env, Err, In, In, S>;
398
+ export declare function makeFoldChunksIO<Env, Err, In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: Conc<In>) => IO<Env, Err, S>, __tsplusTrace?: string): Sink<Env, Err, In, In, S>;
297
399
  /**
400
+ * A sink that folds its inputs with the provided function and initial state.
298
401
  * @tsplus static fncts.io.SinkOps foldLeft
299
402
  * @tsplus location "@fncts/io/Sink/api"
300
403
  */
301
- export declare function makeFoldLeft<In, S>(z: Lazy<S>, f: (s: S, inp: In) => S): Sink<unknown, never, In, never, S>;
404
+ export declare function makeFoldLeft<In, S>(z: Lazy<S>, f: (s: S, inp: In) => S): Sink<never, never, In, never, S>;
302
405
  /**
406
+ * A sink that folds its input chunks with the provided function and initial
407
+ * state. `f` must preserve chunking-invariance.
303
408
  * @tsplus static fncts.io.SinkOps foldLeftChunks
304
409
  * @tsplus location "@fncts/io/Sink/api"
305
410
  */
306
- export declare function makeFoldLeftChunks<In, S>(z: Lazy<S>, f: (s: S, inp: Conc<In>) => S): Sink<unknown, never, In, never, S>;
411
+ export declare function makeFoldLeftChunks<In, S>(z: Lazy<S>, f: (s: S, inp: Conc<In>) => S): Sink<never, never, In, never, S>;
307
412
  /**
413
+ * A sink that effectfully folds its input chunks with the provided function
414
+ * and initial state. `f` must preserve chunking-invariance.
308
415
  * @tsplus static fncts.io.SinkOps foldLeftChunksIO
309
416
  * @tsplus location "@fncts/io/Sink/api"
310
417
  */
311
- export declare function makeFoldLeftChunksIO<R, E, In, S>(z: Lazy<S>, f: (s: S, inp: Conc<In>) => IO<R, E, S>): Sink<R, E, In, In, S>;
418
+ export declare function makeFoldLeftChunksIO<R, E, In, S>(z: Lazy<S>, f: (s: S, inp: Conc<In>) => IO<R, E, S>, __tsplusTrace?: string): Sink<R, E, In, In, S>;
312
419
  /**
420
+ * A sink that effectfully folds its inputs with the provided function and
421
+ * initial state.
313
422
  * @tsplus static fncts.io.SinkOps foldLeftIO
314
423
  * @tsplus location "@fncts/io/Sink/api"
315
424
  */
316
- export declare function makeFoldLeftIO<R, E, In, S>(z: Lazy<S>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R, E, In, In, S>;
425
+ export declare function makeFoldLeftIO<R, E, In, S>(z: Lazy<S>, f: (s: S, inp: In) => IO<R, E, S>, __tsplusTrace?: string): Sink<R, E, In, In, S>;
317
426
  /**
427
+ * A sink that effectfully folds its inputs with the provided function,
428
+ * termination predicate and initial state.
318
429
  * @tsplus static fncts.io.SinkOps foldIO
319
430
  * @tsplus location "@fncts/io/Sink/api"
320
431
  */
321
432
  export declare function makeFoldIO<R, E, In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R, E, In, In, S>;
322
433
  /**
434
+ * Creates a sink that effectfully folds elements of type `In` into a
435
+ * structure of type `S` until `max` elements have been folded.
436
+ *
437
+ * Like {@link makeFoldWeightedIO }, but with a constant cost function of 1.
323
438
  * @tsplus static fncts.io.SinkOps foldUntilIO
324
439
  * @tsplus location "@fncts/io/Sink/api"
325
440
  */
326
- export declare function makeFoldUntilIO<R, E, In, S>(z: Lazy<S>, max: Lazy<number>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R, E, In, In, S>;
441
+ export declare function makeFoldUntilIO<R, E, In, S>(z: Lazy<S>, max: Lazy<number>, f: (s: S, inp: In) => IO<R, E, S>, __tsplusTrace?: string): Sink<R, E, In, In, S>;
327
442
  /**
443
+ * Creates a sink that folds elements of type `In` into a structure of type
444
+ * `S`, until `max` worth of elements (determined by the `costFn`) have been
445
+ * folded.
446
+ *
447
+ * The `decompose` function will be used for decomposing elements that cause
448
+ * an `S` aggregate to cross `max` into smaller elements.
449
+ *
450
+ *
451
+ * Be vigilant with this function, it has to generate "simpler" values or the
452
+ * fold may never end. A value is considered indivisible if `decompose` yields
453
+ * the empty chunk or a single-valued chunk. In these cases, there is no other
454
+ * choice than to yield a value that will cross the threshold.
455
+ *
456
+ * The {@link makeFoldWeightedDecomposeIO } allows the decompose function to return a
457
+ * `IO` value, and consequently it allows the sink to fail.
328
458
  * @tsplus static fncts.io.SinkOps foldWeightedDecompose
329
459
  * @tsplus location "@fncts/io/Sink/api"
330
460
  */
331
- export declare function makeFoldWeightedDecompose<In, S>(z: Lazy<S>, costFn: (s: S, inp: In) => number, max: Lazy<number>, decompose: (inp: In) => Conc<In>, f: (s: S, inp: In) => S): Sink<unknown, never, In, In, S>;
461
+ export declare function makeFoldWeightedDecompose<In, S>(z: Lazy<S>, costFn: (s: S, inp: In) => number, max: Lazy<number>, decompose: (inp: In) => Conc<In>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<never, never, In, In, S>;
332
462
  /**
463
+ * Creates a sink that effectfully folds elements of type `In` into a
464
+ * structure of type `S`, until `max` worth of elements (determined by the
465
+ * `costFn`) have been folded.
466
+ *
467
+ * The `decompose` function will be used for decomposing elements that cause
468
+ * an `S` aggregate to cross `max` into smaller elements. Be vigilant with
469
+ * this function, it has to generate "simpler" values or the fold may never
470
+ * end. A value is considered indivisible if `decompose` yields the empty
471
+ * chunk or a single-valued chunk. In these cases, there is no other choice
472
+ * than to yield a value that will cross the threshold.
333
473
  * @tsplus static fncts.io.SinkOps foldWeightedDecomposeIO
334
474
  * @tsplus location "@fncts/io/Sink/api"
335
475
  */
336
- export declare function makeFoldWeightedDecomposeIO<R, E, In, S, R1, E1, R2, E2>(z: Lazy<S>, costFn: (s: S, inp: In) => IO<R1, E1, number>, max: Lazy<number>, decompose: (inp: In) => IO<R2, E2, Conc<In>>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R & R1 & R2, E | E1 | E2, In, In, S>;
476
+ export declare function makeFoldWeightedDecomposeIO<R, E, In, S, R1, E1, R2, E2>(z: Lazy<S>, costFn: (s: S, inp: In) => IO<R1, E1, number>, max: Lazy<number>, decompose: (inp: In) => IO<R2, E2, Conc<In>>, f: (s: S, inp: In) => IO<R, E, S>, __tsplusTrace?: string): Sink<R | R1 | R2, E | E1 | E2, In, In, S>;
337
477
  /**
478
+ * Creates a sink that folds elements of type `In` into a structure of type
479
+ * `S`, until `max` worth of elements (determined by the `costFn`) have been
480
+ * folded.
481
+ * @note Elements that have an individual cost larger than `max` will force the
482
+ sink to cross the `max` cost. See {@link makeFoldWeightedDecompose } for a variant
483
+ that can handle these cases.
338
484
  * @tsplus static fncts.io.SinkOps foldWeighted
339
485
  * @tsplus location "@fncts/io/Sink/api"
340
486
  */
341
- export declare function makeFoldWeighted<In, S>(z: Lazy<S>, costFn: (s: S, inp: In) => number, max: Lazy<number>, f: (s: S, inp: In) => S): Sink<unknown, never, In, In, S>;
487
+ export declare function makeFoldWeighted<In, S>(z: Lazy<S>, costFn: (s: S, inp: In) => number, max: Lazy<number>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<never, never, In, In, S>;
342
488
  /**
489
+ * Creates a sink that effectfully folds elements of type `In` into a
490
+ * structure of type `S`, until `max` worth of elements (determined by the
491
+ * `costFn`) have been folded.
492
+ * @note Elements that have an individual cost larger than `max` will force the
493
+ sink to cross the `max` cost. See {@link makeFoldWeightedDecomposeIO } for a
494
+ variant that can handle these cases.
343
495
  * @tsplus static fncts.io.SinkOps foldWeightedIO
344
496
  * @tsplus location "@fncts/io/Sink/api"
345
497
  */
346
- export declare function makeFoldWeightedIO<R, E, In, S, R1, E1>(z: Lazy<S>, costFn: (s: S, inp: In) => IO<R, E, number>, max: Lazy<number>, f: (s: S, inp: In) => IO<R1, E1, S>): Sink<R & R1, E | E1, In, In, S>;
498
+ export declare function makeFoldWeightedIO<R, E, In, S, R1, E1>(z: Lazy<S>, costFn: (s: S, inp: In) => IO<R, E, number>, max: Lazy<number>, f: (s: S, inp: In) => IO<R1, E1, S>, __tsplusTrace?: string): Sink<R | R1, E | E1, In, In, S>;
347
499
  /**
348
500
  * Transforms this sink's result.
349
501
  * @tsplus fluent fncts.io.Sink map
@@ -361,7 +513,7 @@ export declare function mapError_<R, E, In, L, Z, E1>(self: Sink<R, E, In, L, Z>
361
513
  * @tsplus fluent fncts.io.Sink mapIO
362
514
  * @tsplus location "@fncts/io/Sink/api"
363
515
  */
364
- export declare function mapIO_<R, E, In, L, Z, R1, E1, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => IO<R1, E1, Z1>, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, Z1>;
516
+ export declare function mapIO_<R, E, In, L, Z, R1, E1, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => IO<R1, E1, Z1>, __tsplusTrace?: string): Sink<R | R1, E | E1, In, L, Z1>;
365
517
  /**
366
518
  * Runs this sink until it yields a result, then uses that result to create
367
519
  * another sink from the provided function which will continue to run until it
@@ -371,101 +523,129 @@ export declare function mapIO_<R, E, In, L, Z, R1, E1, Z1>(self: Sink<R, E, In,
371
523
  * @tsplus fluent fncts.io.Sink matchSink
372
524
  * @tsplus location "@fncts/io/Sink/api"
373
525
  */
374
- export declare function matchSink_<R, E, In, L, Z, R1, E1, In1 extends In, L1, Z1, R2, E2, In2 extends In, L2, Z2>(self: Sink<R, E, In, L, Z>, onFailure: (e: E) => Sink<R1, E1, In1, L1, Z1>, onSuccess: (z: Z) => Sink<R2, E2, In2, L2, Z2>, __tsplusTrace?: string): Sink<R & R1 & R2, E1 | E2, In1 & In2, L | L1 | L2, Z1 | Z2>;
526
+ export declare function matchSink_<R, E, In, L, Z, R1, E1, In1 extends In, L1, Z1, R2, E2, In2 extends In, L2, Z2>(self: Sink<R, E, In, L, Z>, onFailure: (e: E) => Sink<R1, E1, In1, L1, Z1>, onSuccess: (z: Z) => Sink<R2, E2, In2, L2, Z2>, __tsplusTrace?: string): Sink<R | R1 | R2, E1 | E2, In1 & In2, L | L1 | L2, Z1 | Z2>;
375
527
  /**
528
+ * Switch to another sink in case of failure
376
529
  * @tsplus fluent fncts.io.Sink orElse
377
530
  * @tsplus location "@fncts/io/Sink/api"
378
531
  */
379
- export declare function orElse<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R & R1, E | E1, In & In1, L | L1, Z | Z1>;
532
+ export declare function orElse<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Z | Z1>;
380
533
  /**
534
+ * Provides the sink with its required environment, which eliminates its
535
+ * dependency on `R`.
381
536
  * @tsplus fluent fncts.io.Sink provideEnvironment
382
537
  * @tsplus location "@fncts/io/Sink/api"
383
538
  */
384
- export declare function provideEnvironment<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, r: Lazy<Environment<R>>, __tsplusTrace?: string): Sink<unknown, E, In, L, Z>;
539
+ export declare function provideEnvironment<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, r: Lazy<Environment<R>>, __tsplusTrace?: string): Sink<never, E, In, L, Z>;
385
540
  /**
541
+ * Runs both sinks in parallel on the input, returning the result or the
542
+ * error from the one that finishes first.
386
543
  * @tsplus fluent fncts.io.Sink race
387
544
  * @tsplus location "@fncts/io/Sink/api"
388
545
  */
389
- export declare function race<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z | Z1>;
546
+ export declare function race<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Z | Z1>;
390
547
  /**
548
+ * Runs both sinks in parallel on the input, returning the result or the error
549
+ * from the one that finishes first.
391
550
  * @tsplus fluent fncts.io.Sink raceBoth
392
551
  * @tsplus location "@fncts/io/Sink/api"
393
552
  */
394
- export declare function raceBoth<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, capacity?: Lazy<number>): Sink<R & R1, E | E1, In & In1, L | L1, Either<Z, Z1>>;
553
+ export declare function raceBoth<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, capacity?: Lazy<number>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Either<Z, Z1>>;
395
554
  /**
555
+ * Runs both sinks in parallel on the input, using the specified merge
556
+ * function as soon as one result or the other has been computed.
396
557
  * @tsplus fluent fncts.io.Sink raceWith
397
558
  * @tsplus location "@fncts/io/Sink/api"
398
559
  */
399
- export declare function raceWith<R, E, In, L, Z, R1, E1, In1, L1, Z1, R2, E2, Z2, R3, E3, Z3>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, leftDone: (exit: Exit<E, Z>) => MergeDecision<R1, E1, Z1, E2, Z2>, rightDone: (exit: Exit<E1, Z1>) => MergeDecision<R, E, Z, E3, Z3>, capacity?: Lazy<number>, __tsplusTrace?: string): Sink<R & R1 & R2 & R3, E2 | E3, In & In1, L | L1, Z2 | Z3>;
560
+ export declare function raceWith<R, E, In, L, Z, R1, E1, In1, L1, Z1, R2, E2, Z2, R3, E3, Z3>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, leftDone: (exit: Exit<E, Z>) => MergeDecision<R1, E1, Z1, E2, Z2>, rightDone: (exit: Exit<E1, Z1>) => MergeDecision<R, E, Z, E3, Z3>, capacity?: Lazy<number>, __tsplusTrace?: string): Sink<R | R1 | R2 | R3, E2 | E3, In & In1, L | L1, Z2 | Z3>;
400
561
  /**
562
+ * Accesses the specified service in the environment of the effect.
401
563
  * @tsplus static fncts.io.SinkOps service
402
564
  * @tsplus location "@fncts/io/Sink/api"
403
565
  */
404
- export declare function service<S>(/** @tsplus auto */ tag: Tag<S>): Sink<Has<S>, never, unknown, never, S>;
566
+ export declare function service<S>(/** @tsplus auto */ tag: Tag<S>): Sink<S, never, unknown, never, S>;
405
567
  /**
568
+ * Accesses the specified service in the environment of the sink.
406
569
  * @tsplus static fncts.io.SinkOps serviceWith
407
570
  * @tsplus location "@fncts/io/Sink/api"
408
571
  */
409
572
  export declare function serviceWith<S, Z>(f: (service: S) => Z,
410
- /** @tsplus auto */ tag: Tag<S>): Sink<Has<S>, never, unknown, never, Z>;
573
+ /** @tsplus auto */ tag: Tag<S>): Sink<S, never, unknown, never, Z>;
411
574
  /**
575
+ * Accesses the specified service in the environment of the sink in the
576
+ * context of an effect.
412
577
  * @tsplus static fncts.io.SinkOps serviceWithIO
413
578
  * @tsplus location "@fncts/io/Sink/api"
414
579
  */
415
580
  export declare function serviceWithIO<S, R, E, Z>(f: (service: S) => IO<R, E, Z>,
416
- /** @tsplus auto */ tag: Tag<S>): Sink<Has<S> & R, E, unknown, never, Z>;
581
+ /** @tsplus auto */ tag: Tag<S>): Sink<S | R, E, unknown, never, Z>;
417
582
  /**
583
+ * Accesses the specified service in the environment of the sink in the
584
+ * context of a sink.
418
585
  * @tsplus static fncts.io.SinkOps serviceWithSink
419
586
  * @tsplus location "@fncts/io/Sink/api"
420
587
  */
421
588
  export declare function serviceWithSink<S, R, E, In, L, Z>(f: (service: S) => Sink<R, E, In, L, Z>,
422
- /** @tsplus auto */ tag: Tag<S>): Sink<Has<S> & R, E, In, L, Z>;
589
+ /** @tsplus auto */ tag: Tag<S>): Sink<S | R, E, In, L, Z>;
423
590
  /**
591
+ * Splits the sink on the specified predicate, returning a new sink that
592
+ * consumes elements until an element after the first satisfies the specified
593
+ * predicate.
424
594
  * @tsplus fluent fncts.io.Sink splitWhere
425
595
  * @tsplus location "@fncts/io/Sink/api"
426
596
  */
427
- export declare function splitWhere<R, E, In, L extends In, Z>(self: Sink<R, E, In, L, Z>, p: Predicate<In>): Sink<R, E, In, In, Z>;
597
+ export declare function splitWhere<R, E, In, L extends In, Z>(self: Sink<R, E, In, L, Z>, p: Predicate<In>, __tsplusTrace?: string): Sink<R, E, In, In, Z>;
428
598
  /**
599
+ * A sink that immediately ends with the specified value.
429
600
  * @tsplus static fncts.io.SinkOps succeed
430
601
  * @tsplus location "@fncts/io/Sink/api"
431
602
  */
432
- export declare function succeed<Z>(z: Lazy<Z>, __tsplusTrace?: string): Sink<unknown, never, unknown, never, Z>;
603
+ export declare function succeed<Z>(z: Lazy<Z>, __tsplusTrace?: string): Sink<never, never, unknown, never, Z>;
433
604
  /**
605
+ * A sink that immediately ends with the specified value.
434
606
  * @tsplus static fncts.io.SinkOps succeedNow
435
607
  * @tsplus location "@fncts/io/Sink/api"
436
608
  */
437
- export declare function succeedNow<Z>(z: Z, __tsplusTrace?: string): Sink<unknown, never, unknown, never, Z>;
609
+ export declare function succeedNow<Z>(z: Z, __tsplusTrace?: string): Sink<never, never, unknown, never, Z>;
438
610
  /**
611
+ * Summarize a sink by running an effect when the sink starts and again when
612
+ * it completes
439
613
  * @tsplus fluent fncts.io.Sink summarized
440
614
  * @tsplus location "@fncts/io/Sink/api"
441
615
  */
442
- export declare function summarized<R, E, In, L, Z, R1, E1, B, C>(self: Sink<R, E, In, L, Z>, summary: Lazy<IO<R1, E1, B>>, f: (b1: B, b2: B) => C, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, readonly [Z, C]>;
616
+ export declare function summarized<R, E, In, L, Z, R1, E1, B, C>(self: Sink<R, E, In, L, Z>, summary: Lazy<IO<R1, E1, B>>, f: (b1: B, b2: B) => C, __tsplusTrace?: string): Sink<R | R1, E | E1, In, L, readonly [Z, C]>;
443
617
  /**
444
618
  * @tsplus getter fncts.io.Sink timed
445
619
  * @tsplus location "@fncts/io/Sink/api"
446
620
  */
447
621
  export declare function timed<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, L, readonly [Z, Duration]>;
448
622
  /**
623
+ * Creates a sink produced from an effect.
449
624
  * @tsplus static fncts.io.SinkOps unwrap
450
625
  * @tsplus location "@fncts/io/Sink/api"
451
626
  */
452
- export declare function unwrap<R, E, R1, E1, In, L, Z>(io: Lazy<IO<R, E, Sink<R1, E1, In, L, Z>>>): Sink<R & R1, E | E1, In, L, Z>;
627
+ export declare function unwrap<R, E, R1, E1, In, L, Z>(io: Lazy<IO<R, E, Sink<R1, E1, In, L, Z>>>): Sink<R | R1, E | E1, In, L, Z>;
453
628
  /**
454
629
  * Creates a sink produced from a scoped effect.
455
630
  * @tsplus static fncts.io.SinkOps unwrapScoped
456
631
  * @tsplus location "@fncts/io/Sink/api"
457
632
  */
458
- export declare function unwrapScoped<R, E, R1, E1, In, L, Z>(scoped: Lazy<IO<Has<Scope> & R, E, Sink<R1, E1, In, L, Z>>>): Sink<R & R1, E | E1, In, L, Z>;
633
+ export declare function unwrapScoped<R, E, R1, E1, In, L, Z>(scoped: Lazy<IO<R, E, Sink<R1, E1, In, L, Z>>>, __tsplusTrace?: string): Sink<Exclude<R, Scope> | R1, E | E1, In, L, Z>;
459
634
  /**
635
+ * Feeds inputs to this sink until it yields a result, then switches over to
636
+ * the provided sink until it yields a result, finally combining the two
637
+ * results into a tuple.
460
638
  * @tsplus fluent fncts.io.Sink zip
461
639
  * @tsplus location "@fncts/io/Sink/api"
462
640
  */
463
- export declare function zip<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, readonly [Z, Z1]>;
641
+ export declare function zip<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, readonly [Z, Z1]>;
464
642
  /**
643
+ * Runs both sinks in parallel on the input and combines the results in a
644
+ * tuple.
465
645
  * @tsplus fluent fncts.io.Sink zipC
466
646
  * @tsplus location "@fncts/io/Sink/api"
467
647
  */
468
- export declare function zipC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, readonly [Z, Z1]>;
648
+ export declare function zipC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, readonly [Z, Z1]>;
469
649
  /**
470
650
  * Feeds inputs to this sink until it yields a result, then switches over to
471
651
  * the provided sink until it yields a result, finally combining the two
@@ -473,11 +653,11 @@ export declare function zipC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends
473
653
  * @tsplus fluent fncts.io.Sink zipWith
474
654
  * @tsplus location "@fncts/io/Sink/api"
475
655
  */
476
- export declare function zipWith<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1, Z2>(self: Lazy<Sink<R, E, In, L, Z>>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, f: (z: Z, z1: Z1) => Z2): Sink<R & R1, E | E1, In & In1, L | L1, Z2>;
656
+ export declare function zipWith<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1, Z2>(self: Lazy<Sink<R, E, In, L, Z>>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, f: (z: Z, z1: Z1) => Z2, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Z2>;
477
657
  /**
478
658
  * Runs both sinks in parallel on the input and combines the results using the
479
659
  * provided function.
480
660
  * @tsplus fluent fncts.io.Sink zipWithC
481
661
  * @tsplus location "@fncts/io/Sink/api"
482
662
  */
483
- export declare function zipWithC<R, E, In, L, Z, R1, E1, In1, L1, Z1, Z2>(self: Lazy<Sink<R, E, In, L, Z>>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, f: (z: Z, z1: Z1) => Z2): Sink<R & R1, E | E1, In & In1, L | L1, Z2>;
663
+ export declare function zipWithC<R, E, In, L, Z, R1, E1, In1, L1, Z1, Z2>(self: Lazy<Sink<R, E, In, L, Z>>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, f: (z: Z, z1: Z1) => Z2, __tsplusTrace?: string): Sink<R | R1, E | E1, In & In1, L | L1, Z2>;