effect 2.3.8 → 2.4.0

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 (272) hide show
  1. package/dist/cjs/BigInt.js +14 -1
  2. package/dist/cjs/BigInt.js.map +1 -1
  3. package/dist/cjs/Effect.js +16 -61
  4. package/dist/cjs/Effect.js.map +1 -1
  5. package/dist/cjs/Either.js +35 -6
  6. package/dist/cjs/Either.js.map +1 -1
  7. package/dist/cjs/Equal.js +1 -1
  8. package/dist/cjs/Equal.js.map +1 -1
  9. package/dist/cjs/Exit.js +1 -1
  10. package/dist/cjs/Number.js +25 -1
  11. package/dist/cjs/Number.js.map +1 -1
  12. package/dist/cjs/ReadonlyArray.js +2 -2
  13. package/dist/cjs/ReadonlyArray.js.map +1 -1
  14. package/dist/cjs/ReadonlyRecord.js +71 -76
  15. package/dist/cjs/ReadonlyRecord.js.map +1 -1
  16. package/dist/cjs/STM.js.map +1 -1
  17. package/dist/cjs/Schedule.js.map +1 -1
  18. package/dist/cjs/Sink.js.map +1 -1
  19. package/dist/cjs/Stream.js +3 -23
  20. package/dist/cjs/Stream.js.map +1 -1
  21. package/dist/cjs/Struct.js +3 -1
  22. package/dist/cjs/Struct.js.map +1 -1
  23. package/dist/cjs/TestAnnotation.js.map +1 -1
  24. package/dist/cjs/internal/channel/channelExecutor.js +5 -5
  25. package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
  26. package/dist/cjs/internal/channel/channelState.js +5 -5
  27. package/dist/cjs/internal/channel/channelState.js.map +1 -1
  28. package/dist/cjs/internal/channel.js.map +1 -1
  29. package/dist/cjs/internal/clock.js +3 -4
  30. package/dist/cjs/internal/clock.js.map +1 -1
  31. package/dist/cjs/internal/core-effect.js +6 -23
  32. package/dist/cjs/internal/core-effect.js.map +1 -1
  33. package/dist/cjs/internal/core.js +11 -27
  34. package/dist/cjs/internal/core.js.map +1 -1
  35. package/dist/cjs/internal/effect/circular.js +4 -5
  36. package/dist/cjs/internal/effect/circular.js.map +1 -1
  37. package/dist/cjs/internal/either.js +3 -3
  38. package/dist/cjs/internal/either.js.map +1 -1
  39. package/dist/cjs/internal/groupBy.js.map +1 -1
  40. package/dist/cjs/internal/layer.js +0 -2
  41. package/dist/cjs/internal/layer.js.map +1 -1
  42. package/dist/cjs/internal/runtime.js +12 -1
  43. package/dist/cjs/internal/runtime.js.map +1 -1
  44. package/dist/cjs/internal/schedule.js +4 -4
  45. package/dist/cjs/internal/schedule.js.map +1 -1
  46. package/dist/cjs/internal/sink.js +0 -2
  47. package/dist/cjs/internal/sink.js.map +1 -1
  48. package/dist/cjs/internal/stm/stm.js +1 -0
  49. package/dist/cjs/internal/stm/stm.js.map +1 -1
  50. package/dist/cjs/internal/stream.js +51 -64
  51. package/dist/cjs/internal/stream.js.map +1 -1
  52. package/dist/cjs/internal/version.js +1 -1
  53. package/dist/dts/BigInt.d.ts +7 -0
  54. package/dist/dts/BigInt.d.ts.map +1 -1
  55. package/dist/dts/Brand.d.ts +1 -1
  56. package/dist/dts/Brand.d.ts.map +1 -1
  57. package/dist/dts/Cause.d.ts +1 -1
  58. package/dist/dts/Cause.d.ts.map +1 -1
  59. package/dist/dts/Channel.d.ts +11 -11
  60. package/dist/dts/Channel.d.ts.map +1 -1
  61. package/dist/dts/Chunk.d.ts +3 -3
  62. package/dist/dts/Config.d.ts +4 -4
  63. package/dist/dts/Config.d.ts.map +1 -1
  64. package/dist/dts/Cron.d.ts +1 -1
  65. package/dist/dts/Cron.d.ts.map +1 -1
  66. package/dist/dts/Differ.d.ts +2 -2
  67. package/dist/dts/Differ.d.ts.map +1 -1
  68. package/dist/dts/Effect.d.ts +52 -108
  69. package/dist/dts/Effect.d.ts.map +1 -1
  70. package/dist/dts/Either.d.ts +126 -83
  71. package/dist/dts/Either.d.ts.map +1 -1
  72. package/dist/dts/Encoding.d.ts +6 -6
  73. package/dist/dts/Encoding.d.ts.map +1 -1
  74. package/dist/dts/Equal.d.ts.map +1 -1
  75. package/dist/dts/Exit.d.ts +2 -2
  76. package/dist/dts/Fiber.d.ts +2 -2
  77. package/dist/dts/Fiber.d.ts.map +1 -1
  78. package/dist/dts/GroupBy.d.ts +12 -12
  79. package/dist/dts/GroupBy.d.ts.map +1 -1
  80. package/dist/dts/Layer.d.ts +26 -26
  81. package/dist/dts/Layer.d.ts.map +1 -1
  82. package/dist/dts/List.d.ts +2 -2
  83. package/dist/dts/Logger.d.ts +4 -4
  84. package/dist/dts/Match.d.ts +2 -2
  85. package/dist/dts/Match.d.ts.map +1 -1
  86. package/dist/dts/MergeDecision.d.ts +1 -1
  87. package/dist/dts/MergeState.d.ts +5 -5
  88. package/dist/dts/MergeState.d.ts.map +1 -1
  89. package/dist/dts/Metric.d.ts +13 -13
  90. package/dist/dts/Metric.d.ts.map +1 -1
  91. package/dist/dts/MetricPolling.d.ts +4 -4
  92. package/dist/dts/MetricPolling.d.ts.map +1 -1
  93. package/dist/dts/Number.d.ts +8 -0
  94. package/dist/dts/Number.d.ts.map +1 -1
  95. package/dist/dts/Option.d.ts +11 -11
  96. package/dist/dts/ReadonlyArray.d.ts +9 -8
  97. package/dist/dts/ReadonlyArray.d.ts.map +1 -1
  98. package/dist/dts/ReadonlyRecord.d.ts +111 -94
  99. package/dist/dts/ReadonlyRecord.d.ts.map +1 -1
  100. package/dist/dts/Reloadable.d.ts +4 -4
  101. package/dist/dts/Reloadable.d.ts.map +1 -1
  102. package/dist/dts/RequestResolver.d.ts +13 -13
  103. package/dist/dts/RequestResolver.d.ts.map +1 -1
  104. package/dist/dts/Resource.d.ts +1 -1
  105. package/dist/dts/Resource.d.ts.map +1 -1
  106. package/dist/dts/STM.d.ts +144 -139
  107. package/dist/dts/STM.d.ts.map +1 -1
  108. package/dist/dts/Schedule.d.ts +171 -179
  109. package/dist/dts/Schedule.d.ts.map +1 -1
  110. package/dist/dts/SingleProducerAsyncInput.d.ts +1 -1
  111. package/dist/dts/SingleProducerAsyncInput.d.ts.map +1 -1
  112. package/dist/dts/Sink.d.ts +13 -13
  113. package/dist/dts/Sink.d.ts.map +1 -1
  114. package/dist/dts/Stream.d.ts +355 -366
  115. package/dist/dts/Stream.d.ts.map +1 -1
  116. package/dist/dts/Struct.d.ts +3 -3
  117. package/dist/dts/Struct.d.ts.map +1 -1
  118. package/dist/dts/SubscriptionRef.d.ts +2 -2
  119. package/dist/dts/TArray.d.ts +2 -2
  120. package/dist/dts/TDeferred.d.ts +3 -3
  121. package/dist/dts/TMap.d.ts +10 -10
  122. package/dist/dts/TSet.d.ts +4 -4
  123. package/dist/dts/Take.d.ts +2 -2
  124. package/dist/dts/TestAnnotation.d.ts +2 -2
  125. package/dist/dts/TestAnnotation.d.ts.map +1 -1
  126. package/dist/dts/Types.d.ts +7 -0
  127. package/dist/dts/Types.d.ts.map +1 -1
  128. package/dist/dts/internal/stm/stm.d.ts +2 -15
  129. package/dist/dts/internal/stm/stm.d.ts.map +1 -1
  130. package/dist/esm/BigInt.js +12 -0
  131. package/dist/esm/BigInt.js.map +1 -1
  132. package/dist/esm/Effect.js +13 -58
  133. package/dist/esm/Effect.js.map +1 -1
  134. package/dist/esm/Either.js +42 -5
  135. package/dist/esm/Either.js.map +1 -1
  136. package/dist/esm/Equal.js +1 -1
  137. package/dist/esm/Equal.js.map +1 -1
  138. package/dist/esm/Exit.js +1 -1
  139. package/dist/esm/Number.js +23 -0
  140. package/dist/esm/Number.js.map +1 -1
  141. package/dist/esm/ReadonlyArray.js +2 -2
  142. package/dist/esm/ReadonlyArray.js.map +1 -1
  143. package/dist/esm/ReadonlyRecord.js +70 -75
  144. package/dist/esm/ReadonlyRecord.js.map +1 -1
  145. package/dist/esm/STM.js.map +1 -1
  146. package/dist/esm/Schedule.js.map +1 -1
  147. package/dist/esm/Sink.js.map +1 -1
  148. package/dist/esm/Stream.js +5 -22
  149. package/dist/esm/Stream.js.map +1 -1
  150. package/dist/esm/Struct.js +3 -1
  151. package/dist/esm/Struct.js.map +1 -1
  152. package/dist/esm/TestAnnotation.js.map +1 -1
  153. package/dist/esm/internal/channel/channelExecutor.js +5 -5
  154. package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
  155. package/dist/esm/internal/channel/channelState.js +3 -3
  156. package/dist/esm/internal/channel/channelState.js.map +1 -1
  157. package/dist/esm/internal/channel.js.map +1 -1
  158. package/dist/esm/internal/clock.js +3 -4
  159. package/dist/esm/internal/clock.js.map +1 -1
  160. package/dist/esm/internal/core-effect.js +4 -20
  161. package/dist/esm/internal/core-effect.js.map +1 -1
  162. package/dist/esm/internal/core.js +8 -22
  163. package/dist/esm/internal/core.js.map +1 -1
  164. package/dist/esm/internal/effect/circular.js +4 -5
  165. package/dist/esm/internal/effect/circular.js.map +1 -1
  166. package/dist/esm/internal/either.js +3 -3
  167. package/dist/esm/internal/either.js.map +1 -1
  168. package/dist/esm/internal/groupBy.js.map +1 -1
  169. package/dist/esm/internal/layer.js +0 -2
  170. package/dist/esm/internal/layer.js.map +1 -1
  171. package/dist/esm/internal/runtime.js +12 -1
  172. package/dist/esm/internal/runtime.js.map +1 -1
  173. package/dist/esm/internal/schedule.js +4 -4
  174. package/dist/esm/internal/schedule.js.map +1 -1
  175. package/dist/esm/internal/sink.js +0 -2
  176. package/dist/esm/internal/sink.js.map +1 -1
  177. package/dist/esm/internal/stm/stm.js +1 -0
  178. package/dist/esm/internal/stm/stm.js.map +1 -1
  179. package/dist/esm/internal/stream.js +49 -59
  180. package/dist/esm/internal/stream.js.map +1 -1
  181. package/dist/esm/internal/version.js +1 -1
  182. package/package.json +1 -1
  183. package/src/BigInt.ts +13 -0
  184. package/src/Brand.ts +4 -4
  185. package/src/Cause.ts +1 -1
  186. package/src/Channel.ts +17 -17
  187. package/src/Chunk.ts +4 -4
  188. package/src/Config.ts +4 -4
  189. package/src/Cron.ts +2 -2
  190. package/src/Differ.ts +2 -2
  191. package/src/Effect.ts +68 -145
  192. package/src/Either.ts +215 -133
  193. package/src/Encoding.ts +3 -3
  194. package/src/Equal.ts +1 -1
  195. package/src/Exit.ts +2 -2
  196. package/src/Fiber.ts +2 -2
  197. package/src/GroupBy.ts +16 -16
  198. package/src/Layer.ts +32 -32
  199. package/src/List.ts +3 -3
  200. package/src/Logger.ts +4 -4
  201. package/src/Match.ts +3 -3
  202. package/src/MergeDecision.ts +1 -1
  203. package/src/MergeState.ts +8 -8
  204. package/src/Metric.ts +13 -13
  205. package/src/MetricPolling.ts +9 -9
  206. package/src/Number.ts +26 -0
  207. package/src/Option.ts +17 -17
  208. package/src/ReadonlyArray.ts +23 -15
  209. package/src/ReadonlyRecord.ts +421 -265
  210. package/src/Reloadable.ts +4 -4
  211. package/src/RequestResolver.ts +19 -19
  212. package/src/Resource.ts +3 -3
  213. package/src/STM.ts +166 -213
  214. package/src/Schedule.ts +331 -361
  215. package/src/SingleProducerAsyncInput.ts +1 -1
  216. package/src/Sink.ts +19 -19
  217. package/src/Stream.ts +449 -456
  218. package/src/Struct.ts +8 -5
  219. package/src/SubscriptionRef.ts +2 -2
  220. package/src/TArray.ts +2 -2
  221. package/src/TDeferred.ts +4 -4
  222. package/src/TMap.ts +10 -10
  223. package/src/TSet.ts +4 -4
  224. package/src/Take.ts +4 -4
  225. package/src/TestAnnotation.ts +5 -8
  226. package/src/Types.ts +11 -0
  227. package/src/internal/blockedRequests.ts +2 -2
  228. package/src/internal/cause.ts +2 -2
  229. package/src/internal/channel/channelExecutor.ts +26 -26
  230. package/src/internal/channel/channelState.ts +13 -13
  231. package/src/internal/channel/mergeDecision.ts +1 -1
  232. package/src/internal/channel/mergeState.ts +6 -6
  233. package/src/internal/channel/singleProducerAsyncInput.ts +5 -5
  234. package/src/internal/channel.ts +43 -43
  235. package/src/internal/clock.ts +3 -4
  236. package/src/internal/config.ts +7 -7
  237. package/src/internal/configError.ts +1 -1
  238. package/src/internal/configProvider/pathPatch.ts +2 -2
  239. package/src/internal/configProvider.ts +1 -1
  240. package/src/internal/core-effect.ts +28 -43
  241. package/src/internal/core.ts +15 -40
  242. package/src/internal/dataSource.ts +26 -26
  243. package/src/internal/differ/orPatch.ts +7 -7
  244. package/src/internal/differ.ts +2 -2
  245. package/src/internal/effect/circular.ts +9 -10
  246. package/src/internal/either.ts +25 -22
  247. package/src/internal/encoding/base64.ts +1 -1
  248. package/src/internal/encoding/base64Url.ts +1 -1
  249. package/src/internal/encoding/hex.ts +1 -1
  250. package/src/internal/fiber.ts +2 -2
  251. package/src/internal/fiberRuntime.ts +9 -9
  252. package/src/internal/groupBy.ts +40 -40
  253. package/src/internal/layer/circular.ts +4 -4
  254. package/src/internal/layer.ts +52 -54
  255. package/src/internal/matcher.ts +5 -5
  256. package/src/internal/metric/polling.ts +8 -8
  257. package/src/internal/metric.ts +6 -6
  258. package/src/internal/reloadable.ts +4 -4
  259. package/src/internal/resource.ts +2 -2
  260. package/src/internal/runtime.ts +32 -19
  261. package/src/internal/schedule.ts +430 -500
  262. package/src/internal/sink.ts +27 -29
  263. package/src/internal/stm/core.ts +23 -23
  264. package/src/internal/stm/stm.ts +158 -157
  265. package/src/internal/stm/tArray.ts +3 -3
  266. package/src/internal/stm/tDeferred.ts +5 -5
  267. package/src/internal/stm/tMap.ts +13 -13
  268. package/src/internal/stm/tSet.ts +4 -4
  269. package/src/internal/stream.ts +688 -723
  270. package/src/internal/subscriptionRef.ts +3 -3
  271. package/src/internal/take.ts +6 -6
  272. package/src/internal/version.ts +1 -1
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.fromEffectOption = exports.fromEffect = exports.fromChunks = exports.fromChunkQueue = exports.fromChunkPubSub = exports.fromChunk = exports.fromChannel = exports.fromAsyncIterable = exports.forever = exports.flattenTake = exports.flattenIterables = exports.flattenExitOption = exports.flattenEffect = exports.flattenChunks = exports.flatten = exports.flatMap = exports.findEffect = exports.find = exports.finalizer = exports.filterMapWhileEffect = exports.filterMapWhile = exports.filterMapEffect = exports.filterMap = exports.filterEffect = exports.filter = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.execute = exports.ensuringWith = exports.ensuring = exports.encodeText = exports.empty = exports.either = exports.dropWhileEffect = exports.dropWhile = exports.dropUntilEffect = exports.dropUntil = exports.dropRight = exports.drop = exports.drainFork = exports.drain = exports.distributedWithDynamicCallback = exports.distributedWithDynamic = exports.distributedWith = exports.dieSync = exports.dieMessage = exports.die = exports.decodeText = exports.debounce = exports.crossWith = exports.crossRight = exports.crossLeft = exports.cross = exports.contextWithStream = exports.contextWithEffect = exports.contextWith = exports.context = exports.concatAll = exports.concat = exports.combineChunks = exports.combine = exports.chunksWith = exports.chunks = exports.channelToStream = exports.changesWithEffect = exports.changesWith = exports.changes = exports.catchTags = exports.catchTag = exports.catchSomeCause = exports.catchSome = exports.catchAllCause = exports.catchAll = exports.bufferChunks = exports.buffer = exports.broadcastedQueuesDynamic = exports.broadcastedQueues = exports.broadcastDynamic = exports.broadcast = exports.branchAfter = exports.bindTo = exports.bind = exports.asyncScoped = exports.asyncOption = exports.asyncInterrupt = exports.asyncEffect = exports.as = exports.aggregateWithinEither = exports.aggregateWithin = exports.aggregate = exports.acquireRelease = exports.accumulateChunks = exports.accumulate = exports._async = exports.StreamTypeId = exports.StreamImpl = exports.Do = exports.DefaultChunkSize = void 0;
7
- exports.runDrain = exports.runCount = exports.runCollect = exports.run = exports.retry = exports.repeatWithSchedule = exports.repeatWith = exports.repeatValue = exports.repeatElementsWith = exports.repeatElements = exports.repeatEither = exports.repeatEffectWithSchedule = exports.repeatEffectOption = exports.repeatEffectChunkOption = exports.repeatEffectChunk = exports.repeatEffect = exports.repeat = exports.refineOrDieWith = exports.refineOrDie = exports.rechunk = exports.range = exports.provideSomeLayer = exports.provideServiceStream = exports.provideServiceEffect = exports.provideService = exports.provideLayer = exports.provideContext = exports.prepend = exports.pipeThroughChannelOrFail = exports.pipeThroughChannel = exports.pipeThrough = exports.peel = exports.partitionEither = exports.partition = exports.paginateEffect = exports.paginateChunkEffect = exports.paginateChunk = exports.paginate = exports.orElseSucceed = exports.orElseIfEmptyStream = exports.orElseIfEmptyChunk = exports.orElseIfEmpty = exports.orElseFail = exports.orElseEither = exports.orElse = exports.orDieWith = exports.orDie = exports.onError = exports.onDone = exports.never = exports.mkString = exports.mergeWith = exports.mergeRight = exports.mergeLeft = exports.mergeEither = exports.mergeAll = exports.merge = exports.matchConcurrency = exports.mapInputContext = exports.mapErrorCause = exports.mapError = exports.mapEffectSequential = exports.mapEffectPar = exports.mapConcatEffect = exports.mapConcatChunkEffect = exports.mapConcatChunk = exports.mapConcat = exports.mapChunksEffect = exports.mapChunks = exports.mapBoth = exports.mapAccumEffect = exports.mapAccum = exports.map = exports.make = exports.let_ = exports.iterate = exports.isStream = exports.intersperseAffixes = exports.intersperse = exports.interruptWhenDeferred = exports.interruptWhen = exports.interruptAfter = exports.interleaveWith = exports.interleave = exports.identityStream = exports.haltWhenDeferred = exports.haltWhen = exports.haltAfter = exports.groupedWithin = exports.grouped = exports.groupAdjacentBy = exports.fromSchedule = exports.fromReadableStreamByob = exports.fromReadableStream = exports.fromQueue = exports.fromPull = exports.fromPubSub = exports.fromIteratorSucceed = exports.fromIterableEffect = exports.fromIterable = void 0;
8
- exports.zipWithPreviousAndNext = exports.zipWithPrevious = exports.zipWithNext = exports.zipWithIndex = exports.zipWithChunks = exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipLatestWith = exports.zipLatest = exports.zipFlatten = exports.zipAllWith = exports.zipAllSortedByKeyWith = exports.zipAllSortedByKeyRight = exports.zipAllSortedByKeyLeft = exports.zipAllSortedByKey = exports.zipAllRight = exports.zipAllLeft = exports.zipAll = exports.zip = exports.withSpan = exports.whenEffect = exports.whenCaseEffect = exports.whenCase = exports.when = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unit = exports.unfoldEffect = exports.unfoldChunkEffect = exports.unfoldChunk = exports.unfold = exports.transduce = exports.toReadableStream = exports.toQueueOfElements = exports.toQueue = exports.toPull = exports.toPubSub = exports.toChannel = exports.timeoutTo = exports.timeoutFailCause = exports.timeoutFail = exports.timeout = exports.tick = exports.throttleEffect = exports.throttle = exports.tapSink = exports.tapErrorCause = exports.tapError = exports.tapBoth = exports.tap = exports.takeWhile = exports.takeUntilEffect = exports.takeUntil = exports.takeRight = exports.take = exports.sync = exports.suspend = exports.succeed = exports.splitOnChunk = exports.splitLines = exports.split = exports.someOrFail = exports.someOrElse = exports.some = exports.slidingSize = exports.sliding = exports.scoped = exports.scheduleWith = exports.schedule = exports.scanReduceEffect = exports.scanReduce = exports.scanEffect = exports.scan = exports.runSum = exports.runScoped = exports.runLast = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoQueue = exports.runIntoPubSubScoped = exports.runIntoPubSub = exports.runHead = exports.runForEachWhileScoped = exports.runForEachWhile = exports.runForEachScoped = exports.runForEachChunkScoped = exports.runForEachChunk = exports.runForEach = exports.runFoldWhileScopedEffect = exports.runFoldWhileScoped = exports.runFoldWhileEffect = exports.runFoldWhile = exports.runFoldScopedEffect = exports.runFoldScoped = exports.runFoldEffect = exports.runFold = void 0;
6
+ exports.fromIterableEffect = exports.fromIterable = exports.fromEffectOption = exports.fromEffect = exports.fromChunks = exports.fromChunkQueue = exports.fromChunkPubSub = exports.fromChunk = exports.fromChannel = exports.fromAsyncIterable = exports.forever = exports.flattenTake = exports.flattenIterables = exports.flattenExitOption = exports.flattenEffect = exports.flattenChunks = exports.flatten = exports.flatMap = exports.findEffect = exports.find = exports.finalizer = exports.filterMapWhileEffect = exports.filterMapWhile = exports.filterMapEffect = exports.filterMap = exports.filterEffect = exports.filter = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.execute = exports.ensuringWith = exports.ensuring = exports.encodeText = exports.empty = exports.either = exports.dropWhileEffect = exports.dropWhile = exports.dropUntilEffect = exports.dropUntil = exports.dropRight = exports.drop = exports.drainFork = exports.drain = exports.distributedWithDynamicCallback = exports.distributedWithDynamic = exports.distributedWith = exports.dieSync = exports.dieMessage = exports.die = exports.decodeText = exports.debounce = exports.crossWith = exports.crossRight = exports.crossLeft = exports.cross = exports.contextWithStream = exports.contextWithEffect = exports.contextWith = exports.context = exports.concatAll = exports.concat = exports.combineChunks = exports.combine = exports.chunksWith = exports.chunks = exports.channelToStream = exports.changesWithEffect = exports.changesWith = exports.changes = exports.catchTags = exports.catchTag = exports.catchSomeCause = exports.catchSome = exports.catchAllCause = exports.catchAll = exports.bufferChunks = exports.buffer = exports.broadcastedQueuesDynamic = exports.broadcastedQueues = exports.broadcastDynamic = exports.broadcast = exports.branchAfter = exports.bindTo = exports.bind = exports.asyncScoped = exports.asyncEffect = exports.as = exports.aggregateWithinEither = exports.aggregateWithin = exports.aggregate = exports.acquireRelease = exports.accumulateChunks = exports.accumulate = exports._async = exports.StreamTypeId = exports.StreamImpl = exports.Do = exports.DefaultChunkSize = void 0;
7
+ exports.runFoldScoped = exports.runFoldEffect = exports.runFold = exports.runDrain = exports.runCount = exports.runCollect = exports.run = exports.retry = exports.repeatWith = exports.repeatValue = exports.repeatElementsWith = exports.repeatElements = exports.repeatEither = exports.repeatEffectWithSchedule = exports.repeatEffectOption = exports.repeatEffectChunkOption = exports.repeatEffectChunk = exports.repeatEffect = exports.repeat = exports.refineOrDieWith = exports.refineOrDie = exports.rechunk = exports.range = exports.provideSomeLayer = exports.provideServiceStream = exports.provideServiceEffect = exports.provideService = exports.provideLayer = exports.provideContext = exports.prepend = exports.pipeThroughChannelOrFail = exports.pipeThroughChannel = exports.pipeThrough = exports.peel = exports.partitionEither = exports.partition = exports.paginateEffect = exports.paginateChunkEffect = exports.paginateChunk = exports.paginate = exports.orElseSucceed = exports.orElseIfEmptyStream = exports.orElseIfEmptyChunk = exports.orElseIfEmpty = exports.orElseFail = exports.orElseEither = exports.orElse = exports.orDieWith = exports.orDie = exports.onError = exports.onDone = exports.never = exports.mkString = exports.mergeWith = exports.mergeRight = exports.mergeLeft = exports.mergeEither = exports.mergeAll = exports.merge = exports.matchConcurrency = exports.mapInputContext = exports.mapErrorCause = exports.mapError = exports.mapEffectSequential = exports.mapEffectPar = exports.mapConcatEffect = exports.mapConcatChunkEffect = exports.mapConcatChunk = exports.mapConcat = exports.mapChunksEffect = exports.mapChunks = exports.mapBoth = exports.mapAccumEffect = exports.mapAccum = exports.map = exports.make = exports.let_ = exports.iterate = exports.isStream = exports.intersperseAffixes = exports.intersperse = exports.interruptWhenDeferred = exports.interruptWhen = exports.interruptAfter = exports.interleaveWith = exports.interleave = exports.identityStream = exports.haltWhenDeferred = exports.haltWhen = exports.haltAfter = exports.groupedWithin = exports.grouped = exports.groupAdjacentBy = exports.fromSchedule = exports.fromReadableStreamByob = exports.fromReadableStream = exports.fromQueue = exports.fromPull = exports.fromPubSub = exports.fromIteratorSucceed = void 0;
8
+ exports.zipWithPreviousAndNext = exports.zipWithPrevious = exports.zipWithNext = exports.zipWithIndex = exports.zipWithChunks = exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipLatestWith = exports.zipLatest = exports.zipFlatten = exports.zipAllWith = exports.zipAllSortedByKeyWith = exports.zipAllSortedByKeyRight = exports.zipAllSortedByKeyLeft = exports.zipAllSortedByKey = exports.zipAllRight = exports.zipAllLeft = exports.zipAll = exports.zip = exports.withSpan = exports.whenEffect = exports.whenCaseEffect = exports.whenCase = exports.when = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unit = exports.unfoldEffect = exports.unfoldChunkEffect = exports.unfoldChunk = exports.unfold = exports.transduce = exports.toReadableStream = exports.toQueueOfElements = exports.toQueue = exports.toPull = exports.toPubSub = exports.toChannel = exports.timeoutTo = exports.timeoutFailCause = exports.timeoutFail = exports.timeout = exports.tick = exports.throttleEffect = exports.throttle = exports.tapSink = exports.tapErrorCause = exports.tapError = exports.tapBoth = exports.tap = exports.takeWhile = exports.takeUntilEffect = exports.takeUntil = exports.takeRight = exports.take = exports.sync = exports.suspend = exports.succeed = exports.splitOnChunk = exports.splitLines = exports.split = exports.someOrFail = exports.someOrElse = exports.some = exports.slidingSize = exports.sliding = exports.scoped = exports.scheduleWith = exports.schedule = exports.scanReduceEffect = exports.scanReduce = exports.scanEffect = exports.scan = exports.runSum = exports.runScoped = exports.runLast = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoQueue = exports.runIntoPubSubScoped = exports.runIntoPubSub = exports.runHead = exports.runForEachWhileScoped = exports.runForEachWhile = exports.runForEachScoped = exports.runForEachChunkScoped = exports.runForEachChunk = exports.runForEach = exports.runFoldWhileScopedEffect = exports.runFoldWhileScoped = exports.runFoldWhileEffect = exports.runFoldWhile = exports.runFoldScopedEffect = void 0;
9
9
  var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../Cause.js"));
