@typed/fx 1.0.9 → 1.0.11

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 (428) hide show
  1. package/coverage/src/Fx.ts.html +1 -1
  2. package/coverage/src/Subject/Subject.ts.html +1 -1
  3. package/coverage/src/_internal/RefCounter.ts.html +1 -1
  4. package/coverage/src/_internal/earlyExit.ts.html +1 -1
  5. package/coverage/src/constructor/at.ts.html +1 -1
  6. package/coverage/src/constructor/fromArray.ts.html +1 -1
  7. package/coverage/src/constructor/fromEffect.ts.html +1 -1
  8. package/coverage/src/constructor/fromEmitter.ts.html +1 -1
  9. package/coverage/src/constructor/serviceWith.ts.html +70 -66
  10. package/coverage/src/constructor/succeed.ts.html +11 -12
  11. package/coverage/src/operator/delay.ts.html +1 -1
  12. package/coverage/src/operator/filterEffect.ts.html +1 -1
  13. package/coverage/src/operator/filterMap.ts.html +78 -74
  14. package/coverage/src/operator/filterMapEffect.ts.html +1 -1
  15. package/coverage/src/operator/flatMap.ts.html +1 -1
  16. package/coverage/src/operator/flatMapConcurrently.ts.html +71 -66
  17. package/coverage/src/operator/merge.ts.html +1 -1
  18. package/coverage/src/operator/multicast.ts.html +1 -1
  19. package/coverage/src/operator/provideService.ts.html +1 -1
  20. package/coverage/src/operator/provideServiceEffect.ts.html +1 -1
  21. package/coverage/src/operator/scan.ts.html +70 -66
  22. package/coverage/src/operator/scanEffect.ts.html +1 -1
  23. package/coverage/src/operator/skipRepeats.ts.html +1 -1
  24. package/coverage/src/operator/slice.ts.html +78 -74
  25. package/coverage/src/operator/startWith.ts.html +70 -66
  26. package/coverage/src/operator/switchMap.ts.html +1 -1
  27. package/coverage/src/operator/withPermit.ts.html +1 -1
  28. package/coverage/src/run/collectAll.ts.html +1 -1
  29. package/coverage/src/run/observe.ts.html +1 -1
  30. package/coverage/src/run/reduce.ts.html +70 -66
  31. package/coverage/src/run/run.ts.html +1 -1
  32. package/dist/Fx.js +1 -1
  33. package/dist/Subject/HoldSubject.d.ts +1 -1
  34. package/dist/Subject/HoldSubject.d.ts.map +1 -1
  35. package/dist/Subject/HoldSubject.js +3 -3
  36. package/dist/Subject/HoldSubject.js.map +1 -1
  37. package/dist/Subject/RefSubject.d.ts +1 -1
  38. package/dist/Subject/RefSubject.d.ts.map +1 -1
  39. package/dist/Subject/RefSubject.js +3 -3
  40. package/dist/Subject/RefSubject.js.map +1 -1
  41. package/dist/Subject/Subject.js +1 -1
  42. package/dist/Subject/SynchronizedSubject.d.ts.map +1 -1
  43. package/dist/Subject/SynchronizedSubject.js +5 -6
  44. package/dist/Subject/SynchronizedSubject.js.map +1 -1
  45. package/dist/_internal/RefCounter.js +2 -2
  46. package/dist/_internal/RefCounter.js.map +1 -1
  47. package/dist/_internal/earlyExit.js +1 -1
  48. package/dist/constructor/acquireUseRelease.js +1 -1
  49. package/dist/constructor/async.js +1 -1
  50. package/dist/constructor/asyncEffect.js +1 -1
  51. package/dist/constructor/asyncOption.d.ts +1 -1
  52. package/dist/constructor/asyncOption.js +1 -1
  53. package/dist/constructor/at.d.ts.map +1 -1
  54. package/dist/constructor/at.js +1 -1
  55. package/dist/constructor/at.js.map +1 -1
  56. package/dist/constructor/die.js +1 -1
  57. package/dist/constructor/dieMessage.js +1 -1
  58. package/dist/constructor/dieSync.js +1 -1
  59. package/dist/constructor/done.js +1 -1
  60. package/dist/constructor/fail.js +1 -1
  61. package/dist/constructor/failCause.js +1 -1
  62. package/dist/constructor/failCauseSync.js +1 -1
  63. package/dist/constructor/fromArray.js +1 -1
  64. package/dist/constructor/fromEffect.js +1 -1
  65. package/dist/constructor/fromEither.d.ts +1 -1
  66. package/dist/constructor/fromEither.js +1 -1
  67. package/dist/constructor/fromEitherCause.d.ts +1 -1
  68. package/dist/constructor/fromEitherCause.js +1 -1
  69. package/dist/constructor/fromEmitter.d.ts +4 -4
  70. package/dist/constructor/fromEmitter.d.ts.map +1 -1
  71. package/dist/constructor/fromEmitter.js +4 -4
  72. package/dist/constructor/fromEmitter.js.map +1 -1
  73. package/dist/constructor/fromFiber.js +1 -1
  74. package/dist/constructor/fromFiberEffect.js +1 -1
  75. package/dist/constructor/fromFxEffect.js +1 -1
  76. package/dist/constructor/fromOption.d.ts +1 -1
  77. package/dist/constructor/fromOption.js +1 -1
  78. package/dist/constructor/periodic.d.ts.map +1 -1
  79. package/dist/constructor/periodic.js +1 -1
  80. package/dist/constructor/periodic.js.map +1 -1
  81. package/dist/constructor/promise.js +1 -1
  82. package/dist/constructor/promiseAbort.js +1 -1
  83. package/dist/constructor/promiseFx.js +1 -1
  84. package/dist/constructor/random.js +1 -1
  85. package/dist/constructor/scheduled.js +1 -1
  86. package/dist/constructor/service.d.ts.map +1 -1
  87. package/dist/constructor/service.js +1 -1
  88. package/dist/constructor/service.js.map +1 -1
  89. package/dist/constructor/serviceWith.d.ts.map +1 -1
  90. package/dist/constructor/serviceWith.js +1 -2
  91. package/dist/constructor/serviceWith.js.map +1 -1
  92. package/dist/constructor/serviceWithEffect.d.ts.map +1 -1
  93. package/dist/constructor/serviceWithEffect.js +1 -2
  94. package/dist/constructor/serviceWithEffect.js.map +1 -1
  95. package/dist/constructor/serviceWithFx.js +1 -1
  96. package/dist/constructor/serviceWithFx.js.map +1 -1
  97. package/dist/constructor/succeed.js +1 -1
  98. package/dist/constructor/sync.js +1 -1
  99. package/dist/constructor/tryCatchPromise.js +1 -1
  100. package/dist/constructor/tryCatchPromiseAbort.js +1 -1
  101. package/dist/constructor/tryPromise.js +1 -1
  102. package/dist/constructor/tryPromiseAbort.js +1 -1
  103. package/dist/operator/catch.js +1 -1
  104. package/dist/operator/catchAll.js +2 -2
  105. package/dist/operator/catchAllDefect.js +2 -2
  106. package/dist/operator/combine.js +1 -1
  107. package/dist/operator/compact.d.ts +1 -1
  108. package/dist/operator/compact.js +1 -1
  109. package/dist/operator/contramapContext.d.ts +5 -0
  110. package/dist/operator/contramapContext.d.ts.map +1 -0
  111. package/dist/operator/contramapContext.js +25 -0
  112. package/dist/operator/contramapContext.js.map +1 -0
  113. package/dist/operator/debounce.d.ts.map +1 -1
  114. package/dist/operator/debounce.js +1 -1
  115. package/dist/operator/debounce.js.map +1 -1
  116. package/dist/operator/delay.d.ts.map +1 -1
  117. package/dist/operator/delay.js +1 -1
  118. package/dist/operator/delay.js.map +1 -1
  119. package/dist/operator/during.js +1 -1
  120. package/dist/operator/exhaustMap.js +1 -1
  121. package/dist/operator/exhaustMapEffect.js +1 -1
  122. package/dist/operator/exhaustMapLatest.js +1 -1
  123. package/dist/operator/exhaustMapLatestEffect.js +1 -1
  124. package/dist/operator/filter.d.ts +1 -1
  125. package/dist/operator/filterEffect.js +1 -1
  126. package/dist/operator/filterMap.d.ts +1 -1
  127. package/dist/operator/filterMap.js +2 -2
  128. package/dist/operator/filterMapEffect.d.ts +1 -1
  129. package/dist/operator/filterMapEffect.js +2 -2
  130. package/dist/operator/flatMap.js +1 -1
  131. package/dist/operator/flatMapCause.js +1 -1
  132. package/dist/operator/flatMapConcurrently.js +3 -3
  133. package/dist/operator/flatMapConcurrently.js.map +1 -1
  134. package/dist/operator/flatMapEffect.js +1 -1
  135. package/dist/operator/flatMapEffectConcurrently.js +1 -1
  136. package/dist/operator/hold.d.ts +1 -1
  137. package/dist/operator/hold.d.ts.map +1 -1
  138. package/dist/operator/hold.js +3 -3
  139. package/dist/operator/hold.js.map +1 -1
  140. package/dist/operator/index.d.ts +2 -2
  141. package/dist/operator/index.d.ts.map +1 -1
  142. package/dist/operator/index.js +2 -2
  143. package/dist/operator/index.js.map +1 -1
  144. package/dist/operator/interruptible.js +1 -1
  145. package/dist/operator/mapCause.js +1 -1
  146. package/dist/operator/merge.js +1 -1
  147. package/dist/operator/mergeRace.js +1 -1
  148. package/dist/operator/multicast.d.ts.map +1 -1
  149. package/dist/operator/multicast.js +7 -7
  150. package/dist/operator/multicast.js.map +1 -1
  151. package/dist/operator/onDone.js +2 -2
  152. package/dist/operator/onDoneCause.js +1 -1
  153. package/dist/operator/onExit.js +1 -1
  154. package/dist/operator/onInterrupt.js +1 -1
  155. package/dist/operator/provideContext.d.ts +4 -0
  156. package/dist/operator/provideContext.d.ts.map +1 -0
  157. package/dist/operator/provideContext.js +18 -0
  158. package/dist/operator/provideContext.js.map +1 -0
  159. package/dist/operator/provideLayer.js +1 -1
  160. package/dist/operator/provideService.d.ts.map +1 -1
  161. package/dist/operator/provideService.js +2 -2
  162. package/dist/operator/provideService.js.map +1 -1
  163. package/dist/operator/provideServiceEffect.d.ts.map +1 -1
  164. package/dist/operator/provideServiceEffect.js +2 -2
  165. package/dist/operator/provideServiceEffect.js.map +1 -1
  166. package/dist/operator/provideSomeLayer.js +1 -1
  167. package/dist/operator/race.js +4 -5
  168. package/dist/operator/race.js.map +1 -1
  169. package/dist/operator/sample.js +1 -1
  170. package/dist/operator/sampleEffect.js +1 -1
  171. package/dist/operator/sandbox.js +1 -1
  172. package/dist/operator/scan.js +1 -1
  173. package/dist/operator/scanEffect.js +3 -4
  174. package/dist/operator/scanEffect.js.map +1 -1
  175. package/dist/operator/separate.d.ts +1 -1
  176. package/dist/operator/separate.js +2 -2
  177. package/dist/operator/since.js +1 -1
  178. package/dist/operator/skipAfter.d.ts +1 -1
  179. package/dist/operator/skipRepeats.js +3 -3
  180. package/dist/operator/skipRepeats.js.map +1 -1
  181. package/dist/operator/skipUntil.d.ts +1 -1
  182. package/dist/operator/skipWhile.d.ts +1 -1
  183. package/dist/operator/skipWhile.js +2 -2
  184. package/dist/operator/slice.js +1 -1
  185. package/dist/operator/snapshot.js +3 -3
  186. package/dist/operator/snapshot.js.map +1 -1
  187. package/dist/operator/snapshotEffect.js +4 -6
  188. package/dist/operator/snapshotEffect.js.map +1 -1
  189. package/dist/operator/startWith.js +1 -1
  190. package/dist/operator/startWithEffect.js +1 -1
  191. package/dist/operator/struct.js +1 -1
  192. package/dist/operator/switchMap.js +1 -1
  193. package/dist/operator/switchMapCause.js +1 -1
  194. package/dist/operator/switchMapEffect.js +1 -1
  195. package/dist/operator/switchMapError.js +2 -2
  196. package/dist/operator/switchMatch.js +3 -3
  197. package/dist/operator/switchMatch.js.map +1 -1
  198. package/dist/operator/takeUntil.d.ts +1 -1
  199. package/dist/operator/takeWhile.d.ts +1 -1
  200. package/dist/operator/takeWhile.js +2 -2
  201. package/dist/operator/tap.js +1 -1
  202. package/dist/operator/tapCause.js +1 -1
  203. package/dist/operator/tapDefect.js +2 -2
  204. package/dist/operator/tapError.js +2 -2
  205. package/dist/operator/throttle.d.ts.map +1 -1
  206. package/dist/operator/throttle.js +1 -1
  207. package/dist/operator/throttle.js.map +1 -1
  208. package/dist/operator/uninterruptible.js +1 -1
  209. package/dist/operator/withItems.js +1 -1
  210. package/dist/operator/withPermit.d.ts +2 -2
  211. package/dist/operator/withPermit.d.ts.map +1 -1
  212. package/dist/operator/withPermit.js +2 -3
  213. package/dist/operator/withPermit.js.map +1 -1
  214. package/dist/operator/withRuntimeFlags.js +1 -1
  215. package/dist/operator/zip.js +1 -1
  216. package/dist/run/collectAll.js +1 -1
  217. package/dist/run/collectN.js +1 -1
  218. package/dist/run/drain.d.ts.map +1 -1
  219. package/dist/run/drain.js +1 -1
  220. package/dist/run/drain.js.map +1 -1
  221. package/dist/run/observe.js +1 -1
  222. package/dist/run/reduce.js +1 -1
  223. package/dist/run/run.js +3 -3
  224. package/dist/run/run.js.map +1 -1
  225. package/dist/run/unsafe.d.ts +5 -5
  226. package/dist/run/unsafe.d.ts.map +1 -1
  227. package/dist/run/unsafe.js +5 -5
  228. package/dist/run/unsafe.js.map +1 -1
  229. package/dist/typeclass/Applicative.js +1 -1
  230. package/dist/typeclass/Applicative.js.map +1 -1
  231. package/dist/typeclass/Bicovariant.d.ts.map +1 -1
  232. package/dist/typeclass/Bicovariant.js +1 -1
  233. package/dist/typeclass/Bicovariant.js.map +1 -1
  234. package/dist/typeclass/Product.d.ts.map +1 -1
  235. package/dist/typeclass/Product.js +1 -1
  236. package/dist/typeclass/Product.js.map +1 -1
  237. package/dist/typeclass/SemiCoproduct.js +4 -4
  238. package/dist/typeclass/SemiCoproduct.js.map +1 -1
  239. package/dist/typeclass/SemiProduct.d.ts.map +1 -1
  240. package/dist/typeclass/SemiProduct.js +2 -2
  241. package/dist/typeclass/SemiProduct.js.map +1 -1
  242. package/package.json +5 -6
  243. package/src/Fx.ts +1 -1
  244. package/src/Subject/HoldSubject.test.ts +1 -1
  245. package/src/Subject/HoldSubject.ts +3 -3
  246. package/src/Subject/RefSubject.ts +3 -3
  247. package/src/Subject/Subject.test.ts +1 -1
  248. package/src/Subject/Subject.ts +1 -1
  249. package/src/Subject/SynchronizedSubject.ts +5 -6
  250. package/src/_internal/RefCounter.ts +2 -2
  251. package/src/_internal/earlyExit.ts +1 -1
  252. package/src/constructor/acquireUseRelease.ts +1 -1
  253. package/src/constructor/async.ts +1 -1
  254. package/src/constructor/asyncEffect.ts +1 -1
  255. package/src/constructor/asyncOption.ts +2 -2
  256. package/src/constructor/at.ts +1 -1
  257. package/src/constructor/die.ts +1 -1
  258. package/src/constructor/dieMessage.ts +1 -1
  259. package/src/constructor/dieSync.ts +1 -1
  260. package/src/constructor/done.ts +1 -1
  261. package/src/constructor/fail.ts +1 -1
  262. package/src/constructor/failCause.ts +1 -1
  263. package/src/constructor/failCauseSync.ts +1 -1
  264. package/src/constructor/fromArray.test.ts +1 -1
  265. package/src/constructor/fromArray.ts +1 -1
  266. package/src/constructor/fromEffect.test.ts +1 -1
  267. package/src/constructor/fromEffect.ts +1 -1
  268. package/src/constructor/fromEither.ts +2 -2
  269. package/src/constructor/fromEitherCause.ts +2 -2
  270. package/src/constructor/fromEmitter.test.ts +1 -1
  271. package/src/constructor/fromEmitter.ts +7 -8
  272. package/src/constructor/fromFiber.ts +1 -1
  273. package/src/constructor/fromFiberEffect.ts +1 -1
  274. package/src/constructor/fromFxEffect.ts +1 -1
  275. package/src/constructor/fromIterable.test.ts +1 -1
  276. package/src/constructor/fromOption.ts +2 -2
  277. package/src/constructor/periodic.ts +1 -1
  278. package/src/constructor/promise.ts +1 -1
  279. package/src/constructor/promiseAbort.ts +1 -1
  280. package/src/constructor/promiseFx.ts +1 -1
  281. package/src/constructor/random.ts +1 -1
  282. package/src/constructor/scheduled.ts +1 -1
  283. package/src/constructor/service.ts +1 -1
  284. package/src/constructor/serviceWith.ts +3 -4
  285. package/src/constructor/serviceWithEffect.ts +2 -3
  286. package/src/constructor/serviceWithFx.ts +1 -1
  287. package/src/constructor/succeed.ts +1 -1
  288. package/src/constructor/sync.ts +1 -1
  289. package/src/constructor/tryCatchPromise.ts +1 -1
  290. package/src/constructor/tryCatchPromiseAbort.ts +1 -1
  291. package/src/constructor/tryPromise.ts +1 -1
  292. package/src/constructor/tryPromiseAbort.ts +1 -1
  293. package/src/operator/catchAll.ts +2 -2
  294. package/src/operator/catchAllCause.test.ts +2 -2
  295. package/src/operator/catchAllDefect.ts +2 -2
  296. package/src/operator/combine.test.ts +2 -2
  297. package/src/operator/combine.ts +1 -1
  298. package/src/operator/compact.ts +2 -2
  299. package/src/operator/concatMap.test.ts +2 -2
  300. package/src/operator/continueWith.test.ts +2 -2
  301. package/src/operator/contramapContext.ts +34 -0
  302. package/src/operator/debounce.test.ts +2 -2
  303. package/src/operator/debounce.ts +1 -1
  304. package/src/operator/delay.ts +1 -1
  305. package/src/operator/during.ts +1 -1
  306. package/src/operator/exhaustMap.test.ts +2 -2
  307. package/src/operator/exhaustMap.ts +1 -1
  308. package/src/operator/exhaustMapEffect.ts +1 -1
  309. package/src/operator/exhaustMapLatest.test.ts +2 -2
  310. package/src/operator/exhaustMapLatest.ts +1 -1
  311. package/src/operator/exhaustMapLatestEffect.ts +1 -1
  312. package/src/operator/filter.test.ts +2 -2
  313. package/src/operator/filter.ts +1 -1
  314. package/src/operator/filterEffect.test.ts +2 -2
  315. package/src/operator/filterEffect.ts +1 -1
  316. package/src/operator/filterMap.test.ts +4 -4
  317. package/src/operator/filterMap.ts +2 -2
  318. package/src/operator/filterMapEffect.test.ts +4 -4
  319. package/src/operator/filterMapEffect.ts +2 -2
  320. package/src/operator/flatMap.test.ts +3 -3
  321. package/src/operator/flatMap.ts +1 -1
  322. package/src/operator/flatMapCause.ts +1 -1
  323. package/src/operator/flatMapConcurrently.test.ts +2 -2
  324. package/src/operator/flatMapConcurrently.ts +3 -3
  325. package/src/operator/flatMapEffect.ts +1 -1
  326. package/src/operator/flatMapEffectConcurrently.ts +1 -1
  327. package/src/operator/hold.test.ts +1 -1
  328. package/src/operator/hold.ts +3 -3
  329. package/src/operator/index.ts +2 -2
  330. package/src/operator/interruptible.ts +1 -1
  331. package/src/operator/loop.test.ts +2 -2
  332. package/src/operator/map.test.ts +2 -2
  333. package/src/operator/mapCause.test.ts +3 -3
  334. package/src/operator/mapCause.ts +1 -1
  335. package/src/operator/merge.test.ts +2 -2
  336. package/src/operator/merge.ts +1 -1
  337. package/src/operator/mergeRace.test.ts +3 -3
  338. package/src/operator/mergeRace.ts +1 -1
  339. package/src/operator/multicast.test.ts +2 -2
  340. package/src/operator/multicast.ts +7 -11
  341. package/src/operator/onDone.ts +2 -2
  342. package/src/operator/onDoneCause.ts +1 -1
  343. package/src/operator/onExit.ts +1 -1
  344. package/src/operator/onInterrupt.ts +1 -1
  345. package/src/operator/{provideEnvironment.ts → provideContext.ts} +5 -5
  346. package/src/operator/provideLayer.ts +1 -1
  347. package/src/operator/provideService.test.ts +2 -2
  348. package/src/operator/provideService.ts +2 -2
  349. package/src/operator/provideServiceEffect.test.ts +2 -2
  350. package/src/operator/provideServiceEffect.ts +2 -2
  351. package/src/operator/provideSomeLayer.ts +1 -1
  352. package/src/operator/race.test.ts +2 -2
  353. package/src/operator/race.ts +17 -18
  354. package/src/operator/sample.ts +1 -1
  355. package/src/operator/sandbox.ts +1 -1
  356. package/src/operator/scan.test.ts +2 -2
  357. package/src/operator/scan.ts +1 -1
  358. package/src/operator/scanEffect.test.ts +3 -3
  359. package/src/operator/scanEffect.ts +9 -7
  360. package/src/operator/separate.test.ts +2 -2
  361. package/src/operator/separate.ts +2 -2
  362. package/src/operator/since.ts +1 -1
  363. package/src/operator/skipAfter.test.ts +2 -2
  364. package/src/operator/skipAfter.ts +1 -1
  365. package/src/operator/skipRepeats.test.ts +2 -2
  366. package/src/operator/skipRepeats.ts +3 -3
  367. package/src/operator/skipUntil.test.ts +2 -2
  368. package/src/operator/skipUntil.ts +1 -1
  369. package/src/operator/skipWhile.ts +2 -2
  370. package/src/operator/slice.test.ts +2 -2
  371. package/src/operator/slice.ts +1 -1
  372. package/src/operator/snapshot.test.ts +2 -2
  373. package/src/operator/snapshot.ts +3 -3
  374. package/src/operator/snapshotEffect.test.ts +2 -2
  375. package/src/operator/snapshotEffect.ts +14 -18
  376. package/src/operator/startWith.ts +1 -1
  377. package/src/operator/startWithEffect.ts +1 -1
  378. package/src/operator/struct.test.ts +2 -2
  379. package/src/operator/struct.ts +1 -1
  380. package/src/operator/switchMap.test.ts +2 -2
  381. package/src/operator/switchMap.ts +1 -1
  382. package/src/operator/switchMapCause.test.ts +3 -3
  383. package/src/operator/switchMapCause.ts +1 -1
  384. package/src/operator/switchMapEffect.ts +1 -1
  385. package/src/operator/switchMapError.ts +2 -2
  386. package/src/operator/switchMatch.test.ts +2 -2
  387. package/src/operator/switchMatch.ts +3 -3
  388. package/src/operator/takeUntil.test.ts +2 -2
  389. package/src/operator/takeUntil.ts +1 -1
  390. package/src/operator/takeWhile.ts +2 -2
  391. package/src/operator/tap.ts +1 -1
  392. package/src/operator/tapCause.ts +1 -1
  393. package/src/operator/tapDefect.ts +2 -2
  394. package/src/operator/tapError.ts +2 -2
  395. package/src/operator/throttle.test.ts +2 -2
  396. package/src/operator/throttle.ts +1 -1
  397. package/src/operator/uninterruptible.ts +1 -1
  398. package/src/operator/withItems.ts +1 -1
  399. package/src/operator/withPermit.ts +5 -6
  400. package/src/operator/withRuntimeFlags.ts +1 -1
  401. package/src/operator/zip.test.ts +2 -2
  402. package/src/operator/zip.ts +1 -1
  403. package/src/operator/zipItems.test.ts +2 -2
  404. package/src/run/collectAll.ts +1 -1
  405. package/src/run/collectN.ts +1 -1
  406. package/src/run/drain.ts +3 -1
  407. package/src/run/observe.ts +1 -1
  408. package/src/run/reduce.ts +1 -1
  409. package/src/run/run.ts +3 -3
  410. package/src/run/unsafe.ts +9 -10
  411. package/src/typeclass/Applicative.ts +2 -2
  412. package/src/typeclass/Bicovariant.ts +1 -1
  413. package/src/typeclass/Product.ts +2 -1
  414. package/src/typeclass/SemiCoproduct.ts +4 -4
  415. package/src/typeclass/SemiProduct.ts +5 -2
  416. package/tsconfig.build.tsbuildinfo +1 -1
  417. package/dist/operator/provideEnvironment.d.ts +0 -4
  418. package/dist/operator/provideEnvironment.d.ts.map +0 -1
  419. package/dist/operator/provideEnvironment.js +0 -18
  420. package/dist/operator/provideEnvironment.js.map +0 -1
  421. package/dist/operator/provideSomeEnvironment.d.ts +0 -4
  422. package/dist/operator/provideSomeEnvironment.d.ts.map +0 -1
  423. package/dist/operator/provideSomeEnvironment.js +0 -18
  424. package/dist/operator/provideSomeEnvironment.js.map +0 -1
  425. package/src/operator/during.test.ts +0 -49
  426. package/src/operator/provideSomeEnvironment.ts +0 -29
  427. package/src/operator/since.test.ts +0 -48
  428. package/src/operator/until.test.ts +0 -48
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
- import { pipe } from '@fp-ts/data/Function'
4
+ import { pipe } from '@fp-ts/core/Function'
5
5
  import { describe, it } from 'vitest'
