@fncts/io 0.0.1 → 0.0.4

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 (279) hide show
  1. package/Channel/api.d.ts +2 -2
  2. package/Clock/api.d.ts +3 -1
  3. package/Clock/definition.d.ts +3 -1
  4. package/Clock/live.d.ts +2 -0
  5. package/Fiber/api/interruptFork.d.ts +1 -1
  6. package/IO/api/asyncIO.d.ts +6 -0
  7. package/IO/api/ensuringChildren.d.ts +7 -0
  8. package/IO/api/sequenceT.d.ts +2 -3
  9. package/IO/api/sleep.d.ts +3 -1
  10. package/IO/api/timeout.d.ts +14 -0
  11. package/IO/api.d.ts +2 -2
  12. package/IO/definition.d.ts +8 -4
  13. package/IO.d.ts +3 -0
  14. package/IOSpec.d.ts +10 -1
  15. package/Latch.d.ts +3 -0
  16. package/Schedule/Decision.d.ts +1 -1
  17. package/Schedule/api.d.ts +1 -1
  18. package/Schedule.d.ts +0 -1
  19. package/Scope/Finalizer/definition.d.ts +1 -1
  20. package/Scope/ReleaseMap/definition.d.ts +1 -1
  21. package/Stream/api.d.ts +5 -22
  22. package/Stream/internal/DebounceState.d.ts +3 -3
  23. package/Stream/internal/Handoff.d.ts +9 -9
  24. package/Stream/internal/SinkEndReason.d.ts +6 -18
  25. package/TFuture/definition.d.ts +1 -1
  26. package/TSemaphore/definition.d.ts +1 -1
  27. package/_cjs/Cached.cjs +3 -3
  28. package/_cjs/Channel/ChildExecutorDecision.cjs +2 -2
  29. package/_cjs/Channel/UpstreamPullRequest.cjs +2 -2
  30. package/_cjs/Channel/UpstreamPullStrategy.cjs +1 -1
  31. package/_cjs/Channel/api/interruptWhen.cjs +1 -1
  32. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  33. package/_cjs/Channel/api/mapOutIOC.cjs +1 -1
  34. package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
  35. package/_cjs/Channel/api/mergeAllWith.cjs +1 -1
  36. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  37. package/_cjs/Channel/api/mergeWith.cjs +6 -6
  38. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  39. package/_cjs/Channel/api.cjs +14 -14
  40. package/_cjs/Channel/api.cjs.map +1 -1
  41. package/_cjs/Channel/core-api.cjs +1 -1
  42. package/_cjs/Channel/internal/ChannelExecutor.cjs +2 -2
  43. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  44. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +8 -7
  45. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  46. package/_cjs/Channel.cjs +3 -3
  47. package/_cjs/Clock/api.cjs.map +1 -1
  48. package/_cjs/Clock/live.cjs +1 -1
  49. package/_cjs/Clock/live.cjs.map +1 -1
  50. package/_cjs/Clock.cjs +3 -3
  51. package/_cjs/Console.cjs +3 -3
  52. package/_cjs/Fiber/FiberContext.cjs +57 -56
  53. package/_cjs/Fiber/FiberContext.cjs.map +1 -1
  54. package/_cjs/Fiber/api/interruptFork.cjs +1 -1
  55. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  56. package/_cjs/Fiber.cjs +23 -23
  57. package/_cjs/FiberRef/constructors.cjs +1 -1
  58. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  59. package/_cjs/FiberRef.cjs +5 -5
  60. package/_cjs/FiberRefs/join.cjs +2 -2
  61. package/_cjs/FiberRefs/join.cjs.map +1 -1
  62. package/_cjs/FiberRefs.cjs +3 -3
  63. package/_cjs/FiberScope.cjs +2 -2
  64. package/_cjs/FiberState/constructors.cjs +1 -1
  65. package/_cjs/FiberState.cjs +3 -3
  66. package/_cjs/FiberStatus/constructors.cjs +1 -1
  67. package/_cjs/FiberStatus.cjs +2 -2
  68. package/_cjs/Future.cjs +3 -3
  69. package/_cjs/Hub.cjs +2 -2
  70. package/_cjs/IO/api/asyncIO.cjs +37 -0
  71. package/_cjs/IO/api/asyncIO.cjs.map +1 -0
  72. package/_cjs/IO/api/core-scope.cjs +1 -1
  73. package/_cjs/IO/api/ensuringChildren.cjs +24 -0
  74. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -0
  75. package/_cjs/IO/api/interrupt.cjs +5 -5
  76. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  77. package/_cjs/IO/api/sleep.cjs.map +1 -1
  78. package/_cjs/IO/api/timeout.cjs +42 -0
  79. package/_cjs/IO/api/timeout.cjs.map +1 -0
  80. package/_cjs/IO/api.cjs +41 -40
  81. package/_cjs/IO/api.cjs.map +1 -1
  82. package/_cjs/IO/definition.cjs +9 -6
  83. package/_cjs/IO/definition.cjs.map +1 -1
  84. package/_cjs/IO/runtime.cjs +1 -1
  85. package/_cjs/IO/runtime.cjs.map +1 -1
  86. package/_cjs/IO.cjs +86 -47
  87. package/_cjs/IO.cjs.map +1 -1
  88. package/_cjs/IOEnv.cjs +3 -3
  89. package/_cjs/InterruptStatus.cjs +2 -2
  90. package/_cjs/Layer/api.cjs +5 -3
  91. package/_cjs/Layer/api.cjs.map +1 -1
  92. package/_cjs/Layer.cjs +3 -3
  93. package/_cjs/Logger.cjs +3 -3
  94. package/_cjs/Queue/api.cjs +7 -7
  95. package/_cjs/Queue.cjs +5 -5
  96. package/_cjs/Random.cjs +3 -3
  97. package/_cjs/Ref/Atomic/Atomic.cjs +3 -3
  98. package/_cjs/Ref/Atomic/api.cjs +10 -6
  99. package/_cjs/Ref/Atomic/api.cjs.map +1 -1
  100. package/_cjs/Ref/Atomic.cjs +2 -2
  101. package/_cjs/Ref/Derived.cjs +2 -2
  102. package/_cjs/Ref/DerivedAll.cjs +1 -1
  103. package/_cjs/Ref/Synchronized/api.cjs +1 -1
  104. package/_cjs/Ref/Synchronized/constructors.cjs +1 -1
  105. package/_cjs/Ref/Synchronized/definition.cjs +1 -1
  106. package/_cjs/Ref/api/get.cjs +1 -1
  107. package/_cjs/Ref/api/match.cjs +1 -1
  108. package/_cjs/Ref/api/matchAll.cjs +1 -1
  109. package/_cjs/Ref/api/modify.cjs +1 -1
  110. package/_cjs/Ref/api/set.cjs +1 -1
  111. package/_cjs/Ref/api.cjs +8 -8
  112. package/_cjs/Ref/constructors.cjs +1 -1
  113. package/_cjs/Ref.cjs +9 -9
  114. package/_cjs/STM/api/core-api.cjs +1 -1
  115. package/_cjs/STM/api/core-constructors.cjs +1 -1
  116. package/_cjs/STM/api.cjs +2 -2
  117. package/_cjs/STM/driver.cjs +1 -1
  118. package/_cjs/STM/internal/Entry.cjs +1 -1
  119. package/_cjs/STM/internal/Journal.cjs +2 -2
  120. package/_cjs/STM.cjs +5 -5
  121. package/_cjs/Schedule/Decision.cjs.map +1 -1
  122. package/_cjs/Schedule/api/driver.cjs +11 -9
  123. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  124. package/_cjs/Schedule/api.cjs +49 -49
  125. package/_cjs/Schedule/api.cjs.map +1 -1
  126. package/_cjs/Schedule.cjs +4 -17
  127. package/_cjs/Schedule.cjs.map +1 -1
  128. package/_cjs/Scope/Finalizer/definition.cjs +6 -4
  129. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  130. package/_cjs/Scope/Finalizer.cjs +1 -1
  131. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -1
  132. package/_cjs/Scope/ReleaseMap/api.cjs +1 -1
  133. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -1
  134. package/_cjs/Scope/ReleaseMap/definition.cjs +4 -2
  135. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  136. package/_cjs/Scope/ReleaseMap.cjs +3 -3
  137. package/_cjs/Scope/api.cjs +1 -1
  138. package/_cjs/Scope.cjs +2 -2
  139. package/_cjs/ScopedRef.cjs +2 -2
  140. package/_cjs/Sink/api.cjs +1 -1
  141. package/_cjs/Sink/api.cjs.map +1 -1
  142. package/_cjs/Sink.cjs +2 -2
  143. package/_cjs/State/api.cjs +2 -2
  144. package/_cjs/State/definition.cjs +1 -1
  145. package/_cjs/State.cjs +2 -2
  146. package/_cjs/Stream/api/zipAllWith.cjs +1 -1
  147. package/_cjs/Stream/api/zipWith.cjs +1 -1
  148. package/_cjs/Stream/api.cjs +308 -308
  149. package/_cjs/Stream/api.cjs.map +1 -1
  150. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
  151. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  152. package/_cjs/Stream/internal/SinkEndReason.cjs +2 -37
  153. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  154. package/_cjs/Stream.cjs +2 -2
  155. package/_cjs/Supervisor/constructors.cjs +1 -1
  156. package/_cjs/Supervisor.cjs +3 -3
  157. package/_cjs/TExit/constructors.cjs +1 -1
  158. package/_cjs/TExit.cjs +2 -2
  159. package/_cjs/TFuture/definition.cjs +4 -2
  160. package/_cjs/TFuture/definition.cjs.map +1 -1
  161. package/_cjs/TFuture.cjs +3 -3
  162. package/_cjs/TRef/api.cjs +2 -2
  163. package/_cjs/TRef/constructors.cjs +3 -3
  164. package/_cjs/TRef.cjs +3 -3
  165. package/_cjs/TSemaphore/api.cjs +1 -1
  166. package/_cjs/TSemaphore/definition.cjs +4 -2
  167. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  168. package/_cjs/TSemaphore.cjs +3 -3
  169. package/_cjs/collection/immutable/Conc.cjs +3 -3
  170. package/_mjs/Channel/api/interruptWhen.mjs +1 -1
  171. package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
  172. package/_mjs/Channel/api/mapOutIOC.mjs +1 -1
  173. package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
  174. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  175. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
  176. package/_mjs/Channel/api/mergeWith.mjs +6 -6
  177. package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
  178. package/_mjs/Channel/api.mjs +14 -14
  179. package/_mjs/Channel/api.mjs.map +1 -1
  180. package/_mjs/Channel/internal/ChannelExecutor.mjs +2 -2
  181. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  182. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +8 -7
  183. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
  184. package/_mjs/Clock/api.mjs.map +1 -1
  185. package/_mjs/Clock/live.mjs +1 -1
  186. package/_mjs/Clock/live.mjs.map +1 -1
  187. package/_mjs/Fiber/FiberContext.mjs +57 -56
  188. package/_mjs/Fiber/FiberContext.mjs.map +1 -1
  189. package/_mjs/Fiber/api/interruptFork.mjs +1 -1
  190. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  191. package/_mjs/FiberRef/constructors.mjs +1 -1
  192. package/_mjs/FiberRef/constructors.mjs.map +1 -1
  193. package/_mjs/FiberRefs/join.mjs +2 -2
  194. package/_mjs/FiberRefs/join.mjs.map +1 -1
  195. package/_mjs/IO/api/asyncIO.mjs +20 -0
  196. package/_mjs/IO/api/asyncIO.mjs.map +1 -0
  197. package/_mjs/IO/api/ensuringChildren.mjs +11 -0
  198. package/_mjs/IO/api/ensuringChildren.mjs.map +1 -0
  199. package/_mjs/IO/api/interrupt.mjs +4 -4
  200. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  201. package/_mjs/IO/api/sleep.mjs.map +1 -1
  202. package/_mjs/IO/api/timeout.mjs +23 -0
  203. package/_mjs/IO/api/timeout.mjs.map +1 -0
  204. package/_mjs/IO/api.mjs +41 -40
  205. package/_mjs/IO/api.mjs.map +1 -1
  206. package/_mjs/IO/definition.mjs +6 -4
  207. package/_mjs/IO/definition.mjs.map +1 -1
  208. package/_mjs/IO/runtime.mjs +1 -1
  209. package/_mjs/IO/runtime.mjs.map +1 -1
  210. package/_mjs/IO.mjs +3 -0
  211. package/_mjs/IO.mjs.map +1 -1
  212. package/_mjs/Layer/api.mjs +4 -3
  213. package/_mjs/Layer/api.mjs.map +1 -1
  214. package/_mjs/Ref/Atomic/api.mjs +10 -6
  215. package/_mjs/Ref/Atomic/api.mjs.map +1 -1
  216. package/_mjs/Schedule/Decision.mjs.map +1 -1
  217. package/_mjs/Schedule/api/driver.mjs +10 -9
  218. package/_mjs/Schedule/api/driver.mjs.map +1 -1
  219. package/_mjs/Schedule/api.mjs +49 -49
  220. package/_mjs/Schedule/api.mjs.map +1 -1
  221. package/_mjs/Schedule.mjs +0 -1
  222. package/_mjs/Schedule.mjs.map +1 -1
  223. package/_mjs/Scope/Finalizer/definition.mjs +5 -4
  224. package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
  225. package/_mjs/Scope/ReleaseMap/definition.mjs +3 -2
  226. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  227. package/_mjs/Sink/api.mjs +1 -1
  228. package/_mjs/Sink/api.mjs.map +1 -1
  229. package/_mjs/Stream/api.mjs +308 -302
  230. package/_mjs/Stream/api.mjs.map +1 -1
  231. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
  232. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  233. package/_mjs/Stream/internal/SinkEndReason.mjs +1 -30
  234. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  235. package/_mjs/TFuture/definition.mjs +3 -2
  236. package/_mjs/TFuture/definition.mjs.map +1 -1
  237. package/_mjs/TSemaphore/definition.mjs +3 -2
  238. package/_mjs/TSemaphore/definition.mjs.map +1 -1
  239. package/_src/Channel/api.ts +3 -3
  240. package/_src/Channel/internal/ChannelExecutor.ts +2 -2
  241. package/_src/Channel/internal/SingleProducerAsyncInput.ts +1 -0
  242. package/_src/Clock/api.ts +1 -1
  243. package/_src/Clock/definition.ts +1 -1
  244. package/_src/Clock/live.ts +2 -2
  245. package/_src/Fiber/FiberContext.ts +3 -2
  246. package/_src/Fiber/api/interruptFork.ts +1 -1
  247. package/_src/FiberRef/constructors.ts +1 -1
  248. package/_src/FiberRefs/join.ts +2 -2
  249. package/_src/IO/api/asyncIO.ts +16 -0
  250. package/_src/IO/api/ensuringChildren.ts +11 -0
  251. package/_src/IO/api/interrupt.ts +2 -1
  252. package/_src/IO/api/sequenceT.ts +1 -1
  253. package/_src/IO/api/sleep.ts +1 -1
  254. package/_src/IO/api/timeout.ts +19 -0
  255. package/_src/IO/api.ts +6 -4
  256. package/_src/IO/definition.ts +8 -4
  257. package/_src/IO.ts +3 -0
  258. package/_src/Layer/api.ts +1 -1
  259. package/_src/Ref/Atomic/api.ts +4 -0
  260. package/_src/Schedule/Decision.ts +0 -2
  261. package/_src/Schedule/api/driver.ts +1 -1
  262. package/_src/Schedule/api.ts +0 -3
  263. package/_src/Schedule.ts +0 -1
  264. package/_src/Scope/Finalizer/definition.ts +1 -1
  265. package/_src/Scope/ReleaseMap/definition.ts +1 -1
  266. package/_src/Stream/api.ts +199 -134
  267. package/_src/Stream/internal/DebounceState.ts +2 -2
  268. package/_src/Stream/internal/Handoff.ts +9 -9
  269. package/_src/Stream/internal/SinkEndReason.ts +7 -25
  270. package/_src/TFuture/definition.ts +2 -2
  271. package/_src/TSemaphore/definition.ts +1 -1
  272. package/package.json +5 -5
  273. package/runTests.d.ts +1 -0
  274. package/Schedule/Interval.d.ts +0 -71
  275. package/_cjs/Schedule/Interval.cjs +0 -154
  276. package/_cjs/Schedule/Interval.cjs.map +0 -1
  277. package/_mjs/Schedule/Interval.mjs +0 -114
  278. package/_mjs/Schedule/Interval.mjs.map +0 -1
  279. package/_src/Schedule/Interval.ts +0 -103