10
10
  var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../Chunk.js"));
11
11
  var Clock = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../Clock.js"));
@@ -47,7 +47,7 @@ var pull = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/
47
47
  var SinkEndReason = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/sinkEndReason.js"));
48
48
  var ZipAllState = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/zipAllState.js"));
49
49
  var ZipChunksState = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/zipChunksState.js"));
50
- var _take = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./take.js"));
50
+ var InternalTake = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./take.js"));
51
51
  function _getRequireWildcardCache(e) {
52
52
  if ("function" != typeof WeakMap) return null;
53
53
  var r = new WeakMap(),
@@ -200,20 +200,36 @@ const aggregateWithinEither = exports.aggregateWithinEither = /*#__PURE__*/(0, _
200
200
  /** @internal */
201
201
  const as = exports.as = /*#__PURE__*/(0, _Function.dual)(2, (self, value) => map(self, () => value));
202
202
  /** @internal */
203
- const _async = (register, outputBuffer = 16) => asyncOption(cb => {
204
- register(cb);
205
- return Option.none();
206
- }, outputBuffer);
203
+ const _async = (register, outputBuffer = 16) => Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)).pipe(Effect.flatMap(output => Effect.runtime().pipe(Effect.flatMap(runtime => Effect.sync(() => {
204
+ const runPromiseExit = Runtime.runPromiseExit(runtime);
205
+ const canceler = register(emit.make(resume => InternalTake.fromPull(resume).pipe(Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, runPromiseExit).then(exit => {
206
+ if (Exit.isFailure(exit)) {
207
+ if (!Cause.isInterrupted(exit.cause)) {
208
+ throw Cause.squash(exit.cause);
209
+ }
210
+ }
211
+ })));
212
+ return canceler;
213
+ })), Effect.map(value => {
214
+ const loop = Queue.take(output).pipe(Effect.flatMap(take => InternalTake.done(take)), Effect.match({
215
+ onFailure: maybeError => core.fromEffect(Queue.shutdown(output)).pipe(channel.zipRight(Option.match(maybeError, {
216
+ onNone: () => core.unit,
217
+ onSome: error => core.fail(error)
218
+ }))),
219
+ onSuccess: chunk => core.write(chunk).pipe(core.flatMap(() => loop))
220
+ }), channel.unwrap);
221
+ return fromChannel(loop).pipe(ensuring(value ?? Effect.unit));
222
+ }))), unwrapScoped);
207
223
  /** @internal */
