effect 3.10.19 → 3.11.1
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.
- package/dist/cjs/BigDecimal.js +125 -24
- package/dist/cjs/BigDecimal.js.map +1 -1
- package/dist/cjs/Channel.js +44 -4
- package/dist/cjs/Channel.js.map +1 -1
- package/dist/cjs/Config.js +8 -1
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Context.js +26 -1
- package/dist/cjs/Context.js.map +1 -1
- package/dist/cjs/Cron.js +75 -67
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/DateTime.js +111 -661
- package/dist/cjs/DateTime.js.map +1 -1
- package/dist/cjs/Effect.js +82 -4
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Inspectable.js +8 -4
- package/dist/cjs/Inspectable.js.map +1 -1
- package/dist/cjs/JSONSchema.js.map +1 -1
- package/dist/cjs/Micro.js +1099 -1072
- package/dist/cjs/Micro.js.map +1 -1
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schema.js +57 -8
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/Sink.js +9 -1
- package/dist/cjs/Sink.js.map +1 -1
- package/dist/cjs/Stream.js +55 -14
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/Utils.js +7 -1
- package/dist/cjs/Utils.js.map +1 -1
- package/dist/cjs/internal/channel/channelExecutor.js +5 -9
- package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
- package/dist/cjs/internal/channel.js +156 -130
- package/dist/cjs/internal/channel.js.map +1 -1
- package/dist/cjs/internal/config.js +13 -4
- package/dist/cjs/internal/config.js.map +1 -1
- package/dist/cjs/internal/context.js +46 -3
- package/dist/cjs/internal/context.js.map +1 -1
- package/dist/cjs/internal/dateTime.js +747 -0
- package/dist/cjs/internal/dateTime.js.map +1 -0
- package/dist/cjs/internal/fiberRuntime.js +34 -11
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/groupBy.js +9 -3
- package/dist/cjs/internal/groupBy.js.map +1 -1
- package/dist/cjs/internal/layer.js +1 -1
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/mailbox.js +1 -1
- package/dist/cjs/internal/mailbox.js.map +1 -1
- package/dist/cjs/internal/pool.js +4 -2
- package/dist/cjs/internal/pool.js.map +1 -1
- package/dist/cjs/internal/sink.js +25 -21
- package/dist/cjs/internal/sink.js.map +1 -1
- package/dist/cjs/internal/stream.js +70 -71
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/BigDecimal.d.ts +56 -1
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/Channel.d.ts +66 -5
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/Config.d.ts +23 -1
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Context.d.ts +111 -0
- package/dist/dts/Context.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts +15 -6
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/DateTime.d.ts +41 -41
- package/dist/dts/DateTime.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +88 -1
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Inspectable.d.ts.map +1 -1
- package/dist/dts/JSONSchema.d.ts +1 -0
- package/dist/dts/JSONSchema.d.ts.map +1 -1
- package/dist/dts/Micro.d.ts +875 -872
- package/dist/dts/Micro.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +2 -0
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +32 -0
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/Sink.d.ts +8 -0
- package/dist/dts/Sink.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +166 -59
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/Utils.d.ts +4 -0
- package/dist/dts/Utils.d.ts.map +1 -1
- package/dist/dts/internal/context.d.ts +1 -1
- package/dist/dts/internal/context.d.ts.map +1 -1
- package/dist/dts/internal/dateTime.d.ts +2 -0
- package/dist/dts/internal/dateTime.d.ts.map +1 -0
- package/dist/dts/internal/fiberRuntime.d.ts.map +1 -1
- package/dist/dts/internal/stream.d.ts.map +1 -1
- package/dist/esm/BigDecimal.js +119 -20
- package/dist/esm/BigDecimal.js.map +1 -1
- package/dist/esm/Channel.js +42 -2
- package/dist/esm/Channel.js.map +1 -1
- package/dist/esm/Config.js +7 -0
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Context.js +25 -0
- package/dist/esm/Context.js.map +1 -1
- package/dist/esm/Cron.js +75 -67
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/DateTime.js +109 -624
- package/dist/esm/DateTime.js.map +1 -1
- package/dist/esm/Effect.js +77 -0
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Inspectable.js +8 -4
- package/dist/esm/Inspectable.js.map +1 -1
- package/dist/esm/JSONSchema.js.map +1 -1
- package/dist/esm/Micro.js +1077 -1047
- package/dist/esm/Micro.js.map +1 -1
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schema.js +54 -0
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/Sink.js +8 -0
- package/dist/esm/Sink.js.map +1 -1
- package/dist/esm/Stream.js +53 -12
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/Utils.js +5 -0
- package/dist/esm/Utils.js.map +1 -1
- package/dist/esm/internal/channel/channelExecutor.js +5 -7
- package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
- package/dist/esm/internal/channel.js +152 -129
- package/dist/esm/internal/channel.js.map +1 -1
- package/dist/esm/internal/config.js +11 -3
- package/dist/esm/internal/config.js.map +1 -1
- package/dist/esm/internal/context.js +42 -2
- package/dist/esm/internal/context.js.map +1 -1
- package/dist/esm/internal/dateTime.js +704 -0
- package/dist/esm/internal/dateTime.js.map +1 -0
- package/dist/esm/internal/fiberRuntime.js +31 -9
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/groupBy.js +9 -3
- package/dist/esm/internal/groupBy.js.map +1 -1
- package/dist/esm/internal/layer.js +1 -1
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/mailbox.js +1 -1
- package/dist/esm/internal/mailbox.js.map +1 -1
- package/dist/esm/internal/pool.js +4 -2
- package/dist/esm/internal/pool.js.map +1 -1
- package/dist/esm/internal/sink.js +23 -20
- package/dist/esm/internal/sink.js.map +1 -1
- package/dist/esm/internal/stream.js +66 -69
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +1 -1
- package/src/BigDecimal.ts +131 -21
- package/src/Channel.ts +81 -5
- package/src/Config.ts +24 -1
- package/src/Context.ts +119 -0
- package/src/Cron.ts +85 -68
- package/src/DateTime.ts +151 -754
- package/src/Effect.ts +340 -1
- package/src/Inspectable.ts +11 -7
- package/src/JSONSchema.ts +1 -0
- package/src/Micro.ts +2005 -1757
- package/src/STM.ts +2 -0
- package/src/Schema.ts +60 -0
- package/src/Sink.ts +11 -0
- package/src/Stream.ts +171 -71
- package/src/Utils.ts +8 -0
- package/src/internal/channel/channelExecutor.ts +37 -33
- package/src/internal/channel.ts +504 -467
- package/src/internal/config.ts +18 -6
- package/src/internal/context.ts +56 -4
- package/src/internal/dateTime.ts +1126 -0
- package/src/internal/fiberRuntime.ts +35 -16
- package/src/internal/groupBy.ts +13 -22
- package/src/internal/layer.ts +5 -8
- package/src/internal/mailbox.ts +6 -4
- package/src/internal/pool.ts +4 -1
- package/src/internal/sink.ts +55 -35
- package/src/internal/stream.ts +299 -299
- package/src/internal/version.ts +1 -1
package/dist/dts/Stream.d.ts
CHANGED
|
@@ -5690,30 +5690,40 @@ export declare const paginateChunkEffect: <S, A, E, R>(s: S, f: (s: S) => Effect
|
|
|
5690
5690
|
*/
|
|
5691
5691
|
export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effect<readonly [A, Option.Option<S>], E, R>) => Stream<A, E, R>;
|
|
5692
5692
|
/**
|
|
5693
|
-
*
|
|
5694
|
-
*
|
|
5695
|
-
*
|
|
5696
|
-
*
|
|
5693
|
+
* Splits a stream into two substreams based on a predicate.
|
|
5694
|
+
*
|
|
5695
|
+
* **Details**
|
|
5696
|
+
*
|
|
5697
|
+
* The `Stream.partition` function splits a stream into two parts: one for
|
|
5698
|
+
* elements that satisfy the predicate (evaluated to `true`) and another for
|
|
5699
|
+
* those that do not (evaluated to `false`).
|
|
5700
|
+
*
|
|
5701
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5702
|
+
* one.
|
|
5703
|
+
*
|
|
5704
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5705
|
+
* conditions.
|
|
5697
5706
|
*
|
|
5698
5707
|
* @example
|
|
5699
5708
|
* ```ts
|
|
5709
|
+
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5700
5710
|
* import { Effect, Stream } from "effect"
|
|
5701
5711
|
*
|
|
5702
|
-
* const partition = Stream.range(1,
|
|
5712
|
+
* const partition = Stream.range(1, 9).pipe(
|
|
5703
5713
|
* Stream.partition((n) => n % 2 === 0, { bufferSize: 5 })
|
|
5704
5714
|
* )
|
|
5705
5715
|
*
|
|
5706
5716
|
* const program = Effect.scoped(
|
|
5707
5717
|
* Effect.gen(function*() {
|
|
5708
|
-
* const [
|
|
5709
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5718
|
+
* const [odds, evens] = yield* partition
|
|
5710
5719
|
* console.log(yield* Stream.runCollect(odds))
|
|
5720
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5711
5721
|
* })
|
|
5712
5722
|
* )
|
|
5713
5723
|
*
|
|
5714
5724
|
* // Effect.runPromise(program)
|
|
5715
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5716
5725
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5726
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5717
5727
|
* ```
|
|
5718
5728
|
*
|
|
5719
5729
|
* @since 2.0.0
|
|
@@ -5721,30 +5731,40 @@ export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effe
|
|
|
5721
5731
|
*/
|
|
5722
5732
|
export declare const partition: {
|
|
5723
5733
|
/**
|
|
5724
|
-
*
|
|
5725
|
-
*
|
|
5726
|
-
*
|
|
5727
|
-
*
|
|
5734
|
+
* Splits a stream into two substreams based on a predicate.
|
|
5735
|
+
*
|
|
5736
|
+
* **Details**
|
|
5737
|
+
*
|
|
5738
|
+
* The `Stream.partition` function splits a stream into two parts: one for
|
|
5739
|
+
* elements that satisfy the predicate (evaluated to `true`) and another for
|
|
5740
|
+
* those that do not (evaluated to `false`).
|
|
5741
|
+
*
|
|
5742
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5743
|
+
* one.
|
|
5744
|
+
*
|
|
5745
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5746
|
+
* conditions.
|
|
5728
5747
|
*
|
|
5729
5748
|
* @example
|
|
5730
5749
|
* ```ts
|
|
5750
|
+
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5731
5751
|
* import { Effect, Stream } from "effect"
|
|
5732
5752
|
*
|
|
5733
|
-
* const partition = Stream.range(1,
|
|
5753
|
+
* const partition = Stream.range(1, 9).pipe(
|
|
5734
5754
|
* Stream.partition((n) => n % 2 === 0, { bufferSize: 5 })
|
|
5735
5755
|
* )
|
|
5736
5756
|
*
|
|
5737
5757
|
* const program = Effect.scoped(
|
|
5738
5758
|
* Effect.gen(function*() {
|
|
5739
|
-
* const [
|
|
5740
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5759
|
+
* const [odds, evens] = yield* partition
|
|
5741
5760
|
* console.log(yield* Stream.runCollect(odds))
|
|
5761
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5742
5762
|
* })
|
|
5743
5763
|
* )
|
|
5744
5764
|
*
|
|
5745
5765
|
* // Effect.runPromise(program)
|
|
5746
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5747
5766
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5767
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5748
5768
|
* ```
|
|
5749
5769
|
*
|
|
5750
5770
|
* @since 2.0.0
|
|
@@ -5754,30 +5774,40 @@ export declare const partition: {
|
|
|
5754
5774
|
bufferSize?: number | undefined;
|
|
5755
5775
|
} | undefined): <E, R>(self: Stream<C, E, R>) => Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>;
|
|
5756
5776
|
/**
|
|
5757
|
-
*
|
|
5758
|
-
*
|
|
5759
|
-
*
|
|
5760
|
-
*
|
|
5777
|
+
* Splits a stream into two substreams based on a predicate.
|
|
5778
|
+
*
|
|
5779
|
+
* **Details**
|
|
5780
|
+
*
|
|
5781
|
+
* The `Stream.partition` function splits a stream into two parts: one for
|
|
5782
|
+
* elements that satisfy the predicate (evaluated to `true`) and another for
|
|
5783
|
+
* those that do not (evaluated to `false`).
|
|
5784
|
+
*
|
|
5785
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5786
|
+
* one.
|
|
5787
|
+
*
|
|
5788
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5789
|
+
* conditions.
|
|
5761
5790
|
*
|
|
5762
5791
|
* @example
|
|
5763
5792
|
* ```ts
|
|
5793
|
+
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5764
5794
|
* import { Effect, Stream } from "effect"
|
|
5765
5795
|
*
|
|
5766
|
-
* const partition = Stream.range(1,
|
|
5796
|
+
* const partition = Stream.range(1, 9).pipe(
|
|
5767
5797
|
* Stream.partition((n) => n % 2 === 0, { bufferSize: 5 })
|
|
5768
5798
|
* )
|
|
5769
5799
|
*
|
|
5770
5800
|
* const program = Effect.scoped(
|
|
5771
5801
|
* Effect.gen(function*() {
|
|
5772
|
-
* const [
|
|
5773
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5802
|
+
* const [odds, evens] = yield* partition
|
|
5774
5803
|
* console.log(yield* Stream.runCollect(odds))
|
|
5804
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5775
5805
|
* })
|
|
5776
5806
|
* )
|
|
5777
5807
|
*
|
|
5778
5808
|
* // Effect.runPromise(program)
|
|
5779
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5780
5809
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5810
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5781
5811
|
* ```
|
|
5782
5812
|
*
|
|
5783
5813
|
* @since 2.0.0
|
|
@@ -5787,30 +5817,40 @@ export declare const partition: {
|
|
|
5787
5817
|
bufferSize?: number | undefined;
|
|
5788
5818
|
} | undefined): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[excluded: Stream<A, E, never>, satisfying: Stream<A, E, never>], E, Scope.Scope | R>;
|
|
5789
5819
|
/**
|
|
5790
|
-
*
|
|
5791
|
-
*
|
|
5792
|
-
*
|
|
5793
|
-
*
|
|
5820
|
+
* Splits a stream into two substreams based on a predicate.
|
|
5821
|
+
*
|
|
5822
|
+
* **Details**
|
|
5823
|
+
*
|
|
5824
|
+
* The `Stream.partition` function splits a stream into two parts: one for
|
|
5825
|
+
* elements that satisfy the predicate (evaluated to `true`) and another for
|
|
5826
|
+
* those that do not (evaluated to `false`).
|
|
5827
|
+
*
|
|
5828
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5829
|
+
* one.
|
|
5830
|
+
*
|
|
5831
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5832
|
+
* conditions.
|
|
5794
5833
|
*
|
|
5795
5834
|
* @example
|
|
5796
5835
|
* ```ts
|
|
5836
|
+
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5797
5837
|
* import { Effect, Stream } from "effect"
|
|
5798
5838
|
*
|
|
5799
|
-
* const partition = Stream.range(1,
|
|
5839
|
+
* const partition = Stream.range(1, 9).pipe(
|
|
5800
5840
|
* Stream.partition((n) => n % 2 === 0, { bufferSize: 5 })
|
|
5801
5841
|
* )
|
|
5802
5842
|
*
|
|
5803
5843
|
* const program = Effect.scoped(
|
|
5804
5844
|
* Effect.gen(function*() {
|
|
5805
|
-
* const [
|
|
5806
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5845
|
+
* const [odds, evens] = yield* partition
|
|
5807
5846
|
* console.log(yield* Stream.runCollect(odds))
|
|
5847
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5808
5848
|
* })
|
|
5809
5849
|
* )
|
|
5810
5850
|
*
|
|
5811
5851
|
* // Effect.runPromise(program)
|
|
5812
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5813
5852
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5853
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5814
5854
|
* ```
|
|
5815
5855
|
*
|
|
5816
5856
|
* @since 2.0.0
|
|
@@ -5820,30 +5860,40 @@ export declare const partition: {
|
|
|
5820
5860
|
bufferSize?: number | undefined;
|
|
5821
5861
|
} | undefined): Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>;
|
|
5822
5862
|
/**
|
|
5823
|
-
*
|
|
5824
|
-
*
|
|
5825
|
-
*
|
|
5826
|
-
*
|
|
5863
|
+
* Splits a stream into two substreams based on a predicate.
|
|
5864
|
+
*
|
|
5865
|
+
* **Details**
|
|
5866
|
+
*
|
|
5867
|
+
* The `Stream.partition` function splits a stream into two parts: one for
|
|
5868
|
+
* elements that satisfy the predicate (evaluated to `true`) and another for
|
|
5869
|
+
* those that do not (evaluated to `false`).
|
|
5870
|
+
*
|
|
5871
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5872
|
+
* one.
|
|
5873
|
+
*
|
|
5874
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5875
|
+
* conditions.
|
|
5827
5876
|
*
|
|
5828
5877
|
* @example
|
|
5829
5878
|
* ```ts
|
|
5879
|
+
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5830
5880
|
* import { Effect, Stream } from "effect"
|
|
5831
5881
|
*
|
|
5832
|
-
* const partition = Stream.range(1,
|
|
5882
|
+
* const partition = Stream.range(1, 9).pipe(
|
|
5833
5883
|
* Stream.partition((n) => n % 2 === 0, { bufferSize: 5 })
|
|
5834
5884
|
* )
|
|
5835
5885
|
*
|
|
5836
5886
|
* const program = Effect.scoped(
|
|
5837
5887
|
* Effect.gen(function*() {
|
|
5838
|
-
* const [
|
|
5839
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5888
|
+
* const [odds, evens] = yield* partition
|
|
5840
5889
|
* console.log(yield* Stream.runCollect(odds))
|
|
5890
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5841
5891
|
* })
|
|
5842
5892
|
* )
|
|
5843
5893
|
*
|
|
5844
5894
|
* // Effect.runPromise(program)
|
|
5845
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5846
5895
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5896
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5847
5897
|
* ```
|
|
5848
5898
|
*
|
|
5849
5899
|
* @since 2.0.0
|
|
@@ -5854,16 +5904,29 @@ export declare const partition: {
|
|
|
5854
5904
|
} | undefined): Effect.Effect<[excluded: Stream<A, E, never>, satisfying: Stream<A, E, never>], E, R | Scope.Scope>;
|
|
5855
5905
|
};
|
|
5856
5906
|
/**
|
|
5857
|
-
*
|
|
5858
|
-
*
|
|
5907
|
+
* Splits a stream into two substreams based on an effectful condition.
|
|
5908
|
+
*
|
|
5909
|
+
* **Details**
|
|
5910
|
+
*
|
|
5911
|
+
* The `Stream.partitionEither` function is used to divide a stream into two
|
|
5912
|
+
* parts: one for elements that satisfy a condition producing `Either.left`
|
|
5913
|
+
* values, and another for those that produce `Either.right` values. This
|
|
5914
|
+
* function applies an effectful predicate to each element in the stream to
|
|
5915
|
+
* determine which substream it belongs to.
|
|
5916
|
+
*
|
|
5917
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5918
|
+
* one.
|
|
5919
|
+
*
|
|
5920
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
5859
5921
|
*
|
|
5860
5922
|
* @example
|
|
5861
5923
|
* ```ts
|
|
5924
|
+
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
5862
5925
|
* import { Effect, Either, Stream } from "effect"
|
|
5863
5926
|
*
|
|
5864
5927
|
* const partition = Stream.range(1, 9).pipe(
|
|
5865
5928
|
* Stream.partitionEither(
|
|
5866
|
-
* (n) => Effect.succeed(n % 2 === 0 ? Either.
|
|
5929
|
+
* (n) => Effect.succeed(n % 2 === 0 ? Either.right(n) : Either.left(n)),
|
|
5867
5930
|
* { bufferSize: 5 }
|
|
5868
5931
|
* )
|
|
5869
5932
|
* )
|
|
@@ -5877,8 +5940,8 @@ export declare const partition: {
|
|
|
5877
5940
|
* )
|
|
5878
5941
|
*
|
|
5879
5942
|
* // Effect.runPromise(program)
|
|
5880
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5881
5943
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5944
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5882
5945
|
* ```
|
|
5883
5946
|
*
|
|
5884
5947
|
* @since 2.0.0
|
|
@@ -5886,16 +5949,29 @@ export declare const partition: {
|
|
|
5886
5949
|
*/
|
|
5887
5950
|
export declare const partitionEither: {
|
|
5888
5951
|
/**
|
|
5889
|
-
*
|
|
5890
|
-
*
|
|
5952
|
+
* Splits a stream into two substreams based on an effectful condition.
|
|
5953
|
+
*
|
|
5954
|
+
* **Details**
|
|
5955
|
+
*
|
|
5956
|
+
* The `Stream.partitionEither` function is used to divide a stream into two
|
|
5957
|
+
* parts: one for elements that satisfy a condition producing `Either.left`
|
|
5958
|
+
* values, and another for those that produce `Either.right` values. This
|
|
5959
|
+
* function applies an effectful predicate to each element in the stream to
|
|
5960
|
+
* determine which substream it belongs to.
|
|
5961
|
+
*
|
|
5962
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5963
|
+
* one.
|
|
5964
|
+
*
|
|
5965
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
5891
5966
|
*
|
|
5892
5967
|
* @example
|
|
5893
5968
|
* ```ts
|
|
5969
|
+
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
5894
5970
|
* import { Effect, Either, Stream } from "effect"
|
|
5895
5971
|
*
|
|
5896
5972
|
* const partition = Stream.range(1, 9).pipe(
|
|
5897
5973
|
* Stream.partitionEither(
|
|
5898
|
-
* (n) => Effect.succeed(n % 2 === 0 ? Either.
|
|
5974
|
+
* (n) => Effect.succeed(n % 2 === 0 ? Either.right(n) : Either.left(n)),
|
|
5899
5975
|
* { bufferSize: 5 }
|
|
5900
5976
|
* )
|
|
5901
5977
|
* )
|
|
@@ -5909,8 +5985,8 @@ export declare const partitionEither: {
|
|
|
5909
5985
|
* )
|
|
5910
5986
|
*
|
|
5911
5987
|
* // Effect.runPromise(program)
|
|
5912
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5913
5988
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5989
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5914
5990
|
* ```
|
|
5915
5991
|
*
|
|
5916
5992
|
* @since 2.0.0
|
|
@@ -5920,16 +5996,29 @@ export declare const partitionEither: {
|
|
|
5920
5996
|
readonly bufferSize?: number | undefined;
|
|
5921
5997
|
} | undefined): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[left: Stream<A2, E2 | E, never>, right: Stream<A3, E2 | E, never>], E2 | E, Scope.Scope | R2 | R>;
|
|
5922
5998
|
/**
|
|
5923
|
-
*
|
|
5924
|
-
*
|
|
5999
|
+
* Splits a stream into two substreams based on an effectful condition.
|
|
6000
|
+
*
|
|
6001
|
+
* **Details**
|
|
6002
|
+
*
|
|
6003
|
+
* The `Stream.partitionEither` function is used to divide a stream into two
|
|
6004
|
+
* parts: one for elements that satisfy a condition producing `Either.left`
|
|
6005
|
+
* values, and another for those that produce `Either.right` values. This
|
|
6006
|
+
* function applies an effectful predicate to each element in the stream to
|
|
6007
|
+
* determine which substream it belongs to.
|
|
6008
|
+
*
|
|
6009
|
+
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
6010
|
+
* one.
|
|
6011
|
+
*
|
|
6012
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
5925
6013
|
*
|
|
5926
6014
|
* @example
|
|
5927
6015
|
* ```ts
|
|
6016
|
+
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
5928
6017
|
* import { Effect, Either, Stream } from "effect"
|
|
5929
6018
|
*
|
|
5930
6019
|
* const partition = Stream.range(1, 9).pipe(
|
|
5931
6020
|
* Stream.partitionEither(
|
|
5932
|
-
* (n) => Effect.succeed(n % 2 === 0 ? Either.
|
|
6021
|
+
* (n) => Effect.succeed(n % 2 === 0 ? Either.right(n) : Either.left(n)),
|
|
5933
6022
|
* { bufferSize: 5 }
|
|
5934
6023
|
* )
|
|
5935
6024
|
* )
|
|
@@ -5943,8 +6032,8 @@ export declare const partitionEither: {
|
|
|
5943
6032
|
* )
|
|
5944
6033
|
*
|
|
5945
6034
|
* // Effect.runPromise(program)
|
|
5946
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5947
6035
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6036
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5948
6037
|
* ```
|
|
5949
6038
|
*
|
|
5950
6039
|
* @since 2.0.0
|
|
@@ -6826,21 +6915,21 @@ export declare const run: {
|
|
|
6826
6915
|
* @since 2.0.0
|
|
6827
6916
|
* @category destructors
|
|
6828
6917
|
*/
|
|
6829
|
-
export declare const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk.Chunk<A>, E,
|
|
6918
|
+
export declare const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk.Chunk<A>, E, R>;
|
|
6830
6919
|
/**
|
|
6831
6920
|
* Runs the stream and emits the number of elements processed
|
|
6832
6921
|
*
|
|
6833
6922
|
* @since 2.0.0
|
|
6834
6923
|
* @category destructors
|
|
6835
6924
|
*/
|
|
6836
|
-
export declare const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number, E,
|
|
6925
|
+
export declare const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number, E, R>;
|
|
6837
6926
|
/**
|
|
6838
6927
|
* Runs the stream only for its effects. The emitted elements are discarded.
|
|
6839
6928
|
*
|
|
6840
6929
|
* @since 2.0.0
|
|
6841
6930
|
* @category destructors
|
|
6842
6931
|
*/
|
|
6843
|
-
export declare const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E,
|
|
6932
|
+
export declare const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E, R>;
|
|
6844
6933
|
/**
|
|
6845
6934
|
* Executes a pure fold over the stream of values - reduces all elements in
|
|
6846
6935
|
* the stream to a value of type `S`.
|
|
@@ -6856,7 +6945,7 @@ export declare const runFold: {
|
|
|
6856
6945
|
* @since 2.0.0
|
|
6857
6946
|
* @category destructors
|
|
6858
6947
|
*/
|
|
6859
|
-
<S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E,
|
|
6948
|
+
<S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>;
|
|
6860
6949
|
/**
|
|
6861
6950
|
* Executes a pure fold over the stream of values - reduces all elements in
|
|
6862
6951
|
* the stream to a value of type `S`.
|
|
@@ -6864,7 +6953,7 @@ export declare const runFold: {
|
|
|
6864
6953
|
* @since 2.0.0
|
|
6865
6954
|
* @category destructors
|
|
6866
6955
|
*/
|
|
6867
|
-
<A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E,
|
|
6956
|
+
<A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, R>;
|
|
6868
6957
|
};
|
|
6869
6958
|
/**
|
|
6870
6959
|
* Executes an effectful fold over the stream of values.
|
|
@@ -6953,7 +7042,7 @@ export declare const runFoldWhile: {
|
|
|
6953
7042
|
* @since 2.0.0
|
|
6954
7043
|
* @category destructors
|
|
6955
7044
|
*/
|
|
6956
|
-
<S, A>(s: S, cont: Predicate<S>, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E,
|
|
7045
|
+
<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>;
|
|
6957
7046
|
/**
|
|
6958
7047
|
* Reduces the elements in the stream to a value of type `S`. Stops the fold
|
|
6959
7048
|
* early when the condition is not fulfilled. Example:
|
|
@@ -6961,7 +7050,7 @@ export declare const runFoldWhile: {
|
|
|
6961
7050
|
* @since 2.0.0
|
|
6962
7051
|
* @category destructors
|
|
6963
7052
|
*/
|
|
6964
|
-
<A, E, R, S>(self: Stream<A, E, R>, s: S, cont: Predicate<S>, f: (s: S, a: A) => S): Effect.Effect<S, E,
|
|
7053
|
+
<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>;
|
|
6965
7054
|
};
|
|
6966
7055
|
/**
|
|
6967
7056
|
* Executes an effectful fold over the stream of values. Stops the fold early
|
|
@@ -7583,6 +7672,15 @@ export declare const scheduleWith: {
|
|
|
7583
7672
|
* @category constructors
|
|
7584
7673
|
*/
|
|
7585
7674
|
export declare const scoped: <A, E, R>(effect: Effect.Effect<A, E, R>) => Stream<A, E, Exclude<R, Scope.Scope>>;
|
|
7675
|
+
/**
|
|
7676
|
+
* Use a function that receives a scope and returns an effect to emit an output
|
|
7677
|
+
* element. The output element will be the result of the returned effect, if
|
|
7678
|
+
* successful.
|
|
7679
|
+
*
|
|
7680
|
+
* @since 3.11.0
|
|
7681
|
+
* @category constructors
|
|
7682
|
+
*/
|
|
7683
|
+
export declare const scopedWith: <A, E, R>(f: (scope: Scope.Scope) => Effect.Effect<A, E, R>) => Stream<A, E, R>;
|
|
7586
7684
|
/**
|
|
7587
7685
|
* Emits a sliding window of `n` elements.
|
|
7588
7686
|
*
|
|
@@ -9061,6 +9159,15 @@ export declare const unwrap: <A, E2, R2, E, R>(effect: Effect.Effect<Stream<A, E
|
|
|
9061
9159
|
* @category constructors
|
|
9062
9160
|
*/
|
|
9063
9161
|
export declare const unwrapScoped: <A, E2, R2, E, R>(effect: Effect.Effect<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R2 | Exclude<R, Scope.Scope>>;
|
|
9162
|
+
/**
|
|
9163
|
+
* Creates a stream produced from a function which receives a `Scope` and
|
|
9164
|
+
* returns an `Effect`. The resulting stream will emit a single element, which
|
|
9165
|
+
* will be the result of the returned effect, if successful.
|
|
9166
|
+
*
|
|
9167
|
+
* @since 3.11.0
|
|
9168
|
+
* @category constructors
|
|
9169
|
+
*/
|
|
9170
|
+
export declare const unwrapScopedWith: <A, E2, R2, E, R>(f: (scope: Scope.Scope) => Effect.Effect<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R | R2>;
|
|
9064
9171
|
/**
|
|
9065
9172
|
* Updates the specified service within the context of the `Stream`.
|
|
9066
9173
|
*
|