@@ -1 +1 @@
1
- {"version":3,"file":"join.mjs","mappings":";;;;;;;;;;AAAA;;;;AAGA,OAAM,SAAUA,IAAV,CAAeC,IAAf,EAAgCC,OAAhC,EAA0DC,IAA1D,EAAyE;EAC7E,MAAMC,eAAe,GAAGH,IAAI,CAACI,cAA7B;EACA,MAAMC,cAAc,GAAIH,IAAI,CAACE,cAA7B;EAEA,MAAMA,cAAc,GAAGE,mDAAiCH,eAAjC,EAAkD,CAACI,GAAD,EAAMJ,eAAN,EAAuBK,UAAvB,KAAqC;IAC5G,MAAMC,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AA1C,CAAhB;EACA,OAAOH,OAAO,KAAK,CAAZ,GAAgBC,oBAAWC,QAAX,CAAoBJ,IAAI,CAACM,EAAzB,EAA6BL,KAAK,CAACK,EAAnC,CAAhB,GAAyDJ,OAAhE;AACD;AAED;;;;;AAGA,SAASK,YAAT,CACExB,WADF,EAEED,UAFF,EAEiD;sBAD/CC;MAAAyB,eACA1B;sBADAC;MAAA0B,eACA3B;;YACU;IACV,IAAIa,6CAA4BA,wCAAhC,EAAyD;MACvD,MAAM,CAACC,aAAD,IAA6Bc,cAAYtB,IAA/C;MACA,MAAM,CAACuB,YAAD,EAAeC,UAAf,IAA6BJ,aAAWpB,IAA9C;MACA,MAAMc,OAAO,GAAsBH,cAAc,CAACH,aAAD,EAAgBe,YAAhB,CAAjD;;MACA,IAAIT,OAAO,GAAG,CAAd,EAAiB;;uBACkBM,aAAWX;;;;MAC7C,CAFD,MAEO,IAAIK,OAAO,GAAG,CAAd,EAAiB;wBACFQ,cAAYb;;;;;MACjC,CAFM,MAEA;QACL,OAAOgB,sBAAKD,UAAL,CAAP;MACD;IACF;;IACD,OAAOC,0BAAP;EACD;AAAA","names":["join","self","fiberId","that","parentFiberRefs","fiberRefLocals","childFiberRefs","tsplus_module_2","ref","childStack","parentStack","tsplus_module_3","tsplus_module_1","ancestor","child","head","patch","tsplus_module_4","oldValue","_","newValue","newStack","tsplus_module_6","parentFiberId","tail","tsplus_module_8","compareFiberId","left","right","compare","tsplus_module_9","compare_","startTime","id","findAncestor","childStack_1","childStack_2","parentStack_1","childFiberId","childValue","tsplus_module_10"],"sourceRoot":"","sources":["../../_src/FiberRefs/join.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"join.mjs","mappings":";;;;;;;;;;AAAA;;;;AAGA,OAAM,SAAUA,IAAV,CAAeC,IAAf,EAAgCC,OAAhC,EAA0DC,IAA1D,EAAyE;EAC7E,MAAMC,eAAe,GAAGH,IAAI,CAACI,cAA7B;EACA,MAAMC,cAAc,GAAIH,IAAI,C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BC,IAAxB,EAA+CC,KAA/C,EAAqE;EACnE,MAAMC,OAAO,GAAGC,oBAAWD,OAAX,CAAmBF,IAAI,CAACI,SAAxB,EAAmCH,KAAK,CAACG,SAAzC,CAAhB;EACA,OAAOF,OAAO,KAAK,CAAZ,GAAgBC,oBAAWD,OAAX,CAAmBF,IAAI,CAACK,EAAxB,EAA4BJ,KAAK,CAACI,EAAlC,CAAhB,GAAwDH,OAA/D;AACD;AAED;;;;;AAGA,SAASI,YAAT,CACEvB,WADF,EAEED,UAFF,EAEiD;sBAD/CC;MAAAwB,eACAzB;sBADAC;MAAAyB,eACA1B;;YACU;IACV,IAAIa,6CAA4BA,wCAAhC,EAAyD;MACvD,MAAM,CAACC,aAAD,IAA6Ba,cAAYrB,IAA/C;MACA,MAAM,CAACsB,YAAD,EAAeC,UAAf,IAA6BJ,aAAWnB,IAA9C;MACA,MAAMc,OAAO,GAAsBH,cAAc,CAACH,aAAD,EAAgBc,YAAhB,CAAjD;;MACA,IAAIR,OAAO,GAAG,CAAd,EAAiB;;uBACkBK,aAAWV;;;;MAC7C,CAFD,MAEO,IAAIK,OAAO,GAAG,CAAd,EAAiB;wBACFO,cAAYZ;;;;;MACjC,CAFM,MAEA;QACL,OAAOe,sBAAKD,UAAL,CAAP;MACD;IACF;;IACD,OAAOC,0BAAP;EACD;AAAA","names":["join","self","fiberId","that","parentFiberRefs","fiberRefLocals","childFiberRefs","tsplus_module_2","ref","childStack","parentStack","tsplus_module_3","tsplus_module_1","ancestor","child","head","patch","tsplus_module_4","oldValue","_","newValue","newStack","tsplus_module_6","parentFiberId","tail","tsplus_module_8","compareFiberId","left","right","compare","tsplus_module_9","startTime","id","findAncestor","childStack_1","childStack_2","parentStack_1","childFiberId","childValue","tsplus_module_10"],"sourceRoot":"","sources":["../../_src/FiberRefs/join.ts"],"sourcesContent":[null]}
@@ -0,0 +1,20 @@
1
+ const fileName_1 = "(@fncts/io) src/IO/api/asyncIO.ts";
2
+ import * as tsplus_module_1 from "@fncts/io/IO/api/fulfill";
3
+ import * as tsplus_module_2 from "@fncts/io/IO/api";
4
+ import * as tsplus_module_3 from "@fncts/io/Future/api";
5
+ import * as tsplus_module_4 from "@fncts/io/IO/api/interrupt";
6
+ import * as tsplus_module_5 from "@fncts/io/IO/runtime";
7
+ import * as tsplus_module_6 from "@fncts/io/Future/constructors";
8
+ /**
9
+ * @tsplus static fncts.io.IOOps asyncIO
10
+ */
11
+
12
+ export function asyncIO(register) {
13
+ return tsplus_module_2.flatMap_(tsplus_module_6.make(), f => tsplus_module_2.flatMap_(tsplus_module_5.runtime(fileName_1 + ":7:27"), r => tsplus_module_2.map_(tsplus_module_4.uninterruptibleMask(({
14
+ restore
15
+ }) => {
16
+ const io = register(k => r.unsafeRunAsync(tsplus_module_1.fulfill_(k, f), fileName_1 + ":10:52"));
17
+ return tsplus_module_2.apSecond_(tsplus_module_2.fork(restore(tsplus_module_2.catchAllCause_(io, cause => tsplus_module_3.failCause_(f, cause), fileName_1 + ":11:40"))), restore(tsplus_module_3.wait(f)), fileName_1 + ":11:79");
18
+ }), a => a, fileName_1 + ":8:16"), fileName_1 + ":7:16"), fileName_1 + ":6:16");
19
+ }
20
+ //# sourceMappingURL=asyncIO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncIO.mjs","mappings":";;;;;;;AAAA;;;;AAGA,OAAM,SAAUA,OAAV,CAA2BC,QAA3B,EAAoF;EACxF,gCACcC,sBADd,EACQC,CAAC,6BACKC,6CADL,EACDC,CAAC,yBAELC,oCAAuB,CAAC;IAAEC;EAAF,CAAD,KAAgB;IACrC,MAAMC,EAAE,GAAGP,QAAQ,CAAEQ,CAAD,IAAOJ,CAAC,CAACK,cAAF,CAAiBC,4BAAUR,CAAV,CAAjB,EAA6BS,qBAA7B,CAAR,CAAnB;IACA,sDAAOL,OAAO,CAACM,mCAAkBC,KAAD,IAAWC,8BAAYD,KAAZ,CAA5B,EAA8CF,qBAA9C,CAAD,CAAd,GAAuEL,OAAO,sBAACJ,CAAD,EAA9E,EAAuFS,qBAAvF;EACD,CAHD,CAFK,EACDI,CAAC,IAMAA,CAPA,EAOCJ,oBAPD,CADA,EAQCA,oBARD,CADT,EASUA,oBATV;AAWD","names":["asyncIO","register","tsplus_module_6","f","tsplus_module_5","r","tsplus_module_4","restore","io","k","unsafeRunAsync","tsplus_module_1","fileName_1","tsplus_module_2","cause","tsplus_module_3","a"],"sourceRoot":"","sources":["../../../_src/IO/api/asyncIO.ts"],"sourcesContent":[null]}
@@ -0,0 +1,11 @@
1
+ const fileName_1 = "(@fncts/io) src/IO/api/ensuringChildren.ts";
2
+ import * as tsplus_module_1 from "@fncts/io/IO/api";
3
+ import * as tsplus_module_2 from "@fncts/io/Supervisor/constructors";
4
+ /**
5
+ * @tsplus fluent fncts.io.IO ensuringChildren
6
+ */
7
+
8
+ export function ensuringChildren(self, children) {
9
+ return tsplus_module_1.flatMap_(tsplus_module_2.track, supervisor => tsplus_module_1.ensuring_(tsplus_module_1.supervised_(self, supervisor, fileName_1 + ":9:20"), tsplus_module_1.flatMap_(supervisor.value, children, fileName_1 + ":9:66"), fileName_1 + ":9:41"), fileName_1 + ":8:34");
10
+ }
11
+ //# sourceMappingURL=ensuringChildren.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensuringChildren.mjs","mappings":";;;AAAA;;;;AAGA,OAAM,SAAUA,gBAAV,CACJC,IADI,EAEJC,QAFI,EAE+D;EAEnE,OAAOC,gDAA0BC,UAAD,IAC9BD,4DAAgBC,UAAhB,EAA0BC,oBAA1B,GAAqCF,mCAAU,CAACG,KAAX,EAAyBJ,QAAzB,EAAiCG,oBAAjC,CAArC,EAAuEA,oBAAvE,CADK,EACmEA,oBADnE,CAAP;AAGD","names":["ensuringChildren","self","children","tsplus_module_1","supervisor","fileName_1","value"],"sourceRoot":"","sources":["../../../_src/IO/api/ensuringChildren.ts"],"sourcesContent":[null]}
@@ -111,7 +111,7 @@ export function interruptibleMask(k) {
111
111
  function onInterrupt_1(ma, cleanup) {
112
112
  return uninterruptibleMask_1(({
113
113
  restore
114
- }) => tsplus_module_2.matchCauseIO_(restore(ma), cause => tsplus_module_1.interrupted(cause) ? cleanup(tsplus_module_1.interruptors(cause)) : tsplus_module_2.failCauseNow(cause, fileName_1 + ":103:84"), tsplus_module_2.succeedNow, fileName_1 + ":102:29"));
114
+ }) => tsplus_module_2.matchCauseIO_(restore(ma), cause => tsplus_module_1.interrupted(cause) ? tsplus_module_2.apSecond_(cleanup(tsplus_module_1.interruptors(cause)), tsplus_module_2.failCauseNow(cause, fileName_1 + ":104:81"), fileName_1 + ":104:65") : tsplus_module_2.failCauseNow(cause, fileName_1 + ":104:107"), tsplus_module_2.succeedNow, fileName_1 + ":102:29"));
115
115
  }
