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
package/src/Stream.ts CHANGED
@@ -29,7 +29,7 @@ import type * as Emit from "./StreamEmit.js"
29
29
  import type * as HaltStrategy from "./StreamHaltStrategy.js"
30
30
  import type * as Take from "./Take.js"
31
31
  import type * as Tracer from "./Tracer.js"
32
- import type { Covariant, NoInfer } from "./Types.js"
32
+ import type { Covariant, MergeRecord, NoInfer } from "./Types.js"
33
33
  import type * as Unify from "./Unify.js"
34
34
 
35
35
  /**
@@ -169,9 +169,9 @@ export const accumulateChunks: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E,
169
169
  * @since 2.0.0
170
170
  * @category constructors
171
171
  */
172
- export const acquireRelease: <A, E, R, R2, _>(
172
+ export const acquireRelease: <A, E, R, R2, X>(
173
173
  acquire: Effect.Effect<A, E, R>,
174
- release: (resource: A, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<_, never, R2>
174
+ release: (resource: A, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<X, never, R2>
175
175
  ) => Stream<A, E, R | R2> = internal.acquireRelease
176
176
 
177
177
  /**
@@ -204,14 +204,14 @@ export const aggregate: {
204
204
  * @category utils
205
205
  */
206
206
  export const aggregateWithin: {
207
- <B, A, A2, E2, R2, R3, C>(
207
+ <B, A, A2, E2, R2, C, R3>(
208
208
  sink: Sink.Sink<B, A | A2, A2, E2, R2>,
209
- schedule: Schedule.Schedule<R3, Option.Option<B>, C>
209
+ schedule: Schedule.Schedule<C, Option.Option<B>, R3>
210
210
  ): <E, R>(self: Stream<A, E, R>) => Stream<B, E2 | E, R2 | R3 | R>
211
- <A, E, R, B, A2, E2, R2, R3, C>(
211
+ <A, E, R, B, A2, E2, R2, C, R3>(
212
212
  self: Stream<A, E, R>,
213
213
  sink: Sink.Sink<B, A | A2, A2, E2, R2>,
214
- schedule: Schedule.Schedule<R3, Option.Option<B>, C>
214
+ schedule: Schedule.Schedule<C, Option.Option<B>, R3>
215
215
  ): Stream<B, E | E2, R | R2 | R3>
216
216
  } = internal.aggregateWithin
217
217
 
@@ -233,15 +233,15 @@ export const aggregateWithin: {
233
233
  * @category utils
234
234
  */
235
235
  export const aggregateWithinEither: {
236
- <B, A, A2, E2, R2, R3, C>(
236
+ <B, A, A2, E2, R2, C, R3>(
237
237
  sink: Sink.Sink<B, A | A2, A2, E2, R2>,
238
- schedule: Schedule.Schedule<R3, Option.Option<B>, C>
239
- ): <E, R>(self: Stream<A, E, R>) => Stream<Either.Either<C, B>, E2 | E, R2 | R3 | R>
240
- <A, E, R, B, A2, E2, R2, R3, C>(
238
+ schedule: Schedule.Schedule<C, Option.Option<B>, R3>
239
+ ): <E, R>(self: Stream<A, E, R>) => Stream<Either.Either<B, C>, E2 | E, R2 | R3 | R>
240
+ <A, E, R, B, A2, E2, R2, C, R3>(
241
241
  self: Stream<A, E, R>,
242
242
  sink: Sink.Sink<B, A | A2, A2, E2, R2>,
243
- schedule: Schedule.Schedule<R3, Option.Option<B>, C>
244
- ): Stream<Either.Either<C, B>, E | E2, R | R2 | R3>
243
+ schedule: Schedule.Schedule<C, Option.Option<B>, R3>
244
+ ): Stream<Either.Either<B, C>, E | E2, R | R2 | R3>
245
245
  } = internal.aggregateWithinEither
246
246
 
247
247
  /**
@@ -252,19 +252,22 @@ export const aggregateWithinEither: {
252
252
  */
253
253
  export const as: {
254
254
  <B>(value: B): <A, E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
255
- <R, E, A, B>(self: Stream<A, E, R>, value: B): Stream<B, E, R>
255
+ <A, E, R, B>(self: Stream<A, E, R>, value: B): Stream<B, E, R>
256
256
  } = internal.as
257
257
 
258
258
  const _async: <A, E = never, R = never>(
259
- register: (emit: Emit.Emit<R, E, A, void>) => void,
259
+ register: (emit: Emit.Emit<R, E, A, void>) => Effect.Effect<void, never, R> | void,
260
260
  outputBuffer?: number
261
261
  ) => Stream<A, E, R> = internal._async
262
262
 
263
263
  export {
264
264
  /**
265
265
  * Creates a stream from an asynchronous callback that can be called multiple
266
- * times. The optionality of the error type `E` can be used to signal the end
267
- * of the stream, by setting it to `None`.
266
+ * times. The optionality of the error type `E` in `Emit` can be used to
267
+ * signal the end of the stream by setting it to `None`.
268
+ *
269
+ * The registration function can optionally return an `Effect`, which will be
270
+ * executed if the `Fiber` executing this Effect is interrupted.
268
271
  *
269
272
  * @since 2.0.0
270
273
  * @category constructors
@@ -286,34 +289,6 @@ export const asyncEffect: <A, E = never, R = never>(
286
289
  outputBuffer?: number
287
290
  ) => Stream<A, E, R> = internal.asyncEffect
288
291
 
289
- /**
290
- * Creates a stream from an asynchronous callback that can be called multiple
291
- * times. The registration of the callback returns either a canceler or
292
- * synchronously returns a stream. The optionality of the error type `E` can
293
- * be used to signal the end of the stream, by setting it to `None`.
294
- *
295
- * @since 2.0.0
296
- * @category constructors
297
- */
298
- export const asyncInterrupt: <A, E = never, R = never>(
299
- register: (emit: Emit.Emit<R, E, A, void>) => Either.Either<Effect.Effect<unknown, never, R>, Stream<A, E, R>>,
300
- outputBuffer?: number
301
- ) => Stream<A, E, R> = internal.asyncInterrupt
302
-
303
- /**
304
- * Creates a stream from an asynchronous callback that can be called multiple
305
- * times. The registration of the callback can possibly return the stream
306
- * synchronously. The optionality of the error type `E` can be used to signal
307
- * the end of the stream, by setting it to `None`.
308
- *
309
- * @since 2.0.0
310
- * @category constructors
311
- */
312
- export const asyncOption: <A, E = never, R = never>(
313
- register: (emit: Emit.Emit<R, E, A, void>) => Option.Option<Stream<A, E, R>>,
314
- outputBuffer?: number
315
- ) => Stream<A, E, R> = internal.asyncOption
316
-
317
292
  /**
318
293
  * Creates a stream from an asynchronous callback that can be called multiple
319
294
  * times. The registration of the callback itself returns an a scoped
@@ -340,8 +315,8 @@ export const branchAfter: {
340
315
  <A, A2, E2, R2>(
341
316
  n: number,
342
317
  f: (input: Chunk.Chunk<A>) => Stream<A2, E2, R2>
343
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
344
- <A, E, R, R2, E2, A2>(
318
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
319
+ <A, E, R, A2, E2, R2>(
345
320
  self: Stream<A, E, R>,
346
321
  n: number,
347
322
  f: (input: Chunk.Chunk<A>) => Stream<A2, E2, R2>
@@ -481,8 +456,8 @@ export const bufferChunks: {
481
456
  * @category error handling
482
457
  */
483
458
  export const catchAll: {
484
- <E, R2, E2, A2>(f: (error: E) => Stream<A2, E2, R2>): <R, A>(self: Stream<A, E, R>) => Stream<A2 | A, E2, R2 | R>
485
- <R, A, E, R2, E2, A2>(self: Stream<A, E, R>, f: (error: E) => Stream<A2, E2, R2>): Stream<A | A2, E2, R | R2>
459
+ <E, A2, E2, R2>(f: (error: E) => Stream<A2, E2, R2>): <A, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2, R2 | R>
460
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, f: (error: E) => Stream<A2, E2, R2>): Stream<A | A2, E2, R | R2>
486
461
  } = internal.catchAll
487
462
 
488
463
  /**
@@ -494,10 +469,10 @@ export const catchAll: {
494
469
  * @category error handling
495
470
  */
496
471
  export const catchAllCause: {
497
- <E, R2, E2, A2>(
472
+ <E, A2, E2, R2>(
498
473
  f: (cause: Cause.Cause<E>) => Stream<A2, E2, R2>
499
- ): <R, A>(self: Stream<A, E, R>) => Stream<A2 | A, E2, R2 | R>
500
- <R, A, E, R2, E2, A2>(
474
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2, R2 | R>
475
+ <A, E, R, A2, E2, R2>(
501
476
  self: Stream<A, E, R>,
502
477
  f: (cause: Cause.Cause<E>) => Stream<A2, E2, R2>
503
478
  ): Stream<A | A2, E2, R | R2>
@@ -511,10 +486,10 @@ export const catchAllCause: {
511
486
  * @category error handling
512
487
  */
513
488
  export const catchSome: {
514
- <E, R2, E2, A2>(
489
+ <E, A2, E2, R2>(
515
490
  pf: (error: E) => Option.Option<Stream<A2, E2, R2>>
516
- ): <R, A>(self: Stream<A, E, R>) => Stream<A2 | A, E | E2, R2 | R>
517
- <R, A, E, R2, E2, A2>(
491
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A2 | A, E | E2, R2 | R>
492
+ <A, E, R, A2, E2, R2>(
518
493
  self: Stream<A, E, R>,
519
494
  pf: (error: E) => Option.Option<Stream<A2, E2, R2>>
520
495
  ): Stream<A | A2, E | E2, R | R2>
@@ -528,11 +503,11 @@ export const catchSome: {
528
503
  * @category error handling
529
504
  */
530
505
  export const catchTag: {
531
- <K extends E["_tag"] & string, E extends { _tag: string }, R1, E1, A1>(
506
+ <K extends E["_tag"] & string, E extends { _tag: string }, A1, E1, R1>(
532
507
  k: K,
533
508
  f: (e: Extract<E, { _tag: K }>) => Stream<A1, E1, R1>
534
- ): <R, A>(self: Stream<A, E, R>) => Stream<A1 | A, E1 | Exclude<E, { _tag: K }>, R1 | R>
535
- <R, E extends { _tag: string }, A, K extends E["_tag"] & string, R1, E1, A1>(
509
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A1 | A, E1 | Exclude<E, { _tag: K }>, R1 | R>
510
+ <A, E extends { _tag: string }, R, K extends E["_tag"] & string, A1, E1, R1>(
536
511
  self: Stream<A, E, R>,
537
512
  k: K,
538
513
  f: (e: Extract<E, { _tag: K }>) => Stream<A1, E1, R1>
@@ -552,7 +527,7 @@ export const catchTags: {
552
527
  Cases extends { [K in E["_tag"]]+?: (error: Extract<E, { _tag: K }>) => Stream<any, any, any> }
553
528
  >(
554
529
  cases: Cases
555
- ): <R, A>(
530
+ ): <A, R>(
556
531
  self: Stream<A, E, R>
557
532
  ) => Stream<
558
533
  | A
@@ -572,9 +547,9 @@ export const catchTags: {
572
547
  }[keyof Cases]
573
548
  >
574
549
  <
575
- R,
576
- E extends { _tag: string },
577
550
  A,
551
+ E extends { _tag: string },
552
+ R,
578
553
  Cases extends { [K in E["_tag"]]+?: (error: Extract<E, { _tag: K }>) => Stream<any, any, any> }
579
554
  >(
580
555
  self: Stream<A, E, R>,
@@ -607,10 +582,10 @@ export const catchTags: {
607
582
  * @category error handling
608
583
  */
609
584
  export const catchSomeCause: {
610
- <E, R2, E2, A2>(
585
+ <E, A2, E2, R2>(
611
586
  pf: (cause: Cause.Cause<E>) => Option.Option<Stream<A2, E2, R2>>
612
- ): <R, A>(self: Stream<A, E, R>) => Stream<A2 | A, E | E2, R2 | R>
613
- <R, A, E, R2, E2, A2>(
587
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A2 | A, E | E2, R2 | R>
588
+ <A, E, R, A2, E2, R2>(
614
589
  self: Stream<A, E, R>,
615
590
  pf: (cause: Cause.Cause<E>) => Option.Option<Stream<A2, E2, R2>>
616
591
  ): Stream<A | A2, E | E2, R | R2>
@@ -635,7 +610,7 @@ export const changes: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R> = inte
635
610
  * @category utils
636
611
  */
637
612
  export const changesWith: {
638
- <A>(f: (x: A, y: A) => boolean): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
613
+ <A>(f: (x: A, y: A) => boolean): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
639
614
  <A, E, R>(self: Stream<A, E, R>, f: (x: A, y: A) => boolean): Stream<A, E, R>
640
615
  } = internal.changesWith
641
616
 
@@ -648,10 +623,10 @@ export const changesWith: {
648
623
  * @category utils
649
624
  */
650
625
  export const changesWithEffect: {
651
- <A, R2, E2>(
626
+ <A, E2, R2>(
652
627
  f: (x: A, y: A) => Effect.Effect<boolean, E2, R2>
653
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
654
- <R, E, A, R2, E2>(self: Stream<A, E, R>, f: (x: A, y: A) => Effect.Effect<boolean, E2, R2>): Stream<A, E | E2, R | R2>
628
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
629
+ <A, E, R, E2, R2>(self: Stream<A, E, R>, f: (x: A, y: A) => Effect.Effect<boolean, E2, R2>): Stream<A, E | E2, R | R2>
655
630
  } = internal.changesWithEffect
656
631
 
657
632
  /**
@@ -671,10 +646,10 @@ export const chunks: <A, E, R>(self: Stream<A, E, R>) => Stream<Chunk.Chunk<A>,
671
646
  * @category utils
672
647
  */
673
648
  export const chunksWith: {
674
- <R, E, A, R2, E2, A2>(
649
+ <A, E, R, A2, E2, R2>(
675
650
  f: (stream: Stream<Chunk.Chunk<A>, E, R>) => Stream<Chunk.Chunk<A2>, E2, R2>
676
651
  ): (self: Stream<A, E, R>) => Stream<A2, E | E2, R | R2>
677
- <R, E, A, R2, E2, A2>(
652
+ <A, E, R, A2, E2, R2>(
678
653
  self: Stream<A, E, R>,
679
654
  f: (stream: Stream<Chunk.Chunk<A>, E, R>) => Stream<Chunk.Chunk<A2>, E2, R2>
680
655
  ): Stream<A2, E | E2, R | R2>
@@ -694,7 +669,7 @@ export const chunksWith: {
694
669
  * @category utils
695
670
  */
696
671
  export const combine: {
697
- <R2, E2, A2, S, R3, E, A, R4, R5, A3>(
672
+ <A2, E2, R2, S, R3, E, A, R4, R5, A3>(
698
673
  that: Stream<A2, E2, R2>,
699
674
  s: S,
700
675
  f: (
@@ -703,7 +678,7 @@ export const combine: {
703
678
  pullRight: Effect.Effect<A2, Option.Option<E2>, R4>
704
679
  ) => Effect.Effect<Exit.Exit<readonly [A3, S], Option.Option<E2 | E>>, never, R5>
705
680
  ): <R>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R3 | R4 | R5 | R>
706
- <R, R2, E2, A2, S, R3, E, A, R4, R5, A3>(
681
+ <R, A2, E2, R2, S, R3, E, A, R4, R5, A3>(
707
682
  self: Stream<A, E, R>,
708
683
  that: Stream<A2, E2, R2>,
709
684
  s: S,
@@ -726,7 +701,7 @@ export const combine: {
726
701
  * @category utils
727
702
  */
728
703
  export const combineChunks: {
729
- <R2, E2, A2, S, R3, E, A, R4, R5, A3>(
704
+ <A2, E2, R2, S, R3, E, A, R4, R5, A3>(
730
705
  that: Stream<A2, E2, R2>,
731
706
  s: S,
732
707
  f: (
@@ -735,7 +710,7 @@ export const combineChunks: {
735
710
  pullRight: Effect.Effect<Chunk.Chunk<A2>, Option.Option<E2>, R4>
736
711
  ) => Effect.Effect<Exit.Exit<readonly [Chunk.Chunk<A3>, S], Option.Option<E2 | E>>, never, R5>
737
712
  ): <R>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R3 | R4 | R5 | R>
738
- <R, R2, E2, A2, S, R3, E, A, R4, R5, A3>(
713
+ <R, A2, E2, R2, S, R3, E, A, R4, R5, A3>(
739
714
  self: Stream<A, E, R>,
740
715
  that: Stream<A2, E2, R2>,
741
716
  s: S,
@@ -756,8 +731,8 @@ export const combineChunks: {
756
731
  * @category utils
757
732
  */
758
733
  export const concat: {
759
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
760
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A | A2, E | E2, R | R2>
734
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
735
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A | A2, E | E2, R | R2>
761
736
  } = internal.concat
762
737
 
763
738
  /**
@@ -779,8 +754,8 @@ export const concatAll: <A, E, R>(streams: Chunk.Chunk<Stream<A, E, R>>) => Stre
779
754
  * @category utils
780
755
  */
781
756
  export const cross: {
782
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
783
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<[A, A2], E | E2, R | R2>
757
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
758
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<[A, A2], E | E2, R | R2>
784
759
  } = internal.cross
785
760
 
786
761
  /**
@@ -794,8 +769,8 @@ export const cross: {
794
769
  * @category utils
795
770
  */
796
771
  export const crossLeft: {
797
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
798
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
772
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
773
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
799
774
  } = internal.crossLeft
800
775
 
801
776
  /**
@@ -810,8 +785,8 @@ export const crossLeft: {
810
785
  * @category utils
811
786
  */
812
787
  export const crossRight: {
813
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
814
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A2, E | E2, R | R2>
788
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
789
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A2, E | E2, R | R2>
815
790
  } = internal.crossRight
816
791
 
817
792
  /**
@@ -825,11 +800,11 @@ export const crossRight: {
825
800
  * @category utils
826
801
  */
827
802
  export const crossWith: {
828
- <R2, E2, B, A, C>(
803
+ <B, E2, R2, A, C>(
829
804
  that: Stream<B, E2, R2>,
830
805
  f: (a: A, b: B) => C
831
- ): <R, E>(self: Stream<A, E, R>) => Stream<C, E2 | E, R2 | R>
832
- <R, E, R2, E2, B, A, C>(
806
+ ): <E, R>(self: Stream<A, E, R>) => Stream<C, E2 | E, R2 | R>
807
+ <A, E, R, B, E2, R2, C>(
833
808
  self: Stream<A, E, R>,
834
809
  that: Stream<B, E2, R2>,
835
810
  f: (a: A, b: B) => C
@@ -894,10 +869,10 @@ export const distributedWith: {
894
869
  readonly maximumLag: number
895
870
  readonly decide: (a: A) => Effect.Effect<Predicate<number>>
896
871
  }
897
- ): <R, E>(
872
+ ): <E, R>(
898
873
  self: Stream<A, E, R>
899
874
  ) => Effect.Effect<Stream.DynamicTuple<Queue.Dequeue<Exit.Exit<A, Option.Option<E>>>, N>, never, Scope.Scope | R>
900
- <R, E, N extends number, A>(
875
+ <A, E, R, N extends number>(
901
876
  self: Stream<A, E, R>,
902
877
  options: {
903
878
  readonly size: N
@@ -919,20 +894,20 @@ export const distributedWith: {
919
894
  * @category utils
920
895
  */
921
896
  export const distributedWithDynamic: {
922
- <E, A, _>(
923
- options: { readonly maximumLag: number; readonly decide: (a: A) => Effect.Effect<Predicate<number>> }
924
- ): <R>(
897
+ <A>(
898
+ options: { readonly maximumLag: number; readonly decide: (a: A) => Effect.Effect<Predicate<number>, never, never> }
899
+ ): <E, R>(
925
900
  self: Stream<A, E, R>
926
901
  ) => Effect.Effect<
927
- Effect.Effect<[number, Queue.Dequeue<Exit.Exit<A, Option.Option<E>>>]>,
902
+ Effect.Effect<[number, Queue.Dequeue<Exit.Exit<A, Option.Option<E>>>], never, never>,
928
903
  never,
929
904
  Scope.Scope | R
930
905
  >
931
- <R, E, A, _>(
906
+ <A, E, R>(
932
907
  self: Stream<A, E, R>,
933
- options: { readonly maximumLag: number; readonly decide: (a: A) => Effect.Effect<Predicate<number>> }
908
+ options: { readonly maximumLag: number; readonly decide: (a: A) => Effect.Effect<Predicate<number>, never, never> }
934
909
  ): Effect.Effect<
935
- Effect.Effect<[number, Queue.Dequeue<Exit.Exit<A, Option.Option<E>>>]>,
910
+ Effect.Effect<[number, Queue.Dequeue<Exit.Exit<A, Option.Option<E>>>], never, never>,
936
911
  never,
937
912
  Scope.Scope | R
938
913
  >
@@ -956,8 +931,8 @@ export const drain: <A, E, R>(self: Stream<A, E, R>) => Stream<never, E, R> = in
956
931
  * @category utils
957
932
  */
958
933
  export const drainFork: {
959
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
960
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
934
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
935
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
961
936
  } = internal.drainFork
962
937
 
963
938
  /**
@@ -992,7 +967,7 @@ export const dropRight: {
992
967
  * @category utils
993
968
  */
994
969
  export const dropUntil: {
995
- <A>(predicate: Predicate<NoInfer<A>>): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
970
+ <A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
996
971
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>
997
972
  } = internal.dropUntil
998
973
 
@@ -1004,10 +979,10 @@ export const dropUntil: {
1004
979
  * @category utils
1005
980
  */
1006
981
  export const dropUntilEffect: {
1007
- <A, R2, E2>(
982
+ <A, E2, R2>(
1008
983
  predicate: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
1009
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1010
- <R, E, A, R2, E2>(
984
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
985
+ <A, E, R, E2, R2>(
1011
986
  self: Stream<A, E, R>,
1012
987
  predicate: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
1013
988
  ): Stream<A, E | E2, R | R2>
@@ -1021,7 +996,7 @@ export const dropUntilEffect: {
1021
996
  * @category utils
1022
997
  */
1023
998
  export const dropWhile: {
1024
- <A>(predicate: Predicate<NoInfer<A>>): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
999
+ <A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
1025
1000
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>
1026
1001
  } = internal.dropWhile
1027
1002
 
@@ -1033,10 +1008,10 @@ export const dropWhile: {
1033
1008
  * @category utils
1034
1009
  */
1035
1010
  export const dropWhileEffect: {
1036
- <A, R2, E2>(
1011
+ <A, E2, R2>(
1037
1012
  predicate: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
1038
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1039
- <R, E, A, R2, E2>(
1013
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1014
+ <A, E, R, E2, R2>(
1040
1015
  self: Stream<A, E, R>,
1041
1016
  predicate: (a: A) => Effect.Effect<boolean, E2, R2>
1042
1017
  ): Stream<A, E | E2, R | R2>
@@ -1052,7 +1027,7 @@ export const dropWhileEffect: {
1052
1027
  * @since 2.0.0
1053
1028
  * @category utils
1054
1029
  */
1055
- export const either: <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<E, A>, never, R> = internal.either
1030
+ export const either: <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A, E>, never, R> = internal.either
1056
1031
 
1057
1032
  /**
1058
1033
  * The empty stream.
@@ -1069,8 +1044,8 @@ export const empty: Stream<never> = internal.empty
1069
1044
  * @category utils
1070
1045
  */
1071
1046
  export const ensuring: {
1072
- <R2, _>(finalizer: Effect.Effect<_, never, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
1073
- <R, E, A, R2, _>(self: Stream<A, E, R>, finalizer: Effect.Effect<_, never, R2>): Stream<A, E, R | R2>
1047
+ <X, R2>(finalizer: Effect.Effect<X, never, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
1048
+ <A, E, R, X, R2>(self: Stream<A, E, R>, finalizer: Effect.Effect<X, never, R2>): Stream<A, E, R | R2>
1074
1049
  } = internal.ensuring
1075
1050
 
1076
1051
  /**
@@ -1082,8 +1057,8 @@ export const ensuring: {
1082
1057
  export const ensuringWith: {
1083
1058
  <E, R2>(
1084
1059
  finalizer: (exit: Exit.Exit<unknown, E>) => Effect.Effect<unknown, never, R2>
1085
- ): <R, A>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
1086
- <R, E, A, R2>(
1060
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
1061
+ <A, E, R, R2>(
1087
1062
  self: Stream<A, E, R>,
1088
1063
  finalizer: (exit: Exit.Exit<unknown, E>) => Effect.Effect<unknown, never, R2>
1089
1064
  ): Stream<A, E, R | R2>
@@ -1111,7 +1086,7 @@ export const contextWith: <R, A>(f: (env: Context.Context<R>) => A) => Stream<A,
1111
1086
  * @since 2.0.0
1112
1087
  * @category context
1113
1088
  */
1114
- export const contextWithEffect: <R0, R, E, A>(
1089
+ export const contextWithEffect: <R0, A, E, R>(
1115
1090
  f: (env: Context.Context<R0>) => Effect.Effect<A, E, R>
1116
1091
  ) => Stream<A, E, R0 | R> = internal.contextWithEffect
1117
1092
 
@@ -1121,7 +1096,7 @@ export const contextWithEffect: <R0, R, E, A>(
1121
1096
  * @since 2.0.0
1122
1097
  * @category context
1123
1098
  */
1124
- export const contextWithStream: <R0, R, E, A>(
1099
+ export const contextWithStream: <R0, A, E, R>(
1125
1100
  f: (env: Context.Context<R0>) => Stream<A, E, R>
1126
1101
  ) => Stream<A, E, R0 | R> = internal.contextWithStream
1127
1102
 
@@ -1131,7 +1106,7 @@ export const contextWithStream: <R0, R, E, A>(
1131
1106
  * @since 2.0.0
1132
1107
  * @category constructors
1133
1108
  */
1134
- export const execute: <R, E, _>(effect: Effect.Effect<_, E, R>) => Stream<never, E, R> = internal.execute
1109
+ export const execute: <X, E, R>(effect: Effect.Effect<X, E, R>) => Stream<never, E, R> = internal.execute
1135
1110
 
1136
1111
  /**
1137
1112
  * Terminates with the specified error.
@@ -1172,9 +1147,9 @@ export const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Stream<nev
1172
1147
  * @category filtering
1173
1148
  */
1174
1149
  export const filter: {
1175
- <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <R, E>(self: Stream<A, E, R>) => Stream<B, E, R>
1176
- <A, B extends A>(predicate: Predicate<B>): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
1177
- <R, E, A, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>): Stream<B, E, R>
1150
+ <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
1151
+ <A, B extends A>(predicate: Predicate<B>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
1152
+ <A, E, R, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>): Stream<B, E, R>
1178
1153
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>
1179
1154
  } = internal.filter
1180
1155
 
@@ -1185,10 +1160,10 @@ export const filter: {
1185
1160
  * @category filtering
1186
1161
  */
1187
1162
  export const filterEffect: {
1188
- <A, R2, E2>(
1163
+ <A, E2, R2>(
1189
1164
  f: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
1190
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1191
- <R, E, A, R2, E2>(self: Stream<A, E, R>, f: (a: A) => Effect.Effect<boolean, E2, R2>): Stream<A, E | E2, R | R2>
1165
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1166
+ <A, E, R, E2, R2>(self: Stream<A, E, R>, f: (a: A) => Effect.Effect<boolean, E2, R2>): Stream<A, E | E2, R | R2>
1192
1167
  } = internal.filterEffect
1193
1168
 
1194
1169
  /**
@@ -1198,8 +1173,8 @@ export const filterEffect: {
1198
1173
  * @category utils
1199
1174
  */
1200
1175
  export const filterMap: {
1201
- <A, B>(pf: (a: A) => Option.Option<B>): <R, E>(self: Stream<A, E, R>) => Stream<B, E, R>
1202
- <R, E, A, B>(self: Stream<A, E, R>, pf: (a: A) => Option.Option<B>): Stream<B, E, R>
1176
+ <A, B>(pf: (a: A) => Option.Option<B>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
1177
+ <A, E, R, B>(self: Stream<A, E, R>, pf: (a: A) => Option.Option<B>): Stream<B, E, R>
1203
1178
  } = internal.filterMap
1204
1179
 
1205
1180
  /**
@@ -1209,10 +1184,10 @@ export const filterMap: {
1209
1184
  * @category utils
1210
1185
  */
1211
1186
  export const filterMapEffect: {
1212
- <A, R2, E2, A2>(
1187
+ <A, A2, E2, R2>(
1213
1188
  pf: (a: A) => Option.Option<Effect.Effect<A2, E2, R2>>
1214
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1215
- <R, E, A, R2, E2, A2>(
1189
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1190
+ <A, E, R, A2, E2, R2>(
1216
1191
  self: Stream<A, E, R>,
1217
1192
  pf: (a: A) => Option.Option<Effect.Effect<A2, E2, R2>>
1218
1193
  ): Stream<A2, E | E2, R | R2>
@@ -1226,8 +1201,8 @@ export const filterMapEffect: {
1226
1201
  * @category utils
1227
1202
  */
1228
1203
  export const filterMapWhile: {
1229
- <A, A2>(pf: (a: A) => Option.Option<A2>): <R, E>(self: Stream<A, E, R>) => Stream<A2, E, R>
1230
- <R, E, A, A2>(self: Stream<A, E, R>, pf: (a: A) => Option.Option<A2>): Stream<A2, E, R>
1204
+ <A, A2>(pf: (a: A) => Option.Option<A2>): <E, R>(self: Stream<A, E, R>) => Stream<A2, E, R>
1205
+ <A, E, R, A2>(self: Stream<A, E, R>, pf: (a: A) => Option.Option<A2>): Stream<A2, E, R>
1231
1206
  } = internal.filterMapWhile
1232
1207
 
1233
1208
  /**
@@ -1238,10 +1213,10 @@ export const filterMapWhile: {
1238
1213
  * @category utils
1239
1214
  */
1240
1215
  export const filterMapWhileEffect: {
1241
- <A, R2, E2, A2>(
1216
+ <A, A2, E2, R2>(
1242
1217
  pf: (a: A) => Option.Option<Effect.Effect<A2, E2, R2>>
1243
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1244
- <R, E, A, R2, E2, A2>(
1218
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1219
+ <A, E, R, A2, E2, R2>(
1245
1220
  self: Stream<A, E, R>,
1246
1221
  pf: (a: A) => Option.Option<Effect.Effect<A2, E2, R2>>
1247
1222
  ): Stream<A2, E | E2, R | R2>
@@ -1254,7 +1229,7 @@ export const filterMapWhileEffect: {
1254
1229
  * @since 2.0.0
1255
1230
  * @category constructors
1256
1231
  */
1257
- export const finalizer: <R, _>(finalizer: Effect.Effect<_, never, R>) => Stream<void, never, R> = internal.finalizer
1232
+ export const finalizer: <R, X>(finalizer: Effect.Effect<X, never, R>) => Stream<void, never, R> = internal.finalizer
1258
1233
 
1259
1234
  /**
1260
1235
  * Finds the first element emitted by this stream that satisfies the provided
@@ -1264,9 +1239,9 @@ export const finalizer: <R, _>(finalizer: Effect.Effect<_, never, R>) => Stream<
1264
1239
  * @category elements
1265
1240
  */
1266
1241
  export const find: {
1267
- <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <R, E>(self: Stream<A, E, R>) => Stream<B, E, R>
1268
- <A>(predicate: Predicate<NoInfer<A>>): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
1269
- <R, E, A, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>): Stream<B, E, R>
1242
+ <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
1243
+ <A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
1244
+ <A, E, R, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>): Stream<B, E, R>
1270
1245
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>
1271
1246
  } = internal.find
1272
1247
 
@@ -1278,10 +1253,10 @@ export const find: {
1278
1253
  * @category elements
1279
1254
  */
1280
1255
  export const findEffect: {
1281
- <A, R2, E2>(
1256
+ <A, E2, R2>(
1282
1257
  predicate: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
1283
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1284
- <R, E, A, R2, E2>(
1258
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1259
+ <A, E, R, E2, R2>(
1285
1260
  self: Stream<A, E, R>,
1286
1261
  predicate: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
1287
1262
  ): Stream<A, E | E2, R | R2>
@@ -1295,15 +1270,15 @@ export const findEffect: {
1295
1270
  * @category sequencing
1296
1271
  */
1297
1272
  export const flatMap: {
1298
- <A, R2, E2, A2>(
1273
+ <A, A2, E2, R2>(
1299
1274
  f: (a: A) => Stream<A2, E2, R2>,
1300
1275
  options?: {
1301
1276
  readonly concurrency?: number | "unbounded" | undefined
1302
1277
  readonly bufferSize?: number | undefined
1303
1278
  readonly switch?: boolean | undefined
1304
1279
  } | undefined
1305
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1306
- <R, E, A, R2, E2, A2>(
1280
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1281
+ <A, E, R, A2, E2, R2>(
1307
1282
  self: Stream<A, E, R>,
1308
1283
  f: (a: A) => Stream<A2, E2, R2>,
1309
1284
  options?: {
@@ -1326,13 +1301,13 @@ export const flatten: {
1326
1301
  options?:
1327
1302
  | { readonly concurrency?: number | "unbounded" | undefined; readonly bufferSize?: number | undefined }
1328
1303
  | undefined
1329
- ): <R, E, R2, E2, A>(self: Stream<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R | R2>
1330
- <R, E, R2, E2, A>(
1304
+ ): <A, E2, R2, E, R>(self: Stream<Stream<A, E2, R2>, E, R>) => Stream<A, E2 | E, R2 | R>
1305
+ <A, E2, R2, E, R>(
1331
1306
  self: Stream<Stream<A, E2, R2>, E, R>,
1332
1307
  options?:
1333
1308
  | { readonly concurrency?: number | "unbounded" | undefined; readonly bufferSize?: number | undefined }
1334
1309
  | undefined
1335
- ): Stream<A, E | E2, R | R2>
1310
+ ): Stream<A, E2 | E, R2 | R>
1336
1311
  } = internal.flatten
1337
1312
 
1338
1313
  /**
@@ -1356,13 +1331,13 @@ export const flattenEffect: {
1356
1331
  options?:
1357
1332
  | { readonly concurrency?: number | "unbounded" | undefined; readonly unordered?: boolean | undefined }
1358
1333
  | undefined
1359
- ): <R, E, R2, E2, A>(self: Stream<Effect.Effect<A, E2, R2>, E, R>) => Stream<A, E | E2, R | R2>
1360
- <R, E, R2, E2, A>(
1334
+ ): <A, E2, R2, E, R>(self: Stream<Effect.Effect<A, E2, R2>, E, R>) => Stream<A, E2 | E, R2 | R>
1335
+ <A, E2, R2, E, R>(
1361
1336
  self: Stream<Effect.Effect<A, E2, R2>, E, R>,
1362
1337
  options?:
1363
1338
  | { readonly concurrency?: number | "unbounded" | undefined; readonly unordered?: boolean | undefined }
1364
1339
  | undefined
1365
- ): Stream<A, E | E2, R | R2>
1340
+ ): Stream<A, E2 | E, R2 | R>
1366
1341
  } = internal.flattenEffect
1367
1342
 
1368
1343
  /**
@@ -1377,7 +1352,7 @@ export const flattenEffect: {
1377
1352
  * @since 2.0.0
1378
1353
  * @category sequencing
1379
1354
  */
1380
- export const flattenExitOption: <R, E, E2, A>(
1355
+ export const flattenExitOption: <A, E2, E, R>(
1381
1356
  self: Stream<Exit.Exit<A, Option.Option<E2>>, E, R>
1382
1357
  ) => Stream<A, E | E2, R> = internal.flattenExitOption
1383
1358
 
@@ -1397,7 +1372,7 @@ export const flattenIterables: <A, E, R>(self: Stream<Iterable<A>, E, R>) => Str
1397
1372
  * @since 2.0.0
1398
1373
  * @category sequencing
1399
1374
  */
1400
- export const flattenTake: <R, E, E2, A>(self: Stream<Take.Take<A, E2>, E, R>) => Stream<A, E | E2, R> =
1375
+ export const flattenTake: <A, E2, E, R>(self: Stream<Take.Take<A, E2>, E, R>) => Stream<A, E | E2, R> =
1401
1376
  internal.flattenTake
1402
1377
 
1403
1378
  /**
@@ -1620,7 +1595,7 @@ export const fromReadableStreamByob: <E>(
1620
1595
  * @since 2.0.0
1621
1596
  * @category constructors
1622
1597
  */
1623
- export const fromSchedule: <R, A>(schedule: Schedule.Schedule<R, unknown, A>) => Stream<A, never, R> =
1598
+ export const fromSchedule: <A, R>(schedule: Schedule.Schedule<A, unknown, R>) => Stream<A, never, R> =
1624
1599
  internal.fromSchedule
1625
1600
 
1626
1601
  /**
@@ -1631,8 +1606,8 @@ export const fromSchedule: <R, A>(schedule: Schedule.Schedule<R, unknown, A>) =>
1631
1606
  * @category grouping
1632
1607
  */
1633
1608
  export const groupAdjacentBy: {
1634
- <A, K>(f: (a: A) => K): <R, E>(self: Stream<A, E, R>) => Stream<[K, Chunk.NonEmptyChunk<A>], E, R>
1635
- <R, E, A, K>(self: Stream<A, E, R>, f: (a: A) => K): Stream<[K, Chunk.NonEmptyChunk<A>], E, R>
1609
+ <A, K>(f: (a: A) => K): <E, R>(self: Stream<A, E, R>) => Stream<[K, Chunk.NonEmptyChunk<A>], E, R>
1610
+ <A, E, R, K>(self: Stream<A, E, R>, f: (a: A) => K): Stream<[K, Chunk.NonEmptyChunk<A>], E, R>
1636
1611
  } = internal.groupAdjacentBy
1637
1612
 
1638
1613
  /**
@@ -1642,15 +1617,15 @@ export const groupAdjacentBy: {
1642
1617
  * @category grouping
1643
1618
  */
1644
1619
  export const groupBy: {
1645
- <A, R2, E2, K, V>(
1620
+ <A, K, V, E2, R2>(
1646
1621
  f: (a: A) => Effect.Effect<readonly [K, V], E2, R2>,
1647
1622
  options?: { readonly bufferSize?: number | undefined } | undefined
1648
- ): <R, E>(self: Stream<A, E, R>) => GroupBy.GroupBy<R2 | R, E2 | E, K, V>
1649
- <R, E, A, R2, E2, K, V>(
1623
+ ): <E, R>(self: Stream<A, E, R>) => GroupBy.GroupBy<K, V, E2 | E, R2 | R>
1624
+ <A, E, R, K, V, E2, R2>(
1650
1625
  self: Stream<A, E, R>,
1651
1626
  f: (a: A) => Effect.Effect<readonly [K, V], E2, R2>,
1652
1627
  options?: { readonly bufferSize?: number | undefined } | undefined
1653
- ): GroupBy.GroupBy<R | R2, E | E2, K, V>
1628
+ ): GroupBy.GroupBy<K, V, E | E2, R | R2>
1654
1629
  } = _groupBy.groupBy
1655
1630
 
1656
1631
  /**
@@ -1696,14 +1671,14 @@ export const groupByKey: {
1696
1671
  options?: {
1697
1672
  readonly bufferSize?: number | undefined
1698
1673
  }
1699
- ): <R, E>(self: Stream<A, E, R>) => GroupBy.GroupBy<R, E, K, A>
1700
- <R, E, A, K>(
1674
+ ): <E, R>(self: Stream<A, E, R>) => GroupBy.GroupBy<K, A, E, R>
1675
+ <A, E, R, K>(
1701
1676
  self: Stream<A, E, R>,
1702
1677
  f: (a: A) => K,
1703
1678
  options?: {
1704
1679
  readonly bufferSize?: number | undefined
1705
1680
  }
1706
- ): GroupBy.GroupBy<R, E, K, A>
1681
+ ): GroupBy.GroupBy<K, A, E, R>
1707
1682
  } = _groupBy.groupByKey
1708
1683
 
1709
1684
  /**
@@ -1761,8 +1736,8 @@ export const haltAfter: {
1761
1736
  * @category utils
1762
1737
  */
1763
1738
  export const haltWhen: {
1764
- <R2, E2, _>(effect: Effect.Effect<_, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1765
- <R, E, A, R2, E2, _>(self: Stream<A, E, R>, effect: Effect.Effect<_, E2, R2>): Stream<A, E | E2, R | R2>
1739
+ <X, E2, R2>(effect: Effect.Effect<X, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1740
+ <A, E, R, X, E2, R2>(self: Stream<A, E, R>, effect: Effect.Effect<X, E2, R2>): Stream<A, E | E2, R | R2>
1766
1741
  } = internal.haltWhen
1767
1742
 
1768
1743
  /**
@@ -1774,8 +1749,8 @@ export const haltWhen: {
1774
1749
  * @category utils
1775
1750
  */
1776
1751
  export const haltWhenDeferred: {
1777
- <E2, _>(deferred: Deferred.Deferred<_, E2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R>
1778
- <R, E, A, E2, _>(self: Stream<A, E, R>, deferred: Deferred.Deferred<_, E2>): Stream<A, E | E2, R>
1752
+ <X, E2>(deferred: Deferred.Deferred<X, E2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R>
1753
+ <A, E, R, X, E2>(self: Stream<A, E, R>, deferred: Deferred.Deferred<X, E2>): Stream<A, E | E2, R>
1779
1754
  } = internal.haltWhenDeferred
1780
1755
 
1781
1756
  /**
@@ -1796,8 +1771,8 @@ export const identity: <A, E = never, R = never>() => Stream<A, E, R> = internal
1796
1771
  * @category utils
1797
1772
  */
1798
1773
  export const interleave: {
1799
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
1800
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A | A2, E | E2, R | R2>
1774
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
1775
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A | A2, E | E2, R | R2>
1801
1776
  } = internal.interleave
1802
1777
 
1803
1778
  /**
@@ -1813,11 +1788,11 @@ export const interleave: {
1813
1788
  * @category utils
1814
1789
  */
1815
1790
  export const interleaveWith: {
1816
- <R2, E2, A2, R3, E3>(
1791
+ <A2, E2, R2, E3, R3>(
1817
1792
  that: Stream<A2, E2, R2>,
1818
1793
  decider: Stream<boolean, E3, R3>
1819
1794
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E3 | E, R2 | R3 | R>
1820
- <R, E, A, R2, E2, A2, R3, E3>(
1795
+ <A, E, R, A2, E2, R2, E3, R3>(
1821
1796
  self: Stream<A, E, R>,
1822
1797
  that: Stream<A2, E2, R2>,
1823
1798
  decider: Stream<boolean, E3, R3>
@@ -1832,7 +1807,7 @@ export const interleaveWith: {
1832
1807
  */
1833
1808
  export const intersperse: {
1834
1809
  <A2>(element: A2): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E, R>
1835
- <R, E, A, A2>(self: Stream<A, E, R>, element: A2): Stream<A | A2, E, R>
1810
+ <A, E, R, A2>(self: Stream<A, E, R>, element: A2): Stream<A | A2, E, R>
1836
1811
  } = internal.intersperse
1837
1812
 
1838
1813
  /**
@@ -1845,7 +1820,7 @@ export const intersperseAffixes: {
1845
1820
  <A2, A3, A4>(
1846
1821
  options: { readonly start: A2; readonly middle: A3; readonly end: A4 }
1847
1822
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A3 | A4 | A, E, R>
1848
- <R, E, A, A2, A3, A4>(
1823
+ <A, E, R, A2, A3, A4>(
1849
1824
  self: Stream<A, E, R>,
1850
1825
  options: { readonly start: A2; readonly middle: A3; readonly end: A4 }
1851
1826
  ): Stream<A | A2 | A3 | A4, E, R>
@@ -1876,8 +1851,8 @@ export const interruptAfter: {
1876
1851
  * @category utils
1877
1852
  */
1878
1853
  export const interruptWhen: {
1879
- <R2, E2, _>(effect: Effect.Effect<_, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1880
- <R, E, A, R2, E2, _>(self: Stream<A, E, R>, effect: Effect.Effect<_, E2, R2>): Stream<A, E | E2, R | R2>
1854
+ <X, E2, R2>(effect: Effect.Effect<X, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
1855
+ <A, E, R, X, E2, R2>(self: Stream<A, E, R>, effect: Effect.Effect<X, E2, R2>): Stream<A, E | E2, R | R2>
1881
1856
  } = internal.interruptWhen
1882
1857
 
1883
1858
  /**
@@ -1891,8 +1866,8 @@ export const interruptWhen: {
1891
1866
  * @category utils
1892
1867
  */
1893
1868
  export const interruptWhenDeferred: {
1894
- <E2, _>(deferred: Deferred.Deferred<_, E2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R>
1895
- <R, E, A, E2, _>(self: Stream<A, E, R>, deferred: Deferred.Deferred<_, E2>): Stream<A, E | E2, R>
1869
+ <X, E2>(deferred: Deferred.Deferred<X, E2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R>
1870
+ <A, E, R, X, E2>(self: Stream<A, E, R>, deferred: Deferred.Deferred<X, E2>): Stream<A, E | E2, R>
1896
1871
  } = internal.interruptWhenDeferred
1897
1872
 
1898
1873
  /**
@@ -1919,8 +1894,8 @@ export const make: <As extends Array<any>>(...as: As) => Stream<As[number]> = in
1919
1894
  * @category mapping
1920
1895
  */
1921
1896
  export const map: {
1922
- <A, B>(f: (a: A) => B): <R, E>(self: Stream<A, E, R>) => Stream<B, E, R>
1923
- <R, E, A, B>(self: Stream<A, E, R>, f: (a: A) => B): Stream<B, E, R>
1897
+ <A, B>(f: (a: A) => B): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
1898
+ <A, E, R, B>(self: Stream<A, E, R>, f: (a: A) => B): Stream<B, E, R>
1924
1899
  } = internal.map
1925
1900
 
1926
1901
  /**
@@ -1930,8 +1905,8 @@ export const map: {
1930
1905
  * @category mapping
1931
1906
  */
1932
1907
  export const mapAccum: {
1933
- <S, A, A2>(s: S, f: (s: S, a: A) => readonly [S, A2]): <R, E>(self: Stream<A, E, R>) => Stream<A2, E, R>
1934
- <R, E, S, A, A2>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => readonly [S, A2]): Stream<A2, E, R>
1908
+ <S, A, A2>(s: S, f: (s: S, a: A) => readonly [S, A2]): <E, R>(self: Stream<A, E, R>) => Stream<A2, E, R>
1909
+ <A, E, R, S, A2>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => readonly [S, A2]): Stream<A2, E, R>
1935
1910
  } = internal.mapAccum
1936
1911
 
1937
1912
  /**
@@ -1945,8 +1920,8 @@ export const mapAccumEffect: {
1945
1920
  <S, A, A2, E2, R2>(
1946
1921
  s: S,
1947
1922
  f: (s: S, a: A) => Effect.Effect<readonly [S, A2], E2, R2>
1948
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1949
- <R, E, A, S, A2, E2, R2>(
1923
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
1924
+ <A, E, R, S, A2, E2, R2>(
1950
1925
  self: Stream<A, E, R>,
1951
1926
  s: S,
1952
1927
  f: (s: S, a: A) => Effect.Effect<readonly [S, A2], E2, R2>
@@ -1964,7 +1939,7 @@ export const mapBoth: {
1964
1939
  <E, E2, A, A2>(
1965
1940
  options: { readonly onFailure: (e: E) => E2; readonly onSuccess: (a: A) => A2 }
1966
1941
  ): <R>(self: Stream<A, E, R>) => Stream<A2, E2, R>
1967
- <R, E, E2, A, A2>(
1942
+ <A, E, R, E2, A2>(
1968
1943
  self: Stream<A, E, R>,
1969
1944
  options: { readonly onFailure: (e: E) => E2; readonly onSuccess: (a: A) => A2 }
1970
1945
  ): Stream<A2, E2, R>
@@ -1978,7 +1953,7 @@ export const mapBoth: {
1978
1953
  */
1979
1954
  export const mapChunks: {
1980
1955
  <A, B>(f: (chunk: Chunk.Chunk<A>) => Chunk.Chunk<B>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
1981
- <R, E, A, B>(self: Stream<A, E, R>, f: (chunk: Chunk.Chunk<A>) => Chunk.Chunk<B>): Stream<B, E, R>
1956
+ <A, E, R, B>(self: Stream<A, E, R>, f: (chunk: Chunk.Chunk<A>) => Chunk.Chunk<B>): Stream<B, E, R>
1982
1957
  } = internal.mapChunks
1983
1958
 
1984
1959
  /**
@@ -1988,10 +1963,10 @@ export const mapChunks: {
1988
1963
  * @category mapping
1989
1964
  */
1990
1965
  export const mapChunksEffect: {
1991
- <A, R2, E2, B>(
1966
+ <A, B, E2, R2>(
1992
1967
  f: (chunk: Chunk.Chunk<A>) => Effect.Effect<Chunk.Chunk<B>, E2, R2>
1993
- ): <R, E>(self: Stream<A, E, R>) => Stream<B, E2 | E, R2 | R>
1994
- <R, E, A, R2, E2, B>(
1968
+ ): <E, R>(self: Stream<A, E, R>) => Stream<B, E2 | E, R2 | R>
1969
+ <A, E, R, B, E2, R2>(
1995
1970
  self: Stream<A, E, R>,
1996
1971
  f: (chunk: Chunk.Chunk<A>) => Effect.Effect<Chunk.Chunk<B>, E2, R2>
1997
1972
  ): Stream<B, E | E2, R | R2>
@@ -2005,8 +1980,8 @@ export const mapChunksEffect: {
2005
1980
  * @category mapping
2006
1981
  */
2007
1982
  export const mapConcat: {
2008
- <A, A2>(f: (a: A) => Iterable<A2>): <R, E>(self: Stream<A, E, R>) => Stream<A2, E, R>
2009
- <R, E, A, A2>(self: Stream<A, E, R>, f: (a: A) => Iterable<A2>): Stream<A2, E, R>
1983
+ <A, A2>(f: (a: A) => Iterable<A2>): <E, R>(self: Stream<A, E, R>) => Stream<A2, E, R>
1984
+ <A, E, R, A2>(self: Stream<A, E, R>, f: (a: A) => Iterable<A2>): Stream<A2, E, R>
2010
1985
  } = internal.mapConcat
2011
1986
 
2012
1987
  /**
@@ -2017,8 +1992,8 @@ export const mapConcat: {
2017
1992
  * @category mapping
2018
1993
  */
2019
1994
  export const mapConcatChunk: {
2020
- <A, A2>(f: (a: A) => Chunk.Chunk<A2>): <R, E>(self: Stream<A, E, R>) => Stream<A2, E, R>
2021
- <R, E, A, A2>(self: Stream<A, E, R>, f: (a: A) => Chunk.Chunk<A2>): Stream<A2, E, R>
1995
+ <A, A2>(f: (a: A) => Chunk.Chunk<A2>): <E, R>(self: Stream<A, E, R>) => Stream<A2, E, R>
1996
+ <A, E, R, A2>(self: Stream<A, E, R>, f: (a: A) => Chunk.Chunk<A2>): Stream<A2, E, R>
2022
1997
  } = internal.mapConcatChunk
2023
1998
 
2024
1999
  /**
@@ -2029,10 +2004,10 @@ export const mapConcatChunk: {
2029
2004
  * @category mapping
2030
2005
  */
2031
2006
  export const mapConcatChunkEffect: {
2032
- <A, R2, E2, A2>(
2007
+ <A, A2, E2, R2>(
2033
2008
  f: (a: A) => Effect.Effect<Chunk.Chunk<A2>, E2, R2>
2034
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2035
- <R, E, A, R2, E2, A2>(
2009
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2010
+ <A, E, R, A2, E2, R2>(
2036
2011
  self: Stream<A, E, R>,
2037
2012
  f: (a: A) => Effect.Effect<Chunk.Chunk<A2>, E2, R2>
2038
2013
  ): Stream<A2, E | E2, R | R2>
@@ -2046,10 +2021,10 @@ export const mapConcatChunkEffect: {
2046
2021
  * @category mapping
2047
2022
  */
2048
2023
  export const mapConcatEffect: {
2049
- <A, R2, E2, A2>(
2024
+ <A, A2, E2, R2>(
2050
2025
  f: (a: A) => Effect.Effect<Iterable<A2>, E2, R2>
2051
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2052
- <R, E, A, R2, E2, A2>(
2026
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2027
+ <A, E, R, A2, E2, R2>(
2053
2028
  self: Stream<A, E, R>,
2054
2029
  f: (a: A) => Effect.Effect<Iterable<A2>, E2, R2>
2055
2030
  ): Stream<A2, E | E2, R | R2>
@@ -2062,24 +2037,24 @@ export const mapConcatEffect: {
2062
2037
  * @category mapping
2063
2038
  */
2064
2039
  export const mapEffect: {
2065
- <A, R2, E2, A2>(
2040
+ <A, A2, E2, R2>(
2066
2041
  f: (a: A) => Effect.Effect<A2, E2, R2>,
2067
2042
  options?:
2068
2043
  | { readonly concurrency?: number | "unbounded" | undefined; readonly unordered?: boolean | undefined }
2069
2044
  | undefined
2070
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2071
- <A, R2, E2, A2, K>(
2045
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2046
+ <A, A2, E2, R2, K>(
2072
2047
  f: (a: A) => Effect.Effect<A2, E2, R2>,
2073
2048
  options: { readonly key: (a: A) => K; readonly bufferSize?: number | undefined }
2074
- ): <R, E>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2075
- <R, E, A, R2, E2, A2>(
2049
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2050
+ <A, E, R, A2, E2, R2>(
2076
2051
  self: Stream<A, E, R>,
2077
2052
  f: (a: A) => Effect.Effect<A2, E2, R2>,
2078
2053
  options?:
2079
2054
  | { readonly concurrency?: number | "unbounded" | undefined; readonly unordered?: boolean | undefined }
2080
2055
  | undefined
2081
2056
  ): Stream<A2, E | E2, R | R2>
2082
- <R, E, A, R2, E2, A2, K>(
2057
+ <A, E, R, A2, E2, R2, K>(
2083
2058
  self: Stream<A, E, R>,
2084
2059
  f: (a: A) => Effect.Effect<A2, E2, R2>,
2085
2060
  options: { readonly key: (a: A) => K; readonly bufferSize?: number | undefined }
@@ -2093,8 +2068,8 @@ export const mapEffect: {
2093
2068
  * @category mapping
2094
2069
  */
2095
2070
  export const mapError: {
2096
- <E, E2>(f: (error: E) => E2): <R, A>(self: Stream<A, E, R>) => Stream<A, E2, R>
2097
- <R, A, E, E2>(self: Stream<A, E, R>, f: (error: E) => E2): Stream<A, E2, R>
2071
+ <E, E2>(f: (error: E) => E2): <A, R>(self: Stream<A, E, R>) => Stream<A, E2, R>
2072
+ <A, E, R, E2>(self: Stream<A, E, R>, f: (error: E) => E2): Stream<A, E2, R>
2098
2073
  } = internal.mapError
2099
2074
 
2100
2075
  /**
@@ -2104,8 +2079,8 @@ export const mapError: {
2104
2079
  * @category mapping
2105
2080
  */
2106
2081
  export const mapErrorCause: {
2107
- <E, E2>(f: (cause: Cause.Cause<E>) => Cause.Cause<E2>): <R, A>(self: Stream<A, E, R>) => Stream<A, E2, R>
2108
- <R, A, E, E2>(self: Stream<A, E, R>, f: (cause: Cause.Cause<E>) => Cause.Cause<E2>): Stream<A, E2, R>
2082
+ <E, E2>(f: (cause: Cause.Cause<E>) => Cause.Cause<E2>): <A, R>(self: Stream<A, E, R>) => Stream<A, E2, R>
2083
+ <A, E, R, E2>(self: Stream<A, E, R>, f: (cause: Cause.Cause<E>) => Cause.Cause<E2>): Stream<A, E2, R>
2109
2084
  } = internal.mapErrorCause
2110
2085
 
2111
2086
  /**
@@ -2118,11 +2093,11 @@ export const mapErrorCause: {
2118
2093
  * @category utils
2119
2094
  */
2120
2095
  export const merge: {
2121
- <R2, E2, A2>(
2096
+ <A2, E2, R2>(
2122
2097
  that: Stream<A2, E2, R2>,
2123
2098
  options?: { readonly haltStrategy?: HaltStrategy.HaltStrategyInput | undefined } | undefined
2124
2099
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
2125
- <R, E, A, R2, E2, A2>(
2100
+ <A, E, R, A2, E2, R2>(
2126
2101
  self: Stream<A, E, R>,
2127
2102
  that: Stream<A2, E2, R2>,
2128
2103
  options?: { readonly haltStrategy?: HaltStrategy.HaltStrategyInput | undefined } | undefined
@@ -2164,15 +2139,15 @@ export const mergeAll: {
2164
2139
  * @category utils
2165
2140
  */
2166
2141
  export const mergeWith: {
2167
- <R2, E2, A2, A, A3, A4>(
2142
+ <A2, E2, R2, A, A3, A4>(
2168
2143
  other: Stream<A2, E2, R2>,
2169
2144
  options: {
2170
2145
  readonly onSelf: (a: A) => A3
2171
2146
  readonly onOther: (a2: A2) => A4
2172
2147
  readonly haltStrategy?: HaltStrategy.HaltStrategyInput | undefined
2173
2148
  }
2174
- ): <R, E>(self: Stream<A, E, R>) => Stream<A3 | A4, E2 | E, R2 | R>
2175
- <R, E, R2, E2, A2, A, A3, A4>(
2149
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A3 | A4, E2 | E, R2 | R>
2150
+ <A, E, R, A2, E2, R2, A3, A4>(
2176
2151
  self: Stream<A, E, R>,
2177
2152
  other: Stream<A2, E2, R2>,
2178
2153
  options: {
@@ -2191,10 +2166,10 @@ export const mergeWith: {
2191
2166
  * @category utils
2192
2167
  */
2193
2168
  export const mergeEither: {
2194
- <R2, E2, A2>(
2169
+ <A2, E2, R2>(
2195
2170
  that: Stream<A2, E2, R2>
2196
- ): <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A, A2>, E2 | E, R2 | R>
2197
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<Either.Either<A, A2>, E | E2, R | R2>
2171
+ ): <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A2, A>, E2 | E, R2 | R>
2172
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<Either.Either<A2, A>, E | E2, R | R2>
2198
2173
  } = internal.mergeEither
2199
2174
 
2200
2175
  /**
@@ -2205,8 +2180,8 @@ export const mergeEither: {
2205
2180
  * @category utils
2206
2181
  */
2207
2182
  export const mergeLeft: {
2208
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
2209
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
2183
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
2184
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
2210
2185
  } = internal.mergeLeft
2211
2186
 
2212
2187
  /**
@@ -2217,8 +2192,8 @@ export const mergeLeft: {
2217
2192
  * @category utils
2218
2193
  */
2219
2194
  export const mergeRight: {
2220
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2221
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A2, E | E2, R | R2>
2195
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
2196
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A2, E | E2, R | R2>
2222
2197
  } = internal.mergeRight
2223
2198
 
2224
2199
  /**
@@ -2228,7 +2203,7 @@ export const mergeRight: {
2228
2203
  * @since 2.0.0
2229
2204
  * @category utils
2230
2205
  */
2231
- export const mkString: <R, E>(self: Stream<string, E, R>) => Effect.Effect<string, E, R> = internal.mkString
2206
+ export const mkString: <E, R>(self: Stream<string, E, R>) => Effect.Effect<string, E, R> = internal.mkString
2232
2207
 
2233
2208
  /**
2234
2209
  * The stream that never produces any value or fails with any error.
@@ -2249,12 +2224,12 @@ export const never: Stream<never> = internal.never
2249
2224
  * @category utils
2250
2225
  */
2251
2226
  export const onError: {
2252
- <E, R2, _>(
2253
- cleanup: (cause: Cause.Cause<E>) => Effect.Effect<_, never, R2>
2254
- ): <R, A>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2255
- <R, A, E, R2, _>(
2227
+ <E, X, R2>(
2228
+ cleanup: (cause: Cause.Cause<E>) => Effect.Effect<X, never, R2>
2229
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2230
+ <A, E, R, X, R2>(
2256
2231
  self: Stream<A, E, R>,
2257
- cleanup: (cause: Cause.Cause<E>) => Effect.Effect<_, never, R2>
2232
+ cleanup: (cause: Cause.Cause<E>) => Effect.Effect<X, never, R2>
2258
2233
  ): Stream<A, E, R | R2>
2259
2234
  } = internal.onError
2260
2235
 
@@ -2265,8 +2240,8 @@ export const onError: {
2265
2240
  * @category utils
2266
2241
  */
2267
2242
  export const onDone: {
2268
- <R2, _>(cleanup: () => Effect.Effect<_, never, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2269
- <R, E, A, R2, _>(self: Stream<A, E, R>, cleanup: () => Effect.Effect<_, never, R2>): Stream<A, E, R | R2>
2243
+ <X, R2>(cleanup: () => Effect.Effect<X, never, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2244
+ <A, E, R, X, R2>(self: Stream<A, E, R>, cleanup: () => Effect.Effect<X, never, R2>): Stream<A, E, R | R2>
2270
2245
  } = internal.onDone
2271
2246
 
2272
2247
  /**
@@ -2286,8 +2261,8 @@ export const orDie: <A, E, R>(self: Stream<A, E, R>) => Stream<A, never, R> = in
2286
2261
  * @category error handling
2287
2262
  */
2288
2263
  export const orDieWith: {
2289
- <E>(f: (e: E) => unknown): <R, A>(self: Stream<A, E, R>) => Stream<A, never, R>
2290
- <R, A, E>(self: Stream<A, E, R>, f: (e: E) => unknown): Stream<A, never, R>
2264
+ <E>(f: (e: E) => unknown): <A, R>(self: Stream<A, E, R>) => Stream<A, never, R>
2265
+ <A, E, R>(self: Stream<A, E, R>, f: (e: E) => unknown): Stream<A, never, R>
2291
2266
  } = internal.orDieWith
2292
2267
 
2293
2268
  /**
@@ -2299,8 +2274,8 @@ export const orDieWith: {
2299
2274
  * @category error handling
2300
2275
  */
2301
2276
  export const orElse: {
2302
- <R2, E2, A2>(that: LazyArg<Stream<A2, E2, R2>>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2, R2 | R>
2303
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: LazyArg<Stream<A2, E2, R2>>): Stream<A | A2, E2, R | R2>
2277
+ <A2, E2, R2>(that: LazyArg<Stream<A2, E2, R2>>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2, R2 | R>
2278
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: LazyArg<Stream<A2, E2, R2>>): Stream<A | A2, E2, R | R2>
2304
2279
  } = internal.orElse
2305
2280
 
2306
2281
  /**
@@ -2312,13 +2287,13 @@ export const orElse: {
2312
2287
  * @category error handling
2313
2288
  */
2314
2289
  export const orElseEither: {
2315
- <R2, E2, A2>(
2290
+ <A2, E2, R2>(
2316
2291
  that: LazyArg<Stream<A2, E2, R2>>
2317
- ): <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A, A2>, E2, R2 | R>
2318
- <R, E, A, R2, E2, A2>(
2292
+ ): <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A2, A>, E2, R2 | R>
2293
+ <A, E, R, A2, E2, R2>(
2319
2294
  self: Stream<A, E, R>,
2320
2295
  that: LazyArg<Stream<A2, E2, R2>>
2321
- ): Stream<Either.Either<A, A2>, E2, R | R2>
2296
+ ): Stream<Either.Either<A2, A>, E2, R | R2>
2322
2297
  } = internal.orElseEither
2323
2298
 
2324
2299
  /**
@@ -2331,7 +2306,7 @@ export const orElseEither: {
2331
2306
  */
2332
2307
  export const orElseFail: {
2333
2308
  <E2>(error: LazyArg<E2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2, R>
2334
- <R, E, A, E2>(self: Stream<A, E, R>, error: LazyArg<E2>): Stream<A, E2, R>
2309
+ <A, E, R, E2>(self: Stream<A, E, R>, error: LazyArg<E2>): Stream<A, E2, R>
2335
2310
  } = internal.orElseFail
2336
2311
 
2337
2312
  /**
@@ -2342,7 +2317,7 @@ export const orElseFail: {
2342
2317
  */
2343
2318
  export const orElseIfEmpty: {
2344
2319
  <A2>(element: LazyArg<A2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E, R>
2345
- <R, E, A, A2>(self: Stream<A, E, R>, element: LazyArg<A2>): Stream<A | A2, E, R>
2320
+ <A, E, R, A2>(self: Stream<A, E, R>, element: LazyArg<A2>): Stream<A | A2, E, R>
2346
2321
  } = internal.orElseIfEmpty
2347
2322
 
2348
2323
  /**
@@ -2353,7 +2328,7 @@ export const orElseIfEmpty: {
2353
2328
  */
2354
2329
  export const orElseIfEmptyChunk: {
2355
2330
  <A2>(chunk: LazyArg<Chunk.Chunk<A2>>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E, R>
2356
- <R, E, A, A2>(self: Stream<A, E, R>, chunk: LazyArg<Chunk.Chunk<A2>>): Stream<A | A2, E, R>
2331
+ <A, E, R, A2>(self: Stream<A, E, R>, chunk: LazyArg<Chunk.Chunk<A2>>): Stream<A | A2, E, R>
2357
2332
  } = internal.orElseIfEmptyChunk
2358
2333
 
2359
2334
  /**
@@ -2363,8 +2338,8 @@ export const orElseIfEmptyChunk: {
2363
2338
  * @category error handling
2364
2339
  */
2365
2340
  export const orElseIfEmptyStream: {
2366
- <R2, E2, A2>(stream: LazyArg<Stream<A2, E2, R2>>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
2367
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, stream: LazyArg<Stream<A2, E2, R2>>): Stream<A | A2, E | E2, R | R2>
2341
+ <A2, E2, R2>(stream: LazyArg<Stream<A2, E2, R2>>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
2342
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, stream: LazyArg<Stream<A2, E2, R2>>): Stream<A | A2, E | E2, R | R2>
2368
2343
  } = internal.orElseIfEmptyStream
2369
2344
 
2370
2345
  /**
@@ -2375,7 +2350,7 @@ export const orElseIfEmptyStream: {
2375
2350
  */
2376
2351
  export const orElseSucceed: {
2377
2352
  <A2>(value: LazyArg<A2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, never, R>
2378
- <R, E, A, A2>(self: Stream<A, E, R>, value: LazyArg<A2>): Stream<A | A2, never, R>
2353
+ <A, E, R, A2>(self: Stream<A, E, R>, value: LazyArg<A2>): Stream<A | A2, never, R>
2379
2354
  } = internal.orElseSucceed
2380
2355
 
2381
2356
  /**
@@ -2409,7 +2384,7 @@ export const paginateChunk: <S, A>(
2409
2384
  * @since 2.0.0
2410
2385
  * @category constructors
2411
2386
  */
2412
- export const paginateChunkEffect: <S, R, E, A>(
2387
+ export const paginateChunkEffect: <S, A, E, R>(
2413
2388
  s: S,
2414
2389
  f: (s: S) => Effect.Effect<readonly [Chunk.Chunk<A>, Option.Option<S>], E, R>
2415
2390
  ) => Stream<A, E, R> = internal.paginateChunkEffect
@@ -2422,7 +2397,7 @@ export const paginateChunkEffect: <S, R, E, A>(
2422
2397
  * @since 2.0.0
2423
2398
  * @category constructors
2424
2399
  */
2425
- export const paginateEffect: <S, R, E, A>(
2400
+ export const paginateEffect: <S, A, E, R>(
2426
2401
  s: S,
2427
2402
  f: (s: S) => Effect.Effect<readonly [A, Option.Option<S>], E, R>
2428
2403
  ) => Stream<A, E, R> = internal.paginateEffect
@@ -2440,25 +2415,25 @@ export const partition: {
2440
2415
  <C extends A, B extends A, A = C>(
2441
2416
  refinement: Refinement<NoInfer<A>, B>,
2442
2417
  options?: { bufferSize?: number | undefined } | undefined
2443
- ): <R, E>(
2418
+ ): <E, R>(
2444
2419
  self: Stream<C, E, R>
2445
- ) => Effect.Effect<[excluded: Stream<Exclude<C, B>, E>, satisfying: Stream<B, E>], E, Scope.Scope | R>
2420
+ ) => Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>
2446
2421
  <A>(
2447
2422
  predicate: Predicate<A>,
2448
2423
  options?: { bufferSize?: number | undefined } | undefined
2449
- ): <R, E>(
2424
+ ): <E, R>(
2450
2425
  self: Stream<A, E, R>
2451
- ) => Effect.Effect<[excluded: Stream<A, E>, satisfying: Stream<A, E>], E, Scope.Scope | R>
2452
- <R, E, C extends A, B extends A, A = C>(
2426
+ ) => Effect.Effect<[excluded: Stream<A, E, never>, satisfying: Stream<A, E, never>], E, Scope.Scope | R>
2427
+ <C extends A, E, R, B extends A, A = C>(
2453
2428
  self: Stream<C, E, R>,
2454
2429
  refinement: Refinement<A, B>,
2455
2430
  options?: { bufferSize?: number | undefined } | undefined
2456
- ): Effect.Effect<[excluded: Stream<Exclude<C, B>, E>, satisfying: Stream<B, E>], E, Scope.Scope | R>
2431
+ ): Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>
2457
2432
  <A, E, R>(
2458
2433
  self: Stream<A, E, R>,
2459
2434
  predicate: Predicate<A>,
2460
2435
  options?: { bufferSize?: number | undefined } | undefined
2461
- ): Effect.Effect<[excluded: Stream<A, E>, satisfying: Stream<A, E>], E, Scope.Scope | R>
2436
+ ): Effect.Effect<[excluded: Stream<A, E, never>, satisfying: Stream<A, E, never>], E, R | Scope.Scope>
2462
2437
  } = internal.partition
2463
2438
 
2464
2439
  /**
@@ -2469,17 +2444,17 @@ export const partition: {
2469
2444
  * @category utils
2470
2445
  */
2471
2446
  export const partitionEither: {
2472
- <A, R2, E2, A2, A3>(
2473
- predicate: (a: NoInfer<A>) => Effect.Effect<Either.Either<A2, A3>, E2, R2>,
2447
+ <A, A3, A2, E2, R2>(
2448
+ predicate: (a: NoInfer<A>) => Effect.Effect<Either.Either<A3, A2>, E2, R2>,
2474
2449
  options?: { readonly bufferSize?: number | undefined } | undefined
2475
- ): <R, E>(
2450
+ ): <E, R>(
2476
2451
  self: Stream<A, E, R>
2477
- ) => Effect.Effect<[left: Stream<A2, E2 | E>, right: Stream<A3, E2 | E>], E2 | E, Scope.Scope | R2 | R>
2478
- <R, E, A, R2, E2, A2, A3>(
2452
+ ) => Effect.Effect<[left: Stream<A2, E2 | E, never>, right: Stream<A3, E2 | E, never>], E2 | E, Scope.Scope | R2 | R>
2453
+ <A, E, R, A3, A2, E2, R2>(
2479
2454
  self: Stream<A, E, R>,
2480
- predicate: (a: A) => Effect.Effect<Either.Either<A2, A3>, E2, R2>,
2455
+ predicate: (a: A) => Effect.Effect<Either.Either<A3, A2>, E2, R2>,
2481
2456
  options?: { readonly bufferSize?: number | undefined } | undefined
2482
- ): Effect.Effect<[left: Stream<A2, E | E2>, right: Stream<A3, E | E2>], E | E2, Scope.Scope | R | R2>
2457
+ ): Effect.Effect<[left: Stream<A2, E | E2, never>, right: Stream<A3, E | E2, never>], E | E2, Scope.Scope | R | R2>
2483
2458
  } = internal.partitionEither
2484
2459
 
2485
2460
  /**
@@ -2555,7 +2530,7 @@ export const pipeThroughChannelOrFail: {
2555
2530
  */
2556
2531
  export const prepend: {
2557
2532
  <B>(values: Chunk.Chunk<B>): <A, E, R>(self: Stream<A, E, R>) => Stream<B | A, E, R>
2558
- <R, E, A, B>(self: Stream<A, E, R>, values: Chunk.Chunk<B>): Stream<A | B, E, R>
2533
+ <A, E, R, B>(self: Stream<A, E, R>, values: Chunk.Chunk<B>): Stream<A | B, E, R>
2559
2534
  } = internal.prepend
2560
2535
 
2561
2536
  /**
@@ -2593,7 +2568,7 @@ export const provideService: {
2593
2568
  tag: T,
2594
2569
  resource: Context.Tag.Service<T>
2595
2570
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, Exclude<R, Context.Tag.Identifier<T>>>
2596
- <R, E, A, T extends Context.Tag<any, any>>(
2571
+ <A, E, R, T extends Context.Tag<any, any>>(
2597
2572
  self: Stream<A, E, R>,
2598
2573
  tag: T,
2599
2574
  resource: Context.Tag.Service<T>
@@ -2608,11 +2583,11 @@ export const provideService: {
2608
2583
  * @category context
2609
2584
  */
2610
2585
  export const provideServiceEffect: {
2611
- <T extends Context.Tag<any, any>, R2, E2>(
2586
+ <T extends Context.Tag<any, any>, E2, R2>(
2612
2587
  tag: T,
2613
2588
  effect: Effect.Effect<Context.Tag.Service<T>, E2, R2>
2614
2589
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | Exclude<R, Context.Tag.Identifier<T>>>
2615
- <R, E, A, T extends Context.Tag<any, any>, R2, E2>(
2590
+ <A, E, R, T extends Context.Tag<any, any>, E2, R2>(
2616
2591
  self: Stream<A, E, R>,
2617
2592
  tag: T,
2618
2593
  effect: Effect.Effect<Context.Tag.Service<T>, E2, R2>
@@ -2627,11 +2602,11 @@ export const provideServiceEffect: {
2627
2602
  * @category context
2628
2603
  */
2629
2604
  export const provideServiceStream: {
2630
- <T extends Context.Tag<any, any>, R2, E2>(
2605
+ <T extends Context.Tag<any, any>, E2, R2>(
2631
2606
  tag: T,
2632
2607
  stream: Stream<Context.Tag.Service<T>, E2, R2>
2633
2608
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | Exclude<R, Context.Tag.Identifier<T>>>
2634
- <R, E, A, T extends Context.Tag<any, any>, R2, E2>(
2609
+ <A, E, R, T extends Context.Tag<any, any>, E2, R2>(
2635
2610
  self: Stream<A, E, R>,
2636
2611
  tag: T,
2637
2612
  stream: Stream<Context.Tag.Service<T>, E2, R2>
@@ -2661,7 +2636,7 @@ export const provideSomeLayer: {
2661
2636
  <RIn, E2, ROut>(
2662
2637
  layer: Layer.Layer<ROut, E2, RIn>
2663
2638
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, RIn | Exclude<R, ROut>>
2664
- <R, E, A, RIn, E2, ROut>(
2639
+ <A, E, R, RIn, E2, ROut>(
2665
2640
  self: Stream<A, E, R>,
2666
2641
  layer: Layer.Layer<ROut, E2, RIn>
2667
2642
  ): Stream<A, E | E2, RIn | Exclude<R, ROut>>
@@ -2694,8 +2669,8 @@ export const rechunk: {
2694
2669
  * @category error handling
2695
2670
  */
2696
2671
  export const refineOrDie: {
2697
- <E, E2>(pf: (error: E) => Option.Option<E2>): <R, A>(self: Stream<A, E, R>) => Stream<A, E2, R>
2698
- <R, A, E, E2>(self: Stream<A, E, R>, pf: (error: E) => Option.Option<E2>): Stream<A, E2, R>
2672
+ <E, E2>(pf: (error: E) => Option.Option<E2>): <A, R>(self: Stream<A, E, R>) => Stream<A, E2, R>
2673
+ <A, E, R, E2>(self: Stream<A, E, R>, pf: (error: E) => Option.Option<E2>): Stream<A, E2, R>
2699
2674
  } = internal.refineOrDie
2700
2675
 
2701
2676
  /**
@@ -2709,8 +2684,8 @@ export const refineOrDieWith: {
2709
2684
  <E, E2>(
2710
2685
  pf: (error: E) => Option.Option<E2>,
2711
2686
  f: (error: E) => unknown
2712
- ): <R, A>(self: Stream<A, E, R>) => Stream<A, E2, R>
2713
- <R, A, E, E2>(self: Stream<A, E, R>, pf: (error: E) => Option.Option<E2>, f: (error: E) => unknown): Stream<A, E2, R>
2687
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A, E2, R>
2688
+ <A, E, R, E2>(self: Stream<A, E, R>, pf: (error: E) => Option.Option<E2>, f: (error: E) => unknown): Stream<A, E2, R>
2714
2689
  } = internal.refineOrDieWith
2715
2690
 
2716
2691
  /**
@@ -2721,8 +2696,8 @@ export const refineOrDieWith: {
2721
2696
  * @category utils
2722
2697
  */
2723
2698
  export const repeat: {
2724
- <R2, B>(schedule: Schedule.Schedule<R2, unknown, B>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2725
- <R, E, A, R2, B>(self: Stream<A, E, R>, schedule: Schedule.Schedule<R2, unknown, B>): Stream<A, E, R | R2>
2699
+ <B, R2>(schedule: Schedule.Schedule<B, unknown, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2700
+ <A, E, R, B, R2>(self: Stream<A, E, R>, schedule: Schedule.Schedule<B, unknown, R2>): Stream<A, E, R | R2>
2726
2701
  } = internal.repeat
2727
2702
 
2728
2703
  /**
@@ -2772,9 +2747,9 @@ export const repeatEffectOption: <A, E, R>(effect: Effect.Effect<A, Option.Optio
2772
2747
  * @since 2.0.0
2773
2748
  * @category constructors
2774
2749
  */
2775
- export const repeatEffectWithSchedule: <R, E, A, A0 extends A, R2, _>(
2750
+ export const repeatEffectWithSchedule: <A, E, R, X, A0 extends A, R2>(
2776
2751
  effect: Effect.Effect<A, E, R>,
2777
- schedule: Schedule.Schedule<R2, A0, _>
2752
+ schedule: Schedule.Schedule<X, A0, R2>
2778
2753
  ) => Stream<A, E, R | R2> = internal.repeatEffectWithSchedule
2779
2754
 
2780
2755
  /**
@@ -2786,13 +2761,13 @@ export const repeatEffectWithSchedule: <R, E, A, A0 extends A, R2, _>(
2786
2761
  * @category utils
2787
2762
  */
2788
2763
  export const repeatEither: {
2789
- <R2, B>(
2790
- schedule: Schedule.Schedule<R2, unknown, B>
2791
- ): <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<B, A>, E, R2 | R>
2792
- <R, E, A, R2, B>(
2764
+ <B, R2>(
2765
+ schedule: Schedule.Schedule<B, unknown, R2>
2766
+ ): <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A, B>, E, R2 | R>
2767
+ <A, E, R, B, R2>(
2793
2768
  self: Stream<A, E, R>,
2794
- schedule: Schedule.Schedule<R2, unknown, B>
2795
- ): Stream<Either.Either<B, A>, E, R | R2>
2769
+ schedule: Schedule.Schedule<B, unknown, R2>
2770
+ ): Stream<Either.Either<A, B>, E, R | R2>
2796
2771
  } = internal.repeatEither
2797
2772
 
2798
2773
  /**
@@ -2806,8 +2781,8 @@ export const repeatEither: {
2806
2781
  * @category utils
2807
2782
  */
2808
2783
  export const repeatElements: {
2809
- <R2, B>(schedule: Schedule.Schedule<R2, unknown, B>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2810
- <R, E, A, R2, B>(self: Stream<A, E, R>, schedule: Schedule.Schedule<R2, unknown, B>): Stream<A, E, R | R2>
2784
+ <B, R2>(schedule: Schedule.Schedule<B, unknown, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2785
+ <A, E, R, B, R2>(self: Stream<A, E, R>, schedule: Schedule.Schedule<B, unknown, R2>): Stream<A, E, R | R2>
2811
2786
  } = internal.repeatElements
2812
2787
 
2813
2788
  /**
@@ -2826,13 +2801,13 @@ export const repeatElements: {
2826
2801
  * @category utils
2827
2802
  */
2828
2803
  export const repeatElementsWith: {
2829
- <R2, B, A, C>(
2830
- schedule: Schedule.Schedule<R2, unknown, B>,
2804
+ <B, R2, A, C>(
2805
+ schedule: Schedule.Schedule<B, unknown, R2>,
2831
2806
  options: { readonly onElement: (a: A) => C; readonly onSchedule: (b: B) => C }
2832
- ): <R, E>(self: Stream<A, E, R>) => Stream<C, E, R2 | R>
2833
- <R, E, R2, B, A, C>(
2807
+ ): <E, R>(self: Stream<A, E, R>) => Stream<C, E, R2 | R>
2808
+ <A, E, R, B, R2, C>(
2834
2809
  self: Stream<A, E, R>,
2835
- schedule: Schedule.Schedule<R2, unknown, B>,
2810
+ schedule: Schedule.Schedule<B, unknown, R2>,
2836
2811
  options: { readonly onElement: (a: A) => C; readonly onSchedule: (b: B) => C }
2837
2812
  ): Stream<C, E, R | R2>
2838
2813
  } = internal.repeatElementsWith
@@ -2855,13 +2830,13 @@ export const repeatValue: <A>(value: A) => Stream<A> = internal.repeatValue
2855
2830
  * @category utils
2856
2831
  */
2857
2832
  export const repeatWith: {
2858
- <R2, B, A, C>(
2859
- schedule: Schedule.Schedule<R2, unknown, B>,
2833
+ <B, R2, A, C>(
2834
+ schedule: Schedule.Schedule<B, unknown, R2>,
2860
2835
  options: { readonly onElement: (a: A) => C; readonly onSchedule: (b: B) => C }
2861
- ): <R, E>(self: Stream<A, E, R>) => Stream<C, E, R2 | R>
2862
- <R, E, R2, B, A, C>(
2836
+ ): <E, R>(self: Stream<A, E, R>) => Stream<C, E, R2 | R>
2837
+ <A, E, R, B, R2, C>(
2863
2838
  self: Stream<A, E, R>,
2864
- schedule: Schedule.Schedule<R2, unknown, B>,
2839
+ schedule: Schedule.Schedule<B, unknown, R2>,
2865
2840
  options: { readonly onElement: (a: A) => C; readonly onSchedule: (b: B) => C }
2866
2841
  ): Stream<C, E, R | R2>
2867
2842
  } = internal.repeatWith
@@ -2880,10 +2855,10 @@ export const repeatWith: {
2880
2855
  * @category utils
2881
2856
  */
2882
2857
  export const retry: {
2883
- <R2, E, E0 extends E, _>(
2884
- schedule: Schedule.Schedule<R2, E0, _>
2885
- ): <R, A>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2886
- <R, A, R2, E, E0 extends E, _>(self: Stream<A, E, R>, schedule: Schedule.Schedule<R2, E0, _>): Stream<A, E, R | R2>
2858
+ <E0 extends E, R2, E, X>(
2859
+ schedule: Schedule.Schedule<X, E0, R2>
2860
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
2861
+ <A, E, R, X, E0 extends E, R2>(self: Stream<A, E, R>, schedule: Schedule.Schedule<X, E0, R2>): Stream<A, E, R | R2>
2887
2862
  } = internal.retry
2888
2863
 
2889
2864
  /**
@@ -2934,8 +2909,8 @@ export const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E
2934
2909
  * @category destructors
2935
2910
  */
2936
2911
  export const runFold: {
2937
- <S, A>(s: S, f: (s: S, a: A) => S): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>
2938
- <R, E, S, A>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, R>
2912
+ <S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>
2913
+ <A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, R>
2939
2914
  } = internal.runFold
2940
2915
 
2941
2916
  /**
@@ -2945,11 +2920,11 @@ export const runFold: {
2945
2920
  * @category destructors
2946
2921
  */
2947
2922
  export const runFoldEffect: {
2948
- <S, A, R2, E2>(
2923
+ <S, A, E2, R2>(
2949
2924
  s: S,
2950
2925
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
2951
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, R2 | R>
2952
- <R, E, S, A, R2, E2>(
2926
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, R2 | R>
2927
+ <A, E, R, S, E2, R2>(
2953
2928
  self: Stream<A, E, R>,
2954
2929
  s: S,
2955
2930
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
@@ -2964,8 +2939,8 @@ export const runFoldEffect: {
2964
2939
  * @category destructors
2965
2940
  */
2966
2941
  export const runFoldScoped: {
2967
- <S, A>(s: S, f: (s: S, a: A) => S): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E, Scope.Scope | R>
2968
- <R, E, S, A>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, Scope.Scope | R>
2942
+ <S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, Scope.Scope | R>
2943
+ <A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, Scope.Scope | R>
2969
2944
  } = internal.runFoldScoped
2970
2945
 
2971
2946
  /**
@@ -2976,11 +2951,11 @@ export const runFoldScoped: {
2976
2951
  * @category destructors
2977
2952
  */
2978
2953
  export const runFoldScopedEffect: {
2979
- <S, A, R2, E2>(
2954
+ <S, A, E2, R2>(
2980
2955
  s: S,
2981
2956
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
2982
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, Scope.Scope | R2 | R>
2983
- <R, E, S, A, R2, E2>(
2957
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, Scope.Scope | R2 | R>
2958
+ <A, E, R, S, E2, R2>(
2984
2959
  self: Stream<A, E, R>,
2985
2960
  s: S,
2986
2961
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
@@ -2995,8 +2970,8 @@ export const runFoldScopedEffect: {
2995
2970
  * @category destructors
2996
2971
  */
2997
2972
  export const runFoldWhile: {
2998
- <S, A>(s: S, cont: Predicate<S>, f: (s: S, a: A) => S): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>
2999
- <R, E, S, A>(self: Stream<A, E, R>, s: S, cont: Predicate<S>, f: (s: S, a: A) => S): Effect.Effect<S, E, R>
2973
+ <S, A>(s: S, cont: Predicate<S>, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>
2974
+ <A, E, R, S>(self: Stream<A, E, R>, s: S, cont: Predicate<S>, f: (s: S, a: A) => S): Effect.Effect<S, E, R>
3000
2975
  } = internal.runFoldWhile
3001
2976
 
3002
2977
  /**
@@ -3007,12 +2982,12 @@ export const runFoldWhile: {
3007
2982
  * @category destructors
3008
2983
  */
3009
2984
  export const runFoldWhileEffect: {
3010
- <S, A, R2, E2>(
2985
+ <S, A, E2, R2>(
3011
2986
  s: S,
3012
2987
  cont: Predicate<S>,
3013
2988
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
3014
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, R2 | R>
3015
- <R, E, S, A, R2, E2>(
2989
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, R2 | R>
2990
+ <A, E, R, S, E2, R2>(
3016
2991
  self: Stream<A, E, R>,
3017
2992
  s: S,
3018
2993
  cont: Predicate<S>,
@@ -3033,8 +3008,8 @@ export const runFoldWhileScoped: {
3033
3008
  s: S,
3034
3009
  cont: Predicate<S>,
3035
3010
  f: (s: S, a: A) => S
3036
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E, Scope.Scope | R>
3037
- <R, E, S, A>(
3011
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, Scope.Scope | R>
3012
+ <A, E, R, S>(
3038
3013
  self: Stream<A, E, R>,
3039
3014
  s: S,
3040
3015
  cont: Predicate<S>,
@@ -3051,12 +3026,12 @@ export const runFoldWhileScoped: {
3051
3026
  * @category destructors
3052
3027
  */
3053
3028
  export const runFoldWhileScopedEffect: {
3054
- <S, A, R2, E2>(
3029
+ <S, A, E2, R2>(
3055
3030
  s: S,
3056
3031
  cont: Predicate<S>,
3057
3032
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
3058
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, Scope.Scope | R2 | R>
3059
- <R, E, S, A, R2, E2>(
3033
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E2 | E, R2 | R | Scope.Scope>
3034
+ <A, E, R, S, E2, R2>(
3060
3035
  self: Stream<A, E, R>,
3061
3036
  s: S,
3062
3037
  cont: Predicate<S>,
@@ -3072,12 +3047,12 @@ export const runFoldWhileScopedEffect: {
3072
3047
  * @category destructors
3073
3048
  */
3074
3049
  export const runForEach: {
3075
- <A, R2, E2, _>(
3076
- f: (a: A) => Effect.Effect<_, E2, R2>
3077
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, R2 | R>
3078
- <R, E, A, R2, E2, _>(
3050
+ <A, X, E2, R2>(
3051
+ f: (a: A) => Effect.Effect<X, E2, R2>
3052
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, R2 | R>
3053
+ <A, E, R, X, E2, R2>(
3079
3054
  self: Stream<A, E, R>,
3080
- f: (a: A) => Effect.Effect<_, E2, R2>
3055
+ f: (a: A) => Effect.Effect<X, E2, R2>
3081
3056
  ): Effect.Effect<void, E | E2, R | R2>
3082
3057
  } = internal.runForEach
3083
3058
 
@@ -3089,12 +3064,12 @@ export const runForEach: {
3089
3064
  * @category destructors
3090
3065
  */
3091
3066
  export const runForEachChunk: {
3092
- <A, R2, E2, _>(
3093
- f: (a: Chunk.Chunk<A>) => Effect.Effect<_, E2, R2>
3094
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, R2 | R>
3095
- <R, E, A, R2, E2, _>(
3067
+ <A, X, E2, R2>(
3068
+ f: (a: Chunk.Chunk<A>) => Effect.Effect<X, E2, R2>
3069
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, R2 | R>
3070
+ <A, E, R, X, E2, R2>(
3096
3071
  self: Stream<A, E, R>,
3097
- f: (a: Chunk.Chunk<A>) => Effect.Effect<_, E2, R2>
3072
+ f: (a: Chunk.Chunk<A>) => Effect.Effect<X, E2, R2>
3098
3073
  ): Effect.Effect<void, E | E2, R | R2>
3099
3074
  } = internal.runForEachChunk
3100
3075
 
@@ -3106,12 +3081,12 @@ export const runForEachChunk: {
3106
3081
  * @category destructors
3107
3082
  */
3108
3083
  export const runForEachChunkScoped: {
3109
- <A, R2, E2, _>(
3110
- f: (a: Chunk.Chunk<A>) => Effect.Effect<_, E2, R2>
3111
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, Scope.Scope | R2 | R>
3112
- <R, E, A, R2, E2, _>(
3084
+ <A, X, E2, R2>(
3085
+ f: (a: Chunk.Chunk<A>) => Effect.Effect<X, E2, R2>
3086
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, Scope.Scope | R2 | R>
3087
+ <A, E, R, X, E2, R2>(
3113
3088
  self: Stream<A, E, R>,
3114
- f: (a: Chunk.Chunk<A>) => Effect.Effect<_, E2, R2>
3089
+ f: (a: Chunk.Chunk<A>) => Effect.Effect<X, E2, R2>
3115
3090
  ): Effect.Effect<void, E | E2, Scope.Scope | R | R2>
3116
3091
  } = internal.runForEachChunkScoped
3117
3092
 
@@ -3123,12 +3098,12 @@ export const runForEachChunkScoped: {
3123
3098
  * @category destructors
3124
3099
  */
3125
3100
  export const runForEachScoped: {
3126
- <A, R2, E2, _>(
3127
- f: (a: A) => Effect.Effect<_, E2, R2>
3128
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, Scope.Scope | R2 | R>
3129
- <R, E, A, R2, E2, _>(
3101
+ <A, X, E2, R2>(
3102
+ f: (a: A) => Effect.Effect<X, E2, R2>
3103
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, Scope.Scope | R2 | R>
3104
+ <A, E, R, X, E2, R2>(
3130
3105
  self: Stream<A, E, R>,
3131
- f: (a: A) => Effect.Effect<_, E2, R2>
3106
+ f: (a: A) => Effect.Effect<X, E2, R2>
3132
3107
  ): Effect.Effect<void, E | E2, Scope.Scope | R | R2>
3133
3108
  } = internal.runForEachScoped
3134
3109
 
@@ -3140,10 +3115,10 @@ export const runForEachScoped: {
3140
3115
  * @category destructors
3141
3116
  */
3142
3117
  export const runForEachWhile: {
3143
- <A, R2, E2>(
3118
+ <A, E2, R2>(
3144
3119
  f: (a: A) => Effect.Effect<boolean, E2, R2>
3145
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, R2 | R>
3146
- <R, E, A, R2, E2>(
3120
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, R2 | R>
3121
+ <A, E, R, E2, R2>(
3147
3122
  self: Stream<A, E, R>,
3148
3123
  f: (a: A) => Effect.Effect<boolean, E2, R2>
3149
3124
  ): Effect.Effect<void, E | E2, R | R2>
@@ -3157,10 +3132,10 @@ export const runForEachWhile: {
3157
3132
  * @category destructors
3158
3133
  */
3159
3134
  export const runForEachWhileScoped: {
3160
- <A, R2, E2>(
3135
+ <A, E2, R2>(
3161
3136
  f: (a: A) => Effect.Effect<boolean, E2, R2>
3162
- ): <R, E>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, Scope.Scope | R2 | R>
3163
- <R, E, A, R2, E2>(
3137
+ ): <E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E2 | E, Scope.Scope | R2 | R>
3138
+ <A, E, R, E2, R2>(
3164
3139
  self: Stream<A, E, R>,
3165
3140
  f: (a: A) => Effect.Effect<boolean, E2, R2>
3166
3141
  ): Effect.Effect<void, E | E2, Scope.Scope | R | R2>
@@ -3273,7 +3248,7 @@ export const runScoped: {
3273
3248
  * @since 2.0.0
3274
3249
  * @category destructors
3275
3250
  */
3276
- export const runSum: <R, E>(self: Stream<number, E, R>) => Effect.Effect<number, E, R> = internal.runSum
3251
+ export const runSum: <E, R>(self: Stream<number, E, R>) => Effect.Effect<number, E, R> = internal.runSum
3277
3252
 
3278
3253
  /**
3279
3254
  * Statefully maps over the elements of this stream to produce all
@@ -3283,8 +3258,8 @@ export const runSum: <R, E>(self: Stream<number, E, R>) => Effect.Effect<number,
3283
3258
  * @category utils
3284
3259
  */
3285
3260
  export const scan: {
3286
- <S, A>(s: S, f: (s: S, a: A) => S): <R, E>(self: Stream<A, E, R>) => Stream<S, E, R>
3287
- <R, E, S, A>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Stream<S, E, R>
3261
+ <S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Stream<S, E, R>
3262
+ <A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Stream<S, E, R>
3288
3263
  } = internal.scan
3289
3264
 
3290
3265
  /**
@@ -3295,11 +3270,11 @@ export const scan: {
3295
3270
  * @category utils
3296
3271
  */
3297
3272
  export const scanEffect: {
3298
- <S, A, R2, E2>(
3273
+ <S, A, E2, R2>(
3299
3274
  s: S,
3300
3275
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
3301
- ): <R, E>(self: Stream<A, E, R>) => Stream<S, E2 | E, R2 | R>
3302
- <R, E, S, A, R2, E2>(
3276
+ ): <E, R>(self: Stream<A, E, R>) => Stream<S, E2 | E, R2 | R>
3277
+ <A, E, R, S, E2, R2>(
3303
3278
  self: Stream<A, E, R>,
3304
3279
  s: S,
3305
3280
  f: (s: S, a: A) => Effect.Effect<S, E2, R2>
@@ -3316,8 +3291,8 @@ export const scanEffect: {
3316
3291
  * @category utils
3317
3292
  */
3318
3293
  export const scanReduce: {
3319
- <A2, A>(f: (a2: A2 | A, a: A) => A2): <R, E>(self: Stream<A, E, R>) => Stream<A2 | A, E, R>
3320
- <R, E, A2, A>(self: Stream<A, E, R>, f: (a2: A2 | A, a: A) => A2): Stream<A2 | A, E, R>
3294
+ <A2, A>(f: (a2: A2 | A, a: A) => A2): <E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E, R>
3295
+ <A, E, R, A2>(self: Stream<A, E, R>, f: (a2: A | A2, a: A) => A2): Stream<A | A2, E, R>
3321
3296
  } = internal.scanReduce
3322
3297
 
3323
3298
  /**
@@ -3329,7 +3304,15 @@ export const scanReduce: {
3329
3304
  * @since 2.0.0
3330
3305
  * @category utils
3331
3306
  */
3332
- export const scanReduceEffect = internal.scanReduceEffect
3307
+ export const scanReduceEffect: {
3308
+ <A2, A, E2, R2>(
3309
+ f: (a2: A2 | A, a: A) => Effect.Effect<A2 | A, E2, R2>
3310
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
3311
+ <A, E, R, A2, E2, R2>(
3312
+ self: Stream<A, E, R>,
3313
+ f: (a2: A | A2, a: A) => Effect.Effect<A | A2, E2, R2>
3314
+ ): Stream<A | A2, E | E2, R | R2>
3315
+ } = internal.scanReduceEffect
3333
3316
 
3334
3317
  /**
3335
3318
  * Schedules the output of the stream using the provided `schedule`.
@@ -3338,10 +3321,10 @@ export const scanReduceEffect = internal.scanReduceEffect
3338
3321
  * @category utils
3339
3322
  */
3340
3323
  export const schedule: {
3341
- <R2, A, A0 extends A, _>(
3342
- schedule: Schedule.Schedule<R2, A0, _>
3343
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
3344
- <R, E, R2, A, A0 extends A, _>(self: Stream<A, E, R>, schedule: Schedule.Schedule<R2, A0, _>): Stream<A, E, R | R2>
3324
+ <X, A0 extends A, R2, A>(
3325
+ schedule: Schedule.Schedule<X, A0, R2>
3326
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R2 | R>
3327
+ <A, E, R, X, A0 extends A, R2>(self: Stream<A, E, R>, schedule: Schedule.Schedule<X, A0, R2>): Stream<A, E, R | R2>
3345
3328
  } = internal.schedule
3346
3329
 
3347
3330
  /**
@@ -3353,13 +3336,13 @@ export const schedule: {
3353
3336
  * @category utils
3354
3337
  */
3355
3338
  export const scheduleWith: {
3356
- <R2, A, A0 extends A, B, C>(
3357
- schedule: Schedule.Schedule<R2, A0, B>,
3339
+ <B, A0 extends A, R2, A, C>(
3340
+ schedule: Schedule.Schedule<B, A0, R2>,
3358
3341
  options: { readonly onElement: (a: A) => C; readonly onSchedule: (b: B) => C }
3359
- ): <R, E>(self: Stream<A, E, R>) => Stream<C, E, R2 | R>
3360
- <R, E, R2, A, A0 extends A, B, C>(
3342
+ ): <E, R>(self: Stream<A, E, R>) => Stream<C, E, R2 | R>
3343
+ <A, E, R, B, A0 extends A, R2, C>(
3361
3344
  self: Stream<A, E, R>,
3362
- schedule: Schedule.Schedule<R2, A0, B>,
3345
+ schedule: Schedule.Schedule<B, A0, R2>,
3363
3346
  options: { readonly onElement: (a: A) => C; readonly onSchedule: (b: B) => C }
3364
3347
  ): Stream<C, E, R | R2>
3365
3348
  } = internal.scheduleWith
@@ -3423,7 +3406,7 @@ export const some: <A, E, R>(self: Stream<Option.Option<A>, E, R>) => Stream<A,
3423
3406
  */
3424
3407
  export const someOrElse: {
3425
3408
  <A2>(fallback: LazyArg<A2>): <A, E, R>(self: Stream<Option.Option<A>, E, R>) => Stream<A2 | A, E, R>
3426
- <R, E, A, A2>(self: Stream<Option.Option<A>, E, R>, fallback: LazyArg<A2>): Stream<A | A2, E, R>
3409
+ <A, E, R, A2>(self: Stream<Option.Option<A>, E, R>, fallback: LazyArg<A2>): Stream<A | A2, E, R>
3427
3410
  } = internal.someOrElse
3428
3411
 
3429
3412
  /**
@@ -3434,7 +3417,7 @@ export const someOrElse: {
3434
3417
  */
3435
3418
  export const someOrFail: {
3436
3419
  <E2>(error: LazyArg<E2>): <A, E, R>(self: Stream<Option.Option<A>, E, R>) => Stream<A, E2 | E, R>
3437
- <R, E, A, E2>(self: Stream<Option.Option<A>, E, R>, error: LazyArg<E2>): Stream<A, E | E2, R>
3420
+ <A, E, R, E2>(self: Stream<Option.Option<A>, E, R>, error: LazyArg<E2>): Stream<A, E | E2, R>
3438
3421
  } = internal.someOrFail
3439
3422
 
3440
3423
  /**
@@ -3456,7 +3439,7 @@ export const someOrFail: {
3456
3439
  * @category utils
3457
3440
  */
3458
3441
  export const split: {
3459
- <A>(predicate: Predicate<NoInfer<A>>): <R, E>(self: Stream<A, E, R>) => Stream<Chunk.Chunk<A>, E, R>
3442
+ <A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<Chunk.Chunk<A>, E, R>
3460
3443
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<Chunk.Chunk<A>, E, R>
3461
3444
  } = internal.split
3462
3445
 
@@ -3467,7 +3450,7 @@ export const split: {
3467
3450
  * @category utils
3468
3451
  */
3469
3452
  export const splitOnChunk: {
3470
- <A>(delimiter: Chunk.Chunk<A>): <R, E>(self: Stream<A, E, R>) => Stream<Chunk.Chunk<A>, E, R>
3453
+ <A>(delimiter: Chunk.Chunk<A>): <E, R>(self: Stream<A, E, R>) => Stream<Chunk.Chunk<A>, E, R>
3471
3454
  <A, E, R>(self: Stream<A, E, R>, delimiter: Chunk.Chunk<A>): Stream<Chunk.Chunk<A>, E, R>
3472
3455
  } = internal.splitOnChunk
3473
3456
 
@@ -3478,7 +3461,7 @@ export const splitOnChunk: {
3478
3461
  * @since 2.0.0
3479
3462
  * @category combinators
3480
3463
  */
3481
- export const splitLines: <R, E>(self: Stream<string, E, R>) => Stream<string, E, R> = internal.splitLines
3464
+ export const splitLines: <E, R>(self: Stream<string, E, R>) => Stream<string, E, R> = internal.splitLines
3482
3465
 
3483
3466
  /**
3484
3467
  * Creates a single-valued pure stream.
@@ -3534,7 +3517,7 @@ export const takeRight: {
3534
3517
  * @category utils
3535
3518
  */
3536
3519
  export const takeUntil: {
3537
- <A>(predicate: Predicate<NoInfer<A>>): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
3520
+ <A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
3538
3521
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>
3539
3522
  } = internal.takeUntil
3540
3523
 
@@ -3546,10 +3529,10 @@ export const takeUntil: {
3546
3529
  * @category utils
3547
3530
  */
3548
3531
  export const takeUntilEffect: {
3549
- <A, R2, E2>(
3532
+ <A, E2, R2>(
3550
3533
  predicate: (a: NoInfer<A>) => Effect.Effect<boolean, E2, R2>
3551
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
3552
- <R, E, A, R2, E2>(
3534
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
3535
+ <A, E, R, E2, R2>(
3553
3536
  self: Stream<A, E, R>,
3554
3537
  predicate: (a: A) => Effect.Effect<boolean, E2, R2>
3555
3538
  ): Stream<A, E | E2, R | R2>
@@ -3563,9 +3546,9 @@ export const takeUntilEffect: {
3563
3546
  * @category utils
3564
3547
  */
3565
3548
  export const takeWhile: {
3566
- <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <R, E>(self: Stream<A, E, R>) => Stream<B, E, R>
3567
- <A>(predicate: Predicate<NoInfer<A>>): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
3568
- <R, E, A, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>): Stream<B, E, R>
3549
+ <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>
3550
+ <A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
3551
+ <A, E, R, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>): Stream<B, E, R>
3569
3552
  <A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>
3570
3553
  } = internal.takeWhile
3571
3554
 
@@ -3576,10 +3559,10 @@ export const takeWhile: {
3576
3559
  * @category sequencing
3577
3560
  */
3578
3561
  export const tap: {
3579
- <A, R2, E2, _>(
3580
- f: (a: NoInfer<A>) => Effect.Effect<_, E2, R2>
3581
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
3582
- <R, E, A, R2, E2, _>(self: Stream<A, E, R>, f: (a: NoInfer<A>) => Effect.Effect<_, E2, R2>): Stream<A, E | E2, R | R2>
3562
+ <A, X, E2, R2>(
3563
+ f: (a: NoInfer<A>) => Effect.Effect<X, E2, R2>
3564
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
3565
+ <A, E, R, X, E2, R2>(self: Stream<A, E, R>, f: (a: NoInfer<A>) => Effect.Effect<X, E2, R2>): Stream<A, E | E2, R | R2>
3583
3566
  } = internal.tap
3584
3567
 
3585
3568
  /**
@@ -3590,13 +3573,13 @@ export const tap: {
3590
3573
  * @category sequencing
3591
3574
  */
3592
3575
  export const tapBoth: {
3593
- <E, R2, E2, X1, A, R3, E3, X2>(
3576
+ <E, X1, E2, R2, A, X2, E3, R3>(
3594
3577
  options: {
3595
3578
  readonly onFailure: (e: NoInfer<E>) => Effect.Effect<X1, E2, R2>
3596
3579
  readonly onSuccess: (a: NoInfer<A>) => Effect.Effect<X2, E3, R3>
3597
3580
  }
3598
3581
  ): <R>(self: Stream<A, E, R>) => Stream<A, E | E2 | E3, R2 | R3 | R>
3599
- <R, E, A, R2, E2, X1, R3, E3, X2>(
3582
+ <A, E, R, X1, E2, R2, X2, E3, R3>(
3600
3583
  self: Stream<A, E, R>,
3601
3584
  options: {
3602
3585
  readonly onFailure: (e: NoInfer<E>) => Effect.Effect<X1, E2, R2>
@@ -3612,10 +3595,10 @@ export const tapBoth: {
3612
3595
  * @category sequencing
3613
3596
  */
3614
3597
  export const tapError: {
3615
- <E, R2, E2, _>(
3616
- f: (error: NoInfer<E>) => Effect.Effect<_, E2, R2>
3617
- ): <R, A>(self: Stream<A, E, R>) => Stream<A, E | E2, R2 | R>
3618
- <R, A, E, R2, E2, _>(self: Stream<A, E, R>, f: (error: E) => Effect.Effect<_, E2, R2>): Stream<A, E | E2, R | R2>
3598
+ <E, X, E2, R2>(
3599
+ f: (error: NoInfer<E>) => Effect.Effect<X, E2, R2>
3600
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A, E | E2, R2 | R>
3601
+ <A, E, R, X, E2, R2>(self: Stream<A, E, R>, f: (error: E) => Effect.Effect<X, E2, R2>): Stream<A, E | E2, R | R2>
3619
3602
  } = internal.tapError
3620
3603
 
3621
3604
  /**
@@ -3626,12 +3609,12 @@ export const tapError: {
3626
3609
  * @category utils
3627
3610
  */
3628
3611
  export const tapErrorCause: {
3629
- <E, R2, E2, _>(
3630
- f: (cause: Cause.Cause<NoInfer<E>>) => Effect.Effect<_, E2, R2>
3631
- ): <R, A>(self: Stream<A, E, R>) => Stream<A, E | E2, R2 | R>
3632
- <R, A, E, R2, E2, _>(
3612
+ <E, X, E2, R2>(
3613
+ f: (cause: Cause.Cause<NoInfer<E>>) => Effect.Effect<X, E2, R2>
3614
+ ): <A, R>(self: Stream<A, E, R>) => Stream<A, E | E2, R2 | R>
3615
+ <A, E, R, X, E2, R2>(
3633
3616
  self: Stream<A, E, R>,
3634
- f: (cause: Cause.Cause<E>) => Effect.Effect<_, E2, R2>
3617
+ f: (cause: Cause.Cause<E>) => Effect.Effect<X, E2, R2>
3635
3618
  ): Stream<A, E | E2, R | R2>
3636
3619
  } = internal.tapErrorCause
3637
3620
 
@@ -3672,7 +3655,7 @@ export const throttle: {
3672
3655
  readonly burst?: number | undefined
3673
3656
  readonly strategy?: "enforce" | "shape" | undefined
3674
3657
  }
3675
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E, R>
3658
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>
3676
3659
  <A, E, R>(
3677
3660
  self: Stream<A, E, R>,
3678
3661
  options: {
@@ -3702,7 +3685,7 @@ export const throttle: {
3702
3685
  * @category utils
3703
3686
  */
3704
3687
  export const throttleEffect: {
3705
- <A, R2, E2>(
3688
+ <A, E2, R2>(
3706
3689
  options: {
3707
3690
  readonly cost: (chunk: Chunk.Chunk<A>) => Effect.Effect<number, E2, R2>
3708
3691
  readonly units: number
@@ -3710,8 +3693,8 @@ export const throttleEffect: {
3710
3693
  readonly burst?: number | undefined
3711
3694
  readonly strategy?: "enforce" | "shape" | undefined
3712
3695
  }
3713
- ): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
3714
- <R, E, A, R2, E2>(
3696
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
3697
+ <A, E, R, E2, R2>(
3715
3698
  self: Stream<A, E, R>,
3716
3699
  options: {
3717
3700
  readonly cost: (chunk: Chunk.Chunk<A>) => Effect.Effect<number, E2, R2>
@@ -3751,7 +3734,7 @@ export const timeout: {
3751
3734
  */
3752
3735
  export const timeoutFail: {
3753
3736
  <E2>(error: LazyArg<E2>, duration: Duration.DurationInput): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R>
3754
- <R, E, A, E2>(self: Stream<A, E, R>, error: LazyArg<E2>, duration: Duration.DurationInput): Stream<A, E | E2, R>
3737
+ <A, E, R, E2>(self: Stream<A, E, R>, error: LazyArg<E2>, duration: Duration.DurationInput): Stream<A, E | E2, R>
3755
3738
  } = internal.timeoutFail
3756
3739
 
3757
3740
  /**
@@ -3766,7 +3749,7 @@ export const timeoutFailCause: {
3766
3749
  cause: LazyArg<Cause.Cause<E2>>,
3767
3750
  duration: Duration.DurationInput
3768
3751
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R>
3769
- <R, E, A, E2>(
3752
+ <A, E, R, E2>(
3770
3753
  self: Stream<A, E, R>,
3771
3754
  cause: LazyArg<Cause.Cause<E2>>,
3772
3755
  duration: Duration.DurationInput
@@ -3781,11 +3764,11 @@ export const timeoutFailCause: {
3781
3764
  * @category utils
3782
3765
  */
3783
3766
  export const timeoutTo: {
3784
- <R2, E2, A2>(
3767
+ <A2, E2, R2>(
3785
3768
  duration: Duration.DurationInput,
3786
3769
  that: Stream<A2, E2, R2>
3787
3770
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A2 | A, E2 | E, R2 | R>
3788
- <R, E, A, R2, E2, A2>(
3771
+ <A, E, R, A2, E2, R2>(
3789
3772
  self: Stream<A, E, R>,
3790
3773
  duration: Duration.DurationInput,
3791
3774
  that: Stream<A2, E2, R2>
@@ -3915,7 +3898,7 @@ export const unfoldChunk: <S, A>(
3915
3898
  * @since 2.0.0
3916
3899
  * @category constructors
3917
3900
  */
3918
- export const unfoldChunkEffect: <R, E, A, S>(
3901
+ export const unfoldChunkEffect: <S, A, E, R>(
3919
3902
  s: S,
3920
3903
  f: (s: S) => Effect.Effect<Option.Option<readonly [Chunk.Chunk<A>, S]>, E, R>
3921
3904
  ) => Stream<A, E, R> = internal.unfoldChunkEffect
@@ -3927,7 +3910,7 @@ export const unfoldChunkEffect: <R, E, A, S>(
3927
3910
  * @since 2.0.0
3928
3911
  * @category constructors
3929
3912
  */
3930
- export const unfoldEffect: <S, R, E, A>(
3913
+ export const unfoldEffect: <S, A, E, R>(
3931
3914
  s: S,
3932
3915
  f: (s: S) => Effect.Effect<Option.Option<readonly [A, S]>, E, R>
3933
3916
  ) => Stream<A, E, R> = internal.unfoldEffect
@@ -3946,7 +3929,7 @@ export const unit: Stream<void> = internal.unit
3946
3929
  * @since 2.0.0
3947
3930
  * @category constructors
3948
3931
  */
3949
- export const unwrap: <R, E, R2, E2, A>(effect: Effect.Effect<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R | R2> =
3932
+ export const unwrap: <A, E2, R2, E, R>(effect: Effect.Effect<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R | R2> =
3950
3933
  internal.unwrap
3951
3934
 
3952
3935
  /**
@@ -3955,7 +3938,7 @@ export const unwrap: <R, E, R2, E2, A>(effect: Effect.Effect<Stream<A, E2, R2>,
3955
3938
  * @since 2.0.0
3956
3939
  * @category constructors
3957
3940
  */
3958
- export const unwrapScoped: <R, E, R2, E2, A>(
3941
+ export const unwrapScoped: <A, E2, R2, E, R>(
3959
3942
  effect: Effect.Effect<Stream<A, E2, R2>, E, R>
3960
3943
  ) => Stream<A, E | E2, R2 | Exclude<R, Scope.Scope>> = internal.unwrapScoped
3961
3944
 
@@ -3965,7 +3948,17 @@ export const unwrapScoped: <R, E, R2, E2, A>(
3965
3948
  * @since 2.0.0
3966
3949
  * @category context
3967
3950
  */
3968
- export const updateService = internal.updateService
3951
+ export const updateService: {
3952
+ <T extends Context.Tag<any, any>>(
3953
+ tag: T,
3954
+ f: (service: Context.Tag.Service<T>) => Context.Tag.Service<T>
3955
+ ): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, T | R>
3956
+ <A, E, R, T extends Context.Tag<any, any>>(
3957
+ self: Stream<A, E, R>,
3958
+ tag: T,
3959
+ f: (service: Context.Tag.Service<T>) => Context.Tag.Service<T>
3960
+ ): Stream<A, E, R | T>
3961
+ } = internal.updateService
3969
3962
 
3970
3963
  /**
3971
3964
  * Returns the specified stream if the given condition is satisfied, otherwise
@@ -3986,7 +3979,7 @@ export const when: {
3986
3979
  * @since 2.0.0
3987
3980
  * @category constructors
3988
3981
  */
3989
- export const whenCase: <A, R, E, A2>(
3982
+ export const whenCase: <A, A2, E, R>(
3990
3983
  evaluate: LazyArg<A>,
3991
3984
  pf: (a: A) => Option.Option<Stream<A2, E, R>>
3992
3985
  ) => Stream<A2, E, R> = internal.whenCase
@@ -3999,10 +3992,10 @@ export const whenCase: <A, R, E, A2>(
3999
3992
  * @category utils
4000
3993
  */
4001
3994
  export const whenCaseEffect: {
4002
- <A, R2, E2, A2>(
3995
+ <A, A2, E2, R2>(
4003
3996
  pf: (a: A) => Option.Option<Stream<A2, E2, R2>>
4004
- ): <R, E>(self: Effect.Effect<A, E, R>) => Stream<A2, E2 | E, R2 | R>
4005
- <R, E, A, R2, E2, A2>(
3997
+ ): <E, R>(self: Effect.Effect<A, E, R>) => Stream<A2, E2 | E, R2 | R>
3998
+ <A, E, R, A2, E2, R2>(
4006
3999
  self: Effect.Effect<A, E, R>,
4007
4000
  pf: (a: A) => Option.Option<Stream<A2, E2, R2>>
4008
4001
  ): Stream<A2, E | E2, R | R2>
@@ -4016,8 +4009,8 @@ export const whenCaseEffect: {
4016
4009
  * @category utils
4017
4010
  */
4018
4011
  export const whenEffect: {
4019
- <R2, E2>(effect: Effect.Effect<boolean, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
4020
- <R, E, A, R2, E2>(self: Stream<A, E, R>, effect: Effect.Effect<boolean, E2, R2>): Stream<A, E | E2, R | R2>
4012
+ <E2, R2>(effect: Effect.Effect<boolean, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
4013
+ <A, E, R, E2, R2>(self: Stream<A, E, R>, effect: Effect.Effect<boolean, E2, R2>): Stream<A, E | E2, R | R2>
4021
4014
  } = internal.whenEffect
4022
4015
 
4023
4016
  /**
@@ -4060,8 +4053,8 @@ export const withSpan: {
4060
4053
  * @category zipping
4061
4054
  */
4062
4055
  export const zip: {
4063
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
4064
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<[A, A2], E | E2, R | R2>
4056
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
4057
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<[A, A2], E | E2, R | R2>
4065
4058
  } = internal.zip
4066
4059
 
4067
4060
  /**
@@ -4074,10 +4067,10 @@ export const zip: {
4074
4067
  * @category zipping
4075
4068
  */
4076
4069
  export const zipFlatten: {
4077
- <R2, E2, A2>(
4070
+ <A2, E2, R2>(
4078
4071
  that: Stream<A2, E2, R2>
4079
- ): <R, E, A extends ReadonlyArray<any>>(self: Stream<A, E, R>) => Stream<[...A, A2], E2 | E, R2 | R>
4080
- <R, E, A extends ReadonlyArray<any>, R2, E2, A2>(
4072
+ ): <A extends ReadonlyArray<any>, E, R>(self: Stream<A, E, R>) => Stream<[...A, A2], E2 | E, R2 | R>
4073
+ <A extends ReadonlyArray<any>, E, R, A2, E2, R2>(
4081
4074
  self: Stream<A, E, R>,
4082
4075
  that: Stream<A2, E2, R2>
4083
4076
  ): Stream<[...A, A2], E | E2, R | R2>
@@ -4094,10 +4087,10 @@ export const zipFlatten: {
4094
4087
  * @category zipping
4095
4088
  */
4096
4089
  export const zipAll: {
4097
- <R2, E2, A2, A>(
4090
+ <A2, E2, R2, A>(
4098
4091
  options: { readonly other: Stream<A2, E2, R2>; readonly defaultSelf: A; readonly defaultOther: A2 }
4099
- ): <R, E>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
4100
- <R, E, R2, E2, A2, A>(
4092
+ ): <E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
4093
+ <A, E, R, A2, E2, R2>(
4101
4094
  self: Stream<A, E, R>,
4102
4095
  options: { readonly other: Stream<A2, E2, R2>; readonly defaultSelf: A; readonly defaultOther: A2 }
4103
4096
  ): Stream<[A, A2], E | E2, R | R2>
@@ -4114,8 +4107,8 @@ export const zipAll: {
4114
4107
  * @category zipping
4115
4108
  */
4116
4109
  export const zipAllLeft: {
4117
- <R2, E2, A2, A>(that: Stream<A2, E2, R2>, defaultLeft: A): <R, E>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
4118
- <R, E, R2, E2, A2, A>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>, defaultLeft: A): Stream<A, E | E2, R | R2>
4110
+ <A2, E2, R2, A>(that: Stream<A2, E2, R2>, defaultLeft: A): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
4111
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>, defaultLeft: A): Stream<A, E | E2, R | R2>
4119
4112
  } = internal.zipAllLeft
4120
4113
 
4121
4114
  /**
@@ -4129,11 +4122,11 @@ export const zipAllLeft: {
4129
4122
  * @category zipping
4130
4123
  */
4131
4124
  export const zipAllRight: {
4132
- <R2, E2, A2>(
4125
+ <A2, E2, R2>(
4133
4126
  that: Stream<A2, E2, R2>,
4134
4127
  defaultRight: A2
4135
4128
  ): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
4136
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>, defaultRight: A2): Stream<A2, E | E2, R | R2>
4129
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>, defaultRight: A2): Stream<A2, E | E2, R | R2>
4137
4130
  } = internal.zipAllRight
4138
4131
 
4139
4132
  /**
@@ -4151,15 +4144,15 @@ export const zipAllRight: {
4151
4144
  * @category zipping
4152
4145
  */
4153
4146
  export const zipAllSortedByKey: {
4154
- <R2, E2, A2, A, K>(
4147
+ <A2, E2, R2, A, K>(
4155
4148
  options: {
4156
4149
  readonly other: Stream<readonly [K, A2], E2, R2>
4157
4150
  readonly defaultSelf: A
4158
4151
  readonly defaultOther: A2
4159
4152
  readonly order: Order.Order<K>
4160
4153
  }
4161
- ): <R, E>(self: Stream<readonly [K, A], E, R>) => Stream<[K, [A, A2]], E2 | E, R2 | R>
4162
- <R, E, R2, E2, A2, A, K>(
4154
+ ): <E, R>(self: Stream<readonly [K, A], E, R>) => Stream<[K, [A, A2]], E2 | E, R2 | R>
4155
+ <K, A, E, R, A2, E2, R2>(
4163
4156
  self: Stream<readonly [K, A], E, R>,
4164
4157
  options: {
4165
4158
  readonly other: Stream<readonly [K, A2], E2, R2>
@@ -4184,14 +4177,14 @@ export const zipAllSortedByKey: {
4184
4177
  * @category zipping
4185
4178
  */
4186
4179
  export const zipAllSortedByKeyLeft: {
4187
- <R2, E2, A2, A, K>(
4180
+ <A2, E2, R2, A, K>(
4188
4181
  options: {
4189
4182
  readonly other: Stream<readonly [K, A2], E2, R2>
4190
4183
  readonly defaultSelf: A
4191
4184
  readonly order: Order.Order<K>
4192
4185
  }
4193
- ): <R, E>(self: Stream<readonly [K, A], E, R>) => Stream<[K, A], E2 | E, R2 | R>
4194
- <R, E, R2, E2, A2, A, K>(
4186
+ ): <E, R>(self: Stream<readonly [K, A], E, R>) => Stream<[K, A], E2 | E, R2 | R>
4187
+ <K, A, E, R, A2, E2, R2>(
4195
4188
  self: Stream<readonly [K, A], E, R>,
4196
4189
  options: {
4197
4190
  readonly other: Stream<readonly [K, A2], E2, R2>
@@ -4215,14 +4208,14 @@ export const zipAllSortedByKeyLeft: {
4215
4208
  * @category zipping
4216
4209
  */
4217
4210
  export const zipAllSortedByKeyRight: {
4218
- <R2, E2, A2, K>(
4211
+ <K, A2, E2, R2>(
4219
4212
  options: {
4220
4213
  readonly other: Stream<readonly [K, A2], E2, R2>
4221
4214
  readonly defaultOther: A2
4222
4215
  readonly order: Order.Order<K>
4223
4216
  }
4224
4217
  ): <A, E, R>(self: Stream<readonly [K, A], E, R>) => Stream<[K, A2], E2 | E, R2 | R>
4225
- <R, E, A, R2, E2, A2, K>(
4218
+ <A, E, R, K, A2, E2, R2>(
4226
4219
  self: Stream<readonly [K, A], E, R>,
4227
4220
  options: {
4228
4221
  readonly other: Stream<readonly [K, A2], E2, R2>
@@ -4247,7 +4240,7 @@ export const zipAllSortedByKeyRight: {
4247
4240
  * @category zipping
4248
4241
  */
4249
4242
  export const zipAllSortedByKeyWith: {
4250
- <R2, E2, A, A3, A2, K>(
4243
+ <K, A2, E2, R2, A, A3>(
4251
4244
  options: {
4252
4245
  readonly other: Stream<readonly [K, A2], E2, R2>
4253
4246
  readonly onSelf: (a: A) => A3
@@ -4255,8 +4248,8 @@ export const zipAllSortedByKeyWith: {
4255
4248
  readonly onBoth: (a: A, a2: A2) => A3
4256
4249
  readonly order: Order.Order<K>
4257
4250
  }
4258
- ): <R, E>(self: Stream<readonly [K, A], E, R>) => Stream<[K, A3], E2 | E, R2 | R>
4259
- <R, E, R2, E2, A, A3, A2, K>(
4251
+ ): <E, R>(self: Stream<readonly [K, A], E, R>) => Stream<[K, A3], E2 | E, R2 | R>
4252
+ <K, A, E, R, A2, E2, R2, A3>(
4260
4253
  self: Stream<readonly [K, A], E, R>,
4261
4254
  options: {
4262
4255
  readonly other: Stream<readonly [K, A2], E2, R2>
@@ -4279,15 +4272,15 @@ export const zipAllSortedByKeyWith: {
4279
4272
  * @category zipping
4280
4273
  */
4281
4274
  export const zipAllWith: {
4282
- <R2, E2, A2, A, A3>(
4275
+ <A2, E2, R2, A, A3>(
4283
4276
  options: {
4284
4277
  readonly other: Stream<A2, E2, R2>
4285
4278
  readonly onSelf: (a: A) => A3
4286
4279
  readonly onOther: (a2: A2) => A3
4287
4280
  readonly onBoth: (a: A, a2: A2) => A3
4288
4281
  }
4289
- ): <R, E>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4290
- <R, E, R2, E2, A2, A, A3>(
4282
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4283
+ <A, E, R, A2, E2, R2, A3>(
4291
4284
  self: Stream<A, E, R>,
4292
4285
  options: {
4293
4286
  readonly other: Stream<A2, E2, R2>
@@ -4311,8 +4304,8 @@ export const zipAllWith: {
4311
4304
  * @category zipping
4312
4305
  */
4313
4306
  export const zipLatest: {
4314
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
4315
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<[A, A2], E | E2, R | R2>
4307
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<[A, A2], E2 | E, R2 | R>
4308
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<[A, A2], E | E2, R | R2>
4316
4309
  } = internal.zipLatest
4317
4310
 
4318
4311
  /**
@@ -4328,11 +4321,11 @@ export const zipLatest: {
4328
4321
  * @category zipping
4329
4322
  */
4330
4323
  export const zipLatestWith: {
4331
- <R2, E2, A2, A, A3>(
4324
+ <A2, E2, R2, A, A3>(
4332
4325
  that: Stream<A2, E2, R2>,
4333
4326
  f: (a: A, a2: A2) => A3
4334
- ): <R, E>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4335
- <R, E, R2, E2, A2, A, A3>(
4327
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4328
+ <A, E, R, A2, E2, R2, A3>(
4336
4329
  self: Stream<A, E, R>,
4337
4330
  that: Stream<A2, E2, R2>,
4338
4331
  f: (a: A, a2: A2) => A3
@@ -4349,8 +4342,8 @@ export const zipLatestWith: {
4349
4342
  * @category zipping
4350
4343
  */
4351
4344
  export const zipLeft: {
4352
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
4353
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
4345
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>
4346
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A, E | E2, R | R2>
4354
4347
  } = internal.zipLeft
4355
4348
 
4356
4349
  /**
@@ -4363,8 +4356,8 @@ export const zipLeft: {
4363
4356
  * @category zipping
4364
4357
  */
4365
4358
  export const zipRight: {
4366
- <R2, E2, A2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
4367
- <R, E, A, R2, E2, A2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A2, E | E2, R | R2>
4359
+ <A2, E2, R2>(that: Stream<A2, E2, R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A2, E2 | E, R2 | R>
4360
+ <A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A2, E | E2, R | R2>
4368
4361
  } = internal.zipRight
4369
4362
 
4370
4363
  /**
@@ -4377,11 +4370,11 @@ export const zipRight: {
4377
4370
  * @category zipping
4378
4371
  */
4379
4372
  export const zipWith: {
4380
- <R2, E2, A2, A, A3>(
4373
+ <A2, E2, R2, A, A3>(
4381
4374
  that: Stream<A2, E2, R2>,
4382
4375
  f: (a: A, a2: A2) => A3
4383
- ): <R, E>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4384
- <R, E, R2, E2, A2, A, A3>(
4376
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4377
+ <A, E, R, A2, E2, R2, A3>(
4385
4378
  self: Stream<A, E, R>,
4386
4379
  that: Stream<A2, E2, R2>,
4387
4380
  f: (a: A, a2: A2) => A3
@@ -4398,20 +4391,20 @@ export const zipWith: {
4398
4391
  * @category zipping
4399
4392
  */
4400
4393
  export const zipWithChunks: {
4401
- <R2, E2, A2, A, A3>(
4394
+ <A2, E2, R2, A, A3>(
4402
4395
  that: Stream<A2, E2, R2>,
4403
4396
  f: (
4404
4397
  left: Chunk.Chunk<A>,
4405
4398
  right: Chunk.Chunk<A2>
4406
- ) => readonly [Chunk.Chunk<A3>, Either.Either<Chunk.Chunk<A>, Chunk.Chunk<A2>>]
4407
- ): <R, E>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4408
- <R, E, R2, E2, A2, A, A3>(
4399
+ ) => readonly [Chunk.Chunk<A3>, Either.Either<Chunk.Chunk<A2>, Chunk.Chunk<A>>]
4400
+ ): <E, R>(self: Stream<A, E, R>) => Stream<A3, E2 | E, R2 | R>
4401
+ <A, E, R, A2, E2, R2, A3>(
4409
4402
  self: Stream<A, E, R>,
4410
4403
  that: Stream<A2, E2, R2>,
4411
4404
  f: (
4412
4405
  left: Chunk.Chunk<A>,
4413
4406
  right: Chunk.Chunk<A2>
4414
- ) => readonly [Chunk.Chunk<A3>, Either.Either<Chunk.Chunk<A>, Chunk.Chunk<A2>>]
4407
+ ) => readonly [Chunk.Chunk<A3>, Either.Either<Chunk.Chunk<A2>, Chunk.Chunk<A>>]
4415
4408
  ): Stream<A3, E | E2, R | R2>
4416
4409
  } = internal.zipWithChunks
4417
4410
 
@@ -4468,21 +4461,21 @@ export const Do: Stream<{}> = internal.Do
4468
4461
  * @category do notation
4469
4462
  */
4470
4463
  export const bind: {
4471
- <N extends string, K, R2, E2, A>(
4464
+ <N extends string, K, A, E2, R2>(
4472
4465
  tag: Exclude<N, keyof K>,
4473
4466
  f: (_: K) => Stream<A, E2, R2>,
4474
4467
  options?:
4475
4468
  | { readonly concurrency?: number | "unbounded" | undefined; readonly bufferSize?: number | undefined }
4476
4469
  | undefined
4477
- ): <R, E>(self: Stream<K, E, R>) => Stream<Effect.MergeRecord<K, { [k in N]: A }>, E2 | E, R2 | R>
4478
- <R, E, N extends string, K, R2, E2, A>(
4470
+ ): <E, R>(self: Stream<K, E, R>) => Stream<MergeRecord<K, { [k in N]: A }>, E2 | E, R2 | R>
4471
+ <K, E, R, N extends string, A, E2, R2>(
4479
4472
  self: Stream<K, E, R>,
4480
4473
  tag: Exclude<N, keyof K>,
4481
4474
  f: (_: K) => Stream<A, E2, R2>,
4482
4475
  options?:
4483
4476
  | { readonly concurrency?: number | "unbounded" | undefined; readonly bufferSize?: number | undefined }
4484
4477
  | undefined
4485
- ): Stream<Effect.MergeRecord<K, { [k in N]: A }>, E | E2, R | R2>
4478
+ ): Stream<MergeRecord<K, { [k in N]: A }>, E | E2, R | R2>
4486
4479
  } = internal.bind
4487
4480
 
4488
4481
  /**
@@ -4492,21 +4485,21 @@ export const bind: {
4492
4485
  * @category do notation
4493
4486
  */
4494
4487
  export const bindEffect: {
4495
- <N extends string, K, R2, E2, A>(
4488
+ <N extends string, K, A, E2, R2>(
4496
4489
  tag: Exclude<N, keyof K>,
4497
4490
  f: (_: K) => Effect.Effect<A, E2, R2>,
4498
4491
  options?:
4499
4492
  | { readonly concurrency?: number | "unbounded" | undefined; readonly bufferSize?: number | undefined }
4500
4493
  | undefined
4501
- ): <R, E>(self: Stream<K, E, R>) => Stream<Effect.MergeRecord<K, { [k in N]: A }>, E2 | E, R2 | R>
4502
- <R, E, N extends string, K, R2, E2, A>(
4494
+ ): <E, R>(self: Stream<K, E, R>) => Stream<MergeRecord<K, { [k in N]: A }>, E2 | E, R2 | R>
4495
+ <K, E, R, N extends string, A, E2, R2>(
4503
4496
  self: Stream<K, E, R>,
4504
4497
  tag: Exclude<N, keyof K>,
4505
4498
  f: (_: K) => Effect.Effect<A, E2, R2>,
4506
4499
  options?:
4507
4500
  | { readonly concurrency?: number | "unbounded" | undefined; readonly unordered?: boolean | undefined }
4508
4501
  | undefined
4509
- ): Stream<Effect.MergeRecord<K, { [k in N]: A }>, E | E2, R | R2>
4502
+ ): Stream<MergeRecord<K, { [k in N]: A }>, E | E2, R | R2>
4510
4503
  } = _groupBy.bindEffect
4511
4504
 
4512
4505
  /**
@@ -4515,19 +4508,19 @@ export const bindEffect: {
4515
4508
  */
4516
4509
  export const bindTo: {
4517
4510
  <N extends string>(tag: N): <A, E, R>(self: Stream<A, E, R>) => Stream<Record<N, A>, E, R>
4518
- <R, E, A, N extends string>(self: Stream<A, E, R>, tag: N): Stream<Record<N, A>, E, R>
4511
+ <A, E, R, N extends string>(self: Stream<A, E, R>, tag: N): Stream<Record<N, A>, E, R>
4519
4512
  } = internal.bindTo
4520
4513
 
4521
4514
  const let_: {
4522
4515
  <N extends string, K, A>(
4523
4516
  tag: Exclude<N, keyof K>,
4524
4517
  f: (_: K) => A
4525
- ): <R, E>(self: Stream<K, E, R>) => Stream<Effect.MergeRecord<K, { [k in N]: A }>, E, R>
4526
- <R, E, K, N extends string, A>(
4518
+ ): <E, R>(self: Stream<K, E, R>) => Stream<MergeRecord<K, { [k in N]: A }>, E, R>
4519
+ <K, E, R, N extends string, A>(
4527
4520
  self: Stream<K, E, R>,
4528
4521
  tag: Exclude<N, keyof K>,
4529
4522
  f: (_: K) => A
4530
- ): Stream<Effect.MergeRecord<K, { [k in N]: A }>, E, R>
4523
+ ): Stream<MergeRecord<K, { [k in N]: A }>, E, R>
4531
4524
  } = internal.let_
4532
4525
 
4533
4526
  export {
@@ -4551,8 +4544,8 @@ export {
4551
4544
  * @category encoding
4552
4545
  */
4553
4546
  export const decodeText: {
4554
- (encoding?: string | undefined): <R, E>(self: Stream<Uint8Array, E, R>) => Stream<string, E, R>
4555
- <R, E>(self: Stream<Uint8Array, E, R>, encoding?: string | undefined): Stream<string, E, R>
4547
+ (encoding?: string | undefined): <E, R>(self: Stream<Uint8Array, E, R>) => Stream<string, E, R>
4548
+ <E, R>(self: Stream<Uint8Array, E, R>, encoding?: string | undefined): Stream<string, E, R>
4556
4549
  } = internal.decodeText
4557
4550
 
4558
4551
  /**
@@ -4561,4 +4554,4 @@ export const decodeText: {
4561
4554
  * @since 2.0.0
4562
4555
  * @category encoding
4563
4556
  */
4564
- export const encodeText: <R, E>(self: Stream<string, E, R>) => Stream<Uint8Array, E, R> = internal.encodeText
4557
+ export const encodeText: <E, R>(self: Stream<string, E, R>) => Stream<Uint8Array, E, R> = internal.encodeText