208
224
  exports._async = _async;
209
- const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(_take.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
225
+ const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(InternalTake.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
210
226
  if (Exit.isFailure(exit)) {
211
227
  if (!Cause.isInterrupted(exit.cause)) {
212
228
  throw Cause.squash(exit.cause);
213
229
  }
214
230
  }
215
231
  }))), Effect.map(() => {
216
- const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(_take.done), Effect.match({
232
+ const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(InternalTake.done), Effect.match({
217
233
  onFailure: maybeError => (0, _Function.pipe)(core.fromEffect(Queue.shutdown(output)), channel.zipRight(Option.match(maybeError, {
218
234
  onNone: () => core.unit,
219
235
  onSome: core.fail
@@ -224,40 +240,13 @@ const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.
224
240
  }))))), channel.unwrapScoped, fromChannel);
225
241
  /** @internal */
226
242
  exports.asyncEffect = asyncEffect;
227
- const asyncInterrupt = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(Effect.sync(() => register(emit.make(k => (0, _Function.pipe)(_take.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
228
- if (Exit.isFailure(exit)) {
229
- if (!Cause.isInterrupted(exit.cause)) {
230
- throw Cause.squash(exit.cause);
231
- }
232
- }
233
- })))), Effect.map(Either.match({
234
- onLeft: canceler => {
235
- const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(_take.done), Effect.match({
236
- onFailure: maybeError => channel.zipRight(core.fromEffect(Queue.shutdown(output)), Option.match(maybeError, {
237
- onNone: () => core.unit,
238
- onSome: core.fail
239
- })),
240
- onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => loop))
241
- }), channel.unwrap);
242
- return (0, _Function.pipe)(fromChannel(loop), ensuring(canceler));
243
- },
244
- onRight: stream => unwrap((0, _Function.pipe)(Queue.shutdown(output), Effect.as(stream)))
245
- })))))), unwrapScoped);
246
- /** @internal */
247
- exports.asyncInterrupt = asyncInterrupt;
248
- const asyncOption = (register, outputBuffer = 16) => asyncInterrupt(emit => Option.match(register(emit), {
249
- onNone: () => Either.left(Effect.unit),
250
- onSome: Either.right
251
- }), outputBuffer);
252
- /** @internal */
253
- exports.asyncOption = asyncOption;
254
- const asyncScoped = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(_take.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
243
+ const asyncScoped = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(InternalTake.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
255
244
  if (Exit.isFailure(exit)) {
256
245
  if (!Cause.isInterrupted(exit.cause)) {
257
246
  throw Cause.squash(exit.cause);
258
247
  }
259
248
  }
260
- }))), Effect.zipRight(Ref.make(false)), Effect.flatMap(ref => (0, _Function.pipe)(Ref.get(ref), Effect.map(isDone => isDone ? pull.end() : (0, _Function.pipe)(Queue.take(output), Effect.flatMap(_take.done), Effect.onError(() => (0, _Function.pipe)(Ref.set(ref, true), Effect.zipRight(Queue.shutdown(output)))))))))))), scoped, flatMap(repeatEffectChunkOption));
249
+ }))), Effect.zipRight(Ref.make(false)), Effect.flatMap(ref => (0, _Function.pipe)(Ref.get(ref), Effect.map(isDone => isDone ? pull.end() : (0, _Function.pipe)(Queue.take(output), Effect.flatMap(InternalTake.done), Effect.onError(() => (0, _Function.pipe)(Ref.set(ref, true), Effect.zipRight(Queue.shutdown(output)))))))))))), scoped, flatMap(repeatEffectChunkOption));
261
250
  /** @internal */
