@fncts/io 0.0.32 → 0.0.33
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/Fiber/FiberRuntime.d.ts +3 -3
- package/IO/api.d.ts +2 -1
- package/IO/definition.d.ts +34 -24
- package/IO/runtime.d.ts +7 -17
- package/STM/definition.d.ts +1 -1
- package/Stream/api.d.ts +89 -1
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs +1 -1
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +3 -3
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +4 -4
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api/toPull.cjs +2 -2
- package/_cjs/Channel/api/toPull.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +6 -6
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelExecutor.cjs +10 -10
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +3 -3
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/Clock/live.cjs +1 -1
- package/_cjs/Clock/live.cjs.map +1 -1
- package/_cjs/Fiber/FiberRuntime.cjs +78 -47
- package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
- package/_cjs/Fiber/api/collectAll.cjs +1 -1
- package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
- package/_cjs/Fiber/api/mapIO.cjs +1 -1
- package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
- package/_cjs/Fiber/api/zipWith.cjs +1 -1
- package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
- package/_cjs/Fiber/constructors.cjs +5 -5
- package/_cjs/Fiber/constructors.cjs.map +1 -1
- package/_cjs/FiberRef/unsafe.cjs +3 -2
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/Future/api.cjs +4 -4
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Hub/internal.cjs +1 -1
- package/_cjs/Hub/internal.cjs.map +1 -1
- package/_cjs/IO/api/asyncIO.cjs +1 -1
- package/_cjs/IO/api/asyncIO.cjs.map +1 -1
- package/_cjs/IO/api/asyncInterrupt.cjs +2 -2
- package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
- package/_cjs/IO/api/concurrency.cjs +3 -3
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/daemonChildren.cjs +1 -1
- package/_cjs/IO/api/daemonChildren.cjs.map +1 -1
- package/_cjs/IO/api/fork.cjs +2 -1
- package/_cjs/IO/api/fork.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +2 -2
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/repeat.cjs +2 -2
- package/_cjs/IO/api/repeat.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +1 -1
- package/_cjs/IO/api/timeout.cjs.map +1 -1
- package/_cjs/IO/api/transplant.cjs +1 -1
- package/_cjs/IO/api/transplant.cjs.map +1 -1
- package/_cjs/IO/api/withEarlyRelease.cjs +1 -1
- package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
- package/_cjs/IO/api.cjs +33 -32
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +17 -31
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +45 -38
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/Logger/api.cjs +3 -2
- package/_cjs/Logger/api.cjs.map +1 -1
- package/_cjs/MVar/api.cjs +11 -11
- package/_cjs/MVar/api.cjs.map +1 -1
- package/_cjs/Push/api.cjs +3 -3
- package/_cjs/Push/api.cjs.map +1 -1
- package/_cjs/Push/internal.cjs +1 -1
- package/_cjs/Push/internal.cjs.map +1 -1
- package/_cjs/Queue/api/filterInputIO.cjs +2 -2
- package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
- package/_cjs/Ref/Derived.cjs +4 -4
- package/_cjs/Ref/Derived.cjs.map +1 -1
- package/_cjs/Ref/DerivedAll.cjs +5 -5
- package/_cjs/Ref/DerivedAll.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/api.cjs +3 -3
- package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
- package/_cjs/Ref/api/collect.cjs +1 -1
- package/_cjs/Ref/api/collect.cjs.map +1 -1
- package/_cjs/Ref/api/dimap.cjs +3 -3
- package/_cjs/Ref/api/dimap.cjs.map +1 -1
- package/_cjs/Ref/api/filter.cjs +2 -2
- package/_cjs/Ref/api/filter.cjs.map +1 -1
- package/_cjs/Ref/api.cjs +2 -3
- package/_cjs/Ref/api.cjs.map +1 -1
- package/_cjs/RefSubject/Atomic.cjs +6 -6
- package/_cjs/RefSubject/Atomic.cjs.map +1 -1
- package/_cjs/STM/api.cjs +5 -5
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/STM/definition.cjs +1 -1
- package/_cjs/STM/definition.cjs.map +1 -1
- package/_cjs/STM/internal/CommitState.cjs +5 -4
- package/_cjs/STM/internal/CommitState.cjs.map +1 -1
- package/_cjs/STM/internal/Journal.cjs +8 -8
- package/_cjs/STM/internal/Journal.cjs.map +1 -1
- package/_cjs/Schedule/api/driver.cjs +3 -3
- package/_cjs/Schedule/api/driver.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +8 -8
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api.cjs +3 -3
- package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +1 -1
- package/_cjs/ScopedRef/api.cjs.map +1 -1
- package/_cjs/Semaphore.cjs +2 -2
- package/_cjs/Semaphore.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +6 -6
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +8 -8
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +6 -6
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
- package/_cjs/Stream/api.cjs +370 -130
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs +2 -2
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
- package/_cjs/Stream/internal/Pull.cjs +2 -2
- package/_cjs/Stream/internal/Pull.cjs.map +1 -1
- package/_cjs/Stream/internal/Take.cjs +6 -6
- package/_cjs/Stream/internal/Take.cjs.map +1 -1
- package/_cjs/Stream/internal/util.cjs +3 -2
- package/_cjs/Stream/internal/util.cjs.map +1 -1
- package/_cjs/TFuture/api.cjs +3 -3
- package/_cjs/TFuture/api.cjs.map +1 -1
- package/_cjs/TFuture/constructors.cjs +1 -1
- package/_cjs/TFuture/constructors.cjs.map +1 -1
- package/_cjs/TRef/definition.cjs +9 -9
- package/_cjs/TRef/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/findIO.cjs +3 -3
- package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
- package/_cjs/data/Exit/foreachIO.cjs +1 -1
- package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
- package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
- package/_mjs/Channel/api/mapOutConcurrentIO.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +3 -3
- package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
- package/_mjs/Channel/api/mergeWith.mjs +4 -4
- package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
- package/_mjs/Channel/api/toPull.mjs +2 -2
- package/_mjs/Channel/api/toPull.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +6 -6
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +10 -10
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +3 -3
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
- package/_mjs/Clock/live.mjs +1 -1
- package/_mjs/Clock/live.mjs.map +1 -1
- package/_mjs/Fiber/FiberRuntime.mjs +78 -47
- package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
- package/_mjs/Fiber/api/collectAll.mjs +1 -1
- package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
- package/_mjs/Fiber/api/mapIO.mjs +1 -1
- package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
- package/_mjs/Fiber/api/zipWith.mjs +1 -1
- package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
- package/_mjs/Fiber/constructors.mjs +5 -5
- package/_mjs/Fiber/constructors.mjs.map +1 -1
- package/_mjs/FiberRef/unsafe.mjs +3 -2
- package/_mjs/FiberRef/unsafe.mjs.map +1 -1
- package/_mjs/Future/api.mjs +4 -4
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Hub/internal.mjs +1 -1
- package/_mjs/Hub/internal.mjs.map +1 -1
- package/_mjs/IO/api/asyncIO.mjs +1 -1
- package/_mjs/IO/api/asyncIO.mjs.map +1 -1
- package/_mjs/IO/api/asyncInterrupt.mjs +2 -2
- package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
- package/_mjs/IO/api/concurrency.mjs +3 -3
- package/_mjs/IO/api/concurrency.mjs.map +1 -1
- package/_mjs/IO/api/daemonChildren.mjs +1 -1
- package/_mjs/IO/api/daemonChildren.mjs.map +1 -1
- package/_mjs/IO/api/fork.mjs +2 -1
- package/_mjs/IO/api/fork.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +2 -2
- package/_mjs/IO/api/interrupt.mjs.map +1 -1
- package/_mjs/IO/api/repeat.mjs +2 -2
- package/_mjs/IO/api/repeat.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +1 -1
- package/_mjs/IO/api/timeout.mjs.map +1 -1
- package/_mjs/IO/api/transplant.mjs +1 -1
- package/_mjs/IO/api/transplant.mjs.map +1 -1
- package/_mjs/IO/api/withEarlyRelease.mjs +1 -1
- package/_mjs/IO/api/withEarlyRelease.mjs.map +1 -1
- package/_mjs/IO/api.mjs +32 -30
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +16 -27
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +42 -33
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/Logger/api.mjs +3 -2
- package/_mjs/Logger/api.mjs.map +1 -1
- package/_mjs/MVar/api.mjs +11 -11
- package/_mjs/MVar/api.mjs.map +1 -1
- package/_mjs/Push/api.mjs +3 -3
- package/_mjs/Push/api.mjs.map +1 -1
- package/_mjs/Push/internal.mjs +1 -1
- package/_mjs/Push/internal.mjs.map +1 -1
- package/_mjs/Queue/api/filterInputIO.mjs +2 -2
- package/_mjs/Queue/api/filterInputIO.mjs.map +1 -1
- package/_mjs/Ref/Derived.mjs +4 -4
- package/_mjs/Ref/Derived.mjs.map +1 -1
- package/_mjs/Ref/DerivedAll.mjs +5 -5
- package/_mjs/Ref/DerivedAll.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/api.mjs +3 -3
- package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
- package/_mjs/Ref/api/collect.mjs +1 -1
- package/_mjs/Ref/api/collect.mjs.map +1 -1
- package/_mjs/Ref/api/dimap.mjs +3 -3
- package/_mjs/Ref/api/dimap.mjs.map +1 -1
- package/_mjs/Ref/api/filter.mjs +2 -2
- package/_mjs/Ref/api/filter.mjs.map +1 -1
- package/_mjs/Ref/api.mjs +2 -1
- package/_mjs/Ref/api.mjs.map +1 -1
- package/_mjs/RefSubject/Atomic.mjs +6 -6
- package/_mjs/RefSubject/Atomic.mjs.map +1 -1
- package/_mjs/STM/api.mjs +5 -5
- package/_mjs/STM/api.mjs.map +1 -1
- package/_mjs/STM/definition.mjs +1 -1
- package/_mjs/STM/definition.mjs.map +1 -1
- package/_mjs/STM/internal/CommitState.mjs +5 -4
- package/_mjs/STM/internal/CommitState.mjs.map +1 -1
- package/_mjs/STM/internal/Journal.mjs +8 -8
- package/_mjs/STM/internal/Journal.mjs.map +1 -1
- package/_mjs/Schedule/api/driver.mjs +3 -3
- package/_mjs/Schedule/api/driver.mjs.map +1 -1
- package/_mjs/Schedule/api.mjs +8 -8
- package/_mjs/Schedule/api.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs +1 -1
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/api.mjs +3 -3
- package/_mjs/Scope/ReleaseMap/api.mjs.map +1 -1
- package/_mjs/ScopedRef/api.mjs +1 -1
- package/_mjs/ScopedRef/api.mjs.map +1 -1
- package/_mjs/Semaphore.mjs +2 -2
- package/_mjs/Semaphore.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +6 -6
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/Stream/api/zipAllWith.mjs +8 -8
- package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
- package/_mjs/Stream/api/zipWithChunks.mjs +6 -6
- package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +281 -58
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/Stream/internal/Handoff.mjs +2 -2
- package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
- package/_mjs/Stream/internal/Pull.mjs +2 -2
- package/_mjs/Stream/internal/Pull.mjs.map +1 -1
- package/_mjs/Stream/internal/Take.mjs +6 -6
- package/_mjs/Stream/internal/Take.mjs.map +1 -1
- package/_mjs/Stream/internal/util.mjs +3 -2
- package/_mjs/Stream/internal/util.mjs.map +1 -1
- package/_mjs/TFuture/api.mjs +3 -3
- package/_mjs/TFuture/api.mjs.map +1 -1
- package/_mjs/TFuture/constructors.mjs +1 -1
- package/_mjs/TFuture/constructors.mjs.map +1 -1
- package/_mjs/TRef/definition.mjs +9 -9
- package/_mjs/TRef/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/findIO.mjs +3 -3
- package/_mjs/collection/immutable/Conc/findIO.mjs.map +1 -1
- package/_mjs/data/Exit/foreachIO.mjs +1 -1
- package/_mjs/data/Exit/foreachIO.mjs.map +1 -1
- package/_src/Fiber/FiberRuntime.ts +39 -16
- package/_src/IO/api/asyncIO.ts +1 -1
- package/_src/IO/api.ts +4 -3
- package/_src/IO/definition.ts +35 -28
- package/_src/IO/runtime.ts +36 -35
- package/_src/RefSubject/Atomic.ts +4 -4
- package/_src/STM/definition.ts +1 -1
- package/_src/Stream/api.ts +258 -8
- package/package.json +2 -2
package/_cjs/Stream/api.cjs
CHANGED
|
@@ -35,11 +35,9 @@ exports.cross = cross;
|
|
|
35
35
|
exports.crossWith = void 0;
|
|
36
36
|
exports.debounce = debounce;
|
|
37
37
|
exports.defaultIfEmpty = defaultIfEmpty;
|
|
38
|
-
exports.defer =
|
|
38
|
+
exports.defer = void 0;
|
|
39
39
|
exports.distributedWith = distributedWith;
|
|
40
|
-
exports.distributedWithDynamic = void 0;
|
|
41
|
-
exports.drain = drain;
|
|
42
|
-
exports.drop = void 0;
|
|
40
|
+
exports.drop = exports.drain = exports.distributedWithDynamic = void 0;
|
|
43
41
|
exports.dropUntil = dropUntil;
|
|
44
42
|
exports.dropWhile = void 0;
|
|
45
43
|
exports.either = either;
|
|
@@ -49,6 +47,7 @@ exports.environment = exports.ensuring = void 0;
|
|
|
49
47
|
exports.environmentWith = environmentWith;
|
|
50
48
|
exports.environmentWithIO = environmentWithIO;
|
|
51
49
|
exports.environmentWithStream = environmentWithStream;
|
|
50
|
+
exports.execute = void 0;
|
|
52
51
|
exports.fail = fail;
|
|
53
52
|
exports.failCause = failCause;
|
|
54
53
|
exports.failNow = exports.failCauseNow = void 0;
|
|
@@ -86,8 +85,14 @@ exports.mapErrorCause = mapErrorCause;
|
|
|
86
85
|
exports.mapIO = void 0;
|
|
87
86
|
exports.mapIOConcurrently = mapIOConcurrently;
|
|
88
87
|
exports.mapIOConcurrentlyUnordered = mapIOConcurrentlyUnordered;
|
|
89
|
-
exports.
|
|
88
|
+
exports.mergeEither = exports.merge = void 0;
|
|
89
|
+
exports.mergeHaltEither = mergeHaltEither;
|
|
90
|
+
exports.mergeHaltLeft = mergeHaltLeft;
|
|
91
|
+
exports.mergeHaltRight = mergeHaltRight;
|
|
92
|
+
exports.mergeLeft = mergeLeft;
|
|
93
|
+
exports.mergeMap = void 0;
|
|
90
94
|
exports.mergeMapIO = mergeMapIO;
|
|
95
|
+
exports.mergeRight = mergeRight;
|
|
91
96
|
exports.mergeWith = void 0;
|
|
92
97
|
exports.onError = onError;
|
|
93
98
|
exports.orElse = void 0;
|
|
@@ -112,12 +117,18 @@ exports.scan = scan;
|
|
|
112
117
|
exports.scanIO = void 0;
|
|
113
118
|
exports.scanReduce = scanReduce;
|
|
114
119
|
exports.scoped = exports.scanReduceIO = void 0;
|
|
120
|
+
exports.sliding = sliding;
|
|
121
|
+
exports.split = split;
|
|
115
122
|
exports.succeed = succeed;
|
|
116
123
|
exports.succeedNow = void 0;
|
|
117
124
|
exports.take = take;
|
|
118
125
|
exports.takeUntil = takeUntil;
|
|
119
126
|
exports.takeUntilIO = takeUntilIO;
|
|
120
|
-
exports.tap =
|
|
127
|
+
exports.tap = void 0;
|
|
128
|
+
exports.tapBoth = tapBoth;
|
|
129
|
+
exports.tapError = void 0;
|
|
130
|
+
exports.tapErrorCause = tapErrorCause;
|
|
131
|
+
exports.tapSink = tapSink;
|
|
121
132
|
exports.throttleEnforce = throttleEnforce;
|
|
122
133
|
exports.toQueue = exports.toPull = exports.toHub = exports.throttleEnforceIO = void 0;
|
|
123
134
|
exports.toQueueDropping = toQueueDropping;
|
|
@@ -182,20 +193,23 @@ var tsplus_module_49 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/requir
|
|
|
182
193
|
var tsplus_module_50 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
|
|
183
194
|
var tsplus_module_51 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/collection/immutable/Conc/findIO"));
|
|
184
195
|
var tsplus_module_52 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/definition"));
|
|
185
|
-
var tsplus_module_53 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
186
|
-
var tsplus_module_54 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
187
|
-
var tsplus_module_55 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
188
|
-
var tsplus_module_56 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/
|
|
189
|
-
var tsplus_module_57 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/
|
|
190
|
-
var tsplus_module_58 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/
|
|
191
|
-
var tsplus_module_59 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/
|
|
192
|
-
var tsplus_module_60 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
193
|
-
var tsplus_module_61 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/
|
|
194
|
-
var tsplus_module_62 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
195
|
-
var tsplus_module_63 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
196
|
-
var tsplus_module_64 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
196
|
+
var tsplus_module_53 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/definition"));
|
|
197
|
+
var tsplus_module_54 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/Pull"));
|
|
198
|
+
var tsplus_module_55 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Queue/api/takeBetween"));
|
|
199
|
+
var tsplus_module_56 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/interruptWhen"));
|
|
200
|
+
var tsplus_module_57 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mapOutConcurrentIO"));
|
|
201
|
+
var tsplus_module_58 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mergeMap"));
|
|
202
|
+
var tsplus_module_59 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/internal/MergeDecision"));
|
|
203
|
+
var tsplus_module_60 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mergeWith"));
|
|
204
|
+
var tsplus_module_61 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/MemoMap"));
|
|
205
|
+
var tsplus_module_62 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/api"));
|
|
206
|
+
var tsplus_module_63 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/runDrain"));
|
|
207
|
+
var tsplus_module_64 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/definition"));
|
|
208
|
+
var tsplus_module_65 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/exceptions"));
|
|
209
|
+
var tsplus_module_66 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/interrupt"));
|
|
210
|
+
var tsplus_module_67 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/toPull"));
|
|
197
211
|
var _function = /*#__PURE__*/require("@fncts/base/data/function");
|
|
198
|
-
var
|
|
212
|
+
var _definition4 = /*#__PURE__*/require("./definition.cjs");
|
|
199
213
|
var _Handoff2 = /*#__PURE__*/require("./internal/Handoff.cjs");
|
|
200
214
|
var _SinkEndReason2 = /*#__PURE__*/require("./internal/SinkEndReason.cjs");
|
|
201
215
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -227,8 +241,12 @@ const concat = concat_1;
|
|
|
227
241
|
exports.concat = concat;
|
|
228
242
|
const crossWith = crossWith_1;
|
|
229
243
|
exports.crossWith = crossWith;
|
|
244
|
+
const defer = defer_1;
|
|
245
|
+
exports.defer = defer;
|
|
230
246
|
const distributedWithDynamic = distributedWithDynamic_1;
|
|
231
247
|
exports.distributedWithDynamic = distributedWithDynamic;
|
|
248
|
+
const drain = drain_1;
|
|
249
|
+
exports.drain = drain;
|
|
232
250
|
const drop = drop_1;
|
|
233
251
|
exports.drop = drop;
|
|
234
252
|
const dropWhile = dropWhile_1;
|
|
@@ -237,6 +255,8 @@ const ensuring = ensuring_1;
|
|
|
237
255
|
exports.ensuring = ensuring;
|
|
238
256
|
const environment = environment_1;
|
|
239
257
|
exports.environment = environment;
|
|
258
|
+
const execute = execute_1;
|
|
259
|
+
exports.execute = execute;
|
|
240
260
|
const failNow = failNow_1;
|
|
241
261
|
exports.failNow = failNow;
|
|
242
262
|
const failCauseNow = failCauseNow_1;
|
|
@@ -287,6 +307,8 @@ const mapError = mapError_1;
|
|
|
287
307
|
exports.mapError = mapError;
|
|
288
308
|
const mapIO = mapIO_1;
|
|
289
309
|
exports.mapIO = mapIO;
|
|
310
|
+
const merge = merge_1;
|
|
311
|
+
exports.merge = merge;
|
|
290
312
|
const mergeMap = mergeMap_1;
|
|
291
313
|
exports.mergeMap = mergeMap;
|
|
292
314
|
const mergeEither = mergeEither_1;
|
|
@@ -325,6 +347,10 @@ const scanReduceIO = scanReduceIO_1;
|
|
|
325
347
|
exports.scanReduceIO = scanReduceIO;
|
|
326
348
|
const succeedNow = succeedNow_1;
|
|
327
349
|
exports.succeedNow = succeedNow;
|
|
350
|
+
const tap = tap_1;
|
|
351
|
+
exports.tap = tap;
|
|
352
|
+
const tapError = tapError_1;
|
|
353
|
+
exports.tapError = tapError;
|
|
328
354
|
const throttleEnforceIO = throttleEnforceIO_1;
|
|
329
355
|
exports.throttleEnforceIO = throttleEnforceIO;
|
|
330
356
|
const toHub = toHub_1;
|
|
@@ -381,7 +407,7 @@ function aggregateAsync(sink, __tsplusTrace) {
|
|
|
381
407
|
*/
|
|
382
408
|
function aggregateAsyncWithin_1(sink, schedule, __tsplusTrace) {
|
|
383
409
|
return stream => {
|
|
384
|
-
return filterMap_1(cb => tsplus_module_4.match(() => tsplus_module_3.nothing(), tsplus_module_3.just)(cb), __tsplusTrace)(aggregateAsyncWithinEither_1(sink, schedule, __tsplusTrace)(stream));
|
|
410
|
+
return filterMap_1(cb => tsplus_module_4.match(() => tsplus_module_3.nothing(__tsplusTrace), tsplus_module_3.just)(cb), __tsplusTrace)(aggregateAsyncWithinEither_1(sink, schedule, __tsplusTrace)(stream));
|
|
385
411
|
};
|
|
386
412
|
}
|
|
387
413
|
/**
|
|
@@ -434,15 +460,15 @@ function aggregateAsyncWithinEither_1(sink, schedule, __tsplusTrace) {
|
|
|
434
460
|
function handleSide(leftovers, b, c, __tsplusTrace) {
|
|
435
461
|
return tsplus_module_10.unwrap(() => tsplus_module_1.zipRight(tsplus_module_1.map(reason => tsplus_module_21.matchSinkEndReason({
|
|
436
462
|
ScheduleEnd: () => tsplus_module_10.unwrapScoped(() => tsplus_module_1.flatMap(consumed_ => tsplus_module_1.flatMap(sinkFiber => tsplus_module_1.map(scheduleFiber => {
|
|
437
|
-
const toWrite = tsplus_module_20.match(() => tsplus_module_19.make(tsplus_module_18.right(b)), c => tsplus_module_19.make(tsplus_module_18.right(b), tsplus_module_18.left(c)))(c);
|
|
463
|
+
const toWrite = tsplus_module_20.match(() => tsplus_module_19.make(tsplus_module_18.right(b, __tsplusTrace)), c => tsplus_module_19.make(tsplus_module_18.right(b, __tsplusTrace), tsplus_module_18.left(c, __tsplusTrace)))(c);
|
|
438
464
|
return consumed_ ? tsplus_module_11.zipRight(scheduledAggregator(sinkFiber, scheduleFiber))(tsplus_module_10.write(() => toWrite)) : scheduledAggregator(sinkFiber, scheduleFiber);
|
|
439
|
-
}, __tsplusTrace)(tsplus_module_17.forkScoped(timeout(tsplus_module_3.just(b), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(forkSink), __tsplusTrace)(tsplus_module_14.get(consumed, __tsplusTrace))),
|
|
440
|
-
UpstreamEnd: () => tsplus_module_10.unwrap(() => tsplus_module_1.map(p => p ? tsplus_module_10.write(() => tsplus_module_19.make(tsplus_module_18.right(b))) : tsplus_module_10.unit, __tsplusTrace)(tsplus_module_14.get(consumed, __tsplusTrace)))
|
|
465
|
+
}, __tsplusTrace)(tsplus_module_17.forkScoped(timeout(tsplus_module_3.just(b, __tsplusTrace), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(forkSink), __tsplusTrace)(tsplus_module_14.get(consumed, __tsplusTrace))),
|
|
466
|
+
UpstreamEnd: () => tsplus_module_10.unwrap(() => tsplus_module_1.map(p => p ? tsplus_module_10.write(() => tsplus_module_19.make(tsplus_module_18.right(b, __tsplusTrace))) : tsplus_module_10.unit, __tsplusTrace)(tsplus_module_14.get(consumed, __tsplusTrace)))
|
|
441
467
|
})(reason), __tsplusTrace)(tsplus_module_14.get(sinkEndReason, __tsplusTrace)), __tsplusTrace)(tsplus_module_13.set(tsplus_module_12.flatten(leftovers), __tsplusTrace)(sinkLeftovers)));
|
|
442
468
|
}
|
|
443
|
-
return tsplus_module_10.unwrap(() => tsplus_module_26.raceWith(() => tsplus_module_22.join(scheduleFiber, __tsplusTrace), (sinkExit, scheduleFiber) => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)(tsplus_module_1.fromExit(() => sinkExit, __tsplusTrace)), __tsplusTrace)(tsplus_module_23.interrupt(scheduleFiber)), (scheduleExit, sinkFiber) => tsplus_module_1.matchCauseIO(cause => tsplus_module_4.match(() => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd()))(handoff), __tsplusTrace)), cause => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_5.offer(tsplus_module_5.halt(cause))(handoff), __tsplusTrace)))(tsplus_module_25.failureOrCause(cause)), c => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.just(c), __tsplusTrace), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd()))(handoff), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fromExit(() => scheduleExit, __tsplusTrace)), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)));
|
|
469
|
+
return tsplus_module_10.unwrap(() => tsplus_module_26.raceWith(() => tsplus_module_22.join(scheduleFiber, __tsplusTrace), (sinkExit, scheduleFiber) => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), __tsplusTrace)(tsplus_module_1.fromExit(() => sinkExit, __tsplusTrace)), __tsplusTrace)(tsplus_module_23.interrupt(scheduleFiber)), (scheduleExit, sinkFiber) => tsplus_module_1.matchCauseIO(cause => tsplus_module_4.match(() => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd()))(handoff), __tsplusTrace)), cause => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_5.offer(tsplus_module_5.halt(cause))(handoff), __tsplusTrace)))(tsplus_module_25.failureOrCause(cause)), c => tsplus_module_1.zipRight(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.just(c, __tsplusTrace), __tsplusTrace), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd()))(handoff), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fromExit(() => scheduleExit, __tsplusTrace)), __tsplusTrace)(tsplus_module_22.join(sinkFiber, __tsplusTrace)));
|
|
444
470
|
};
|
|
445
|
-
return unwrapScoped_1(tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(sinkFiber => tsplus_module_1.map(scheduleFiber => new
|
|
471
|
+
return unwrapScoped_1(tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(sinkFiber => tsplus_module_1.map(scheduleFiber => new _definition4.Stream(scheduledAggregator(sinkFiber, scheduleFiber)), __tsplusTrace)(tsplus_module_17.forkScoped(timeout(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(tsplus_module_17.forkScoped(tsplus_module_16.runScoped(tsplus_module_10.doneCollect(tsplus_module_10.pipeToOrFail(sink.channel)(handoffConsumer))), __tsplusTrace)), __tsplusTrace)(tsplus_module_17.forkScoped(tsplus_module_16.runScoped(tsplus_module_10.pipeTo(handoffProducer)(stream.channel)), __tsplusTrace)), __tsplusTrace);
|
|
446
472
|
}, __tsplusTrace)(fromIO_1(deps, __tsplusTrace));
|
|
447
473
|
};
|
|
448
474
|
}
|
|
@@ -486,10 +512,14 @@ function as(b, __tsplusTrace) {
|
|
|
486
512
|
function asyncInterrupt_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
487
513
|
return unwrapScoped_1(tsplus_module_1.flatMap(output => tsplus_module_1.flatMap(runtime => tsplus_module_1.map(eitherStream => tsplus_module_4.match(canceler => {
|
|
488
514
|
const loop = tsplus_module_10.unwrap(() => tsplus_module_1.match(maybeError => tsplus_module_20.match(() => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow)(maybeError), as => tsplus_module_11.zipRight(loop)(tsplus_module_10.writeNow(as)), __tsplusTrace)(tsplus_module_1.flatMap(take => tsplus_module_27.done(take), __tsplusTrace)(tsplus_module_28.take(output, __tsplusTrace))));
|
|
489
|
-
return ensuring_1(canceler, __tsplusTrace)(new
|
|
515
|
+
return ensuring_1(canceler, __tsplusTrace)(new _definition4.Stream(loop));
|
|
490
516
|
}, stream => unwrap_1(tsplus_module_1.as(() => stream, __tsplusTrace)(tsplus_module_28.shutdown(output, __tsplusTrace)), __tsplusTrace))(eitherStream), __tsplusTrace)(tsplus_module_1.succeed(() => register((k, cb) => {
|
|
491
517
|
const effect = tsplus_module_1.flatMap(a => tsplus_module_28.offer(a, __tsplusTrace)(output), __tsplusTrace)(tsplus_module_27.fromPull(k));
|
|
492
|
-
|
|
518
|
+
const fiber = runtime.makeFiber(effect, __tsplusTrace);
|
|
519
|
+
if (cb) {
|
|
520
|
+
fiber.addObserver(cb);
|
|
521
|
+
}
|
|
522
|
+
fiber.start(effect);
|
|
493
523
|
}), __tsplusTrace)), __tsplusTrace)(tsplus_module_29.runtime(__tsplusTrace)), __tsplusTrace)(tsplus_module_31.acquireRelease(() => tsplus_module_30.makeBounded(outputBuffer, __tsplusTrace), queue => tsplus_module_28.shutdown(queue, __tsplusTrace), __tsplusTrace)), __tsplusTrace);
|
|
494
524
|
}
|
|
495
525
|
/**
|
|
@@ -501,7 +531,7 @@ function asyncInterrupt_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
|
501
531
|
* @tsplus static fncts.io.StreamOps asyncMaybe
|
|
502
532
|
*/
|
|
503
533
|
function asyncMaybe_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
504
|
-
return asyncInterrupt_1(k => tsplus_module_20.match(() => tsplus_module_18.left(tsplus_module_1.unit), tsplus_module_18.right)(register(k)), outputBuffer, __tsplusTrace);
|
|
534
|
+
return asyncInterrupt_1(k => tsplus_module_20.match(() => tsplus_module_18.left(tsplus_module_1.unit, __tsplusTrace), tsplus_module_18.right)(register(k)), outputBuffer, __tsplusTrace);
|
|
505
535
|
}
|
|
506
536
|
/**
|
|
507
537
|
* @tsplus static fncts.io.StreamOps async
|
|
@@ -509,17 +539,24 @@ function asyncMaybe_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
|
509
539
|
function async(register, outputBuffer = 16, __tsplusTrace) {
|
|
510
540
|
return asyncMaybe_1(cb => {
|
|
511
541
|
register(cb);
|
|
512
|
-
return tsplus_module_3.nothing();
|
|
542
|
+
return tsplus_module_3.nothing(__tsplusTrace);
|
|
513
543
|
}, outputBuffer, __tsplusTrace);
|
|
514
544
|
}
|
|
515
545
|
/**
|
|
516
546
|
* @tsplus static fncts.io.StreamOps asyncIO
|
|
517
547
|
*/
|
|
518
548
|
function asyncIO(register, outputBuffer = 16, __tsplusTrace) {
|
|
519
|
-
return new
|
|
549
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.flatMap(output => tsplus_module_1.flatMap(runtime => tsplus_module_1.map(() => {
|
|
520
550
|
const loop = tsplus_module_10.unwrap(() => tsplus_module_1.matchCauseIO(cause => tsplus_module_1.as(() => tsplus_module_4.match(maybeError => tsplus_module_20.match(() => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow)(maybeError), tsplus_module_11.failCauseNow)(tsplus_module_25.failureOrCause(cause)), __tsplusTrace)(tsplus_module_28.shutdown(output, __tsplusTrace)), as => tsplus_module_1.succeed(() => tsplus_module_11.zipRight(loop)(tsplus_module_10.writeNow(as)), __tsplusTrace), __tsplusTrace)(tsplus_module_1.flatMap(take => tsplus_module_27.done(take), __tsplusTrace)(tsplus_module_28.take(output, __tsplusTrace))));
|
|
521
551
|
return loop;
|
|
522
|
-
}, __tsplusTrace)(register((k, cb) =>
|
|
552
|
+
}, __tsplusTrace)(register((k, cb) => {
|
|
553
|
+
const io = tsplus_module_1.flatMap(a => tsplus_module_28.offer(a, __tsplusTrace)(output), __tsplusTrace)(tsplus_module_27.fromPull(k));
|
|
554
|
+
const fiber = runtime.makeFiber(io, __tsplusTrace);
|
|
555
|
+
if (cb) {
|
|
556
|
+
fiber.addObserver(cb);
|
|
557
|
+
}
|
|
558
|
+
fiber.start(io);
|
|
559
|
+
})), __tsplusTrace)(tsplus_module_29.runtime(__tsplusTrace)), __tsplusTrace)(tsplus_module_31.acquireRelease(() => tsplus_module_30.makeBounded(outputBuffer, __tsplusTrace), _ => tsplus_module_28.shutdown(_, __tsplusTrace), __tsplusTrace))));
|
|
523
560
|
}
|
|
524
561
|
/**
|
|
525
562
|
* Returns a stream whose failure and success channels have been mapped by
|
|
@@ -607,7 +644,7 @@ function broadcastedQueuesDynamic_1(maximumLag, __tsplusTrace) {
|
|
|
607
644
|
function buffer(capacity, __tsplusTrace) {
|
|
608
645
|
return stream => {
|
|
609
646
|
const queue = toQueueOfElements_1(capacity, __tsplusTrace)(stream);
|
|
610
|
-
return new
|
|
647
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
|
611
648
|
const process = tsplus_module_11.flatMap(exit => tsplus_module_36.match(cause => tsplus_module_20.match(() => tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow)(tsplus_module_25.flipCauseOption(cause)), value => tsplus_module_11.zipRight(process)(tsplus_module_10.writeNow(tsplus_module_19.single(value))))(exit))(tsplus_module_10.fromIO(() => tsplus_module_28.take(queue, __tsplusTrace)));
|
|
612
649
|
return process;
|
|
613
650
|
}, __tsplusTrace)(queue)));
|
|
@@ -619,7 +656,7 @@ function buffer(capacity, __tsplusTrace) {
|
|
|
619
656
|
function bufferChunks(capacity, __tsplusTrace) {
|
|
620
657
|
return stream => {
|
|
621
658
|
const queue = toQueue_1(capacity, __tsplusTrace)(stream);
|
|
622
|
-
return new
|
|
659
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
|
623
660
|
const process = tsplus_module_11.flatMap(take => tsplus_module_27.match(tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.zipRight(process)(tsplus_module_10.writeNow(value)))(take))(tsplus_module_10.fromIO(() => tsplus_module_28.take(queue, __tsplusTrace)));
|
|
624
661
|
return process;
|
|
625
662
|
}, __tsplusTrace)(queue)));
|
|
@@ -633,7 +670,7 @@ function bufferChunks(capacity, __tsplusTrace) {
|
|
|
633
670
|
*/
|
|
634
671
|
function bufferUnbounded(stream, __tsplusTrace) {
|
|
635
672
|
const queue = toQueueUnbounded_1(stream, __tsplusTrace);
|
|
636
|
-
return new
|
|
673
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
|
637
674
|
const process = tsplus_module_11.flatMap(take => tsplus_module_27.match(tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.zipRight(process)(tsplus_module_10.writeNow(value)))(take))(tsplus_module_10.fromIO(() => tsplus_module_28.take(queue, __tsplusTrace)));
|
|
638
675
|
return process;
|
|
639
676
|
}, __tsplusTrace)(queue)));
|
|
@@ -667,7 +704,7 @@ function catchAll_1(f, __tsplusTrace) {
|
|
|
667
704
|
function catchAllCause_1(f, __tsplusTrace) {
|
|
668
705
|
return stream => {
|
|
669
706
|
const channel = tsplus_module_10.catchAllCause(cause => f(cause).channel)(stream.channel);
|
|
670
|
-
return new
|
|
707
|
+
return new _definition4.Stream(channel);
|
|
671
708
|
};
|
|
672
709
|
}
|
|
673
710
|
/**
|
|
@@ -701,7 +738,7 @@ function catchJustCause(pf, __tsplusTrace) {
|
|
|
701
738
|
*/
|
|
702
739
|
function flatMap_1(f, __tsplusTrace) {
|
|
703
740
|
return stream => {
|
|
704
|
-
return new
|
|
741
|
+
return new _definition4.Stream(tsplus_module_10.concatMap(as => tsplus_module_12.foldLeft(tsplus_module_10.unit, (s, a) => tsplus_module_11.flatMap(() => a)(s))(tsplus_module_12.map(a => f(a).channel)(as)))(stream.channel));
|
|
705
742
|
};
|
|
706
743
|
}
|
|
707
744
|
/**
|
|
@@ -725,7 +762,7 @@ function chunksWith(f, __tsplusTrace) {
|
|
|
725
762
|
}
|
|
726
763
|
function changesWithWriter(f, last, __tsplusTrace) {
|
|
727
764
|
return tsplus_module_10.readWithCause(chunk => {
|
|
728
|
-
const [newLast, newChunk] = tsplus_module_12.foldLeft([last, tsplus_module_7.empty()], ([maybeLast, os], o1) => tsplus_module_20.match(() => [tsplus_module_3.just(o1), tsplus_module_12.append(o1)(os)], o => f(o, o1) ? [tsplus_module_3.just(o1), os] : [tsplus_module_3.just(o1), tsplus_module_12.append(o1)(os)])(maybeLast))(chunk);
|
|
765
|
+
const [newLast, newChunk] = tsplus_module_12.foldLeft([last, tsplus_module_7.empty()], ([maybeLast, os], o1) => tsplus_module_20.match(() => [tsplus_module_3.just(o1, __tsplusTrace), tsplus_module_12.append(o1)(os)], o => f(o, o1) ? [tsplus_module_3.just(o1, __tsplusTrace), os] : [tsplus_module_3.just(o1, __tsplusTrace), tsplus_module_12.append(o1)(os)])(maybeLast))(chunk);
|
|
729
766
|
return tsplus_module_11.zipRight(changesWithWriter(f, newLast, __tsplusTrace))(tsplus_module_10.writeNow(newChunk));
|
|
730
767
|
}, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit);
|
|
731
768
|
}
|
|
@@ -738,7 +775,7 @@ function changesWithWriter(f, last, __tsplusTrace) {
|
|
|
738
775
|
*/
|
|
739
776
|
function changesWith(f, __tsplusTrace) {
|
|
740
777
|
return stream => {
|
|
741
|
-
return new
|
|
778
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(changesWithWriter(f, tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace))(stream.channel));
|
|
742
779
|
};
|
|
743
780
|
}
|
|
744
781
|
/**
|
|
@@ -756,14 +793,14 @@ function collectWhile(pf, __tsplusTrace) {
|
|
|
756
793
|
return tsplus_module_10.writeNow(mapped);
|
|
757
794
|
}
|
|
758
795
|
}, tsplus_module_10.failNow, tsplus_module_11.succeedNow);
|
|
759
|
-
return new
|
|
796
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
|
760
797
|
};
|
|
761
798
|
}
|
|
762
799
|
/**
|
|
763
800
|
* Effectfully transforms all elements of the stream for as long as the specified partial function is defined.
|
|
764
801
|
*/
|
|
765
802
|
function collectWhileIO(stream, pf, __tsplusTrace) {
|
|
766
|
-
return new
|
|
803
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(collectWhileIOLoop(tsplus_module_40.empty()[Symbol.iterator](), pf, __tsplusTrace))(stream.channel));
|
|
767
804
|
}
|
|
768
805
|
function collectWhileIOLoop(iterator, pf, __tsplusTrace) {
|
|
769
806
|
const next = iterator.next();
|
|
@@ -774,7 +811,7 @@ function collectWhileIOLoop(iterator, pf, __tsplusTrace) {
|
|
|
774
811
|
}
|
|
775
812
|
}
|
|
776
813
|
function combineProducer(handoff, latch, __tsplusTrace) {
|
|
777
|
-
return tsplus_module_11.zipRight(tsplus_module_10.readWithCause(value => tsplus_module_11.zipRight(combineProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_41.succeed(value))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_41.failCause(tsplus_module_25.map(tsplus_module_3.just)(cause)))(handoff)), () => tsplus_module_11.zipRight(combineProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_41.fail(tsplus_module_3.nothing()))(handoff)))))(tsplus_module_10.fromIO(() => tsplus_module_5.take(latch)));
|
|
814
|
+
return tsplus_module_11.zipRight(tsplus_module_10.readWithCause(value => tsplus_module_11.zipRight(combineProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_41.succeed(value, __tsplusTrace))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_41.failCause(tsplus_module_25.map(tsplus_module_3.just)(cause), __tsplusTrace))(handoff)), () => tsplus_module_11.zipRight(combineProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_41.fail(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace))(handoff)))))(tsplus_module_10.fromIO(() => tsplus_module_5.take(latch)));
|
|
778
815
|
}
|
|
779
816
|
/**
|
|
780
817
|
* Combines the elements from this stream and the specified stream by repeatedly applying the
|
|
@@ -788,7 +825,7 @@ function combineProducer(handoff, latch, __tsplusTrace) {
|
|
|
788
825
|
*/
|
|
789
826
|
function combine(that, s, f, __tsplusTrace) {
|
|
790
827
|
return stream => {
|
|
791
|
-
return new
|
|
828
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right, latchL, latchR]) => {
|
|
792
829
|
const pullLeft = tsplus_module_1.flatMap(tsplus_module_1.fromExitNow, __tsplusTrace)(tsplus_module_1.zipRight(tsplus_module_5.take(left), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchL)));
|
|
793
830
|
const pullRight = tsplus_module_1.flatMap(tsplus_module_1.fromExitNow, __tsplusTrace)(tsplus_module_1.zipRight(tsplus_module_5.take(right), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchR)));
|
|
794
831
|
return unfoldIO_1(s, s => tsplus_module_1.flatMap(exit => tsplus_module_1.optional(tsplus_module_1.fromExitNow(exit, __tsplusTrace), __tsplusTrace), __tsplusTrace)(f(s, pullLeft, pullRight)), __tsplusTrace).channel;
|
|
@@ -808,7 +845,7 @@ function combineChunksProducer(handoff, latch, __tsplusTrace) {
|
|
|
808
845
|
*/
|
|
809
846
|
function combineChunks(that, s, f, __tsplusTrace) {
|
|
810
847
|
return stream => {
|
|
811
|
-
return new
|
|
848
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right, latchL, latchR]) => {
|
|
812
849
|
const pullLeft = tsplus_module_1.flatMap(take => tsplus_module_27.done(take), __tsplusTrace)(tsplus_module_1.zipRight(tsplus_module_5.take(left), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchL)));
|
|
813
850
|
const pullRight = tsplus_module_1.flatMap(take => tsplus_module_27.done(take), __tsplusTrace)(tsplus_module_1.zipRight(tsplus_module_5.take(right), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchR)));
|
|
814
851
|
return unfoldChunkIO_1(s, s => tsplus_module_1.flatMap(exit => tsplus_module_1.optional(tsplus_module_1.fromExit(() => exit, __tsplusTrace), __tsplusTrace), __tsplusTrace)(f(s, pullLeft, pullRight)), __tsplusTrace).channel;
|
|
@@ -823,7 +860,7 @@ function combineChunks(that, s, f, __tsplusTrace) {
|
|
|
823
860
|
*/
|
|
824
861
|
function concat_1(that, __tsplusTrace) {
|
|
825
862
|
return stream => {
|
|
826
|
-
return new
|
|
863
|
+
return new _definition4.Stream(tsplus_module_11.zipRight(that.channel)(stream.channel));
|
|
827
864
|
};
|
|
828
865
|
}
|
|
829
866
|
/**
|
|
@@ -834,7 +871,7 @@ function concat_1(that, __tsplusTrace) {
|
|
|
834
871
|
*/
|
|
835
872
|
function cross(that, __tsplusTrace) {
|
|
836
873
|
return stream => {
|
|
837
|
-
return new
|
|
874
|
+
return new _definition4.Stream(tsplus_module_10.concatMap(as => tsplus_module_10.mapOut(bs => tsplus_module_12.flatMap(a => tsplus_module_12.map(b => (0, _function.tuple)(a, b))(bs))(as))(that.channel))(stream.channel));
|
|
838
875
|
};
|
|
839
876
|
}
|
|
840
877
|
/**
|
|
@@ -905,15 +942,15 @@ function debounce(duration, __tsplusTrace) {
|
|
|
905
942
|
})(signal))(ex), __tsplusTrace)(tsplus_module_22.join(fiber, __tsplusTrace))
|
|
906
943
|
})(state));
|
|
907
944
|
}
|
|
908
|
-
return zipRight_1(new
|
|
945
|
+
return zipRight_1(new _definition4.Stream(consumer(tsplus_module_42.notStarted, __tsplusTrace)), __tsplusTrace)(scoped_1(() => tsplus_module_33.fork(tsplus_module_16.runScoped(tsplus_module_10.pipeTo(producer)(stream.channel)), __tsplusTrace), __tsplusTrace));
|
|
909
946
|
}, __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace), __tsplusTrace);
|
|
910
947
|
};
|
|
911
948
|
}
|
|
912
949
|
/**
|
|
913
950
|
* @tsplus static fncts.io.StreamOps defer
|
|
914
951
|
*/
|
|
915
|
-
function
|
|
916
|
-
return new
|
|
952
|
+
function defer_1(self) {
|
|
953
|
+
return new _definition4.Stream(tsplus_module_10.defer(() => self().channel));
|
|
917
954
|
}
|
|
918
955
|
function defaultIfEmptyWriter(fb, __tsplusTrace) {
|
|
919
956
|
return tsplus_module_10.readWith(i => tsplus_module_12.isEmpty(i) ? defaultIfEmptyWriter(fb, __tsplusTrace) : tsplus_module_11.zipRight(tsplus_module_10.id())(tsplus_module_10.writeNow(i)), tsplus_module_10.failNow, () => fb.channel);
|
|
@@ -925,7 +962,7 @@ function defaultIfEmptyWriter(fb, __tsplusTrace) {
|
|
|
925
962
|
*/
|
|
926
963
|
function defaultIfEmpty(fb, __tsplusTrace) {
|
|
927
964
|
return fa => {
|
|
928
|
-
return new
|
|
965
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(defaultIfEmptyWriter(fb, __tsplusTrace))(fa.channel));
|
|
929
966
|
};
|
|
930
967
|
}
|
|
931
968
|
/**
|
|
@@ -957,17 +994,17 @@ function distributedWithDynamic_1(maximumLag, decide, done = () => tsplus_module
|
|
|
957
994
|
return self => {
|
|
958
995
|
const offer = queuesRef => a => tsplus_module_1.flatMap(shouldProcess => tsplus_module_1.flatMap(queues => tsplus_module_1.flatMap(ids => tsplus_module_12.isNonEmpty(ids) ? tsplus_module_15.update(map => tsplus_module_45.removeMany(ids)(map), __tsplusTrace)(queuesRef) : tsplus_module_1.unit, __tsplusTrace)(tsplus_module_1.foldLeft(queues, tsplus_module_7.empty(), (b, [id, queue]) => {
|
|
959
996
|
if (shouldProcess(id)) {
|
|
960
|
-
return tsplus_module_1.matchCauseIO(c => tsplus_module_25.interrupted(c) ? tsplus_module_1.succeedNow(tsplus_module_12.append(id)(b), __tsplusTrace) : tsplus_module_1.failCauseNow(c, __tsplusTrace), () => tsplus_module_1.succeedNow(b, __tsplusTrace), __tsplusTrace)(tsplus_module_28.offer(tsplus_module_41.succeed(a), __tsplusTrace)(queue));
|
|
997
|
+
return tsplus_module_1.matchCauseIO(c => tsplus_module_25.interrupted(c) ? tsplus_module_1.succeedNow(tsplus_module_12.append(id)(b), __tsplusTrace) : tsplus_module_1.failCauseNow(c, __tsplusTrace), () => tsplus_module_1.succeedNow(b, __tsplusTrace), __tsplusTrace)(tsplus_module_28.offer(tsplus_module_41.succeed(a, __tsplusTrace), __tsplusTrace)(queue));
|
|
961
998
|
} else {
|
|
962
999
|
return tsplus_module_1.succeedNow(b, __tsplusTrace);
|
|
963
1000
|
}
|
|
964
1001
|
}, __tsplusTrace)), __tsplusTrace)(tsplus_module_14.get(queuesRef, __tsplusTrace)), __tsplusTrace)(decide(a));
|
|
965
1002
|
return tsplus_module_1.flatMap(queuesRef => tsplus_module_1.map(add => add, __tsplusTrace)(tsplus_module_1.flatMap(queuesLock => tsplus_module_1.flatMap(newQueue => {
|
|
966
|
-
const finalize = endTake => queuesLock.withPermit(tsplus_module_1.asUnit(tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(queues => tsplus_module_1.flatMap(() => tsplus_module_1.map(() => void 0, __tsplusTrace)(done(endTake)), __tsplusTrace)(tsplus_module_1.foreach(queues, queue => tsplus_module_1.catchJustCause(c => tsplus_module_25.interrupted(c) ? tsplus_module_3.just(tsplus_module_1.unit) : tsplus_module_3.nothing(), __tsplusTrace)(tsplus_module_28.offer(endTake, __tsplusTrace)(queue)), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.map(map => tsplus_module_45.values(map), __tsplusTrace)(tsplus_module_14.get(queuesRef, __tsplusTrace))), __tsplusTrace)(tsplus_module_13.set(tsplus_module_1.flatMap(queue => tsplus_module_1.flatMap(() => {
|
|
1003
|
+
const finalize = endTake => queuesLock.withPermit(tsplus_module_1.asUnit(tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(queues => tsplus_module_1.flatMap(() => tsplus_module_1.map(() => void 0, __tsplusTrace)(done(endTake)), __tsplusTrace)(tsplus_module_1.foreach(queues, queue => tsplus_module_1.catchJustCause(c => tsplus_module_25.interrupted(c) ? tsplus_module_3.just(tsplus_module_1.unit, __tsplusTrace) : tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace)(tsplus_module_28.offer(endTake, __tsplusTrace)(queue)), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.map(map => tsplus_module_45.values(map), __tsplusTrace)(tsplus_module_14.get(queuesRef, __tsplusTrace))), __tsplusTrace)(tsplus_module_13.set(tsplus_module_1.flatMap(queue => tsplus_module_1.flatMap(() => {
|
|
967
1004
|
const id = Symbol();
|
|
968
1005
|
return tsplus_module_1.map(() => (0, _function.tuple)(id, queue), __tsplusTrace)(tsplus_module_15.update(map => tsplus_module_45.set(id, queue)(map), __tsplusTrace)(queuesRef));
|
|
969
1006
|
}, __tsplusTrace)(tsplus_module_28.offer(endTake, __tsplusTrace)(queue)), __tsplusTrace)(tsplus_module_30.makeBounded(1, __tsplusTrace)), __tsplusTrace)(newQueue)), __tsplusTrace));
|
|
970
|
-
return tsplus_module_1.map(() => queuesLock.withPermit(tsplus_module_1.flatten(tsplus_module_14.get(newQueue, __tsplusTrace), __tsplusTrace)), __tsplusTrace)(tsplus_module_33.fork(tsplus_module_1.matchCauseIO(cause => finalize(tsplus_module_41.failCause(tsplus_module_25.map(tsplus_module_3.just)(cause))), () => finalize(tsplus_module_41.fail(tsplus_module_3.nothing())), __tsplusTrace)(runForeachScoped_1(offer(queuesRef), __tsplusTrace)(self)), __tsplusTrace));
|
|
1007
|
+
return tsplus_module_1.map(() => queuesLock.withPermit(tsplus_module_1.flatten(tsplus_module_14.get(newQueue, __tsplusTrace), __tsplusTrace)), __tsplusTrace)(tsplus_module_33.fork(tsplus_module_1.matchCauseIO(cause => finalize(tsplus_module_41.failCause(tsplus_module_25.map(tsplus_module_3.just)(cause), __tsplusTrace)), () => finalize(tsplus_module_41.fail(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace)), __tsplusTrace)(runForeachScoped_1(offer(queuesRef), __tsplusTrace)(self)), __tsplusTrace));
|
|
971
1008
|
}, __tsplusTrace)(tsplus_module_6.make(() => tsplus_module_1.flatMap(queue => tsplus_module_1.flatMap(id => tsplus_module_1.map(() => (0, _function.tuple)(id, queue), __tsplusTrace)(tsplus_module_15.update(map => tsplus_module_45.set(id, queue)(map), __tsplusTrace)(queuesRef)), __tsplusTrace)(tsplus_module_1.succeed(() => Symbol(), __tsplusTrace)), __tsplusTrace)(tsplus_module_30.makeBounded(maximumLag, __tsplusTrace)), __tsplusTrace)), __tsplusTrace)(tsplus_module_46.makeSemaphore(1, __tsplusTrace))), __tsplusTrace)(tsplus_module_31.acquireRelease(() => tsplus_module_6.make(() => tsplus_module_45.empty(), __tsplusTrace), ref => tsplus_module_1.flatMap(qs => tsplus_module_1.foreach(tsplus_module_45.values(qs), q => tsplus_module_28.shutdown(q, __tsplusTrace), __tsplusTrace), __tsplusTrace)(tsplus_module_14.get(ref, __tsplusTrace)), __tsplusTrace));
|
|
972
1009
|
};
|
|
973
1010
|
}
|
|
@@ -977,8 +1014,8 @@ function distributedWithDynamic_1(maximumLag, decide, done = () => tsplus_module
|
|
|
977
1014
|
*
|
|
978
1015
|
* @tsplus getter fncts.io.Stream drain
|
|
979
1016
|
*/
|
|
980
|
-
function
|
|
981
|
-
return new
|
|
1017
|
+
function drain_1(fa, __tsplusTrace) {
|
|
1018
|
+
return new _definition4.Stream(tsplus_module_10.drain(fa.channel));
|
|
982
1019
|
}
|
|
983
1020
|
function dropLoop(r, __tsplusTrace) {
|
|
984
1021
|
return tsplus_module_10.readWith(inp => {
|
|
@@ -995,7 +1032,7 @@ function dropLoop(r, __tsplusTrace) {
|
|
|
995
1032
|
*/
|
|
996
1033
|
function drop_1(n, __tsplusTrace) {
|
|
997
1034
|
return stream => {
|
|
998
|
-
return new
|
|
1035
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(dropLoop(n, __tsplusTrace))(stream.channel));
|
|
999
1036
|
};
|
|
1000
1037
|
}
|
|
1001
1038
|
/**
|
|
@@ -1030,12 +1067,12 @@ function dropUntil(p, __tsplusTrace) {
|
|
|
1030
1067
|
* @tsplus getter fncts.io.Stream either
|
|
1031
1068
|
*/
|
|
1032
1069
|
function either(stream, __tsplusTrace) {
|
|
1033
|
-
return catchAll_1(e => succeedNow_1(tsplus_module_18.left(e), __tsplusTrace), __tsplusTrace)(map_1(tsplus_module_18.right, __tsplusTrace)(stream));
|
|
1070
|
+
return catchAll_1(e => succeedNow_1(tsplus_module_18.left(e, __tsplusTrace), __tsplusTrace), __tsplusTrace)(map_1(tsplus_module_18.right, __tsplusTrace)(stream));
|
|
1034
1071
|
}
|
|
1035
1072
|
/**
|
|
1036
1073
|
* @tsplus static fncts.io.StreamOps empty
|
|
1037
1074
|
*/
|
|
1038
|
-
const empty_1 = /*#__PURE__*/fromChunkNow_1( /*#__PURE__*/tsplus_module_7.empty(), fileName_1 + ":
|
|
1075
|
+
const empty_1 = /*#__PURE__*/fromChunkNow_1( /*#__PURE__*/tsplus_module_7.empty(), fileName_1 + ":1234:70");
|
|
1039
1076
|
const empty = empty_1;
|
|
1040
1077
|
exports.empty = empty;
|
|
1041
1078
|
function endWhenWriter(fiber, __tsplusTrace) {
|
|
@@ -1054,7 +1091,7 @@ function endWhenWriter(fiber, __tsplusTrace) {
|
|
|
1054
1091
|
*/
|
|
1055
1092
|
function endWhen(io, __tsplusTrace) {
|
|
1056
1093
|
return stream => {
|
|
1057
|
-
return new
|
|
1094
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(fiber => tsplus_module_10.pipeTo(endWhenWriter(fiber, __tsplusTrace))(stream.channel), __tsplusTrace)(tsplus_module_17.forkScoped(io, __tsplusTrace))));
|
|
1058
1095
|
};
|
|
1059
1096
|
}
|
|
1060
1097
|
/**
|
|
@@ -1062,7 +1099,7 @@ function endWhen(io, __tsplusTrace) {
|
|
|
1062
1099
|
*/
|
|
1063
1100
|
function ensuring_1(finalizer, __tsplusTrace) {
|
|
1064
1101
|
return self => {
|
|
1065
|
-
return new
|
|
1102
|
+
return new _definition4.Stream(tsplus_module_10.ensuring(finalizer)(self.channel));
|
|
1066
1103
|
};
|
|
1067
1104
|
}
|
|
1068
1105
|
/**
|
|
@@ -1095,13 +1132,21 @@ function environmentWithIO(f, __tsplusTrace) {
|
|
|
1095
1132
|
function environmentWithStream(f, __tsplusTrace) {
|
|
1096
1133
|
return flatMap_1(f, __tsplusTrace)(environment_1(__tsplusTrace));
|
|
1097
1134
|
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Creates a stream that executes the specified effect but emits no elements.
|
|
1137
|
+
*
|
|
1138
|
+
* @tsplus static fncts.io.StreamOps execute
|
|
1139
|
+
*/
|
|
1140
|
+
function execute_1(io, __tsplusTrace) {
|
|
1141
|
+
return drain_1(fromIO_1(io, __tsplusTrace), __tsplusTrace);
|
|
1142
|
+
}
|
|
1098
1143
|
/**
|
|
1099
1144
|
* Halt a stream with the specified error
|
|
1100
1145
|
*
|
|
1101
1146
|
* @tsplus static fncts.io.StreamOps failNow
|
|
1102
1147
|
*/
|
|
1103
1148
|
function failNow_1(error, __tsplusTrace) {
|
|
1104
|
-
return new
|
|
1149
|
+
return new _definition4.Stream(tsplus_module_10.failNow(error));
|
|
1105
1150
|
}
|
|
1106
1151
|
/**
|
|
1107
1152
|
* Halt a stream with the specified error
|
|
@@ -1109,7 +1154,7 @@ function failNow_1(error, __tsplusTrace) {
|
|
|
1109
1154
|
* @tsplus static fncts.io.StreamOps fail
|
|
1110
1155
|
*/
|
|
1111
1156
|
function fail(error, __tsplusTrace) {
|
|
1112
|
-
return new
|
|
1157
|
+
return new _definition4.Stream(tsplus_module_10.fail(error));
|
|
1113
1158
|
}
|
|
1114
1159
|
/**
|
|
1115
1160
|
* The stream that always halts with `cause`.
|
|
@@ -1137,7 +1182,7 @@ function filter(predicate, __tsplusTrace) {
|
|
|
1137
1182
|
*/
|
|
1138
1183
|
function filterIO(f, __tsplusTrace) {
|
|
1139
1184
|
return fa => {
|
|
1140
|
-
return new
|
|
1185
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(filterIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(fa.channel));
|
|
1141
1186
|
};
|
|
1142
1187
|
}
|
|
1143
1188
|
function filterIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -1161,7 +1206,7 @@ function filterMap_1(f, __tsplusTrace) {
|
|
|
1161
1206
|
*/
|
|
1162
1207
|
function filterMapIO(f, __tsplusTrace) {
|
|
1163
1208
|
return fa => {
|
|
1164
|
-
return new
|
|
1209
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(filterMapIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(fa.channel));
|
|
1165
1210
|
};
|
|
1166
1211
|
}
|
|
1167
1212
|
function filterMapIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -1180,7 +1225,7 @@ function filterMapIOLoop(iterator, f, __tsplusTrace) {
|
|
|
1180
1225
|
function find(p, __tsplusTrace) {
|
|
1181
1226
|
return stream => {
|
|
1182
1227
|
const loop = tsplus_module_10.readWith(inp => tsplus_module_20.match(() => loop, a => tsplus_module_10.writeNow(tsplus_module_19.single(a)))(tsplus_module_12.find(p)(inp)), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1183
|
-
return new
|
|
1228
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
|
1184
1229
|
};
|
|
1185
1230
|
}
|
|
1186
1231
|
/**
|
|
@@ -1191,7 +1236,7 @@ function find(p, __tsplusTrace) {
|
|
|
1191
1236
|
function findIO(f, __tsplusTrace) {
|
|
1192
1237
|
return stream => {
|
|
1193
1238
|
const loop = tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(() => tsplus_module_1.map(maybeA => tsplus_module_20.match(() => loop, a => tsplus_module_10.writeNow(tsplus_module_19.single(a)))(maybeA), __tsplusTrace)(tsplus_module_51.findIO(f, __tsplusTrace)(inp))), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1194
|
-
return new
|
|
1239
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
|
1195
1240
|
};
|
|
1196
1241
|
}
|
|
1197
1242
|
/**
|
|
@@ -1214,10 +1259,10 @@ function flattenExitOption_1(stream, __tsplusTrace) {
|
|
|
1214
1259
|
const processChunk = (chunk, cont) => {
|
|
1215
1260
|
const [toEmit, rest] = tsplus_module_12.splitWhere(_ => !tsplus_module_52.isSuccess(_))(chunk);
|
|
1216
1261
|
const next = tsplus_module_20.match(() => cont, exit => tsplus_module_36.match(cause => tsplus_module_20.match(() => tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow)(tsplus_module_25.flipCauseOption(cause)), () => tsplus_module_11.endNow(undefined))(exit))(tsplus_module_12.head(rest));
|
|
1217
|
-
return tsplus_module_11.zipRight(next)(tsplus_module_10.writeNow(tsplus_module_12.filterMap(exit => tsplus_module_36.match(() => tsplus_module_3.nothing(), tsplus_module_3.just)(exit))(toEmit)));
|
|
1262
|
+
return tsplus_module_11.zipRight(next)(tsplus_module_10.writeNow(tsplus_module_12.filterMap(exit => tsplus_module_36.match(() => tsplus_module_3.nothing(__tsplusTrace), tsplus_module_3.just)(exit))(toEmit)));
|
|
1218
1263
|
};
|
|
1219
1264
|
const process = tsplus_module_10.readWithCause(chunk => processChunk(chunk, process), tsplus_module_11.failCauseNow, _ => tsplus_module_11.endNow(undefined));
|
|
1220
|
-
return new
|
|
1265
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(process)(stream.channel));
|
|
1221
1266
|
}
|
|
1222
1267
|
/**
|
|
1223
1268
|
* Unwraps `Exit` values and flatten chunks that also signify end-of-stream by failing with `None`.
|
|
@@ -1234,7 +1279,7 @@ function flattenTake_1(stream, __tsplusTrace) {
|
|
|
1234
1279
|
* @tsplus getter fncts.io.Stream flattenChunks
|
|
1235
1280
|
*/
|
|
1236
1281
|
function flattenChunks_1(stream, __tsplusTrace) {
|
|
1237
|
-
return new
|
|
1282
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(c => tsplus_module_12.flatten(c))(stream.channel));
|
|
1238
1283
|
}
|
|
1239
1284
|
/**
|
|
1240
1285
|
* Repeats this stream forever.
|
|
@@ -1242,7 +1287,7 @@ function flattenChunks_1(stream, __tsplusTrace) {
|
|
|
1242
1287
|
* @tsplus getter fncts.io.Stream forever
|
|
1243
1288
|
*/
|
|
1244
1289
|
function forever_1(stream, __tsplusTrace) {
|
|
1245
|
-
return new
|
|
1290
|
+
return new _definition4.Stream(tsplus_module_10.repeated(stream.channel));
|
|
1246
1291
|
}
|
|
1247
1292
|
/**
|
|
1248
1293
|
* Creates a stream from a `Chunk` of values
|
|
@@ -1250,7 +1295,7 @@ function forever_1(stream, __tsplusTrace) {
|
|
|
1250
1295
|
* @tsplus static fncts.io.StreamOps fromChunkNow
|
|
1251
1296
|
*/
|
|
1252
1297
|
function fromChunkNow_1(c, __tsplusTrace) {
|
|
1253
|
-
return new
|
|
1298
|
+
return new _definition4.Stream(tsplus_module_10.defer(() => tsplus_module_12.isEmpty(c) ? tsplus_module_10.unit : tsplus_module_10.writeNow(c)));
|
|
1254
1299
|
}
|
|
1255
1300
|
/**
|
|
1256
1301
|
* Creates a stream from a `Chunk` of values
|
|
@@ -1258,7 +1303,7 @@ function fromChunkNow_1(c, __tsplusTrace) {
|
|
|
1258
1303
|
* @tsplus static fncts.io.StreamOps fromChunk
|
|
1259
1304
|
*/
|
|
1260
1305
|
function fromChunk_1(c, __tsplusTrace) {
|
|
1261
|
-
return new
|
|
1306
|
+
return new _definition4.Stream(tsplus_module_10.unwrap(() => tsplus_module_1.succeedNow(tsplus_module_10.write(c), __tsplusTrace)));
|
|
1262
1307
|
}
|
|
1263
1308
|
/**
|
|
1264
1309
|
* Creates a single-valued stream from a managed resource
|
|
@@ -1266,7 +1311,60 @@ function fromChunk_1(c, __tsplusTrace) {
|
|
|
1266
1311
|
* @tsplus static fncts.io.StreamOps scoped
|
|
1267
1312
|
*/
|
|
1268
1313
|
function scoped_1(stream, __tsplusTrace) {
|
|
1269
|
-
return new
|
|
1314
|
+
return new _definition4.Stream(tsplus_module_10.scoped(() => tsplus_module_1.map(tsplus_module_19.single, __tsplusTrace)(stream())));
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Emits a sliding window of n elements.
|
|
1318
|
+
*
|
|
1319
|
+
* @tsplus pipeable fncts.io.Stream sliding
|
|
1320
|
+
*/
|
|
1321
|
+
function sliding(chunkSize, stepSize, __tsplusTrace) {
|
|
1322
|
+
return self => {
|
|
1323
|
+
return defer_1(() => {
|
|
1324
|
+
function slidingChunk(chunk, input) {
|
|
1325
|
+
const updatedChunk = tsplus_module_12.concat(input)(chunk);
|
|
1326
|
+
const length = updatedChunk.length;
|
|
1327
|
+
if (length >= chunkSize) {
|
|
1328
|
+
const array = new Array((length - chunkSize) / stepSize + 1);
|
|
1329
|
+
let arrayIndex = 0;
|
|
1330
|
+
let chunkIndex = 0;
|
|
1331
|
+
while (chunkIndex + chunkSize <= length) {
|
|
1332
|
+
array[arrayIndex] = tsplus_module_12.slice(chunkIndex, chunkIndex + chunkSize)(updatedChunk);
|
|
1333
|
+
arrayIndex += 1;
|
|
1334
|
+
chunkIndex += stepSize;
|
|
1335
|
+
}
|
|
1336
|
+
return [tsplus_module_12.drop(chunkIndex)(updatedChunk), tsplus_module_53.fromArray(array)];
|
|
1337
|
+
} else {
|
|
1338
|
+
return [updatedChunk, tsplus_module_7.empty()];
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
function sliding(chunk, written) {
|
|
1342
|
+
return tsplus_module_10.readWithCause(input => {
|
|
1343
|
+
const [updatedChunk, out] = slidingChunk(chunk, input);
|
|
1344
|
+
if (tsplus_module_12.isEmpty(out)) {
|
|
1345
|
+
return sliding(updatedChunk, written);
|
|
1346
|
+
} else {
|
|
1347
|
+
return tsplus_module_11.zipRight(sliding(updatedChunk, true))(tsplus_module_10.writeNow(out));
|
|
1348
|
+
}
|
|
1349
|
+
}, err => {
|
|
1350
|
+
const index = written && chunkSize > stepSize ? chunkSize - stepSize : 0;
|
|
1351
|
+
if (index >= chunk.length) {
|
|
1352
|
+
return tsplus_module_11.failCauseNow(err);
|
|
1353
|
+
} else {
|
|
1354
|
+
return tsplus_module_11.zipRight(tsplus_module_11.failCauseNow(err))(tsplus_module_10.writeNow(tsplus_module_19.single(chunk)));
|
|
1355
|
+
}
|
|
1356
|
+
}, done => {
|
|
1357
|
+
const index = written && chunkSize > stepSize ? chunkSize - stepSize : 0;
|
|
1358
|
+
if (index >= chunk.length) {
|
|
1359
|
+
return tsplus_module_11.succeedNow(done);
|
|
1360
|
+
} else {
|
|
1361
|
+
return tsplus_module_11.zipRight(tsplus_module_11.succeedNow(done))(tsplus_module_10.writeNow(tsplus_module_19.single(chunk)));
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(sliding(tsplus_module_7.empty(), false))(self.channel));
|
|
1366
|
+
});
|
|
1367
|
+
};
|
|
1270
1368
|
}
|
|
1271
1369
|
/**
|
|
1272
1370
|
* Creates a stream from an effect producing a value of type `A`
|
|
@@ -1282,7 +1380,7 @@ function fromIO_1(fa, __tsplusTrace) {
|
|
|
1282
1380
|
* @tsplus static fncts.io.StreamOps fromIOMaybe
|
|
1283
1381
|
*/
|
|
1284
1382
|
function fromIOMaybe_1(fa, __tsplusTrace) {
|
|
1285
|
-
return new
|
|
1383
|
+
return new _definition4.Stream(tsplus_module_10.unwrap(() => tsplus_module_1.match(maybeError => tsplus_module_20.match(() => tsplus_module_10.unit, tsplus_module_10.failNow)(maybeError), a => tsplus_module_10.writeNow(tsplus_module_19.single(a)), __tsplusTrace)(fa)));
|
|
1286
1384
|
}
|
|
1287
1385
|
function fromAsyncIterableLoop(iterator, __tsplusTrace) {
|
|
1288
1386
|
return tsplus_module_10.unwrap(() => tsplus_module_1.async(k => {
|
|
@@ -1293,12 +1391,12 @@ function fromAsyncIterableLoop(iterator, __tsplusTrace) {
|
|
|
1293
1391
|
* @tsplus static fncts.io.StreamOps fromAsyncIterable
|
|
1294
1392
|
*/
|
|
1295
1393
|
function fromAsyncIterable(iterable, __tsplusTrace) {
|
|
1296
|
-
return new
|
|
1394
|
+
return new _definition4.Stream(fromAsyncIterableLoop(iterable[Symbol.asyncIterator](), __tsplusTrace));
|
|
1297
1395
|
}
|
|
1298
1396
|
/**
|
|
1299
1397
|
* @tsplus static fncts.io.StreamOps fromIterable
|
|
1300
1398
|
*/
|
|
1301
|
-
function fromIterable(iterable, maxChunkSize =
|
|
1399
|
+
function fromIterable(iterable, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1302
1400
|
return unwrap_1(tsplus_module_1.succeed(() => {
|
|
1303
1401
|
const loop = iterator => tsplus_module_10.unwrap(() => tsplus_module_1.succeed(() => {
|
|
1304
1402
|
let result = iterator.next();
|
|
@@ -1318,7 +1416,7 @@ function fromIterable(iterable, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE,
|
|
|
1318
1416
|
return tsplus_module_11.zipRight(loop(iterator))(tsplus_module_10.writeNow(tsplus_module_19.from(out)));
|
|
1319
1417
|
}
|
|
1320
1418
|
}, __tsplusTrace));
|
|
1321
|
-
return new
|
|
1419
|
+
return new _definition4.Stream(loop(iterable[Symbol.iterator]()));
|
|
1322
1420
|
}, __tsplusTrace), __tsplusTrace);
|
|
1323
1421
|
}
|
|
1324
1422
|
/**
|
|
@@ -1328,7 +1426,7 @@ function fromIterableSingle(iterable, __tsplusTrace) {
|
|
|
1328
1426
|
return flatMap_1(iterator => repeatIOMaybe_1(tsplus_module_1.defer(() => {
|
|
1329
1427
|
const value = iterator.next();
|
|
1330
1428
|
if (value.done) {
|
|
1331
|
-
return tsplus_module_1.failNow(tsplus_module_3.nothing(), __tsplusTrace);
|
|
1429
|
+
return tsplus_module_1.failNow(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace);
|
|
1332
1430
|
} else {
|
|
1333
1431
|
return tsplus_module_1.succeedNow(value.value, __tsplusTrace);
|
|
1334
1432
|
}
|
|
@@ -1345,31 +1443,31 @@ function fromPull_1(scopedPull, __tsplusTrace) {
|
|
|
1345
1443
|
*
|
|
1346
1444
|
* @tsplus static fncts.io.StreamOps fromQueue
|
|
1347
1445
|
*/
|
|
1348
|
-
function fromQueue_1(queue, maxChunkSize =
|
|
1446
|
+
function fromQueue_1(queue, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1349
1447
|
return repeatIOChunkMaybe_1(tsplus_module_1.catchAllCause(c => tsplus_module_1.flatMap(down => {
|
|
1350
1448
|
if (down && tsplus_module_25.interrupted(c)) {
|
|
1351
|
-
return
|
|
1449
|
+
return tsplus_module_54.end;
|
|
1352
1450
|
} else {
|
|
1353
|
-
return
|
|
1451
|
+
return tsplus_module_54.failCause(c);
|
|
1354
1452
|
}
|
|
1355
|
-
}, __tsplusTrace)(tsplus_module_28.isShutdown(queue, __tsplusTrace)), __tsplusTrace)(tsplus_module_1.map(tsplus_module_19.from, __tsplusTrace)(
|
|
1453
|
+
}, __tsplusTrace)(tsplus_module_28.isShutdown(queue, __tsplusTrace)), __tsplusTrace)(tsplus_module_1.map(tsplus_module_19.from, __tsplusTrace)(tsplus_module_55.takeBetween(1, maxChunkSize, __tsplusTrace)(queue))), __tsplusTrace);
|
|
1356
1454
|
}
|
|
1357
1455
|
/**
|
|
1358
1456
|
* @tsplus static fncts.io.StreamOps fromQueueWithShutdown
|
|
1359
1457
|
*/
|
|
1360
|
-
function fromQueueWithShutdown_1(queue, maxChunkSize =
|
|
1458
|
+
function fromQueueWithShutdown_1(queue, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1361
1459
|
return ensuring_1(tsplus_module_28.shutdown(queue, __tsplusTrace), __tsplusTrace)(fromQueue_1(queue, maxChunkSize, __tsplusTrace));
|
|
1362
1460
|
}
|
|
1363
1461
|
/**
|
|
1364
1462
|
* @tsplus static fncts.io.StreamOps fromHub
|
|
1365
1463
|
*/
|
|
1366
|
-
function fromHub(hub, maxChunkSize =
|
|
1464
|
+
function fromHub(hub, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1367
1465
|
return flatMap_1(queue => fromQueueWithShutdown_1(queue, maxChunkSize, __tsplusTrace), __tsplusTrace)(scoped_1(() => tsplus_module_34.subscribe(hub(), __tsplusTrace), __tsplusTrace));
|
|
1368
1466
|
}
|
|
1369
1467
|
/**
|
|
1370
1468
|
* @tsplus static fncts.io.StreamOps fromHubScoped
|
|
1371
1469
|
*/
|
|
1372
|
-
function fromHubScoped(hub, maxChunkSize =
|
|
1470
|
+
function fromHubScoped(hub, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1373
1471
|
return tsplus_module_1.defer(() => tsplus_module_1.map(queue => fromQueueWithShutdown_1(queue, maxChunkSize, __tsplusTrace), __tsplusTrace)(tsplus_module_34.subscribe(hub(), __tsplusTrace)), __tsplusTrace);
|
|
1374
1472
|
}
|
|
1375
1473
|
/**
|
|
@@ -1378,7 +1476,7 @@ function fromHubScoped(hub, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __ts
|
|
|
1378
1476
|
* @tsplus static fncts.io.StreamOps haltNow
|
|
1379
1477
|
*/
|
|
1380
1478
|
function haltNow(u, __tsplusTrace) {
|
|
1381
|
-
return new
|
|
1479
|
+
return new _definition4.Stream(tsplus_module_10.halt(() => u));
|
|
1382
1480
|
}
|
|
1383
1481
|
/**
|
|
1384
1482
|
* Halt a stream with the specified exception
|
|
@@ -1386,7 +1484,7 @@ function haltNow(u, __tsplusTrace) {
|
|
|
1386
1484
|
* @tsplus static fncts.io.StreamOps halt
|
|
1387
1485
|
*/
|
|
1388
1486
|
function halt_1(u, __tsplusTrace) {
|
|
1389
|
-
return new
|
|
1487
|
+
return new _definition4.Stream(tsplus_module_10.halt(u));
|
|
1390
1488
|
}
|
|
1391
1489
|
function haltWhenWriter(fiber, __tsplusTrace) {
|
|
1392
1490
|
return tsplus_module_10.unwrap(() => tsplus_module_1.map(maybeExit => tsplus_module_20.match(() => tsplus_module_10.readWith(i => tsplus_module_11.zipRight(haltWhenWriter(fiber, __tsplusTrace))(tsplus_module_10.writeNow(i)), tsplus_module_10.failNow, () => tsplus_module_10.unit), exit => tsplus_module_36.match(tsplus_module_11.failCauseNow, () => tsplus_module_10.unit)(exit))(maybeExit), __tsplusTrace)(tsplus_module_49.poll(fiber, __tsplusTrace)));
|
|
@@ -1405,7 +1503,7 @@ function haltWhenWriter(fiber, __tsplusTrace) {
|
|
|
1405
1503
|
*/
|
|
1406
1504
|
function haltWhen(io, __tsplusTrace) {
|
|
1407
1505
|
return fa => {
|
|
1408
|
-
return new
|
|
1506
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(fiber => tsplus_module_10.pipeTo(haltWhenWriter(fiber, __tsplusTrace))(fa.channel), __tsplusTrace)(tsplus_module_17.forkScoped(io, __tsplusTrace))));
|
|
1409
1507
|
};
|
|
1410
1508
|
}
|
|
1411
1509
|
function haltWhenFutureWriter(future, __tsplusTrace) {
|
|
@@ -1420,7 +1518,7 @@ function haltWhenFutureWriter(future, __tsplusTrace) {
|
|
|
1420
1518
|
*/
|
|
1421
1519
|
function haltWhenFuture(future, __tsplusTrace) {
|
|
1422
1520
|
return fa => {
|
|
1423
|
-
return new
|
|
1521
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(haltWhenFutureWriter(future, __tsplusTrace))(fa.channel));
|
|
1424
1522
|
};
|
|
1425
1523
|
}
|
|
1426
1524
|
/**
|
|
@@ -1446,7 +1544,7 @@ function interleaveWithProducer(handoff, __tsplusTrace) {
|
|
|
1446
1544
|
*/
|
|
1447
1545
|
function interleaveWith_1(sb, b, __tsplusTrace) {
|
|
1448
1546
|
return sa => {
|
|
1449
|
-
return new
|
|
1547
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right]) => {
|
|
1450
1548
|
const process = (leftDone, rightDone) => tsplus_module_10.readWithCause(b => {
|
|
1451
1549
|
if (b && !leftDone) {
|
|
1452
1550
|
return tsplus_module_11.flatMap(take => tsplus_module_27.match(rightDone ? tsplus_module_10.unit : process(true, rightDone), tsplus_module_11.failCauseNow, chunk => tsplus_module_11.zipRight(process(leftDone, rightDone))(tsplus_module_10.writeNow(chunk)))(take))(tsplus_module_10.fromIO(() => tsplus_module_5.take(left)));
|
|
@@ -1480,7 +1578,7 @@ function intersperseWriter(middle, isFirst, __tsplusTrace) {
|
|
|
1480
1578
|
* Intersperse stream with provided element
|
|
1481
1579
|
*/
|
|
1482
1580
|
function intersperse(stream, middle, __tsplusTrace) {
|
|
1483
|
-
return new
|
|
1581
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(intersperseWriter(middle, true, __tsplusTrace))(stream.channel));
|
|
1484
1582
|
}
|
|
1485
1583
|
/**
|
|
1486
1584
|
* Interrupts the evaluation of this stream when the provided IO completes. The given
|
|
@@ -1494,7 +1592,7 @@ function intersperse(stream, middle, __tsplusTrace) {
|
|
|
1494
1592
|
*/
|
|
1495
1593
|
function interruptWhen(io, __tsplusTrace) {
|
|
1496
1594
|
return stream => {
|
|
1497
|
-
return new
|
|
1595
|
+
return new _definition4.Stream(tsplus_module_56.interruptWhen(io)(stream.channel));
|
|
1498
1596
|
};
|
|
1499
1597
|
}
|
|
1500
1598
|
/**
|
|
@@ -1502,7 +1600,7 @@ function interruptWhen(io, __tsplusTrace) {
|
|
|
1502
1600
|
*/
|
|
1503
1601
|
function interruptWhenFuture(future, __tsplusTrace) {
|
|
1504
1602
|
return fa => {
|
|
1505
|
-
return new
|
|
1603
|
+
return new _definition4.Stream(tsplus_module_56.interruptWhenFuture(future)(fa.channel));
|
|
1506
1604
|
};
|
|
1507
1605
|
}
|
|
1508
1606
|
/**
|
|
@@ -1512,7 +1610,7 @@ function interruptWhenFuture(future, __tsplusTrace) {
|
|
|
1512
1610
|
*/
|
|
1513
1611
|
function map_1(f, __tsplusTrace) {
|
|
1514
1612
|
return stream => {
|
|
1515
|
-
return new
|
|
1613
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(as => tsplus_module_12.map(f)(as))(stream.channel));
|
|
1516
1614
|
};
|
|
1517
1615
|
}
|
|
1518
1616
|
function mapAccumAccumulator(currS, f, __tsplusTrace) {
|
|
@@ -1528,7 +1626,7 @@ function mapAccumAccumulator(currS, f, __tsplusTrace) {
|
|
|
1528
1626
|
*/
|
|
1529
1627
|
function mapAccum_1(s, f, __tsplusTrace) {
|
|
1530
1628
|
return stream => {
|
|
1531
|
-
return new
|
|
1629
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(mapAccumAccumulator(s, f, __tsplusTrace))(stream.channel));
|
|
1532
1630
|
};
|
|
1533
1631
|
}
|
|
1534
1632
|
function mapAccumIOAccumulator(s, f, __tsplusTrace) {
|
|
@@ -1551,7 +1649,7 @@ function mapAccumIOAccumulator(s, f, __tsplusTrace) {
|
|
|
1551
1649
|
*/
|
|
1552
1650
|
function mapAccumIO_1(s, f, __tsplusTrace) {
|
|
1553
1651
|
return stream => {
|
|
1554
|
-
return new
|
|
1652
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(mapAccumIOAccumulator(s, f, __tsplusTrace))(stream.channel));
|
|
1555
1653
|
};
|
|
1556
1654
|
}
|
|
1557
1655
|
/**
|
|
@@ -1561,7 +1659,7 @@ function mapAccumIO_1(s, f, __tsplusTrace) {
|
|
|
1561
1659
|
*/
|
|
1562
1660
|
function mapChunks_1(f, __tsplusTrace) {
|
|
1563
1661
|
return stream => {
|
|
1564
|
-
return new
|
|
1662
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(f)(stream.channel));
|
|
1565
1663
|
};
|
|
1566
1664
|
}
|
|
1567
1665
|
/**
|
|
@@ -1571,7 +1669,7 @@ function mapChunks_1(f, __tsplusTrace) {
|
|
|
1571
1669
|
*/
|
|
1572
1670
|
function mapChunksIO(f, __tsplusTrace) {
|
|
1573
1671
|
return stream => {
|
|
1574
|
-
return new
|
|
1672
|
+
return new _definition4.Stream(tsplus_module_10.mapOutIO(f)(stream.channel));
|
|
1575
1673
|
};
|
|
1576
1674
|
}
|
|
1577
1675
|
/**
|
|
@@ -1625,7 +1723,7 @@ function mapConcatIO(f, __tsplusTrace) {
|
|
|
1625
1723
|
*/
|
|
1626
1724
|
function mapError_1(f, __tsplusTrace) {
|
|
1627
1725
|
return stream => {
|
|
1628
|
-
return new
|
|
1726
|
+
return new _definition4.Stream(tsplus_module_10.mapError(f)(stream.channel));
|
|
1629
1727
|
};
|
|
1630
1728
|
}
|
|
1631
1729
|
/**
|
|
@@ -1635,7 +1733,7 @@ function mapError_1(f, __tsplusTrace) {
|
|
|
1635
1733
|
*/
|
|
1636
1734
|
function mapErrorCause(f, __tsplusTrace) {
|
|
1637
1735
|
return fa => {
|
|
1638
|
-
return new
|
|
1736
|
+
return new _definition4.Stream(tsplus_module_10.mapErrorCause(f)(fa.channel));
|
|
1639
1737
|
};
|
|
1640
1738
|
}
|
|
1641
1739
|
/**
|
|
@@ -1645,7 +1743,7 @@ function mapErrorCause(f, __tsplusTrace) {
|
|
|
1645
1743
|
*/
|
|
1646
1744
|
function mapIO_1(f, __tsplusTrace) {
|
|
1647
1745
|
return stream => {
|
|
1648
|
-
return new
|
|
1746
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(mapIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(stream.channel));
|
|
1649
1747
|
};
|
|
1650
1748
|
}
|
|
1651
1749
|
function mapIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -1667,7 +1765,7 @@ function mapIOLoop(iterator, f, __tsplusTrace) {
|
|
|
1667
1765
|
*/
|
|
1668
1766
|
function mapIOConcurrently(n, f, __tsplusTrace) {
|
|
1669
1767
|
return stream => {
|
|
1670
|
-
return new
|
|
1768
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(tsplus_module_19.single)(tsplus_module_57.mapOutConcurrentIO(n, f)(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(stream.channel))));
|
|
1671
1769
|
};
|
|
1672
1770
|
}
|
|
1673
1771
|
/**
|
|
@@ -1675,7 +1773,75 @@ function mapIOConcurrently(n, f, __tsplusTrace) {
|
|
|
1675
1773
|
*/
|
|
1676
1774
|
function mapIOConcurrentlyUnordered(n, f) {
|
|
1677
1775
|
return self => {
|
|
1678
|
-
return pipeThroughChannelOrFail_1(
|
|
1776
|
+
return pipeThroughChannelOrFail_1(tsplus_module_58.mergeMap(inp => fromIO_1(f(inp), fileName_1 + ":2290:41").channel, n, 16)(tsplus_module_10.concatMap(chunk => tsplus_module_10.writeChunk(chunk))(tsplus_module_10.id())))(self);
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* Merges this stream and the specified stream together.
|
|
1781
|
+
*
|
|
1782
|
+
* New produced stream will terminate when both specified stream terminate if
|
|
1783
|
+
* no termination strategy is specified.
|
|
1784
|
+
*
|
|
1785
|
+
* @tsplus pipeable fncts.io.Stream merge
|
|
1786
|
+
*/
|
|
1787
|
+
function merge_1(that, strategy = "Both", __tsplusTrace) {
|
|
1788
|
+
return self => {
|
|
1789
|
+
return mergeWith_1(that, _function.identity, _function.identity, strategy, __tsplusTrace)(self);
|
|
1790
|
+
};
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Merges this stream and the specified stream together. New produced stream
|
|
1794
|
+
* will terminate when either stream terminates.
|
|
1795
|
+
*
|
|
1796
|
+
* @tsplus pipeable fncts.io.Stream mergeHaltEither
|
|
1797
|
+
*/
|
|
1798
|
+
function mergeHaltEither(that, __tsplusTrace) {
|
|
1799
|
+
return self => {
|
|
1800
|
+
return merge_1(that, "Either", __tsplusTrace)(self);
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Merges this stream and the specified stream together. New produced stream
|
|
1805
|
+
* will terminate when this stream terminates.
|
|
1806
|
+
*
|
|
1807
|
+
* @tsplus pipeable fncts.io.Stream mergeHaltLeft
|
|
1808
|
+
*/
|
|
1809
|
+
function mergeHaltLeft(that, __tsplusTrace) {
|
|
1810
|
+
return self => {
|
|
1811
|
+
return merge_1(that, "Left", __tsplusTrace)(self);
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Merges this stream and the specified stream together. New produced stream
|
|
1816
|
+
* will terminate when the specified stream terminates.
|
|
1817
|
+
*
|
|
1818
|
+
* @tsplus pipeable fncts.io.Stream mergeHaltRight
|
|
1819
|
+
*/
|
|
1820
|
+
function mergeHaltRight(that, __tsplusTrace) {
|
|
1821
|
+
return self => {
|
|
1822
|
+
return merge_1(that, "Right", __tsplusTrace)(self);
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* Merges this stream and the specified stream together, discarding the values
|
|
1827
|
+
* from the right stream.
|
|
1828
|
+
*
|
|
1829
|
+
* @tsplus pipeable fncts.io.Stream mergeLeft
|
|
1830
|
+
*/
|
|
1831
|
+
function mergeLeft(that, __tsplusTrace) {
|
|
1832
|
+
return self => {
|
|
1833
|
+
return merge_1(drain_1(that, __tsplusTrace))(self);
|
|
1834
|
+
};
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* Merges this stream and the specified stream together, discarding the values
|
|
1838
|
+
* from the left stream.
|
|
1839
|
+
*
|
|
1840
|
+
* @tsplus pipeable fncts.io.Stream mergeRight
|
|
1841
|
+
*/
|
|
1842
|
+
function mergeRight(that, __tsplusTrace) {
|
|
1843
|
+
return self => {
|
|
1844
|
+
return merge_1(that)(drain_1(self, __tsplusTrace));
|
|
1679
1845
|
};
|
|
1680
1846
|
}
|
|
1681
1847
|
/**
|
|
@@ -1688,7 +1854,7 @@ function mapIOConcurrentlyUnordered(n, f) {
|
|
|
1688
1854
|
*/
|
|
1689
1855
|
function mergeMap_1(f, n, bufferSize = 16, __tsplusTrace) {
|
|
1690
1856
|
return ma => {
|
|
1691
|
-
return new
|
|
1857
|
+
return new _definition4.Stream(tsplus_module_58.mergeMap(a => f(a).channel, n, bufferSize)(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(ma.channel)));
|
|
1692
1858
|
};
|
|
1693
1859
|
}
|
|
1694
1860
|
/**
|
|
@@ -1712,14 +1878,14 @@ function mergeEither_1(fb, __tsplusTrace) {
|
|
|
1712
1878
|
};
|
|
1713
1879
|
}
|
|
1714
1880
|
function mergeWithHandler(terminate, __tsplusTrace) {
|
|
1715
|
-
return exit => terminate || !tsplus_module_52.isSuccess(exit) ?
|
|
1881
|
+
return exit => terminate || !tsplus_module_52.isSuccess(exit) ? tsplus_module_59.done(tsplus_module_1.fromExitNow(exit, __tsplusTrace)) : tsplus_module_59.wait(tsplus_module_1.fromExitNow);
|
|
1716
1882
|
}
|
|
1717
1883
|
/**
|
|
1718
1884
|
* @tsplus pipeable fncts.io.Stream mergeWith
|
|
1719
1885
|
*/
|
|
1720
1886
|
function mergeWith_1(sb, l, r, strategy = "Both", __tsplusTrace) {
|
|
1721
1887
|
return sa => {
|
|
1722
|
-
return new
|
|
1888
|
+
return new _definition4.Stream(tsplus_module_60.mergeWith(map_1(r, __tsplusTrace)(sb).channel, mergeWithHandler(strategy === "Either" || strategy === "Left", __tsplusTrace), mergeWithHandler(strategy === "Either" || strategy === "Right", __tsplusTrace))(map_1(l, __tsplusTrace)(sa).channel));
|
|
1723
1889
|
};
|
|
1724
1890
|
}
|
|
1725
1891
|
/**
|
|
@@ -1743,7 +1909,7 @@ function onError(cleanup, __tsplusTrace) {
|
|
|
1743
1909
|
*/
|
|
1744
1910
|
function orElse_1(that, __tsplusTrace) {
|
|
1745
1911
|
return stream => {
|
|
1746
|
-
return new
|
|
1912
|
+
return new _definition4.Stream(tsplus_module_10.orElse(that().channel)(stream.channel));
|
|
1747
1913
|
};
|
|
1748
1914
|
}
|
|
1749
1915
|
/**
|
|
@@ -1776,7 +1942,7 @@ function orElseFail(e, __tsplusTrace) {
|
|
|
1776
1942
|
* See also Stream#catchAll.
|
|
1777
1943
|
*/
|
|
1778
1944
|
function orElseOptional(stream, that, __tsplusTrace) {
|
|
1779
|
-
return catchAll_1(maybeError => tsplus_module_20.match(() => that(), e => failNow_1(tsplus_module_3.just(e), __tsplusTrace))(maybeError), __tsplusTrace)(stream);
|
|
1945
|
+
return catchAll_1(maybeError => tsplus_module_20.match(() => that(), e => failNow_1(tsplus_module_3.just(e, __tsplusTrace), __tsplusTrace))(maybeError), __tsplusTrace)(stream);
|
|
1780
1946
|
}
|
|
1781
1947
|
/**
|
|
1782
1948
|
* Succeeds with the specified value if this one fails with a typed error.
|
|
@@ -1793,7 +1959,7 @@ function orElseSucceed(a, __tsplusTrace) {
|
|
|
1793
1959
|
*/
|
|
1794
1960
|
function pipeThrough_1(sa, __tsplusTrace) {
|
|
1795
1961
|
return ma => {
|
|
1796
|
-
return new
|
|
1962
|
+
return new _definition4.Stream(tsplus_module_10.pipeToOrFail(sa.channel)(ma.channel));
|
|
1797
1963
|
};
|
|
1798
1964
|
}
|
|
1799
1965
|
/**
|
|
@@ -1801,7 +1967,7 @@ function pipeThrough_1(sa, __tsplusTrace) {
|
|
|
1801
1967
|
*/
|
|
1802
1968
|
function pipeThroughChannelOrFail_1(channel) {
|
|
1803
1969
|
return self => {
|
|
1804
|
-
return new
|
|
1970
|
+
return new _definition4.Stream(tsplus_module_10.pipeToOrFail(channel)(self.channel));
|
|
1805
1971
|
};
|
|
1806
1972
|
}
|
|
1807
1973
|
/**
|
|
@@ -1812,7 +1978,7 @@ function pipeThroughChannelOrFail_1(channel) {
|
|
|
1812
1978
|
*/
|
|
1813
1979
|
function provideEnvironment_1(r, __tsplusTrace) {
|
|
1814
1980
|
return ra => {
|
|
1815
|
-
return new
|
|
1981
|
+
return new _definition4.Stream(tsplus_module_10.provideEnvironment(() => r)(ra.channel));
|
|
1816
1982
|
};
|
|
1817
1983
|
}
|
|
1818
1984
|
/**
|
|
@@ -1820,7 +1986,7 @@ function provideEnvironment_1(r, __tsplusTrace) {
|
|
|
1820
1986
|
*/
|
|
1821
1987
|
function provideLayer_1(layer, __tsplusTrace) {
|
|
1822
1988
|
return self => {
|
|
1823
|
-
return new
|
|
1989
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(r => tsplus_module_10.provideEnvironment(() => r)(self.channel), __tsplusTrace)(tsplus_module_61.build(layer, __tsplusTrace))));
|
|
1824
1990
|
};
|
|
1825
1991
|
}
|
|
1826
1992
|
/**
|
|
@@ -1829,7 +1995,7 @@ function provideLayer_1(layer, __tsplusTrace) {
|
|
|
1829
1995
|
function provideSomeLayer(layer, __tsplusTrace) {
|
|
1830
1996
|
return self => {
|
|
1831
1997
|
// @ts-expect-error
|
|
1832
|
-
return provideLayer_1(
|
|
1998
|
+
return provideLayer_1(tsplus_module_62.and(layer, __tsplusTrace)(tsplus_module_62.environment(__tsplusTrace)), __tsplusTrace)(self);
|
|
1833
1999
|
};
|
|
1834
2000
|
}
|
|
1835
2001
|
class Rechunker {
|
|
@@ -1893,7 +2059,7 @@ function rechunkProcess(rechunker, target, __tsplusTrace) {
|
|
|
1893
2059
|
*/
|
|
1894
2060
|
function rechunk(n, __tsplusTrace) {
|
|
1895
2061
|
return stream => {
|
|
1896
|
-
return new
|
|
2062
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(rechunkProcess(new Rechunker(n), n, __tsplusTrace))(stream.channel));
|
|
1897
2063
|
};
|
|
1898
2064
|
}
|
|
1899
2065
|
/**
|
|
@@ -1902,7 +2068,7 @@ function rechunk(n, __tsplusTrace) {
|
|
|
1902
2068
|
* @tsplus static fncts.io.StreamOps repeatValue
|
|
1903
2069
|
*/
|
|
1904
2070
|
function repeatValue(a, __tsplusTrace) {
|
|
1905
|
-
return new
|
|
2071
|
+
return new _definition4.Stream(tsplus_module_10.repeated(tsplus_module_10.writeNow(tsplus_module_19.single(a))));
|
|
1906
2072
|
}
|
|
1907
2073
|
/**
|
|
1908
2074
|
* Creates a stream from an effect producing a value of type `A` which repeats forever.
|
|
@@ -1934,7 +2100,7 @@ function repeatIOChunk(fa, __tsplusTrace) {
|
|
|
1934
2100
|
* @tsplus static fncts.io.StreamOps repeatIOChunkMaybe
|
|
1935
2101
|
*/
|
|
1936
2102
|
function repeatIOChunkMaybe_1(fa, __tsplusTrace) {
|
|
1937
|
-
return unfoldChunkIO_1(undefined, _ => tsplus_module_1.catchAll(maybeError => tsplus_module_20.match(() => tsplus_module_1.succeedNow(tsplus_module_3.nothing(), __tsplusTrace), tsplus_module_1.failNow)(maybeError), __tsplusTrace)(tsplus_module_1.map(chunk => tsplus_module_3.just((0, _function.tuple)(chunk, undefined)), __tsplusTrace)(fa)), __tsplusTrace);
|
|
2103
|
+
return unfoldChunkIO_1(undefined, _ => tsplus_module_1.catchAll(maybeError => tsplus_module_20.match(() => tsplus_module_1.succeedNow(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), tsplus_module_1.failNow)(maybeError), __tsplusTrace)(tsplus_module_1.map(chunk => tsplus_module_3.just((0, _function.tuple)(chunk, undefined), __tsplusTrace), __tsplusTrace)(fa)), __tsplusTrace);
|
|
1938
2104
|
}
|
|
1939
2105
|
/**
|
|
1940
2106
|
* Runs the sink on the stream to produce either the sink's result or an error.
|
|
@@ -1943,7 +2109,7 @@ function repeatIOChunkMaybe_1(fa, __tsplusTrace) {
|
|
|
1943
2109
|
*/
|
|
1944
2110
|
function run_1(sink, __tsplusTrace) {
|
|
1945
2111
|
return stream => {
|
|
1946
|
-
return
|
|
2112
|
+
return tsplus_module_63.runDrain(tsplus_module_10.pipeToOrFail(sink.channel)(stream.channel));
|
|
1947
2113
|
};
|
|
1948
2114
|
}
|
|
1949
2115
|
/**
|
|
@@ -1978,7 +2144,7 @@ function runForeachScoped_1(f, __tsplusTrace) {
|
|
|
1978
2144
|
*/
|
|
1979
2145
|
function runIntoElementsScoped_(queue, __tsplusTrace) {
|
|
1980
2146
|
return stream => {
|
|
1981
|
-
const writer = tsplus_module_10.readWith(inp => tsplus_module_11.zipRight(writer)(tsplus_module_12.foldLeft(tsplus_module_10.unit, (channel, a) => tsplus_module_11.zipRight(tsplus_module_10.writeNow(tsplus_module_41.succeed(a)))(channel))(inp)), err => tsplus_module_10.writeNow(tsplus_module_41.fail(tsplus_module_3.just(err))), () => tsplus_module_10.writeNow(tsplus_module_41.fail(tsplus_module_3.nothing())));
|
|
2147
|
+
const writer = tsplus_module_10.readWith(inp => tsplus_module_11.zipRight(writer)(tsplus_module_12.foldLeft(tsplus_module_10.unit, (channel, a) => tsplus_module_11.zipRight(tsplus_module_10.writeNow(tsplus_module_41.succeed(a, __tsplusTrace)))(channel))(inp)), err => tsplus_module_10.writeNow(tsplus_module_41.fail(tsplus_module_3.just(err, __tsplusTrace), __tsplusTrace)), () => tsplus_module_10.writeNow(tsplus_module_41.fail(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace)));
|
|
1982
2148
|
return tsplus_module_1.asUnit(tsplus_module_16.runScoped(tsplus_module_10.drain(tsplus_module_10.mapOutIO(exit => tsplus_module_28.offer(exit, __tsplusTrace)(queue))(tsplus_module_10.pipeTo(writer)(stream.channel)))), __tsplusTrace);
|
|
1983
2149
|
};
|
|
1984
2150
|
}
|
|
@@ -2004,9 +2170,9 @@ function runIntoQueueElementsScoped_1(queue) {
|
|
|
2004
2170
|
return self => {
|
|
2005
2171
|
return tsplus_module_1.defer(() => {
|
|
2006
2172
|
const queue0 = queue();
|
|
2007
|
-
const writer = tsplus_module_10.readWithCause(inp => tsplus_module_11.zipRight(writer)(tsplus_module_10.fromIO(() => tsplus_module_28.offerAll(tsplus_module_12.map(a => tsplus_module_41.succeed(a))(inp), fileName_1 + ":
|
|
2008
|
-
return tsplus_module_1.asUnit(tsplus_module_16.runScoped(tsplus_module_10.drain(tsplus_module_10.pipeTo(writer)(self.channel))), fileName_1 + ":
|
|
2009
|
-
}, fileName_1 + ":
|
|
2173
|
+
const writer = tsplus_module_10.readWithCause(inp => tsplus_module_11.zipRight(writer)(tsplus_module_10.fromIO(() => tsplus_module_28.offerAll(tsplus_module_12.map(a => tsplus_module_41.succeed(a, fileName_1 + ":2799:85"))(inp), fileName_1 + ":2799:57")(queue0))), cause => tsplus_module_10.fromIO(() => tsplus_module_28.offer(tsplus_module_41.failCause(tsplus_module_25.map(e => tsplus_module_3.just(e, fileName_1 + ":2800:84"))(cause), fileName_1 + ":2800:62"), fileName_1 + ":2800:47")(queue0)), () => tsplus_module_10.fromIO(() => tsplus_module_28.offer(tsplus_module_41.fail(tsplus_module_3.nothing(fileName_1 + ":2801:60"), fileName_1 + ":2801:52"), fileName_1 + ":2801:42")(queue0)));
|
|
2174
|
+
return tsplus_module_1.asUnit(tsplus_module_16.runScoped(tsplus_module_10.drain(tsplus_module_10.pipeTo(writer)(self.channel))), fileName_1 + ":2804:55");
|
|
2175
|
+
}, fileName_1 + ":2796:20");
|
|
2010
2176
|
};
|
|
2011
2177
|
}
|
|
2012
2178
|
/**
|
|
@@ -2071,7 +2237,34 @@ function scanReduce(f, __tsplusTrace) {
|
|
|
2071
2237
|
*/
|
|
2072
2238
|
function scanReduceIO_1(f, __tsplusTrace) {
|
|
2073
2239
|
return fa => {
|
|
2074
|
-
return mapAccumIO_1(tsplus_module_3.nothing(), (s, a) => tsplus_module_20.match(() => tsplus_module_1.succeedNow([a, tsplus_module_3.just(a)], __tsplusTrace), b => tsplus_module_1.map(b => [b, tsplus_module_3.just(b)], __tsplusTrace)(f(b, a)))(s), __tsplusTrace)(fa);
|
|
2240
|
+
return mapAccumIO_1(tsplus_module_3.nothing(__tsplusTrace), (s, a) => tsplus_module_20.match(() => tsplus_module_1.succeedNow([a, tsplus_module_3.just(a, __tsplusTrace)], __tsplusTrace), b => tsplus_module_1.map(b => [b, tsplus_module_3.just(b, __tsplusTrace)], __tsplusTrace)(f(b, a)))(s), __tsplusTrace)(fa);
|
|
2241
|
+
};
|
|
2242
|
+
}
|
|
2243
|
+
/**
|
|
2244
|
+
* @tsplus pipeable fncts.io.Stream split
|
|
2245
|
+
*/
|
|
2246
|
+
function split(predicate, __tsplusTrace) {
|
|
2247
|
+
return self => {
|
|
2248
|
+
function split(leftovers, input) {
|
|
2249
|
+
const [chunk, remaining] = tsplus_module_12.splitWhere(predicate)(tsplus_module_12.concat(input)(leftovers));
|
|
2250
|
+
if (tsplus_module_12.isEmpty(chunk) || tsplus_module_12.isEmpty(remaining)) {
|
|
2251
|
+
return loop(tsplus_module_12.concat(tsplus_module_12.drop(1)(remaining))(chunk));
|
|
2252
|
+
} else {
|
|
2253
|
+
return tsplus_module_11.zipRight(split(tsplus_module_7.empty(), tsplus_module_12.drop(1)(remaining)))(tsplus_module_10.writeNow(tsplus_module_19.single(chunk)));
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
function loop(leftovers) {
|
|
2257
|
+
return tsplus_module_10.readWith(input => split(leftovers, input), tsplus_module_10.failNow, _ => {
|
|
2258
|
+
if (tsplus_module_12.isEmpty(leftovers)) {
|
|
2259
|
+
return tsplus_module_10.unit;
|
|
2260
|
+
} else if (tsplus_module_64.isNothing(tsplus_module_12.find(predicate)(leftovers))) {
|
|
2261
|
+
return tsplus_module_11.zipRight(tsplus_module_10.unit)(tsplus_module_10.writeNow(tsplus_module_19.single(leftovers)));
|
|
2262
|
+
} else {
|
|
2263
|
+
return tsplus_module_11.zipRight(tsplus_module_10.unit)(split(tsplus_module_7.empty(), leftovers));
|
|
2264
|
+
}
|
|
2265
|
+
});
|
|
2266
|
+
}
|
|
2267
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop(tsplus_module_7.empty()))(self.channel));
|
|
2075
2268
|
};
|
|
2076
2269
|
}
|
|
2077
2270
|
/**
|
|
@@ -2112,9 +2305,9 @@ function take(n, __tsplusTrace) {
|
|
|
2112
2305
|
return empty_1;
|
|
2113
2306
|
}
|
|
2114
2307
|
if (!Number.isInteger(n)) {
|
|
2115
|
-
return halt_1(() => new
|
|
2308
|
+
return halt_1(() => new tsplus_module_65.IllegalArgumentError(`${n} should be an integer`, "Stream.take"), __tsplusTrace);
|
|
2116
2309
|
}
|
|
2117
|
-
return new
|
|
2310
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(takeLoop(n, __tsplusTrace))(stream.channel));
|
|
2118
2311
|
};
|
|
2119
2312
|
}
|
|
2120
2313
|
/**
|
|
@@ -2122,7 +2315,7 @@ function take(n, __tsplusTrace) {
|
|
|
2122
2315
|
*/
|
|
2123
2316
|
function takeUntilIO(f, __tsplusTrace) {
|
|
2124
2317
|
return ma => {
|
|
2125
|
-
return new
|
|
2318
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(takeUntilIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(ma.channel));
|
|
2126
2319
|
};
|
|
2127
2320
|
}
|
|
2128
2321
|
function takeUntilIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -2152,17 +2345,64 @@ function takeUntilLoop(p, __tsplusTrace) {
|
|
|
2152
2345
|
*/
|
|
2153
2346
|
function takeUntil(p, __tsplusTrace) {
|
|
2154
2347
|
return fa => {
|
|
2155
|
-
return new
|
|
2348
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(takeUntilLoop(p, __tsplusTrace))(fa.channel));
|
|
2156
2349
|
};
|
|
2157
2350
|
}
|
|
2158
2351
|
/**
|
|
2159
2352
|
* @tsplus pipeable fncts.io.Stream tap
|
|
2160
2353
|
*/
|
|
2161
|
-
function
|
|
2354
|
+
function tap_1(f, __tsplusTrace) {
|
|
2162
2355
|
return ma => {
|
|
2163
2356
|
return mapIO_1(a => tsplus_module_1.as(() => a, __tsplusTrace)(f(a)), __tsplusTrace)(ma);
|
|
2164
2357
|
};
|
|
2165
2358
|
}
|
|
2359
|
+
/**
|
|
2360
|
+
* Returns a stream that effectfully "peeks" at the failure and adds an effect
|
|
2361
|
+
* to consumption of every element of the stream
|
|
2362
|
+
*
|
|
2363
|
+
* @tsplus pipeable fncts.io.Stream tapBoth
|
|
2364
|
+
*/
|
|
2365
|
+
function tapBoth(f, g, __tsplusTrace) {
|
|
2366
|
+
return self => {
|
|
2367
|
+
return tap_1(g, __tsplusTrace)(tapError_1(f, __tsplusTrace)(self));
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* Returns a stream that effectfully "peeks" at the failure of the stream.
|
|
2372
|
+
*
|
|
2373
|
+
* @tsplus pipeable fncts.io.Stream tapError
|
|
2374
|
+
*/
|
|
2375
|
+
function tapError_1(f, __tsplusTrace) {
|
|
2376
|
+
return self => {
|
|
2377
|
+
return catchAll_1(e => fromIO_1(f(e), __tsplusTrace), __tsplusTrace)(self);
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Returns a stream that effectfully "peeks" at the cause of failure of the
|
|
2382
|
+
* stream.
|
|
2383
|
+
*
|
|
2384
|
+
* @tsplus pipeable fncts.io.Stream tapErrorCause
|
|
2385
|
+
*/
|
|
2386
|
+
function tapErrorCause(f, __tsplusTrace) {
|
|
2387
|
+
return self => {
|
|
2388
|
+
return catchAllCause_1(e => fromIO_1(tsplus_module_1.zipRight(tsplus_module_1.refailCause(e, __tsplusTrace), __tsplusTrace)(f(e)), __tsplusTrace), __tsplusTrace)(self);
|
|
2389
|
+
};
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Sends all elements emitted by this stream to the specified sink in addition
|
|
2393
|
+
* to emitting them.
|
|
2394
|
+
*
|
|
2395
|
+
* @tsplus pipeable fncts.io.Stream tapSink
|
|
2396
|
+
*/
|
|
2397
|
+
function tapSink(sink, __tsplusTrace) {
|
|
2398
|
+
return self => {
|
|
2399
|
+
return flatMap_1(([queue, future]) => {
|
|
2400
|
+
const right = flattenTake_1(fromQueue_1(queue, 1, __tsplusTrace), __tsplusTrace);
|
|
2401
|
+
const loop = tsplus_module_10.readWithCause(chunk => tsplus_module_11.zipRight(loop)(tsplus_module_11.zipRight(tsplus_module_10.writeNow(chunk))(tsplus_module_10.fromIO(() => tsplus_module_28.offer(tsplus_module_27.chunk(chunk), __tsplusTrace)(queue)))), cause => tsplus_module_10.fromIO(() => tsplus_module_28.offer(tsplus_module_27.failCause(cause), __tsplusTrace)(queue)), () => tsplus_module_10.fromIO(() => tsplus_module_28.offer(tsplus_module_27.end, __tsplusTrace)(queue)));
|
|
2402
|
+
return merge_1(execute_1(tsplus_module_66.ensuring(tsplus_module_37.succeed_(undefined, __tsplusTrace)(future), __tsplusTrace)(run_1(sink, __tsplusTrace)(right)), __tsplusTrace), "Both", __tsplusTrace)(new _definition4.Stream(tsplus_module_10.ensuring(tsplus_module_1.zipRight(tsplus_module_37.wait(future, __tsplusTrace), __tsplusTrace)(tsplus_module_24.forkDaemon(tsplus_module_28.offer(tsplus_module_27.end, __tsplusTrace)(queue), __tsplusTrace)))(tsplus_module_10.pipeTo(loop)(self.channel))));
|
|
2403
|
+
}, __tsplusTrace)(fromIO_1(tsplus_module_1.zip(tsplus_module_38.make(__tsplusTrace), __tsplusTrace)(tsplus_module_30.makeBounded(1, __tsplusTrace)), __tsplusTrace));
|
|
2404
|
+
};
|
|
2405
|
+
}
|
|
2166
2406
|
/**
|
|
2167
2407
|
* Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket
|
|
2168
2408
|
* algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate
|
|
@@ -2198,7 +2438,7 @@ function throttleEnforceIOLoop(costFn, units, duration, burst, tokens, timestamp
|
|
|
2198
2438
|
*/
|
|
2199
2439
|
function throttleEnforceIO_1(costFn, units, duration, burst = 0, __tsplusTrace) {
|
|
2200
2440
|
return sa => {
|
|
2201
|
-
return new
|
|
2441
|
+
return new _definition4.Stream(tsplus_module_11.flatMap(current => tsplus_module_10.pipeTo(throttleEnforceIOLoop(costFn, units, duration, burst, units, current, __tsplusTrace))(sa.channel))(tsplus_module_10.fromIO(() => tsplus_module_43.currentTime)));
|
|
2202
2442
|
};
|
|
2203
2443
|
}
|
|
2204
2444
|
/**
|
|
@@ -2218,7 +2458,7 @@ function toHub_1(capacity, __tsplusTrace) {
|
|
|
2218
2458
|
* @tsplus getter fncts.io.Stream toPull
|
|
2219
2459
|
*/
|
|
2220
2460
|
function toPull_1(stream, __tsplusTrace) {
|
|
2221
|
-
return tsplus_module_1.map(io => tsplus_module_1.flatMap(r => tsplus_module_4.match(() => tsplus_module_1.failNow(tsplus_module_3.nothing(), __tsplusTrace), tsplus_module_1.succeedNow)(r), __tsplusTrace)(tsplus_module_1.mapError(tsplus_module_3.just, __tsplusTrace)(io)), __tsplusTrace)(
|
|
2461
|
+
return tsplus_module_1.map(io => tsplus_module_1.flatMap(r => tsplus_module_4.match(() => tsplus_module_1.failNow(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace), tsplus_module_1.succeedNow)(r), __tsplusTrace)(tsplus_module_1.mapError(tsplus_module_3.just, __tsplusTrace)(io)), __tsplusTrace)(tsplus_module_67.toPull(stream.channel));
|
|
2222
2462
|
}
|
|
2223
2463
|
/**
|
|
2224
2464
|
* Converts the stream to a managed queue of chunks. After the managed queue is used,
|
|
@@ -2273,7 +2513,7 @@ function unfoldChunkIOLoop(s, f, __tsplusTrace) {
|
|
|
2273
2513
|
* @tsplus static fncts.io.StreamOps unfoldChunkIO
|
|
2274
2514
|
*/
|
|
2275
2515
|
function unfoldChunkIO_1(s, f, __tsplusTrace) {
|
|
2276
|
-
return new
|
|
2516
|
+
return new _definition4.Stream(unfoldChunkIOLoop(s, f, __tsplusTrace));
|
|
2277
2517
|
}
|
|
2278
2518
|
/**
|
|
2279
2519
|
* Creates a stream by effectfully peeling off the "layers" of a value of type `S`
|
|
@@ -2290,7 +2530,7 @@ function unfoldChunkLoop(s, f, __tsplusTrace) {
|
|
|
2290
2530
|
* @tsplus static fncts.io.StreamOps unfoldChunk
|
|
2291
2531
|
*/
|
|
2292
2532
|
function unfoldChunk_1(s, f, __tsplusTrace) {
|
|
2293
|
-
return new
|
|
2533
|
+
return new _definition4.Stream(tsplus_module_10.defer(() => unfoldChunkLoop(s, f, __tsplusTrace)));
|
|
2294
2534
|
}
|
|
2295
2535
|
/**
|
|
2296
2536
|
* @tsplus static fncts.io.StreamOps unfold
|