6
6
 
7
7
  import { fromArray } from '../constructor/fromArray.js'
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
17
17
  loop(0, (acc, n) => [(acc + n).toString(), acc + n]),
18
18
  collectAll,
19
19
  )
20
- const events = await Effect.unsafeRunPromise(test)
20
+ const events = await Effect.runPromise(test)
21
21
 
22
22
  deepStrictEqual(events, ['1', '3', '6'])
23
23
  })
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
- import { pipe } from '@fp-ts/data/Function'
4
+ import { pipe } from '@fp-ts/core/Function'
5
5
  import { describe, it } from 'vitest'
6
6
 
7
7
  import { fromArray } from '../constructor/fromArray.js'
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
17
17
  map((x) => x + 1),
18
18
  collectAll,
19
19
  )
20
- const events = await Effect.unsafeRunPromise(test)
20
+ const events = await Effect.runPromise(test)
21
21
 
22
22
  deepStrictEqual(events, [2, 3, 4])
23
23
  })
@@ -3,8 +3,8 @@ import { deepStrictEqual, ok } from 'assert'
3
3
  import * as Cause from '@effect/io/Cause'
4
4
  import * as Effect from '@effect/io/Effect'
5
5
  import * as Exit from '@effect/io/Exit'
6
- import { pipe } from '@fp-ts/data/Function'
7
- import * as Option from '@fp-ts/data/Option'
6
+ import { pipe } from '@fp-ts/core/Function'
7
+ import * as Option from '@fp-ts/core/Option'
8
8
  import { describe, it } from 'vitest'
