@fncts/io 0.0.2 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/Channel/UpstreamPullRequest/api.d.ts +1 -1
  2. package/Channel/api.d.ts +2 -2
  3. package/Clock/api.d.ts +3 -1
  4. package/Clock/definition.d.ts +3 -1
  5. package/Clock/live.d.ts +2 -0
  6. package/Fiber/api/interruptFork.d.ts +1 -1
  7. package/FiberRef/constructors.d.ts +0 -53
  8. package/FiberRef/unsafe.d.ts +53 -0
  9. package/FiberRef.d.ts +1 -0
  10. package/Future/constructors.d.ts +3 -3
  11. package/IO/api/asyncIO.d.ts +6 -0
  12. package/IO/api/ensuringChildren.d.ts +7 -0
  13. package/IO/api/sequenceT.d.ts +2 -3
  14. package/IO/api/sleep.d.ts +3 -1
  15. package/IO/api/timeout.d.ts +14 -0
  16. package/IO/api.d.ts +2 -2
  17. package/IO/definition.d.ts +8 -4
  18. package/IO.d.ts +3 -0
  19. package/IOSpec.d.ts +10 -1
  20. package/InterruptStatus/constructors.d.ts +3 -3
  21. package/Latch.d.ts +3 -0
  22. package/Schedule/Decision.d.ts +1 -1
  23. package/Schedule/api.d.ts +1 -1
  24. package/Schedule.d.ts +0 -1
  25. package/Scope/Finalizer/definition.d.ts +1 -1
  26. package/Scope/ReleaseMap/definition.d.ts +1 -1
  27. package/Stream/api.d.ts +5 -22
  28. package/Stream/internal/DebounceState.d.ts +3 -3
  29. package/Stream/internal/Handoff.d.ts +9 -9
  30. package/Stream/internal/SinkEndReason.d.ts +6 -18
  31. package/TFuture/definition.d.ts +1 -1
  32. package/TSemaphore/definition.d.ts +1 -1
  33. package/_cjs/Cached.cjs +3 -3
  34. package/_cjs/Channel/ChildExecutorDecision.cjs +2 -2
  35. package/_cjs/Channel/UpstreamPullRequest/api.cjs +3 -3
  36. package/_cjs/Channel/UpstreamPullRequest/api.cjs.map +1 -1
  37. package/_cjs/Channel/UpstreamPullRequest.cjs +2 -2
  38. package/_cjs/Channel/UpstreamPullStrategy.cjs +1 -1
  39. package/_cjs/Channel/api/interruptWhen.cjs +1 -1
  40. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  41. package/_cjs/Channel/api/mapOutIOC.cjs +1 -1
  42. package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
  43. package/_cjs/Channel/api/mergeAllWith.cjs +1 -1
  44. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  45. package/_cjs/Channel/api/mergeWith.cjs +6 -6
  46. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  47. package/_cjs/Channel/api.cjs +14 -14
  48. package/_cjs/Channel/api.cjs.map +1 -1
  49. package/_cjs/Channel/core-api.cjs +1 -1
  50. package/_cjs/Channel/internal/ChannelExecutor.cjs +2 -2
  51. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  52. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +8 -7
  53. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  54. package/_cjs/Channel.cjs +3 -3
  55. package/_cjs/Clock/api.cjs.map +1 -1
  56. package/_cjs/Clock/live.cjs +1 -1
  57. package/_cjs/Clock/live.cjs.map +1 -1
  58. package/_cjs/Clock.cjs +3 -3
  59. package/_cjs/Console.cjs +3 -3
  60. package/_cjs/Fiber/FiberContext.cjs +58 -57
  61. package/_cjs/Fiber/FiberContext.cjs.map +1 -1
  62. package/_cjs/Fiber/api/interruptFork.cjs +1 -1
  63. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  64. package/_cjs/Fiber/constructors.cjs +2 -2
  65. package/_cjs/Fiber/constructors.cjs.map +1 -1
  66. package/_cjs/Fiber.cjs +23 -23
  67. package/_cjs/FiberRef/constructors.cjs +3 -84
  68. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  69. package/_cjs/FiberRef/unsafe.cjs +94 -0
  70. package/_cjs/FiberRef/unsafe.cjs.map +1 -0
  71. package/_cjs/FiberRef.cjs +18 -5
  72. package/_cjs/FiberRef.cjs.map +1 -1
  73. package/_cjs/FiberRefs/join.cjs +2 -2
  74. package/_cjs/FiberRefs/join.cjs.map +1 -1
  75. package/_cjs/FiberRefs.cjs +3 -3
  76. package/_cjs/FiberScope.cjs +2 -2
  77. package/_cjs/FiberState/constructors.cjs +1 -1
  78. package/_cjs/FiberState.cjs +3 -3
  79. package/_cjs/FiberStatus/constructors.cjs +1 -1
  80. package/_cjs/FiberStatus.cjs +2 -2
  81. package/_cjs/Future/constructors.cjs +2 -4
  82. package/_cjs/Future/constructors.cjs.map +1 -1
  83. package/_cjs/Future.cjs +3 -3
  84. package/_cjs/Hub.cjs +2 -2
  85. package/_cjs/IO/api/asyncIO.cjs +37 -0
  86. package/_cjs/IO/api/asyncIO.cjs.map +1 -0
  87. package/_cjs/IO/api/concurrency.cjs +1 -1
  88. package/_cjs/IO/api/core-scope.cjs +1 -1
  89. package/_cjs/IO/api/ensuringChildren.cjs +24 -0
  90. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -0
  91. package/_cjs/IO/api/environment.cjs +1 -1
  92. package/_cjs/IO/api/interrupt.cjs +5 -5
  93. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  94. package/_cjs/IO/api/sleep.cjs.map +1 -1
  95. package/_cjs/IO/api/timeout.cjs +42 -0
  96. package/_cjs/IO/api/timeout.cjs.map +1 -0
  97. package/_cjs/IO/api.cjs +41 -40
  98. package/_cjs/IO/api.cjs.map +1 -1
  99. package/_cjs/IO/definition.cjs +9 -6
  100. package/_cjs/IO/definition.cjs.map +1 -1
  101. package/_cjs/IO/runtime.cjs +2 -2
  102. package/_cjs/IO/runtime.cjs.map +1 -1
  103. package/_cjs/IO.cjs +86 -47
  104. package/_cjs/IO.cjs.map +1 -1
  105. package/_cjs/IOEnv/services.cjs +1 -1
  106. package/_cjs/IOEnv.cjs +3 -3
  107. package/_cjs/InterruptStatus/constructors.cjs +3 -7
  108. package/_cjs/InterruptStatus/constructors.cjs.map +1 -1
  109. package/_cjs/InterruptStatus.cjs +2 -2
  110. package/_cjs/Layer/api.cjs +5 -3
  111. package/_cjs/Layer/api.cjs.map +1 -1
  112. package/_cjs/Layer.cjs +3 -3
  113. package/_cjs/Logger.cjs +3 -3
  114. package/_cjs/Queue/api.cjs +7 -7
  115. package/_cjs/Queue.cjs +5 -5
  116. package/_cjs/Random.cjs +3 -3
  117. package/_cjs/Ref/Atomic/Atomic.cjs +3 -3
  118. package/_cjs/Ref/Atomic/api.cjs +10 -6
  119. package/_cjs/Ref/Atomic/api.cjs.map +1 -1
  120. package/_cjs/Ref/Atomic.cjs +2 -2
  121. package/_cjs/Ref/Derived.cjs +2 -2
  122. package/_cjs/Ref/DerivedAll.cjs +1 -1
  123. package/_cjs/Ref/Synchronized/api.cjs +1 -1
  124. package/_cjs/Ref/Synchronized/constructors.cjs +1 -1
  125. package/_cjs/Ref/Synchronized/definition.cjs +1 -1
  126. package/_cjs/Ref/api/get.cjs +1 -1
  127. package/_cjs/Ref/api/match.cjs +1 -1
  128. package/_cjs/Ref/api/matchAll.cjs +1 -1
  129. package/_cjs/Ref/api/modify.cjs +1 -1
  130. package/_cjs/Ref/api/set.cjs +1 -1
  131. package/_cjs/Ref/api.cjs +8 -8
  132. package/_cjs/Ref/constructors.cjs +1 -1
  133. package/_cjs/Ref.cjs +9 -9
  134. package/_cjs/STM/api/core-api.cjs +1 -1
  135. package/_cjs/STM/api/core-constructors.cjs +1 -1
  136. package/_cjs/STM/api.cjs +2 -2
  137. package/_cjs/STM/driver.cjs +1 -1
  138. package/_cjs/STM/internal/Entry.cjs +1 -1
  139. package/_cjs/STM/internal/Journal.cjs +2 -2
  140. package/_cjs/STM.cjs +5 -5
  141. package/_cjs/Schedule/Decision.cjs.map +1 -1
  142. package/_cjs/Schedule/api/driver.cjs +11 -9
  143. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  144. package/_cjs/Schedule/api.cjs +49 -49
  145. package/_cjs/Schedule/api.cjs.map +1 -1
  146. package/_cjs/Schedule.cjs +4 -17
  147. package/_cjs/Schedule.cjs.map +1 -1
  148. package/_cjs/Scope/Finalizer/definition.cjs +6 -4
  149. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  150. package/_cjs/Scope/Finalizer.cjs +1 -1
  151. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -1
  152. package/_cjs/Scope/ReleaseMap/api.cjs +1 -1
  153. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -1
  154. package/_cjs/Scope/ReleaseMap/definition.cjs +4 -2
  155. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  156. package/_cjs/Scope/ReleaseMap.cjs +3 -3
  157. package/_cjs/Scope/api.cjs +1 -1
  158. package/_cjs/Scope.cjs +2 -2
  159. package/_cjs/ScopedRef.cjs +2 -2
  160. package/_cjs/Sink/api.cjs +1 -1
  161. package/_cjs/Sink/api.cjs.map +1 -1
  162. package/_cjs/Sink.cjs +2 -2
  163. package/_cjs/State/api.cjs +2 -2
  164. package/_cjs/State/definition.cjs +1 -1
  165. package/_cjs/State.cjs +2 -2
  166. package/_cjs/Stream/api/zipAllWith.cjs +1 -1
  167. package/_cjs/Stream/api/zipWith.cjs +1 -1
  168. package/_cjs/Stream/api.cjs +308 -308
  169. package/_cjs/Stream/api.cjs.map +1 -1
  170. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
  171. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  172. package/_cjs/Stream/internal/SinkEndReason.cjs +2 -37
  173. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  174. package/_cjs/Stream.cjs +2 -2
  175. package/_cjs/Supervisor/constructors.cjs +1 -1
  176. package/_cjs/Supervisor.cjs +3 -3
  177. package/_cjs/TExit/constructors.cjs +1 -1
  178. package/_cjs/TExit.cjs +2 -2
  179. package/_cjs/TFuture/definition.cjs +4 -2
  180. package/_cjs/TFuture/definition.cjs.map +1 -1
  181. package/_cjs/TFuture.cjs +3 -3
  182. package/_cjs/TRef/api.cjs +2 -2
  183. package/_cjs/TRef/constructors.cjs +3 -3
  184. package/_cjs/TRef.cjs +3 -3
  185. package/_cjs/TSemaphore/api.cjs +1 -1
  186. package/_cjs/TSemaphore/definition.cjs +4 -2
  187. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  188. package/_cjs/TSemaphore.cjs +3 -3
  189. package/_cjs/collection/immutable/Conc.cjs +3 -3
  190. package/_mjs/Channel/UpstreamPullRequest/api.mjs +1 -2
  191. package/_mjs/Channel/UpstreamPullRequest/api.mjs.map +1 -1
  192. package/_mjs/Channel/api/interruptWhen.mjs +1 -1
  193. package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
  194. package/_mjs/Channel/api/mapOutIOC.mjs +1 -1
  195. package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
  196. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  197. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
  198. package/_mjs/Channel/api/mergeWith.mjs +6 -6
  199. package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
  200. package/_mjs/Channel/api.mjs +14 -14
  201. package/_mjs/Channel/api.mjs.map +1 -1
  202. package/_mjs/Channel/internal/ChannelExecutor.mjs +2 -2
  203. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  204. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +8 -7
  205. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
  206. package/_mjs/Clock/api.mjs.map +1 -1
  207. package/_mjs/Clock/live.mjs +1 -1
  208. package/_mjs/Clock/live.mjs.map +1 -1
  209. package/_mjs/Fiber/FiberContext.mjs +58 -57
  210. package/_mjs/Fiber/FiberContext.mjs.map +1 -1
  211. package/_mjs/Fiber/api/interruptFork.mjs +1 -1
  212. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  213. package/_mjs/Fiber/constructors.mjs +1 -1
  214. package/_mjs/Fiber/constructors.mjs.map +1 -1
  215. package/_mjs/FiberRef/constructors.mjs +3 -66
  216. package/_mjs/FiberRef/constructors.mjs.map +1 -1
  217. package/_mjs/FiberRef/unsafe.mjs +66 -0
  218. package/_mjs/FiberRef/unsafe.mjs.map +1 -0
  219. package/_mjs/FiberRef.mjs +2 -1
  220. package/_mjs/FiberRef.mjs.map +1 -1
  221. package/_mjs/FiberRefs/join.mjs +2 -2
  222. package/_mjs/FiberRefs/join.mjs.map +1 -1
  223. package/_mjs/Future/constructors.mjs +3 -4
  224. package/_mjs/Future/constructors.mjs.map +1 -1
  225. package/_mjs/IO/api/asyncIO.mjs +20 -0
  226. package/_mjs/IO/api/asyncIO.mjs.map +1 -0
  227. package/_mjs/IO/api/concurrency.mjs +1 -1
  228. package/_mjs/IO/api/ensuringChildren.mjs +11 -0
  229. package/_mjs/IO/api/ensuringChildren.mjs.map +1 -0
  230. package/_mjs/IO/api/environment.mjs +1 -1
  231. package/_mjs/IO/api/interrupt.mjs +4 -4
  232. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  233. package/_mjs/IO/api/sleep.mjs.map +1 -1
  234. package/_mjs/IO/api/timeout.mjs +23 -0
  235. package/_mjs/IO/api/timeout.mjs.map +1 -0
  236. package/_mjs/IO/api.mjs +41 -40
  237. package/_mjs/IO/api.mjs.map +1 -1
  238. package/_mjs/IO/definition.mjs +6 -4
  239. package/_mjs/IO/definition.mjs.map +1 -1
  240. package/_mjs/IO/runtime.mjs +2 -2
  241. package/_mjs/IO/runtime.mjs.map +1 -1
  242. package/_mjs/IO.mjs +3 -0
  243. package/_mjs/IO.mjs.map +1 -1
  244. package/_mjs/IOEnv/services.mjs +1 -1
  245. package/_mjs/InterruptStatus/constructors.mjs +3 -3
  246. package/_mjs/InterruptStatus/constructors.mjs.map +1 -1
  247. package/_mjs/Layer/api.mjs +4 -3
  248. package/_mjs/Layer/api.mjs.map +1 -1
  249. package/_mjs/Ref/Atomic/api.mjs +10 -6
  250. package/_mjs/Ref/Atomic/api.mjs.map +1 -1
  251. package/_mjs/Schedule/Decision.mjs.map +1 -1
  252. package/_mjs/Schedule/api/driver.mjs +10 -9
  253. package/_mjs/Schedule/api/driver.mjs.map +1 -1
  254. package/_mjs/Schedule/api.mjs +49 -49
  255. package/_mjs/Schedule/api.mjs.map +1 -1
  256. package/_mjs/Schedule.mjs +0 -1
  257. package/_mjs/Schedule.mjs.map +1 -1
  258. package/_mjs/Scope/Finalizer/definition.mjs +5 -4
  259. package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
  260. package/_mjs/Scope/ReleaseMap/definition.mjs +3 -2
  261. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  262. package/_mjs/Sink/api.mjs +1 -1
  263. package/_mjs/Sink/api.mjs.map +1 -1
  264. package/_mjs/Stream/api.mjs +308 -302
  265. package/_mjs/Stream/api.mjs.map +1 -1
  266. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
  267. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  268. package/_mjs/Stream/internal/SinkEndReason.mjs +1 -30
  269. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  270. package/_mjs/TFuture/definition.mjs +3 -2
  271. package/_mjs/TFuture/definition.mjs.map +1 -1
  272. package/_mjs/TSemaphore/definition.mjs +3 -2
  273. package/_mjs/TSemaphore/definition.mjs.map +1 -1
  274. package/_src/Channel/UpstreamPullRequest/api.ts +2 -3
  275. package/_src/Channel/api.ts +3 -3
  276. package/_src/Channel/internal/ChannelExecutor.ts +2 -2
  277. package/_src/Channel/internal/SingleProducerAsyncInput.ts +1 -0
  278. package/_src/Clock/api.ts +1 -1
  279. package/_src/Clock/definition.ts +1 -1
  280. package/_src/Clock/live.ts +2 -2
  281. package/_src/Fiber/FiberContext.ts +3 -2
  282. package/_src/Fiber/api/interruptFork.ts +1 -1
  283. package/_src/Fiber/constructors.ts +1 -1
  284. package/_src/FiberRef/constructors.ts +1 -78
  285. package/_src/FiberRef/unsafe.ts +79 -0
  286. package/_src/FiberRef.ts +1 -0
  287. package/_src/FiberRefs/join.ts +2 -2
  288. package/_src/Future/constructors.ts +1 -1
  289. package/_src/IO/api/asyncIO.ts +16 -0
  290. package/_src/IO/api/ensuringChildren.ts +11 -0
  291. package/_src/IO/api/interrupt.ts +2 -1
  292. package/_src/IO/api/sequenceT.ts +1 -1
  293. package/_src/IO/api/sleep.ts +1 -1
  294. package/_src/IO/api/timeout.ts +19 -0
  295. package/_src/IO/api.ts +6 -4
  296. package/_src/IO/definition.ts +8 -4
  297. package/_src/IO.ts +3 -0
  298. package/_src/InterruptStatus/constructors.ts +2 -0
  299. package/_src/Layer/api.ts +1 -1
  300. package/_src/Ref/Atomic/api.ts +4 -0
  301. package/_src/Schedule/Decision.ts +0 -2
  302. package/_src/Schedule/api/driver.ts +1 -1
  303. package/_src/Schedule/api.ts +0 -3
  304. package/_src/Schedule.ts +0 -1
  305. package/_src/Scope/Finalizer/definition.ts +1 -1
  306. package/_src/Scope/ReleaseMap/definition.ts +1 -1
  307. package/_src/Stream/api.ts +199 -134
  308. package/_src/Stream/internal/DebounceState.ts +2 -2
  309. package/_src/Stream/internal/Handoff.ts +9 -9
  310. package/_src/Stream/internal/SinkEndReason.ts +7 -25
  311. package/_src/TFuture/definition.ts +2 -2
  312. package/_src/TSemaphore/definition.ts +1 -1
  313. package/package.json +3 -3
  314. package/runTests.d.ts +1 -0
  315. package/Schedule/Interval.d.ts +0 -71
  316. package/_cjs/Schedule/Interval.cjs +0 -154
  317. package/_cjs/Schedule/Interval.cjs.map +0 -1
  318. package/_mjs/Schedule/Interval.mjs +0 -114
  319. package/_mjs/Schedule/Interval.mjs.map +0 -1
  320. package/_src/Schedule/Interval.ts +0 -103