116
116
  /**
117
117
  * Calls the specified function, and runs the effect it returns, if this
@@ -124,7 +124,7 @@ function onInterrupt_1(ma, cleanup) {
124
124
  export function onInterruptExtended_(self, cleanup) {
125
125
  return uninterruptibleMask_1(({
126
126
  restore
127
- }) => tsplus_module_2.matchCauseIO_(restore(self), cause => tsplus_module_1.interrupted(cause) ? tsplus_module_2.matchCauseIO_(cleanup(), tsplus_module_2.failCauseNow, () => tsplus_module_2.failCauseNow(cause, fileName_1 + ":123:74"), fileName_1 + ":123:35") : tsplus_module_2.failCauseNow(cause, fileName_1 + ":124:28"), tsplus_module_2.succeedNow, fileName_1 + ":120:31"));
127
+ }) => tsplus_module_2.matchCauseIO_(restore(self), cause => tsplus_module_1.interrupted(cause) ? tsplus_module_2.matchCauseIO_(cleanup(), tsplus_module_2.failCauseNow, () => tsplus_module_2.failCauseNow(cause, fileName_1 + ":124:74"), fileName_1 + ":124:35") : tsplus_module_2.failCauseNow(cause, fileName_1 + ":125:28"), tsplus_module_2.succeedNow, fileName_1 + ":121:31"));
128
128
  }
129
129
  /**
130
130
  * Returns an IO whose interruption will be disconnected from the
@@ -156,14 +156,14 @@ export class InterruptStatusRestore {
156
156
  constructor(flag) {
157
157
  this.flag = flag;
158
158
 
159
- this.restore = io => setInterruptStatus_1(io, this.flag, fileName_1 + ":161:77");
159
+ this.restore = io => setInterruptStatus_1(io, this.flag, fileName_1 + ":162:77");
160
160
 
161
161
  this.force = io => {
162
162
  if (this.flag.isUninteruptible) {
163
163
  return interruptible_1(disconnect_1(uninterruptible_1(io)));
164
164
  }
165
165
 
166
- return setInterruptStatus_1(io, this.flag, fileName_1 + ":167:33");
166
+ return setInterruptStatus_1(io, this.flag, fileName_1 + ":168:33");
167
167
  };
168
168
  }
169
169
 
@@ -1 +1 @@
1
- {"version":3,"file":"interrupt.mjs","mappings":";;;;;;aAOgBA,WAAW;aAoBXC,mBAAmB;aAsBnBC,aAAa;aAebC,eAAe;aAWfC,mBAAmB;aAqBnBC,YAAY;aAgDZC,UAAU;AAhJ1B,SAASC,YAAT,QAA6B,mBAA7B;AAEA;;;;;;AAKA,uBAA4BC,OAA5B,EAA8CC,aAA9C,EAAoE;EAClE,OAAOC,6BAAgBC,0BAAgBH,OAAhB,CAAhB,EADqCC,aACrC,CAAP;AACD;AAED;;;;;;;;AAMA,OAAO,MAAMG,SAAS,gBAA8BF,uFAA7C;AAEP;;;;;;;;;AAQA,8BACEG,IADF,EAEEC,IAFF,EAGEL,aAHF,EAGwB;EAEtB,OAAO,IAAIF,YAAJ,CAAiBM,IAAjB,EAAuBC,IAAvB,EAA6BL,aAA7B,CAAP;AACD;AAED;;;;;;;;;;;;;;;;AAcA,yBAAuCI,IAAvC,EAA0DJ,aAA1D,EAAgF;EAC9E,OAAOM,2BAAIC,6BAAJ,EADiDP,aACjD,CAAP;AACD;AAED;;;;;;;;;;;;;AAWA,2BAAyCI,IAAzC,EAA4DJ,aAA5D,EAAkF;EAChF,OAAOM,2BAAIC,+BAAJ,EADmDP,aACnD,CAAP;AACD;AAED;;;;;;;;;AAOA,+BAA6CQ,CAA7C,EAAgG;EAC9F,OAAOP,mCAAuBI,IAAD,IAASI,kBAACD,CAAC,CAAC,IAAIE,sBAAJ,CAA2BL,IAA3B,C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,EAFmDA,aAEnD,CADK,CAAP;AAOD;AAED;;;;;AAGA,OAAM,MAAOU,sBAAP,CAA6B;EACjCe,YAAqBpB,IAArB,EAA0C;IAArB;;IAErB,eAAoBqB,EAAV,IAA2CpB,yBAAsB,KAAKD,IAA3B,EAA+BM,sBAA/B,CAArD;;IAEA,aAAkBe,EAAV,IAA0C;MAChD,IAAI,KAAKrB,IAAL,CAAUsB,gBAAd,EAAgC;QAC9B,sDAAOD,EAAP;MACD;;MACD,OAAOpB,yBAAsB,KAAKD,IAA3B,EAA+BM,sBAA/B,CAAP;IACD,CALD;EAJ8C;;AADb","names":["interruptAs","setInterruptStatus_","interruptible","uninterruptible","uninterruptibleMask","onInterrupt_","disconnect","SetInterrupt","fiberId","__tsplusTrace","tsplus_module_2","tsplus_module_1","interrupt","self","flag","setInterruptStatus_1","tsplus_module_3","f","uninterruptible_1","InterruptStatusRestore","fileName_1","interruptibleMask","k","interruptible_1","ma","cleanup","uninterruptibleMask_1","restore","cause","onInterruptExtended_","id","fiber","onInterrupt_1","tsplus_module_4","constructor","io","isUninteruptible"],"sourceRoot":"","sources":["../../../_src/IO/api/interrupt.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"interrupt.mjs","mappings":";;;;;;aAOgBA,WAAW;aAoBXC,mBAAmB;aAsBnBC,aAAa;aAebC,eAAe;aAWfC,mBAAmB;aAqBnBC,YAAY;aAiDZC,UAAU;AAjJ1B,SAASC,YAAT,QAA6B,mBAA7B;AAEA;;;;;;AAKA,uBAA4BC,OAA5B,EAA8CC,aAA9C,EAAoE;EAClE,OAAOC,6BAAgBC,0BAAgBH,OAAhB,CAAhB,EADqCC,aACrC,CAAP;AACD;AAED;;;;;;;;AAMA,OAAO,MAAMG,SAAS,gBAA8BF,uFAA7C;AAEP;;;;;;;;;AAQA,8BACEG,IADF,EAEEC,IAFF,EAGEL,aAHF,EAGwB;EAEtB,OAAO,IAAIF,YAAJ,CAAiBM,IAAjB,EAAuBC,IAAvB,EAA6BL,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AAhB,EAAqBR,sBAArB,CAA9C,EAAoEA,sBAApE,CADJ,GAEIV,6BAAgBkB,KAAhB,EAAqBR,sBAArB,CAJR,EAI8BV,0BAJ9B,EAI8BU,sBAJ9B,CADK,CAAP;AASD;AAED;;;;;;;;;;;;;;;;AAeA,sBAAoCP,IAApC,EAAuDJ,aAAvD,EAA6E;EAC3E,OAAOiB,sBAAoB,CAAC;IAAEC;EAAF,CAAD,KACzBjB,kDAAoBoB,EAAD,IACjBpB,2DAAO,CAACG,IAAD,CAAP,GAAkCkB,KAAD,IAC/BC,qBAAO,sBAACD,KAAD,EAAP,EAAgC,MAAKE,2BAACF,KAAK,CAAC/B,WAAN,CAAkB8B,EAAlB,CAAD,CAArC,CADF,EAHiDrB,aAGjD,CADF,EAFmDA,aAEnD,CADK,CAAP;AAOD;AAED;;;;;AAGA,OAAM,MAAOU,sBAAP,CAA6B;EACjCe,YAAqBpB,IAArB,EAA0C;IAArB;;IAErB,eAAoBqB,EAAV,IAA2CpB,yBAAsB,KAAKD,IAA3B,EAA+BM,sBAA/B,CAArD;;IAEA,aAAkBe,EAAV,IAA0C;MAChD,IAAI,KAAKrB,IAAL,CAAUsB,gBAAd,EAAgC;QAC9B,sDAAOD,EAAP;MACD;;MACD,OAAOpB,yBAAsB,KAAKD,IAA3B,EAA+BM,sBAA/B,CAAP;IACD,CALD;EAJ8C;;AADb","names":["interruptAs","setInterruptStatus_","interruptible","uninterruptible","uninterruptibleMask","onInterrupt_","disconnect","SetInterrupt","fiberId","__tsplusTrace","tsplus_module_2","tsplus_module_1","interrupt","self","flag","setInterruptStatus_1","tsplus_module_3","f","uninterruptible_1","InterruptStatusRestore","fileName_1","interruptibleMask","k","interruptible_1","ma","cleanup","uninterruptibleMask_1","restore","cause","onInterruptExtended_","id","fiber","onInterrupt_1","tsplus_module_4","constructor","io","isUninteruptible"],"sourceRoot":"","sources":["../../../_src/IO/api/interrupt.ts"],"sourcesContent":[null]}
@@ -1 +1 @@
1
- {"version":3,"file":"sleep.mjs","mappings":";AAAA;;;;AAGA,OAAM,SAAUA,KAAV,CAAgBC,QAAhB,EAAkCC,aAAlC,EAAwD;EAC5D,OAAOC,sBAAYF,QAAZ,EAD+BC,aAC/B,CAAP;AACD","names":["sleep","duration","__tsplusTrace","tsplus_module_1"],"sourceRoot":"","sources":["../../../_src/IO/api/sleep.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"sleep.mjs","mappings":";AAAA;;;;AAGA,OAAM,SAAUA,KAAV,CAAgBC,QAAhB,EAA0CC,aAA1C,EAAgE;EACpE,OAAOC,sBAAYF,QAAZ,EADuCC,aACvC,CAAP;AACD","names":["sleep","duration","__tsplusTrace","tsplus_module_1"],"sourceRoot":"","sources":["../../../_src/IO/api/sleep.ts"],"sourcesContent":[null]}
@@ -0,0 +1,23 @@
1
+ const fileName_1 = "(@fncts/io) src/IO/api/timeout.ts";
2
+ import * as tsplus_module_1 from "@fncts/io/IO/api/interrupt";
3
+ import * as tsplus_module_2 from "@fncts/io/IO/api/sleep";
4
+ import * as tsplus_module_3 from "@fncts/io/IO/api";
5
+ import * as tsplus_module_4 from "@fncts/io/IO/api/raceFirst";
6
+ import * as tsplus_module_5 from "@fncts/base/data/Maybe/constructors";
7
+ export const timeoutTo = timeoutTo_1;
8
+ /**
9
+ * @tsplus fluent fncts.io.IO timeoutTo
10
+ */
11
+
12
+ function timeoutTo_1(self, duration, b, f, __tsplusTrace) {
13
+ return tsplus_module_4.raceFirst_(tsplus_module_3.map_(self, f, __tsplusTrace), tsplus_module_3.as_(tsplus_module_1.interruptible(tsplus_module_2.sleep(duration, __tsplusTrace)), b));
14
+ }
15
+ /**
16
+ * @tsplus fluent fncts.io.IO timeout
17
+ */
18
+
19
+
20
+ export function timeout(self, duration) {
21
+ return timeoutTo_1(self, duration, () => tsplus_module_5.nothing(), tsplus_module_5.just, fileName_1 + ":18:24");
22
+ }
23
+ //# sourceMappingURL=timeout.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeout.mjs","mappings":";;;;;;aAGgBA,SAAS;AAHzB;;;;AAGA,qBACEC,IADF,EAEEC,QAFF,EAGEC,CAHF,EAIEC,CAJF,EAKEC,aALF,EAKwB;EAEtB,OAAOC,sDAASF,CAAT,EAFPC,aAEO,GAAsBE,wEAASL,QAAT,EAF7BG,aAE6B,IAAoCF,CAApC,CAAtB,CAAP;AACD;AAED;;;;;AAGA,OAAM,SAAUK,OAAV,CAA2BP,IAA3B,EAA8CC,QAA9C,EAAsE;EAC1E,OAAOO,kBAAeP,QAAf,EAAuB,MAAEQ,yBAAzB,EAAkCA,oBAAlC,EAAkCC,qBAAlC,CAAP;AACD","names":["timeoutTo","self","duration","b","f","__tsplusTrace","tsplus_module_4","tsplus_module_3","timeout","timeoutTo_1","tsplus_module_5","fileName_1"],"sourceRoot":"","sources":["../../../_src/IO/api/timeout.ts"],"sourcesContent":[null]}
package/_mjs/IO/api.mjs CHANGED
@@ -636,13 +636,14 @@ function foldLeft_1(as, b, f, __tsplusTrace) {
636
636
  /**
637
637
  * Combines an array of `IO`s using a `Monoid`
638
638
  *
639
- * @constrained
640
639
  * @tsplus static fncts.io.IOOps foldMap
641
640
  */
642
641
 
643
642
 
644
- export function foldMap_(M) {
645
- return (as, f) => foldLeft_1(as, M.nat, (m, a) => map_1(a, a => M.combine_(m, f(a)), fileName_1 + ":769:43"), fileName_1 + ":769:16");
643
+ export function foldMap_(as, f,
644
+ /** @tsplus auto */
645
+ M) {
646
+ return foldLeft_1(as, M.nat, (m, a) => map_1(a, a => M.combine(m, f(a)), fileName_1 + ":771:48"), fileName_1 + ":771:21");
646
647
  }
647
648
 
648
649
  function foldRightLoop(iterator, b, f) {
@@ -662,7 +663,7 @@ export function foldRight_(as, b, f) {
662
663
 
663
664
  function foreachWithIndexDiscardLoop(iterator, f, i = 0) {
664
665
  const next = iterator.next();
665
- return next.done ? unit_1 : flatMap_1(f(i, next.value), () => foreachWithIndexDiscardLoop(iterator, f, i + 1), fileName_1 + ":800:56");
666
+ return next.done ? unit_1 : flatMap_1(f(i, next.value), () => foreachWithIndexDiscardLoop(iterator, f, i + 1), fileName_1 + ":802:56");
666
667
  }
667
668
  /**
668
669
  * Applies the function `f` to each element of the `Iterable<A>` and
@@ -701,15 +702,15 @@ export function foreachWithIndex_(as, f) {
701
702
  return as_1(foreachWithIndexDiscard_1(as, (i, a) => flatMap_1(f(i, a), b => {
702
703
  acc.push(b);
703
704
  return unit_1;
704
- }, fileName_1 + ":841:22")), () => tsplus_module_11.from(acc));
705
- }, fileName_1 + ":838:18");
705
+ }, fileName_1 + ":843:22")), () => tsplus_module_11.from(acc));
706
+ }, fileName_1 + ":840:18");
706
707
  }
707
708
  /**
708
709
  * @tsplus static fncts.io.IOOps foreachWithIndexDiscard
709
710
  */
710
711
 
711
712
  function foreachWithIndexDiscard_1(as, f) {
712
- return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), f), fileName_1 + ":856:18");
713
+ return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), f), fileName_1 + ":858:18");
713
714
  }