9
9
 
10
10
  import { fail } from '../constructor/fail.js'
@@ -16,7 +16,7 @@ describe(import.meta.url, () => {
16
16
  describe(mapCause.name, () => {
17
17
  it('transforms an Fx error', async () => {
18
18
  const test = pipe(fail(1), mapCause(Cause.map((x) => x + 1)), collectAll)
19
- const exit = await Effect.unsafeRunPromiseExit(test)
19
+ const exit = await Effect.runPromiseExit(test)
20
20
 
21
21
  ok(Exit.isFailure(exit))
22
22
 
@@ -1,5 +1,5 @@
1
1
  import type { Cause } from '@effect/io/Cause'
2
- import { flow } from '@fp-ts/data/Function'
2
+ import { flow } from '@fp-ts/core/Function'
3
3
 
4
4
  import { Fx } from '../Fx.js'
5
5
 
@@ -1,8 +1,8 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
+ import { pipe } from '@fp-ts/core/Function'
4
5
  import { millis } from '@fp-ts/data/Duration'
5
- import { pipe } from '@fp-ts/data/Function'
6
6
  import { describe, it } from 'vitest'
7
7
 
8
8
  import { at } from '../constructor/at.js'
@@ -23,7 +23,7 @@ describe(import.meta.url, () => {
23
23
  ),
24
24
  collectAll,
25
25
  )
26
- const events = await Effect.unsafeRunPromise(test)
26
+ const events = await Effect.runPromise(test)
27
27
 
28
28
  deepStrictEqual(events, [1, 3, 4, 2, 5])
29
29
  })
@@ -1,5 +1,5 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
- import { pipe } from '@fp-ts/data/Function'
2
+ import { pipe } from '@fp-ts/core/Function'
3
3
 
4
4
  import { Fx } from '../Fx.js'
5
5
  import { withRefCounter } from '../_internal/RefCounter.js'
@@ -1,8 +1,8 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
+ import { pipe } from '@fp-ts/core/Function'
4
5
  import { millis } from '@fp-ts/data/Duration'
5
- import { pipe } from '@fp-ts/data/Function'
6
6
  import { describe, it } from 'vitest'
7
7
 
8
8
  import { at } from '../constructor/at.js'
@@ -14,14 +14,14 @@ describe(import.meta.url, () => {
14
14
  describe(mergeRace.name, () => {
15
15
  it('interrupts the second Fx when the first emits', async () => {
16
16
  const test = pipe(at(millis(0), 1), mergeRace(at(millis(200), 2)), collectAll)
17
- const events = await Effect.unsafeRunPromise(test)
17
+ const events = await Effect.runPromise(test)
18
18
 
19
19
  deepStrictEqual(events, [1])
20
20
  })
21
21
 
22
22
  it('emits both streams when second emits first', async () => {
23
23
  const test = pipe(at(millis(200), 1), mergeRace(at(millis(0), 2)), collectAll)
24
- const events = await Effect.unsafeRunPromise(test)
24
+ const events = await Effect.runPromise(test)
25
25
 
26
26
  deepStrictEqual(events, [2, 1])
27
27
  })
@@ -1,7 +1,7 @@
1
1
  import * as Cause from '@effect/io/Cause'
2
2
  import * as Effect from '@effect/io/Effect'
3
3
  import * as Fiber from '@effect/io/Fiber'
4
- import { pipe } from '@fp-ts/data/Function'
4
+ import { pipe } from '@fp-ts/core/Function'
5
5
 
6
6
  import { Fx } from '../Fx.js'
7
7
 
@@ -2,8 +2,8 @@ import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
4
  import * as Fiber from '@effect/io/Fiber'
5
+ import { pipe } from '@fp-ts/core/Function'
5
6
  import { millis } from '@fp-ts/data/Duration'
6
- import { pipe } from '@fp-ts/data/Function'
7
7
  import { describe, it } from 'vitest'
8
8
 
9
9
  import { fromIterable } from '../constructor/fromIterable.js'
@@ -63,7 +63,7 @@ describe(import.meta.url, () => {
63
63
  deepStrictEqual(started, 1)
64
64
  })
65
65
 
66
- await Effect.unsafeRunPromise(test)
66
+ await Effect.runPromise(test)
67
67
  })
68
68
  })
69
69
  })
@@ -4,8 +4,8 @@ import * as Effect from '@effect/io/Effect'
4
4
  import * as Fiber from '@effect/io/Fiber'
5
5
  import type { RuntimeFiber } from '@effect/io/Fiber'
6
6
  import type { Scope } from '@effect/io/Scope'
7
+ import { pipe } from '@fp-ts/core/Function'
7
8
  import type { Context } from '@fp-ts/data/Context'
8
- import { pipe } from '@fp-ts/data/Function'
9
9
 
10
10
  import { Fx } from '../Fx.js'
11
11
  import { asap } from '../_internal/RefCounter.js'
@@ -35,7 +35,7 @@ export class MulticastFx<R, E, A>
35
35
 
36
36
  return Effect.gen(function* ($) {
37
37
  const deferred = yield* $(Deferred.make<never, void>())
38
- const context = yield* $(Effect.environment<R | R2>())
38
+ const context = yield* $(Effect.context<R | R2>())
39
39
  const observer: MulticastObserver<R2, E, A> = {
40
40
  sink,
41
41
  context,
@@ -56,18 +56,14 @@ export class MulticastFx<R, E, A>
56
56
 
57
57
  event(a: A) {
58
58
  return Effect.suspendSucceed(() =>
59
- pipe(
60
- this.observers.slice(),
61
- Effect.forEachDiscard((observer) => this.runEvent(a, observer)),
62
- ),
59
+ Effect.forEachDiscard(this.observers.slice(), (observer) => this.runEvent(a, observer)),
63
60
  )
64
61
  }
65
62
 
66
63
  error(cause: Cause<E>) {
67
64
  return Effect.suspendSucceed(() =>
68
65
  pipe(
69
- this.observers.slice(),
70
- Effect.forEachDiscard((observer) => this.runError(cause, observer)),
66
+ Effect.forEachDiscard(this.observers.slice(), (observer) => this.runError(cause, observer)),
71
67
  Effect.tap(() => this.cleanup()),
72
68
  ),
73
69
  )
@@ -84,13 +80,13 @@ export class MulticastFx<R, E, A>
84
80
  }
85
81
 
86
82
  protected runEvent(a: A, observer: MulticastObserver<any, E, A>) {
87
- return pipe(observer.sink.event(a), Effect.provideEnvironment(observer.context))
83
+ return pipe(observer.sink.event(a), Effect.provideContext(observer.context))
88
84
  }
89
85
 
90
86
  protected runError(cause: Cause<E>, observer: MulticastObserver<any, E, A>) {
91
87
  return pipe(
92
88
  observer.sink.error(cause),
93
- Effect.provideEnvironment(observer.context),
89
+ Effect.provideContext(observer.context),
94
90
  Effect.tap(() => Effect.sync(() => this.removeObserver(observer))),
95
91
  Effect.intoDeferred(observer.deferred),
96
92
  )
@@ -99,7 +95,7 @@ export class MulticastFx<R, E, A>
99
95
  protected runEnd(observer: MulticastObserver<any, E, A>) {
100
96
  return pipe(
101
97
  observer.sink.end,
102
- Effect.provideEnvironment(observer.context),
98
+ Effect.provideContext(observer.context),
103
99
  Effect.tap(() => Effect.sync(() => this.removeObserver(observer))),
104
100
  Effect.intoDeferred(observer.deferred),
105
101
  )
@@ -1,7 +1,7 @@
1
1
  import * as Cause from '@effect/io/Cause'
2
2
  import * as Effect from '@effect/io/Effect'
3
- import * as Either from '@fp-ts/data/Either'
4
- import { flow, pipe } from '@fp-ts/data/Function'
3
+ import * as Either from '@fp-ts/core/Either'
4
+ import { flow, pipe } from '@fp-ts/core/Function'
5
5
 
6
6
  import type { Fx } from '../Fx.js'
7
7
 
@@ -1,6 +1,6 @@
1
1
  import * as Cause from '@effect/io/Cause'
2
2
  import * as Effect from '@effect/io/Effect'
3
- import { pipe } from '@fp-ts/data/Function'
3
+ import { pipe } from '@fp-ts/core/Function'
4
4
 
5
5
  import { Fx } from '../Fx.js'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type * as Effect from '@effect/io/Effect'
2
2
  import * as Exit from '@effect/io/Exit'
3
- import { pipe } from '@fp-ts/data/Function'
3
+ import { pipe } from '@fp-ts/core/Function'
4
4
 
5
5
  import type { Fx } from '../Fx.js'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
2
  import type { FiberId } from '@effect/io/Fiber/Id'
3
- import { flow, pipe } from '@fp-ts/data/Function'
3
+ import { flow, pipe } from '@fp-ts/core/Function'
4
4
  import type { HashSet } from '@fp-ts/data/HashSet'
5
5
 
6
6
  import { Fx } from '../Fx.js'
@@ -1,15 +1,15 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
2
  import type { Scope } from '@effect/io/Scope'
3
+ import { pipe } from '@fp-ts/core/Function'
3
4
  import * as Context from '@fp-ts/data/Context'
4
- import { pipe } from '@fp-ts/data/Function'
5
5
 
6
6
  import { Fx } from '../Fx.js'
7
7
 
8
- export function provideEnvironment<R>(context: Context.Context<R>) {
9
- return <E, A>(self: Fx<R, E, A>): Fx<never, E, A> => new ProvideEnvironmentFx(self, context)
8
+ export function provideContext<R>(context: Context.Context<R>) {
9
+ return <E, A>(self: Fx<R, E, A>): Fx<never, E, A> => new ProvideContextFx(self, context)
10
10
  }
11
11
 
12
- class ProvideEnvironmentFx<R, E, A> extends Fx.Variance<never, E, A> implements Fx<never, E, A> {
12
+ class ProvideContextFx<R, E, A> extends Fx.Variance<never, E, A> implements Fx<never, E, A> {
13
13
  constructor(readonly self: Fx<R, E, A>, readonly context: Context.Context<R>) {
14
14
  super()
15
15
  }
@@ -17,7 +17,7 @@ class ProvideEnvironmentFx<R, E, A> extends Fx.Variance<never, E, A> implements
17
17
  run<R2>(sink: Fx.Sink<R2, E, A>) {
18
18
  return pipe(
19
19
  this.self.run(sink),
20
- Effect.provideSomeEnvironment<R2 | Scope, R | R2 | Scope>(Context.merge(this.context)),
20
+ Effect.contramapContext<R2 | Scope, R | R2 | Scope>(Context.merge(this.context)),
21
21
  )
22
22
  }
23
23
  }
@@ -1,5 +1,5 @@
1
1
  import type { Layer } from '@effect/io/Layer'
2
- import { pipe } from '@fp-ts/data/Function'
2
+ import { pipe } from '@fp-ts/core/Function'
3
3
 
4
4
  import type { Fx } from '../Fx.js'
5
5
 
@@ -1,8 +1,8 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
+ import { pipe } from '@fp-ts/core/Function'
4
5
  import { Tag } from '@fp-ts/data/Context'
5
- import { pipe } from '@fp-ts/data/Function'
6
6
  import { describe, it } from 'vitest'
7
7
 
8
8
  import { serviceWith } from '../constructor/serviceWith.js'
@@ -30,7 +30,7 @@ describe(import.meta.url, () => {
30
30
  Foo.provide(42),
31
31
  collectAll,
32
32
  )
33
- const events = await Effect.unsafeRunPromise(test)
33
+ const events = await Effect.runPromise(test)
34
34
 
35
35
  deepStrictEqual(events, [42])
36
36
  })
@@ -1,6 +1,6 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
+ import { pipe } from '@fp-ts/core/Function'
2
3
  import type * as Context from '@fp-ts/data/Context'
3
- import { pipe } from '@fp-ts/data/Function'
4
4
 
5
5
  import { Fx } from '../Fx.js'
6
6
 
@@ -20,6 +20,6 @@ class ProvideServiceFx<R, E, A, S>
20
20
  }
21
21
 
22
22
  run<R2>(sink: Fx.Sink<R2, E, A>) {
23
- return pipe(this.self.run(sink), Effect.provideService(this.tag)(this.service))
23
+ return pipe(this.self.run(sink), Effect.provideService(this.tag, this.service))
24
24
  }
25
25
  }
@@ -1,8 +1,8 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
+ import { pipe } from '@fp-ts/core/Function'
4
5
  import { Tag } from '@fp-ts/data/Context'
5
- import { pipe } from '@fp-ts/data/Function'
6
6
  import { describe, it } from 'vitest'
7
7
 
8
8
  import { serviceWith } from '../constructor/serviceWith.js'
@@ -33,7 +33,7 @@ describe(import.meta.url, () => {
33
33
  Foo.provide(42),
34
34
  collectAll,
35
35
  )
36
- const events = await Effect.unsafeRunPromise(test)
36
+ const events = await Effect.runPromise(test)
37
37
 
38
38
  deepStrictEqual(events, [42])
39
39
  })
@@ -1,7 +1,7 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
2
  import type { Scope } from '@effect/io/Scope'
3
+ import { pipe } from '@fp-ts/core/Function'
3
4
  import type * as Context from '@fp-ts/data/Context'
4
- import { pipe } from '@fp-ts/data/Function'
5
5
 
6
6
  import { Fx } from '../Fx.js'
7
7
 
@@ -28,7 +28,7 @@ class ProvideServiceEffectFx<R, E, A, R2, E2, S>
28
28
  run<R3>(sink: Fx.Sink<R3, E | E2, A>) {
29
29
  return pipe(
30
30
  this.self.run(sink),
31
- Effect.provideServiceEffect(this.tag)(this.service),
31
+ Effect.provideServiceEffect(this.tag, this.service),
32
32
  Effect.matchCauseEffect(sink.error, Effect.succeed),
33
33
  ) as Effect.Effect<Exclude<R | R2 | R3 | Scope, S>, never, unknown>
34
34
  }
@@ -1,6 +1,6 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
2
  import type { Layer } from '@effect/io/Layer'
3
- import { pipe } from '@fp-ts/data/Function'
3
+ import { pipe } from '@fp-ts/core/Function'
4
4
 
5
5
  import { Fx } from '../Fx.js'
6
6
 
@@ -1,8 +1,8 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
+ import { pipe } from '@fp-ts/core/Function'
4
5
  import { millis } from '@fp-ts/data/Duration'
5
- import { pipe } from '@fp-ts/data/Function'
6
6
  import { describe, it } from 'vitest'
7
7
 
8
8
  import { at } from '../constructor/at.js'
@@ -22,7 +22,7 @@ describe(import.meta.url, () => {
22
22
  ),
23
23
  collectAll,
24
24
  )
25
- const events = await Effect.unsafeRunPromise(test)
25
+ const events = await Effect.runPromise(test)
26
26
 
27
27
  deepStrictEqual(events, [1, 2])
28
28
  })
@@ -3,8 +3,8 @@ import * as Effect from '@effect/io/Effect'
3
3
  import * as ExecutionStrategy from '@effect/io/ExecutionStrategy'
4
4
  import * as Exit from '@effect/io/Exit'
5
5
  import * as Scope from '@effect/io/Scope'
6
+ import { pipe } from '@fp-ts/core/Function'
6
7
  import type { Chunk } from '@fp-ts/data/Chunk'
7
- import { pipe } from '@fp-ts/data/Function'
8
8
 
9
9
  import { Fx } from '../Fx.js'
10
10
  import { asap } from '../_internal/RefCounter.js'
@@ -44,25 +44,20 @@ class RaceAllFx<Streams extends readonly Fx<any, any, any>[]>
44
44
 
45
45
  return Effect.gen(function* ($) {
46
46
  const fiberId = yield* $(Effect.fiberId())
47
- const closeScope = Effect.forEachDiscard(Scope.close(Exit.failCause(interrupt(fiberId))))
48
47
  const scope = yield* $(Effect.scope())
49
48
 
50
49
  const scopes: Chunk<Scope.CloseableScope> = yield* $(
51
- pipe(
52
- streams,
53
- Effect.forEachWithIndex((s, i) =>
54
- pipe(
55
- scope,
56
- Scope.fork(ExecutionStrategy.sequential),
57
- Effect.flatMap((scope) =>
58
- pipe(
59
- s,
60
- tap(() => cleanupScopes(i)),
61
- run(sink.event, sink.error, sink.end),
62
- Effect.scheduleForked(asap), // Schedule starts so that all Scopes can be returned *before* attempting to cleanup
63
- Effect.as(scope),
64
- Effect.provideService(Scope.Tag)(scope),
65
- ),
50
+ Effect.forEachWithIndex(streams, (s, i) =>
51
+ pipe(
52
+ Scope.fork(scope, ExecutionStrategy.sequential),
53
+ Effect.flatMap((scope) =>
54
+ pipe(
55
+ s,
56
+ tap(() => cleanupScopes(i)),
57
+ run(sink.event, sink.error, sink.end),
58
+ Effect.scheduleForked(asap), // Schedule starts so that all Scopes can be returned *before* attempting to cleanup
59
+ Effect.as(scope),
60
+ Effect.provideService(Scope.Tag, scope),
66
61
  ),
67
62
  ),
68
63
  ),
@@ -75,7 +70,11 @@ class RaceAllFx<Streams extends readonly Fx<any, any, any>[]>
75
70
 
76
71
  currentFibers.splice(i, 1)
77
72
 
78
- return yield* $(closeScope(currentFibers))
73
+ return yield* $(
74
+ Effect.forEachDiscard(currentFibers, (s) =>
75
+ Scope.close(s, Exit.failCause(interrupt(fiberId))),
76
+ ),
77
+ )
79
78
  })
80
79
  }
81
80
  })
@@ -1,4 +1,4 @@
1
- import { identity, pipe } from '@fp-ts/data/Function'
1
+ import { identity, pipe } from '@fp-ts/core/Function'
2
2
 
3
3
  import type { Fx } from '../Fx.js'
4
4
 
@@ -1,5 +1,5 @@
1
1
  import type { Cause } from '@effect/io/Cause'
2
- import { pipe } from '@fp-ts/data/Function'
2
+ import { pipe } from '@fp-ts/core/Function'
3
3
 
4
4
  import type { Fx } from '../Fx.js'
5
5
  import { fail } from '../constructor/fail.js'
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
- import { pipe } from '@fp-ts/data/Function'
4
+ import { pipe } from '@fp-ts/core/Function'
5
5
  import { describe, it } from 'vitest'
6
6
 
7
7
  import { fromArray } from '../constructor/fromArray.js'
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
17
17
  scan(0, (acc, n) => acc + n),
18
18
  collectAll,
19
19
  )
20
- const events = await Effect.unsafeRunPromise(test)
20
+ const events = await Effect.runPromise(test)
21
21
 
22
22
  deepStrictEqual(events, [0, 1, 3, 6])
23
23
  })
@@ -1,4 +1,4 @@
1
- import { pipe } from '@fp-ts/data/Function'
1
+ import { pipe } from '@fp-ts/core/Function'
2
2
 
3
3
  import type { Fx } from '../Fx.js'
4
4
 
@@ -1,8 +1,8 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
+ import { pipe } from '@fp-ts/core/Function'
4
5
  import { millis } from '@fp-ts/data/Duration'
5
- import { pipe } from '@fp-ts/data/Function'
6
6
  import { describe, it } from 'vitest'
7
7
 
8
8
  import { fromArray } from '../constructor/fromArray.js'
@@ -18,7 +18,7 @@ describe(import.meta.url, () => {
18
18
  scanEffect(Effect.succeed(0), (acc, n) => Effect.sync(() => acc + n)),
19
19
  collectAll,
20
20
  )
21
- const events = await Effect.unsafeRunPromise(test)
21
+ const events = await Effect.runPromise(test)
22
22
 
23
23
  deepStrictEqual(events, [0, 1, 3, 6])
24
24
  })
@@ -34,7 +34,7 @@ describe(import.meta.url, () => {
34
34
  ),
35
35
  collectAll,
36
36
  )
37
- const events = await Effect.unsafeRunPromise(test)
37
+ const events = await Effect.runPromise(test)
38
38
 
39
39
  deepStrictEqual(events, [0, 10, 30, 60])
40
40
  })