@@ -1,4 +1,4 @@
1
- import type { UpstreamPullRequest } from "@fncts/io/Channel/UpstreamPullRequest";
1
+ import type { UpstreamPullRequest } from "@fncts/io/Channel/UpstreamPullRequest/definition";
2
2
  /**
3
3
  * @tsplus fluent fncts.io.Channel.UpstreamPullRequest match
4
4
  * @tsplus location "@fncts/io/Channel/UpstreamPullRequest/api"
package/Channel/api.d.ts CHANGED
@@ -228,7 +228,7 @@ export declare function fromInput<Err, Elem, Done>(input: AsyncInputConsumer<Err
228
228
  * @tsplus static fncts.io.ChannelOps fromIO
229
229
  * @tsplus location "@fncts/io/Channel/api"
230
230
  */
231
- export declare function fromIO<R, E, A>(io: IO<R, E, A>): Channel<R, unknown, unknown, unknown, E, never, A>;
231
+ export declare function fromIO<R, E, A>(io: Lazy<IO<R, E, A>>): Channel<R, unknown, unknown, unknown, E, never, A>;
232
232
  /**
233
233
  * @tsplus static fncts.io.ChannelOps fromOption
234
234
  * @tsplus location "@fncts/io/Channel/api"
@@ -411,7 +411,7 @@ export declare const unit: Channel<unknown, unknown, unknown, unknown, never, ne
411
411
  * @tsplus static fncts.io.ChannelOps unwrap
412
412
  * @tsplus location "@fncts/io/Channel/api"
413
413
  */