714
715
  /**
715
716
  * Applies the function `f` to each element of the `Iterable<A>` and runs
@@ -720,7 +721,7 @@ function foreachWithIndexDiscard_1(as, f) {
720
721
 
721
722
 
722
723
  function foreachDiscard_1(as, f) {
723
- return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)), fileName_1 + ":866:18");
724
+ return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)), fileName_1 + ":868:18");
724
725
  }
725
726
  /**
726
727
  * Repeats this effect forever (until the first failure).
@@ -730,7 +731,7 @@ function foreachDiscard_1(as, f) {
730
731
 
731
732
 
732
733
  function forever_1(ma) {
733
- return flatMap_1(apSecond_1(ma, yieldNow_1, fileName_1 + ":875:21"), () => forever_1(ma), fileName_1 + ":875:42");
734
+ return flatMap_1(apSecond_1(ma, yieldNow_1, fileName_1 + ":877:21"), () => forever_1(ma), fileName_1 + ":877:42");
734
735
  }
735
736
  /**
736
737
  * Returns an IO that forks this IO into its own separate fiber,
@@ -864,7 +865,7 @@ export function fromPromiseHalt(promise, __tsplusTrace) {
864
865
  */
865
866
 
866
867
  export function get(ma) {
867
- return matchCauseIO_1(ma, cause => failCauseNow_1(tsplus_module_5.map_(cause, tsplus_module_2.just), fileName_1 + ":1016:31"), ma => tsplus_module_4.match_(ma, () => failNow_1(tsplus_module_2.nothing(), fileName_1 + ":1017:38"), succeedNow_1), fileName_1 + ":1015:25");
868
+ return matchCauseIO_1(ma, cause => failCauseNow_1(tsplus_module_5.map_(cause, tsplus_module_2.just), fileName_1 + ":1018:31"), ma => tsplus_module_4.match_(ma, () => failNow_1(tsplus_module_2.nothing(), fileName_1 + ":1019:38"), succeedNow_1), fileName_1 + ":1017:25");
868
869
  }