@@ -1,6 +1,6 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
- import * as TSemaphore from '@effect/stm/TSemaphore'
3
- import { pipe } from '@fp-ts/data/Function'
2
+ import type * as Scope from '@effect/io/Scope'
3
+ import { pipe } from '@fp-ts/core/Function'
4
4
 
5
5
  import { Fx, Sink } from '../Fx.js'
6
6
 
@@ -24,7 +24,9 @@ class ScanEffectFx<R, E, A, R2, E2, B, R3, E3>
24
24
  super()
25
25
  }
26
26
 
27
- run<R4>(sink: Sink<R4, E | E2 | E3, B>) {
27
+ run<R4>(
28
+ sink: Sink<R4, E | E2 | E3, B>,
29
+ ): Effect.Effect<R | R2 | R3 | R4 | Scope.Scope, never, unknown> {
28
30
  return pipe(
29
31
  this.seed,
30
32
  Effect.matchCauseEffect(sink.error, (acc) =>
@@ -37,9 +39,9 @@ class ScanEffectFx<R, E, A, R2, E2, B, R3, E3>
37
39
  }
38
40
  }
39
41
 
40
- class ScanEffectSink<R, E, A, R2, E2, B, R3, E3, R4> implements Fx.Sink<R | R2 | R3 | R4, E, A> {
42
+ class ScanEffectSink<E, A, E2, B, R3, E3, R4> implements Fx.Sink<R3 | R4, E, A> {
41
43
  protected acc: B = this.seed
42
- protected semaphore = TSemaphore.unsafeMake(1)
44
+ protected semaphore = Effect.unsafeMakeSemaphore(1)
43
45
 
44
46
  constructor(
45
47
  readonly sink: Sink<R4, E | E2 | E3, B>,
@@ -47,7 +49,7 @@ class ScanEffectSink<R, E, A, R2, E2, B, R3, E3, R4> implements Fx.Sink<R | R2 |
47
49
  readonly f: (b: B, a: A) => Effect.Effect<R3, E3, B>,
48
50
  ) {}
49
51
 
50
- event = (a: A) => {
52
+ event = (a: A): Effect.Effect<R3 | R4, never, unknown> => {
51
53
  return pipe(
52
54
  this.f(this.acc, a),
53
55
  Effect.matchCauseEffect(this.sink.error, (acc) => {
@@ -55,7 +57,7 @@ class ScanEffectSink<R, E, A, R2, E2, B, R3, E3, R4> implements Fx.Sink<R | R2 |
55
57
 
56
58
  return this.sink.event(acc)
57
59
  }),
58
- TSemaphore.withPermit(this.semaphore),
60
+ this.semaphore.withPermits(1),
59
61
  )
60
62
  }
61
63
 
@@ -2,8 +2,8 @@ import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
4
  import * as Fiber from '@effect/io/Fiber'
5
+ import * as Either from '@fp-ts/core/Either'
5
6
  import { millis } from '@fp-ts/data/Duration'
6
- import * as Either from '@fp-ts/data/Either'
7
7
  import { describe, it } from 'vitest'
8
8
 
9
9
  import { at } from '../constructor/at.js'
@@ -32,7 +32,7 @@ describe(import.meta.url, () => {
32
32
  deepStrictEqual(yield* $(Fiber.join(fiberRights)), [4, 2])
33
33
  })
34
34
 
35
- await Effect.unsafeRunPromise(test)
35
+ await Effect.runPromise(test)
36
36
  })
37
37
  })
38
38
  })
