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/esm/Stream.js
CHANGED
|
@@ -51,7 +51,7 @@ export const accumulateChunks = internal.accumulateChunks;
|
|
|
51
51
|
* (file) => file.close
|
|
52
52
|
* ).pipe(Stream.flatMap((file) => file.getLines))
|
|
53
53
|
*
|
|
54
|
-
*
|
|
54
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
55
55
|
* // Opening file.txt
|
|
56
56
|
* // Closing file.txt
|
|
57
57
|
* // { _id: 'Chunk', values: [ [ 'Line 1', 'Line 2', 'Line 3' ] ] }
|
|
@@ -110,7 +110,7 @@ export const aggregateWithinEither = internal.aggregateWithinEither;
|
|
|
110
110
|
*
|
|
111
111
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
112
112
|
*
|
|
113
|
-
*
|
|
113
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
114
114
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
115
115
|
* ```
|
|
116
116
|
*
|
|
@@ -149,7 +149,7 @@ export {
|
|
|
149
149
|
* }
|
|
150
150
|
* )
|
|
151
151
|
*
|
|
152
|
-
*
|
|
152
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
153
153
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
154
154
|
*
|
|
155
155
|
* ```
|
|
@@ -254,7 +254,7 @@ export const branchAfter = internal.branchAfter;
|
|
|
254
254
|
* )
|
|
255
255
|
* )
|
|
256
256
|
*
|
|
257
|
-
*
|
|
257
|
+
* Effect.runPromise(numbers).then(console.log)
|
|
258
258
|
* // Emit 1 element before broadcasting
|
|
259
259
|
* // Emit 2 element before broadcasting
|
|
260
260
|
* // Emit 3 element before broadcasting
|
|
@@ -362,7 +362,7 @@ export const broadcastedQueuesDynamic = internal.broadcastedQueuesDynamic;
|
|
|
362
362
|
* Stream.schedule(Schedule.spaced("5 seconds"))
|
|
363
363
|
* )
|
|
364
364
|
*
|
|
365
|
-
*
|
|
365
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
366
366
|
* // before buffering: 1
|
|
367
367
|
* // before buffering: 2
|
|
368
368
|
* // before buffering: 3
|
|
@@ -455,7 +455,7 @@ export const catchSomeCause = internal.catchSomeCause;
|
|
|
455
455
|
*
|
|
456
456
|
* const stream = Stream.make(1, 1, 1, 2, 2, 3, 4).pipe(Stream.changes)
|
|
457
457
|
*
|
|
458
|
-
*
|
|
458
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
459
459
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
|
|
460
460
|
* ```
|
|
461
461
|
*
|
|
@@ -536,7 +536,7 @@ export const combineChunks = internal.combineChunks;
|
|
|
536
536
|
*
|
|
537
537
|
* const stream = Stream.concat(s1, s2)
|
|
538
538
|
*
|
|
539
|
-
*
|
|
539
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
540
540
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
541
541
|
* ```
|
|
542
542
|
*
|
|
@@ -557,7 +557,7 @@ export const concat = internal.concat;
|
|
|
557
557
|
*
|
|
558
558
|
* const stream = Stream.concatAll(Chunk.make(s1, s2, s3))
|
|
559
559
|
*
|
|
560
|
-
*
|
|
560
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
561
561
|
* // {
|
|
562
562
|
* // _id: 'Chunk',
|
|
563
563
|
* // values: [
|
|
@@ -587,7 +587,7 @@ export const concatAll = internal.concatAll;
|
|
|
587
587
|
*
|
|
588
588
|
* const product = Stream.cross(s1, s2)
|
|
589
589
|
*
|
|
590
|
-
*
|
|
590
|
+
* Effect.runPromise(Stream.runCollect(product)).then(console.log)
|
|
591
591
|
* // {
|
|
592
592
|
* // _id: "Chunk",
|
|
593
593
|
* // values: [
|
|
@@ -671,7 +671,7 @@ export const crossWith = internal.crossWith;
|
|
|
671
671
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
672
672
|
* )
|
|
673
673
|
*
|
|
674
|
-
*
|
|
674
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
675
675
|
* // Received 1 after 5ms
|
|
676
676
|
* // Received 2 after 2ms
|
|
677
677
|
* // Received 3 after 0ms
|
|
@@ -743,7 +743,7 @@ export const distributedWithDynamic = internal.distributedWithDynamic;
|
|
|
743
743
|
* // We create a stream and immediately drain it.
|
|
744
744
|
* const stream = Stream.range(1, 6).pipe(Stream.drain)
|
|
745
745
|
*
|
|
746
|
-
*
|
|
746
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
747
747
|
* // { _id: 'Chunk', values: [] }
|
|
748
748
|
* ```
|
|
749
749
|
*
|
|
@@ -828,7 +828,7 @@ export const either = internal.either;
|
|
|
828
828
|
*
|
|
829
829
|
* const stream = Stream.empty
|
|
830
830
|
*
|
|
831
|
-
*
|
|
831
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
832
832
|
* // { _id: 'Chunk', values: [] }
|
|
833
833
|
* ```
|
|
834
834
|
*
|
|
@@ -850,7 +850,7 @@ export const empty = internal.empty;
|
|
|
850
850
|
* )
|
|
851
851
|
* )
|
|
852
852
|
*
|
|
853
|
-
*
|
|
853
|
+
* Effect.runPromise(Stream.runCollect(program)).then(console.log)
|
|
854
854
|
* // Application Logic.
|
|
855
855
|
* // Finalizing the stream
|
|
856
856
|
* // Doing some other works after stream's finalization
|
|
@@ -954,7 +954,7 @@ export const failCauseSync = internal.failCauseSync;
|
|
|
954
954
|
*
|
|
955
955
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
956
956
|
*
|
|
957
|
-
*
|
|
957
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
958
958
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
959
959
|
* ```
|
|
960
960
|
*
|
|
@@ -1021,7 +1021,7 @@ export const filterMapWhileEffect = internal.filterMapWhileEffect;
|
|
|
1021
1021
|
* )
|
|
1022
1022
|
* )
|
|
1023
1023
|
*
|
|
1024
|
-
*
|
|
1024
|
+
* Effect.runPromise(Stream.runCollect(program)).then(console.log)
|
|
1025
1025
|
* // Application Logic.
|
|
1026
1026
|
* // Deleting dir: tmp
|
|
1027
1027
|
* // Temporary directory was deleted.
|
|
@@ -1127,7 +1127,7 @@ export const forever = internal.forever;
|
|
|
1127
1127
|
* (e) => new Error(String(e)) // Error Handling
|
|
1128
1128
|
* )
|
|
1129
1129
|
*
|
|
1130
|
-
*
|
|
1130
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1131
1131
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
1132
1132
|
* ```
|
|
1133
1133
|
*
|
|
@@ -1159,7 +1159,7 @@ export const toChannel = internal.toChannel;
|
|
|
1159
1159
|
* // Creating a stream with values from a single Chunk
|
|
1160
1160
|
* const stream = Stream.fromChunk(Chunk.make(1, 2, 3))
|
|
1161
1161
|
*
|
|
1162
|
-
*
|
|
1162
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1163
1163
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
1164
1164
|
* ```
|
|
1165
1165
|
*
|
|
@@ -1199,7 +1199,7 @@ export const fromChunkQueue = internal.fromChunkQueue;
|
|
|
1199
1199
|
* // Creating a stream with values from multiple Chunks
|
|
1200
1200
|
* const stream = Stream.fromChunks(Chunk.make(1, 2, 3), Chunk.make(4, 5, 6))
|
|
1201
1201
|
*
|
|
1202
|
-
*
|
|
1202
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1203
1203
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
1204
1204
|
* ```
|
|
1205
1205
|
*
|
|
@@ -1217,7 +1217,7 @@ export const fromChunks = internal.fromChunks;
|
|
|
1217
1217
|
*
|
|
1218
1218
|
* const stream = Stream.fromEffect(Random.nextInt)
|
|
1219
1219
|
*
|
|
1220
|
-
*
|
|
1220
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1221
1221
|
* // Example Output: { _id: 'Chunk', values: [ 922694024 ] }
|
|
1222
1222
|
* ```
|
|
1223
1223
|
*
|
|
@@ -1262,7 +1262,7 @@ export const fromTPubSub = internal.fromTPubSub;
|
|
|
1262
1262
|
*
|
|
1263
1263
|
* const stream = Stream.fromIterable(numbers)
|
|
1264
1264
|
*
|
|
1265
|
-
*
|
|
1265
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1266
1266
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
1267
1267
|
* ```
|
|
1268
1268
|
*
|
|
@@ -1286,9 +1286,9 @@ export const fromIterable = internal.fromIterable;
|
|
|
1286
1286
|
*
|
|
1287
1287
|
* const stream = Stream.fromIterableEffect(getUsers)
|
|
1288
1288
|
*
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1289
|
+
* Effect.runPromise(
|
|
1290
|
+
* Stream.runCollect(stream.pipe(Stream.provideService(Database, { getUsers: Effect.succeed(["user1", "user2"]) })))
|
|
1291
|
+
* ).then(console.log)
|
|
1292
1292
|
* // { _id: 'Chunk', values: [ 'user1', 'user2' ] }
|
|
1293
1293
|
* ```
|
|
1294
1294
|
*
|
|
@@ -1365,7 +1365,7 @@ export const fromReadableStreamByob = internal.fromReadableStreamByob;
|
|
|
1365
1365
|
*
|
|
1366
1366
|
* const stream = Stream.fromSchedule(schedule)
|
|
1367
1367
|
*
|
|
1368
|
-
*
|
|
1368
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1369
1369
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
1370
1370
|
* ```
|
|
1371
1371
|
*
|
|
@@ -1408,7 +1408,7 @@ export const groupAdjacentBy = internal.groupAdjacentBy;
|
|
|
1408
1408
|
* )
|
|
1409
1409
|
* ))
|
|
1410
1410
|
*
|
|
1411
|
-
*
|
|
1411
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1412
1412
|
* // {
|
|
1413
1413
|
* // _id: 'Chunk',
|
|
1414
1414
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
@@ -1464,7 +1464,7 @@ export const groupByKey = groupBy_.groupByKey;
|
|
|
1464
1464
|
*
|
|
1465
1465
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
1466
1466
|
*
|
|
1467
|
-
*
|
|
1467
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log("%o", chunks))
|
|
1468
1468
|
* // {
|
|
1469
1469
|
* // _id: 'Chunk',
|
|
1470
1470
|
* // values: [
|
|
@@ -1494,7 +1494,7 @@ export const grouped = internal.grouped;
|
|
|
1494
1494
|
* Stream.take(3)
|
|
1495
1495
|
* )
|
|
1496
1496
|
*
|
|
1497
|
-
*
|
|
1497
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunks) => console.log(Chunk.toArray(chunks)))
|
|
1498
1498
|
* // [
|
|
1499
1499
|
* // {
|
|
1500
1500
|
* // _id: 'Chunk',
|
|
@@ -1583,7 +1583,7 @@ export const identity = internal.identityStream;
|
|
|
1583
1583
|
*
|
|
1584
1584
|
* const stream = Stream.interleave(s1, s2)
|
|
1585
1585
|
*
|
|
1586
|
-
*
|
|
1586
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1587
1587
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
1588
1588
|
* ```
|
|
1589
1589
|
* @since 2.0.0
|
|
@@ -1610,7 +1610,7 @@ export const interleave = internal.interleave;
|
|
|
1610
1610
|
*
|
|
1611
1611
|
* const stream = Stream.interleaveWith(s1, s2, booleanStream)
|
|
1612
1612
|
*
|
|
1613
|
-
*
|
|
1613
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1614
1614
|
* // {
|
|
1615
1615
|
* // _id: 'Chunk',
|
|
1616
1616
|
* // values: [
|
|
@@ -1633,7 +1633,7 @@ export const interleaveWith = internal.interleaveWith;
|
|
|
1633
1633
|
*
|
|
1634
1634
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
1635
1635
|
*
|
|
1636
|
-
*
|
|
1636
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1637
1637
|
* // {
|
|
1638
1638
|
* // _id: 'Chunk',
|
|
1639
1639
|
* // values: [
|
|
@@ -1662,7 +1662,7 @@ export const intersperse = internal.intersperse;
|
|
|
1662
1662
|
* })
|
|
1663
1663
|
* )
|
|
1664
1664
|
*
|
|
1665
|
-
*
|
|
1665
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1666
1666
|
* // {
|
|
1667
1667
|
* // _id: 'Chunk',
|
|
1668
1668
|
* // values: [
|
|
@@ -1720,7 +1720,7 @@ export const interruptWhenDeferred = internal.interruptWhenDeferred;
|
|
|
1720
1720
|
* // An infinite Stream of numbers starting from 1 and incrementing
|
|
1721
1721
|
* const stream = Stream.iterate(1, (n) => n + 1)
|
|
1722
1722
|
*
|
|
1723
|
-
*
|
|
1723
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(10)))).then(console.log)
|
|
1724
1724
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }
|
|
1725
1725
|
* ```
|
|
1726
1726
|
*
|
|
@@ -1737,7 +1737,7 @@ export const iterate = internal.iterate;
|
|
|
1737
1737
|
*
|
|
1738
1738
|
* const stream = Stream.make(1, 2, 3)
|
|
1739
1739
|
*
|
|
1740
|
-
*
|
|
1740
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1741
1741
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
1742
1742
|
* ```
|
|
1743
1743
|
*
|
|
@@ -1754,7 +1754,7 @@ export const make = internal.make;
|
|
|
1754
1754
|
*
|
|
1755
1755
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
1756
1756
|
*
|
|
1757
|
-
*
|
|
1757
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1758
1758
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
1759
1759
|
* ```
|
|
1760
1760
|
*
|
|
@@ -1773,9 +1773,9 @@ export const map = internal.map;
|
|
|
1773
1773
|
* stream.pipe(Stream.mapAccum(0, (s, a) => [s + a, s + a]))
|
|
1774
1774
|
*
|
|
1775
1775
|
* // input: 0, 1, 2, 3, 4, 5, 6
|
|
1776
|
-
*
|
|
1777
|
-
*
|
|
1778
|
-
*
|
|
1776
|
+
* Effect.runPromise(Stream.runCollect(runningTotal(Stream.range(0, 6)))).then(
|
|
1777
|
+
* console.log
|
|
1778
|
+
* )
|
|
1779
1779
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
1780
1780
|
* ```
|
|
1781
1781
|
*
|
|
@@ -1826,7 +1826,7 @@ export const mapChunksEffect = internal.mapChunksEffect;
|
|
|
1826
1826
|
* Stream.map((s) => parseInt(s))
|
|
1827
1827
|
* )
|
|
1828
1828
|
*
|
|
1829
|
-
*
|
|
1829
|
+
* Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
1830
1830
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
1831
1831
|
* ```
|
|
1832
1832
|
*
|
|
@@ -1869,7 +1869,7 @@ export const mapConcatEffect = internal.mapConcatEffect;
|
|
|
1869
1869
|
* Stream.mapEffect((n) => Random.nextIntBetween(0, n))
|
|
1870
1870
|
* )
|
|
1871
1871
|
*
|
|
1872
|
-
*
|
|
1872
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1873
1873
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
1874
1874
|
* ```
|
|
1875
1875
|
*
|
|
@@ -1910,7 +1910,7 @@ export const mapErrorCause = internal.mapErrorCause;
|
|
|
1910
1910
|
*
|
|
1911
1911
|
* const stream = Stream.merge(s1, s2)
|
|
1912
1912
|
*
|
|
1913
|
-
*
|
|
1913
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1914
1914
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
1915
1915
|
* ```
|
|
1916
1916
|
*
|
|
@@ -1966,7 +1966,7 @@ export const mergeWithTag = internal.mergeWithTag;
|
|
|
1966
1966
|
* onOther: (n) => Math.floor(n)
|
|
1967
1967
|
* })
|
|
1968
1968
|
*
|
|
1969
|
-
*
|
|
1969
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1970
1970
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
1971
1971
|
* ```
|
|
1972
1972
|
*
|
|
@@ -2069,7 +2069,7 @@ export const onDone = internal.onDone;
|
|
|
2069
2069
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
2070
2070
|
* )
|
|
2071
2071
|
*
|
|
2072
|
-
*
|
|
2072
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2073
2073
|
* // Stream started
|
|
2074
2074
|
* // after mapping: 2
|
|
2075
2075
|
* // after mapping: 4
|
|
@@ -2166,7 +2166,7 @@ export const orElseSucceed = internal.orElseSucceed;
|
|
|
2166
2166
|
* n < 3 ? Option.some(n + 1) : Option.none()
|
|
2167
2167
|
* ])
|
|
2168
2168
|
*
|
|
2169
|
-
*
|
|
2169
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2170
2170
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3 ] }
|
|
2171
2171
|
* ```
|
|
2172
2172
|
*
|
|
@@ -2213,12 +2213,9 @@ export const paginateEffect = internal.paginateEffect;
|
|
|
2213
2213
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
2214
2214
|
* one.
|
|
2215
2215
|
*
|
|
2216
|
-
*
|
|
2217
|
-
* conditions.
|
|
2216
|
+
* **Example** (Partitioning a Stream into Even and Odd Numbers)
|
|
2218
2217
|
*
|
|
2219
|
-
* @example
|
|
2220
2218
|
* ```ts
|
|
2221
|
-
* // Title: Partitioning a Stream into Even and Odd Numbers
|
|
2222
2219
|
* import { Effect, Stream } from "effect"
|
|
2223
2220
|
*
|
|
2224
2221
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -2233,11 +2230,14 @@ export const paginateEffect = internal.paginateEffect;
|
|
|
2233
2230
|
* })
|
|
2234
2231
|
* )
|
|
2235
2232
|
*
|
|
2236
|
-
*
|
|
2233
|
+
* Effect.runPromise(program)
|
|
2237
2234
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
2238
2235
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
2239
2236
|
* ```
|
|
2240
2237
|
*
|
|
2238
|
+
* @see {@link partitionEither} for partitioning a stream based on effectful
|
|
2239
|
+
* conditions.
|
|
2240
|
+
*
|
|
2241
2241
|
* @since 2.0.0
|
|
2242
2242
|
* @category utils
|
|
2243
2243
|
*/
|
|
@@ -2256,11 +2256,9 @@ export const partition = internal.partition;
|
|
|
2256
2256
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
2257
2257
|
* one.
|
|
2258
2258
|
*
|
|
2259
|
-
*
|
|
2259
|
+
* **Example** (Partitioning a Stream with an Effectful Predicate)
|
|
2260
2260
|
*
|
|
2261
|
-
* @example
|
|
2262
2261
|
* ```ts
|
|
2263
|
-
* // Title: Partitioning a Stream with an Effectful Predicate
|
|
2264
2262
|
* import { Effect, Either, Stream } from "effect"
|
|
2265
2263
|
*
|
|
2266
2264
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -2278,11 +2276,13 @@ export const partition = internal.partition;
|
|
|
2278
2276
|
* })
|
|
2279
2277
|
* )
|
|
2280
2278
|
*
|
|
2281
|
-
*
|
|
2279
|
+
* Effect.runPromise(program)
|
|
2282
2280
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
2283
2281
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
2284
2282
|
* ```
|
|
2285
2283
|
*
|
|
2284
|
+
* @see {@link partition} for partitioning a stream based on simple conditions.
|
|
2285
|
+
*
|
|
2286
2286
|
* @since 2.0.0
|
|
2287
2287
|
* @category utils
|
|
2288
2288
|
*/
|
|
@@ -2451,7 +2451,7 @@ export const raceAll = internal.raceAll;
|
|
|
2451
2451
|
* // A Stream with a range of numbers from 1 to 5
|
|
2452
2452
|
* const stream = Stream.range(1, 5)
|
|
2453
2453
|
*
|
|
2454
|
-
*
|
|
2454
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2455
2455
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
2456
2456
|
* ```
|
|
2457
2457
|
*
|
|
@@ -2492,7 +2492,7 @@ export const refineOrDieWith = internal.refineOrDieWith;
|
|
|
2492
2492
|
*
|
|
2493
2493
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
2494
2494
|
*
|
|
2495
|
-
*
|
|
2495
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
2496
2496
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
2497
2497
|
* ```
|
|
2498
2498
|
*
|
|
@@ -2510,7 +2510,7 @@ export const repeat = internal.repeat;
|
|
|
2510
2510
|
*
|
|
2511
2511
|
* const stream = Stream.repeatEffect(Random.nextInt)
|
|
2512
2512
|
*
|
|
2513
|
-
*
|
|
2513
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
2514
2514
|
* // Example Output: { _id: 'Chunk', values: [ 3891571149, 4239494205, 2352981603, 2339111046, 1488052210 ] }
|
|
2515
2515
|
* ```
|
|
2516
2516
|
*
|
|
@@ -2613,7 +2613,7 @@ export const repeatElementsWith = internal.repeatElementsWith;
|
|
|
2613
2613
|
*
|
|
2614
2614
|
* const stream = Stream.repeatValue(0)
|
|
2615
2615
|
*
|
|
2616
|
-
*
|
|
2616
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
2617
2617
|
* // { _id: 'Chunk', values: [ 0, 0, 0, 0, 0 ] }
|
|
2618
2618
|
* ```
|
|
2619
2619
|
*
|
|
@@ -2863,7 +2863,7 @@ export const runSum = internal.runSum;
|
|
|
2863
2863
|
*
|
|
2864
2864
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
2865
2865
|
*
|
|
2866
|
-
*
|
|
2866
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2867
2867
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
2868
2868
|
* ```
|
|
2869
2869
|
*
|
|
@@ -2932,7 +2932,7 @@ export const scheduleWith = internal.scheduleWith;
|
|
|
2932
2932
|
* Stream.flatMap(() => Console.log("use"))
|
|
2933
2933
|
* )
|
|
2934
2934
|
*
|
|
2935
|
-
*
|
|
2935
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2936
2936
|
* // acquire
|
|
2937
2937
|
* // use
|
|
2938
2938
|
* // release
|
|
@@ -3041,7 +3041,7 @@ export const splitLines = internal.splitLines;
|
|
|
3041
3041
|
* // A Stream with a single number
|
|
3042
3042
|
* const stream = Stream.succeed(3)
|
|
3043
3043
|
*
|
|
3044
|
-
*
|
|
3044
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3045
3045
|
* // { _id: 'Chunk', values: [ 3 ] }
|
|
3046
3046
|
* ```
|
|
3047
3047
|
*
|
|
@@ -3072,7 +3072,7 @@ export const suspend = internal.suspend;
|
|
|
3072
3072
|
*
|
|
3073
3073
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
3074
3074
|
*
|
|
3075
|
-
*
|
|
3075
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3076
3076
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
3077
3077
|
* ```
|
|
3078
3078
|
*
|
|
@@ -3089,7 +3089,7 @@ export const take = internal.take;
|
|
|
3089
3089
|
*
|
|
3090
3090
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
3091
3091
|
*
|
|
3092
|
-
*
|
|
3092
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3093
3093
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
3094
3094
|
* ```
|
|
3095
3095
|
*
|
|
@@ -3107,7 +3107,7 @@ export const takeRight = internal.takeRight;
|
|
|
3107
3107
|
*
|
|
3108
3108
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
3109
3109
|
*
|
|
3110
|
-
*
|
|
3110
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3111
3111
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
3112
3112
|
* ```
|
|
3113
3113
|
*
|
|
@@ -3133,7 +3133,7 @@ export const takeUntilEffect = internal.takeUntilEffect;
|
|
|
3133
3133
|
*
|
|
3134
3134
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
3135
3135
|
*
|
|
3136
|
-
*
|
|
3136
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3137
3137
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
3138
3138
|
* ```
|
|
3139
3139
|
*
|
|
@@ -3154,7 +3154,7 @@ export const takeWhile = internal.takeWhile;
|
|
|
3154
3154
|
* Stream.tap((n) => Console.log(`after mapping: ${n}`))
|
|
3155
3155
|
* )
|
|
3156
3156
|
*
|
|
3157
|
-
*
|
|
3157
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3158
3158
|
* // before mapping: 1
|
|
3159
3159
|
* // after mapping: 2
|
|
3160
3160
|
* // before mapping: 2
|
|
@@ -3235,7 +3235,7 @@ export const tapSink = internal.tapSink;
|
|
|
3235
3235
|
* Stream.tap((n) => log(`> Emitted ${n}`))
|
|
3236
3236
|
* )
|
|
3237
3237
|
*
|
|
3238
|
-
*
|
|
3238
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3239
3239
|
* // Received 0 after 56ms
|
|
3240
3240
|
* // > Emitted 0 after 0ms
|
|
3241
3241
|
* // Received 1 after 52ms
|
|
@@ -3289,7 +3289,7 @@ export const throttleEffect = internal.throttleEffect;
|
|
|
3289
3289
|
*
|
|
3290
3290
|
* const stream = Stream.tick("1 seconds").pipe(Stream.tap(() => log("tick")))
|
|
3291
3291
|
*
|
|
3292
|
-
*
|
|
3292
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
3293
3293
|
* // tick after 4ms
|
|
3294
3294
|
* // tick after 1003ms
|
|
3295
3295
|
* // tick after 1001ms
|
|
@@ -3365,7 +3365,7 @@ export const toPubSub = internal.toPubSub;
|
|
|
3365
3365
|
* }
|
|
3366
3366
|
* })
|
|
3367
3367
|
*
|
|
3368
|
-
*
|
|
3368
|
+
* Effect.runPromise(Effect.scoped(program)).then(console.log, console.error)
|
|
3369
3369
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
3370
3370
|
* // { _id: 'Chunk', values: [ 3, 4 ] }
|
|
3371
3371
|
* // { _id: 'Chunk', values: [ 5 ] }
|
|
@@ -3442,7 +3442,7 @@ export const transduce = internal.transduce;
|
|
|
3442
3442
|
*
|
|
3443
3443
|
* const stream = Stream.unfold(1, (n) => Option.some([n, n + 1]))
|
|
3444
3444
|
*
|
|
3445
|
-
*
|
|
3445
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
3446
3446
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
3447
3447
|
* ```
|
|
3448
3448
|
*
|
|
@@ -3478,7 +3478,7 @@ export const unfoldChunkEffect = internal.unfoldChunkEffect;
|
|
|
3478
3478
|
* Effect.map((b) => (b ? Option.some([n, -n]) : Option.some([n, n])))
|
|
3479
3479
|
* ))
|
|
3480
3480
|
*
|
|
3481
|
-
*
|
|
3481
|
+
* Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
3482
3482
|
* // { _id: 'Chunk', values: [ 1, -1, -1, -1, -1 ] }
|
|
3483
3483
|
* ```
|
|
3484
3484
|
*
|
|
@@ -3497,7 +3497,7 @@ export {
|
|
|
3497
3497
|
*
|
|
3498
3498
|
* const stream = Stream.void
|
|
3499
3499
|
*
|
|
3500
|
-
*
|
|
3500
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3501
3501
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
3502
3502
|
*
|
|
3503
3503
|
* ```
|
|
@@ -3590,7 +3590,7 @@ export const withSpan = internal.withSpan;
|
|
|
3590
3590
|
* Stream.make("a", "b", "c")
|
|
3591
3591
|
* )
|
|
3592
3592
|
*
|
|
3593
|
-
*
|
|
3593
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3594
3594
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
3595
3595
|
* ```
|
|
3596
3596
|
*
|
|
@@ -3625,7 +3625,7 @@ export const zipFlatten = internal.zipFlatten;
|
|
|
3625
3625
|
* defaultOther: "x"
|
|
3626
3626
|
* })
|
|
3627
3627
|
*
|
|
3628
|
-
*
|
|
3628
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3629
3629
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
3630
3630
|
* ```
|
|
3631
3631
|
*
|
|
@@ -3731,7 +3731,7 @@ export const zipAllSortedByKeyWith = internal.zipAllSortedByKeyWith;
|
|
|
3731
3731
|
* onBoth: (n, s) => [n - s.length, s]
|
|
3732
3732
|
* })
|
|
3733
3733
|
*
|
|
3734
|
-
*
|
|
3734
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3735
3735
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
3736
3736
|
* ```
|
|
3737
3737
|
*
|
|
@@ -3762,7 +3762,7 @@ export const zipAllWith = internal.zipAllWith;
|
|
|
3762
3762
|
*
|
|
3763
3763
|
* const stream = Stream.zipLatest(s1, s2)
|
|
3764
3764
|
*
|
|
3765
|
-
*
|
|
3765
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3766
3766
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
3767
3767
|
* ```
|
|
3768
3768
|
*
|
|
@@ -3788,7 +3788,7 @@ export const zipLatest = internal.zipLatest;
|
|
|
3788
3788
|
* Stream.fromSchedule(Schedule.spaced('4 millis')),
|
|
3789
3789
|
* ).pipe(Stream.take(6), Stream.tap(Console.log))
|
|
3790
3790
|
*
|
|
3791
|
-
*
|
|
3791
|
+
* Effect.runPromise(Stream.runDrain(stream))
|
|
3792
3792
|
* // Output:
|
|
3793
3793
|
* // [ 0, 0, 0 ]
|
|
3794
3794
|
* // [ 1, 0, 0 ]
|
|
@@ -3853,7 +3853,7 @@ export const zipRight = internal.zipRight;
|
|
|
3853
3853
|
* (n, s) => [n - s.length, s]
|
|
3854
3854
|
* )
|
|
3855
3855
|
*
|
|
3856
|
-
*
|
|
3856
|
+
* Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3857
3857
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
3858
3858
|
* ```
|
|
3859
3859
|
*
|
|
@@ -3880,7 +3880,7 @@ export const zipWithChunks = internal.zipWithChunks;
|
|
|
3880
3880
|
*
|
|
3881
3881
|
* const stream = Stream.zipWithNext(Stream.make(1, 2, 3, 4))
|
|
3882
3882
|
*
|
|
3883
|
-
*
|
|
3883
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunk) => console.log(Chunk.toArray(chunk)))
|
|
3884
3884
|
* // [
|
|
3885
3885
|
* // [ 1, { _id: 'Option', _tag: 'Some', value: 2 } ],
|
|
3886
3886
|
* // [ 2, { _id: 'Option', _tag: 'Some', value: 3 } ],
|
|
@@ -3903,7 +3903,7 @@ export const zipWithNext = internal.zipWithNext;
|
|
|
3903
3903
|
*
|
|
3904
3904
|
* const stream = Stream.zipWithPrevious(Stream.make(1, 2, 3, 4))
|
|
3905
3905
|
*
|
|
3906
|
-
*
|
|
3906
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunk) => console.log(Chunk.toArray(chunk)))
|
|
3907
3907
|
* // [
|
|
3908
3908
|
* // [ { _id: 'Option', _tag: 'None' }, 1 ],
|
|
3909
3909
|
* // [ { _id: 'Option', _tag: 'Some', value: 1 }, 2 ],
|
|
@@ -3925,7 +3925,7 @@ export const zipWithPrevious = internal.zipWithPrevious;
|
|
|
3925
3925
|
*
|
|
3926
3926
|
* const stream = Stream.zipWithPreviousAndNext(Stream.make(1, 2, 3, 4))
|
|
3927
3927
|
*
|
|
3928
|
-
*
|
|
3928
|
+
* Effect.runPromise(Stream.runCollect(stream)).then((chunk) => console.log(Chunk.toArray(chunk)))
|
|
3929
3929
|
* // [
|
|
3930
3930
|
* // [
|
|
3931
3931
|
* // { _id: 'Option', _tag: 'None' },
|
|
@@ -3965,7 +3965,7 @@ export const zipWithPreviousAndNext = internal.zipWithPreviousAndNext;
|
|
|
3965
3965
|
*
|
|
3966
3966
|
* const indexedStream = Stream.zipWithIndex(stream)
|
|
3967
3967
|
*
|
|
3968
|
-
*
|
|
3968
|
+
* Effect.runPromise(Stream.runCollect(indexedStream)).then(console.log)
|
|
3969
3969
|
* // {
|
|
3970
3970
|
* // _id: 'Chunk',
|
|
3971
3971
|
* // values: [ [ 'Mary', 0 ], [ 'James', 1 ], [ 'Robert', 2 ], [ 'Patricia', 3 ] ]
|
|
@@ -3989,11 +3989,6 @@ export const zipWithIndex = internal.zipWithIndex;
|
|
|
3989
3989
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
3990
3990
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
3991
3991
|
*
|
|
3992
|
-
* @see {@link bindTo}
|
|
3993
|
-
* @see {@link bind}
|
|
3994
|
-
* @see {@link bindEffect}
|
|
3995
|
-
* @see {@link let_ let}
|
|
3996
|
-
*
|
|
3997
3992
|
* @example
|
|
3998
3993
|
* ```ts
|
|
3999
3994
|
* import * as assert from "node:assert"
|
|
@@ -4008,6 +4003,11 @@ export const zipWithIndex = internal.zipWithIndex;
|
|
|
4008
4003
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
4009
4004
|
* ```
|
|
4010
4005
|
*
|
|
4006
|
+
* @see {@link bindTo}
|
|
4007
|
+
* @see {@link bind}
|
|
4008
|
+
* @see {@link bindEffect}
|
|
4009
|
+
* @see {@link let_ let}
|
|
4010
|
+
*
|
|
4011
4011
|
* @category do notation
|
|
4012
4012
|
* @since 2.0.0
|
|
4013
4013
|
*/
|
|
@@ -4022,11 +4022,6 @@ export const Do = internal.Do;
|
|
|
4022
4022
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
4023
4023
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
4024
4024
|
*
|
|
4025
|
-
* @see {@link Do}
|
|
4026
|
-
* @see {@link bindTo}
|
|
4027
|
-
* @see {@link bindEffect}
|
|
4028
|
-
* @see {@link let_ let}
|
|
4029
|
-
*
|
|
4030
4025
|
* @example
|
|
4031
4026
|
* ```ts
|
|
4032
4027
|
* import * as assert from "node:assert"
|
|
@@ -4041,6 +4036,11 @@ export const Do = internal.Do;
|
|
|
4041
4036
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
4042
4037
|
* ```
|
|
4043
4038
|
*
|
|
4039
|
+
* @see {@link Do}
|
|
4040
|
+
* @see {@link bindTo}
|
|
4041
|
+
* @see {@link bindEffect}
|
|
4042
|
+
* @see {@link let_ let}
|
|
4043
|
+
*
|
|
4044
4044
|
* @category do notation
|
|
4045
4045
|
* @since 2.0.0
|
|
4046
4046
|
*/
|
|
@@ -4067,11 +4067,6 @@ export const bindEffect = groupBy_.bindEffect;
|
|
|
4067
4067
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
4068
4068
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
4069
4069
|
*
|
|
4070
|
-
* @see {@link Do}
|
|
4071
|
-
* @see {@link bind}
|
|
4072
|
-
* @see {@link bindEffect}
|
|
4073
|
-
* @see {@link let_ let}
|
|
4074
|
-
*
|
|
4075
4070
|
* @example
|
|
4076
4071
|
* ```ts
|
|
4077
4072
|
* import * as assert from "node:assert"
|
|
@@ -4086,6 +4081,11 @@ export const bindEffect = groupBy_.bindEffect;
|
|
|
4086
4081
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
4087
4082
|
* ```
|
|
4088
4083
|
*
|
|
4084
|
+
* @see {@link Do}
|
|
4085
|
+
* @see {@link bind}
|
|
4086
|
+
* @see {@link bindEffect}
|
|
4087
|
+
* @see {@link let_ let}
|
|
4088
|
+
*
|
|
4089
4089
|
* @category do notation
|
|
4090
4090
|
* @since 2.0.0
|
|
4091
4091
|
*/
|
|
@@ -4102,11 +4102,6 @@ export {
|
|
|
4102
4102
|
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
|
|
4103
4103
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
4104
4104
|
*
|
|
4105
|
-
* @see {@link Do}
|
|
4106
|
-
* @see {@link bindTo}
|
|
4107
|
-
* @see {@link bind}
|
|
4108
|
-
* @see {@link bindEffect}
|
|
4109
|
-
*
|
|
4110
4105
|
* @example
|
|
4111
4106
|
* ```ts
|
|
4112
4107
|
* import * as assert from "node:assert"
|
|
@@ -4119,8 +4114,13 @@ export {
|
|
|
4119
4114
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
4120
4115
|
* )
|
|
4121
4116
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
4122
|
-
*
|
|
4123
4117
|
* ```
|
|
4118
|
+
*
|
|
4119
|
+
* @see {@link Do}
|
|
4120
|
+
* @see {@link bindTo}
|
|
4121
|
+
* @see {@link bind}
|
|
4122
|
+
* @see {@link bindEffect}
|
|
4123
|
+
*
|
|
4124
4124
|
* @category do notation
|
|
4125
4125
|
* @since 2.0.0
|
|
4126
4126
|
*/
|