869
870
  /**
870
871
  * Extracts the optional value, or returns the given 'orElse'.
@@ -873,7 +874,7 @@ export function get(ma) {
873
874
  */
874
875
 
875
876
  export function getOrElse_(ma, orElse) {
876
- return map_1(ma, ma => tsplus_module_7.getOrElse_(ma, orElse), fileName_1 + ":1027:16");
877
+ return map_1(ma, ma => tsplus_module_7.getOrElse_(ma, orElse), fileName_1 + ":1029:16");
877
878
  }
878
879
  /**
879
880
  * Extracts the optional value, or executes the effect 'orElse'.
@@ -882,7 +883,7 @@ export function getOrElse_(ma, orElse) {
882
883
  */
883
884
 
884
885
  export function getOrElseIO_(ma, orElse) {
885
- return flatMap_1(ma, mab => tsplus_module_7.getOrElse_(tsplus_module_7.map_(mab, succeedNow_1), orElse), fileName_1 + ":1039:48");
886
+ return flatMap_1(ma, mab => tsplus_module_7.getOrElse_(tsplus_module_7.map_(mab, succeedNow_1), orElse), fileName_1 + ":1041:48");
886
887
  }
887
888
  /**
888
889
  * Lifts a Maybe into an IO. If the option is `Nothing`, fail with `onNothing`.
@@ -891,7 +892,7 @@ export function getOrElseIO_(ma, orElse) {
891
892
  */