262
251
  exports.asyncScoped = asyncScoped;
263
252
  const branchAfter = exports.branchAfter = /*#__PURE__*/(0, _Function.dual)(3, (self, n, f) => suspend(() => {
@@ -318,7 +307,7 @@ const bufferChunks = exports.bufferChunks = /*#__PURE__*/(0, _Function.dual)(2,
318
307
  }
319
308
  const queue = toQueue(self, options);
320
309
  return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
321
- const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(_take.match({
310
+ const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(InternalTake.match({
322
311
  onEnd: () => core.unit,
323
312
  onFailure: core.failCause,
324
313
  onSuccess: value => (0, _Function.pipe)(core.write(value), core.flatMap(() => process))
@@ -347,7 +336,7 @@ const bufferUnbounded = self => {
347
336
  strategy: "unbounded"
348
337
  });
349
338
  return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
350
- const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(_take.match({
339
+ const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(InternalTake.match({
351
340
  onEnd: () => core.unit,
352
341
  onFailure: core.failCause,
353
342
  onSuccess: value => core.flatMap(core.write(value), () => process)
@@ -359,13 +348,13 @@ const bufferSignal = (scoped, bufferChannel) => {
359
348
  const producer = (queue, ref) => {
360
349
  const terminate = take => (0, _Function.pipe)(Ref.get(ref), Effect.tap(Deferred.await), Effect.zipRight(Deferred.make()), Effect.flatMap(deferred => (0, _Function.pipe)(Queue.offer(queue, [take, deferred]), Effect.zipRight(Ref.set(ref, deferred)), Effect.zipRight(Deferred.await(deferred)))), Effect.asUnit, core.fromEffect);
361
350
  return core.readWithCause({
362
- onInput: input => (0, _Function.pipe)(Deferred.make(), Effect.flatMap(deferred => (0, _Function.pipe)(Queue.offer(queue, [_take.chunk(input), deferred]), Effect.flatMap(added => (0, _Function.pipe)(Ref.set(ref, deferred), Effect.when(() => added))))), Effect.asUnit, core.fromEffect, core.flatMap(() => producer(queue, ref))),
363
- onFailure: error => terminate(_take.failCause(error)),
364
- onDone: () => terminate(_take.end)
351
+ onInput: input => (0, _Function.pipe)(Deferred.make(), Effect.flatMap(deferred => (0, _Function.pipe)(Queue.offer(queue, [InternalTake.chunk(input), deferred]), Effect.flatMap(added => (0, _Function.pipe)(Ref.set(ref, deferred), Effect.when(() => added))))), Effect.asUnit, core.fromEffect, core.flatMap(() => producer(queue, ref))),
352
+ onFailure: error => terminate(InternalTake.failCause(error)),
353
+ onDone: () => terminate(InternalTake.end)
365
354
  });
366
355
  };
367
356
  const consumer = queue => {
368
- const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(([take, deferred]) => channel.zipRight(core.fromEffect(Deferred.succeed(deferred, void 0)), _take.match(take, {
357
+ const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(([take, deferred]) => channel.zipRight(core.fromEffect(Deferred.succeed(deferred, void 0)), InternalTake.match(take, {
369
358
  onEnd: () => core.unit,
370
359
  onFailure: core.failCause,
371
360
  onSuccess: value => (0, _Function.pipe)(core.write(value), core.flatMap(() => process))
@@ -466,13 +455,13 @@ const combine = exports.combine = /*#__PURE__*/(0, _Function.dual)(4, (self, tha
466
455
  /** @internal */
467
456
  const combineChunks = exports.combineChunks = /*#__PURE__*/(0, _Function.dual)(4, (self, that, s, f) => {
468
457
  const producer = (handoff, latch) => channel.zipRight(core.fromEffect(Handoff.take(latch)), core.readWithCause({
469
- onInput: input => core.flatMap(core.fromEffect((0, _Function.pipe)(handoff, Handoff.offer(_take.chunk(input)))), () => producer(handoff, latch)),
470
- onFailure: cause => core.fromEffect(Handoff.offer(handoff, _take.failCause(cause))),
471
- onDone: () => core.fromEffect(Handoff.offer(handoff, _take.end))
458
+ onInput: input => core.flatMap(core.fromEffect((0, _Function.pipe)(handoff, Handoff.offer(InternalTake.chunk(input)))), () => producer(handoff, latch)),
459
+ onFailure: cause => core.fromEffect(Handoff.offer(handoff, InternalTake.failCause(cause))),
460
+ onDone: () => core.fromEffect(Handoff.offer(handoff, InternalTake.end))
472
461
  }));
473
462
  return new StreamImpl((0, _Function.pipe)(Effect.all([Handoff.make(), Handoff.make(), Handoff.make(), Handoff.make()]), Effect.tap(([left, _, latchL]) => (0, _Function.pipe)(toChannel(self), core.pipeTo(producer(left, latchL)), channelExecutor.runScoped, Effect.forkScoped)), Effect.tap(([_, right, __, latchR]) => (0, _Function.pipe)(toChannel(that), core.pipeTo(producer(right, latchR)), channelExecutor.runScoped, Effect.forkScoped)), Effect.map(([left, right, latchL, latchR]) => {
474
- const pullLeft = (0, _Function.pipe)(latchL, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(left), Effect.flatMap(_take.done))));
475
- const pullRight = (0, _Function.pipe)(latchR, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(right), Effect.flatMap(_take.done))));
463
+ const pullLeft = (0, _Function.pipe)(latchL, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(left), Effect.flatMap(InternalTake.done))));
464
+ const pullRight = (0, _Function.pipe)(latchR, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(right), Effect.flatMap(InternalTake.done))));
476
465
  return toChannel(unfoldChunkEffect(s, s => Effect.flatMap(f(s, pullLeft, pullRight), unsome)));
477
466
  }), channel.unwrapScoped));
478
467
  });
@@ -1207,22 +1196,22 @@ const interleave = exports.interleave = /*#__PURE__*/(0, _Function.dual)(2, (sel
1207
1196
  /** @internal */
1208
1197
  const interleaveWith = exports.interleaveWith = /*#__PURE__*/(0, _Function.dual)(3, (self, that, decider) => {
1209
1198
  const producer = handoff => core.readWithCause({
1210
- onInput: value => core.flatMap(core.fromEffect(Handoff.offer(handoff, _take.of(value))), () => producer(handoff)),
1211
- onFailure: cause => core.fromEffect(Handoff.offer(handoff, _take.failCause(cause))),
1212
- onDone: () => core.fromEffect(Handoff.offer(handoff, _take.end))
1199
+ onInput: value => core.flatMap(core.fromEffect(Handoff.offer(handoff, InternalTake.of(value))), () => producer(handoff)),
1200
+ onFailure: cause => core.fromEffect(Handoff.offer(handoff, InternalTake.failCause(cause))),
1201
+ onDone: () => core.fromEffect(Handoff.offer(handoff, InternalTake.end))
1213
1202
  });
1214
1203
  return new StreamImpl(channel.unwrapScoped((0, _Function.pipe)(Handoff.make(), Effect.zip(Handoff.make()), Effect.tap(([left]) => (0, _Function.pipe)(toChannel(self), channel.concatMap(channel.writeChunk), core.pipeTo(producer(left)), channelExecutor.runScoped, Effect.forkScoped)), Effect.tap(([_, right]) => (0, _Function.pipe)(toChannel(that), channel.concatMap(channel.writeChunk), core.pipeTo(producer(right)), channelExecutor.runScoped, Effect.forkScoped)), Effect.map(([left, right]) => {
1215
1204
  const process = (leftDone, rightDone) => core.readWithCause({
1216
1205
  onInput: bool => {
1217
1206
  if (bool && !leftDone) {
1218
- return (0, _Function.pipe)(core.fromEffect(Handoff.take(left)), core.flatMap(_take.match({
1207
+ return (0, _Function.pipe)(core.fromEffect(Handoff.take(left)), core.flatMap(InternalTake.match({
1219
1208
  onEnd: () => rightDone ? core.unit : process(true, rightDone),
1220
1209
  onFailure: core.failCause,
1221
1210
  onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => process(leftDone, rightDone)))
1222
1211
  })));
1223
1212
  }
1224
1213
  if (!bool && !rightDone) {
1225
- return (0, _Function.pipe)(core.fromEffect(Handoff.take(right)), core.flatMap(_take.match({
1214
+ return (0, _Function.pipe)(core.fromEffect(Handoff.take(right)), core.flatMap(InternalTake.match({
1226
1215
  onEnd: () => leftDone ? core.unit : process(leftDone, true),
1227
1216
  onFailure: core.failCause,
1228
1217
  onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => process(leftDone, rightDone)))
@@ -1690,10 +1679,8 @@ const repeatWith = exports.repeatWith = /*#__PURE__*/(0, _Function.dual)(3, (sel
1690
1679
  return new StreamImpl((0, _Function.pipe)(process, channel.zipRight(loop)));
1691
1680
  }), unwrap);
1692
1681
  });
1693
- /** @internal */
1694
1682
  const repeatWithSchedule = (value, schedule) => repeatEffectWithSchedule(Effect.succeed(value), schedule);
1695
1683
  /** @internal */
1696
- exports.repeatWithSchedule = repeatWithSchedule;
1697
1684
  const repeatEffectWithSchedule = (effect, schedule) => flatMap(fromEffect(Effect.zip(effect, Schedule.driver(schedule))), ([a, driver]) => concat(succeed(a), unfoldEffect(a, s => Effect.matchEffect(driver.next(s), {
1698
1685
  onFailure: Effect.succeed,
1699
1686
  onSuccess: () => Effect.map(effect, nextA => Option.some([nextA, nextA]))
@@ -1767,9 +1754,9 @@ const runIntoQueueElementsScoped = exports.runIntoQueueElementsScoped = /*#__PUR
1767
1754
  /** @internal */
1768
1755
  const runIntoQueueScoped = exports.runIntoQueueScoped = /*#__PURE__*/(0, _Function.dual)(2, (self, queue) => {
1769
1756
  const writer = core.readWithCause({
1770
- onInput: input => core.flatMap(core.write(_take.chunk(input)), () => writer),
1771
- onFailure: cause => core.write(_take.failCause(cause)),
1772
- onDone: () => core.write(_take.end)
1757
+ onInput: input => core.flatMap(core.write(InternalTake.chunk(input)), () => writer),
1758
+ onFailure: cause => core.write(InternalTake.failCause(cause)),
1759
+ onDone: () => core.write(InternalTake.end)
1773
1760
  });
1774
1761
  return (0, _Function.pipe)(core.pipeTo(toChannel(self), writer), channel.mapOutEffect(take => Queue.offer(queue, take)), channel.drain, channelExecutor.runScoped, Effect.asUnit);
1775
1762
  });
@@ -2122,20 +2109,20 @@ const tapSink = exports.tapSink = /*#__PURE__*/(0, _Function.dual)(2, (self, sin
2122
2109
  maxChunkSize: 1
2123
2110
  }));
2124
2111
  const loop = core.readWithCause({
2125
- onInput: chunk => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, _take.chunk(chunk))), core.foldCauseChannel({
2112
+ onInput: chunk => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.chunk(chunk))), core.foldCauseChannel({
2126
2113
  onFailure: () => core.flatMap(core.write(chunk), () => channel.identityChannel()),
2127
2114
  onSuccess: () => core.flatMap(core.write(chunk), () => loop)
2128
2115
  })),
2129
- onFailure: cause => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, _take.failCause(cause))), core.foldCauseChannel({
2116
+ onFailure: cause => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.failCause(cause))), core.foldCauseChannel({
2130
2117
  onFailure: () => core.failCause(cause),
2131
2118
  onSuccess: () => core.failCause(cause)
2132
2119
  })),
2133
- onDone: () => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, _take.end)), core.foldCauseChannel({
2120
+ onDone: () => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.end)), core.foldCauseChannel({
2134
2121
  onFailure: () => core.unit,
2135
2122
  onSuccess: () => core.unit
2136
2123
  }))
2137
2124
  });
2138
- return (0, _Function.pipe)(new StreamImpl((0, _Function.pipe)(core.pipeTo(toChannel(self), loop), channel.ensuring(Effect.zipRight(Effect.forkDaemon(Queue.offer(queue, _take.end)), Deferred.await(deferred))))), merge(execute((0, _Function.pipe)(run(right, sink), Effect.ensuring(Effect.zipRight(Queue.shutdown(queue), Deferred.succeed(deferred, void 0)))))));
2125
+ return (0, _Function.pipe)(new StreamImpl((0, _Function.pipe)(core.pipeTo(toChannel(self), loop), channel.ensuring(Effect.zipRight(Effect.forkDaemon(Queue.offer(queue, InternalTake.end)), Deferred.await(deferred))))), merge(execute((0, _Function.pipe)(run(right, sink), Effect.ensuring(Effect.zipRight(Queue.shutdown(queue), Deferred.succeed(deferred, void 0)))))));
2139
2126
  })));
2140
2127
  /** @internal */
2141
2128
  const throttle = exports.throttle = /*#__PURE__*/(0, _Function.dual)(2, (self, options) => throttleEffect(self, {