414
- export declare function unwrap<R, E, Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: IO<R, E, Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>>): Channel<R & Env, InErr, InElem, InDone, E | OutErr, OutElem, OutDone>;
414
+ export declare function unwrap<R, E, Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: Lazy<IO<R, E, Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>>>): Channel<R & Env, InErr, InElem, InDone, E | OutErr, OutElem, OutDone>;
415
415
  /**
416
416
  * Makes a channel from a managed that returns a channel in case of success
417
417
  * @tsplus static fncts.io.ChannelOps unwrapScoped
package/Clock/api.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { Lazy } from "@fncts/base/data/function";
2
+ import { Duration } from "@fncts/base/data/Duration";
1
3
  import { UIO } from "@fncts/io/IO/definition";
2
4
  /**
3
5
  * @tsplus static fncts.io.ClockOps currentTime
@@ -8,4 +10,4 @@ export declare const currentTime: import("../IO").IO<unknown, never, number>;
8
10
  * @tsplus static fncts.io.ClockOps sleep
9
11
  * @tsplus location "@fncts/io/Clock/api"
10
12
  */
11
- export declare function sleep(duration: number, __tsplusTrace?: string): UIO<void>;
13
+ export declare function sleep(duration: Lazy<Duration>, __tsplusTrace?: string): UIO<void>;
@@ -1,11 +1,13 @@
1
1
  import { UIO } from "@fncts/io/IO/definition";
2
+ import { Lazy } from "@fncts/base/data/function";
3
+ import { Duration } from "@fncts/base/data/Duration";
2
4
  /**
3
5
  * @tsplus type fncts.io.Clock
4
6
  * @tsplus companion fncts.io.ClockOps
5
7
  */
