effect 3.13.9 → 3.13.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Arbitrary.js +38 -22
- package/dist/cjs/Arbitrary.js.map +1 -1
- package/dist/cjs/Array.js +50 -50
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/Brand.js +9 -4
- package/dist/cjs/Brand.js.map +1 -1
- package/dist/cjs/Cause.js +1 -0
- package/dist/cjs/Cause.js.map +1 -1
- package/dist/cjs/Chunk.js +25 -23
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Config.js +2 -1
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Context.js +4 -4
- package/dist/cjs/Effect.js +823 -632
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +12 -12
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/LogLevel.js +1 -1
- package/dist/cjs/Logger.js +12 -12
- package/dist/cjs/Match.js +26 -26
- package/dist/cjs/Option.js +43 -43
- package/dist/cjs/Predicate.js +6 -2
- package/dist/cjs/Predicate.js.map +1 -1
- package/dist/cjs/Schema.js +21 -17
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/SchemaAST.js +49 -25
- package/dist/cjs/SchemaAST.js.map +1 -1
- package/dist/cjs/Scope.js +2 -0
- package/dist/cjs/Scope.js.map +1 -1
- package/dist/cjs/Stream.js +93 -93
- package/dist/cjs/internal/core.js +1 -1
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/schema/util.js +23 -14
- package/dist/cjs/internal/schema/util.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/Array.d.ts +47 -47
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/Brand.d.ts +14 -6
- package/dist/dts/Brand.d.ts.map +1 -1
- package/dist/dts/Cause.d.ts +1 -0
- package/dist/dts/Cause.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +91 -89
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Config.d.ts +2 -1
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Context.d.ts +4 -4
- package/dist/dts/Effect.d.ts +2107 -1621
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +33 -33
- package/dist/dts/LogLevel.d.ts +3 -3
- package/dist/dts/Logger.d.ts +16 -16
- package/dist/dts/Match.d.ts +26 -26
- package/dist/dts/Option.d.ts +84 -84
- package/dist/dts/Predicate.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +53 -21
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/SchemaAST.d.ts.map +1 -1
- package/dist/dts/Scope.d.ts +2 -0
- package/dist/dts/Scope.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +229 -229
- package/dist/esm/Arbitrary.js +38 -22
- package/dist/esm/Arbitrary.js.map +1 -1
- package/dist/esm/Array.js +50 -50
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/Brand.js +9 -4
- package/dist/esm/Brand.js.map +1 -1
- package/dist/esm/Cause.js +1 -0
- package/dist/esm/Cause.js.map +1 -1
- package/dist/esm/Chunk.js +25 -23
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Config.js +2 -1
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Context.js +4 -4
- package/dist/esm/Effect.js +845 -648
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +17 -17
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/LogLevel.js +1 -1
- package/dist/esm/Logger.js +12 -12
- package/dist/esm/Match.js +26 -26
- package/dist/esm/Option.js +48 -48
- package/dist/esm/Predicate.js +3 -0
- package/dist/esm/Predicate.js.map +1 -1
- package/dist/esm/Schema.js +21 -17
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/SchemaAST.js +46 -22
- package/dist/esm/SchemaAST.js.map +1 -1
- package/dist/esm/Scope.js +2 -0
- package/dist/esm/Scope.js.map +1 -1
- package/dist/esm/Stream.js +101 -101
- package/dist/esm/internal/core.js +1 -1
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/schema/util.js +23 -14
- package/dist/esm/internal/schema/util.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/Arbitrary.ts +39 -24
- package/src/Array.ts +116 -113
- package/src/Brand.ts +14 -6
- package/src/Cause.ts +1 -0
- package/src/Chunk.ts +97 -95
- package/src/Config.ts +2 -1
- package/src/Context.ts +4 -4
- package/src/Effect.ts +2107 -1621
- package/src/Either.ts +34 -34
- package/src/LogLevel.ts +3 -3
- package/src/Logger.ts +16 -16
- package/src/Match.ts +26 -26
- package/src/Option.ts +84 -84
- package/src/Predicate.ts +4 -0
- package/src/Schema.ts +87 -41
- package/src/SchemaAST.ts +47 -22
- package/src/Scope.ts +2 -0
- package/src/Stream.ts +229 -229
- package/src/internal/core.ts +2 -1
- package/src/internal/schema/util.ts +34 -25
- package/src/internal/version.ts +1 -1
package/dist/dts/Stream.d.ts
CHANGED
|
@@ -192,7 +192,7 @@ export declare const accumulateChunks: <A, E, R>(self: Stream<A, E, R>) => Strea
|
|
|
192
192
|
* (file) => file.close
|
|
193
193
|
* ).pipe(Stream.flatMap((file) => file.getLines))
|
|
194
194
|
*
|
|
195
|
-
*
|
|
195
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
196
196
|
* // Opening file.txt
|
|
197
197
|
* // Closing file.txt
|
|
198
198
|
* // { _id: 'Chunk', values: [ [ 'Line 1', 'Line 2', 'Line 3' ] ] }
|
|
@@ -334,7 +334,7 @@ export declare const aggregateWithinEither: {
|
|
|
334
334
|
*
|
|
335
335
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
336
336
|
*
|
|
337
|
-
*
|
|
337
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
338
338
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
339
339
|
* ```
|
|
340
340
|
*
|
|
@@ -351,7 +351,7 @@ export declare const as: {
|
|
|
351
351
|
*
|
|
352
352
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
353
353
|
*
|
|
354
|
-
*
|
|
354
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
355
355
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
356
356
|
* ```
|
|
357
357
|
*
|
|
@@ -368,7 +368,7 @@ export declare const as: {
|
|
|
368
368
|
*
|
|
369
369
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
370
370
|
*
|
|
371
|
-
*
|
|
371
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
372
372
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
373
373
|
* ```
|
|
374
374
|
*
|
|
@@ -411,7 +411,7 @@ export {
|
|
|
411
411
|
* }
|
|
412
412
|
* )
|
|
413
413
|
*
|
|
414
|
-
*
|
|
414
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
415
415
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
416
416
|
*
|
|
417
417
|
* ```
|
|
@@ -546,7 +546,7 @@ export declare const branchAfter: {
|
|
|
546
546
|
* )
|
|
547
547
|
* )
|
|
548
548
|
*
|
|
549
|
-
*
|
|
549
|
+
* Effect.runPromise(numbers).then(console.log)
|
|
550
550
|
* // Emit 1 element before broadcasting
|
|
551
551
|
* // Emit 2 element before broadcasting
|
|
552
552
|
* // Emit 3 element before broadcasting
|
|
@@ -628,7 +628,7 @@ export declare const broadcast: {
|
|
|
628
628
|
* )
|
|
629
629
|
* )
|
|
630
630
|
*
|
|
631
|
-
*
|
|
631
|
+
* Effect.runPromise(numbers).then(console.log)
|
|
632
632
|
* // Emit 1 element before broadcasting
|
|
633
633
|
* // Emit 2 element before broadcasting
|
|
634
634
|
* // Emit 3 element before broadcasting
|
|
@@ -717,7 +717,7 @@ export declare const broadcast: {
|
|
|
717
717
|
* )
|
|
718
718
|
* )
|
|
719
719
|
*
|
|
720
|
-
*
|
|
720
|
+
* Effect.runPromise(numbers).then(console.log)
|
|
721
721
|
* // Emit 1 element before broadcasting
|
|
722
722
|
* // Emit 2 element before broadcasting
|
|
723
723
|
* // Emit 3 element before broadcasting
|
|
@@ -977,7 +977,7 @@ export declare const broadcastedQueuesDynamic: {
|
|
|
977
977
|
* Stream.schedule(Schedule.spaced("5 seconds"))
|
|
978
978
|
* )
|
|
979
979
|
*
|
|
980
|
-
*
|
|
980
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
981
981
|
* // before buffering: 1
|
|
982
982
|
* // before buffering: 2
|
|
983
983
|
* // before buffering: 3
|
|
@@ -1019,7 +1019,7 @@ export declare const buffer: {
|
|
|
1019
1019
|
* Stream.schedule(Schedule.spaced("5 seconds"))
|
|
1020
1020
|
* )
|
|
1021
1021
|
*
|
|
1022
|
-
*
|
|
1022
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1023
1023
|
* // before buffering: 1
|
|
1024
1024
|
* // before buffering: 2
|
|
1025
1025
|
* // before buffering: 3
|
|
@@ -1066,7 +1066,7 @@ export declare const buffer: {
|
|
|
1066
1066
|
* Stream.schedule(Schedule.spaced("5 seconds"))
|
|
1067
1067
|
* )
|
|
1068
1068
|
*
|
|
1069
|
-
*
|
|
1069
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1070
1070
|
* // before buffering: 1
|
|
1071
1071
|
* // before buffering: 2
|
|
1072
1072
|
* // before buffering: 3
|
|
@@ -1336,7 +1336,7 @@ export declare const catchSomeCause: {
|
|
|
1336
1336
|
*
|
|
1337
1337
|
* const stream = Stream.make(1, 1, 1, 2, 2, 3, 4).pipe(Stream.changes)
|
|
1338
1338
|
*
|
|
1339
|
-
*
|
|
1339
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1340
1340
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
|
|
1341
1341
|
* ```
|
|
1342
1342
|
*
|
|
@@ -1524,7 +1524,7 @@ export declare const combineChunks: {
|
|
|
1524
1524
|
*
|
|
1525
1525
|
* const stream = Stream.concat(s1, s2)
|
|
1526
1526
|
*
|
|
1527
|
-
*
|
|
1527
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1528
1528
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1529
1529
|
* ```
|
|
1530
1530
|
*
|
|
@@ -1546,7 +1546,7 @@ export declare const concat: {
|
|
|
1546
1546
|
*
|
|
1547
1547
|
* const stream = Stream.concat(s1, s2)
|
|
1548
1548
|
*
|
|
1549
|
-
*
|
|
1549
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1550
1550
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1551
1551
|
* ```
|
|
1552
1552
|
*
|
|
@@ -1568,7 +1568,7 @@ export declare const concat: {
|
|
|
1568
1568
|
*
|
|
1569
1569
|
* const stream = Stream.concat(s1, s2)
|
|
1570
1570
|
*
|
|
1571
|
-
*
|
|
1571
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1572
1572
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1573
1573
|
* ```
|
|
1574
1574
|
*
|
|
@@ -1590,7 +1590,7 @@ export declare const concat: {
|
|
|
1590
1590
|
*
|
|
1591
1591
|
* const stream = Stream.concatAll(Chunk.make(s1, s2, s3))
|
|
1592
1592
|
*
|
|
1593
|
-
*
|
|
1593
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1594
1594
|
* // {
|
|
1595
1595
|
* // _id: 'Chunk',
|
|
1596
1596
|
* // values: [
|
|
@@ -1620,7 +1620,7 @@ export declare const concatAll: <A, E, R>(streams: Chunk.Chunk<Stream<A, E, R>>)
|
|
|
1620
1620
|
*
|
|
1621
1621
|
* const product = Stream.cross(s1, s2)
|
|
1622
1622
|
*
|
|
1623
|
-
*
|
|
1623
|
+
* Effect.runPromise(Stream.runCollect(product)).then(console.log)
|
|
1624
1624
|
* // {
|
|
1625
1625
|
* // _id: "Chunk",
|
|
1626
1626
|
* // values: [
|
|
@@ -1649,7 +1649,7 @@ export declare const cross: {
|
|
|
1649
1649
|
*
|
|
1650
1650
|
* const product = Stream.cross(s1, s2)
|
|
1651
1651
|
*
|
|
1652
|
-
*
|
|
1652
|
+
* Effect.runPromise(Stream.runCollect(product)).then(console.log)
|
|
1653
1653
|
* // {
|
|
1654
1654
|
* // _id: "Chunk",
|
|
1655
1655
|
* // values: [
|
|
@@ -1678,7 +1678,7 @@ export declare const cross: {
|
|
|
1678
1678
|
*
|
|
1679
1679
|
* const product = Stream.cross(s1, s2)
|
|
1680
1680
|
*
|
|
1681
|
-
*
|
|
1681
|
+
* Effect.runPromise(Stream.runCollect(product)).then(console.log)
|
|
1682
1682
|
* // {
|
|
1683
1683
|
* // _id: "Chunk",
|
|
1684
1684
|
* // values: [
|
|
@@ -1834,7 +1834,7 @@ export declare const crossWith: {
|
|
|
1834
1834
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
1835
1835
|
* )
|
|
1836
1836
|
*
|
|
1837
|
-
*
|
|
1837
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1838
1838
|
* // Received 1 after 5ms
|
|
1839
1839
|
* // Received 2 after 2ms
|
|
1840
1840
|
* // Received 3 after 0ms
|
|
@@ -1890,7 +1890,7 @@ export declare const debounce: {
|
|
|
1890
1890
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
1891
1891
|
* )
|
|
1892
1892
|
*
|
|
1893
|
-
*
|
|
1893
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1894
1894
|
* // Received 1 after 5ms
|
|
1895
1895
|
* // Received 2 after 2ms
|
|
1896
1896
|
* // Received 3 after 0ms
|
|
@@ -1946,7 +1946,7 @@ export declare const debounce: {
|
|
|
1946
1946
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
1947
1947
|
* )
|
|
1948
1948
|
*
|
|
1949
|
-
*
|
|
1949
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1950
1950
|
* // Received 1 after 5ms
|
|
1951
1951
|
* // Received 2 after 2ms
|
|
1952
1952
|
* // Received 3 after 0ms
|
|
@@ -2077,7 +2077,7 @@ export declare const distributedWithDynamic: {
|
|
|
2077
2077
|
* // We create a stream and immediately drain it.
|
|
2078
2078
|
* const stream = Stream.range(1, 6).pipe(Stream.drain)
|
|
2079
2079
|
*
|
|
2080
|
-
*
|
|
2080
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2081
2081
|
* // { _id: 'Chunk', values: [] }
|
|
2082
2082
|
* ```
|
|
2083
2083
|
*
|
|
@@ -2283,7 +2283,7 @@ export declare const either: <A, E, R>(self: Stream<A, E, R>) => Stream<Either.E
|
|
|
2283
2283
|
*
|
|
2284
2284
|
* const stream = Stream.empty
|
|
2285
2285
|
*
|
|
2286
|
-
*
|
|
2286
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2287
2287
|
* // { _id: 'Chunk', values: [] }
|
|
2288
2288
|
* ```
|
|
2289
2289
|
*
|
|
@@ -2305,7 +2305,7 @@ export declare const empty: Stream<never>;
|
|
|
2305
2305
|
* )
|
|
2306
2306
|
* )
|
|
2307
2307
|
*
|
|
2308
|
-
*
|
|
2308
|
+
* Effect.runPromise(Stream.runCollect(program)).then(console.log)
|
|
2309
2309
|
* // Application Logic.
|
|
2310
2310
|
* // Finalizing the stream
|
|
2311
2311
|
* // Doing some other works after stream's finalization
|
|
@@ -2330,7 +2330,7 @@ export declare const ensuring: {
|
|
|
2330
2330
|
* )
|
|
2331
2331
|
* )
|
|
2332
2332
|
*
|
|
2333
|
-
*
|
|
2333
|
+
* Effect.runPromise(Stream.runCollect(program)).then(console.log)
|
|
2334
2334
|
* // Application Logic.
|
|
2335
2335
|
* // Finalizing the stream
|
|
2336
2336
|
* // Doing some other works after stream's finalization
|
|
@@ -2355,7 +2355,7 @@ export declare const ensuring: {
|
|
|
2355
2355
|
* )
|
|
2356
2356
|
* )
|
|
2357
2357
|
*
|
|
2358
|
-
*
|
|
2358
|
+
* Effect.runPromise(Stream.runCollect(program)).then(console.log)
|
|
2359
2359
|
* // Application Logic.
|
|
2360
2360
|
* // Finalizing the stream
|
|
2361
2361
|
* // Doing some other works after stream's finalization
|
|
@@ -2475,7 +2475,7 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => St
|
|
|
2475
2475
|
*
|
|
2476
2476
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2477
2477
|
*
|
|
2478
|
-
*
|
|
2478
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2479
2479
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2480
2480
|
* ```
|
|
2481
2481
|
*
|
|
@@ -2492,7 +2492,7 @@ export declare const filter: {
|
|
|
2492
2492
|
*
|
|
2493
2493
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2494
2494
|
*
|
|
2495
|
-
*
|
|
2495
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2496
2496
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2497
2497
|
* ```
|
|
2498
2498
|
*
|
|
@@ -2509,7 +2509,7 @@ export declare const filter: {
|
|
|
2509
2509
|
*
|
|
2510
2510
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2511
2511
|
*
|
|
2512
|
-
*
|
|
2512
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2513
2513
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2514
2514
|
* ```
|
|
2515
2515
|
*
|
|
@@ -2526,7 +2526,7 @@ export declare const filter: {
|
|
|
2526
2526
|
*
|
|
2527
2527
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2528
2528
|
*
|
|
2529
|
-
*
|
|
2529
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2530
2530
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2531
2531
|
* ```
|
|
2532
2532
|
*
|
|
@@ -2543,7 +2543,7 @@ export declare const filter: {
|
|
|
2543
2543
|
*
|
|
2544
2544
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2545
2545
|
*
|
|
2546
|
-
*
|
|
2546
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2547
2547
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2548
2548
|
* ```
|
|
2549
2549
|
*
|
|
@@ -2690,7 +2690,7 @@ export declare const filterMapWhileEffect: {
|
|
|
2690
2690
|
* )
|
|
2691
2691
|
* )
|
|
2692
2692
|
*
|
|
2693
|
-
*
|
|
2693
|
+
* Effect.runPromise(Stream.runCollect(program)).then(console.log)
|
|
2694
2694
|
* // Application Logic.
|
|
2695
2695
|
* // Deleting dir: tmp
|
|
2696
2696
|
* // Temporary directory was deleted.
|
|
@@ -2917,7 +2917,7 @@ export declare const forever: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R
|
|
|
2917
2917
|
* (e) => new Error(String(e)) // Error Handling
|
|
2918
2918
|
* )
|
|
2919
2919
|
*
|
|
2920
|
-
*
|
|
2920
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2921
2921
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
2922
2922
|
* ```
|
|
2923
2923
|
*
|
|
@@ -2949,7 +2949,7 @@ export declare const toChannel: <A, E, R>(stream: Stream<A, E, R>) => Channel.Ch
|
|
|
2949
2949
|
* // Creating a stream with values from a single Chunk
|
|
2950
2950
|
* const stream = Stream.fromChunk(Chunk.make(1, 2, 3))
|
|
2951
2951
|
*
|
|
2952
|
-
*
|
|
2952
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2953
2953
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
2954
2954
|
* ```
|
|
2955
2955
|
*
|
|
@@ -3020,7 +3020,7 @@ export declare const fromChunkQueue: <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, o
|
|
|
3020
3020
|
* // Creating a stream with values from multiple Chunks
|
|
3021
3021
|
* const stream = Stream.fromChunks(Chunk.make(1, 2, 3), Chunk.make(4, 5, 6))
|
|
3022
3022
|
*
|
|
3023
|
-
*
|
|
3023
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3024
3024
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
3025
3025
|
* ```
|
|
3026
3026
|
*
|
|
@@ -3038,7 +3038,7 @@ export declare const fromChunks: <A>(...chunks: Array<Chunk.Chunk<A>>) => Stream
|
|
|
3038
3038
|
*
|
|
3039
3039
|
* const stream = Stream.fromEffect(Random.nextInt)
|
|
3040
3040
|
*
|
|
3041
|
-
*
|
|
3041
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3042
3042
|
* // Example Output: { _id: 'Chunk', values: [ 922694024 ] }
|
|
3043
3043
|
* ```
|
|
3044
3044
|
*
|
|
@@ -3114,7 +3114,7 @@ export declare const fromTPubSub: <A>(pubsub: TPubSub<A>) => Stream<A>;
|
|
|
3114
3114
|
*
|
|
3115
3115
|
* const stream = Stream.fromIterable(numbers)
|
|
3116
3116
|
*
|
|
3117
|
-
*
|
|
3117
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3118
3118
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
3119
3119
|
* ```
|
|
3120
3120
|
*
|
|
@@ -3138,9 +3138,9 @@ export declare const fromIterable: <A>(iterable: Iterable<A>) => Stream<A>;
|
|
|
3138
3138
|
*
|
|
3139
3139
|
* const stream = Stream.fromIterableEffect(getUsers)
|
|
3140
3140
|
*
|
|
3141
|
-
*
|
|
3142
|
-
*
|
|
3143
|
-
*
|
|
3141
|
+
* Effect.runPromise(
|
|
3142
|
+
* Stream.runCollect(stream.pipe(Stream.provideService(Database, { getUsers: Effect.succeed(["user1", "user2"]) })))
|
|
3143
|
+
* ).then(console.log)
|
|
3144
3144
|
* // { _id: 'Chunk', values: [ 'user1', 'user2' ] }
|
|
3145
3145
|
* ```
|
|
3146
3146
|
*
|
|
@@ -3269,7 +3269,7 @@ export declare const fromReadableStreamByob: {
|
|
|
3269
3269
|
*
|
|
3270
3270
|
* const stream = Stream.fromSchedule(schedule)
|
|
3271
3271
|
*
|
|
3272
|
-
*
|
|
3272
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3273
3273
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
3274
3274
|
* ```
|
|
3275
3275
|
*
|
|
@@ -3329,7 +3329,7 @@ export declare const groupAdjacentBy: {
|
|
|
3329
3329
|
* )
|
|
3330
3330
|
* ))
|
|
3331
3331
|
*
|
|
3332
|
-
*
|
|
3332
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3333
3333
|
* // {
|
|
3334
3334
|
* // _id: 'Chunk',
|
|
3335
3335
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
@@ -3367,7 +3367,7 @@ export declare const groupBy: {
|
|
|
3367
3367
|
* )
|
|
3368
3368
|
* ))
|
|
3369
3369
|
*
|
|
3370
|
-
*
|
|
3370
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3371
3371
|
* // {
|
|
3372
3372
|
* // _id: 'Chunk',
|
|
3373
3373
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
@@ -3407,7 +3407,7 @@ export declare const groupBy: {
|
|
|
3407
3407
|
* )
|
|
3408
3408
|
* ))
|
|
3409
3409
|
*
|
|
3410
|
-
*
|
|
3410
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3411
3411
|
* // {
|
|
3412
3412
|
* // _id: 'Chunk',
|
|
3413
3413
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
@@ -3543,7 +3543,7 @@ export declare const groupByKey: {
|
|
|
3543
3543
|
*
|
|
3544
3544
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
3545
3545
|
*
|
|
3546
|
-
*
|
|
3546
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log("%o", chunks))
|
|
3547
3547
|
* // {
|
|
3548
3548
|
* // _id: 'Chunk',
|
|
3549
3549
|
* // values: [
|
|
@@ -3568,7 +3568,7 @@ export declare const grouped: {
|
|
|
3568
3568
|
*
|
|
3569
3569
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
3570
3570
|
*
|
|
3571
|
-
*
|
|
3571
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log("%o", chunks))
|
|
3572
3572
|
* // {
|
|
3573
3573
|
* // _id: 'Chunk',
|
|
3574
3574
|
* // values: [
|
|
@@ -3593,7 +3593,7 @@ export declare const grouped: {
|
|
|
3593
3593
|
*
|
|
3594
3594
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
3595
3595
|
*
|
|
3596
|
-
*
|
|
3596
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log("%o", chunks))
|
|
3597
3597
|
* // {
|
|
3598
3598
|
* // _id: 'Chunk',
|
|
3599
3599
|
* // values: [
|
|
@@ -3624,7 +3624,7 @@ export declare const grouped: {
|
|
|
3624
3624
|
* Stream.take(3)
|
|
3625
3625
|
* )
|
|
3626
3626
|
*
|
|
3627
|
-
*
|
|
3627
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log(Chunk.toArray(chunks)))
|
|
3628
3628
|
* // [
|
|
3629
3629
|
* // {
|
|
3630
3630
|
* // _id: 'Chunk',
|
|
@@ -3671,7 +3671,7 @@ export declare const groupedWithin: {
|
|
|
3671
3671
|
* Stream.take(3)
|
|
3672
3672
|
* )
|
|
3673
3673
|
*
|
|
3674
|
-
*
|
|
3674
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log(Chunk.toArray(chunks)))
|
|
3675
3675
|
* // [
|
|
3676
3676
|
* // {
|
|
3677
3677
|
* // _id: 'Chunk',
|
|
@@ -3718,7 +3718,7 @@ export declare const groupedWithin: {
|
|
|
3718
3718
|
* Stream.take(3)
|
|
3719
3719
|
* )
|
|
3720
3720
|
*
|
|
3721
|
-
*
|
|
3721
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log(Chunk.toArray(chunks)))
|
|
3722
3722
|
* // [
|
|
3723
3723
|
* // {
|
|
3724
3724
|
* // _id: 'Chunk',
|
|
@@ -3879,7 +3879,7 @@ export declare const identity: <A, E = never, R = never>() => Stream<A, E, R>;
|
|
|
3879
3879
|
*
|
|
3880
3880
|
* const stream = Stream.interleave(s1, s2)
|
|
3881
3881
|
*
|
|
3882
|
-
*
|
|
3882
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3883
3883
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
3884
3884
|
* ```
|
|
3885
3885
|
* @since 2.0.0
|
|
@@ -3901,7 +3901,7 @@ export declare const interleave: {
|
|
|
3901
3901
|
*
|
|
3902
3902
|
* const stream = Stream.interleave(s1, s2)
|
|
3903
3903
|
*
|
|
3904
|
-
*
|
|
3904
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3905
3905
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
3906
3906
|
* ```
|
|
3907
3907
|
* @since 2.0.0
|
|
@@ -3923,7 +3923,7 @@ export declare const interleave: {
|
|
|
3923
3923
|
*
|
|
3924
3924
|
* const stream = Stream.interleave(s1, s2)
|
|
3925
3925
|
*
|
|
3926
|
-
*
|
|
3926
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3927
3927
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
3928
3928
|
* ```
|
|
3929
3929
|
* @since 2.0.0
|
|
@@ -3951,7 +3951,7 @@ export declare const interleave: {
|
|
|
3951
3951
|
*
|
|
3952
3952
|
* const stream = Stream.interleaveWith(s1, s2, booleanStream)
|
|
3953
3953
|
*
|
|
3954
|
-
*
|
|
3954
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3955
3955
|
* // {
|
|
3956
3956
|
* // _id: 'Chunk',
|
|
3957
3957
|
* // values: [
|
|
@@ -3985,7 +3985,7 @@ export declare const interleaveWith: {
|
|
|
3985
3985
|
*
|
|
3986
3986
|
* const stream = Stream.interleaveWith(s1, s2, booleanStream)
|
|
3987
3987
|
*
|
|
3988
|
-
*
|
|
3988
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3989
3989
|
* // {
|
|
3990
3990
|
* // _id: 'Chunk',
|
|
3991
3991
|
* // values: [
|
|
@@ -4019,7 +4019,7 @@ export declare const interleaveWith: {
|
|
|
4019
4019
|
*
|
|
4020
4020
|
* const stream = Stream.interleaveWith(s1, s2, booleanStream)
|
|
4021
4021
|
*
|
|
4022
|
-
*
|
|
4022
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4023
4023
|
* // {
|
|
4024
4024
|
* // _id: 'Chunk',
|
|
4025
4025
|
* // values: [
|
|
@@ -4043,7 +4043,7 @@ export declare const interleaveWith: {
|
|
|
4043
4043
|
*
|
|
4044
4044
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
4045
4045
|
*
|
|
4046
|
-
*
|
|
4046
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4047
4047
|
* // {
|
|
4048
4048
|
* // _id: 'Chunk',
|
|
4049
4049
|
* // values: [
|
|
@@ -4066,7 +4066,7 @@ export declare const intersperse: {
|
|
|
4066
4066
|
*
|
|
4067
4067
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
4068
4068
|
*
|
|
4069
|
-
*
|
|
4069
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4070
4070
|
* // {
|
|
4071
4071
|
* // _id: 'Chunk',
|
|
4072
4072
|
* // values: [
|
|
@@ -4089,7 +4089,7 @@ export declare const intersperse: {
|
|
|
4089
4089
|
*
|
|
4090
4090
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
4091
4091
|
*
|
|
4092
|
-
*
|
|
4092
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4093
4093
|
* // {
|
|
4094
4094
|
* // _id: 'Chunk',
|
|
4095
4095
|
* // values: [
|
|
@@ -4119,7 +4119,7 @@ export declare const intersperse: {
|
|
|
4119
4119
|
* })
|
|
4120
4120
|
* )
|
|
4121
4121
|
*
|
|
4122
|
-
*
|
|
4122
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4123
4123
|
* // {
|
|
4124
4124
|
* // _id: 'Chunk',
|
|
4125
4125
|
* // values: [
|
|
@@ -4149,7 +4149,7 @@ export declare const intersperseAffixes: {
|
|
|
4149
4149
|
* })
|
|
4150
4150
|
* )
|
|
4151
4151
|
*
|
|
4152
|
-
*
|
|
4152
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4153
4153
|
* // {
|
|
4154
4154
|
* // _id: 'Chunk',
|
|
4155
4155
|
* // values: [
|
|
@@ -4183,7 +4183,7 @@ export declare const intersperseAffixes: {
|
|
|
4183
4183
|
* })
|
|
4184
4184
|
* )
|
|
4185
4185
|
*
|
|
4186
|
-
*
|
|
4186
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4187
4187
|
* // {
|
|
4188
4188
|
* // _id: 'Chunk',
|
|
4189
4189
|
* // values: [
|
|
@@ -4313,7 +4313,7 @@ export declare const interruptWhenDeferred: {
|
|
|
4313
4313
|
* // An infinite Stream of numbers starting from 1 and incrementing
|
|
4314
4314
|
* const stream = Stream.iterate(1, (n) => n + 1)
|
|
4315
4315
|
*
|
|
4316
|
-
*
|
|
4316
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(10)))).then(console.log)
|
|
4317
4317
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }
|
|
4318
4318
|
* ```
|
|
4319
4319
|
*
|
|
@@ -4330,7 +4330,7 @@ export declare const iterate: <A>(value: A, next: (value: A) => A) => Stream<A>;
|
|
|
4330
4330
|
*
|
|
4331
4331
|
* const stream = Stream.make(1, 2, 3)
|
|
4332
4332
|
*
|
|
4333
|
-
*
|
|
4333
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4334
4334
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
4335
4335
|
* ```
|
|
4336
4336
|
*
|
|
@@ -4347,7 +4347,7 @@ export declare const make: <As extends Array<any>>(...as: As) => Stream<As[numbe
|
|
|
4347
4347
|
*
|
|
4348
4348
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4349
4349
|
*
|
|
4350
|
-
*
|
|
4350
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4351
4351
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4352
4352
|
* ```
|
|
4353
4353
|
*
|
|
@@ -4364,7 +4364,7 @@ export declare const map: {
|
|
|
4364
4364
|
*
|
|
4365
4365
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4366
4366
|
*
|
|
4367
|
-
*
|
|
4367
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4368
4368
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4369
4369
|
* ```
|
|
4370
4370
|
*
|
|
@@ -4381,7 +4381,7 @@ export declare const map: {
|
|
|
4381
4381
|
*
|
|
4382
4382
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4383
4383
|
*
|
|
4384
|
-
*
|
|
4384
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4385
4385
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4386
4386
|
* ```
|
|
4387
4387
|
*
|
|
@@ -4401,9 +4401,9 @@ export declare const map: {
|
|
|
4401
4401
|
* stream.pipe(Stream.mapAccum(0, (s, a) => [s + a, s + a]))
|
|
4402
4402
|
*
|
|
4403
4403
|
* // input: 0, 1, 2, 3, 4, 5, 6
|
|
4404
|
-
*
|
|
4405
|
-
*
|
|
4406
|
-
*
|
|
4404
|
+
* Effect.runPromise(Stream.runCollect(runningTotal(Stream.range(0, 6)))).then(
|
|
4405
|
+
* console.log
|
|
4406
|
+
* )
|
|
4407
4407
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4408
4408
|
* ```
|
|
4409
4409
|
*
|
|
@@ -4422,9 +4422,9 @@ export declare const mapAccum: {
|
|
|
4422
4422
|
* stream.pipe(Stream.mapAccum(0, (s, a) => [s + a, s + a]))
|
|
4423
4423
|
*
|
|
4424
4424
|
* // input: 0, 1, 2, 3, 4, 5, 6
|
|
4425
|
-
*
|
|
4426
|
-
*
|
|
4427
|
-
*
|
|
4425
|
+
* Effect.runPromise(Stream.runCollect(runningTotal(Stream.range(0, 6)))).then(
|
|
4426
|
+
* console.log
|
|
4427
|
+
* )
|
|
4428
4428
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4429
4429
|
* ```
|
|
4430
4430
|
*
|
|
@@ -4443,9 +4443,9 @@ export declare const mapAccum: {
|
|
|
4443
4443
|
* stream.pipe(Stream.mapAccum(0, (s, a) => [s + a, s + a]))
|
|
4444
4444
|
*
|
|
4445
4445
|
* // input: 0, 1, 2, 3, 4, 5, 6
|
|
4446
|
-
*
|
|
4447
|
-
*
|
|
4448
|
-
*
|
|
4446
|
+
* Effect.runPromise(Stream.runCollect(runningTotal(Stream.range(0, 6)))).then(
|
|
4447
|
+
* console.log
|
|
4448
|
+
* )
|
|
4449
4449
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4450
4450
|
* ```
|
|
4451
4451
|
*
|
|
@@ -4567,7 +4567,7 @@ export declare const mapChunksEffect: {
|
|
|
4567
4567
|
* Stream.map((s) => parseInt(s))
|
|
4568
4568
|
* )
|
|
4569
4569
|
*
|
|
4570
|
-
*
|
|
4570
|
+
* Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4571
4571
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4572
4572
|
* ```
|
|
4573
4573
|
*
|
|
@@ -4588,7 +4588,7 @@ export declare const mapConcat: {
|
|
|
4588
4588
|
* Stream.map((s) => parseInt(s))
|
|
4589
4589
|
* )
|
|
4590
4590
|
*
|
|
4591
|
-
*
|
|
4591
|
+
* Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4592
4592
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4593
4593
|
* ```
|
|
4594
4594
|
*
|
|
@@ -4609,7 +4609,7 @@ export declare const mapConcat: {
|
|
|
4609
4609
|
* Stream.map((s) => parseInt(s))
|
|
4610
4610
|
* )
|
|
4611
4611
|
*
|
|
4612
|
-
*
|
|
4612
|
+
* Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4613
4613
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4614
4614
|
* ```
|
|
4615
4615
|
*
|
|
@@ -4704,7 +4704,7 @@ export declare const mapConcatEffect: {
|
|
|
4704
4704
|
* Stream.mapEffect((n) => Random.nextIntBetween(0, n))
|
|
4705
4705
|
* )
|
|
4706
4706
|
*
|
|
4707
|
-
*
|
|
4707
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4708
4708
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4709
4709
|
* ```
|
|
4710
4710
|
*
|
|
@@ -4723,7 +4723,7 @@ export declare const mapEffect: {
|
|
|
4723
4723
|
* Stream.mapEffect((n) => Random.nextIntBetween(0, n))
|
|
4724
4724
|
* )
|
|
4725
4725
|
*
|
|
4726
|
-
*
|
|
4726
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4727
4727
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4728
4728
|
* ```
|
|
4729
4729
|
*
|
|
@@ -4745,7 +4745,7 @@ export declare const mapEffect: {
|
|
|
4745
4745
|
* Stream.mapEffect((n) => Random.nextIntBetween(0, n))
|
|
4746
4746
|
* )
|
|
4747
4747
|
*
|
|
4748
|
-
*
|
|
4748
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4749
4749
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4750
4750
|
* ```
|
|
4751
4751
|
*
|
|
@@ -4767,7 +4767,7 @@ export declare const mapEffect: {
|
|
|
4767
4767
|
* Stream.mapEffect((n) => Random.nextIntBetween(0, n))
|
|
4768
4768
|
* )
|
|
4769
4769
|
*
|
|
4770
|
-
*
|
|
4770
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4771
4771
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4772
4772
|
* ```
|
|
4773
4773
|
*
|
|
@@ -4789,7 +4789,7 @@ export declare const mapEffect: {
|
|
|
4789
4789
|
* Stream.mapEffect((n) => Random.nextIntBetween(0, n))
|
|
4790
4790
|
* )
|
|
4791
4791
|
*
|
|
4792
|
-
*
|
|
4792
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4793
4793
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4794
4794
|
* ```
|
|
4795
4795
|
*
|
|
@@ -4864,7 +4864,7 @@ export declare const mapErrorCause: {
|
|
|
4864
4864
|
*
|
|
4865
4865
|
* const stream = Stream.merge(s1, s2)
|
|
4866
4866
|
*
|
|
4867
|
-
*
|
|
4867
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4868
4868
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
4869
4869
|
* ```
|
|
4870
4870
|
*
|
|
@@ -4891,7 +4891,7 @@ export declare const merge: {
|
|
|
4891
4891
|
*
|
|
4892
4892
|
* const stream = Stream.merge(s1, s2)
|
|
4893
4893
|
*
|
|
4894
|
-
*
|
|
4894
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4895
4895
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
4896
4896
|
* ```
|
|
4897
4897
|
*
|
|
@@ -4920,7 +4920,7 @@ export declare const merge: {
|
|
|
4920
4920
|
*
|
|
4921
4921
|
* const stream = Stream.merge(s1, s2)
|
|
4922
4922
|
*
|
|
4923
|
-
*
|
|
4923
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4924
4924
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
4925
4925
|
* ```
|
|
4926
4926
|
*
|
|
@@ -5057,7 +5057,7 @@ export declare const mergeWithTag: {
|
|
|
5057
5057
|
* onOther: (n) => Math.floor(n)
|
|
5058
5058
|
* })
|
|
5059
5059
|
*
|
|
5060
|
-
*
|
|
5060
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5061
5061
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5062
5062
|
* ```
|
|
5063
5063
|
*
|
|
@@ -5088,7 +5088,7 @@ export declare const mergeWith: {
|
|
|
5088
5088
|
* onOther: (n) => Math.floor(n)
|
|
5089
5089
|
* })
|
|
5090
5090
|
*
|
|
5091
|
-
*
|
|
5091
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5092
5092
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5093
5093
|
* ```
|
|
5094
5094
|
*
|
|
@@ -5123,7 +5123,7 @@ export declare const mergeWith: {
|
|
|
5123
5123
|
* onOther: (n) => Math.floor(n)
|
|
5124
5124
|
* })
|
|
5125
5125
|
*
|
|
5126
|
-
*
|
|
5126
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5127
5127
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5128
5128
|
* ```
|
|
5129
5129
|
*
|
|
@@ -5371,7 +5371,7 @@ export declare const onDone: {
|
|
|
5371
5371
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
5372
5372
|
* )
|
|
5373
5373
|
*
|
|
5374
|
-
*
|
|
5374
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5375
5375
|
* // Stream started
|
|
5376
5376
|
* // after mapping: 2
|
|
5377
5377
|
* // after mapping: 4
|
|
@@ -5396,7 +5396,7 @@ export declare const onStart: {
|
|
|
5396
5396
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
5397
5397
|
* )
|
|
5398
5398
|
*
|
|
5399
|
-
*
|
|
5399
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5400
5400
|
* // Stream started
|
|
5401
5401
|
* // after mapping: 2
|
|
5402
5402
|
* // after mapping: 4
|
|
@@ -5421,7 +5421,7 @@ export declare const onStart: {
|
|
|
5421
5421
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
5422
5422
|
* )
|
|
5423
5423
|
*
|
|
5424
|
-
*
|
|
5424
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5425
5425
|
* // Stream started
|
|
5426
5426
|
* // after mapping: 2
|
|
5427
5427
|
* // after mapping: 4
|
|
@@ -5653,7 +5653,7 @@ export declare const orElseSucceed: {
|
|
|
5653
5653
|
* n < 3 ? Option.some(n + 1) : Option.none()
|
|
5654
5654
|
* ])
|
|
5655
5655
|
*
|
|
5656
|
-
*
|
|
5656
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5657
5657
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3 ] }
|
|
5658
5658
|
* ```
|
|
5659
5659
|
*
|
|
@@ -5700,12 +5700,9 @@ export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effe
|
|
|
5700
5700
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5701
5701
|
* one.
|
|
5702
5702
|
*
|
|
5703
|
-
*
|
|
5704
|
-
* conditions.
|
|
5703
|
+
* **Example** (Partitioning a Stream into Even and Odd Numbers)
|
|
5705
5704
|
*
|
|
5706
|
-
* @example
|
|
5707
5705
|
* ```ts
|
|
5708
|
-
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5709
5706
|
* import { Effect, Stream } from "effect"
|
|
5710
5707
|
*
|
|
5711
5708
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5720,11 +5717,14 @@ export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effe
|
|
|
5720
5717
|
* })
|
|
5721
5718
|
* )
|
|
5722
5719
|
*
|
|
5723
|
-
*
|
|
5720
|
+
* Effect.runPromise(program)
|
|
5724
5721
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5725
5722
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5726
5723
|
* ```
|
|
5727
5724
|
*
|
|
5725
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5726
|
+
* conditions.
|
|
5727
|
+
*
|
|
5728
5728
|
* @since 2.0.0
|
|
5729
5729
|
* @category utils
|
|
5730
5730
|
*/
|
|
@@ -5741,12 +5741,9 @@ export declare const partition: {
|
|
|
5741
5741
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5742
5742
|
* one.
|
|
5743
5743
|
*
|
|
5744
|
-
*
|
|
5745
|
-
* conditions.
|
|
5744
|
+
* **Example** (Partitioning a Stream into Even and Odd Numbers)
|
|
5746
5745
|
*
|
|
5747
|
-
* @example
|
|
5748
5746
|
* ```ts
|
|
5749
|
-
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5750
5747
|
* import { Effect, Stream } from "effect"
|
|
5751
5748
|
*
|
|
5752
5749
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5761,11 +5758,14 @@ export declare const partition: {
|
|
|
5761
5758
|
* })
|
|
5762
5759
|
* )
|
|
5763
5760
|
*
|
|
5764
|
-
*
|
|
5761
|
+
* Effect.runPromise(program)
|
|
5765
5762
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5766
5763
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5767
5764
|
* ```
|
|
5768
5765
|
*
|
|
5766
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5767
|
+
* conditions.
|
|
5768
|
+
*
|
|
5769
5769
|
* @since 2.0.0
|
|
5770
5770
|
* @category utils
|
|
5771
5771
|
*/
|
|
@@ -5784,12 +5784,9 @@ export declare const partition: {
|
|
|
5784
5784
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5785
5785
|
* one.
|
|
5786
5786
|
*
|
|
5787
|
-
*
|
|
5788
|
-
* conditions.
|
|
5787
|
+
* **Example** (Partitioning a Stream into Even and Odd Numbers)
|
|
5789
5788
|
*
|
|
5790
|
-
* @example
|
|
5791
5789
|
* ```ts
|
|
5792
|
-
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5793
5790
|
* import { Effect, Stream } from "effect"
|
|
5794
5791
|
*
|
|
5795
5792
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5804,11 +5801,14 @@ export declare const partition: {
|
|
|
5804
5801
|
* })
|
|
5805
5802
|
* )
|
|
5806
5803
|
*
|
|
5807
|
-
*
|
|
5804
|
+
* Effect.runPromise(program)
|
|
5808
5805
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5809
5806
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5810
5807
|
* ```
|
|
5811
5808
|
*
|
|
5809
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5810
|
+
* conditions.
|
|
5811
|
+
*
|
|
5812
5812
|
* @since 2.0.0
|
|
5813
5813
|
* @category utils
|
|
5814
5814
|
*/
|
|
@@ -5827,12 +5827,9 @@ export declare const partition: {
|
|
|
5827
5827
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5828
5828
|
* one.
|
|
5829
5829
|
*
|
|
5830
|
-
*
|
|
5831
|
-
* conditions.
|
|
5830
|
+
* **Example** (Partitioning a Stream into Even and Odd Numbers)
|
|
5832
5831
|
*
|
|
5833
|
-
* @example
|
|
5834
5832
|
* ```ts
|
|
5835
|
-
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5836
5833
|
* import { Effect, Stream } from "effect"
|
|
5837
5834
|
*
|
|
5838
5835
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5847,11 +5844,14 @@ export declare const partition: {
|
|
|
5847
5844
|
* })
|
|
5848
5845
|
* )
|
|
5849
5846
|
*
|
|
5850
|
-
*
|
|
5847
|
+
* Effect.runPromise(program)
|
|
5851
5848
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5852
5849
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5853
5850
|
* ```
|
|
5854
5851
|
*
|
|
5852
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5853
|
+
* conditions.
|
|
5854
|
+
*
|
|
5855
5855
|
* @since 2.0.0
|
|
5856
5856
|
* @category utils
|
|
5857
5857
|
*/
|
|
@@ -5870,12 +5870,9 @@ export declare const partition: {
|
|
|
5870
5870
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5871
5871
|
* one.
|
|
5872
5872
|
*
|
|
5873
|
-
*
|
|
5874
|
-
* conditions.
|
|
5873
|
+
* **Example** (Partitioning a Stream into Even and Odd Numbers)
|
|
5875
5874
|
*
|
|
5876
|
-
* @example
|
|
5877
5875
|
* ```ts
|
|
5878
|
-
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
5879
5876
|
* import { Effect, Stream } from "effect"
|
|
5880
5877
|
*
|
|
5881
5878
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5890,11 +5887,14 @@ export declare const partition: {
|
|
|
5890
5887
|
* })
|
|
5891
5888
|
* )
|
|
5892
5889
|
*
|
|
5893
|
-
*
|
|
5890
|
+
* Effect.runPromise(program)
|
|
5894
5891
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5895
5892
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5896
5893
|
* ```
|
|
5897
5894
|
*
|
|
5895
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
5896
|
+
* conditions.
|
|
5897
|
+
*
|
|
5898
5898
|
* @since 2.0.0
|
|
5899
5899
|
* @category utils
|
|
5900
5900
|
*/
|
|
@@ -5916,11 +5916,9 @@ export declare const partition: {
|
|
|
5916
5916
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5917
5917
|
* one.
|
|
5918
5918
|
*
|
|
5919
|
-
*
|
|
5919
|
+
* **Example** (Partitioning a Stream with an Effectful Predicate)
|
|
5920
5920
|
*
|
|
5921
|
-
* @example
|
|
5922
5921
|
* ```ts
|
|
5923
|
-
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
5924
5922
|
* import { Effect, Either, Stream } from "effect"
|
|
5925
5923
|
*
|
|
5926
5924
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5938,11 +5936,13 @@ export declare const partition: {
|
|
|
5938
5936
|
* })
|
|
5939
5937
|
* )
|
|
5940
5938
|
*
|
|
5941
|
-
*
|
|
5939
|
+
* Effect.runPromise(program)
|
|
5942
5940
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5943
5941
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5944
5942
|
* ```
|
|
5945
5943
|
*
|
|
5944
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
5945
|
+
*
|
|
5946
5946
|
* @since 2.0.0
|
|
5947
5947
|
* @category utils
|
|
5948
5948
|
*/
|
|
@@ -5961,11 +5961,9 @@ export declare const partitionEither: {
|
|
|
5961
5961
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5962
5962
|
* one.
|
|
5963
5963
|
*
|
|
5964
|
-
*
|
|
5964
|
+
* **Example** (Partitioning a Stream with an Effectful Predicate)
|
|
5965
5965
|
*
|
|
5966
|
-
* @example
|
|
5967
5966
|
* ```ts
|
|
5968
|
-
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
5969
5967
|
* import { Effect, Either, Stream } from "effect"
|
|
5970
5968
|
*
|
|
5971
5969
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5983,11 +5981,13 @@ export declare const partitionEither: {
|
|
|
5983
5981
|
* })
|
|
5984
5982
|
* )
|
|
5985
5983
|
*
|
|
5986
|
-
*
|
|
5984
|
+
* Effect.runPromise(program)
|
|
5987
5985
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5988
5986
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5989
5987
|
* ```
|
|
5990
5988
|
*
|
|
5989
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
5990
|
+
*
|
|
5991
5991
|
* @since 2.0.0
|
|
5992
5992
|
* @category utils
|
|
5993
5993
|
*/
|
|
@@ -6008,11 +6008,9 @@ export declare const partitionEither: {
|
|
|
6008
6008
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
6009
6009
|
* one.
|
|
6010
6010
|
*
|
|
6011
|
-
*
|
|
6011
|
+
* **Example** (Partitioning a Stream with an Effectful Predicate)
|
|
6012
6012
|
*
|
|
6013
|
-
* @example
|
|
6014
6013
|
* ```ts
|
|
6015
|
-
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
6016
6014
|
* import { Effect, Either, Stream } from "effect"
|
|
6017
6015
|
*
|
|
6018
6016
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -6030,11 +6028,13 @@ export declare const partitionEither: {
|
|
|
6030
6028
|
* })
|
|
6031
6029
|
* )
|
|
6032
6030
|
*
|
|
6033
|
-
*
|
|
6031
|
+
* Effect.runPromise(program)
|
|
6034
6032
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6035
6033
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
6036
6034
|
* ```
|
|
6037
6035
|
*
|
|
6036
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
6037
|
+
*
|
|
6038
6038
|
* @since 2.0.0
|
|
6039
6039
|
* @category utils
|
|
6040
6040
|
*/
|
|
@@ -6469,7 +6469,7 @@ export declare const raceAll: <S extends ReadonlyArray<Stream<any, any, any>>>(.
|
|
|
6469
6469
|
* // A Stream with a range of numbers from 1 to 5
|
|
6470
6470
|
* const stream = Stream.range(1, 5)
|
|
6471
6471
|
*
|
|
6472
|
-
*
|
|
6472
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
6473
6473
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
6474
6474
|
* ```
|
|
6475
6475
|
*
|
|
@@ -6559,7 +6559,7 @@ export declare const refineOrDieWith: {
|
|
|
6559
6559
|
*
|
|
6560
6560
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6561
6561
|
*
|
|
6562
|
-
*
|
|
6562
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6563
6563
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
6564
6564
|
* ```
|
|
6565
6565
|
*
|
|
@@ -6577,7 +6577,7 @@ export declare const repeat: {
|
|
|
6577
6577
|
*
|
|
6578
6578
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6579
6579
|
*
|
|
6580
|
-
*
|
|
6580
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6581
6581
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
6582
6582
|
* ```
|
|
6583
6583
|
*
|
|
@@ -6595,7 +6595,7 @@ export declare const repeat: {
|
|
|
6595
6595
|
*
|
|
6596
6596
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6597
6597
|
*
|
|
6598
|
-
*
|
|
6598
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6599
6599
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
6600
6600
|
* ```
|
|
6601
6601
|
*
|
|
@@ -6614,7 +6614,7 @@ export declare const repeat: {
|
|
|
6614
6614
|
*
|
|
6615
6615
|
* const stream = Stream.repeatEffect(Random.nextInt)
|
|
6616
6616
|
*
|
|
6617
|
-
*
|
|
6617
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6618
6618
|
* // Example Output: { _id: 'Chunk', values: [ 3891571149, 4239494205, 2352981603, 2339111046, 1488052210 ] }
|
|
6619
6619
|
* ```
|
|
6620
6620
|
*
|
|
@@ -6798,7 +6798,7 @@ export declare const repeatElementsWith: {
|
|
|
6798
6798
|
*
|
|
6799
6799
|
* const stream = Stream.repeatValue(0)
|
|
6800
6800
|
*
|
|
6801
|
-
*
|
|
6801
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6802
6802
|
* // { _id: 'Chunk', values: [ 0, 0, 0, 0, 0 ] }
|
|
6803
6803
|
* ```
|
|
6804
6804
|
*
|
|
@@ -7453,7 +7453,7 @@ export declare const runSum: <E, R>(self: Stream<number, E, R>) => Effect.Effect
|
|
|
7453
7453
|
*
|
|
7454
7454
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7455
7455
|
*
|
|
7456
|
-
*
|
|
7456
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7457
7457
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
7458
7458
|
* ```
|
|
7459
7459
|
*
|
|
@@ -7471,7 +7471,7 @@ export declare const scan: {
|
|
|
7471
7471
|
*
|
|
7472
7472
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7473
7473
|
*
|
|
7474
|
-
*
|
|
7474
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7475
7475
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
7476
7476
|
* ```
|
|
7477
7477
|
*
|
|
@@ -7489,7 +7489,7 @@ export declare const scan: {
|
|
|
7489
7489
|
*
|
|
7490
7490
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7491
7491
|
*
|
|
7492
|
-
*
|
|
7492
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7493
7493
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
7494
7494
|
* ```
|
|
7495
7495
|
*
|
|
@@ -7658,7 +7658,7 @@ export declare const scheduleWith: {
|
|
|
7658
7658
|
* Stream.flatMap(() => Console.log("use"))
|
|
7659
7659
|
* )
|
|
7660
7660
|
*
|
|
7661
|
-
*
|
|
7661
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7662
7662
|
* // acquire
|
|
7663
7663
|
* // use
|
|
7664
7664
|
* // release
|
|
@@ -7937,7 +7937,7 @@ export declare const splitLines: <E, R>(self: Stream<string, E, R>) => Stream<st
|
|
|
7937
7937
|
* // A Stream with a single number
|
|
7938
7938
|
* const stream = Stream.succeed(3)
|
|
7939
7939
|
*
|
|
7940
|
-
*
|
|
7940
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7941
7941
|
* // { _id: 'Chunk', values: [ 3 ] }
|
|
7942
7942
|
* ```
|
|
7943
7943
|
*
|
|
@@ -7968,7 +7968,7 @@ export declare const suspend: <A, E, R>(stream: LazyArg<Stream<A, E, R>>) => Str
|
|
|
7968
7968
|
*
|
|
7969
7969
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
7970
7970
|
*
|
|
7971
|
-
*
|
|
7971
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7972
7972
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
7973
7973
|
* ```
|
|
7974
7974
|
*
|
|
@@ -7985,7 +7985,7 @@ export declare const take: {
|
|
|
7985
7985
|
*
|
|
7986
7986
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
7987
7987
|
*
|
|
7988
|
-
*
|
|
7988
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7989
7989
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
7990
7990
|
* ```
|
|
7991
7991
|
*
|
|
@@ -8002,7 +8002,7 @@ export declare const take: {
|
|
|
8002
8002
|
*
|
|
8003
8003
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
8004
8004
|
*
|
|
8005
|
-
*
|
|
8005
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8006
8006
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8007
8007
|
* ```
|
|
8008
8008
|
*
|
|
@@ -8020,7 +8020,7 @@ export declare const take: {
|
|
|
8020
8020
|
*
|
|
8021
8021
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
8022
8022
|
*
|
|
8023
|
-
*
|
|
8023
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8024
8024
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
8025
8025
|
* ```
|
|
8026
8026
|
*
|
|
@@ -8037,7 +8037,7 @@ export declare const takeRight: {
|
|
|
8037
8037
|
*
|
|
8038
8038
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
8039
8039
|
*
|
|
8040
|
-
*
|
|
8040
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8041
8041
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
8042
8042
|
* ```
|
|
8043
8043
|
*
|
|
@@ -8054,7 +8054,7 @@ export declare const takeRight: {
|
|
|
8054
8054
|
*
|
|
8055
8055
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
8056
8056
|
*
|
|
8057
|
-
*
|
|
8057
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8058
8058
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
8059
8059
|
* ```
|
|
8060
8060
|
*
|
|
@@ -8073,7 +8073,7 @@ export declare const takeRight: {
|
|
|
8073
8073
|
*
|
|
8074
8074
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
8075
8075
|
*
|
|
8076
|
-
*
|
|
8076
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8077
8077
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8078
8078
|
* ```
|
|
8079
8079
|
*
|
|
@@ -8091,7 +8091,7 @@ export declare const takeUntil: {
|
|
|
8091
8091
|
*
|
|
8092
8092
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
8093
8093
|
*
|
|
8094
|
-
*
|
|
8094
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8095
8095
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8096
8096
|
* ```
|
|
8097
8097
|
*
|
|
@@ -8109,7 +8109,7 @@ export declare const takeUntil: {
|
|
|
8109
8109
|
*
|
|
8110
8110
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
8111
8111
|
*
|
|
8112
|
-
*
|
|
8112
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8113
8113
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8114
8114
|
* ```
|
|
8115
8115
|
*
|
|
@@ -8153,7 +8153,7 @@ export declare const takeUntilEffect: {
|
|
|
8153
8153
|
*
|
|
8154
8154
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8155
8155
|
*
|
|
8156
|
-
*
|
|
8156
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8157
8157
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8158
8158
|
* ```
|
|
8159
8159
|
*
|
|
@@ -8171,7 +8171,7 @@ export declare const takeWhile: {
|
|
|
8171
8171
|
*
|
|
8172
8172
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8173
8173
|
*
|
|
8174
|
-
*
|
|
8174
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8175
8175
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8176
8176
|
* ```
|
|
8177
8177
|
*
|
|
@@ -8189,7 +8189,7 @@ export declare const takeWhile: {
|
|
|
8189
8189
|
*
|
|
8190
8190
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8191
8191
|
*
|
|
8192
|
-
*
|
|
8192
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8193
8193
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8194
8194
|
* ```
|
|
8195
8195
|
*
|
|
@@ -8207,7 +8207,7 @@ export declare const takeWhile: {
|
|
|
8207
8207
|
*
|
|
8208
8208
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8209
8209
|
*
|
|
8210
|
-
*
|
|
8210
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8211
8211
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8212
8212
|
* ```
|
|
8213
8213
|
*
|
|
@@ -8225,7 +8225,7 @@ export declare const takeWhile: {
|
|
|
8225
8225
|
*
|
|
8226
8226
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8227
8227
|
*
|
|
8228
|
-
*
|
|
8228
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8229
8229
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8230
8230
|
* ```
|
|
8231
8231
|
*
|
|
@@ -8247,7 +8247,7 @@ export declare const takeWhile: {
|
|
|
8247
8247
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
8248
8248
|
* )
|
|
8249
8249
|
*
|
|
8250
|
-
*
|
|
8250
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8251
8251
|
* // before mapping: 1
|
|
8252
8252
|
* // after mapping: 2
|
|
8253
8253
|
* // before mapping: 2
|
|
@@ -8274,7 +8274,7 @@ export declare const tap: {
|
|
|
8274
8274
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
8275
8275
|
* )
|
|
8276
8276
|
*
|
|
8277
|
-
*
|
|
8277
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8278
8278
|
* // before mapping: 1
|
|
8279
8279
|
* // after mapping: 2
|
|
8280
8280
|
* // before mapping: 2
|
|
@@ -8301,7 +8301,7 @@ export declare const tap: {
|
|
|
8301
8301
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
8302
8302
|
* )
|
|
8303
8303
|
*
|
|
8304
|
-
*
|
|
8304
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8305
8305
|
* // before mapping: 1
|
|
8306
8306
|
* // after mapping: 2
|
|
8307
8307
|
* // before mapping: 2
|
|
@@ -8455,7 +8455,7 @@ export declare const tapSink: {
|
|
|
8455
8455
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
8456
8456
|
* )
|
|
8457
8457
|
*
|
|
8458
|
-
*
|
|
8458
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8459
8459
|
* // Received 0 after 56ms
|
|
8460
8460
|
* // > Emitted 0 after 0ms
|
|
8461
8461
|
* // Received 1 after 52ms
|
|
@@ -8511,7 +8511,7 @@ export declare const throttle: {
|
|
|
8511
8511
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
8512
8512
|
* )
|
|
8513
8513
|
*
|
|
8514
|
-
*
|
|
8514
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8515
8515
|
* // Received 0 after 56ms
|
|
8516
8516
|
* // > Emitted 0 after 0ms
|
|
8517
8517
|
* // Received 1 after 52ms
|
|
@@ -8573,7 +8573,7 @@ export declare const throttle: {
|
|
|
8573
8573
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
8574
8574
|
* )
|
|
8575
8575
|
*
|
|
8576
|
-
*
|
|
8576
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8577
8577
|
* // Received 0 after 56ms
|
|
8578
8578
|
* // > Emitted 0 after 0ms
|
|
8579
8579
|
* // Received 1 after 52ms
|
|
@@ -8681,7 +8681,7 @@ export declare const throttleEffect: {
|
|
|
8681
8681
|
*
|
|
8682
8682
|
* const stream = Stream.tick("1 seconds").pipe(Stream.tap(() => log("tick")))
|
|
8683
8683
|
*
|
|
8684
|
-
*
|
|
8684
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
8685
8685
|
* // tick after 4ms
|
|
8686
8686
|
* // tick after 1003ms
|
|
8687
8687
|
* // tick after 1001ms
|
|
@@ -8854,7 +8854,7 @@ export declare const toPubSub: {
|
|
|
8854
8854
|
* }
|
|
8855
8855
|
* })
|
|
8856
8856
|
*
|
|
8857
|
-
*
|
|
8857
|
+
* Effect.runPromise(Effect.scoped(program)).then(console.log, console.error)
|
|
8858
8858
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
8859
8859
|
* // { _id: 'Chunk', values: [ 3, 4 ] }
|
|
8860
8860
|
* // { _id: 'Chunk', values: [ 5 ] }
|
|
@@ -9071,7 +9071,7 @@ export declare const transduce: {
|
|
|
9071
9071
|
*
|
|
9072
9072
|
* const stream = Stream.unfold(1, (n) => Option.some([n, n + 1]))
|
|
9073
9073
|
*
|
|
9074
|
-
*
|
|
9074
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
9075
9075
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
9076
9076
|
* ```
|
|
9077
9077
|
*
|
|
@@ -9107,7 +9107,7 @@ export declare const unfoldChunkEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.E
|
|
|
9107
9107
|
* Effect.map((b) => (b ? Option.some([n, -n]) : Option.some([n, n])))
|
|
9108
9108
|
* ))
|
|
9109
9109
|
*
|
|
9110
|
-
*
|
|
9110
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
9111
9111
|
* // { _id: 'Chunk', values: [ 1, -1, -1, -1, -1 ] }
|
|
9112
9112
|
* ```
|
|
9113
9113
|
*
|
|
@@ -9126,7 +9126,7 @@ export {
|
|
|
9126
9126
|
*
|
|
9127
9127
|
* const stream = Stream.void
|
|
9128
9128
|
*
|
|
9129
|
-
*
|
|
9129
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9130
9130
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
9131
9131
|
*
|
|
9132
9132
|
* ```
|
|
@@ -9300,7 +9300,7 @@ export declare const withSpan: {
|
|
|
9300
9300
|
* Stream.make("a", "b", "c")
|
|
9301
9301
|
* )
|
|
9302
9302
|
*
|
|
9303
|
-
*
|
|
9303
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9304
9304
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
9305
9305
|
* ```
|
|
9306
9306
|
*
|
|
@@ -9324,7 +9324,7 @@ export declare const zip: {
|
|
|
9324
9324
|
* Stream.make("a", "b", "c")
|
|
9325
9325
|
* )
|
|
9326
9326
|
*
|
|
9327
|
-
*
|
|
9327
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9328
9328
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
9329
9329
|
* ```
|
|
9330
9330
|
*
|
|
@@ -9348,7 +9348,7 @@ export declare const zip: {
|
|
|
9348
9348
|
* Stream.make("a", "b", "c")
|
|
9349
9349
|
* )
|
|
9350
9350
|
*
|
|
9351
|
-
*
|
|
9351
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9352
9352
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
9353
9353
|
* ```
|
|
9354
9354
|
*
|
|
@@ -9405,7 +9405,7 @@ export declare const zipFlatten: {
|
|
|
9405
9405
|
* defaultOther: "x"
|
|
9406
9406
|
* })
|
|
9407
9407
|
*
|
|
9408
|
-
*
|
|
9408
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9409
9409
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9410
9410
|
* ```
|
|
9411
9411
|
*
|
|
@@ -9430,7 +9430,7 @@ export declare const zipAll: {
|
|
|
9430
9430
|
* defaultOther: "x"
|
|
9431
9431
|
* })
|
|
9432
9432
|
*
|
|
9433
|
-
*
|
|
9433
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9434
9434
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9435
9435
|
* ```
|
|
9436
9436
|
*
|
|
@@ -9459,7 +9459,7 @@ export declare const zipAll: {
|
|
|
9459
9459
|
* defaultOther: "x"
|
|
9460
9460
|
* })
|
|
9461
9461
|
*
|
|
9462
|
-
*
|
|
9462
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9463
9463
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9464
9464
|
* ```
|
|
9465
9465
|
*
|
|
@@ -9774,7 +9774,7 @@ export declare const zipAllSortedByKeyWith: {
|
|
|
9774
9774
|
* onBoth: (n, s) => [n - s.length, s]
|
|
9775
9775
|
* })
|
|
9776
9776
|
*
|
|
9777
|
-
*
|
|
9777
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9778
9778
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9779
9779
|
* ```
|
|
9780
9780
|
*
|
|
@@ -9800,7 +9800,7 @@ export declare const zipAllWith: {
|
|
|
9800
9800
|
* onBoth: (n, s) => [n - s.length, s]
|
|
9801
9801
|
* })
|
|
9802
9802
|
*
|
|
9803
|
-
*
|
|
9803
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9804
9804
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9805
9805
|
* ```
|
|
9806
9806
|
*
|
|
@@ -9831,7 +9831,7 @@ export declare const zipAllWith: {
|
|
|
9831
9831
|
* onBoth: (n, s) => [n - s.length, s]
|
|
9832
9832
|
* })
|
|
9833
9833
|
*
|
|
9834
|
-
*
|
|
9834
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9835
9835
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9836
9836
|
* ```
|
|
9837
9837
|
*
|
|
@@ -9868,7 +9868,7 @@ export declare const zipAllWith: {
|
|
|
9868
9868
|
*
|
|
9869
9869
|
* const stream = Stream.zipLatest(s1, s2)
|
|
9870
9870
|
*
|
|
9871
|
-
*
|
|
9871
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9872
9872
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
9873
9873
|
* ```
|
|
9874
9874
|
*
|
|
@@ -9899,7 +9899,7 @@ export declare const zipLatest: {
|
|
|
9899
9899
|
*
|
|
9900
9900
|
* const stream = Stream.zipLatest(s1, s2)
|
|
9901
9901
|
*
|
|
9902
|
-
*
|
|
9902
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9903
9903
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
9904
9904
|
* ```
|
|
9905
9905
|
*
|
|
@@ -9930,7 +9930,7 @@ export declare const zipLatest: {
|
|
|
9930
9930
|
*
|
|
9931
9931
|
* const stream = Stream.zipLatest(s1, s2)
|
|
9932
9932
|
*
|
|
9933
|
-
*
|
|
9933
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9934
9934
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
9935
9935
|
* ```
|
|
9936
9936
|
*
|
|
@@ -9957,7 +9957,7 @@ export declare const zipLatest: {
|
|
|
9957
9957
|
* Stream.fromSchedule(Schedule.spaced('4 millis')),
|
|
9958
9958
|
* ).pipe(Stream.take(6), Stream.tap(Console.log))
|
|
9959
9959
|
*
|
|
9960
|
-
*
|
|
9960
|
+
* Effect.runPromise(Stream.runDrain(stream))
|
|
9961
9961
|
* // Output:
|
|
9962
9962
|
* // [ 0, 0, 0 ]
|
|
9963
9963
|
* // [ 1, 0, 0 ]
|
|
@@ -10099,7 +10099,7 @@ export declare const zipRight: {
|
|
|
10099
10099
|
* (n, s) => [n - s.length, s]
|
|
10100
10100
|
* )
|
|
10101
10101
|
*
|
|
10102
|
-
*
|
|
10102
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10103
10103
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10104
10104
|
* ```
|
|
10105
10105
|
*
|
|
@@ -10124,7 +10124,7 @@ export declare const zipWith: {
|
|
|
10124
10124
|
* (n, s) => [n - s.length, s]
|
|
10125
10125
|
* )
|
|
10126
10126
|
*
|
|
10127
|
-
*
|
|
10127
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10128
10128
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10129
10129
|
* ```
|
|
10130
10130
|
*
|
|
@@ -10149,7 +10149,7 @@ export declare const zipWith: {
|
|
|
10149
10149
|
* (n, s) => [n - s.length, s]
|
|
10150
10150
|
* )
|
|
10151
10151
|
*
|
|
10152
|
-
*
|
|
10152
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10153
10153
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10154
10154
|
* ```
|
|
10155
10155
|
*
|
|
@@ -10198,7 +10198,7 @@ export declare const zipWithChunks: {
|
|
|
10198
10198
|
*
|
|
10199
10199
|
* const stream = Stream.zipWithNext(Stream.make(1, 2, 3, 4))
|
|
10200
10200
|
*
|
|
10201
|
-
*
|
|
10201
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunk) => console.log(Chunk.toArray(chunk)))
|
|
10202
10202
|
* // [
|
|
10203
10203
|
* // [ 1, { _id: 'Option', _tag: 'Some', value: 2 } ],
|
|
10204
10204
|
* // [ 2, { _id: 'Option', _tag: 'Some', value: 3 } ],
|
|
@@ -10221,7 +10221,7 @@ export declare const zipWithNext: <A, E, R>(self: Stream<A, E, R>) => Stream<[A,
|
|
|
10221
10221
|
*
|
|
10222
10222
|
* const stream = Stream.zipWithPrevious(Stream.make(1, 2, 3, 4))
|
|
10223
10223
|
*
|
|
10224
|
-
*
|
|
10224
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunk) => console.log(Chunk.toArray(chunk)))
|
|
10225
10225
|
* // [
|
|
10226
10226
|
* // [ { _id: 'Option', _tag: 'None' }, 1 ],
|
|
10227
10227
|
* // [ { _id: 'Option', _tag: 'Some', value: 1 }, 2 ],
|
|
@@ -10243,7 +10243,7 @@ export declare const zipWithPrevious: <A, E, R>(self: Stream<A, E, R>) => Stream
|
|
|
10243
10243
|
*
|
|
10244
10244
|
* const stream = Stream.zipWithPreviousAndNext(Stream.make(1, 2, 3, 4))
|
|
10245
10245
|
*
|
|
10246
|
-
*
|
|
10246
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunk) => console.log(Chunk.toArray(chunk)))
|
|
10247
10247
|
* // [
|
|
10248
10248
|
* // [
|
|
10249
10249
|
* // { _id: 'Option', _tag: 'None' },
|
|
@@ -10283,7 +10283,7 @@ export declare const zipWithPreviousAndNext: <A, E, R>(self: Stream<A, E, R>) =>
|
|
|
10283
10283
|
*
|
|
10284
10284
|
* const indexedStream = Stream.zipWithIndex(stream)
|
|
10285
10285
|
*
|
|
10286
|
-
*
|
|
10286
|
+
* Effect.runPromise(Stream.runCollect(indexedStream)).then(console.log)
|
|
10287
10287
|
* // {
|
|
10288
10288
|
* // _id: 'Chunk',
|
|
10289
10289
|
* // values: [ [ 'Mary', 0 ], [ 'James', 1 ], [ 'Robert', 2 ], [ 'Patricia', 3 ] ]
|
|
@@ -10304,11 +10304,6 @@ export declare const zipWithIndex: <A, E, R>(self: Stream<A, E, R>) => Stream<[A
|
|
|
10304
10304
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10305
10305
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10306
10306
|
*
|
|
10307
|
-
* @see {@link bindTo}
|
|
10308
|
-
* @see {@link bind}
|
|
10309
|
-
* @see {@link bindEffect}
|
|
10310
|
-
* @see {@link let_ let}
|
|
10311
|
-
*
|
|
10312
10307
|
* @example
|
|
10313
10308
|
* ```ts
|
|
10314
10309
|
* import * as assert from "node:assert"
|
|
@@ -10323,6 +10318,11 @@ export declare const zipWithIndex: <A, E, R>(self: Stream<A, E, R>) => Stream<[A
|
|
|
10323
10318
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10324
10319
|
* ```
|
|
10325
10320
|
*
|
|
10321
|
+
* @see {@link bindTo}
|
|
10322
|
+
* @see {@link bind}
|
|
10323
|
+
* @see {@link bindEffect}
|
|
10324
|
+
* @see {@link let_ let}
|
|
10325
|
+
*
|
|
10326
10326
|
* @category do notation
|
|
10327
10327
|
* @since 2.0.0
|
|
10328
10328
|
*/
|
|
@@ -10337,11 +10337,6 @@ export declare const Do: Stream<{}>;
|
|
|
10337
10337
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10338
10338
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10339
10339
|
*
|
|
10340
|
-
* @see {@link Do}
|
|
10341
|
-
* @see {@link bindTo}
|
|
10342
|
-
* @see {@link bindEffect}
|
|
10343
|
-
* @see {@link let_ let}
|
|
10344
|
-
*
|
|
10345
10340
|
* @example
|
|
10346
10341
|
* ```ts
|
|
10347
10342
|
* import * as assert from "node:assert"
|
|
@@ -10356,6 +10351,11 @@ export declare const Do: Stream<{}>;
|
|
|
10356
10351
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10357
10352
|
* ```
|
|
10358
10353
|
*
|
|
10354
|
+
* @see {@link Do}
|
|
10355
|
+
* @see {@link bindTo}
|
|
10356
|
+
* @see {@link bindEffect}
|
|
10357
|
+
* @see {@link let_ let}
|
|
10358
|
+
*
|
|
10359
10359
|
* @category do notation
|
|
10360
10360
|
* @since 2.0.0
|
|
10361
10361
|
*/
|
|
@@ -10370,11 +10370,6 @@ export declare const bind: {
|
|
|
10370
10370
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10371
10371
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10372
10372
|
*
|
|
10373
|
-
* @see {@link Do}
|
|
10374
|
-
* @see {@link bindTo}
|
|
10375
|
-
* @see {@link bindEffect}
|
|
10376
|
-
* @see {@link let_ let}
|
|
10377
|
-
*
|
|
10378
10373
|
* @example
|
|
10379
10374
|
* ```ts
|
|
10380
10375
|
* import * as assert from "node:assert"
|
|
@@ -10389,6 +10384,11 @@ export declare const bind: {
|
|
|
10389
10384
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10390
10385
|
* ```
|
|
10391
10386
|
*
|
|
10387
|
+
* @see {@link Do}
|
|
10388
|
+
* @see {@link bindTo}
|
|
10389
|
+
* @see {@link bindEffect}
|
|
10390
|
+
* @see {@link let_ let}
|
|
10391
|
+
*
|
|
10392
10392
|
* @category do notation
|
|
10393
10393
|
* @since 2.0.0
|
|
10394
10394
|
*/
|
|
@@ -10408,11 +10408,6 @@ export declare const bind: {
|
|
|
10408
10408
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10409
10409
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10410
10410
|
*
|
|
10411
|
-
* @see {@link Do}
|
|
10412
|
-
* @see {@link bindTo}
|
|
10413
|
-
* @see {@link bindEffect}
|
|
10414
|
-
* @see {@link let_ let}
|
|
10415
|
-
*
|
|
10416
10411
|
* @example
|
|
10417
10412
|
* ```ts
|
|
10418
10413
|
* import * as assert from "node:assert"
|
|
@@ -10427,6 +10422,11 @@ export declare const bind: {
|
|
|
10427
10422
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10428
10423
|
* ```
|
|
10429
10424
|
*
|
|
10425
|
+
* @see {@link Do}
|
|
10426
|
+
* @see {@link bindTo}
|
|
10427
|
+
* @see {@link bindEffect}
|
|
10428
|
+
* @see {@link let_ let}
|
|
10429
|
+
*
|
|
10430
10430
|
* @category do notation
|
|
10431
10431
|
* @since 2.0.0
|
|
10432
10432
|
*/
|
|
@@ -10494,11 +10494,6 @@ export declare const bindEffect: {
|
|
|
10494
10494
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10495
10495
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10496
10496
|
*
|
|
10497
|
-
* @see {@link Do}
|
|
10498
|
-
* @see {@link bind}
|
|
10499
|
-
* @see {@link bindEffect}
|
|
10500
|
-
* @see {@link let_ let}
|
|
10501
|
-
*
|
|
10502
10497
|
* @example
|
|
10503
10498
|
* ```ts
|
|
10504
10499
|
* import * as assert from "node:assert"
|
|
@@ -10513,6 +10508,11 @@ export declare const bindEffect: {
|
|
|
10513
10508
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10514
10509
|
* ```
|
|
10515
10510
|
*
|
|
10511
|
+
* @see {@link Do}
|
|
10512
|
+
* @see {@link bind}
|
|
10513
|
+
* @see {@link bindEffect}
|
|
10514
|
+
* @see {@link let_ let}
|
|
10515
|
+
*
|
|
10516
10516
|
* @category do notation
|
|
10517
10517
|
* @since 2.0.0
|
|
10518
10518
|
*/
|
|
@@ -10527,11 +10527,6 @@ export declare const bindTo: {
|
|
|
10527
10527
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10528
10528
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10529
10529
|
*
|
|
10530
|
-
* @see {@link Do}
|
|
10531
|
-
* @see {@link bind}
|
|
10532
|
-
* @see {@link bindEffect}
|
|
10533
|
-
* @see {@link let_ let}
|
|
10534
|
-
*
|
|
10535
10530
|
* @example
|
|
10536
10531
|
* ```ts
|
|
10537
10532
|
* import * as assert from "node:assert"
|
|
@@ -10546,6 +10541,11 @@ export declare const bindTo: {
|
|
|
10546
10541
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10547
10542
|
* ```
|
|
10548
10543
|
*
|
|
10544
|
+
* @see {@link Do}
|
|
10545
|
+
* @see {@link bind}
|
|
10546
|
+
* @see {@link bindEffect}
|
|
10547
|
+
* @see {@link let_ let}
|
|
10548
|
+
*
|
|
10549
10549
|
* @category do notation
|
|
10550
10550
|
* @since 2.0.0
|
|
10551
10551
|
*/
|
|
@@ -10562,11 +10562,6 @@ export declare const bindTo: {
|
|
|
10562
10562
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10563
10563
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10564
10564
|
*
|
|
10565
|
-
* @see {@link Do}
|
|
10566
|
-
* @see {@link bind}
|
|
10567
|
-
* @see {@link bindEffect}
|
|
10568
|
-
* @see {@link let_ let}
|
|
10569
|
-
*
|
|
10570
10565
|
* @example
|
|
10571
10566
|
* ```ts
|
|
10572
10567
|
* import * as assert from "node:assert"
|
|
@@ -10581,6 +10576,11 @@ export declare const bindTo: {
|
|
|
10581
10576
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10582
10577
|
* ```
|
|
10583
10578
|
*
|
|
10579
|
+
* @see {@link Do}
|
|
10580
|
+
* @see {@link bind}
|
|
10581
|
+
* @see {@link bindEffect}
|
|
10582
|
+
* @see {@link let_ let}
|
|
10583
|
+
*
|
|
10584
10584
|
* @category do notation
|
|
10585
10585
|
* @since 2.0.0
|
|
10586
10586
|
*/
|
|
@@ -10607,11 +10607,6 @@ export {
|
|
|
10607
10607
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
10608
10608
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
10609
10609
|
*
|
|
10610
|
-
* @see {@link Do}
|
|
10611
|
-
* @see {@link bindTo}
|
|
10612
|
-
* @see {@link bind}
|
|
10613
|
-
* @see {@link bindEffect}
|
|
10614
|
-
*
|
|
10615
10610
|
* @example
|
|
10616
10611
|
* ```ts
|
|
10617
10612
|
* import * as assert from "node:assert"
|
|
@@ -10624,8 +10619,13 @@ export {
|
|
|
10624
10619
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10625
10620
|
* )
|
|
10626
10621
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10627
|
-
*
|
|
10628
10622
|
* ```
|
|
10623
|
+
*
|
|
10624
|
+
* @see {@link Do}
|
|
10625
|
+
* @see {@link bindTo}
|
|
10626
|
+
* @see {@link bind}
|
|
10627
|
+
* @see {@link bindEffect}
|
|
10628
|
+
*
|
|
10629
10629
|
* @category do notation
|
|
10630
10630
|
* @since 2.0.0
|
|
10631
10631
|
*/
|