892
893
 
893
894
  function getOrFailWith_1(maybe, onNothing) {
894
- return defer_1(() => tsplus_module_4.match_(maybe, () => fail_1(onNothing, fileName_1 + ":1048:44"), succeedNow_1), fileName_1 + ":1048:18");
895
+ return defer_1(() => tsplus_module_4.match_(maybe, () => fail_1(onNothing, fileName_1 + ":1050:44"), succeedNow_1), fileName_1 + ":1050:18");
895
896
  }
896
897
  /**
897
898
  * Lifts a Maybe into a IO, if the Maybe is `Nothing` it fails with Unit.
@@ -931,7 +932,7 @@ function haltNow_1(e, __tsplusTrace) {
931
932
 
932
933
 
933
934
  function ifIO_1(self, onFalse, onTrue) {
934
- return flatMap_1(self, b => b ? onTrue() : onFalse(), fileName_1 + ":1090:22");
935
+ return flatMap_1(self, b => b ? onTrue() : onFalse(), fileName_1 + ":1092:22");
935
936
  }
936
937
  /**
937
938
  * @tsplus static fncts.io.IOOps if
@@ -946,7 +947,7 @@ export function if_(b, onTrue, onFalse, __tsplusTrace) {
946
947
  */
947
948
 
948
949
  export function ignore(fa) {
949
- return match_1(fa, () => undefined, () => undefined, fileName_1 + ":1109:18");
950
+ return match_1(fa, () => undefined, () => undefined, fileName_1 + ":1111:18");
950
951
  }