6
8
  export declare abstract class Clock {
7
9
  abstract readonly currentTime: UIO<number>;
8
- abstract sleep(duration: number, __tsplusTrace?: string): UIO<void>;
10
+ abstract sleep(duration: Lazy<Duration>, __tsplusTrace?: string): UIO<void>;
9
11
  }
10
12
  /**
11
13
  * @tsplus static fncts.io.ClockOps Tag
package/Clock/live.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { UIO } from "@fncts/io/IO/definition";
2
+ import { Lazy } from "@fncts/base/data/function";
3
+ import { Duration } from "@fncts/base/data/Duration";
2
4
  import { Clock } from "@fncts/io/Clock/definition";
3
5
  /**
4
6
  * @tsplus static fncts.io.ClockOps Live
@@ -7,4 +7,4 @@ import { UIO } from "@fncts/io/IO/definition";
7
7
  * @tsplus getter fncts.io.Fiber interruptFork
8
8
  * @tsplus location "@fncts/io/Fiber/api/interruptFork"
9
9
  */
10
- export declare function interruptFork<E, A>(fiber: Fiber<E, A>): UIO<void>;
10
+ export declare function interruptFork<E, A>(fiber: Fiber<E, A>, __tsplusTrace?: string): UIO<void>;
@@ -2,62 +2,9 @@ import { Lazy } from "@fncts/base/data/function";
2
2
  import { IO } from "@fncts/io/IO/definition";
3
3
  import { Has } from "@fncts/base/typeclass/Has";
4
4
  import { Scope } from "@fncts/io/Scope/definition";
5
- import { Environment } from "@fncts/base/data/Environment";
6
5
  import { FiberRef } from "@fncts/io/FiberRef/definition";
7
- import { Maybe } from "@fncts/base/data/Maybe";
8
- import { FiberScope } from "@fncts/io/FiberScope/definition";
9
- import { LogLevel } from "@fncts/io/LogLevel";
10
- import { List } from "@fncts/base/collection/immutable/List";
11
- import { HashMap } from "@fncts/base/collection/immutable/HashMap";
12
- import type { LogSpan } from "@fncts/io/LogSpan";
13
- import { Patch } from "@fncts/base/data/Patch";
14
- /**
15
- * @tsplus static fncts.io.FiberRefOps unsafeMakePatch
16
- * @tsplus location "@fncts/io/FiberRef/constructors"
17
- */
18
- export declare function unsafeMakePatch<Value, Patch>(initial: Value, diff: (oldValue: Value, newValue: Value) => Patch, combine: (first: Patch, second: Patch) => Patch, patch: (patch: Patch) => (oldValue: Value) => Value, fork: Patch): FiberRef.WithPatch<Value, Patch>;
19
- /**
20
- * @tsplus static fncts.io.FiberRefOps unsafeMakeEnvironment
21
- * @tsplus location "@fncts/io/FiberRef/constructors"
22
- */
23
- export declare function unsafeMakeEnvironment<A>(initial: Environment<A>): FiberRef.WithPatch<Environment<A>, Patch<A, A>>;
24
- /**
25
- * @tsplus static fncts.io.FiberRefOps unsafeMake
26
- * @tsplus location "@fncts/io/FiberRef/constructors"
27
- */
28
- export declare function unsafeMake<A>(initial: A, fork?: (a: A) => A, join?: (a0: A, a1: A) => A): FiberRef.WithPatch<A, (_: A) => A>;
29
6
  /**
30
7
  * @tsplus static fncts.io.FiberRefOps make
31
8
  * @tsplus location "@fncts/io/FiberRef/constructors"
32
9
  */
33
10
  export declare function make<A>(initial: A, fork?: (a: A) => A, join?: (a: A, a1: A) => A): IO<Has<Scope>, never, FiberRef<A>>;
34
- /**
35
- * @tsplus static fncts.io.FiberRefOps forkScopeOverride
36
- * @tsplus location "@fncts/io/FiberRef/constructors"
37
- */
38
- export declare const forkScopeOverride: import("@fncts/io/FiberRef/definition").FiberRef.WithPatch<import("@fncts/base/data/Maybe").Maybe<import("../FiberScope").FiberScope>, (_: import("@fncts/base/data/Maybe").Maybe<import("../FiberScope").FiberScope>) => import("@fncts/base/data/Maybe").Maybe<import("../FiberScope").FiberScope>>;
39
- /**
40
- * @tsplus static fncts.io.FiberRefOps currentEnvironment
41
- * @tsplus location "@fncts/io/FiberRef/constructors"
42
- */
43
- export declare const currentEnvironment: import("@fncts/io/FiberRef/definition").FiberRef.WithPatch<import("@fncts/base/data/Environment").Environment<unknown>, Patch<unknown, unknown>>;
44
- /**
45
- * @tsplus static fncts.io.FiberRefOps fiberName
46
- * @tsplus location "@fncts/io/FiberRef/constructors"
47
- */
48
- export declare const fiberName: import("@fncts/io/FiberRef/definition").FiberRef.WithPatch<import("@fncts/base/data/Maybe").Maybe<string>, (_: import("@fncts/base/data/Maybe").Maybe<string>) => import("@fncts/base/data/Maybe").Maybe<string>>;
49
- /**
50
- * @tsplus static fncts.io.FiberRefOps currentLogLevel
51
- * @tsplus location "@fncts/io/FiberRef/constructors"
52
- */
53
- export declare const currentLogLevel: import("@fncts/io/FiberRef/definition").FiberRef.WithPatch<import("../LogLevel").LogLevel, (_: import("../LogLevel").LogLevel) => import("../LogLevel").LogLevel>;
54
- /**
55
- * @tsplus static fncts.io.FiberRefOps currentLogSpan
56
- * @tsplus location "@fncts/io/FiberRef/constructors"
57
- */
58
- export declare const currentLogSpan: import("@fncts/io/FiberRef/definition").FiberRef.WithPatch<import("@fncts/base/collection/immutable/List").List<LogSpan>, (_: import("@fncts/base/collection/immutable/List").List<LogSpan>) => import("@fncts/base/collection/immutable/List").List<LogSpan>>;
59
- /**
60
- * @tsplus static fncts.io.FiberRefOps currentLogAnnotations
61
- * @tsplus location "@fncts/io/FiberRef/constructors"
62
- */
63
- export declare const currentLogAnnotations: import("@fncts/io/FiberRef/definition").FiberRef.WithPatch<import("@fncts/base/collection/immutable/HashMap").HashMap<string, string>, (_: import("@fncts/base/collection/immutable/HashMap").HashMap<string, string>) => import("@fncts/base/collection/immutable/HashMap").HashMap<string, string>>;
@@ -0,0 +1,53 @@
1
+ import { Environment } from "@fncts/base/data/Environment";
2
+ import { Maybe } from "@fncts/base/data/Maybe";
3
+ import { FiberScope } from "@fncts/io/FiberScope/definition";
4
+ import { LogLevel } from "@fncts/io/LogLevel";
5
+ import { List } from "@fncts/base/collection/immutable/List";
6
+ import { HashMap } from "@fncts/base/collection/immutable/HashMap";
7
+ import type { LogSpan } from "../LogSpan.js";
8
+ import { Patch } from "@fncts/base/data/Patch";
9
+ /**
10
+ * @tsplus static fncts.io.FiberRefOps unsafeMakePatch
11
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
12
+ */
13
+ export declare function unsafeMakePatch<Value, Patch>(initial: Value, diff: (oldValue: Value, newValue: Value) => Patch, combine: (first: Patch, second: Patch) => Patch, patch: (patch: Patch) => (oldValue: Value) => Value, fork: Patch): FiberRef.WithPatch<Value, Patch>;
14
+ /**
15
+ * @tsplus static fncts.io.FiberRefOps unsafeMakeEnvironment
16
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
17
+ */
18
+ export declare function unsafeMakeEnvironment<A>(initial: Environment<A>): FiberRef.WithPatch<Environment<A>, Patch<A, A>>;
19
+ /**
20
+ * @tsplus static fncts.io.FiberRefOps unsafeMake
21
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
22
+ */
23
+ export declare function unsafeMake<A>(initial: A, fork?: (a: A) => A, join?: (a0: A, a1: A) => A): FiberRef.WithPatch<A, (_: A) => A>;
24
+ /**
25
+ * @tsplus static fncts.io.FiberRefOps forkScopeOverride
26
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
27
+ */
28
+ export declare const forkScopeOverride: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/data/Maybe.js").Maybe<import("../FiberScope.js").FiberScope>, (_: import("@fncts/base/data/Maybe.js").Maybe<import("../FiberScope.js").FiberScope>) => import("@fncts/base/data/Maybe.js").Maybe<import("../FiberScope.js").FiberScope>>;
29
+ /**
30
+ * @tsplus static fncts.io.FiberRefOps currentEnvironment
31
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
32
+ */
33
+ export declare const currentEnvironment: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/data/Environment.js").Environment<unknown>, Patch<unknown, unknown>>;
34
+ /**
35
+ * @tsplus static fncts.io.FiberRefOps fiberName
36
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
37
+ */
38
+ export declare const fiberName: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/data/Maybe.js").Maybe<string>, (_: import("@fncts/base/data/Maybe.js").Maybe<string>) => import("@fncts/base/data/Maybe.js").Maybe<string>>;
39
+ /**
40
+ * @tsplus static fncts.io.FiberRefOps currentLogLevel
41
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
42
+ */
43
+ export declare const currentLogLevel: import("./definition.js").FiberRef.WithPatch<import("../LogLevel.js").LogLevel, (_: import("../LogLevel.js").LogLevel) => import("../LogLevel.js").LogLevel>;
44
+ /**
45
+ * @tsplus static fncts.io.FiberRefOps currentLogSpan
46
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
47
+ */
48
+ export declare const currentLogSpan: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/collection/immutable/List.js").List<LogSpan>, (_: import("@fncts/base/collection/immutable/List.js").List<LogSpan>) => import("@fncts/base/collection/immutable/List.js").List<LogSpan>>;
49
+ /**
50
+ * @tsplus static fncts.io.FiberRefOps currentLogAnnotations
51
+ * @tsplus location "@fncts/io/FiberRef/unsafe"
52
+ */
53
+ export declare const currentLogAnnotations: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/collection/immutable/HashMap.js").HashMap<string, string>, (_: import("@fncts/base/collection/immutable/HashMap.js").HashMap<string, string>) => import("@fncts/base/collection/immutable/HashMap.js").HashMap<string, string>>;
package/FiberRef.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./FiberRef/api.js";
2
2
  export * from "./FiberRef/constructors.js";
