@fncts/io 0.0.31 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- package/Channel/api/runScoped.d.ts +1 -0
- package/Channel/api.d.ts +1 -0
- package/Channel/internal/ChannelExecutor.d.ts +2 -2
- package/Fiber/FiberMessage.d.ts +5 -5
- package/Fiber/FiberRuntime.d.ts +3 -3
- package/IO/api/provideSomeLayer.d.ts +1 -2
- package/IO/api/zipConcurrent.d.ts +2 -1
- package/IO/api.d.ts +2 -1
- package/IO/definition.d.ts +34 -24
- package/IO/runtime.d.ts +10 -18
- package/STM/definition.d.ts +1 -1
- package/Stream/api.d.ts +113 -5
- 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/runScoped.cjs +19 -3
- package/_cjs/Channel/api/runScoped.cjs.map +1 -1
- package/_cjs/Channel/api/toPull.cjs +3 -3
- package/_cjs/Channel/api/toPull.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +8 -7
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelExecutor.cjs +71 -62
- 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/FiberMessage.cjs +12 -11
- package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
- package/_cjs/Fiber/FiberRuntime.cjs +102 -70
- 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/FiberScope/definition.cjs +2 -2
- package/_cjs/FiberScope/definition.cjs.map +1 -1
- package/_cjs/Future/api.cjs +4 -4
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Hub/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/provideSomeLayer.cjs.map +1 -1
- package/_cjs/IO/api/raceWith.cjs +9 -12
- package/_cjs/IO/api/raceWith.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/stateful.cjs +3 -3
- package/_cjs/IO/api/stateful.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/withChildren.cjs +5 -4
- package/_cjs/IO/api/withChildren.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/zipConcurrent.cjs +23 -23
- package/_cjs/IO/api/zipConcurrent.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 +47 -40
- 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/Queue/api/filterOutputIO.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 +415 -133
- 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/Cached/definition.mjs.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/runScoped.mjs +19 -3
- package/_mjs/Channel/api/runScoped.mjs.map +1 -1
- package/_mjs/Channel/api/toPull.mjs +3 -3
- package/_mjs/Channel/api/toPull.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +8 -7
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +71 -62
- 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/FiberMessage.mjs +5 -5
- package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
- package/_mjs/Fiber/FiberRuntime.mjs +102 -70
- 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/FiberScope/definition.mjs +2 -2
- package/_mjs/FiberScope/definition.mjs.map +1 -1
- package/_mjs/Future/api.mjs +4 -4
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Hub/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/provideSomeLayer.mjs.map +1 -1
- package/_mjs/IO/api/raceWith.mjs +9 -12
- package/_mjs/IO/api/raceWith.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/stateful.mjs +3 -3
- package/_mjs/IO/api/stateful.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/withChildren.mjs +5 -4
- package/_mjs/IO/api/withChildren.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/zipConcurrent.mjs +23 -23
- package/_mjs/IO/api/zipConcurrent.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 +43 -34
- 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/Queue/api/filterOutputIO.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 +321 -60
- 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/Cached/definition.ts +1 -1
- package/_src/Channel/api/runScoped.ts +30 -5
- package/_src/Channel/api/toPull.ts +1 -1
- package/_src/Channel/api.ts +1 -0
- package/_src/Channel/internal/ChannelExecutor.ts +24 -20
- package/_src/Fiber/FiberMessage.ts +5 -5
- package/_src/Fiber/FiberRuntime.ts +40 -17
- package/_src/FiberRefs/api.ts +1 -1
- package/_src/Hub/api.ts +1 -1
- package/_src/IO/api/asyncIO.ts +1 -1
- package/_src/IO/api/provideSomeLayer.ts +1 -3
- package/_src/IO/api/raceWith.ts +1 -3
- package/_src/IO/api/stateful.ts +1 -1
- package/_src/IO/api/zipConcurrent.ts +26 -30
- package/_src/IO/api.ts +4 -3
- package/_src/IO/definition.ts +35 -28
- package/_src/IO/runtime.ts +39 -38
- package/_src/Queue/api/filterInputIO.ts +1 -1
- package/_src/Queue/api/filterOutputIO.ts +1 -1
- package/_src/RefSubject/Atomic.ts +4 -4
- package/_src/STM/definition.ts +1 -1
- package/_src/State/definition.ts +1 -1
- package/_src/Stream/api.ts +315 -14
- package/_src/Subject/Atomic.ts +1 -1
- package/_src/global.ts +0 -4
- package/_src/index.ts +2 -2
- package/global.d.ts +0 -4
- package/index.d.ts +2 -2
- package/package.json +3 -3
- package/RuntimeConfig.d.ts +0 -11
- package/_cjs/RuntimeConfig.cjs +0 -12
- package/_cjs/RuntimeConfig.cjs.map +0 -1
- package/_mjs/RuntimeConfig.mjs +0 -3
- package/_mjs/RuntimeConfig.mjs.map +0 -1
- package/_src/RuntimeConfig.ts +0 -6
package/_cjs/Stream/api.cjs
CHANGED
@@ -35,10 +35,9 @@ exports.cross = cross;
|
|
35
35
|
exports.crossWith = void 0;
|
36
36
|
exports.debounce = debounce;
|
37
37
|
exports.defaultIfEmpty = defaultIfEmpty;
|
38
|
+
exports.defer = void 0;
|
38
39
|
exports.distributedWith = distributedWith;
|
39
|
-
exports.distributedWithDynamic = void 0;
|
40
|
-
exports.drain = drain;
|
41
|
-
exports.drop = void 0;
|
40
|
+
exports.drop = exports.drain = exports.distributedWithDynamic = void 0;
|
42
41
|
exports.dropUntil = dropUntil;
|
43
42
|
exports.dropWhile = void 0;
|
44
43
|
exports.either = either;
|
@@ -48,6 +47,7 @@ exports.environment = exports.ensuring = void 0;
|
|
48
47
|
exports.environmentWith = environmentWith;
|
49
48
|
exports.environmentWithIO = environmentWithIO;
|
50
49
|
exports.environmentWithStream = environmentWithStream;
|
50
|
+
exports.execute = void 0;
|
51
51
|
exports.fail = fail;
|
52
52
|
exports.failCause = failCause;
|
53
53
|
exports.failNow = exports.failCauseNow = void 0;
|
@@ -83,18 +83,24 @@ exports.mapConcatIO = mapConcatIO;
|
|
83
83
|
exports.mapError = void 0;
|
84
84
|
exports.mapErrorCause = mapErrorCause;
|
85
85
|
exports.mapIO = void 0;
|
86
|
-
exports.
|
87
|
-
exports.
|
86
|
+
exports.mapIOConcurrently = mapIOConcurrently;
|
87
|
+
exports.mapIOConcurrentlyUnordered = mapIOConcurrentlyUnordered;
|
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;
|
88
94
|
exports.mergeMapIO = mergeMapIO;
|
95
|
+
exports.mergeRight = mergeRight;
|
89
96
|
exports.mergeWith = void 0;
|
90
|
-
exports.mergeWithHandler = mergeWithHandler;
|
91
97
|
exports.onError = onError;
|
92
98
|
exports.orElse = void 0;
|
93
99
|
exports.orElseEither = orElseEither;
|
94
100
|
exports.orElseFail = orElseFail;
|
95
101
|
exports.orElseOptional = orElseOptional;
|
96
102
|
exports.orElseSucceed = orElseSucceed;
|
97
|
-
exports.provideLayer = exports.provideEnvironment = exports.pipeThrough = void 0;
|
103
|
+
exports.provideLayer = exports.provideEnvironment = exports.pipeThroughChannelOrFail = exports.pipeThrough = void 0;
|
98
104
|
exports.provideSomeLayer = provideSomeLayer;
|
99
105
|
exports.rechunk = rechunk;
|
100
106
|
exports.repeatIO = repeatIO;
|
@@ -104,17 +110,25 @@ exports.repeatValue = repeatValue;
|
|
104
110
|
exports.run = void 0;
|
105
111
|
exports.runCollect = runCollect;
|
106
112
|
exports.runDrain = runDrain;
|
107
|
-
exports.
|
113
|
+
exports.runForeachScoped = void 0;
|
114
|
+
exports.runIntoElementsScoped_ = runIntoElementsScoped_;
|
115
|
+
exports.runScoped = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoHubScoped = void 0;
|
108
116
|
exports.scan = scan;
|
109
117
|
exports.scanIO = void 0;
|
110
118
|
exports.scanReduce = scanReduce;
|
111
119
|
exports.scoped = exports.scanReduceIO = void 0;
|
120
|
+
exports.sliding = sliding;
|
121
|
+
exports.split = split;
|
112
122
|
exports.succeed = succeed;
|
113
123
|
exports.succeedNow = void 0;
|
114
124
|
exports.take = take;
|
115
125
|
exports.takeUntil = takeUntil;
|
116
126
|
exports.takeUntilIO = takeUntilIO;
|
117
|
-
exports.tap =
|
127
|
+
exports.tap = void 0;
|
128
|
+
exports.tapBoth = tapBoth;
|
129
|
+
exports.tapError = void 0;
|
130
|
+
exports.tapErrorCause = tapErrorCause;
|
131
|
+
exports.tapSink = tapSink;
|
118
132
|
exports.throttleEnforce = throttleEnforce;
|
119
133
|
exports.toQueue = exports.toPull = exports.toHub = exports.throttleEnforceIO = void 0;
|
120
134
|
exports.toQueueDropping = toQueueDropping;
|
@@ -179,20 +193,23 @@ var tsplus_module_49 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/requir
|
|
179
193
|
var tsplus_module_50 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
|
180
194
|
var tsplus_module_51 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/collection/immutable/Conc/findIO"));
|
181
195
|
var tsplus_module_52 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/definition"));
|
182
|
-
var tsplus_module_53 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
183
|
-
var tsplus_module_54 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
184
|
-
var tsplus_module_55 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
185
|
-
var tsplus_module_56 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/
|
186
|
-
var tsplus_module_57 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/
|
187
|
-
var tsplus_module_58 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/
|
188
|
-
var tsplus_module_59 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/
|
189
|
-
var tsplus_module_60 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
190
|
-
var tsplus_module_61 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/
|
191
|
-
var tsplus_module_62 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
192
|
-
var tsplus_module_63 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
193
|
-
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"));
|
194
211
|
var _function = /*#__PURE__*/require("@fncts/base/data/function");
|
195
|
-
var
|
212
|
+
var _definition4 = /*#__PURE__*/require("./definition.cjs");
|
196
213
|
var _Handoff2 = /*#__PURE__*/require("./internal/Handoff.cjs");
|
197
214
|
var _SinkEndReason2 = /*#__PURE__*/require("./internal/SinkEndReason.cjs");
|
198
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); }
|
@@ -224,8 +241,12 @@ const concat = concat_1;
|
|
224
241
|
exports.concat = concat;
|
225
242
|
const crossWith = crossWith_1;
|
226
243
|
exports.crossWith = crossWith;
|
244
|
+
const defer = defer_1;
|
245
|
+
exports.defer = defer;
|
227
246
|
const distributedWithDynamic = distributedWithDynamic_1;
|
228
247
|
exports.distributedWithDynamic = distributedWithDynamic;
|
248
|
+
const drain = drain_1;
|
249
|
+
exports.drain = drain;
|
229
250
|
const drop = drop_1;
|
230
251
|
exports.drop = drop;
|
231
252
|
const dropWhile = dropWhile_1;
|
@@ -234,6 +255,8 @@ const ensuring = ensuring_1;
|
|
234
255
|
exports.ensuring = ensuring;
|
235
256
|
const environment = environment_1;
|
236
257
|
exports.environment = environment;
|
258
|
+
const execute = execute_1;
|
259
|
+
exports.execute = execute;
|
237
260
|
const failNow = failNow_1;
|
238
261
|
exports.failNow = failNow;
|
239
262
|
const failCauseNow = failCauseNow_1;
|
@@ -284,6 +307,8 @@ const mapError = mapError_1;
|
|
284
307
|
exports.mapError = mapError;
|
285
308
|
const mapIO = mapIO_1;
|
286
309
|
exports.mapIO = mapIO;
|
310
|
+
const merge = merge_1;
|
311
|
+
exports.merge = merge;
|
287
312
|
const mergeMap = mergeMap_1;
|
288
313
|
exports.mergeMap = mergeMap;
|
289
314
|
const mergeEither = mergeEither_1;
|
@@ -294,6 +319,8 @@ const orElse = orElse_1;
|
|
294
319
|
exports.orElse = orElse;
|
295
320
|
const pipeThrough = pipeThrough_1;
|
296
321
|
exports.pipeThrough = pipeThrough;
|
322
|
+
const pipeThroughChannelOrFail = pipeThroughChannelOrFail_1;
|
323
|
+
exports.pipeThroughChannelOrFail = pipeThroughChannelOrFail;
|
297
324
|
const provideEnvironment = provideEnvironment_1;
|
298
325
|
exports.provideEnvironment = provideEnvironment;
|
299
326
|
const provideLayer = provideLayer_1;
|
@@ -306,10 +333,10 @@ const run = run_1;
|
|
306
333
|
exports.run = run;
|
307
334
|
const runForeachScoped = runForeachScoped_1;
|
308
335
|
exports.runForeachScoped = runForeachScoped;
|
309
|
-
const runIntoElementsScoped_ = runIntoElementsScoped_1;
|
310
|
-
exports.runIntoElementsScoped_ = runIntoElementsScoped_;
|
311
336
|
const runIntoQueueScoped = runIntoQueueScoped_1;
|
312
337
|
exports.runIntoQueueScoped = runIntoQueueScoped;
|
338
|
+
const runIntoQueueElementsScoped = runIntoQueueElementsScoped_1;
|
339
|
+
exports.runIntoQueueElementsScoped = runIntoQueueElementsScoped;
|
313
340
|
const runIntoHubScoped = runIntoHubScoped_1;
|
314
341
|
exports.runIntoHubScoped = runIntoHubScoped;
|
315
342
|
const runScoped = runScoped_1;
|
@@ -320,6 +347,10 @@ const scanReduceIO = scanReduceIO_1;
|
|
320
347
|
exports.scanReduceIO = scanReduceIO;
|
321
348
|
const succeedNow = succeedNow_1;
|
322
349
|
exports.succeedNow = succeedNow;
|
350
|
+
const tap = tap_1;
|
351
|
+
exports.tap = tap;
|
352
|
+
const tapError = tapError_1;
|
353
|
+
exports.tapError = tapError;
|
323
354
|
const throttleEnforceIO = throttleEnforceIO_1;
|
324
355
|
exports.throttleEnforceIO = throttleEnforceIO;
|
325
356
|
const toHub = toHub_1;
|
@@ -376,7 +407,7 @@ function aggregateAsync(sink, __tsplusTrace) {
|
|
376
407
|
*/
|
377
408
|
function aggregateAsyncWithin_1(sink, schedule, __tsplusTrace) {
|
378
409
|
return stream => {
|
379
|
-
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));
|
380
411
|
};
|
381
412
|
}
|
382
413
|
/**
|
@@ -429,15 +460,15 @@ function aggregateAsyncWithinEither_1(sink, schedule, __tsplusTrace) {
|
|
429
460
|
function handleSide(leftovers, b, c, __tsplusTrace) {
|
430
461
|
return tsplus_module_10.unwrap(() => tsplus_module_1.zipRight(tsplus_module_1.map(reason => tsplus_module_21.matchSinkEndReason({
|
431
462
|
ScheduleEnd: () => tsplus_module_10.unwrapScoped(() => tsplus_module_1.flatMap(consumed_ => tsplus_module_1.flatMap(sinkFiber => tsplus_module_1.map(scheduleFiber => {
|
432
|
-
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);
|
433
464
|
return consumed_ ? tsplus_module_11.zipRight(scheduledAggregator(sinkFiber, scheduleFiber))(tsplus_module_10.write(() => toWrite)) : scheduledAggregator(sinkFiber, scheduleFiber);
|
434
|
-
}, __tsplusTrace)(tsplus_module_17.forkScoped(timeout(tsplus_module_3.just(b), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(forkSink), __tsplusTrace)(tsplus_module_14.get(consumed, __tsplusTrace))),
|
435
|
-
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)))
|
436
467
|
})(reason), __tsplusTrace)(tsplus_module_14.get(sinkEndReason, __tsplusTrace)), __tsplusTrace)(tsplus_module_13.set(tsplus_module_12.flatten(leftovers), __tsplusTrace)(sinkLeftovers)));
|
437
468
|
}
|
438
|
-
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)));
|
439
470
|
};
|
440
|
-
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);
|
441
472
|
}, __tsplusTrace)(fromIO_1(deps, __tsplusTrace));
|
442
473
|
};
|
443
474
|
}
|
@@ -481,10 +512,14 @@ function as(b, __tsplusTrace) {
|
|
481
512
|
function asyncInterrupt_1(register, outputBuffer = 16, __tsplusTrace) {
|
482
513
|
return unwrapScoped_1(tsplus_module_1.flatMap(output => tsplus_module_1.flatMap(runtime => tsplus_module_1.map(eitherStream => tsplus_module_4.match(canceler => {
|
483
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))));
|
484
|
-
return ensuring_1(canceler, __tsplusTrace)(new
|
515
|
+
return ensuring_1(canceler, __tsplusTrace)(new _definition4.Stream(loop));
|
485
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) => {
|
486
517
|
const effect = tsplus_module_1.flatMap(a => tsplus_module_28.offer(a, __tsplusTrace)(output), __tsplusTrace)(tsplus_module_27.fromPull(k));
|
487
|
-
|
518
|
+
const fiber = runtime.makeFiber(effect, __tsplusTrace);
|
519
|
+
if (cb) {
|
520
|
+
fiber.addObserver(cb);
|
521
|
+
}
|
522
|
+
fiber.start(effect);
|
488
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);
|
489
524
|
}
|
490
525
|
/**
|
@@ -496,7 +531,7 @@ function asyncInterrupt_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
496
531
|
* @tsplus static fncts.io.StreamOps asyncMaybe
|
497
532
|
*/
|
498
533
|
function asyncMaybe_1(register, outputBuffer = 16, __tsplusTrace) {
|
499
|
-
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);
|
500
535
|
}
|
501
536
|
/**
|
502
537
|
* @tsplus static fncts.io.StreamOps async
|
@@ -504,17 +539,24 @@ function asyncMaybe_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
504
539
|
function async(register, outputBuffer = 16, __tsplusTrace) {
|
505
540
|
return asyncMaybe_1(cb => {
|
506
541
|
register(cb);
|
507
|
-
return tsplus_module_3.nothing();
|
542
|
+
return tsplus_module_3.nothing(__tsplusTrace);
|
508
543
|
}, outputBuffer, __tsplusTrace);
|
509
544
|
}
|
510
545
|
/**
|
511
546
|
* @tsplus static fncts.io.StreamOps asyncIO
|
512
547
|
*/
|
513
548
|
function asyncIO(register, outputBuffer = 16, __tsplusTrace) {
|
514
|
-
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(() => {
|
515
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))));
|
516
551
|
return loop;
|
517
|
-
}, __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))));
|
518
560
|
}
|
519
561
|
/**
|
520
562
|
* Returns a stream whose failure and success channels have been mapped by
|
@@ -602,7 +644,7 @@ function broadcastedQueuesDynamic_1(maximumLag, __tsplusTrace) {
|
|
602
644
|
function buffer(capacity, __tsplusTrace) {
|
603
645
|
return stream => {
|
604
646
|
const queue = toQueueOfElements_1(capacity, __tsplusTrace)(stream);
|
605
|
-
return new
|
647
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
606
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)));
|
607
649
|
return process;
|
608
650
|
}, __tsplusTrace)(queue)));
|
@@ -614,7 +656,7 @@ function buffer(capacity, __tsplusTrace) {
|
|
614
656
|
function bufferChunks(capacity, __tsplusTrace) {
|
615
657
|
return stream => {
|
616
658
|
const queue = toQueue_1(capacity, __tsplusTrace)(stream);
|
617
|
-
return new
|
659
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
618
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)));
|
619
661
|
return process;
|
620
662
|
}, __tsplusTrace)(queue)));
|
@@ -628,7 +670,7 @@ function bufferChunks(capacity, __tsplusTrace) {
|
|
628
670
|
*/
|
629
671
|
function bufferUnbounded(stream, __tsplusTrace) {
|
630
672
|
const queue = toQueueUnbounded_1(stream, __tsplusTrace);
|
631
|
-
return new
|
673
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
632
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)));
|
633
675
|
return process;
|
634
676
|
}, __tsplusTrace)(queue)));
|
@@ -662,7 +704,7 @@ function catchAll_1(f, __tsplusTrace) {
|
|
662
704
|
function catchAllCause_1(f, __tsplusTrace) {
|
663
705
|
return stream => {
|
664
706
|
const channel = tsplus_module_10.catchAllCause(cause => f(cause).channel)(stream.channel);
|
665
|
-
return new
|
707
|
+
return new _definition4.Stream(channel);
|
666
708
|
};
|
667
709
|
}
|
668
710
|
/**
|
@@ -696,7 +738,7 @@ function catchJustCause(pf, __tsplusTrace) {
|
|
696
738
|
*/
|
697
739
|
function flatMap_1(f, __tsplusTrace) {
|
698
740
|
return stream => {
|
699
|
-
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));
|
700
742
|
};
|
701
743
|
}
|
702
744
|
/**
|
@@ -720,7 +762,7 @@ function chunksWith(f, __tsplusTrace) {
|
|
720
762
|
}
|
721
763
|
function changesWithWriter(f, last, __tsplusTrace) {
|
722
764
|
return tsplus_module_10.readWithCause(chunk => {
|
723
|
-
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);
|
724
766
|
return tsplus_module_11.zipRight(changesWithWriter(f, newLast, __tsplusTrace))(tsplus_module_10.writeNow(newChunk));
|
725
767
|
}, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit);
|
726
768
|
}
|
@@ -733,7 +775,7 @@ function changesWithWriter(f, last, __tsplusTrace) {
|
|
733
775
|
*/
|
734
776
|
function changesWith(f, __tsplusTrace) {
|
735
777
|
return stream => {
|
736
|
-
return new
|
778
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(changesWithWriter(f, tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace))(stream.channel));
|
737
779
|
};
|
738
780
|
}
|
739
781
|
/**
|
@@ -751,14 +793,14 @@ function collectWhile(pf, __tsplusTrace) {
|
|
751
793
|
return tsplus_module_10.writeNow(mapped);
|
752
794
|
}
|
753
795
|
}, tsplus_module_10.failNow, tsplus_module_11.succeedNow);
|
754
|
-
return new
|
796
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
755
797
|
};
|
756
798
|
}
|
757
799
|
/**
|
758
800
|
* Effectfully transforms all elements of the stream for as long as the specified partial function is defined.
|
759
801
|
*/
|
760
802
|
function collectWhileIO(stream, pf, __tsplusTrace) {
|
761
|
-
return new
|
803
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(collectWhileIOLoop(tsplus_module_40.empty()[Symbol.iterator](), pf, __tsplusTrace))(stream.channel));
|
762
804
|
}
|
763
805
|
function collectWhileIOLoop(iterator, pf, __tsplusTrace) {
|
764
806
|
const next = iterator.next();
|
@@ -769,7 +811,7 @@ function collectWhileIOLoop(iterator, pf, __tsplusTrace) {
|
|
769
811
|
}
|
770
812
|
}
|
771
813
|
function combineProducer(handoff, latch, __tsplusTrace) {
|
772
|
-
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)));
|
773
815
|
}
|
774
816
|
/**
|
775
817
|
* Combines the elements from this stream and the specified stream by repeatedly applying the
|
@@ -783,7 +825,7 @@ function combineProducer(handoff, latch, __tsplusTrace) {
|
|
783
825
|
*/
|
784
826
|
function combine(that, s, f, __tsplusTrace) {
|
785
827
|
return stream => {
|
786
|
-
return new
|
828
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right, latchL, latchR]) => {
|
787
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)));
|
788
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)));
|
789
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;
|
@@ -791,7 +833,7 @@ function combine(that, s, f, __tsplusTrace) {
|
|
791
833
|
};
|
792
834
|
}
|
793
835
|
function combineChunksProducer(handoff, latch, __tsplusTrace) {
|
794
|
-
return tsplus_module_11.zipRight(tsplus_module_10.readWithCause(chunk => tsplus_module_11.zipRight(combineChunksProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_27.chunk(chunk))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_27.failCause(cause))(handoff)), () =>
|
836
|
+
return tsplus_module_11.zipRight(tsplus_module_10.readWithCause(chunk => tsplus_module_11.zipRight(combineChunksProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_27.chunk(chunk))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_27.failCause(cause))(handoff)), () => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_27.end)(handoff))))(tsplus_module_10.fromIO(() => tsplus_module_5.take(latch)));
|
795
837
|
}
|
796
838
|
/**
|
797
839
|
* Combines the chunks from this stream and the specified stream by repeatedly applying the
|
@@ -803,7 +845,7 @@ function combineChunksProducer(handoff, latch, __tsplusTrace) {
|
|
803
845
|
*/
|
804
846
|
function combineChunks(that, s, f, __tsplusTrace) {
|
805
847
|
return stream => {
|
806
|
-
return new
|
848
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right, latchL, latchR]) => {
|
807
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)));
|
808
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)));
|
809
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;
|
@@ -818,7 +860,7 @@ function combineChunks(that, s, f, __tsplusTrace) {
|
|
818
860
|
*/
|
819
861
|
function concat_1(that, __tsplusTrace) {
|
820
862
|
return stream => {
|
821
|
-
return new
|
863
|
+
return new _definition4.Stream(tsplus_module_11.zipRight(that.channel)(stream.channel));
|
822
864
|
};
|
823
865
|
}
|
824
866
|
/**
|
@@ -829,7 +871,7 @@ function concat_1(that, __tsplusTrace) {
|
|
829
871
|
*/
|
830
872
|
function cross(that, __tsplusTrace) {
|
831
873
|
return stream => {
|
832
|
-
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));
|
833
875
|
};
|
834
876
|
}
|
835
877
|
/**
|
@@ -900,10 +942,16 @@ function debounce(duration, __tsplusTrace) {
|
|
900
942
|
})(signal))(ex), __tsplusTrace)(tsplus_module_22.join(fiber, __tsplusTrace))
|
901
943
|
})(state));
|
902
944
|
}
|
903
|
-
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));
|
904
946
|
}, __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace), __tsplusTrace);
|
905
947
|
};
|
906
948
|
}
|
949
|
+
/**
|
950
|
+
* @tsplus static fncts.io.StreamOps defer
|
951
|
+
*/
|
952
|
+
function defer_1(self) {
|
953
|
+
return new _definition4.Stream(tsplus_module_10.defer(() => self().channel));
|
954
|
+
}
|
907
955
|
function defaultIfEmptyWriter(fb, __tsplusTrace) {
|
908
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);
|
909
957
|
}
|
@@ -914,7 +962,7 @@ function defaultIfEmptyWriter(fb, __tsplusTrace) {
|
|
914
962
|
*/
|
915
963
|
function defaultIfEmpty(fb, __tsplusTrace) {
|
916
964
|
return fa => {
|
917
|
-
return new
|
965
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(defaultIfEmptyWriter(fb, __tsplusTrace))(fa.channel));
|
918
966
|
};
|
919
967
|
}
|
920
968
|
/**
|
@@ -946,17 +994,17 @@ function distributedWithDynamic_1(maximumLag, decide, done = () => tsplus_module
|
|
946
994
|
return self => {
|
947
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]) => {
|
948
996
|
if (shouldProcess(id)) {
|
949
|
-
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));
|
950
998
|
} else {
|
951
999
|
return tsplus_module_1.succeedNow(b, __tsplusTrace);
|
952
1000
|
}
|
953
1001
|
}, __tsplusTrace)), __tsplusTrace)(tsplus_module_14.get(queuesRef, __tsplusTrace)), __tsplusTrace)(decide(a));
|
954
1002
|
return tsplus_module_1.flatMap(queuesRef => tsplus_module_1.map(add => add, __tsplusTrace)(tsplus_module_1.flatMap(queuesLock => tsplus_module_1.flatMap(newQueue => {
|
955
|
-
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(() => {
|
956
1004
|
const id = Symbol();
|
957
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));
|
958
1006
|
}, __tsplusTrace)(tsplus_module_28.offer(endTake, __tsplusTrace)(queue)), __tsplusTrace)(tsplus_module_30.makeBounded(1, __tsplusTrace)), __tsplusTrace)(newQueue)), __tsplusTrace));
|
959
|
-
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));
|
960
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));
|
961
1009
|
};
|
962
1010
|
}
|
@@ -966,8 +1014,8 @@ function distributedWithDynamic_1(maximumLag, decide, done = () => tsplus_module
|
|
966
1014
|
*
|
967
1015
|
* @tsplus getter fncts.io.Stream drain
|
968
1016
|
*/
|
969
|
-
function
|
970
|
-
return new
|
1017
|
+
function drain_1(fa, __tsplusTrace) {
|
1018
|
+
return new _definition4.Stream(tsplus_module_10.drain(fa.channel));
|
971
1019
|
}
|
972
1020
|
function dropLoop(r, __tsplusTrace) {
|
973
1021
|
return tsplus_module_10.readWith(inp => {
|
@@ -984,7 +1032,7 @@ function dropLoop(r, __tsplusTrace) {
|
|
984
1032
|
*/
|
985
1033
|
function drop_1(n, __tsplusTrace) {
|
986
1034
|
return stream => {
|
987
|
-
return new
|
1035
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(dropLoop(n, __tsplusTrace))(stream.channel));
|
988
1036
|
};
|
989
1037
|
}
|
990
1038
|
/**
|
@@ -1019,12 +1067,12 @@ function dropUntil(p, __tsplusTrace) {
|
|
1019
1067
|
* @tsplus getter fncts.io.Stream either
|
1020
1068
|
*/
|
1021
1069
|
function either(stream, __tsplusTrace) {
|
1022
|
-
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));
|
1023
1071
|
}
|
1024
1072
|
/**
|
1025
1073
|
* @tsplus static fncts.io.StreamOps empty
|
1026
1074
|
*/
|
1027
|
-
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");
|
1028
1076
|
const empty = empty_1;
|
1029
1077
|
exports.empty = empty;
|
1030
1078
|
function endWhenWriter(fiber, __tsplusTrace) {
|
@@ -1043,7 +1091,7 @@ function endWhenWriter(fiber, __tsplusTrace) {
|
|
1043
1091
|
*/
|
1044
1092
|
function endWhen(io, __tsplusTrace) {
|
1045
1093
|
return stream => {
|
1046
|
-
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))));
|
1047
1095
|
};
|
1048
1096
|
}
|
1049
1097
|
/**
|
@@ -1051,7 +1099,7 @@ function endWhen(io, __tsplusTrace) {
|
|
1051
1099
|
*/
|
1052
1100
|
function ensuring_1(finalizer, __tsplusTrace) {
|
1053
1101
|
return self => {
|
1054
|
-
return new
|
1102
|
+
return new _definition4.Stream(tsplus_module_10.ensuring(finalizer)(self.channel));
|
1055
1103
|
};
|
1056
1104
|
}
|
1057
1105
|
/**
|
@@ -1084,13 +1132,21 @@ function environmentWithIO(f, __tsplusTrace) {
|
|
1084
1132
|
function environmentWithStream(f, __tsplusTrace) {
|
1085
1133
|
return flatMap_1(f, __tsplusTrace)(environment_1(__tsplusTrace));
|
1086
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
|
+
}
|
1087
1143
|
/**
|
1088
1144
|
* Halt a stream with the specified error
|
1089
1145
|
*
|
1090
1146
|
* @tsplus static fncts.io.StreamOps failNow
|
1091
1147
|
*/
|
1092
1148
|
function failNow_1(error, __tsplusTrace) {
|
1093
|
-
return new
|
1149
|
+
return new _definition4.Stream(tsplus_module_10.failNow(error));
|
1094
1150
|
}
|
1095
1151
|
/**
|
1096
1152
|
* Halt a stream with the specified error
|
@@ -1098,7 +1154,7 @@ function failNow_1(error, __tsplusTrace) {
|
|
1098
1154
|
* @tsplus static fncts.io.StreamOps fail
|
1099
1155
|
*/
|
1100
1156
|
function fail(error, __tsplusTrace) {
|
1101
|
-
return new
|
1157
|
+
return new _definition4.Stream(tsplus_module_10.fail(error));
|
1102
1158
|
}
|
1103
1159
|
/**
|
1104
1160
|
* The stream that always halts with `cause`.
|
@@ -1126,7 +1182,7 @@ function filter(predicate, __tsplusTrace) {
|
|
1126
1182
|
*/
|
1127
1183
|
function filterIO(f, __tsplusTrace) {
|
1128
1184
|
return fa => {
|
1129
|
-
return new
|
1185
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(filterIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(fa.channel));
|
1130
1186
|
};
|
1131
1187
|
}
|
1132
1188
|
function filterIOLoop(iterator, f, __tsplusTrace) {
|
@@ -1150,7 +1206,7 @@ function filterMap_1(f, __tsplusTrace) {
|
|
1150
1206
|
*/
|
1151
1207
|
function filterMapIO(f, __tsplusTrace) {
|
1152
1208
|
return fa => {
|
1153
|
-
return new
|
1209
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(filterMapIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(fa.channel));
|
1154
1210
|
};
|
1155
1211
|
}
|
1156
1212
|
function filterMapIOLoop(iterator, f, __tsplusTrace) {
|
@@ -1169,7 +1225,7 @@ function filterMapIOLoop(iterator, f, __tsplusTrace) {
|
|
1169
1225
|
function find(p, __tsplusTrace) {
|
1170
1226
|
return stream => {
|
1171
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);
|
1172
|
-
return new
|
1228
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
1173
1229
|
};
|
1174
1230
|
}
|
1175
1231
|
/**
|
@@ -1180,7 +1236,7 @@ function find(p, __tsplusTrace) {
|
|
1180
1236
|
function findIO(f, __tsplusTrace) {
|
1181
1237
|
return stream => {
|
1182
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);
|
1183
|
-
return new
|
1239
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
1184
1240
|
};
|
1185
1241
|
}
|
1186
1242
|
/**
|
@@ -1203,10 +1259,10 @@ function flattenExitOption_1(stream, __tsplusTrace) {
|
|
1203
1259
|
const processChunk = (chunk, cont) => {
|
1204
1260
|
const [toEmit, rest] = tsplus_module_12.splitWhere(_ => !tsplus_module_52.isSuccess(_))(chunk);
|
1205
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));
|
1206
|
-
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)));
|
1207
1263
|
};
|
1208
1264
|
const process = tsplus_module_10.readWithCause(chunk => processChunk(chunk, process), tsplus_module_11.failCauseNow, _ => tsplus_module_11.endNow(undefined));
|
1209
|
-
return new
|
1265
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(process)(stream.channel));
|
1210
1266
|
}
|
1211
1267
|
/**
|
1212
1268
|
* Unwraps `Exit` values and flatten chunks that also signify end-of-stream by failing with `None`.
|
@@ -1223,7 +1279,7 @@ function flattenTake_1(stream, __tsplusTrace) {
|
|
1223
1279
|
* @tsplus getter fncts.io.Stream flattenChunks
|
1224
1280
|
*/
|
1225
1281
|
function flattenChunks_1(stream, __tsplusTrace) {
|
1226
|
-
return new
|
1282
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(c => tsplus_module_12.flatten(c))(stream.channel));
|
1227
1283
|
}
|
1228
1284
|
/**
|
1229
1285
|
* Repeats this stream forever.
|
@@ -1231,7 +1287,7 @@ function flattenChunks_1(stream, __tsplusTrace) {
|
|
1231
1287
|
* @tsplus getter fncts.io.Stream forever
|
1232
1288
|
*/
|
1233
1289
|
function forever_1(stream, __tsplusTrace) {
|
1234
|
-
return new
|
1290
|
+
return new _definition4.Stream(tsplus_module_10.repeated(stream.channel));
|
1235
1291
|
}
|
1236
1292
|
/**
|
1237
1293
|
* Creates a stream from a `Chunk` of values
|
@@ -1239,7 +1295,7 @@ function forever_1(stream, __tsplusTrace) {
|
|
1239
1295
|
* @tsplus static fncts.io.StreamOps fromChunkNow
|
1240
1296
|
*/
|
1241
1297
|
function fromChunkNow_1(c, __tsplusTrace) {
|
1242
|
-
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)));
|
1243
1299
|
}
|
1244
1300
|
/**
|
1245
1301
|
* Creates a stream from a `Chunk` of values
|
@@ -1247,7 +1303,7 @@ function fromChunkNow_1(c, __tsplusTrace) {
|
|
1247
1303
|
* @tsplus static fncts.io.StreamOps fromChunk
|
1248
1304
|
*/
|
1249
1305
|
function fromChunk_1(c, __tsplusTrace) {
|
1250
|
-
return new
|
1306
|
+
return new _definition4.Stream(tsplus_module_10.unwrap(() => tsplus_module_1.succeedNow(tsplus_module_10.write(c), __tsplusTrace)));
|
1251
1307
|
}
|
1252
1308
|
/**
|
1253
1309
|
* Creates a single-valued stream from a managed resource
|
@@ -1255,7 +1311,60 @@ function fromChunk_1(c, __tsplusTrace) {
|
|
1255
1311
|
* @tsplus static fncts.io.StreamOps scoped
|
1256
1312
|
*/
|
1257
1313
|
function scoped_1(stream, __tsplusTrace) {
|
1258
|
-
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
|
+
};
|
1259
1368
|
}
|
1260
1369
|
/**
|
1261
1370
|
* Creates a stream from an effect producing a value of type `A`
|
@@ -1271,7 +1380,7 @@ function fromIO_1(fa, __tsplusTrace) {
|
|
1271
1380
|
* @tsplus static fncts.io.StreamOps fromIOMaybe
|
1272
1381
|
*/
|
1273
1382
|
function fromIOMaybe_1(fa, __tsplusTrace) {
|
1274
|
-
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)));
|
1275
1384
|
}
|
1276
1385
|
function fromAsyncIterableLoop(iterator, __tsplusTrace) {
|
1277
1386
|
return tsplus_module_10.unwrap(() => tsplus_module_1.async(k => {
|
@@ -1282,12 +1391,12 @@ function fromAsyncIterableLoop(iterator, __tsplusTrace) {
|
|
1282
1391
|
* @tsplus static fncts.io.StreamOps fromAsyncIterable
|
1283
1392
|
*/
|
1284
1393
|
function fromAsyncIterable(iterable, __tsplusTrace) {
|
1285
|
-
return new
|
1394
|
+
return new _definition4.Stream(fromAsyncIterableLoop(iterable[Symbol.asyncIterator](), __tsplusTrace));
|
1286
1395
|
}
|
1287
1396
|
/**
|
1288
1397
|
* @tsplus static fncts.io.StreamOps fromIterable
|
1289
1398
|
*/
|
1290
|
-
function fromIterable(iterable, maxChunkSize =
|
1399
|
+
function fromIterable(iterable, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
1291
1400
|
return unwrap_1(tsplus_module_1.succeed(() => {
|
1292
1401
|
const loop = iterator => tsplus_module_10.unwrap(() => tsplus_module_1.succeed(() => {
|
1293
1402
|
let result = iterator.next();
|
@@ -1307,7 +1416,7 @@ function fromIterable(iterable, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE,
|
|
1307
1416
|
return tsplus_module_11.zipRight(loop(iterator))(tsplus_module_10.writeNow(tsplus_module_19.from(out)));
|
1308
1417
|
}
|
1309
1418
|
}, __tsplusTrace));
|
1310
|
-
return new
|
1419
|
+
return new _definition4.Stream(loop(iterable[Symbol.iterator]()));
|
1311
1420
|
}, __tsplusTrace), __tsplusTrace);
|
1312
1421
|
}
|
1313
1422
|
/**
|
@@ -1317,7 +1426,7 @@ function fromIterableSingle(iterable, __tsplusTrace) {
|
|
1317
1426
|
return flatMap_1(iterator => repeatIOMaybe_1(tsplus_module_1.defer(() => {
|
1318
1427
|
const value = iterator.next();
|
1319
1428
|
if (value.done) {
|
1320
|
-
return tsplus_module_1.failNow(tsplus_module_3.nothing(), __tsplusTrace);
|
1429
|
+
return tsplus_module_1.failNow(tsplus_module_3.nothing(__tsplusTrace), __tsplusTrace);
|
1321
1430
|
} else {
|
1322
1431
|
return tsplus_module_1.succeedNow(value.value, __tsplusTrace);
|
1323
1432
|
}
|
@@ -1334,31 +1443,31 @@ function fromPull_1(scopedPull, __tsplusTrace) {
|
|
1334
1443
|
*
|
1335
1444
|
* @tsplus static fncts.io.StreamOps fromQueue
|
1336
1445
|
*/
|
1337
|
-
function fromQueue_1(queue, maxChunkSize =
|
1446
|
+
function fromQueue_1(queue, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
1338
1447
|
return repeatIOChunkMaybe_1(tsplus_module_1.catchAllCause(c => tsplus_module_1.flatMap(down => {
|
1339
1448
|
if (down && tsplus_module_25.interrupted(c)) {
|
1340
|
-
return
|
1449
|
+
return tsplus_module_54.end;
|
1341
1450
|
} else {
|
1342
|
-
return
|
1451
|
+
return tsplus_module_54.failCause(c);
|
1343
1452
|
}
|
1344
|
-
}, __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);
|
1345
1454
|
}
|
1346
1455
|
/**
|
1347
1456
|
* @tsplus static fncts.io.StreamOps fromQueueWithShutdown
|
1348
1457
|
*/
|
1349
|
-
function fromQueueWithShutdown_1(queue, maxChunkSize =
|
1458
|
+
function fromQueueWithShutdown_1(queue, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
1350
1459
|
return ensuring_1(tsplus_module_28.shutdown(queue, __tsplusTrace), __tsplusTrace)(fromQueue_1(queue, maxChunkSize, __tsplusTrace));
|
1351
1460
|
}
|
1352
1461
|
/**
|
1353
1462
|
* @tsplus static fncts.io.StreamOps fromHub
|
1354
1463
|
*/
|
1355
|
-
function fromHub(hub, maxChunkSize =
|
1464
|
+
function fromHub(hub, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
1356
1465
|
return flatMap_1(queue => fromQueueWithShutdown_1(queue, maxChunkSize, __tsplusTrace), __tsplusTrace)(scoped_1(() => tsplus_module_34.subscribe(hub(), __tsplusTrace), __tsplusTrace));
|
1357
1466
|
}
|
1358
1467
|
/**
|
1359
1468
|
* @tsplus static fncts.io.StreamOps fromHubScoped
|
1360
1469
|
*/
|
1361
|
-
function fromHubScoped(hub, maxChunkSize =
|
1470
|
+
function fromHubScoped(hub, maxChunkSize = _definition4.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
1362
1471
|
return tsplus_module_1.defer(() => tsplus_module_1.map(queue => fromQueueWithShutdown_1(queue, maxChunkSize, __tsplusTrace), __tsplusTrace)(tsplus_module_34.subscribe(hub(), __tsplusTrace)), __tsplusTrace);
|
1363
1472
|
}
|
1364
1473
|
/**
|
@@ -1367,7 +1476,7 @@ function fromHubScoped(hub, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __ts
|
|
1367
1476
|
* @tsplus static fncts.io.StreamOps haltNow
|
1368
1477
|
*/
|
1369
1478
|
function haltNow(u, __tsplusTrace) {
|
1370
|
-
return new
|
1479
|
+
return new _definition4.Stream(tsplus_module_10.halt(() => u));
|
1371
1480
|
}
|
1372
1481
|
/**
|
1373
1482
|
* Halt a stream with the specified exception
|
@@ -1375,7 +1484,7 @@ function haltNow(u, __tsplusTrace) {
|
|
1375
1484
|
* @tsplus static fncts.io.StreamOps halt
|
1376
1485
|
*/
|
1377
1486
|
function halt_1(u, __tsplusTrace) {
|
1378
|
-
return new
|
1487
|
+
return new _definition4.Stream(tsplus_module_10.halt(u));
|
1379
1488
|
}
|
1380
1489
|
function haltWhenWriter(fiber, __tsplusTrace) {
|
1381
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)));
|
@@ -1394,7 +1503,7 @@ function haltWhenWriter(fiber, __tsplusTrace) {
|
|
1394
1503
|
*/
|
1395
1504
|
function haltWhen(io, __tsplusTrace) {
|
1396
1505
|
return fa => {
|
1397
|
-
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))));
|
1398
1507
|
};
|
1399
1508
|
}
|
1400
1509
|
function haltWhenFutureWriter(future, __tsplusTrace) {
|
@@ -1409,7 +1518,7 @@ function haltWhenFutureWriter(future, __tsplusTrace) {
|
|
1409
1518
|
*/
|
1410
1519
|
function haltWhenFuture(future, __tsplusTrace) {
|
1411
1520
|
return fa => {
|
1412
|
-
return new
|
1521
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(haltWhenFutureWriter(future, __tsplusTrace))(fa.channel));
|
1413
1522
|
};
|
1414
1523
|
}
|
1415
1524
|
/**
|
@@ -1435,7 +1544,7 @@ function interleaveWithProducer(handoff, __tsplusTrace) {
|
|
1435
1544
|
*/
|
1436
1545
|
function interleaveWith_1(sb, b, __tsplusTrace) {
|
1437
1546
|
return sa => {
|
1438
|
-
return new
|
1547
|
+
return new _definition4.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right]) => {
|
1439
1548
|
const process = (leftDone, rightDone) => tsplus_module_10.readWithCause(b => {
|
1440
1549
|
if (b && !leftDone) {
|
1441
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)));
|
@@ -1469,7 +1578,7 @@ function intersperseWriter(middle, isFirst, __tsplusTrace) {
|
|
1469
1578
|
* Intersperse stream with provided element
|
1470
1579
|
*/
|
1471
1580
|
function intersperse(stream, middle, __tsplusTrace) {
|
1472
|
-
return new
|
1581
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(intersperseWriter(middle, true, __tsplusTrace))(stream.channel));
|
1473
1582
|
}
|
1474
1583
|
/**
|
1475
1584
|
* Interrupts the evaluation of this stream when the provided IO completes. The given
|
@@ -1483,7 +1592,7 @@ function intersperse(stream, middle, __tsplusTrace) {
|
|
1483
1592
|
*/
|
1484
1593
|
function interruptWhen(io, __tsplusTrace) {
|
1485
1594
|
return stream => {
|
1486
|
-
return new
|
1595
|
+
return new _definition4.Stream(tsplus_module_56.interruptWhen(io)(stream.channel));
|
1487
1596
|
};
|
1488
1597
|
}
|
1489
1598
|
/**
|
@@ -1491,7 +1600,7 @@ function interruptWhen(io, __tsplusTrace) {
|
|
1491
1600
|
*/
|
1492
1601
|
function interruptWhenFuture(future, __tsplusTrace) {
|
1493
1602
|
return fa => {
|
1494
|
-
return new
|
1603
|
+
return new _definition4.Stream(tsplus_module_56.interruptWhenFuture(future)(fa.channel));
|
1495
1604
|
};
|
1496
1605
|
}
|
1497
1606
|
/**
|
@@ -1501,7 +1610,7 @@ function interruptWhenFuture(future, __tsplusTrace) {
|
|
1501
1610
|
*/
|
1502
1611
|
function map_1(f, __tsplusTrace) {
|
1503
1612
|
return stream => {
|
1504
|
-
return new
|
1613
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(as => tsplus_module_12.map(f)(as))(stream.channel));
|
1505
1614
|
};
|
1506
1615
|
}
|
1507
1616
|
function mapAccumAccumulator(currS, f, __tsplusTrace) {
|
@@ -1517,7 +1626,7 @@ function mapAccumAccumulator(currS, f, __tsplusTrace) {
|
|
1517
1626
|
*/
|
1518
1627
|
function mapAccum_1(s, f, __tsplusTrace) {
|
1519
1628
|
return stream => {
|
1520
|
-
return new
|
1629
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(mapAccumAccumulator(s, f, __tsplusTrace))(stream.channel));
|
1521
1630
|
};
|
1522
1631
|
}
|
1523
1632
|
function mapAccumIOAccumulator(s, f, __tsplusTrace) {
|
@@ -1540,7 +1649,7 @@ function mapAccumIOAccumulator(s, f, __tsplusTrace) {
|
|
1540
1649
|
*/
|
1541
1650
|
function mapAccumIO_1(s, f, __tsplusTrace) {
|
1542
1651
|
return stream => {
|
1543
|
-
return new
|
1652
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(mapAccumIOAccumulator(s, f, __tsplusTrace))(stream.channel));
|
1544
1653
|
};
|
1545
1654
|
}
|
1546
1655
|
/**
|
@@ -1550,7 +1659,7 @@ function mapAccumIO_1(s, f, __tsplusTrace) {
|
|
1550
1659
|
*/
|
1551
1660
|
function mapChunks_1(f, __tsplusTrace) {
|
1552
1661
|
return stream => {
|
1553
|
-
return new
|
1662
|
+
return new _definition4.Stream(tsplus_module_10.mapOut(f)(stream.channel));
|
1554
1663
|
};
|
1555
1664
|
}
|
1556
1665
|
/**
|
@@ -1560,7 +1669,7 @@ function mapChunks_1(f, __tsplusTrace) {
|
|
1560
1669
|
*/
|
1561
1670
|
function mapChunksIO(f, __tsplusTrace) {
|
1562
1671
|
return stream => {
|
1563
|
-
return new
|
1672
|
+
return new _definition4.Stream(tsplus_module_10.mapOutIO(f)(stream.channel));
|
1564
1673
|
};
|
1565
1674
|
}
|
1566
1675
|
/**
|
@@ -1614,7 +1723,7 @@ function mapConcatIO(f, __tsplusTrace) {
|
|
1614
1723
|
*/
|
1615
1724
|
function mapError_1(f, __tsplusTrace) {
|
1616
1725
|
return stream => {
|
1617
|
-
return new
|
1726
|
+
return new _definition4.Stream(tsplus_module_10.mapError(f)(stream.channel));
|
1618
1727
|
};
|
1619
1728
|
}
|
1620
1729
|
/**
|
@@ -1624,7 +1733,7 @@ function mapError_1(f, __tsplusTrace) {
|
|
1624
1733
|
*/
|
1625
1734
|
function mapErrorCause(f, __tsplusTrace) {
|
1626
1735
|
return fa => {
|
1627
|
-
return new
|
1736
|
+
return new _definition4.Stream(tsplus_module_10.mapErrorCause(f)(fa.channel));
|
1628
1737
|
};
|
1629
1738
|
}
|
1630
1739
|
/**
|
@@ -1634,7 +1743,7 @@ function mapErrorCause(f, __tsplusTrace) {
|
|
1634
1743
|
*/
|
1635
1744
|
function mapIO_1(f, __tsplusTrace) {
|
1636
1745
|
return stream => {
|
1637
|
-
return new
|
1746
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(mapIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(stream.channel));
|
1638
1747
|
};
|
1639
1748
|
}
|
1640
1749
|
function mapIOLoop(iterator, f, __tsplusTrace) {
|
@@ -1652,11 +1761,87 @@ function mapIOLoop(iterator, f, __tsplusTrace) {
|
|
1652
1761
|
*
|
1653
1762
|
* @note This combinator destroys the chunking structure. It's recommended to use chunkN afterwards.
|
1654
1763
|
*
|
1655
|
-
* @tsplus pipeable fncts.io.Stream
|
1764
|
+
* @tsplus pipeable fncts.io.Stream mapIOConcurrently
|
1656
1765
|
*/
|
1657
|
-
function
|
1766
|
+
function mapIOConcurrently(n, f, __tsplusTrace) {
|
1658
1767
|
return stream => {
|
1659
|
-
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))));
|
1769
|
+
};
|
1770
|
+
}
|
1771
|
+
/**
|
1772
|
+
* @tsplus pipeable fncts.io.Stream mapIOConcurrentlyUnordered
|
1773
|
+
*/
|
1774
|
+
function mapIOConcurrentlyUnordered(n, f) {
|
1775
|
+
return self => {
|
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));
|
1660
1845
|
};
|
1661
1846
|
}
|
1662
1847
|
/**
|
@@ -1669,7 +1854,7 @@ function mapIOC(n, f, __tsplusTrace) {
|
|
1669
1854
|
*/
|
1670
1855
|
function mergeMap_1(f, n, bufferSize = 16, __tsplusTrace) {
|
1671
1856
|
return ma => {
|
1672
|
-
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)));
|
1673
1858
|
};
|
1674
1859
|
}
|
1675
1860
|
/**
|
@@ -1693,14 +1878,14 @@ function mergeEither_1(fb, __tsplusTrace) {
|
|
1693
1878
|
};
|
1694
1879
|
}
|
1695
1880
|
function mergeWithHandler(terminate, __tsplusTrace) {
|
1696
|
-
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);
|
1697
1882
|
}
|
1698
1883
|
/**
|
1699
1884
|
* @tsplus pipeable fncts.io.Stream mergeWith
|
1700
1885
|
*/
|
1701
1886
|
function mergeWith_1(sb, l, r, strategy = "Both", __tsplusTrace) {
|
1702
1887
|
return sa => {
|
1703
|
-
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));
|
1704
1889
|
};
|
1705
1890
|
}
|
1706
1891
|
/**
|
@@ -1724,7 +1909,7 @@ function onError(cleanup, __tsplusTrace) {
|
|
1724
1909
|
*/
|
1725
1910
|
function orElse_1(that, __tsplusTrace) {
|
1726
1911
|
return stream => {
|
1727
|
-
return new
|
1912
|
+
return new _definition4.Stream(tsplus_module_10.orElse(that().channel)(stream.channel));
|
1728
1913
|
};
|
1729
1914
|
}
|
1730
1915
|
/**
|
@@ -1757,7 +1942,7 @@ function orElseFail(e, __tsplusTrace) {
|
|
1757
1942
|
* See also Stream#catchAll.
|
1758
1943
|
*/
|
1759
1944
|
function orElseOptional(stream, that, __tsplusTrace) {
|
1760
|
-
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);
|
1761
1946
|
}
|
1762
1947
|
/**
|
1763
1948
|
* Succeeds with the specified value if this one fails with a typed error.
|
@@ -1774,7 +1959,15 @@ function orElseSucceed(a, __tsplusTrace) {
|
|
1774
1959
|
*/
|
1775
1960
|
function pipeThrough_1(sa, __tsplusTrace) {
|
1776
1961
|
return ma => {
|
1777
|
-
return new
|
1962
|
+
return new _definition4.Stream(tsplus_module_10.pipeToOrFail(sa.channel)(ma.channel));
|
1963
|
+
};
|
1964
|
+
}
|
1965
|
+
/**
|
1966
|
+
* @tsplus pipeable fncts.io.Stream pipeThroughChannelOrFail
|
1967
|
+
*/
|
1968
|
+
function pipeThroughChannelOrFail_1(channel) {
|
1969
|
+
return self => {
|
1970
|
+
return new _definition4.Stream(tsplus_module_10.pipeToOrFail(channel)(self.channel));
|
1778
1971
|
};
|
1779
1972
|
}
|
1780
1973
|
/**
|
@@ -1785,7 +1978,7 @@ function pipeThrough_1(sa, __tsplusTrace) {
|
|
1785
1978
|
*/
|
1786
1979
|
function provideEnvironment_1(r, __tsplusTrace) {
|
1787
1980
|
return ra => {
|
1788
|
-
return new
|
1981
|
+
return new _definition4.Stream(tsplus_module_10.provideEnvironment(() => r)(ra.channel));
|
1789
1982
|
};
|
1790
1983
|
}
|
1791
1984
|
/**
|
@@ -1793,7 +1986,7 @@ function provideEnvironment_1(r, __tsplusTrace) {
|
|
1793
1986
|
*/
|
1794
1987
|
function provideLayer_1(layer, __tsplusTrace) {
|
1795
1988
|
return self => {
|
1796
|
-
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))));
|
1797
1990
|
};
|
1798
1991
|
}
|
1799
1992
|
/**
|
@@ -1802,7 +1995,7 @@ function provideLayer_1(layer, __tsplusTrace) {
|
|
1802
1995
|
function provideSomeLayer(layer, __tsplusTrace) {
|
1803
1996
|
return self => {
|
1804
1997
|
// @ts-expect-error
|
1805
|
-
return provideLayer_1(
|
1998
|
+
return provideLayer_1(tsplus_module_62.and(layer, __tsplusTrace)(tsplus_module_62.environment(__tsplusTrace)), __tsplusTrace)(self);
|
1806
1999
|
};
|
1807
2000
|
}
|
1808
2001
|
class Rechunker {
|
@@ -1866,7 +2059,7 @@ function rechunkProcess(rechunker, target, __tsplusTrace) {
|
|
1866
2059
|
*/
|
1867
2060
|
function rechunk(n, __tsplusTrace) {
|
1868
2061
|
return stream => {
|
1869
|
-
return new
|
2062
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(rechunkProcess(new Rechunker(n), n, __tsplusTrace))(stream.channel));
|
1870
2063
|
};
|
1871
2064
|
}
|
1872
2065
|
/**
|
@@ -1875,7 +2068,7 @@ function rechunk(n, __tsplusTrace) {
|
|
1875
2068
|
* @tsplus static fncts.io.StreamOps repeatValue
|
1876
2069
|
*/
|
1877
2070
|
function repeatValue(a, __tsplusTrace) {
|
1878
|
-
return new
|
2071
|
+
return new _definition4.Stream(tsplus_module_10.repeated(tsplus_module_10.writeNow(tsplus_module_19.single(a))));
|
1879
2072
|
}
|
1880
2073
|
/**
|
1881
2074
|
* Creates a stream from an effect producing a value of type `A` which repeats forever.
|
@@ -1907,7 +2100,7 @@ function repeatIOChunk(fa, __tsplusTrace) {
|
|
1907
2100
|
* @tsplus static fncts.io.StreamOps repeatIOChunkMaybe
|
1908
2101
|
*/
|
1909
2102
|
function repeatIOChunkMaybe_1(fa, __tsplusTrace) {
|
1910
|
-
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);
|
1911
2104
|
}
|
1912
2105
|
/**
|
1913
2106
|
* Runs the sink on the stream to produce either the sink's result or an error.
|
@@ -1916,7 +2109,7 @@ function repeatIOChunkMaybe_1(fa, __tsplusTrace) {
|
|
1916
2109
|
*/
|
1917
2110
|
function run_1(sink, __tsplusTrace) {
|
1918
2111
|
return stream => {
|
1919
|
-
return
|
2112
|
+
return tsplus_module_63.runDrain(tsplus_module_10.pipeToOrFail(sink.channel)(stream.channel));
|
1920
2113
|
};
|
1921
2114
|
}
|
1922
2115
|
/**
|
@@ -1949,9 +2142,9 @@ function runForeachScoped_1(f, __tsplusTrace) {
|
|
1949
2142
|
*
|
1950
2143
|
* @tsplus pipeable fncts.io.Stream runIntoElementsScoped
|
1951
2144
|
*/
|
1952
|
-
function
|
2145
|
+
function runIntoElementsScoped_(queue, __tsplusTrace) {
|
1953
2146
|
return stream => {
|
1954
|
-
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)));
|
1955
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);
|
1956
2149
|
};
|
1957
2150
|
}
|
@@ -1967,6 +2160,21 @@ function runIntoQueueScoped_1(queue, __tsplusTrace) {
|
|
1967
2160
|
return tsplus_module_1.asUnit(tsplus_module_16.runScoped(tsplus_module_10.drain(tsplus_module_10.mapOutIO(take => tsplus_module_28.offer(take, __tsplusTrace)(queue))(tsplus_module_10.pipeTo(writer)(stream.channel)))), __tsplusTrace);
|
1968
2161
|
};
|
1969
2162
|
}
|
2163
|
+
/**
|
2164
|
+
* Like runIntoQueue, but provides the result as a scoped IO
|
2165
|
+
* to allow for scope composition.
|
2166
|
+
*
|
2167
|
+
* @tsplus pipeable fncts.io.Stream runIntoQueueElementsScoped
|
2168
|
+
*/
|
2169
|
+
function runIntoQueueElementsScoped_1(queue) {
|
2170
|
+
return self => {
|
2171
|
+
return tsplus_module_1.defer(() => {
|
2172
|
+
const queue0 = queue();
|
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");
|
2176
|
+
};
|
2177
|
+
}
|
1970
2178
|
/**
|
1971
2179
|
* Like `Stream#runIntoHub`, but provides the result as a `Managed` to allow for scope
|
1972
2180
|
* composition.
|
@@ -2029,7 +2237,34 @@ function scanReduce(f, __tsplusTrace) {
|
|
2029
2237
|
*/
|
2030
2238
|
function scanReduceIO_1(f, __tsplusTrace) {
|
2031
2239
|
return fa => {
|
2032
|
-
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));
|
2033
2268
|
};
|
2034
2269
|
}
|
2035
2270
|
/**
|
@@ -2070,9 +2305,9 @@ function take(n, __tsplusTrace) {
|
|
2070
2305
|
return empty_1;
|
2071
2306
|
}
|
2072
2307
|
if (!Number.isInteger(n)) {
|
2073
|
-
return halt_1(() => new
|
2308
|
+
return halt_1(() => new tsplus_module_65.IllegalArgumentError(`${n} should be an integer`, "Stream.take"), __tsplusTrace);
|
2074
2309
|
}
|
2075
|
-
return new
|
2310
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(takeLoop(n, __tsplusTrace))(stream.channel));
|
2076
2311
|
};
|
2077
2312
|
}
|
2078
2313
|
/**
|
@@ -2080,7 +2315,7 @@ function take(n, __tsplusTrace) {
|
|
2080
2315
|
*/
|
2081
2316
|
function takeUntilIO(f, __tsplusTrace) {
|
2082
2317
|
return ma => {
|
2083
|
-
return new
|
2318
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(takeUntilIOLoop(tsplus_module_40.empty()[Symbol.iterator](), f, __tsplusTrace))(ma.channel));
|
2084
2319
|
};
|
2085
2320
|
}
|
2086
2321
|
function takeUntilIOLoop(iterator, f, __tsplusTrace) {
|
@@ -2110,17 +2345,64 @@ function takeUntilLoop(p, __tsplusTrace) {
|
|
2110
2345
|
*/
|
2111
2346
|
function takeUntil(p, __tsplusTrace) {
|
2112
2347
|
return fa => {
|
2113
|
-
return new
|
2348
|
+
return new _definition4.Stream(tsplus_module_10.pipeTo(takeUntilLoop(p, __tsplusTrace))(fa.channel));
|
2114
2349
|
};
|
2115
2350
|
}
|
2116
2351
|
/**
|
2117
2352
|
* @tsplus pipeable fncts.io.Stream tap
|
2118
2353
|
*/
|
2119
|
-
function
|
2354
|
+
function tap_1(f, __tsplusTrace) {
|
2120
2355
|
return ma => {
|
2121
2356
|
return mapIO_1(a => tsplus_module_1.as(() => a, __tsplusTrace)(f(a)), __tsplusTrace)(ma);
|
2122
2357
|
};
|
2123
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
|
+
}
|
2124
2406
|
/**
|
2125
2407
|
* Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket
|
2126
2408
|
* algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate
|
@@ -2156,7 +2438,7 @@ function throttleEnforceIOLoop(costFn, units, duration, burst, tokens, timestamp
|
|
2156
2438
|
*/
|
2157
2439
|
function throttleEnforceIO_1(costFn, units, duration, burst = 0, __tsplusTrace) {
|
2158
2440
|
return sa => {
|
2159
|
-
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)));
|
2160
2442
|
};
|
2161
2443
|
}
|
2162
2444
|
/**
|
@@ -2176,7 +2458,7 @@ function toHub_1(capacity, __tsplusTrace) {
|
|
2176
2458
|
* @tsplus getter fncts.io.Stream toPull
|
2177
2459
|
*/
|
2178
2460
|
function toPull_1(stream, __tsplusTrace) {
|
2179
|
-
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));
|
2180
2462
|
}
|
2181
2463
|
/**
|
2182
2464
|
* Converts the stream to a managed queue of chunks. After the managed queue is used,
|
@@ -2202,7 +2484,7 @@ function toQueueDropping(capacity = 2, __tsplusTrace) {
|
|
2202
2484
|
*/
|
2203
2485
|
function toQueueOfElements_1(capacity = 2, __tsplusTrace) {
|
2204
2486
|
return stream => {
|
2205
|
-
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(
|
2487
|
+
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(tsplus_module_17.forkScoped(runIntoQueueElementsScoped_1(() => queue)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_31.acquireRelease(() => tsplus_module_30.makeBounded(capacity, __tsplusTrace), _ => tsplus_module_28.shutdown(_, __tsplusTrace), __tsplusTrace));
|
2206
2488
|
};
|
2207
2489
|
}
|
2208
2490
|
/**
|
@@ -2231,7 +2513,7 @@ function unfoldChunkIOLoop(s, f, __tsplusTrace) {
|
|
2231
2513
|
* @tsplus static fncts.io.StreamOps unfoldChunkIO
|
2232
2514
|
*/
|
2233
2515
|
function unfoldChunkIO_1(s, f, __tsplusTrace) {
|
2234
|
-
return new
|
2516
|
+
return new _definition4.Stream(unfoldChunkIOLoop(s, f, __tsplusTrace));
|
2235
2517
|
}
|
2236
2518
|
/**
|
2237
2519
|
* Creates a stream by effectfully peeling off the "layers" of a value of type `S`
|
@@ -2248,7 +2530,7 @@ function unfoldChunkLoop(s, f, __tsplusTrace) {
|
|
2248
2530
|
* @tsplus static fncts.io.StreamOps unfoldChunk
|
2249
2531
|
*/
|
2250
2532
|
function unfoldChunk_1(s, f, __tsplusTrace) {
|
2251
|
-
return new
|
2533
|
+
return new _definition4.Stream(tsplus_module_10.defer(() => unfoldChunkLoop(s, f, __tsplusTrace)));
|
2252
2534
|
}
|
2253
2535
|
/**
|
2254
2536
|
* @tsplus static fncts.io.StreamOps unfold
|