951
952
  /**
952
953
  * Folds a `IO` to a boolean describing whether or not it is a failure
@@ -955,7 +956,7 @@ export function ignore(fa) {
955
956
  */
956
957
 
957
958
  export function isFailure(ma) {
958
- return match_1(ma, () => true, () => false, fileName_1 + ":1121:18");
959
+ return match_1(ma, () => true, () => false, fileName_1 + ":1123:18");
959
960
  }
960
961
  /**
961
962
  * Folds a `IO` to a boolean describing whether or not it is a success
@@ -964,7 +965,7 @@ export function isFailure(ma) {
964
965
  */
965
966
 
966
967
  export function isSuccess(ma) {
967
- return match_1(ma, () => false, () => true, fileName_1 + ":1133:18");
968
+ return match_1(ma, () => false, () => true, fileName_1 + ":1135:18");
968
969
  }
969
970
  /**
970
971
  * Iterates with the specified effectual function. The moral equivalent of:
@@ -993,7 +994,7 @@ function iterate_1(initial, cont, body, __tsplusTrace) {
993
994
 
994
995
 
995
996
  export function left(a) {
996
- return flatMap_1(succeed_1(a, fileName_1 + ":1168:20"), a => succeedNow_1(tsplus_module_3.left(a), fileName_1 + ":1168:52"), fileName_1 + ":1168:31");
997
+ return flatMap_1(succeed_1(a, fileName_1 + ":1170:20"), a => succeedNow_1(tsplus_module_3.left(a), fileName_1 + ":1170:52"), fileName_1 + ":1170:31");
997
998
  }
998
999
  /**
999
1000
  * @tsplus static fncts.io.IOOps log
@@ -1178,8 +1179,8 @@ export const never = /*#__PURE__*/defer_1(() => asyncInterrupt_1(() => {
1178
1179
  }, 60000);
1179
1180
  return tsplus_module_3.left(succeed_1(() => {
1180
1181
  clearInterval(interval);
1181
- }, fileName_1 + ":1407:17"));
1182
- }), fileName_1 + ":1401:39");
1182
+ }, fileName_1 + ":1409:17"));
1183
+ }), fileName_1 + ":1403:39");
1183
1184
  /**
1184
1185
  * Converts an option on errors into an option on values.
1185
1186
  *
@@ -1187,7 +1188,7 @@ export const never = /*#__PURE__*/defer_1(() => asyncInterrupt_1(() => {
1187
1188
  */
1188
1189
 
1189
1190
  export function optional(ma) {
1190
- return matchIO_1(ma, me => tsplus_module_4.match_(me, () => succeedNow_1(tsplus_module_2.nothing(), fileName_1 + ":1421:41"), failNow_1), a => succeedNow_1(tsplus_module_2.just(a), fileName_1 + ":1422:25"), fileName_1 + ":1420:20");
1191
+ return matchIO_1(ma, me => tsplus_module_4.match_(me, () => succeedNow_1(tsplus_module_2.nothing(), fileName_1 + ":1423:41"), failNow_1), a => succeedNow_1(tsplus_module_2.just(a), fileName_1 + ":1424:25"), fileName_1 + ":1422:20");
1191
1192
  }
1192
1193
  /**
1193
1194
  * Returns the logical disjunction of the `Boolean` value returned by this
@@ -1221,7 +1222,7 @@ export function orElseEither_(self, that, __tsplusTrace) {
1221
1222
  */
1222
1223
 
1223
1224
  export function orElseFail_(ma, e) {
1224
- return orElse_1(ma, () => fail_1(e, fileName_1 + ":1468:27"), fileName_1 + ":1468:19");
1225
+ return orElse_1(ma, () => fail_1(e, fileName_1 + ":1470:27"), fileName_1 + ":1470:19");
1225
1226
  }
1226
1227
  /**
1227
1228
  * @tsplus fluent fncts.io.IO orElseMaybe
@@ -1249,7 +1250,7 @@ export function orHalt(ma, __tsplusTrace) {
1249
1250
  */
1250
1251
 
1251
1252
  export function orHaltKeep(ma) {
1252
- return matchCauseIO_1(ma, cause => failCauseNow_1(tsplus_module_5.flatMap_(cause, tsplus_module_5.halt), fileName_1 + ":1500:52"), succeedNow_1, fileName_1 + ":1500:25");
1253
+ return matchCauseIO_1(ma, cause => failCauseNow_1(tsplus_module_5.flatMap_(cause, tsplus_module_5.halt), fileName_1 + ":1502:52"), succeedNow_1, fileName_1 + ":1502:25");
1253
1254
  }
1254
1255
  /**
1255
1256
  * @tsplus fluent fncts.io.IO orHaltWith
@@ -1270,11 +1271,11 @@ export function parallelErrors(io) {
1270
1271
  const f = tsplus_module_5.failures(cause);
1271
1272
 
1272
1273
  if (tsplus_module_17.length(f) === 0) {
1273
- return failCauseNow_1(cause, fileName_1 + ":1519:29");
1274
+ return failCauseNow_1(cause, fileName_1 + ":1521:29");
1274
1275
  } else {
1275
- return failNow_1(f, fileName_1 + ":1521:24");
1276
+ return failNow_1(f, fileName_1 + ":1523:24");
1276
1277
  }
1277
- }, succeedNow_1, fileName_1 + ":1516:25");
1278
+ }, succeedNow_1, fileName_1 + ":1518:25");
1278
1279
  }
1279
1280
  /**
1280
1281
  * Feeds elements of type `A` to a function `f` that returns an IO.
@@ -1303,7 +1304,7 @@ export function refineOrHalt_(fa, pf, __tsplusTrace) {
1303
1304
  */
1304
1305
 
1305
1306
  function refineOrHaltWith_1(fa, pf, f) {
1306
- return catchAll_1(fa, e => tsplus_module_4.match_(pf(e), () => haltNow_1(f(e), fileName_1 + ":1564:57"), failNow_1), fileName_1 + ":1564:21");
1307
+ return catchAll_1(fa, e => tsplus_module_4.match_(pf(e), () => haltNow_1(f(e), fileName_1 + ":1566:57"), failNow_1), fileName_1 + ":1566:21");
1307
1308
  }
1308
1309
  /**
1309
1310
  * Fail with the returned value if the partial function `pf` matches, otherwise
@@ -1364,7 +1365,7 @@ function repeatUntilIO_1(ma, f, __tsplusTrace) {
1364
1365
 
1365
1366
 
1366
1367
  export function repeatWhile_(ma, f) {
1367
- return repeatWhileIO_1(ma, a => succeedNow_1(f(a), fileName_1 + ":1638:47"), fileName_1 + ":1638:26");
1368
+ return repeatWhileIO_1(ma, a => succeedNow_1(f(a), fileName_1 + ":1640:47"), fileName_1 + ":1640:26");
1368
1369
  }
1369
1370
  /**
1370
1371
  * Repeats this effect while its error satisfies the specified effectful predicate.
@@ -1407,7 +1408,7 @@ export function result(ma, __tsplusTrace) {
1407
1408
  */
1408
1409
 
1409
1410
  export function resurrect(io) {
1410
- return unrefineWith_1(io, tsplus_module_2.just, identity, fileName_1 + ":1687:25");
1411
+ return unrefineWith_1(io, tsplus_module_2.just, identity, fileName_1 + ":1689:25");
1411
1412
  }
1412
1413
  /**
1413
1414
  * Retries this effect until its error satisfies the specified predicate.
@@ -1453,7 +1454,7 @@ function retryWhileIO_1(fa, f, __tsplusTrace) {
1453
1454
  */
1454
1455
 
1455
1456
 
1456
- export const runtimeConfig = /*#__PURE__*/deferWith_1(runtimeConfig => succeedNow_1(runtimeConfig, fileName_1 + ":1739:95"), fileName_1 + ":1739:62");
1457
+ export const runtimeConfig = /*#__PURE__*/deferWith_1(runtimeConfig => succeedNow_1(runtimeConfig, fileName_1 + ":1741:95"), fileName_1 + ":1741:62");
1457
1458
  /**
1458
1459
  * Exposes the full cause of failure of this effect.
1459
1460
  *
@@ -1484,7 +1485,7 @@ export function setRuntimeConfig(runtimeConfig, __tsplusTrace) {
1484
1485
  */
1485
1486
 
1486
1487
  export function sequenceIterable(as) {
1487
- return foreach_1(as, identity, fileName_1 + ":1773:20");
1488
+ return foreach_1(as, identity, fileName_1 + ":1775:20");
1488
1489
  }
1489
1490
  /**
1490
1491
  * @tsplus static fncts.io.IOOps sequenceIterableDiscard
@@ -1547,7 +1548,7 @@ function summarized_1(ma, summary, f, __tsplusTrace) {
1547
1548
 
1548
1549
 
1549
1550
  function swap_1(pab) {
1550
- return matchIO_1(pab, succeedNow_1, failNow_1, fileName_1 + ":1842:21");
1551
+ return matchIO_1(pab, succeedNow_1, failNow_1, fileName_1 + ":1844:21");
1551
1552
  }
1552
1553
  /**
1553
1554
  * Swaps the error/value parameters, applies the function `f` and flips the parameters back
@@ -1647,7 +1648,7 @@ function tryOrElse_1(ma, that, onSuccess, __tsplusTrace) {
1647
1648
  */
1648
1649
 
1649
1650
 
1650
- const unit_1 = /*#__PURE__*/succeedNow_1(undefined, fileName_1 + ":1962:45");
1651
+ const unit_1 = /*#__PURE__*/succeedNow_1(undefined, fileName_1 + ":1964:45");
1651
1652
  export const unit = unit_1;
1652
1653
  /**
1653
1654
  * Converts an option on errors into an option on values.
@@ -1656,7 +1657,7 @@ export const unit = unit_1;
1656
1657
  */
1657
1658
 
1658
1659
  export function unjust(self) {
1659
- return matchIO_1(self, e => tsplus_module_4.match_(e, () => succeedNow_1(tsplus_module_2.nothing(), fileName_1 + ":1971:39"), failNow_1), a => succeedNow_1(tsplus_module_2.just(a), fileName_1 + ":1972:25"), fileName_1 + ":1970:22");
1660
+ return matchIO_1(self, e => tsplus_module_4.match_(e, () => succeedNow_1(tsplus_module_2.nothing(), fileName_1 + ":1973:39"), failNow_1), a => succeedNow_1(tsplus_module_2.just(a), fileName_1 + ":1974:25"), fileName_1 + ":1972:22");
1660
1661
  }
1661
1662
  /**
1662
1663
  * Takes some fiber failures and converts them into errors, using the
@@ -1676,7 +1677,7 @@ function unrefineWith_1(fa, pf, f, __tsplusTrace) {
1676
1677
 
1677
1678
 
1678
1679
  function unsandbox_1(ma) {
1679
- return mapErrorCause_1(ma, cause => tsplus_module_5.flatten(cause), fileName_1 + ":1999:26");
1680
+ return mapErrorCause_1(ma, cause => tsplus_module_5.flatten(cause), fileName_1 + ":2001:26");
1680
1681
  }
1681
1682
  /**
1682
1683
  * Updates the `FiberRef` values for the fiber running this effect using the
@@ -1708,7 +1709,7 @@ export function when_(ma, b, __tsplusTrace) {
1708
1709
  */
1709
1710
 
1710
1711
  function whenIO_1(ma, mb) {
1711
- return flatMap_1(mb, b => b ? asUnit_1(ma) : unit_1, fileName_1 + ":2033:20");
1712
+ return flatMap_1(mb, b => b ? asUnit_1(ma) : unit_1, fileName_1 + ":2035:20");
1712
1713
  }
1713
1714
  /**
1714
1715
  * Returns an effect that yields to the runtime system, starting on a fresh
@@ -1733,7 +1734,7 @@ export function zip_(self, that) {
1733
1734
  */
1734
1735
 
1735
1736
  function zipWith_1(self, that, f) {
1736
- return flatMap_1(self, a => map_1(that, b => f(a, b), fileName_1 + ":2060:38"), fileName_1 + ":2060:22");
1737
+ return flatMap_1(self, a => map_1(that, b => f(a, b), fileName_1 + ":2062:38"), fileName_1 + ":2062:22");
1737
1738
  }
1738
1739
 
1739
1740
  export class GenIO {
@@ -1787,7 +1788,7 @@ function gen_1(f) {
1787
1788
 
1788
1789
  const run = state => {
1789
1790
  if (state.done) {
1790
- return succeed_1(() => state.value, fileName_1 + ":2115:26");
1791
+ return succeed_1(() => state.value, fileName_1 + ":2117:26");
1791
1792
  }
1792
1793
 
1793
1794
  const f = val => {
@@ -1795,10 +1796,10 @@ function gen_1(f) {
1795
1796
  return run(next);
1796
1797
  };
1797
1798
 
1798
- return flatMap_1(state.value.effect, f, fileName_1 + ":2121:40");
1799
+ return flatMap_1(state.value.effect, f, fileName_1 + ":2123:40");
1799
1800
  };
1800
1801
 
1801
1802
  return run(state);
1802
- }, fileName_1 + ":2109:18");
1803
+ }, fileName_1 + ":2111:18");
1803
1804
  }
1804
1805
  //# sourceMappingURL=api.mjs.map