3
3
  export * from "./FiberRef/definition.js";
4
+ export * from "./FiberRef/unsafe.js";
4
5
  export * from "./FiberRef/api/locallyScoped.js";
5
6
  export * from "./FiberRef/api/locallyScopedWith.js";
@@ -1,6 +1,6 @@
1
1
  import { IO } from "@fncts/io/IO/definition";
2
- import { Future } from "@fncts/io/Future";
3
2
  import { FiberId } from "@fncts/base/data/FiberId";
3
+ import { Future } from "@fncts/io/Future/definition";
4
4
  /**
5
5
  * Makes a new future to be completed by the fiber creating the future.
6
6
  * @tsplus static fncts.io.FutureOps make
@@ -12,10 +12,10 @@ export declare function make<E, A>(): IO<unknown, never, Future<E, A>>;
12
12
  * @tsplus static fncts.io.FutureOps makeAs
13
13
  * @tsplus location "@fncts/io/Future/constructors"
14
14
  */
15
- export declare function makeAs<E, A>(fiberId: FiberId): import("../IO").UIO<import("@fncts/io/Future/definition").Future<E, A>>;
15
+ export declare function makeAs<E, A>(fiberId: FiberId): import("../IO").UIO<Future<E, A>>;
16
16
  /**
17
17
  * Makes a new future to be completed by the fiber with the specified id.
18
18
  * @tsplus static fncts.io.FutureOps unsafeMake
19
19
  * @tsplus location "@fncts/io/Future/constructors"
20
20
  */
21
- export declare function unsafeMake<E, A>(fiberId: FiberId): import("@fncts/io/Future/definition").Future<E, A>;
21
+ export declare function unsafeMake<E, A>(fiberId: FiberId): Future<E, A>;
@@ -0,0 +1,6 @@
1
+ import { IO } from "@fncts/io/IO/definition";
2
+ /**
3
+ * @tsplus static fncts.io.IOOps asyncIO
4
+ * @tsplus location "@fncts/io/IO/api/asyncIO"
5
+ */
6
+ export declare function asyncIO<R, E, A>(register: (k: (_: IO<R, E, A>) => void) => IO<R, E, void>): IO<R, E, A>;
@@ -0,0 +1,7 @@
1
+ import { IO } from "@fncts/io/IO/definition";
2
+ import { Conc } from "@fncts/base/collection/immutable/Conc";
3
+ /**
4
+ * @tsplus fluent fncts.io.IO ensuringChildren
5
+ * @tsplus location "@fncts/io/IO/api/ensuringChildren"
6
+ */
7
+ export declare function ensuringChildren<R, E, A, R1>(self: IO<R, E, A>, children: (_: Conc<Fiber.Runtime<any, any>>) => IO<R1, never, void>): IO<R & R1, E, A>;
@@ -1,10 +1,9 @@
1
1
  import { ReadonlyNonEmptyArray } from "@fncts/base/collection/immutable/ImmutableNonEmptyArray";
2
2
  import { IO } from "@fncts/io/IO/definition";
3
- import type { _A, _E, _R } from "@fncts/base/types";
4
3
  /**
5
4
  * @tsplus static fncts.io.IOOps sequenceT
6
5
  * @tsplus location "@fncts/io/IO/api/sequenceT"
7
6
  */