@@ -1,5 +1,5 @@
1
- import * as Either from '@fp-ts/data/Either'
2
- import { pipe } from '@fp-ts/data/Function'
1
+ import * as Either from '@fp-ts/core/Either'
2
+ import { pipe } from '@fp-ts/core/Function'
3
3
 
4
4
  import type { Fx } from '../Fx.js'
5
5
 
@@ -1,5 +1,5 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
- import { pipe } from '@fp-ts/data/Function'
2
+ import { pipe } from '@fp-ts/core/Function'
3
3
 
4
4
  import { Fx } from '../Fx.js'
5
5
  import { withEarlyExit } from '../_internal/earlyExit.js'
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual } from 'assert'
2
2
 
3
3
  import * as Effect from '@effect/io/Effect'
4
- import { pipe } from '@fp-ts/data/Function'
4
+ import { pipe } from '@fp-ts/core/Function'
5
5
  import { describe, it } from 'vitest'
6
6
 
7
7
  import { fromArray } from '../constructor/fromArray.js'
@@ -20,7 +20,7 @@ describe(import.meta.url, () => {
20
20
  skipAfter((x) => x === 4),
21
21
  collectAll,
22
22
  )
23
- const events = await Effect.unsafeRunPromise(test)
23
+ const events = await Effect.runPromise(test)
24
24
 
25
25
  deepStrictEqual(events, [1, 2, 3])
26
26
  deepStrictEqual(count, 8)
@@ -1,5 +1,5 @@
1
1
  import { unit } from '@effect/io/Effect'
2
- import type { Predicate } from '@fp-ts/data/Predicate'
2
+ import type { Predicate } from '@fp-ts/core/Predicate'
3
3
 
4
4
  import { Fx } from '../Fx.js'
5
5