8
- export declare function sequenceT<T extends ReadonlyNonEmptyArray<IO<any, any, any>>>(...ios: T): IO<_R<T[number]>, _E<T[number]>, {
9
- [K in keyof T]: _A<T[K]>;
7
+ export declare function sequenceT<T extends ReadonlyNonEmptyArray<IO<any, any, any>>>(...ios: T): IO<HKT._R<T[number]>, HKT._E<T[number]>, {
8
+ [K in keyof T]: HKT._A<T[K]>;
10
9
  }>;
package/IO/api/sleep.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import { Lazy } from "@fncts/base/data/function";
2
+ import { Duration } from "@fncts/base/data/Duration";
1
3
  import { UIO } from "@fncts/io/IO/definition";
2
4
  /**
3
5
  * @tsplus static fncts.io.IOOps sleep
4
6
  * @tsplus location "@fncts/io/IO/api/sleep"
5
7
  */
6
- export declare function sleep(duration: number, __tsplusTrace?: string): UIO<void>;
8
+ export declare function sleep(duration: Lazy<Duration>, __tsplusTrace?: string): UIO<void>;
@@ -0,0 +1,14 @@
1
+ import { IO } from "@fncts/io/IO/definition";
2
+ import { Lazy } from "@fncts/base/data/function";
3
+ import { Duration } from "@fncts/base/data/Duration";
4
+ import { Maybe } from "@fncts/base/data/Maybe";
5
+ /**
6
+ * @tsplus fluent fncts.io.IO timeoutTo
7
+ * @tsplus location "@fncts/io/IO/api/timeout"
8
+ */
9
+ export declare function timeoutTo<R, E, A, B, B1>(self: IO<R, E, A>, duration: Lazy<Duration>, b: Lazy<B>, f: (a: A) => B1, __tsplusTrace?: string): IO<R, E, B | B1>;
10
+ /**
11
+ * @tsplus fluent fncts.io.IO timeout
12
+ * @tsplus location "@fncts/io/IO/api/timeout"
13
+ */
14
+ export declare function timeout<R, E, A>(self: IO<R, E, A>, duration: Lazy<Duration>): IO<R, E, Maybe<A>>;
package/IO/api.d.ts CHANGED
@@ -390,11 +390,11 @@ export declare function flatten<R, E, R1, E1, A>(self: IO<R, E, IO<R1, E1, A>>):
390
390
  export declare function foldLeft_<A, B, R, E>(as: Iterable<A>, b: B, f: (b: B, a: A) => IO<R, E, B>, __tsplusTrace?: string): IO<R, E, B>;
391
391
  /**
392
392
  * Combines an array of `IO`s using a `Monoid`
393
- * @constrained
394
393
  * @tsplus static fncts.io.IOOps foldMap
395
394
  * @tsplus location "@fncts/io/IO/api"
396
395
  */
397
- export declare function foldMap_<M>(M: P.Monoid<M>): <R, E, A>(as: Iterable<IO<R, E, A>>, f: (a: A) => M) => IO<R, E, M>;
396
+ export declare function foldMap_<R, E, A, M>(as: Iterable<IO<R, E, A>>, f: (a: A) => M,
397
+ /** @tsplus auto */ M: P.Monoid<M>): IO<R, E, M>;
398
398
  /**
399
399
  * Performs a right-associative fold of an `Iterable<A>`
400
400
  * @tsplus static fncts.io.IOOps foldRight
@@ -17,15 +17,19 @@ import type { Trace as Trace_ } from "@fncts/base/data/Trace";
17
17
  import type { FiberContext } from "@fncts/io/Fiber/FiberContext";
18
18
  export declare const IOTypeId: unique symbol;
19
19
  export declare type IOTypeId = typeof IOTypeId;
20
+ export interface IOF extends IO<any, any, any> {
21
+ }
20
22
  /**
21
23
  * @tsplus type fncts.io.IO
22
24
  * @tsplus companion fncts.io.IOOps
23
25
  */
24
26
  export declare abstract class IO<R, E, A> {
25
27
  readonly _typeId: IOTypeId;
26
- readonly _R: (_: R) => void;
27
- readonly _E: () => E;
28
- readonly _A: () => A;
28
+ readonly [HKT.F]: IOF;
29
+ readonly [HKT.R]: (_: R) => void;
30
+ readonly [HKT.E]: () => E;
31
+ readonly [HKT.A]: () => A;
32
+ readonly [HKT.T]: IO<HKT._R<this>, HKT._E<this>, HKT._A<this>>;
29
33
  }
30
34
  /**
31
35
  * @tsplus type fncts.io.IOAspects
@@ -324,7 +328,7 @@ export declare class SetRuntimeConfig extends IO<unknown, never, void> {
324
328
  }
325
329
  export declare type Instruction = Chain<any, any, any, any, any, any> | SucceedNow<any> | Succeed<any> | SucceedWith<any> | Async<any, any, any, any> | Match<any, any, any, any, any, any, any, any, any> | Fork<any, any, any> | SetInterrupt<any, any, any> | GetInterrupt<any, any, any> | Fail<any> | GetDescriptor<any, any, any> | Yield | Defer<any, any, any> | DeferWith<any, any, any> | FiberRefModify<any, any> | FiberRefLocally<any, any, any, any> | FiberRefDelete | FiberRefWith<any, any, any, any, any> | FiberRefModifyAll<any> | Race<any, any, any, any, any, any, any, any, any, any, any, any> | Supervise<any, any, any> | GetForkScope<any, any, any> | OverrideForkScope<any, any, any> | Trace | GetRuntimeConfig<any, any, any> | Ensuring<any, any, any, any> | Logged | SetRuntimeConfig;
326
330
  /**
327
- * @optimize identity
331
+ * @tsplus macro identity
328
332
  */
329
333
  export declare function concrete(_: IO<any, any, any>): Instruction;
330
334
  export declare type Canceler<R> = URIO<R, void>;
package/IO.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./IO/api/acquireReleaseInterruptible.js";
7
7
  export * from "./IO/api/acquireReleaseInterruptibleExit.js";
8
8
  export * from "./IO/api/addFinalizer.js";
9
9
  export * from "./IO/api/addFinalizerExit.js";
10
+ export * from "./IO/api/asyncIO.js";
10
11
  export * from "./IO/api/bracket.js";
11
12
  export * from "./IO/api/bracketExit.js";
12
13
  export * from "./IO/api/clockWith.js";
@@ -14,6 +15,7 @@ export * from "./IO/api/concurrency.js";
14
15
  export * from "./IO/api/concurrentFinalizers.js";
15
16
  export * from "./IO/api/consoleWith.js";
16
17
  export * from "./IO/api/core-scope.js";
18
+ export * from "./IO/api/ensuringChildren.js";
17
19
  export * from "./IO/api/environment.js";
18
20
  export * from "./IO/api/foreachC.js";
19
21
  export * from "./IO/api/foreachExec.js";
@@ -39,6 +41,7 @@ export * from "./IO/api/scopeWith.js";
39
41
  export * from "./IO/api/sequenceT.js";
40
42
  export * from "./IO/api/sleep.js";
41
43
  export * from "./IO/api/stateful.js";
44
+ export * from "./IO/api/timeout.js";
42
45
  export * from "./IO/api/withChildren.js";
43
46
  export * from "./IO/api/withFinalizer.js";
44
47
  export * from "./IO/api/withFinalizerExit.js";
package/IOSpec.d.ts CHANGED
@@ -1,3 +1,12 @@
1
1
  import { IO } from "@fncts/io/IO";
2
2
  import { Exit } from "@fncts/base/data/Exit";
3
- export {};
3
+ import { UIO } from "@fncts/io/IO/definition";
4
+ import { Has } from "@fncts/base/typeclass/Has";
5
+ import { Ref } from "@fncts/io/Ref";
6
+ import { Fiber } from "@fncts/io/Fiber/definition";
7
+ import { Live } from "@fncts/test/control/Live";
8
+ declare class IOSpec extends DefaultRunnableSpec {
9
+ spec: import("@fncts/test/control/Spec.js").Spec<import("@fncts/base/typeclass.js").Has<Live>, import("@fncts/test/data/TestFailure.js").AssertionFailure | import("@fncts/test/data/TestFailure.js").RuntimeFailure<import("@fncts/test/data/TestFailure.js").AssertionFailure | import("@fncts/test/data/TestFailure.js").RuntimeFailure<import("@fncts/base/collection/immutable/Conc.js").Conc<number>> | import("@fncts/test/data/TestFailure.js").RuntimeFailure<import("@fncts/base/collection/immutable/Conc.js").Conc<void>>>>;
10
+ }
11
+ declare const _default: IOSpec;
12
+ export default _default;
@@ -1,14 +1,14 @@
1
- import { InterruptStatus } from "@fncts/io/InterruptStatus";
1
+ import { InterruptStatus } from "./definition.js";
2
2
  /**
3
3
  * @tsplus static fncts.InterruptStatusOps interruptible
4
4
  * @tsplus location "@fncts/io/InterruptStatus/constructors"
5
5
  */
6
- export declare const interruptible: import("./definition").InterruptStatus;
6
+ export declare const interruptible: InterruptStatus;
7
7
  /**
8
8
  * @tsplus static fncts.InterruptStatusOps uninterruptible
9
9
  * @tsplus location "@fncts/io/InterruptStatus/constructors"
10
10
  */
11
- export declare const uninterruptible: import("./definition").InterruptStatus;
11
+ export declare const uninterruptible: InterruptStatus;
12
12
  /**
13
13
  * @tsplus static fncts.InterruptStatusOps fromBoolean
14
14
  * @tsplus location "@fncts/io/InterruptStatus/constructors"
package/Latch.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { UIO } from "@fncts/io/IO/definition";
2
+ import { IO } from "@fncts/io/IO";
3
+ export declare function withLatch<R, E, A>(f: (_: UIO<void>) => IO<R, E, A>): IO<R, E, A>;
@@ -1,4 +1,4 @@
1
- import type { Interval } from "./Interval.js";
1
+ import { Interval } from "@fncts/base/data/Interval";
2
2
  export declare const enum DecisionTag {
3
3
  Continue = "Continue",
4
4
  Done = "Done"
package/Schedule/api.d.ts CHANGED
@@ -3,10 +3,10 @@ import { Either } from "@fncts/base/data/Either";
3
3
  import { Lazy } from "@fncts/base/data/function";
4
4
  import { Environment } from "@fncts/base/data/Environment";
5
5
  import { Maybe } from "@fncts/base/data/Maybe";
6
+ import { Interval } from "@fncts/base/data/Interval";
6
7
  import { Conc } from "@fncts/base/collection/immutable/Conc";
7
8
  import { List } from "@fncts/base/collection/immutable/List";
8
9
  import { Decision } from "./Decision.js";
9
- import { Interval } from "./Interval.js";
10
10
  /**
11
11
  * @tsplus static fncts.io.ScheduleOps __call
12
12
  * @tsplus location "@fncts/io/Schedule/api"
package/Schedule.d.ts CHANGED
@@ -2,4 +2,3 @@ export * from "./Schedule/api.js";
2
2
  export * from "./Schedule/Decision.js";
3
3
  export * from "./Schedule/definition.js";
4
4
  export * from "./Schedule/Driver.js";
5
- export * from "./Schedule/Interval.js";
@@ -3,7 +3,7 @@ import { Newtype } from "@fncts/base/data/Newtype";
3
3
  import { Exit } from "@fncts/base/data/Exit";
4
4
  import { IO } from "@fncts/io/IO/definition";
5
5
  interface FinalizerN extends HKT {
6
- readonly type: Finalizer;
6
+ readonly [HKT.T]: Finalizer;
7
7
  }
8
8
  /**
9
9
  * @tsplus type fncts.io.Managed.Finalizer
@@ -20,7 +20,7 @@ export declare class Running {
20
20
  }
21
21
  export declare type State = Exited | Running;
22
22
  interface ReleaseMapN extends HKT {
23
- readonly type: ReleaseMap;
23
+ readonly [HKT.T]: ReleaseMap;
24
24
  }
25
25
  /**
26
26
  * @tsplus type fncts.io.Scope.ReleaseMap
package/Stream/api.d.ts CHANGED
@@ -1,18 +1,19 @@
1
1
  import { Either } from "@fncts/base/data/Either";
2
2
  import { Sink } from "@fncts/io/Sink/definition";
3
3
  import { Schedule } from "@fncts/io/Schedule/definition";
4
- import { Maybe } from "@fncts/base/data/Maybe";
4
+ import { Maybe, Nothing } from "@fncts/base/data/Maybe";
5
5
  import { Channel } from "@fncts/io/Channel";
6
6
  import { Conc } from "@fncts/base/collection/immutable/Conc";
7
7
  import { Cause } from "@fncts/base/data/Cause";
8
- import { Lazy } from "@fncts/base/data/function";
9
8
  import { IO, UIO } from "@fncts/io/IO/definition";
9
+ import { Lazy } from "@fncts/base/data/function";
10
10
  import { Exit } from "@fncts/base/data/Exit";
11
11
  import { Has } from "@fncts/base/typeclass/Has";
12
12
  import { Scope } from "@fncts/io/Scope/definition";
13
13
  import { Future } from "@fncts/io/Future";
14
14
  import { Ref } from "@fncts/io/Ref";
15
15
  import { Environment } from "@fncts/base/data/Environment";
16
+ import { Duration } from "@fncts/base/data/Duration";
16
17
  import { HashMap } from "@fncts/base/collection/immutable/HashMap";
17
18
  import { Predicate } from "@fncts/base/data/Predicate";
18
19
  import { Fiber } from "@fncts/io/Fiber/definition";
@@ -301,7 +302,7 @@ export declare function contramapEnvironment_<R, E, A, R0>(ra: Stream<R, E, A>,
301
302
  * @tsplus fluent fncts.io.Stream debounce
302
303
  * @tsplus location "@fncts/io/Stream/api"
303
304
  */
304
- export declare function debounce_<R, E, A>(stream: Stream<R, E, A>, duration: number): Stream<R, E, A>;
305
+ export declare function debounce_<R, E, A>(stream: Stream<R, E, A>, duration: Lazy<Duration>): Stream<R, E, A>;
305
306
  /**
306
307
  * Switches to the provided stream in case this one is empty.
307
308
  * @tsplus fluent fncts.io.Stream defaultIfEmpty
@@ -629,24 +630,6 @@ export declare function interruptWhen_<R, E, A, R1, E1>(stream: Stream<R, E, A>,
629
630
  * @tsplus location "@fncts/io/Stream/api"
630
631
  */
631
632
  export declare function interruptWhenFuture_<R, E, A, E1>(fa: Stream<R, E, A>, future: Future<E1, unknown>): Stream<R, E | E1, A>;
632
- /**
633
- * Loops over the stream chunks concatenating the result of f
634
- * @tsplus fluent fncts.io.Stream loopOnChunks
635
- * @tsplus location "@fncts/io/Stream/api"
636
- */
637
- export declare function loopOnChunks_<R, E, A, R1, E1, A1>(stream: Stream<R, E, A>, f: (a: Conc<A>) => Channel<R1, E | E1, Conc<A>, unknown, E | E1, Conc<A1>, boolean>): Stream<R & R1, E | E1, A1>;
638
- /**
639
- * Loops on chunks emitting partially
640
- * @tsplus fluent fncts.io.Stream loopOnPartialChunks
641
- * @tsplus location "@fncts/io/Stream/api"
642
- */
643
- export declare function loopOnPartialChunks_<R, E, A, R1, E1, A1>(stream: Stream<R, E, A>, f: (a: Conc<A>, emit: (a: A1) => UIO<void>) => IO<R1, E1, boolean>): Stream<R & R1, E | E1, A1>;
644
- /**
645
- * Loops on chunks elements emitting partially
646
- * @tsplus fluent fncts.io.Stream loopOnPartialChunksElements
647
- * @tsplus location "@fncts/io/Stream/api"
648
- */
649
- export declare function loopOnPartialChunksElements_<R, E, A, R1, E1, A1>(stream: Stream<R, E, A>, f: (a: A, emit: (a: A1) => UIO<void>) => IO<R1, E1, void>): Stream<R & R1, E | E1, A1>;
650
633
  /**
651
634
  * Transforms the elements of this stream using the supplied function.
652
635
  * @tsplus fluent fncts.io.Stream map
@@ -658,7 +641,7 @@ export declare function map_<R, E, A, B>(stream: Stream<R, E, A>, f: (o: A) => B
658
641
  * @tsplus fluent fncts.io.Stream mapAccum
659
642
  * @tsplus location "@fncts/io/Stream/api"
660
643
  */
661
- export declare function mapAccum_<R, E, A, S, B>(stream: Stream<R, E, A>, s: S, f: (s: S, a: A) => readonly [B, S]): Stream<R, E, B>;
644
+ export declare function mapAccum_<R, E, A, S, B>(stream: Stream<R, E, A>, s: S, f: (s: S, a: A) => readonly [S, B]): Stream<R, E, B>;
662
645
  /**
663
646
  * Statefully and effectfully maps over the elements of this stream to produce
664
647
  * new elements.
@@ -21,9 +21,9 @@ export declare class Previous<A> {
21
21
  export declare const CurrentTag: unique symbol;
22
22
  export declare type CurrentTag = typeof CurrentTag;
23
23
  export declare class Current<E, A> {
24
- readonly fiber: Fiber<E, HandoffSignal<void, E, A>>;
24
+ readonly fiber: Fiber<E, HandoffSignal<E, A>>;
25
25
  readonly _tag = DebounceStateTag.Current;
26
- constructor(fiber: Fiber<E, HandoffSignal<void, E, A>>);
26
+ constructor(fiber: Fiber<E, HandoffSignal<E, A>>);
27
27
  }
28
28
  /**
29
29
  * @tsplus type fncts.io.Stream.DebounceState
@@ -49,7 +49,7 @@ export declare function previous<A>(fiber: Fiber<never, Conc<A>>): DebounceState
49
49
  * @tsplus static fncts.io.Stream.DebounceStateOps Current
50
50
  * @tsplus location "@fncts/io/Stream/internal/DebounceState"
51
51
  */
52
- export declare function current<E, A>(fiber: Fiber<E, HandoffSignal<void, E, A>>): DebounceState<E, A>;
52
+ export declare function current<E, A>(fiber: Fiber<E, HandoffSignal<E, A>>): DebounceState<E, A>;
53
53
  /**
54
54
  * @tsplus fluent fncts.io.Stream.DebounceState match
55
55
  * @tsplus location "@fncts/io/Stream/internal/DebounceState"
@@ -69,16 +69,16 @@ export declare class Halt<E> {
69
69
  }
70
70
  export declare const EndTypeId: unique symbol;
71
71
  export declare type EndTypeId = typeof EndTypeId;
72
- export declare class End<C> {
73
- readonly reason: SinkEndReason<C>;
72
+ export declare class End {
73
+ readonly reason: SinkEndReason;
74
74
  readonly _typeId: typeof HandoffSignalTypeId;
75
75
  readonly _tag: typeof EndTypeId;
76
- constructor(reason: SinkEndReason<C>);
76
+ constructor(reason: SinkEndReason);
77
77
  }
78
78
  /**
79
79
  * @tsplus type fncts.io.Stream.HandoffSignal
80
80
  */
81
- export declare type HandoffSignal<C, E, A> = Emit<A> | Halt<E> | End<C>;
81
+ export declare type HandoffSignal<E, A> = Emit<A> | Halt<E> | End;
82
82
  /**
83
83
  * @tsplus type fncts.io.Stream.HandoffSignalOps
84
84
  */
@@ -89,23 +89,23 @@ export declare const HandoffSignal: HandoffSignalOps;
89
89
  * @tsplus static fncts.io.Stream.HandoffSignalOps Emit
90
90
  * @tsplus location "@fncts/io/Stream/internal/Handoff"
91
91
  */
92
- export declare function emit<A>(els: Conc<A>): HandoffSignal<never, never, A>;
92
+ export declare function emit<A>(els: Conc<A>): HandoffSignal<never, A>;
93
93
  /**
94
94
  * @tsplus static fncts.io.Stream.HandoffSignalOps Halt
95
95
  * @tsplus location "@fncts/io/Stream/internal/Handoff"
96
96
  */
97
- export declare function halt<E>(error: Cause<E>): HandoffSignal<never, E, never>;
97
+ export declare function halt<E>(error: Cause<E>): HandoffSignal<E, never>;
98
98
  /**
99
99
  * @tsplus static fncts.io.Stream.HandoffSignalOps End
100
100
  * @tsplus location "@fncts/io/Stream/internal/Handoff"
101
101
  */
102
- export declare function end<C>(reason: SinkEndReason<C>): HandoffSignal<C, never, never>;
102
+ export declare function end<C>(reason: SinkEndReason): HandoffSignal<never, never>;
103
103
  /**
104
104
  * @tsplus fluent fncts.io.Stream.HandoffSignal match
105
105
  * @tsplus location "@fncts/io/Stream/internal/Handoff"
106
106
  */
107
- export declare function matchSignal_<C, E, A, B, D, F>(signal: HandoffSignal<C, E, A>, cases: {
107
+ export declare function matchSignal_<E, A, B, D, F>(signal: HandoffSignal<E, A>, cases: {
108
108
  Emit: (_: Emit<A>) => B;
109
109
  Halt: (_: Halt<E>) => D;
110
- End: (_: End<C>) => F;
110
+ End: (_: End) => F;
111
111
  }): B | D | F;
@@ -5,19 +5,9 @@ export declare const enum SinkEndReasonTag {
5
5
  UpstreamEnd = "UpstreamEnd"
6
6
  }
7
7
  export declare const SinkEndReasonTypeId: unique symbol;
8
- export declare class SinkEnd {
9
- readonly _typeId: typeof SinkEndReasonTypeId;
10
- readonly _tag = SinkEndReasonTag.SinkEnd;
11
- }
12
- export declare class ScheduleTimeout {
13
- readonly _typeId: typeof SinkEndReasonTypeId;
14
- readonly _tag = SinkEndReasonTag.ScheduleTimeout;
15
- }
16
- export declare class ScheduleEnd<C> {
17
- readonly c: C;
8
+ export declare class ScheduleEnd {
18
9
  readonly _typeId: typeof SinkEndReasonTypeId;
19
10
  readonly _tag = SinkEndReasonTag.ScheduleEnd;
20
- constructor(c: C);
21
11
  }
22
12
  export declare class UpstreamEnd {
23
13
  readonly _typeId: typeof SinkEndReasonTypeId;
@@ -26,14 +16,12 @@ export declare class UpstreamEnd {
26
16
  /**
27
17
  * @tsplus type fncts.io.Stream.SinkEndReason
28
18
  */
29
- export declare type SinkEndReason<C> = SinkEnd | ScheduleTimeout | ScheduleEnd<C> | UpstreamEnd;
19
+ export declare type SinkEndReason = ScheduleEnd | UpstreamEnd;
30
20
  /**
31
21
  * @tsplus fluent fncts.io.Stream.SinkEndReason match
32
22
  * @tsplus location "@fncts/io/Stream/internal/SinkEndReason"
33
23
  */
34
- export declare function matchSinkEndReason_<A, B, C, D, E>(self: SinkEndReason<A>, cases: {
35
- SinkEnd: (_: SinkEnd) => B;
36
- ScheduleTimeout: (_: ScheduleTimeout) => C;
37
- ScheduleEnd: (_: ScheduleEnd<A>) => D;
38
- UpstreamEnd: (_: UpstreamEnd) => E;
39
- }): B | C | D | E;
24
+ export declare function matchSinkEndReason_<A, B>(self: SinkEndReason, cases: {
25
+ ScheduleEnd: (_: ScheduleEnd) => A;
26
+ UpstreamEnd: (_: UpstreamEnd) => B;
27
+ }): A | B;
@@ -4,7 +4,7 @@ import { Maybe } from "@fncts/base/data/Maybe";
4
4
  import { Either } from "@fncts/base/data/Either";
5
5
  import type { UTRef } from "../TRef.js";
6
6
  interface TFutureN extends HKT {
7
- readonly type: TFuture<this["E"], this["A"]>;
7
+ readonly [HKT.T]: TFuture<HKT._E<this>, HKT._A<this>>;
8
8
  }
9
9
  /**
10
10
  * @tsplus type fncts.io.TFuture