@fncts/io 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cached/api.d.ts +2 -2
- package/Channel/ChildExecutorDecision/api.d.ts +2 -2
- package/Channel/UpstreamPullRequest/api.d.ts +2 -2
- package/Channel/api/interruptWhen.d.ts +5 -5
- package/Channel/api/mapOutIOC.d.ts +3 -3
- package/Channel/api/mergeAll.d.ts +2 -2
- package/Channel/api/mergeAllUnboundedWith.d.ts +2 -2
- package/Channel/api/mergeAllWith.d.ts +2 -2
- package/Channel/api/mergeMap.d.ts +2 -2
- package/Channel/api/mergeWith.d.ts +2 -2
- package/Channel/api/zipC.d.ts +6 -6
- package/Channel/api.d.ts +64 -64
- package/Channel/core-api.d.ts +11 -11
- package/Channel/definition.d.ts +35 -21
- package/Fiber/api/evalOn.d.ts +3 -3
- package/Fiber/api/evalOnIO.d.ts +3 -3
- package/Fiber/api/interruptAs.d.ts +3 -3
- package/Fiber/api/interruptAsFork.d.ts +3 -3
- package/Fiber/api/mapFiber.d.ts +2 -2
- package/Fiber/api/mapIO.d.ts +5 -5
- package/Fiber/api/zipWith.d.ts +2 -2
- package/Fiber.d.ts +1 -0
- package/FiberRef/api/locallyScoped.d.ts +2 -2
- package/FiberRef/api/locallyScopedWith.d.ts +2 -2
- package/FiberRef/api.d.ts +18 -18
- package/FiberRefs/api.d.ts +2 -2
- package/FiberRefs/join.d.ts +3 -3
- package/Future/api.d.ts +21 -21
- package/Hub/constructors.d.ts +49 -0
- package/Hub/definition.d.ts +37 -81
- package/Hub/internal.d.ts +4 -11
- package/Hub.d.ts +1 -1
- package/IO/api/acquireRelease.d.ts +1 -1
- package/IO/api/acquireReleaseExit.d.ts +1 -1
- package/IO/api/bracket.d.ts +1 -1
- package/IO/api/bracketExit.d.ts +1 -1
- package/IO/api/concurrency.d.ts +2 -2
- package/IO/api/core-scope.d.ts +5 -5
- package/IO/api/ensuringChildren.d.ts +3 -3
- package/IO/api/environment.d.ts +11 -15
- package/IO/api/foreachC.d.ts +2 -2
- package/IO/api/foreachExec.d.ts +1 -1
- package/IO/api/forkIn.d.ts +3 -3
- package/IO/api/fulfill.d.ts +3 -3
- package/IO/api/interrupt.d.ts +6 -6
- package/IO/api/onExit.d.ts +3 -3
- package/IO/api/onTermination.d.ts +4 -4
- package/IO/api/provideLayer.d.ts +3 -3
- package/IO/api/provideSomeLayer.d.ts +3 -7
- package/IO/api/race.d.ts +2 -2
- package/IO/api/raceFirst.d.ts +2 -2
- package/IO/api/repeat.d.ts +3 -3
- package/IO/api/retry.d.ts +7 -7
- package/IO/api/schedule.d.ts +5 -5
- package/IO/api/scoped.d.ts +2 -2
- package/IO/api/supervised.d.ts +3 -3
- package/IO/api/timeout.d.ts +5 -5
- package/IO/api/withFinalizer.d.ts +3 -3
- package/IO/api/withFinalizerExit.d.ts +3 -3
- package/IO/api/withRuntimeConfig.d.ts +3 -3
- package/IO/api/zipC.d.ts +4 -4
- package/IO/api.d.ts +179 -176
- package/IO/definition.d.ts +15 -9
- package/Layer/MemoMap.d.ts +4 -4
- package/Layer/api.d.ts +28 -28
- package/LogLevel.d.ts +12 -12
- package/LogSpan.d.ts +2 -2
- package/Logger/api.d.ts +5 -5
- package/Queue/constructors.d.ts +2 -1
- package/Queue/definition.d.ts +91 -82
- package/Queue/internal.d.ts +7 -9
- package/Queue.d.ts +0 -2
- package/Ref/Atomic.d.ts +15 -2
- package/Ref/Synchronized.d.ts +72 -0
- package/Ref/constructors.d.ts +7 -0
- package/Ref/definition.d.ts +60 -58
- package/Ref.d.ts +1 -6
- package/STM/api/core-api.d.ts +10 -10
- package/STM/api.d.ts +61 -61
- package/STM/internal/Journal.d.ts +4 -4
- package/Schedule/Decision.d.ts +2 -2
- package/Schedule/api.d.ts +94 -94
- package/Scope/ReleaseMap/api/releaseAll.d.ts +2 -2
- package/Scope/ReleaseMap/api.d.ts +10 -10
- package/Scope/api.d.ts +8 -8
- package/Sink/api.d.ts +68 -68
- package/State/api.d.ts +4 -4
- package/State/internal.d.ts +1 -1
- package/Stream/api/zipAllWith.d.ts +2 -2
- package/Stream/api/zipWith.d.ts +2 -2
- package/Stream/api/zipWithChunks.d.ts +2 -2
- package/Stream/api.d.ts +216 -205
- package/Stream/internal/DebounceState.d.ts +3 -3
- package/Stream/internal/Handoff.d.ts +5 -5
- package/Stream/internal/Pull.d.ts +2 -2
- package/Stream/internal/SinkEndReason.d.ts +3 -3
- package/Stream/internal/Take.d.ts +8 -8
- package/SubscriptionRef.d.ts +29 -0
- package/Supervisor/api.d.ts +4 -4
- package/SupervisorPatch.d.ts +4 -4
- package/TFuture/api.d.ts +7 -7
- package/TReentrantLock/api.d.ts +4 -4
- package/TRef/api.d.ts +24 -24
- package/TSemaphore/api.d.ts +4 -4
- package/TSemaphore/constructors.d.ts +6 -0
- package/_cjs/Cached/api.cjs +9 -9
- package/_cjs/Cached/api.cjs.map +1 -1
- package/_cjs/Channel/ChildExecutorDecision/api.cjs +19 -17
- package/_cjs/Channel/ChildExecutorDecision/api.cjs.map +1 -1
- package/_cjs/Channel/UpstreamPullRequest/api.cjs +16 -14
- package/_cjs/Channel/UpstreamPullRequest/api.cjs.map +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs +14 -10
- package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
- package/_cjs/Channel/api/mapOutIOC.cjs +25 -25
- package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAll.cjs +6 -4
- package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +6 -4
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +48 -52
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeMap.cjs +6 -4
- package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +48 -46
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api/run.cjs +1 -1
- package/_cjs/Channel/api/run.cjs.map +1 -1
- package/_cjs/Channel/api/runScoped.cjs +2 -2
- 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/zipC.cjs +20 -14
- package/_cjs/Channel/api/zipC.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +264 -218
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/core-api.cjs +34 -24
- package/_cjs/Channel/core-api.cjs.map +1 -1
- package/_cjs/Channel/definition.cjs +1 -1
- package/_cjs/Channel/definition.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelExecutor.cjs +83 -83
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +22 -24
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/Differ/api.cjs +5 -5
- package/_cjs/Differ/api.cjs.map +1 -1
- package/_cjs/Fiber/FiberContext.cjs +48 -48
- package/_cjs/Fiber/FiberContext.cjs.map +1 -1
- package/_cjs/Fiber/api/awaitAll.cjs +1 -1
- package/_cjs/Fiber/api/awaitAll.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/evalOn.cjs +12 -10
- package/_cjs/Fiber/api/evalOn.cjs.map +1 -1
- package/_cjs/Fiber/api/evalOnIO.cjs +6 -4
- package/_cjs/Fiber/api/evalOnIO.cjs.map +1 -1
- package/_cjs/Fiber/api/fromIO.cjs +1 -1
- package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
- package/_cjs/Fiber/api/interrupt.cjs +1 -1
- package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAll.cjs +2 -2
- package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAs.cjs +6 -4
- package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAsFork.cjs +6 -4
- package/_cjs/Fiber/api/interruptAsFork.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptFork.cjs +1 -1
- package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
- package/_cjs/Fiber/api/join.cjs +1 -1
- package/_cjs/Fiber/api/join.cjs.map +1 -1
- package/_cjs/Fiber/api/joinAll.cjs +1 -1
- package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
- package/_cjs/Fiber/api/mapFiber.cjs +6 -4
- package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
- package/_cjs/Fiber/api/mapIO.cjs +14 -10
- package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
- package/_cjs/Fiber/api/zipWith.cjs +6 -4
- package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
- package/_cjs/Fiber/definition.cjs.map +1 -1
- package/_cjs/Fiber.cjs +13 -0
- package/_cjs/Fiber.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScoped.cjs +6 -4
- package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScopedWith.cjs +5 -3
- package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
- package/_cjs/FiberRef/api.cjs +64 -47
- package/_cjs/FiberRef/api.cjs.map +1 -1
- package/_cjs/FiberRef/constructors.cjs +1 -1
- package/_cjs/FiberRef/constructors.cjs.map +1 -1
- package/_cjs/FiberRef.cjs.map +1 -1
- package/_cjs/FiberRefs/api.cjs +15 -13
- package/_cjs/FiberRefs/api.cjs.map +1 -1
- package/_cjs/FiberRefs/join.cjs +37 -35
- package/_cjs/FiberRefs/join.cjs.map +1 -1
- package/_cjs/FiberState/definition.cjs.map +1 -1
- package/_cjs/Future/api.cjs +97 -79
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Future/constructors.cjs +1 -1
- package/_cjs/Future/constructors.cjs.map +1 -1
- package/_cjs/Hub/constructors.cjs +93 -0
- package/_cjs/Hub/constructors.cjs.map +1 -0
- package/_cjs/Hub/definition.cjs +104 -13
- package/_cjs/Hub/definition.cjs.map +1 -1
- package/_cjs/Hub/internal.cjs +104 -129
- package/_cjs/Hub/internal.cjs.map +1 -1
- package/_cjs/Hub.cjs +4 -4
- package/_cjs/IO/api/acquireReleaseExit.cjs +1 -1
- package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
- package/_cjs/IO/api/addFinalizerExit.cjs +1 -1
- package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/asyncIO.cjs +4 -4
- package/_cjs/IO/api/asyncIO.cjs.map +1 -1
- package/_cjs/IO/api/bracket.cjs +3 -3
- package/_cjs/IO/api/bracket.cjs.map +1 -1
- package/_cjs/IO/api/bracketExit.cjs +3 -3
- package/_cjs/IO/api/bracketExit.cjs.map +1 -1
- package/_cjs/IO/api/clockWith.cjs +2 -2
- package/_cjs/IO/api/clockWith.cjs.map +1 -1
- package/_cjs/IO/api/concurrency.cjs +9 -7
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/concurrentFinalizers.cjs +1 -1
- package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
- package/_cjs/IO/api/consoleWith.cjs +2 -2
- package/_cjs/IO/api/consoleWith.cjs.map +1 -1
- package/_cjs/IO/api/core-scope.cjs +45 -41
- package/_cjs/IO/api/core-scope.cjs.map +1 -1
- package/_cjs/IO/api/ensuringChildren.cjs +5 -3
- package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
- package/_cjs/IO/api/environment.cjs +35 -35
- package/_cjs/IO/api/environment.cjs.map +1 -1
- package/_cjs/IO/api/foreachC.cjs +19 -23
- package/_cjs/IO/api/foreachC.cjs.map +1 -1
- package/_cjs/IO/api/foreachExec.cjs +3 -3
- package/_cjs/IO/api/foreachExec.cjs.map +1 -1
- package/_cjs/IO/api/forkAll.cjs +1 -1
- package/_cjs/IO/api/forkAll.cjs.map +1 -1
- package/_cjs/IO/api/forkIn.cjs +8 -6
- package/_cjs/IO/api/forkIn.cjs.map +1 -1
- package/_cjs/IO/api/forkScoped.cjs +1 -1
- package/_cjs/IO/api/forkScoped.cjs.map +1 -1
- package/_cjs/IO/api/fulfill.cjs +8 -6
- package/_cjs/IO/api/fulfill.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +36 -30
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/memoize.cjs +1 -1
- package/_cjs/IO/api/memoize.cjs.map +1 -1
- package/_cjs/IO/api/onExit.cjs +6 -4
- package/_cjs/IO/api/onExit.cjs.map +1 -1
- package/_cjs/IO/api/onTermination.cjs +5 -3
- package/_cjs/IO/api/onTermination.cjs.map +1 -1
- package/_cjs/IO/api/once.cjs +3 -5
- package/_cjs/IO/api/once.cjs.map +1 -1
- package/_cjs/IO/api/provideLayer.cjs +6 -4
- package/_cjs/IO/api/provideLayer.cjs.map +1 -1
- package/_cjs/IO/api/provideSomeLayer.cjs +5 -15
- package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
- package/_cjs/IO/api/race.cjs +6 -4
- package/_cjs/IO/api/race.cjs.map +1 -1
- package/_cjs/IO/api/raceFirst.cjs +6 -4
- package/_cjs/IO/api/raceFirst.cjs.map +1 -1
- package/_cjs/IO/api/randomWith.cjs +1 -1
- package/_cjs/IO/api/randomWith.cjs.map +1 -1
- package/_cjs/IO/api/repeat.cjs +12 -12
- package/_cjs/IO/api/repeat.cjs.map +1 -1
- package/_cjs/IO/api/retry.cjs +14 -14
- package/_cjs/IO/api/retry.cjs.map +1 -1
- package/_cjs/IO/api/schedule.cjs +15 -11
- package/_cjs/IO/api/schedule.cjs.map +1 -1
- package/_cjs/IO/api/scoped.cjs +6 -6
- package/_cjs/IO/api/scoped.cjs.map +1 -1
- package/_cjs/IO/api/sequenceT.cjs +1 -1
- package/_cjs/IO/api/sequenceT.cjs.map +1 -1
- package/_cjs/IO/api/stateful.cjs.map +1 -1
- package/_cjs/IO/api/supervised.cjs +6 -4
- package/_cjs/IO/api/supervised.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +10 -6
- package/_cjs/IO/api/timeout.cjs.map +1 -1
- package/_cjs/IO/api/withChildren.cjs +1 -1
- 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/withFinalizer.cjs +6 -4
- package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizerExit.cjs +6 -4
- package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/withRuntimeConfig.cjs +6 -4
- package/_cjs/IO/api/withRuntimeConfig.cjs.map +1 -1
- package/_cjs/IO/api/zipC.cjs +21 -17
- package/_cjs/IO/api/zipC.cjs.map +1 -1
- package/_cjs/IO/api.cjs +634 -509
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +7 -7
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/IOEnv/definition.cjs +1 -1
- package/_cjs/IOEnv/definition.cjs.map +1 -1
- package/_cjs/IOEnv/live.cjs +1 -1
- package/_cjs/IOEnv/live.cjs.map +1 -1
- package/_cjs/Layer/MemoMap.cjs +86 -92
- package/_cjs/Layer/MemoMap.cjs.map +1 -1
- package/_cjs/Layer/api.cjs +110 -81
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Layer/definition.cjs.map +1 -1
- package/_cjs/LogLevel.cjs +24 -16
- package/_cjs/LogLevel.cjs.map +1 -1
- package/_cjs/LogSpan.cjs +18 -16
- package/_cjs/LogSpan.cjs.map +1 -1
- package/_cjs/Logger/api.cjs +18 -14
- package/_cjs/Logger/api.cjs.map +1 -1
- package/_cjs/Logger/constructors.cjs +1 -1
- package/_cjs/Logger/constructors.cjs.map +1 -1
- package/_cjs/Queue/constructors.cjs +19 -5
- package/_cjs/Queue/constructors.cjs.map +1 -1
- package/_cjs/Queue/definition.cjs +191 -16
- package/_cjs/Queue/definition.cjs.map +1 -1
- package/_cjs/Queue/internal.cjs +27 -181
- package/_cjs/Queue/internal.cjs.map +1 -1
- package/_cjs/Queue/strategy.cjs +19 -19
- package/_cjs/Queue/strategy.cjs.map +1 -1
- package/_cjs/Queue.cjs +0 -26
- package/_cjs/Queue.cjs.map +1 -1
- package/_cjs/Random/live.cjs +2 -2
- package/_cjs/Random/live.cjs.map +1 -1
- package/_cjs/Ref/Atomic.cjs +47 -24
- package/_cjs/Ref/Atomic.cjs.map +1 -1
- package/_cjs/Ref/Synchronized.cjs +140 -0
- package/_cjs/Ref/Synchronized.cjs.map +1 -0
- package/_cjs/Ref/constructors.cjs +21 -2
- package/_cjs/Ref/constructors.cjs.map +1 -1
- package/_cjs/Ref/definition.cjs +105 -10
- package/_cjs/Ref/definition.cjs.map +1 -1
- package/_cjs/Ref.cjs +4 -69
- package/_cjs/Ref.cjs.map +1 -1
- package/_cjs/Reloadable/constructors.cjs +10 -10
- package/_cjs/Reloadable/constructors.cjs.map +1 -1
- package/_cjs/RuntimeConfig.cjs +2 -2
- package/_cjs/RuntimeConfig.cjs.map +1 -1
- package/_cjs/STM/api/core-api.cjs +36 -26
- package/_cjs/STM/api/core-api.cjs.map +1 -1
- package/_cjs/STM/api.cjs +217 -163
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/STM/driver.cjs +3 -3
- package/_cjs/STM/driver.cjs.map +1 -1
- package/_cjs/STM/internal/Entry.cjs.map +1 -1
- package/_cjs/STM/internal/Journal.cjs +33 -29
- package/_cjs/STM/internal/Journal.cjs.map +1 -1
- package/_cjs/STM.cjs.map +1 -1
- package/_cjs/Schedule/Decision.cjs +16 -14
- package/_cjs/Schedule/Decision.cjs.map +1 -1
- package/_cjs/Schedule/api/driver.cjs +16 -20
- package/_cjs/Schedule/api/driver.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +381 -290
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +14 -14
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api.cjs +68 -61
- package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
- package/_cjs/Scope/api.cjs +34 -27
- package/_cjs/Scope/api.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +9 -13
- package/_cjs/ScopedRef/api.cjs.map +1 -1
- package/_cjs/ScopedRef/definition.cjs +1 -1
- package/_cjs/ScopedRef/definition.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +307 -249
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/State/api.cjs +18 -14
- package/_cjs/State/api.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +15 -13
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWith.cjs +6 -4
- package/_cjs/Stream/api/zipWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +13 -11
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
- package/_cjs/Stream/api.cjs +992 -788
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/definition.cjs.map +1 -1
- package/_cjs/Stream/internal/DebounceState.cjs +21 -19
- package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs +35 -33
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
- package/_cjs/Stream/internal/Pull.cjs +9 -11
- package/_cjs/Stream/internal/Pull.cjs.map +1 -1
- package/_cjs/Stream/internal/SinkEndReason.cjs +16 -14
- package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
- package/_cjs/Stream/internal/Take.cjs +32 -24
- package/_cjs/Stream/internal/Take.cjs.map +1 -1
- package/_cjs/Stream/internal/util.cjs +3 -3
- package/_cjs/Stream/internal/util.cjs.map +1 -1
- package/_cjs/SubscriptionRef.cjs +68 -0
- package/_cjs/SubscriptionRef.cjs.map +1 -0
- package/_cjs/Supervisor/api.cjs +24 -20
- package/_cjs/Supervisor/api.cjs.map +1 -1
- package/_cjs/Supervisor/constructors.cjs +2 -2
- package/_cjs/Supervisor/constructors.cjs.map +1 -1
- package/_cjs/Supervisor/definition.cjs +1 -1
- package/_cjs/Supervisor/definition.cjs.map +1 -1
- package/_cjs/SupervisorPatch.cjs +15 -11
- package/_cjs/SupervisorPatch.cjs.map +1 -1
- package/_cjs/TExit/definition.cjs.map +1 -1
- package/_cjs/TFuture/api.cjs +21 -15
- 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/TFuture/definition.cjs.map +1 -1
- package/_cjs/TReentrantLock/api.cjs +32 -28
- package/_cjs/TReentrantLock/api.cjs.map +1 -1
- package/_cjs/TReentrantLock/definition.cjs +4 -4
- package/_cjs/TReentrantLock/definition.cjs.map +1 -1
- package/_cjs/TRef/api.cjs +233 -209
- package/_cjs/TRef/api.cjs.map +1 -1
- package/_cjs/TRef/definition.cjs +4 -4
- package/_cjs/TRef/definition.cjs.map +1 -1
- package/_cjs/TSemaphore/api.cjs +27 -23
- package/_cjs/TSemaphore/api.cjs.map +1 -1
- package/_cjs/TSemaphore/constructors.cjs +18 -3
- package/_cjs/TSemaphore/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +21 -19
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +21 -19
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/filterIO.cjs +16 -14
- package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/findIO.cjs +19 -17
- package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/mapIO.cjs +11 -9
- package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +31 -29
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
- package/_cjs/data/Exit/foreachIO.cjs +6 -4
- package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
- package/_cjs/internal/Hub.cjs +13 -11
- package/_cjs/internal/Hub.cjs.map +1 -1
- package/_cjs/internal/IsFatal.cjs +18 -16
- package/_cjs/internal/IsFatal.cjs.map +1 -1
- package/_cjs/internal/MutableQueue.cjs +11 -9
- package/_cjs/internal/MutableQueue.cjs.map +1 -1
- package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
- package/_mjs/Cached/api.mjs +6 -6
- package/_mjs/Cached/api.mjs.map +1 -1
- package/_mjs/Channel/ChildExecutorDecision/api.mjs +18 -16
- package/_mjs/Channel/ChildExecutorDecision/api.mjs.map +1 -1
- package/_mjs/Channel/UpstreamPullRequest/api.mjs +14 -12
- package/_mjs/Channel/UpstreamPullRequest/api.mjs.map +1 -1
- package/_mjs/Channel/api/interruptWhen.mjs +11 -7
- package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
- package/_mjs/Channel/api/mapOutIOC.mjs +24 -23
- package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAll.mjs +5 -3
- package/_mjs/Channel/api/mergeAll.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAllUnboundedWith.mjs +5 -3
- package/_mjs/Channel/api/mergeAllUnboundedWith.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +45 -46
- package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
- package/_mjs/Channel/api/mergeMap.mjs +5 -3
- package/_mjs/Channel/api/mergeMap.mjs.map +1 -1
- package/_mjs/Channel/api/mergeWith.mjs +46 -44
- package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
- package/_mjs/Channel/api/run.mjs +1 -1
- package/_mjs/Channel/api/run.mjs.map +1 -1
- package/_mjs/Channel/api/runScoped.mjs +2 -2
- 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/zipC.mjs +16 -10
- package/_mjs/Channel/api/zipC.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +224 -173
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/core-api.mjs +28 -18
- package/_mjs/Channel/core-api.mjs.map +1 -1
- package/_mjs/Channel/definition.mjs +1 -1
- package/_mjs/Channel/definition.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +83 -83
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +22 -23
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
- package/_mjs/Differ/api.mjs +5 -5
- package/_mjs/Differ/api.mjs.map +1 -1
- package/_mjs/Fiber/FiberContext.mjs +48 -48
- package/_mjs/Fiber/FiberContext.mjs.map +1 -1
- package/_mjs/Fiber/api/awaitAll.mjs +1 -1
- package/_mjs/Fiber/api/awaitAll.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/evalOn.mjs +11 -9
- package/_mjs/Fiber/api/evalOn.mjs.map +1 -1
- package/_mjs/Fiber/api/evalOnIO.mjs +5 -3
- package/_mjs/Fiber/api/evalOnIO.mjs.map +1 -1
- package/_mjs/Fiber/api/fromIO.mjs +1 -1
- package/_mjs/Fiber/api/fromIO.mjs.map +1 -1
- package/_mjs/Fiber/api/interrupt.mjs +1 -1
- package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs +2 -2
- package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAs.mjs +6 -4
- package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAsFork.mjs +6 -4
- package/_mjs/Fiber/api/interruptAsFork.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
- package/_mjs/Fiber/api/join.mjs +1 -1
- package/_mjs/Fiber/api/join.mjs.map +1 -1
- package/_mjs/Fiber/api/joinAll.mjs +1 -1
- package/_mjs/Fiber/api/joinAll.mjs.map +1 -1
- package/_mjs/Fiber/api/mapFiber.mjs +5 -3
- package/_mjs/Fiber/api/mapFiber.mjs.map +1 -1
- package/_mjs/Fiber/api/mapIO.mjs +11 -7
- package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
- package/_mjs/Fiber/api/zipWith.mjs +5 -3
- package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
- package/_mjs/Fiber/definition.mjs.map +1 -1
- package/_mjs/Fiber.mjs +1 -0
- package/_mjs/Fiber.mjs.map +1 -1
- package/_mjs/FiberRef/api/locallyScoped.mjs +5 -3
- package/_mjs/FiberRef/api/locallyScoped.mjs.map +1 -1
- package/_mjs/FiberRef/api/locallyScopedWith.mjs +5 -3
- package/_mjs/FiberRef/api/locallyScopedWith.mjs.map +1 -1
- package/_mjs/FiberRef/api.mjs +52 -36
- package/_mjs/FiberRef/api.mjs.map +1 -1
- package/_mjs/FiberRef/constructors.mjs +1 -1
- package/_mjs/FiberRef/constructors.mjs.map +1 -1
- package/_mjs/FiberRef.mjs.map +1 -1
- package/_mjs/FiberRefs/api.mjs +14 -12
- package/_mjs/FiberRefs/api.mjs.map +1 -1
- package/_mjs/FiberRefs/join.mjs +35 -33
- package/_mjs/FiberRefs/join.mjs.map +1 -1
- package/_mjs/FiberState/definition.mjs.map +1 -1
- package/_mjs/Future/api.mjs +84 -66
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Future/constructors.mjs +1 -1
- package/_mjs/Future/constructors.mjs.map +1 -1
- package/_mjs/Hub/constructors.mjs +66 -0
- package/_mjs/Hub/constructors.mjs.map +1 -0
- package/_mjs/Hub/definition.mjs +88 -9
- package/_mjs/Hub/definition.mjs.map +1 -1
- package/_mjs/Hub/internal.mjs +105 -122
- package/_mjs/Hub/internal.mjs.map +1 -1
- package/_mjs/Hub.mjs +1 -1
- package/_mjs/Hub.mjs.map +1 -1
- package/_mjs/IO/api/acquireReleaseExit.mjs +1 -1
- package/_mjs/IO/api/acquireReleaseExit.mjs.map +1 -1
- package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs +1 -1
- package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs.map +1 -1
- package/_mjs/IO/api/addFinalizerExit.mjs +1 -1
- package/_mjs/IO/api/addFinalizerExit.mjs.map +1 -1
- package/_mjs/IO/api/asyncIO.mjs +4 -4
- package/_mjs/IO/api/asyncIO.mjs.map +1 -1
- package/_mjs/IO/api/bracket.mjs +2 -2
- package/_mjs/IO/api/bracket.mjs.map +1 -1
- package/_mjs/IO/api/bracketExit.mjs +2 -2
- package/_mjs/IO/api/bracketExit.mjs.map +1 -1
- package/_mjs/IO/api/clockWith.mjs +2 -2
- package/_mjs/IO/api/clockWith.mjs.map +1 -1
- package/_mjs/IO/api/concurrency.mjs +8 -6
- package/_mjs/IO/api/concurrency.mjs.map +1 -1
- package/_mjs/IO/api/concurrentFinalizers.mjs +1 -1
- package/_mjs/IO/api/concurrentFinalizers.mjs.map +1 -1
- package/_mjs/IO/api/consoleWith.mjs +2 -2
- package/_mjs/IO/api/consoleWith.mjs.map +1 -1
- package/_mjs/IO/api/core-scope.mjs +40 -36
- package/_mjs/IO/api/core-scope.mjs.map +1 -1
- package/_mjs/IO/api/ensuringChildren.mjs +5 -3
- package/_mjs/IO/api/ensuringChildren.mjs.map +1 -1
- package/_mjs/IO/api/environment.mjs +29 -27
- package/_mjs/IO/api/environment.mjs.map +1 -1
- package/_mjs/IO/api/foreachC.mjs +17 -19
- package/_mjs/IO/api/foreachC.mjs.map +1 -1
- package/_mjs/IO/api/foreachExec.mjs +2 -2
- package/_mjs/IO/api/foreachExec.mjs.map +1 -1
- package/_mjs/IO/api/forkAll.mjs +1 -1
- package/_mjs/IO/api/forkAll.mjs.map +1 -1
- package/_mjs/IO/api/forkIn.mjs +7 -5
- package/_mjs/IO/api/forkIn.mjs.map +1 -1
- package/_mjs/IO/api/forkScoped.mjs +1 -1
- package/_mjs/IO/api/forkScoped.mjs.map +1 -1
- package/_mjs/IO/api/fulfill.mjs +7 -5
- package/_mjs/IO/api/fulfill.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +34 -28
- package/_mjs/IO/api/interrupt.mjs.map +1 -1
- package/_mjs/IO/api/memoize.mjs +1 -1
- package/_mjs/IO/api/memoize.mjs.map +1 -1
- package/_mjs/IO/api/onExit.mjs +5 -3
- package/_mjs/IO/api/onExit.mjs.map +1 -1
- package/_mjs/IO/api/onTermination.mjs +5 -3
- package/_mjs/IO/api/onTermination.mjs.map +1 -1
- package/_mjs/IO/api/once.mjs +3 -4
- package/_mjs/IO/api/once.mjs.map +1 -1
- package/_mjs/IO/api/provideLayer.mjs +5 -3
- package/_mjs/IO/api/provideLayer.mjs.map +1 -1
- package/_mjs/IO/api/provideSomeLayer.mjs +5 -11
- package/_mjs/IO/api/provideSomeLayer.mjs.map +1 -1
- package/_mjs/IO/api/race.mjs +5 -3
- package/_mjs/IO/api/race.mjs.map +1 -1
- package/_mjs/IO/api/raceFirst.mjs +5 -3
- package/_mjs/IO/api/raceFirst.mjs.map +1 -1
- package/_mjs/IO/api/randomWith.mjs +1 -1
- package/_mjs/IO/api/randomWith.mjs.map +1 -1
- package/_mjs/IO/api/repeat.mjs +8 -8
- package/_mjs/IO/api/repeat.mjs.map +1 -1
- package/_mjs/IO/api/retry.mjs +12 -12
- package/_mjs/IO/api/retry.mjs.map +1 -1
- package/_mjs/IO/api/schedule.mjs +15 -11
- package/_mjs/IO/api/schedule.mjs.map +1 -1
- package/_mjs/IO/api/scoped.mjs +3 -3
- package/_mjs/IO/api/scoped.mjs.map +1 -1
- package/_mjs/IO/api/sequenceT.mjs +1 -1
- package/_mjs/IO/api/sequenceT.mjs.map +1 -1
- package/_mjs/IO/api/stateful.mjs.map +1 -1
- package/_mjs/IO/api/supervised.mjs +5 -3
- package/_mjs/IO/api/supervised.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +10 -6
- package/_mjs/IO/api/timeout.mjs.map +1 -1
- package/_mjs/IO/api/withChildren.mjs +1 -1
- 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/withFinalizer.mjs +5 -3
- package/_mjs/IO/api/withFinalizer.mjs.map +1 -1
- package/_mjs/IO/api/withFinalizerExit.mjs +5 -3
- package/_mjs/IO/api/withFinalizerExit.mjs.map +1 -1
- package/_mjs/IO/api/withRuntimeConfig.mjs +5 -3
- package/_mjs/IO/api/withRuntimeConfig.mjs.map +1 -1
- package/_mjs/IO/api/zipC.mjs +18 -14
- package/_mjs/IO/api/zipC.mjs.map +1 -1
- package/_mjs/IO/api.mjs +511 -387
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +7 -7
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/IOEnv/definition.mjs +1 -1
- package/_mjs/IOEnv/definition.mjs.map +1 -1
- package/_mjs/IOEnv/live.mjs +1 -1
- package/_mjs/IOEnv/live.mjs.map +1 -1
- package/_mjs/Layer/MemoMap.mjs +86 -87
- package/_mjs/Layer/MemoMap.mjs.map +1 -1
- package/_mjs/Layer/api.mjs +91 -63
- package/_mjs/Layer/api.mjs.map +1 -1
- package/_mjs/Layer/definition.mjs.map +1 -1
- package/_mjs/LogLevel.mjs +24 -16
- package/_mjs/LogLevel.mjs.map +1 -1
- package/_mjs/LogSpan.mjs +16 -14
- package/_mjs/LogSpan.mjs.map +1 -1
- package/_mjs/Logger/api.mjs +16 -12
- package/_mjs/Logger/api.mjs.map +1 -1
- package/_mjs/Logger/constructors.mjs +1 -1
- package/_mjs/Logger/constructors.mjs.map +1 -1
- package/_mjs/Queue/constructors.mjs +16 -5
- package/_mjs/Queue/constructors.mjs.map +1 -1
- package/_mjs/Queue/definition.mjs +174 -12
- package/_mjs/Queue/definition.mjs.map +1 -1
- package/_mjs/Queue/internal.mjs +21 -170
- package/_mjs/Queue/internal.mjs.map +1 -1
- package/_mjs/Queue/strategy.mjs +20 -23
- package/_mjs/Queue/strategy.mjs.map +1 -1
- package/_mjs/Queue.mjs +1 -3
- package/_mjs/Queue.mjs.map +1 -1
- package/_mjs/Random/live.mjs +2 -2
- package/_mjs/Random/live.mjs.map +1 -1
- package/_mjs/Ref/Atomic.mjs +39 -3
- package/_mjs/Ref/Atomic.mjs.map +1 -1
- package/_mjs/Ref/Synchronized.mjs +123 -0
- package/_mjs/Ref/Synchronized.mjs.map +1 -0
- package/_mjs/Ref/constructors.mjs +15 -1
- package/_mjs/Ref/constructors.mjs.map +1 -1
- package/_mjs/Ref/definition.mjs +96 -4
- package/_mjs/Ref/definition.mjs.map +1 -1
- package/_mjs/Ref.mjs +1 -8
- package/_mjs/Ref.mjs.map +1 -1
- package/_mjs/Reloadable/constructors.mjs +10 -10
- package/_mjs/Reloadable/constructors.mjs.map +1 -1
- package/_mjs/RuntimeConfig.mjs +2 -2
- package/_mjs/RuntimeConfig.mjs.map +1 -1
- package/_mjs/STM/api/core-api.mjs +29 -19
- package/_mjs/STM/api/core-api.mjs.map +1 -1
- package/_mjs/STM/api.mjs +180 -127
- package/_mjs/STM/api.mjs.map +1 -1
- package/_mjs/STM/driver.mjs +3 -3
- package/_mjs/STM/driver.mjs.map +1 -1
- package/_mjs/STM/internal/Entry.mjs.map +1 -1
- package/_mjs/STM/internal/Journal.mjs +33 -29
- package/_mjs/STM/internal/Journal.mjs.map +1 -1
- package/_mjs/STM.mjs.map +1 -1
- package/_mjs/Schedule/Decision.mjs +14 -12
- package/_mjs/Schedule/Decision.mjs.map +1 -1
- package/_mjs/Schedule/api/driver.mjs +15 -17
- package/_mjs/Schedule/api/driver.mjs.map +1 -1
- package/_mjs/Schedule/api.mjs +326 -234
- package/_mjs/Schedule/api.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs +12 -11
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/api.mjs +60 -51
- package/_mjs/Scope/ReleaseMap/api.mjs.map +1 -1
- package/_mjs/Scope/api.mjs +28 -22
- package/_mjs/Scope/api.mjs.map +1 -1
- package/_mjs/ScopedRef/api.mjs +9 -11
- package/_mjs/ScopedRef/api.mjs.map +1 -1
- package/_mjs/ScopedRef/definition.mjs +1 -1
- package/_mjs/ScopedRef/definition.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +301 -240
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/State/api.mjs +16 -12
- package/_mjs/State/api.mjs.map +1 -1
- package/_mjs/Stream/api/zipAllWith.mjs +14 -12
- package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
- package/_mjs/Stream/api/zipWith.mjs +5 -3
- package/_mjs/Stream/api/zipWith.mjs.map +1 -1
- package/_mjs/Stream/api/zipWithChunks.mjs +12 -10
- package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +856 -653
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/Stream/definition.mjs.map +1 -1
- package/_mjs/Stream/internal/DebounceState.mjs +18 -16
- package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
- package/_mjs/Stream/internal/Handoff.mjs +35 -32
- package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
- package/_mjs/Stream/internal/Pull.mjs +9 -10
- package/_mjs/Stream/internal/Pull.mjs.map +1 -1
- package/_mjs/Stream/internal/SinkEndReason.mjs +14 -12
- package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
- package/_mjs/Stream/internal/Take.mjs +28 -20
- package/_mjs/Stream/internal/Take.mjs.map +1 -1
- package/_mjs/Stream/internal/util.mjs +3 -3
- package/_mjs/Stream/internal/util.mjs.map +1 -1
- package/_mjs/SubscriptionRef.mjs +45 -0
- package/_mjs/SubscriptionRef.mjs.map +1 -0
- package/_mjs/Supervisor/api.mjs +22 -18
- package/_mjs/Supervisor/api.mjs.map +1 -1
- package/_mjs/Supervisor/constructors.mjs +2 -2
- package/_mjs/Supervisor/constructors.mjs.map +1 -1
- package/_mjs/Supervisor/definition.mjs +1 -1
- package/_mjs/Supervisor/definition.mjs.map +1 -1
- package/_mjs/SupervisorPatch.mjs +15 -11
- package/_mjs/SupervisorPatch.mjs.map +1 -1
- package/_mjs/TExit/definition.mjs.map +1 -1
- package/_mjs/TFuture/api.mjs +17 -11
- 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/TFuture/definition.mjs.map +1 -1
- package/_mjs/TReentrantLock/api.mjs +32 -28
- package/_mjs/TReentrantLock/api.mjs.map +1 -1
- package/_mjs/TReentrantLock/definition.mjs +4 -4
- package/_mjs/TReentrantLock/definition.mjs.map +1 -1
- package/_mjs/TRef/api.mjs +218 -194
- package/_mjs/TRef/api.mjs.map +1 -1
- package/_mjs/TRef/definition.mjs +4 -4
- package/_mjs/TRef/definition.mjs.map +1 -1
- package/_mjs/TSemaphore/api.mjs +23 -19
- package/_mjs/TSemaphore/api.mjs.map +1 -1
- package/_mjs/TSemaphore/constructors.mjs +12 -2
- package/_mjs/TSemaphore/constructors.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/dropUntilIO.mjs +19 -17
- package/_mjs/collection/immutable/Conc/dropUntilIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/dropWhileIO.mjs +19 -17
- package/_mjs/collection/immutable/Conc/dropWhileIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/filterIO.mjs +14 -12
- package/_mjs/collection/immutable/Conc/filterIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/findIO.mjs +17 -15
- package/_mjs/collection/immutable/Conc/findIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/mapIO.mjs +10 -8
- package/_mjs/collection/immutable/Conc/mapIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs +28 -26
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs.map +1 -1
- package/_mjs/data/Exit/foreachIO.mjs +5 -3
- package/_mjs/data/Exit/foreachIO.mjs.map +1 -1
- package/_mjs/internal/Hub.mjs +13 -11
- package/_mjs/internal/Hub.mjs.map +1 -1
- package/_mjs/internal/IsFatal.mjs +18 -16
- package/_mjs/internal/IsFatal.mjs.map +1 -1
- package/_mjs/internal/MutableQueue.mjs +10 -8
- package/_mjs/internal/MutableQueue.mjs.map +1 -1
- package/_mjs/internal/StackTraceBuilder.mjs.map +1 -1
- package/_src/Cached/api.ts +2 -2
- package/_src/Channel/ChildExecutorDecision/api.ts +14 -17
- package/_src/Channel/UpstreamPullRequest/api.ts +11 -13
- package/_src/Channel/api/interruptWhen.ts +18 -17
- package/_src/Channel/api/mapOutIOC.ts +58 -58
- package/_src/Channel/api/mergeAll.ts +15 -16
- package/_src/Channel/api/mergeAllUnboundedWith.ts +15 -27
- package/_src/Channel/api/mergeAllWith.ts +114 -126
- package/_src/Channel/api/mergeMap.ts +8 -18
- package/_src/Channel/api/mergeWith.ts +154 -158
- package/_src/Channel/api/toPull.ts +1 -1
- package/_src/Channel/api/zipC.ts +52 -88
- package/_src/Channel/api.ts +345 -405
- package/_src/Channel/core-api.ts +75 -122
- package/_src/Channel/definition.ts +49 -7
- package/_src/Channel/internal/ChannelExecutor.ts +1 -5
- package/_src/Channel/internal/SingleProducerAsyncInput.ts +1 -3
- package/_src/Fiber/FiberContext.ts +13 -33
- package/_src/Fiber/api/collectAll.ts +1 -2
- package/_src/Fiber/api/evalOn.ts +11 -14
- package/_src/Fiber/api/evalOnIO.ts +10 -13
- package/_src/Fiber/api/interruptAll.ts +1 -2
- package/_src/Fiber/api/interruptAs.ts +6 -4
- package/_src/Fiber/api/interruptAsFork.ts +6 -4
- package/_src/Fiber/api/interruptFork.ts +1 -1
- package/_src/Fiber/api/mapFiber.ts +5 -7
- package/_src/Fiber/api/mapIO.ts +21 -21
- package/_src/Fiber/api/zipWith.ts +14 -17
- package/_src/Fiber/definition.ts +1 -15
- package/_src/Fiber.ts +1 -1
- package/_src/FiberRef/api/locallyScoped.ts +8 -6
- package/_src/FiberRef/api/locallyScopedWith.ts +5 -7
- package/_src/FiberRef/api.ts +50 -39
- package/_src/FiberRef.ts +0 -1
- package/_src/FiberRefs/api.ts +14 -12
- package/_src/FiberRefs/join.ts +37 -46
- package/_src/FiberState/definition.ts +1 -2
- package/_src/Future/api.ts +67 -53
- package/_src/Hub/constructors.ts +80 -0
- package/_src/Hub/definition.ts +95 -89
- package/_src/Hub/internal.ts +115 -165
- package/_src/Hub.ts +1 -1
- package/_src/IO/api/acquireRelease.ts +1 -1
- package/_src/IO/api/acquireReleaseExit.ts +1 -1
- package/_src/IO/api/bracket.ts +1 -1
- package/_src/IO/api/bracketExit.ts +1 -1
- package/_src/IO/api/clockWith.ts +0 -1
- package/_src/IO/api/concurrency.ts +5 -7
- package/_src/IO/api/consoleWith.ts +0 -2
- package/_src/IO/api/core-scope.ts +36 -33
- package/_src/IO/api/ensuringChildren.ts +8 -7
- package/_src/IO/api/environment.ts +24 -42
- package/_src/IO/api/foreachC.ts +24 -12
- package/_src/IO/api/foreachExec.ts +1 -1
- package/_src/IO/api/forkIn.ts +7 -9
- package/_src/IO/api/fulfill.ts +5 -3
- package/_src/IO/api/interrupt.ts +37 -40
- package/_src/IO/api/onExit.ts +8 -10
- package/_src/IO/api/onTermination.ts +12 -14
- package/_src/IO/api/provideLayer.ts +8 -10
- package/_src/IO/api/provideSomeLayer.ts +5 -14
- package/_src/IO/api/race.ts +19 -21
- package/_src/IO/api/raceFirst.ts +5 -7
- package/_src/IO/api/repeat.ts +3 -5
- package/_src/IO/api/retry.ts +19 -21
- package/_src/IO/api/schedule.ts +20 -21
- package/_src/IO/api/scoped.ts +2 -2
- package/_src/IO/api/sequenceT.ts +7 -1
- package/_src/IO/api/stateful.ts +0 -2
- package/_src/IO/api/supervised.ts +5 -7
- package/_src/IO/api/timeout.ts +10 -16
- package/_src/IO/api/withFinalizer.ts +5 -7
- package/_src/IO/api/withFinalizerExit.ts +6 -5
- package/_src/IO/api/withRuntimeConfig.ts +12 -14
- package/_src/IO/api/zipC.ts +57 -62
- package/_src/IO/api.ts +512 -539
- package/_src/IO/definition.ts +21 -9
- package/_src/IO/runtime.ts +0 -12
- package/_src/IO.ts +0 -1
- package/_src/Layer/MemoMap.ts +61 -63
- package/_src/Layer/api.ts +95 -104
- package/_src/Layer/definition.ts +0 -1
- package/_src/LogLevel.ts +24 -16
- package/_src/LogSpan.ts +16 -16
- package/_src/Logger/api.ts +18 -17
- package/_src/Logger/constructors.ts +9 -15
- package/_src/Queue/constructors.ts +22 -6
- package/_src/Queue/definition.ts +230 -81
- package/_src/Queue/internal.ts +9 -180
- package/_src/Queue/strategy.ts +9 -23
- package/_src/Queue.ts +1 -3
- package/_src/Ref/Atomic.ts +37 -4
- package/_src/Ref/Synchronized.ts +107 -0
- package/_src/Ref/constructors.ts +15 -0
- package/_src/Ref/definition.ts +86 -85
- package/_src/Ref.ts +1 -9
- package/_src/Reloadable/constructors.ts +2 -2
- package/_src/RuntimeConfig.ts +0 -2
- package/_src/STM/api/core-api.ts +32 -35
- package/_src/STM/api.ts +210 -200
- package/_src/STM/internal/Entry.ts +0 -10
- package/_src/STM/internal/Journal.ts +23 -26
- package/_src/STM.ts +0 -1
- package/_src/Schedule/Decision.ts +10 -8
- package/_src/Schedule/api/driver.ts +0 -4
- package/_src/Schedule/api.ts +419 -444
- package/_src/Schedule/definition.ts +0 -1
- package/_src/Scope/ReleaseMap/api/releaseAll.ts +23 -26
- package/_src/Scope/ReleaseMap/api.ts +77 -74
- package/_src/Scope/api.ts +16 -18
- package/_src/ScopedRef/api.ts +0 -3
- package/_src/ScopedRef/definition.ts +1 -2
- package/_src/Sink/api.ts +326 -357
- package/_src/State/api.ts +12 -8
- package/_src/State/internal.ts +1 -1
- package/_src/Stream/api/zipAllWith.ts +6 -5
- package/_src/Stream/api/zipWith.ts +5 -8
- package/_src/Stream/api/zipWithChunks.ts +6 -5
- package/_src/Stream/api.ts +1049 -1176
- package/_src/Stream/definition.ts +0 -2
- package/_src/Stream/internal/DebounceState.ts +16 -17
- package/_src/Stream/internal/Handoff.ts +31 -35
- package/_src/Stream/internal/Pull.ts +1 -2
- package/_src/Stream/internal/SinkEndReason.ts +13 -14
- package/_src/Stream/internal/Take.ts +21 -21
- package/_src/Stream/internal/util.ts +0 -2
- package/_src/SubscriptionRef.ts +44 -0
- package/_src/Supervisor/api.ts +18 -14
- package/_src/Supervisor/definition.ts +0 -1
- package/_src/SupervisorPatch.ts +10 -6
- package/_src/TExit/definition.ts +0 -8
- package/_src/TFuture/api.ts +23 -17
- package/_src/TFuture/definition.ts +0 -1
- package/_src/TReentrantLock/api.ts +14 -10
- package/_src/TReentrantLock/definition.ts +0 -7
- package/_src/TRef/api.ts +207 -209
- package/_src/TRef/definition.ts +0 -12
- package/_src/TSemaphore/api.ts +19 -18
- package/_src/TSemaphore/constructors.ts +7 -0
- package/_src/collection/immutable/Conc/dropUntilIO.ts +19 -21
- package/_src/collection/immutable/Conc/dropWhileIO.ts +21 -23
- package/_src/collection/immutable/Conc/filterIO.ts +15 -17
- package/_src/collection/immutable/Conc/findIO.ts +17 -19
- package/_src/collection/immutable/Conc/mapIO.ts +12 -10
- package/_src/collection/immutable/Conc/takeWhileIO.ts +27 -29
- package/_src/data/Exit/foreachIO.ts +8 -10
- package/_src/global.ts +7 -3
- package/_src/index.ts +3 -0
- package/_src/internal/Hub.ts +17 -27
- package/_src/internal/IsFatal.ts +14 -12
- package/_src/internal/MutableQueue.ts +8 -8
- package/_src/internal/StackTraceBuilder.ts +1 -2
- package/collection/immutable/Conc/dropUntilIO.d.ts +3 -3
- package/collection/immutable/Conc/dropWhileIO.d.ts +3 -3
- package/collection/immutable/Conc/filterIO.d.ts +3 -3
- package/collection/immutable/Conc/findIO.d.ts +2 -2
- package/collection/immutable/Conc/mapIO.d.ts +3 -3
- package/collection/immutable/Conc/takeWhileIO.d.ts +3 -3
- package/data/Exit/foreachIO.d.ts +3 -3
- package/global.d.ts +7 -3
- package/index.d.ts +3 -0
- package/internal/Hub.d.ts +2 -2
- package/internal/IsFatal.d.ts +3 -3
- package/internal/MutableQueue.d.ts +3 -3
- package/package.json +3 -3
- package/Hub/api.d.ts +0 -190
- package/Queue/api/dimapIO.d.ts +0 -41
- package/Queue/api/filterInputIO.d.ts +0 -33
- package/Queue/api/filterOutputIO.d.ts +0 -31
- package/Queue/api/operations.d.ts +0 -82
- package/Queue/api/poll.d.ts +0 -9
- package/Queue/api/takeBetween.d.ts +0 -11
- package/Queue/api/zipWithIO.d.ts +0 -44
- package/Queue/api.d.ts +0 -7
- package/Ref/Atomic/Atomic.d.ts +0 -18
- package/Ref/Atomic/api.d.ts +0 -53
- package/Ref/Derived.d.ts +0 -14
- package/Ref/DerivedAll.d.ts +0 -14
- package/Ref/Synchronized/api.d.ts +0 -100
- package/Ref/Synchronized/constructors.d.ts +0 -8
- package/Ref/Synchronized/definition.d.ts +0 -42
- package/Ref/api/collect.d.ts +0 -11
- package/Ref/api/dimap.d.ts +0 -56
- package/Ref/api/filter.d.ts +0 -20
- package/Ref/api/get.d.ts +0 -9
- package/Ref/api/match.d.ts +0 -13
- package/Ref/api/matchAll.d.ts +0 -11
- package/Ref/api/modify.d.ts +0 -79
- package/Ref/api/set.d.ts +0 -10
- package/Ref/api.d.ts +0 -23
- package/_cjs/Hub/api.cjs +0 -456
- package/_cjs/Hub/api.cjs.map +0 -1
- package/_cjs/Queue/api/dimapIO.cjs +0 -120
- package/_cjs/Queue/api/dimapIO.cjs.map +0 -1
- package/_cjs/Queue/api/filterInputIO.cjs +0 -84
- package/_cjs/Queue/api/filterInputIO.cjs.map +0 -1
- package/_cjs/Queue/api/filterOutputIO.cjs +0 -89
- package/_cjs/Queue/api/filterOutputIO.cjs.map +0 -1
- package/_cjs/Queue/api/operations.cjs +0 -147
- package/_cjs/Queue/api/operations.cjs.map +0 -1
- package/_cjs/Queue/api/poll.cjs +0 -27
- package/_cjs/Queue/api/poll.cjs.map +0 -1
- package/_cjs/Queue/api/takeBetween.cjs +0 -57
- package/_cjs/Queue/api/takeBetween.cjs.map +0 -1
- package/_cjs/Queue/api/zipWithIO.cjs +0 -97
- package/_cjs/Queue/api/zipWithIO.cjs.map +0 -1
- package/_cjs/Queue/api.cjs +0 -97
- package/_cjs/Queue/api.cjs.map +0 -1
- package/_cjs/Ref/Atomic/Atomic.cjs +0 -64
- package/_cjs/Ref/Atomic/Atomic.cjs.map +0 -1
- package/_cjs/Ref/Atomic/api.cjs +0 -156
- package/_cjs/Ref/Atomic/api.cjs.map +0 -1
- package/_cjs/Ref/Derived.cjs +0 -55
- package/_cjs/Ref/Derived.cjs.map +0 -1
- package/_cjs/Ref/DerivedAll.cjs +0 -55
- package/_cjs/Ref/DerivedAll.cjs.map +0 -1
- package/_cjs/Ref/Synchronized/api.cjs +0 -196
- package/_cjs/Ref/Synchronized/api.cjs.map +0 -1
- package/_cjs/Ref/Synchronized/constructors.cjs +0 -32
- package/_cjs/Ref/Synchronized/constructors.cjs.map +0 -1
- package/_cjs/Ref/Synchronized/definition.cjs +0 -88
- package/_cjs/Ref/Synchronized/definition.cjs.map +0 -1
- package/_cjs/Ref/api/collect.cjs +0 -31
- package/_cjs/Ref/api/collect.cjs.map +0 -1
- package/_cjs/Ref/api/dimap.cjs +0 -110
- package/_cjs/Ref/api/dimap.cjs.map +0 -1
- package/_cjs/Ref/api/filter.cjs +0 -45
- package/_cjs/Ref/api/filter.cjs.map +0 -1
- package/_cjs/Ref/api/get.cjs +0 -20
- package/_cjs/Ref/api/get.cjs.map +0 -1
- package/_cjs/Ref/api/match.cjs +0 -26
- package/_cjs/Ref/api/match.cjs.map +0 -1
- package/_cjs/Ref/api/matchAll.cjs +0 -24
- package/_cjs/Ref/api/matchAll.cjs.map +0 -1
- package/_cjs/Ref/api/modify.cjs +0 -239
- package/_cjs/Ref/api/modify.cjs.map +0 -1
- package/_cjs/Ref/api/set.cjs +0 -21
- package/_cjs/Ref/api/set.cjs.map +0 -1
- package/_cjs/Ref/api.cjs +0 -158
- package/_cjs/Ref/api.cjs.map +0 -1
- package/_mjs/Hub/api.mjs +0 -384
- package/_mjs/Hub/api.mjs.map +0 -1
- package/_mjs/Queue/api/dimapIO.mjs +0 -97
- package/_mjs/Queue/api/dimapIO.mjs.map +0 -1
- package/_mjs/Queue/api/filterInputIO.mjs +0 -63
- package/_mjs/Queue/api/filterInputIO.mjs.map +0 -1
- package/_mjs/Queue/api/filterOutputIO.mjs +0 -68
- package/_mjs/Queue/api/filterOutputIO.mjs.map +0 -1
- package/_mjs/Queue/api/operations.mjs +0 -122
- package/_mjs/Queue/api/operations.mjs.map +0 -1
- package/_mjs/Queue/api/poll.mjs +0 -14
- package/_mjs/Queue/api/poll.mjs.map +0 -1
- package/_mjs/Queue/api/takeBetween.mjs +0 -43
- package/_mjs/Queue/api/takeBetween.mjs.map +0 -1
- package/_mjs/Queue/api/zipWithIO.mjs +0 -74
- package/_mjs/Queue/api/zipWithIO.mjs.map +0 -1
- package/_mjs/Queue/api.mjs +0 -9
- package/_mjs/Queue/api.mjs.map +0 -1
- package/_mjs/Ref/Atomic/Atomic.mjs +0 -47
- package/_mjs/Ref/Atomic/Atomic.mjs.map +0 -1
- package/_mjs/Ref/Atomic/api.mjs +0 -127
- package/_mjs/Ref/Atomic/api.mjs.map +0 -1
- package/_mjs/Ref/Derived.mjs +0 -35
- package/_mjs/Ref/Derived.mjs.map +0 -1
- package/_mjs/Ref/DerivedAll.mjs +0 -35
- package/_mjs/Ref/DerivedAll.mjs.map +0 -1
- package/_mjs/Ref/Synchronized/api.mjs +0 -154
- package/_mjs/Ref/Synchronized/api.mjs.map +0 -1
- package/_mjs/Ref/Synchronized/constructors.mjs +0 -15
- package/_mjs/Ref/Synchronized/constructors.mjs.map +0 -1
- package/_mjs/Ref/Synchronized/definition.mjs +0 -66
- package/_mjs/Ref/Synchronized/definition.mjs.map +0 -1
- package/_mjs/Ref/api/collect.mjs +0 -17
- package/_mjs/Ref/api/collect.mjs.map +0 -1
- package/_mjs/Ref/api/dimap.mjs +0 -84
- package/_mjs/Ref/api/dimap.mjs.map +0 -1
- package/_mjs/Ref/api/filter.mjs +0 -29
- package/_mjs/Ref/api/filter.mjs.map +0 -1
- package/_mjs/Ref/api/get.mjs +0 -13
- package/_mjs/Ref/api/get.mjs.map +0 -1
- package/_mjs/Ref/api/match.mjs +0 -18
- package/_mjs/Ref/api/match.mjs.map +0 -1
- package/_mjs/Ref/api/matchAll.mjs +0 -16
- package/_mjs/Ref/api/matchAll.mjs.map +0 -1
- package/_mjs/Ref/api/modify.mjs +0 -204
- package/_mjs/Ref/api/modify.mjs.map +0 -1
- package/_mjs/Ref/api/set.mjs +0 -14
- package/_mjs/Ref/api/set.mjs.map +0 -1
- package/_mjs/Ref/api.mjs +0 -34
- package/_mjs/Ref/api.mjs.map +0 -1
- package/_src/Hub/api.ts +0 -461
- package/_src/Queue/api/dimapIO.ts +0 -130
- package/_src/Queue/api/filterInputIO.ts +0 -75
- package/_src/Queue/api/filterOutputIO.ts +0 -76
- package/_src/Queue/api/operations.ts +0 -139
- package/_src/Queue/api/poll.ts +0 -14
- package/_src/Queue/api/takeBetween.ts +0 -45
- package/_src/Queue/api/zipWithIO.ts +0 -99
- package/_src/Queue/api.ts +0 -9
- package/_src/Ref/Atomic/Atomic.ts +0 -56
- package/_src/Ref/Atomic/api.ts +0 -124
- package/_src/Ref/Derived.ts +0 -71
- package/_src/Ref/DerivedAll.ts +0 -75
- package/_src/Ref/Synchronized/api.ts +0 -249
- package/_src/Ref/Synchronized/constructors.ts +0 -12
- package/_src/Ref/Synchronized/definition.ts +0 -126
- package/_src/Ref/api/collect.ts +0 -19
- package/_src/Ref/api/dimap.ts +0 -115
- package/_src/Ref/api/filter.ts +0 -35
- package/_src/Ref/api/get.ts +0 -17
- package/_src/Ref/api/match.ts +0 -24
- package/_src/Ref/api/matchAll.ts +0 -23
- package/_src/Ref/api/modify.ts +0 -237
- package/_src/Ref/api/set.ts +0 -19
- package/_src/Ref/api.ts +0 -39
package/_cjs/Stream/api.cjs
CHANGED
|
@@ -4,125 +4,129 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.absolve = absolve;
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
7
|
+
exports.acquireRelease = acquireRelease;
|
|
8
|
+
exports.acquireReleaseExit = acquireReleaseExit;
|
|
9
|
+
exports.aggregateAsync = aggregateAsync;
|
|
10
|
+
exports.aggregateAsyncWithinEither = exports.aggregateAsyncWithin = void 0;
|
|
11
|
+
exports.apFirst = apFirst;
|
|
12
|
+
exports.apSecond = void 0;
|
|
13
|
+
exports.as = as;
|
|
14
14
|
exports.async = async;
|
|
15
15
|
exports.asyncIO = asyncIO;
|
|
16
16
|
exports.asyncMaybe = exports.asyncInterrupt = void 0;
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
17
|
+
exports.bimap = bimap;
|
|
18
|
+
exports.broadcast = broadcast;
|
|
19
|
+
exports.broadcastDynamic = broadcastDynamic;
|
|
20
|
+
exports.broadcastedQueuesDynamic = exports.broadcastedQueues = void 0;
|
|
21
|
+
exports.buffer = buffer;
|
|
22
|
+
exports.bufferChunks = bufferChunks;
|
|
22
23
|
exports.bufferUnbounded = bufferUnbounded;
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.changesWith_ = changesWith_;
|
|
24
|
+
exports.catchAllCause = exports.catchAll = void 0;
|
|
25
|
+
exports.catchJust = catchJust;
|
|
26
|
+
exports.catchJustCause = catchJustCause;
|
|
27
|
+
exports.changesWith = changesWith;
|
|
28
28
|
exports.chunks = void 0;
|
|
29
29
|
exports.chunksWith = chunksWith;
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
30
|
+
exports.collectWhile = collectWhile;
|
|
31
|
+
exports.collectWhileIO = collectWhileIO;
|
|
32
|
+
exports.combine = combine;
|
|
33
|
+
exports.combineChunks = combineChunks;
|
|
34
|
+
exports.concat = void 0;
|
|
35
|
+
exports.contramapEnvironment = contramapEnvironment;
|
|
36
|
+
exports.cross = cross;
|
|
37
|
+
exports.crossWith = void 0;
|
|
38
|
+
exports.debounce = debounce;
|
|
39
|
+
exports.defaultIfEmpty = defaultIfEmpty;
|
|
40
|
+
exports.distributedWith = distributedWith;
|
|
41
|
+
exports.distributedWithDynamic = void 0;
|
|
42
42
|
exports.drain = drain;
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
43
|
+
exports.drop = void 0;
|
|
44
|
+
exports.dropUntil = dropUntil;
|
|
45
|
+
exports.dropWhile = void 0;
|
|
45
46
|
exports.either = either;
|
|
46
47
|
exports.empty = void 0;
|
|
47
|
-
exports.
|
|
48
|
-
exports.environment = exports.
|
|
48
|
+
exports.endWhen = endWhen;
|
|
49
|
+
exports.environment = exports.ensuring = void 0;
|
|
49
50
|
exports.environmentWith = environmentWith;
|
|
50
51
|
exports.environmentWithIO = environmentWithIO;
|
|
51
52
|
exports.environmentWithStream = environmentWithStream;
|
|
52
53
|
exports.fail = fail;
|
|
53
54
|
exports.failCause = failCause;
|
|
54
55
|
exports.failNow = exports.failCauseNow = void 0;
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
61
|
-
exports.forever = exports.flattenTake = exports.flattenExitOption = exports.flattenChunks = exports.flatten = exports.
|
|
56
|
+
exports.filter = filter;
|
|
57
|
+
exports.filterIO = filterIO;
|
|
58
|
+
exports.filterMap = void 0;
|
|
59
|
+
exports.filterMapIO = filterMapIO;
|
|
60
|
+
exports.find = find;
|
|
61
|
+
exports.findIO = findIO;
|
|
62
|
+
exports.forever = exports.flattenTake = exports.flattenExitOption = exports.flattenChunks = exports.flatten = exports.flatMap = void 0;
|
|
62
63
|
exports.fromAsyncIterable = fromAsyncIterable;
|
|
63
|
-
exports.
|
|
64
|
+
exports.fromChunkNow = exports.fromChunk = void 0;
|
|
65
|
+
exports.fromHub = fromHub;
|
|
66
|
+
exports.fromHubScoped = fromHubScoped;
|
|
67
|
+
exports.fromIOMaybe = exports.fromIO = void 0;
|
|
64
68
|
exports.fromIterable = fromIterable;
|
|
65
69
|
exports.fromIterableSingle = fromIterableSingle;
|
|
66
|
-
exports.halt = exports.
|
|
70
|
+
exports.halt = exports.fromQueueWithShutdown = exports.fromQueue = exports.fromPull = void 0;
|
|
67
71
|
exports.haltNow = haltNow;
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
70
|
-
exports.
|
|
71
|
-
exports.
|
|
72
|
-
exports.
|
|
73
|
-
exports.
|
|
74
|
-
exports.
|
|
75
|
-
exports.
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
78
|
-
exports.
|
|
79
|
-
exports.
|
|
80
|
-
exports.
|
|
81
|
-
exports.
|
|
82
|
-
exports.
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.mergeMap_ = void 0;
|
|
72
|
+
exports.haltWhen = haltWhen;
|
|
73
|
+
exports.haltWhenFuture = haltWhenFuture;
|
|
74
|
+
exports.interleave = interleave;
|
|
75
|
+
exports.interleaveWith = void 0;
|
|
76
|
+
exports.interruptWhen = interruptWhen;
|
|
77
|
+
exports.interruptWhenFuture = interruptWhenFuture;
|
|
78
|
+
exports.intersperse = intersperse;
|
|
79
|
+
exports.mapChunks = exports.mapAccumIO = exports.mapAccum = exports.map = void 0;
|
|
80
|
+
exports.mapChunksIO = mapChunksIO;
|
|
81
|
+
exports.mapConcat = mapConcat;
|
|
82
|
+
exports.mapConcatChunk = void 0;
|
|
83
|
+
exports.mapConcatChunkIO = mapConcatChunkIO;
|
|
84
|
+
exports.mapConcatIO = mapConcatIO;
|
|
85
|
+
exports.mapError = void 0;
|
|
86
|
+
exports.mapErrorCause = mapErrorCause;
|
|
87
|
+
exports.mapIO = void 0;
|
|
88
|
+
exports.mapIOC = mapIOC;
|
|
89
|
+
exports.mergeMap = exports.mergeEither = void 0;
|
|
90
|
+
exports.mergeMapIO = mergeMapIO;
|
|
91
|
+
exports.mergeWith = void 0;
|
|
89
92
|
exports.mergeWithHandler = mergeWithHandler;
|
|
90
|
-
exports.
|
|
91
|
-
exports.
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
95
|
-
exports.
|
|
96
|
-
exports.
|
|
97
|
-
exports.
|
|
98
|
-
exports.
|
|
93
|
+
exports.onError = onError;
|
|
94
|
+
exports.orElse = void 0;
|
|
95
|
+
exports.orElseEither = orElseEither;
|
|
96
|
+
exports.orElseFail = orElseFail;
|
|
97
|
+
exports.orElseOptional = orElseOptional;
|
|
98
|
+
exports.orElseSucceed = orElseSucceed;
|
|
99
|
+
exports.provideLayer = exports.provideEnvironment = exports.pipeThrough = void 0;
|
|
100
|
+
exports.provideSomeLayer = provideSomeLayer;
|
|
101
|
+
exports.rechunk = rechunk;
|
|
99
102
|
exports.repeatIO = repeatIO;
|
|
100
103
|
exports.repeatIOChunk = repeatIOChunk;
|
|
101
104
|
exports.repeatIOMaybe = exports.repeatIOChunkMaybe = void 0;
|
|
102
105
|
exports.repeatValue = repeatValue;
|
|
106
|
+
exports.run = void 0;
|
|
103
107
|
exports.runCollect = runCollect;
|
|
104
108
|
exports.runDrain = runDrain;
|
|
105
|
-
exports.
|
|
106
|
-
exports.
|
|
107
|
-
exports.
|
|
108
|
-
exports.
|
|
109
|
+
exports.runScoped = exports.runIntoQueueScoped = exports.runIntoHubScoped = exports.runIntoElementsScoped = exports.runForeachScoped = void 0;
|
|
110
|
+
exports.scan = scan;
|
|
111
|
+
exports.scanIO = void 0;
|
|
112
|
+
exports.scanReduce = scanReduce;
|
|
113
|
+
exports.scoped = exports.scanReduceIO = void 0;
|
|
109
114
|
exports.succeed = succeed;
|
|
110
115
|
exports.succeedNow = void 0;
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
118
|
-
exports.
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
121
|
-
exports.toQueue_ = exports.toQueueUnbounded = void 0;
|
|
116
|
+
exports.take = take;
|
|
117
|
+
exports.takeUntil = takeUntil;
|
|
118
|
+
exports.takeUntilIO = takeUntilIO;
|
|
119
|
+
exports.tap = tap;
|
|
120
|
+
exports.throttleEnforce = throttleEnforce;
|
|
121
|
+
exports.toQueue = exports.toPull = exports.toHub = exports.throttleEnforceIO = void 0;
|
|
122
|
+
exports.toQueueDropping = toQueueDropping;
|
|
123
|
+
exports.toQueueOfElements = void 0;
|
|
124
|
+
exports.toQueueSliding = toQueueSliding;
|
|
125
|
+
exports.toQueueUnbounded = void 0;
|
|
122
126
|
exports.unfold = unfold;
|
|
123
127
|
exports.unwrapScoped = exports.unwrap = exports.unfoldIO = exports.unfoldChunkIO = exports.unfoldChunk = void 0;
|
|
124
128
|
exports.zipWithIndex_ = zipWithIndex_;
|
|
125
|
-
exports.
|
|
129
|
+
exports.zipWithLatest = zipWithLatest;
|
|
126
130
|
|
|
127
131
|
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api"));
|
|
128
132
|
|
|
@@ -148,107 +152,97 @@ var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/requir
|
|
|
148
152
|
|
|
149
153
|
var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api"));
|
|
150
154
|
|
|
151
|
-
var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
155
|
+
var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/runScoped"));
|
|
152
156
|
|
|
153
|
-
var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
157
|
+
var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/forkScoped"));
|
|
154
158
|
|
|
155
|
-
var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
159
|
+
var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/constructors"));
|
|
156
160
|
|
|
157
|
-
var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
161
|
+
var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/constructors"));
|
|
158
162
|
|
|
159
|
-
var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
163
|
+
var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/destructors"));
|
|
160
164
|
|
|
161
|
-
var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
165
|
+
var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/SinkEndReason"));
|
|
162
166
|
|
|
163
|
-
var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
167
|
+
var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/join"));
|
|
164
168
|
|
|
165
|
-
var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
169
|
+
var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/interrupt"));
|
|
166
170
|
|
|
167
|
-
var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
171
|
+
var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/core-scope"));
|
|
168
172
|
|
|
169
|
-
var tsplus_module_22 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
173
|
+
var tsplus_module_22 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
|
|
170
174
|
|
|
171
|
-
var tsplus_module_23 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
175
|
+
var tsplus_module_23 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/Take"));
|
|
172
176
|
|
|
173
|
-
var tsplus_module_24 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/
|
|
177
|
+
var tsplus_module_24 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/runtime"));
|
|
174
178
|
|
|
175
|
-
var tsplus_module_25 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
179
|
+
var tsplus_module_25 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Queue/constructors"));
|
|
176
180
|
|
|
177
|
-
var tsplus_module_26 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
181
|
+
var tsplus_module_26 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/acquireRelease"));
|
|
178
182
|
|
|
179
|
-
var tsplus_module_27 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
183
|
+
var tsplus_module_27 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/acquireReleaseExit"));
|
|
180
184
|
|
|
181
|
-
var tsplus_module_28 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
185
|
+
var tsplus_module_28 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api/replicate"));
|
|
182
186
|
|
|
183
|
-
var tsplus_module_29 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
187
|
+
var tsplus_module_29 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Hub/constructors"));
|
|
184
188
|
|
|
185
|
-
var tsplus_module_30 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
189
|
+
var tsplus_module_30 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/api"));
|
|
186
190
|
|
|
187
|
-
var tsplus_module_31 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
191
|
+
var tsplus_module_31 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/api"));
|
|
188
192
|
|
|
189
|
-
var tsplus_module_32 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
193
|
+
var tsplus_module_32 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/constructors"));
|
|
190
194
|
|
|
191
|
-
var tsplus_module_33 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/
|
|
195
|
+
var tsplus_module_33 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/api"));
|
|
192
196
|
|
|
193
|
-
var tsplus_module_34 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/
|
|
197
|
+
var tsplus_module_34 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/Iterable/constructors"));
|
|
194
198
|
|
|
195
|
-
var tsplus_module_35 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
199
|
+
var tsplus_module_35 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/constructors"));
|
|
196
200
|
|
|
197
|
-
var tsplus_module_36 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
201
|
+
var tsplus_module_36 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/DebounceState"));
|
|
198
202
|
|
|
199
|
-
var tsplus_module_37 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
203
|
+
var tsplus_module_37 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Clock/api"));
|
|
200
204
|
|
|
201
|
-
var tsplus_module_38 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/
|
|
205
|
+
var tsplus_module_38 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashMap/api"));
|
|
202
206
|
|
|
203
|
-
var tsplus_module_39 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
207
|
+
var tsplus_module_39 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/TSemaphore/api"));
|
|
204
208
|
|
|
205
|
-
var tsplus_module_40 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
209
|
+
var tsplus_module_40 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/TSemaphore/constructors"));
|
|
206
210
|
|
|
207
|
-
var tsplus_module_41 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
211
|
+
var tsplus_module_41 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/STM/api"));
|
|
208
212
|
|
|
209
|
-
var tsplus_module_42 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
213
|
+
var tsplus_module_42 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Sink/api"));
|
|
210
214
|
|
|
211
|
-
var tsplus_module_43 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
215
|
+
var tsplus_module_43 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Predicate/api"));
|
|
212
216
|
|
|
213
|
-
var tsplus_module_44 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
217
|
+
var tsplus_module_44 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/poll"));
|
|
214
218
|
|
|
215
|
-
var tsplus_module_45 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
219
|
+
var tsplus_module_45 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
|
|
216
220
|
|
|
217
|
-
var tsplus_module_46 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
221
|
+
var tsplus_module_46 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/collection/immutable/Conc/findIO"));
|
|
218
222
|
|
|
219
|
-
var tsplus_module_47 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/
|
|
223
|
+
var tsplus_module_47 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/definition"));
|
|
220
224
|
|
|
221
|
-
var tsplus_module_48 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
225
|
+
var tsplus_module_48 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Stream/internal/Pull"));
|
|
222
226
|
|
|
223
|
-
var tsplus_module_49 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
227
|
+
var tsplus_module_49 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/interruptWhen"));
|
|
224
228
|
|
|
225
|
-
var tsplus_module_50 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
229
|
+
var tsplus_module_50 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mapOutIOC"));
|
|
226
230
|
|
|
227
|
-
var tsplus_module_51 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
231
|
+
var tsplus_module_51 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mergeMap"));
|
|
228
232
|
|
|
229
|
-
var tsplus_module_52 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
233
|
+
var tsplus_module_52 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/internal/MergeDecision"));
|
|
230
234
|
|
|
231
|
-
var tsplus_module_53 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
235
|
+
var tsplus_module_53 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/mergeWith"));
|
|
232
236
|
|
|
233
|
-
var tsplus_module_54 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
237
|
+
var tsplus_module_54 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/MemoMap"));
|
|
234
238
|
|
|
235
|
-
var tsplus_module_55 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/
|
|
239
|
+
var tsplus_module_55 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/api"));
|
|
236
240
|
|
|
237
|
-
var tsplus_module_56 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/
|
|
241
|
+
var tsplus_module_56 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/runDrain"));
|
|
238
242
|
|
|
239
|
-
var tsplus_module_57 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
|
243
|
+
var tsplus_module_57 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/exceptions"));
|
|
240
244
|
|
|
241
|
-
var tsplus_module_58 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/
|
|
242
|
-
|
|
243
|
-
var tsplus_module_59 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/MemoMap"));
|
|
244
|
-
|
|
245
|
-
var tsplus_module_60 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Layer/api"));
|
|
246
|
-
|
|
247
|
-
var tsplus_module_61 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/runDrain"));
|
|
248
|
-
|
|
249
|
-
var tsplus_module_62 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/exceptions"));
|
|
250
|
-
|
|
251
|
-
var tsplus_module_63 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/toPull"));
|
|
245
|
+
var tsplus_module_58 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Channel/api/toPull"));
|
|
252
246
|
|
|
253
247
|
var _function = /*#__PURE__*/require("@fncts/base/data/function");
|
|
254
248
|
|
|
@@ -263,48 +257,48 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
263
257
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
264
258
|
|
|
265
259
|
const fileName_1 = "(@fncts/io) src/Stream/api.ts";
|
|
266
|
-
const
|
|
267
|
-
exports.
|
|
268
|
-
const
|
|
269
|
-
exports.
|
|
270
|
-
const
|
|
271
|
-
exports.
|
|
260
|
+
const aggregateAsyncWithin = aggregateAsyncWithin_1;
|
|
261
|
+
exports.aggregateAsyncWithin = aggregateAsyncWithin;
|
|
262
|
+
const aggregateAsyncWithinEither = aggregateAsyncWithinEither_1;
|
|
263
|
+
exports.aggregateAsyncWithinEither = aggregateAsyncWithinEither;
|
|
264
|
+
const apSecond = apSecond_1;
|
|
265
|
+
exports.apSecond = apSecond;
|
|
272
266
|
const asyncInterrupt = asyncInterrupt_1;
|
|
273
267
|
exports.asyncInterrupt = asyncInterrupt;
|
|
274
268
|
const asyncMaybe = asyncMaybe_1;
|
|
275
269
|
exports.asyncMaybe = asyncMaybe;
|
|
276
|
-
const
|
|
277
|
-
exports.
|
|
278
|
-
const
|
|
279
|
-
exports.
|
|
280
|
-
const
|
|
281
|
-
exports.
|
|
282
|
-
const
|
|
283
|
-
exports.
|
|
284
|
-
const
|
|
285
|
-
exports.
|
|
270
|
+
const broadcastedQueues = broadcastedQueues_1;
|
|
271
|
+
exports.broadcastedQueues = broadcastedQueues;
|
|
272
|
+
const broadcastedQueuesDynamic = broadcastedQueuesDynamic_1;
|
|
273
|
+
exports.broadcastedQueuesDynamic = broadcastedQueuesDynamic;
|
|
274
|
+
const catchAll = catchAll_1;
|
|
275
|
+
exports.catchAll = catchAll;
|
|
276
|
+
const catchAllCause = catchAllCause_1;
|
|
277
|
+
exports.catchAllCause = catchAllCause;
|
|
278
|
+
const flatMap = flatMap_1;
|
|
279
|
+
exports.flatMap = flatMap;
|
|
286
280
|
const chunks = chunks_1;
|
|
287
281
|
exports.chunks = chunks;
|
|
288
|
-
const
|
|
289
|
-
exports.
|
|
290
|
-
const
|
|
291
|
-
exports.
|
|
292
|
-
const
|
|
293
|
-
exports.
|
|
294
|
-
const
|
|
295
|
-
exports.
|
|
296
|
-
const
|
|
297
|
-
exports.
|
|
298
|
-
const
|
|
299
|
-
exports.
|
|
282
|
+
const concat = concat_1;
|
|
283
|
+
exports.concat = concat;
|
|
284
|
+
const crossWith = crossWith_1;
|
|
285
|
+
exports.crossWith = crossWith;
|
|
286
|
+
const distributedWithDynamic = distributedWithDynamic_1;
|
|
287
|
+
exports.distributedWithDynamic = distributedWithDynamic;
|
|
288
|
+
const drop = drop_1;
|
|
289
|
+
exports.drop = drop;
|
|
290
|
+
const dropWhile = dropWhile_1;
|
|
291
|
+
exports.dropWhile = dropWhile;
|
|
292
|
+
const ensuring = ensuring_1;
|
|
293
|
+
exports.ensuring = ensuring;
|
|
300
294
|
const environment = environment_1;
|
|
301
295
|
exports.environment = environment;
|
|
302
296
|
const failNow = failNow_1;
|
|
303
297
|
exports.failNow = failNow;
|
|
304
298
|
const failCauseNow = failCauseNow_1;
|
|
305
299
|
exports.failCauseNow = failCauseNow;
|
|
306
|
-
const
|
|
307
|
-
exports.
|
|
300
|
+
const filterMap = filterMap_1;
|
|
301
|
+
exports.filterMap = filterMap;
|
|
308
302
|
const flatten = flatten_1;
|
|
309
303
|
exports.flatten = flatten;
|
|
310
304
|
const flattenExitOption = flattenExitOption_1;
|
|
@@ -327,74 +321,74 @@ const fromIOMaybe = fromIOMaybe_1;
|
|
|
327
321
|
exports.fromIOMaybe = fromIOMaybe;
|
|
328
322
|
const fromPull = fromPull_1;
|
|
329
323
|
exports.fromPull = fromPull;
|
|
330
|
-
const
|
|
331
|
-
exports.
|
|
324
|
+
const fromQueue = fromQueue_1;
|
|
325
|
+
exports.fromQueue = fromQueue;
|
|
332
326
|
const fromQueueWithShutdown = fromQueueWithShutdown_1;
|
|
333
327
|
exports.fromQueueWithShutdown = fromQueueWithShutdown;
|
|
334
328
|
const halt = halt_1;
|
|
335
329
|
exports.halt = halt;
|
|
336
|
-
const
|
|
337
|
-
exports.
|
|
338
|
-
const
|
|
339
|
-
exports.
|
|
340
|
-
const
|
|
341
|
-
exports.
|
|
342
|
-
const
|
|
343
|
-
exports.
|
|
344
|
-
const
|
|
345
|
-
exports.
|
|
346
|
-
const
|
|
347
|
-
exports.
|
|
348
|
-
const
|
|
349
|
-
exports.
|
|
350
|
-
const
|
|
351
|
-
exports.
|
|
352
|
-
const
|
|
353
|
-
exports.
|
|
354
|
-
const
|
|
355
|
-
exports.
|
|
356
|
-
const
|
|
357
|
-
exports.
|
|
358
|
-
const
|
|
359
|
-
exports.
|
|
360
|
-
const
|
|
361
|
-
exports.
|
|
362
|
-
const
|
|
363
|
-
exports.
|
|
364
|
-
const
|
|
365
|
-
exports.
|
|
330
|
+
const interleaveWith = interleaveWith_1;
|
|
331
|
+
exports.interleaveWith = interleaveWith;
|
|
332
|
+
const map = map_1;
|
|
333
|
+
exports.map = map;
|
|
334
|
+
const mapAccum = mapAccum_1;
|
|
335
|
+
exports.mapAccum = mapAccum;
|
|
336
|
+
const mapAccumIO = mapAccumIO_1;
|
|
337
|
+
exports.mapAccumIO = mapAccumIO;
|
|
338
|
+
const mapChunks = mapChunks_1;
|
|
339
|
+
exports.mapChunks = mapChunks;
|
|
340
|
+
const mapConcatChunk = mapConcatChunk_1;
|
|
341
|
+
exports.mapConcatChunk = mapConcatChunk;
|
|
342
|
+
const mapError = mapError_1;
|
|
343
|
+
exports.mapError = mapError;
|
|
344
|
+
const mapIO = mapIO_1;
|
|
345
|
+
exports.mapIO = mapIO;
|
|
346
|
+
const mergeMap = mergeMap_1;
|
|
347
|
+
exports.mergeMap = mergeMap;
|
|
348
|
+
const mergeEither = mergeEither_1;
|
|
349
|
+
exports.mergeEither = mergeEither;
|
|
350
|
+
const mergeWith = mergeWith_1;
|
|
351
|
+
exports.mergeWith = mergeWith;
|
|
352
|
+
const orElse = orElse_1;
|
|
353
|
+
exports.orElse = orElse;
|
|
354
|
+
const pipeThrough = pipeThrough_1;
|
|
355
|
+
exports.pipeThrough = pipeThrough;
|
|
356
|
+
const provideEnvironment = provideEnvironment_1;
|
|
357
|
+
exports.provideEnvironment = provideEnvironment;
|
|
358
|
+
const provideLayer = provideLayer_1;
|
|
359
|
+
exports.provideLayer = provideLayer;
|
|
366
360
|
const repeatIOMaybe = repeatIOMaybe_1;
|
|
367
361
|
exports.repeatIOMaybe = repeatIOMaybe;
|
|
368
362
|
const repeatIOChunkMaybe = repeatIOChunkMaybe_1;
|
|
369
363
|
exports.repeatIOChunkMaybe = repeatIOChunkMaybe;
|
|
370
|
-
const
|
|
371
|
-
exports.
|
|
372
|
-
const
|
|
373
|
-
exports.
|
|
374
|
-
const
|
|
375
|
-
exports.
|
|
376
|
-
const
|
|
377
|
-
exports.
|
|
378
|
-
const
|
|
379
|
-
exports.
|
|
380
|
-
const
|
|
381
|
-
exports.
|
|
382
|
-
const
|
|
383
|
-
exports.
|
|
384
|
-
const
|
|
385
|
-
exports.
|
|
364
|
+
const run = run_1;
|
|
365
|
+
exports.run = run;
|
|
366
|
+
const runForeachScoped = runForeachScoped_1;
|
|
367
|
+
exports.runForeachScoped = runForeachScoped;
|
|
368
|
+
const runIntoElementsScoped = runIntoElementsScoped_1;
|
|
369
|
+
exports.runIntoElementsScoped = runIntoElementsScoped;
|
|
370
|
+
const runIntoQueueScoped = runIntoQueueScoped_1;
|
|
371
|
+
exports.runIntoQueueScoped = runIntoQueueScoped;
|
|
372
|
+
const runIntoHubScoped = runIntoHubScoped_1;
|
|
373
|
+
exports.runIntoHubScoped = runIntoHubScoped;
|
|
374
|
+
const runScoped = runScoped_1;
|
|
375
|
+
exports.runScoped = runScoped;
|
|
376
|
+
const scanIO = scanIO_1;
|
|
377
|
+
exports.scanIO = scanIO;
|
|
378
|
+
const scanReduceIO = scanReduceIO_1;
|
|
379
|
+
exports.scanReduceIO = scanReduceIO;
|
|
386
380
|
const succeedNow = succeedNow_1;
|
|
387
381
|
exports.succeedNow = succeedNow;
|
|
388
|
-
const
|
|
389
|
-
exports.
|
|
390
|
-
const
|
|
391
|
-
exports.
|
|
382
|
+
const throttleEnforceIO = throttleEnforceIO_1;
|
|
383
|
+
exports.throttleEnforceIO = throttleEnforceIO;
|
|
384
|
+
const toHub = toHub_1;
|
|
385
|
+
exports.toHub = toHub;
|
|
392
386
|
const toPull = toPull_1;
|
|
393
387
|
exports.toPull = toPull;
|
|
394
|
-
const
|
|
395
|
-
exports.
|
|
396
|
-
const
|
|
397
|
-
exports.
|
|
388
|
+
const toQueue = toQueue_1;
|
|
389
|
+
exports.toQueue = toQueue;
|
|
390
|
+
const toQueueOfElements = toQueueOfElements_1;
|
|
391
|
+
exports.toQueueOfElements = toQueueOfElements;
|
|
398
392
|
const toQueueUnbounded = toQueueUnbounded_1;
|
|
399
393
|
exports.toQueueUnbounded = toQueueUnbounded;
|
|
400
394
|
const unfoldChunkIO = unfoldChunkIO_1;
|
|
@@ -414,7 +408,7 @@ exports.unwrapScoped = unwrapScoped;
|
|
|
414
408
|
* @tsplus getter fncts.io.Stream absolve
|
|
415
409
|
*/
|
|
416
410
|
function absolve(self, __tsplusTrace) {
|
|
417
|
-
return mapIO_1(
|
|
411
|
+
return mapIO_1(either => tsplus_module_1.fromEither(() => either, __tsplusTrace), __tsplusTrace)(self);
|
|
418
412
|
}
|
|
419
413
|
/**
|
|
420
414
|
* Aggregates elements of this stream using the provided sink for as long
|
|
@@ -428,22 +422,26 @@ function absolve(self, __tsplusTrace) {
|
|
|
428
422
|
* Any sink can be used here, but see `Sink.foldWeightedM` and `Sink.foldUntilM` for
|
|
429
423
|
* sinks that cover the common usecases.
|
|
430
424
|
*
|
|
431
|
-
* @tsplus
|
|
425
|
+
* @tsplus pipeable fncts.io.Stream aggregateAsync
|
|
432
426
|
*/
|
|
433
427
|
|
|
434
428
|
|
|
435
|
-
function
|
|
436
|
-
return
|
|
429
|
+
function aggregateAsync(sink, __tsplusTrace) {
|
|
430
|
+
return stream => {
|
|
431
|
+
return aggregateAsyncWithin_1(sink, tsplus_module_2.forever, __tsplusTrace)(stream);
|
|
432
|
+
};
|
|
437
433
|
}
|
|
438
434
|
/**
|
|
439
435
|
* Like `aggregateAsyncWithinEither`, but only returns the `Right` results.
|
|
440
436
|
*
|
|
441
|
-
* @tsplus
|
|
437
|
+
* @tsplus pipeable fncts.io.Stream aggregateAsyncWithin
|
|
442
438
|
*/
|
|
443
439
|
|
|
444
440
|
|
|
445
|
-
function aggregateAsyncWithin_1(
|
|
446
|
-
return
|
|
441
|
+
function aggregateAsyncWithin_1(sink, schedule, __tsplusTrace) {
|
|
442
|
+
return stream => {
|
|
443
|
+
return filterMap_1(cb => tsplus_module_4.match(() => tsplus_module_3.nothing(), tsplus_module_3.just)(cb), __tsplusTrace)(aggregateAsyncWithinEither_1(sink, schedule, __tsplusTrace)(stream));
|
|
444
|
+
};
|
|
447
445
|
}
|
|
448
446
|
/**
|
|
449
447
|
* Aggregates elements using the provided sink until it completes, or until the
|
|
@@ -457,96 +455,104 @@ function aggregateAsyncWithin_1(stream, sink, schedule, __tsplusTrace) {
|
|
|
457
455
|
* Aggregated elements will be fed into the schedule to determine the delays between
|
|
458
456
|
* pulls.
|
|
459
457
|
*
|
|
460
|
-
* @tsplus
|
|
461
|
-
*/
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
function aggregateAsyncWithinEither_1(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
458
|
+
* @tsplus pipeable fncts.io.Stream aggregateAsyncWithinEither
|
|
459
|
+
*/
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
function aggregateAsyncWithinEither_1(sink, schedule, __tsplusTrace) {
|
|
463
|
+
return stream => {
|
|
464
|
+
const deps = tsplus_module_9.sequenceT(tsplus_module_5.make(), tsplus_module_6.make(() => new _SinkEndReason2.ScheduleEnd(), __tsplusTrace), tsplus_module_6.make(() => tsplus_module_7.empty(), __tsplusTrace), tsplus_module_8.driver(schedule, __tsplusTrace), tsplus_module_6.make(() => false, __tsplusTrace));
|
|
465
|
+
return flatMap_1(([handoff, sinkEndReason, sinkLeftovers, scheduleDriver, consumed]) => {
|
|
466
|
+
const handoffProducer = tsplus_module_10.readWithCause(_in => tsplus_module_11.apSecond(handoffProducer)(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_5.emit(_in))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_5.halt(cause))(handoff)), _ => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.UpstreamEnd()))(handoff)));
|
|
467
|
+
const handoffConsumer = tsplus_module_10.unwrap(() => tsplus_module_1.flatMap(leftovers => {
|
|
468
|
+
if (tsplus_module_12.isNonEmpty(leftovers)) {
|
|
469
|
+
return tsplus_module_1.apSecond(tsplus_module_1.succeedNow(tsplus_module_11.apSecond(handoffConsumer)(tsplus_module_10.writeNow(leftovers)), __tsplusTrace), __tsplusTrace)(consumed.set(true, __tsplusTrace));
|
|
470
|
+
} else {
|
|
471
|
+
return tsplus_module_1.map(signal => tsplus_module_5.matchSignal({
|
|
472
|
+
Emit: ({
|
|
473
|
+
els
|
|
474
|
+
}) => tsplus_module_11.apSecond(handoffConsumer)(tsplus_module_11.apSecond(tsplus_module_10.writeNow(els))(tsplus_module_10.fromIO(() => consumed.set(true, __tsplusTrace)))),
|
|
475
|
+
Halt: ({
|
|
476
|
+
error
|
|
477
|
+
}) => tsplus_module_11.failCause(() => error),
|
|
478
|
+
End: ({
|
|
479
|
+
reason
|
|
480
|
+
}) => {
|
|
481
|
+
if (reason._tag === "ScheduleEnd"
|
|
482
|
+
/* SinkEndReasonTag.ScheduleEnd */
|
|
483
|
+
) {
|
|
484
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(p => p ? tsplus_module_10.fromIO(() => sinkEndReason.set(new _SinkEndReason2.ScheduleEnd(), __tsplusTrace)) : tsplus_module_11.apSecond(handoffConsumer)(tsplus_module_10.fromIO(() => sinkEndReason.set(new _SinkEndReason2.ScheduleEnd(), __tsplusTrace))), __tsplusTrace)(consumed.get));
|
|
485
|
+
} else {
|
|
486
|
+
return tsplus_module_10.fromIO(() => sinkEndReason.set(reason, __tsplusTrace));
|
|
487
|
+
}
|
|
488
488
|
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}, __tsplusTrace));
|
|
493
|
-
|
|
494
|
-
function timeout(lastB, __tsplusTrace) {
|
|
495
|
-
return scheduleDriver.next(lastB, __tsplusTrace);
|
|
496
|
-
}
|
|
489
|
+
})(signal), __tsplusTrace)(tsplus_module_5.take(handoff));
|
|
490
|
+
}
|
|
491
|
+
}, __tsplusTrace)(sinkLeftovers.getAndSet(tsplus_module_7.empty(), __tsplusTrace)));
|
|
497
492
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
function handleSide(leftovers, b, c, __tsplusTrace) {
|
|
502
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.apSecond_(tsplus_module_13.set_(sinkLeftovers, tsplus_module_12.flatten(leftovers), __tsplusTrace), tsplus_module_1.map_(tsplus_module_14.get(sinkEndReason, __tsplusTrace), reason => tsplus_module_21.matchSinkEndReason_(reason, {
|
|
503
|
-
ScheduleEnd: () => tsplus_module_10.unwrapScoped(() => tsplus_module_1.flatMap_(tsplus_module_14.get(consumed, __tsplusTrace), consumed_ => tsplus_module_1.flatMap_(forkSink, sinkFiber => tsplus_module_1.map_(tsplus_module_17.forkScoped(timeout(tsplus_module_3.just(b), __tsplusTrace), __tsplusTrace), scheduleFiber => {
|
|
504
|
-
const toWrite = tsplus_module_20.match_(c, () => tsplus_module_19.make(tsplus_module_18.right(b)), c => tsplus_module_19.make(tsplus_module_18.right(b), tsplus_module_18.left(c)));
|
|
505
|
-
return consumed_ ? tsplus_module_11.apSecond_(tsplus_module_10.write(() => toWrite), scheduledAggregator(sinkFiber, scheduleFiber)) : scheduledAggregator(sinkFiber, scheduleFiber);
|
|
506
|
-
}, __tsplusTrace), __tsplusTrace), __tsplusTrace)),
|
|
507
|
-
UpstreamEnd: () => tsplus_module_10.unwrap(() => tsplus_module_1.map_(tsplus_module_14.get(consumed, __tsplusTrace), p => p ? tsplus_module_10.write(() => tsplus_module_19.make(tsplus_module_18.right(b))) : tsplus_module_10.unit, __tsplusTrace))
|
|
508
|
-
}), __tsplusTrace), __tsplusTrace));
|
|
493
|
+
function timeout(lastB, __tsplusTrace) {
|
|
494
|
+
return scheduleDriver.next(lastB, __tsplusTrace);
|
|
509
495
|
}
|
|
510
496
|
|
|
511
|
-
|
|
512
|
-
|
|
497
|
+
const scheduledAggregator = (sinkFiber, scheduleFiber) => {
|
|
498
|
+
const forkSink = tsplus_module_1.apSecond(tsplus_module_14.forkScoped(tsplus_module_13.runScoped(tsplus_module_10.doneCollect(tsplus_module_10.pipeToOrFail(sink.channel)(handoffConsumer))), __tsplusTrace), __tsplusTrace)(consumed.set(false, __tsplusTrace));
|
|
499
|
+
|
|
500
|
+
function handleSide(leftovers, b, c, __tsplusTrace) {
|
|
501
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.apSecond(tsplus_module_1.map(reason => tsplus_module_18.matchSinkEndReason({
|
|
502
|
+
ScheduleEnd: () => tsplus_module_10.unwrapScoped(() => tsplus_module_1.flatMap(consumed_ => tsplus_module_1.flatMap(sinkFiber => tsplus_module_1.map(scheduleFiber => {
|
|
503
|
+
const toWrite = tsplus_module_17.match(() => tsplus_module_16.make(tsplus_module_15.right(b)), c => tsplus_module_16.make(tsplus_module_15.right(b), tsplus_module_15.left(c)))(c);
|
|
504
|
+
return consumed_ ? tsplus_module_11.apSecond(scheduledAggregator(sinkFiber, scheduleFiber))(tsplus_module_10.write(() => toWrite)) : scheduledAggregator(sinkFiber, scheduleFiber);
|
|
505
|
+
}, __tsplusTrace)(tsplus_module_14.forkScoped(timeout(tsplus_module_3.just(b), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(forkSink), __tsplusTrace)(consumed.get)),
|
|
506
|
+
UpstreamEnd: () => tsplus_module_10.unwrap(() => tsplus_module_1.map(p => p ? tsplus_module_10.write(() => tsplus_module_16.make(tsplus_module_15.right(b))) : tsplus_module_10.unit, __tsplusTrace)(consumed.get))
|
|
507
|
+
})(reason), __tsplusTrace)(sinkEndReason.get), __tsplusTrace)(sinkLeftovers.set(tsplus_module_12.flatten(leftovers), __tsplusTrace)));
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return tsplus_module_10.unwrap(() => tsplus_module_21.raceWith(() => tsplus_module_19.join(scheduleFiber, __tsplusTrace), (sinkExit, scheduleFiber) => tsplus_module_1.apSecond(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)(tsplus_module_1.fromExit(() => sinkExit, __tsplusTrace)), __tsplusTrace)(tsplus_module_20.interrupt(scheduleFiber, __tsplusTrace)), (scheduleExit, sinkFiber) => tsplus_module_1.matchCauseIO(cause => tsplus_module_4.match(() => tsplus_module_1.apSecond(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)(tsplus_module_19.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_21.forkDaemon(tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd()))(handoff), __tsplusTrace)), cause => tsplus_module_1.apSecond(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)(tsplus_module_19.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_21.forkDaemon(tsplus_module_5.offer(tsplus_module_5.halt(cause))(handoff), __tsplusTrace)))(tsplus_module_22.failureOrCause(cause)), c => tsplus_module_1.apSecond(tsplus_module_1.map(([leftovers, b]) => handleSide(leftovers, b, tsplus_module_3.just(c), __tsplusTrace), __tsplusTrace)(tsplus_module_19.join(sinkFiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_21.forkDaemon(tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.ScheduleEnd()))(handoff), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fromExit(() => scheduleExit, __tsplusTrace)), __tsplusTrace)(tsplus_module_19.join(sinkFiber, __tsplusTrace)));
|
|
511
|
+
};
|
|
513
512
|
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
return unwrapScoped_1(tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(sinkFiber => tsplus_module_1.map(scheduleFiber => new _definition2.Stream(scheduledAggregator(sinkFiber, scheduleFiber)), __tsplusTrace)(tsplus_module_14.forkScoped(timeout(tsplus_module_3.nothing(), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(tsplus_module_14.forkScoped(tsplus_module_13.runScoped(tsplus_module_10.doneCollect(tsplus_module_10.pipeToOrFail(sink.channel)(handoffConsumer))), __tsplusTrace)), __tsplusTrace)(tsplus_module_14.forkScoped(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(handoffProducer)(stream.channel)), __tsplusTrace)), __tsplusTrace);
|
|
514
|
+
}, __tsplusTrace)(fromIO_1(deps, __tsplusTrace));
|
|
515
|
+
};
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
518
|
* Composes this stream with the specified stream to create a cartesian product of elements,
|
|
519
519
|
* but keeps only elements from this stream.
|
|
520
520
|
* The `that` stream would be run multiple times, for every element in the `this` stream.
|
|
521
521
|
*
|
|
522
|
-
* @tsplus
|
|
522
|
+
* @tsplus pipeable fncts.io.Stream apFirst
|
|
523
523
|
*/
|
|
524
524
|
|
|
525
525
|
|
|
526
|
-
function
|
|
527
|
-
return
|
|
526
|
+
function apFirst(that, __tsplusTrace) {
|
|
527
|
+
return stream => {
|
|
528
|
+
return crossWith_1(that, (a, _) => a, __tsplusTrace)(stream);
|
|
529
|
+
};
|
|
528
530
|
}
|
|
529
531
|
/**
|
|
530
532
|
* Composes this stream with the specified stream to create a cartesian product of elements,
|
|
531
533
|
* but keeps only elements from the other stream.
|
|
532
534
|
* The `that` stream would be run multiple times, for every element in the `this` stream.
|
|
533
535
|
*
|
|
534
|
-
* @tsplus
|
|
536
|
+
* @tsplus pipeable fncts.io.Stream apSecond
|
|
535
537
|
*/
|
|
536
538
|
|
|
537
539
|
|
|
538
|
-
function apSecond_1(
|
|
539
|
-
return
|
|
540
|
+
function apSecond_1(that, __tsplusTrace) {
|
|
541
|
+
return stream => {
|
|
542
|
+
return crossWith_1(that, (_, b) => b, __tsplusTrace)(stream);
|
|
543
|
+
};
|
|
540
544
|
}
|
|
541
545
|
/**
|
|
542
546
|
* Maps the success values of this stream to the specified constant value.
|
|
543
547
|
*
|
|
544
|
-
* @tsplus
|
|
548
|
+
* @tsplus pipeable fncts.io.Stream as
|
|
545
549
|
*/
|
|
546
550
|
|
|
547
551
|
|
|
548
|
-
function
|
|
549
|
-
return
|
|
552
|
+
function as(b, __tsplusTrace) {
|
|
553
|
+
return stream => {
|
|
554
|
+
return map_1(() => b(), __tsplusTrace)(stream);
|
|
555
|
+
};
|
|
550
556
|
}
|
|
551
557
|
/**
|
|
552
558
|
* @tsplus static fncts.io.StreamOps asyncInterrupt
|
|
@@ -554,13 +560,13 @@ function as_(stream, b, __tsplusTrace) {
|
|
|
554
560
|
|
|
555
561
|
|
|
556
562
|
function asyncInterrupt_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
557
|
-
return unwrapScoped_1(tsplus_module_1.
|
|
558
|
-
const
|
|
563
|
+
return unwrapScoped_1(tsplus_module_1.flatMap(output => tsplus_module_1.flatMap(runtime => tsplus_module_1.map(eitherStream => tsplus_module_4.match(canceler => {
|
|
564
|
+
const loop = tsplus_module_10.unwrap(() => tsplus_module_1.match(maybeError => tsplus_module_17.match(() => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow)(maybeError), as => tsplus_module_11.apSecond(loop)(tsplus_module_10.writeNow(as)), __tsplusTrace)(tsplus_module_1.flatMap(take => tsplus_module_23.done(take), __tsplusTrace)(output.take)));
|
|
565
|
+
return ensuring_1(canceler, __tsplusTrace)(new _definition2.Stream(loop));
|
|
566
|
+
}, stream => unwrap_1(tsplus_module_1.as(() => stream, __tsplusTrace)(output.shutdown), __tsplusTrace))(eitherStream), __tsplusTrace)(tsplus_module_1.succeed(() => register((k, cb) => {
|
|
567
|
+
const effect = tsplus_module_1.flatMap(a => output.offer(a, __tsplusTrace), __tsplusTrace)(tsplus_module_23.fromPull(k));
|
|
559
568
|
return runtime.unsafeRunAsyncWith(effect, cb || _function.constVoid, __tsplusTrace);
|
|
560
|
-
}), __tsplusTrace),
|
|
561
|
-
const loop = tsplus_module_10.unwrap(() => tsplus_module_1.match_(tsplus_module_1.flatMap_(tsplus_module_27.take(output, __tsplusTrace), take => tsplus_module_26.done(take), __tsplusTrace), maybeError => tsplus_module_20.match_(maybeError, () => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow), as => tsplus_module_11.apSecond_(tsplus_module_10.writeNow(as), loop), __tsplusTrace));
|
|
562
|
-
return ensuring_1(new _definition2.Stream(loop), canceler, __tsplusTrace);
|
|
563
|
-
}, stream => unwrap_1(tsplus_module_1.as_(tsplus_module_27.shutdown(output, __tsplusTrace), () => stream, __tsplusTrace), __tsplusTrace)), __tsplusTrace), __tsplusTrace), __tsplusTrace), __tsplusTrace);
|
|
569
|
+
}), __tsplusTrace)), __tsplusTrace)(tsplus_module_24.runtime(__tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeBounded(outputBuffer, __tsplusTrace), queue => queue.shutdown, __tsplusTrace)), __tsplusTrace);
|
|
564
570
|
}
|
|
565
571
|
/**
|
|
566
572
|
* Creates a stream from an asynchronous callback that can be called multiple times.
|
|
@@ -573,7 +579,7 @@ function asyncInterrupt_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
|
573
579
|
|
|
574
580
|
|
|
575
581
|
function asyncMaybe_1(register, outputBuffer = 16, __tsplusTrace) {
|
|
576
|
-
return asyncInterrupt_1(k =>
|
|
582
|
+
return asyncInterrupt_1(k => tsplus_module_17.match(() => tsplus_module_15.left(tsplus_module_1.unit), tsplus_module_15.right)(register(k)), outputBuffer, __tsplusTrace);
|
|
577
583
|
}
|
|
578
584
|
/**
|
|
579
585
|
* @tsplus static fncts.io.StreamOps async
|
|
@@ -592,19 +598,21 @@ function async(register, outputBuffer = 16, __tsplusTrace) {
|
|
|
592
598
|
|
|
593
599
|
|
|
594
600
|
function asyncIO(register, outputBuffer = 16, __tsplusTrace) {
|
|
595
|
-
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.
|
|
596
|
-
const loop = tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
601
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.flatMap(output => tsplus_module_1.flatMap(runtime => tsplus_module_1.map(() => {
|
|
602
|
+
const loop = tsplus_module_10.unwrap(() => tsplus_module_1.matchCauseIO(cause => tsplus_module_1.as(() => tsplus_module_4.match(maybeError => tsplus_module_17.match(() => tsplus_module_11.endNow(undefined), tsplus_module_10.failNow)(maybeError), tsplus_module_11.failCauseNow)(tsplus_module_22.failureOrCause(cause)), __tsplusTrace)(output.shutdown), as => tsplus_module_1.succeed(() => tsplus_module_11.apSecond(loop)(tsplus_module_10.writeNow(as)), __tsplusTrace), __tsplusTrace)(tsplus_module_1.flatMap(take => tsplus_module_23.done(take), __tsplusTrace)(output.take)));
|
|
597
603
|
return loop;
|
|
598
|
-
}, __tsplusTrace), __tsplusTrace), __tsplusTrace)));
|
|
604
|
+
}, __tsplusTrace)(register((k, cb) => runtime.unsafeRunAsyncWith(tsplus_module_1.flatMap(a => output.offer(a, __tsplusTrace), __tsplusTrace)(tsplus_module_23.fromPull(k)), cb || _function.constVoid, __tsplusTrace))), __tsplusTrace)(tsplus_module_24.runtime(__tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeBounded(outputBuffer, __tsplusTrace), _ => _.shutdown, __tsplusTrace))));
|
|
599
605
|
}
|
|
600
606
|
/**
|
|
601
607
|
* Returns a stream whose failure and success channels have been mapped by
|
|
602
608
|
* the specified pair of functions, `f` and `g`.
|
|
609
|
+
*
|
|
610
|
+
* @tsplus pipeable fncts.io.Stream bimap
|
|
603
611
|
*/
|
|
604
612
|
|
|
605
613
|
|
|
606
|
-
function
|
|
607
|
-
return map_1(
|
|
614
|
+
function bimap(f, g, __tsplusTrace) {
|
|
615
|
+
return stream => map_1(g, __tsplusTrace)(mapError_1(f, __tsplusTrace)(stream));
|
|
608
616
|
}
|
|
609
617
|
/**
|
|
610
618
|
* Creates a stream from a single value that will get cleaned up after the
|
|
@@ -614,8 +622,8 @@ function bimap_(stream, f, g, __tsplusTrace) {
|
|
|
614
622
|
*/
|
|
615
623
|
|
|
616
624
|
|
|
617
|
-
function
|
|
618
|
-
return scoped_1(
|
|
625
|
+
function acquireRelease(acquire, release, __tsplusTrace) {
|
|
626
|
+
return scoped_1(() => tsplus_module_26.acquireRelease(() => acquire, release, __tsplusTrace), __tsplusTrace);
|
|
619
627
|
}
|
|
620
628
|
/**
|
|
621
629
|
* Creates a stream from a single value that will get cleaned up after the
|
|
@@ -625,32 +633,36 @@ function acquireRelease_(acquire, release, __tsplusTrace) {
|
|
|
625
633
|
*/
|
|
626
634
|
|
|
627
635
|
|
|
628
|
-
function
|
|
629
|
-
return scoped_1(
|
|
636
|
+
function acquireReleaseExit(acquire, release, __tsplusTrace) {
|
|
637
|
+
return scoped_1(() => tsplus_module_27.acquireReleaseExit(() => acquire, release, __tsplusTrace), __tsplusTrace);
|
|
630
638
|
}
|
|
631
639
|
/**
|
|
632
640
|
* Fan out the stream, producing a list of streams that have the same elements as this stream.
|
|
633
641
|
* The driver stream will only ever advance of the `maximumLag` chunks before the
|
|
634
642
|
* slowest downstream stream.
|
|
635
643
|
*
|
|
636
|
-
* @tsplus
|
|
644
|
+
* @tsplus pipeable fncts.io.Stream broadcast
|
|
637
645
|
*/
|
|
638
646
|
|
|
639
647
|
|
|
640
|
-
function
|
|
641
|
-
return
|
|
648
|
+
function broadcast(n, maximumLag, __tsplusTrace) {
|
|
649
|
+
return stream => {
|
|
650
|
+
return tsplus_module_1.map(c => tsplus_module_12.map(hub => flattenTake_1(fromQueueWithShutdown_1(hub), __tsplusTrace))(c), __tsplusTrace)(broadcastedQueues_1(n, maximumLag, __tsplusTrace)(stream));
|
|
651
|
+
};
|
|
642
652
|
}
|
|
643
653
|
/**
|
|
644
654
|
* Fan out the stream, producing a dynamic number of streams that have the same elements as this stream.
|
|
645
655
|
* The driver stream will only ever advance of the `maximumLag` chunks before the
|
|
646
656
|
* slowest downstream stream.
|
|
647
657
|
*
|
|
648
|
-
* @tsplus
|
|
658
|
+
* @tsplus pipeable fncts.io.Stream broadcastDynamic
|
|
649
659
|
*/
|
|
650
660
|
|
|
651
661
|
|
|
652
|
-
function
|
|
653
|
-
return
|
|
662
|
+
function broadcastDynamic(maximumLag, __tsplusTrace) {
|
|
663
|
+
return stream => {
|
|
664
|
+
return tsplus_module_1.map(scoped => flattenTake_1(flatMap_1(fromQueue_1, __tsplusTrace)(scoped_1(() => scoped, __tsplusTrace)), __tsplusTrace), __tsplusTrace)(broadcastedQueuesDynamic_1(maximumLag, __tsplusTrace)(stream));
|
|
665
|
+
};
|
|
654
666
|
}
|
|
655
667
|
/**
|
|
656
668
|
* Converts the stream to a managed list of queues. Every value will be replicated to every queue with the
|
|
@@ -658,12 +670,14 @@ function broadcastDynamic_(stream, maximumLag, __tsplusTrace) {
|
|
|
658
670
|
*
|
|
659
671
|
* Queues can unsubscribe from upstream by shutting down.
|
|
660
672
|
*
|
|
661
|
-
* @tsplus
|
|
673
|
+
* @tsplus pipeable fncts.io.Stream broadcastedQueues
|
|
662
674
|
*/
|
|
663
675
|
|
|
664
676
|
|
|
665
|
-
function broadcastedQueues_1(
|
|
666
|
-
return
|
|
677
|
+
function broadcastedQueues_1(n, maximumLag, __tsplusTrace) {
|
|
678
|
+
return stream => {
|
|
679
|
+
return tsplus_module_1.flatMap(hub => tsplus_module_1.flatMap(queues => tsplus_module_1.map(() => queues, __tsplusTrace)(tsplus_module_1.fork(runIntoHubScoped_1(hub, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.sequenceIterable(tsplus_module_28.replicate(n, hub.subscribe), __tsplusTrace)), __tsplusTrace)(tsplus_module_29.makeBounded(maximumLag, __tsplusTrace));
|
|
680
|
+
};
|
|
667
681
|
}
|
|
668
682
|
/**
|
|
669
683
|
* Converts the stream to a managed dynamic amount of queues. Every chunk will be replicated to every queue with the
|
|
@@ -671,39 +685,45 @@ function broadcastedQueues_1(stream, n, maximumLag, __tsplusTrace) {
|
|
|
671
685
|
*
|
|
672
686
|
* Queues can unsubscribe from upstream by shutting down.
|
|
673
687
|
*
|
|
674
|
-
* @tsplus
|
|
688
|
+
* @tsplus pipeable fncts.io.Stream broadcastedQueuesDynamic
|
|
675
689
|
*/
|
|
676
690
|
|
|
677
691
|
|
|
678
|
-
function broadcastedQueuesDynamic_1(
|
|
679
|
-
return
|
|
692
|
+
function broadcastedQueuesDynamic_1(maximumLag, __tsplusTrace) {
|
|
693
|
+
return stream => {
|
|
694
|
+
return tsplus_module_1.map(hub => hub.subscribe, __tsplusTrace)(toHub_1(maximumLag, __tsplusTrace)(stream));
|
|
695
|
+
};
|
|
680
696
|
}
|
|
681
697
|
/**
|
|
682
698
|
* Allows a faster producer to progress independently of a slower consumer by buffering
|
|
683
699
|
* up to `capacity` elements in a queue.
|
|
684
700
|
*
|
|
685
|
-
* @tsplus
|
|
701
|
+
* @tsplus pipeable fncts.io.Stream buffer
|
|
686
702
|
*/
|
|
687
703
|
|
|
688
704
|
|
|
689
|
-
function
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
705
|
+
function buffer(capacity, __tsplusTrace) {
|
|
706
|
+
return stream => {
|
|
707
|
+
const queue = toQueueOfElements_1(capacity, __tsplusTrace)(stream);
|
|
708
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
|
709
|
+
const process = tsplus_module_11.flatMap(exit => tsplus_module_30.match(cause => tsplus_module_17.match(() => tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow)(tsplus_module_22.flipCauseOption(cause)), value => tsplus_module_11.apSecond(process)(tsplus_module_10.writeNow(tsplus_module_16.single(value))))(exit))(tsplus_module_10.fromIO(() => queue.take));
|
|
710
|
+
return process;
|
|
711
|
+
}, __tsplusTrace)(queue)));
|
|
712
|
+
};
|
|
695
713
|
}
|
|
696
714
|
/**
|
|
697
|
-
* @tsplus
|
|
715
|
+
* @tsplus pipeable fncts.io.Stream bufferChunks
|
|
698
716
|
*/
|
|
699
717
|
|
|
700
718
|
|
|
701
|
-
function
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
719
|
+
function bufferChunks(capacity, __tsplusTrace) {
|
|
720
|
+
return stream => {
|
|
721
|
+
const queue = toQueue_1(capacity, __tsplusTrace)(stream);
|
|
722
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
|
723
|
+
const process = tsplus_module_11.flatMap(take => tsplus_module_23.match(tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.apSecond(process)(tsplus_module_10.writeNow(value)))(take))(tsplus_module_10.fromIO(() => queue.take));
|
|
724
|
+
return process;
|
|
725
|
+
}, __tsplusTrace)(queue)));
|
|
726
|
+
};
|
|
707
727
|
}
|
|
708
728
|
/**
|
|
709
729
|
* Allows a faster producer to progress independently of a slower consumer by buffering
|
|
@@ -715,79 +735,89 @@ function bufferChunks_(stream, capacity, __tsplusTrace) {
|
|
|
715
735
|
|
|
716
736
|
function bufferUnbounded(stream, __tsplusTrace) {
|
|
717
737
|
const queue = toQueueUnbounded_1(stream, __tsplusTrace);
|
|
718
|
-
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.
|
|
719
|
-
const process = tsplus_module_11.
|
|
738
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(queue => {
|
|
739
|
+
const process = tsplus_module_11.flatMap(take => tsplus_module_23.match(tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.apSecond(process)(tsplus_module_10.writeNow(value)))(take))(tsplus_module_10.fromIO(() => queue.take));
|
|
720
740
|
return process;
|
|
721
|
-
}, __tsplusTrace)));
|
|
741
|
+
}, __tsplusTrace)(queue)));
|
|
722
742
|
}
|
|
723
743
|
|
|
724
744
|
function bufferSignalProducer(queue, ref, __tsplusTrace) {
|
|
725
|
-
const terminate = take => tsplus_module_10.fromIO(() => tsplus_module_1.
|
|
745
|
+
const terminate = take => tsplus_module_10.fromIO(() => tsplus_module_1.flatMap(latch => tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(p => tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(() => tsplus_module_1.map(() => void 0, __tsplusTrace)(tsplus_module_31.wait(p, __tsplusTrace)), __tsplusTrace)(ref.set(p, __tsplusTrace)), __tsplusTrace)(queue.offer((0, _function.tuple)(take, p), __tsplusTrace)), __tsplusTrace)(tsplus_module_32.make(__tsplusTrace)), __tsplusTrace)(tsplus_module_31.wait(latch, __tsplusTrace)), __tsplusTrace)(ref.get));
|
|
726
746
|
|
|
727
|
-
return tsplus_module_10.readWith(inp => tsplus_module_11.
|
|
747
|
+
return tsplus_module_10.readWith(inp => tsplus_module_11.apSecond(bufferSignalProducer(queue, ref, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_1.flatMap(p => tsplus_module_1.flatMap(added => tsplus_module_1.map(() => void 0, __tsplusTrace)(tsplus_module_1.when(() => added, __tsplusTrace)(ref.set(p, __tsplusTrace))), __tsplusTrace)(queue.offer((0, _function.tuple)(tsplus_module_23.chunk(inp), p), __tsplusTrace)), __tsplusTrace)(tsplus_module_32.make(__tsplusTrace)))), e => terminate(tsplus_module_23.fail(e)), () => terminate(tsplus_module_23.end));
|
|
728
748
|
}
|
|
729
749
|
|
|
730
750
|
function bufferSignalConsumer(queue, __tsplusTrace) {
|
|
731
|
-
const process = tsplus_module_11.
|
|
751
|
+
const process = tsplus_module_11.flatMap(([take, promise]) => tsplus_module_11.apSecond(tsplus_module_23.match(tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow, value => tsplus_module_11.apSecond(process)(tsplus_module_10.writeNow(value)))(take))(tsplus_module_10.fromIO(() => tsplus_module_31.succeed_(undefined, __tsplusTrace)(promise))))(tsplus_module_10.fromIO(() => queue.take));
|
|
732
752
|
return process;
|
|
733
753
|
}
|
|
734
754
|
/**
|
|
735
755
|
* Switches over to the stream produced by the provided function in case this one
|
|
736
756
|
* fails with a typed error.
|
|
737
757
|
*
|
|
738
|
-
* @tsplus
|
|
758
|
+
* @tsplus pipeable fncts.io.Stream catchAll
|
|
739
759
|
*/
|
|
740
760
|
|
|
741
761
|
|
|
742
|
-
function catchAll_1(
|
|
743
|
-
return
|
|
762
|
+
function catchAll_1(f, __tsplusTrace) {
|
|
763
|
+
return stream => {
|
|
764
|
+
return catchAllCause_1(cause => tsplus_module_4.match(f, failCauseNow_1)(tsplus_module_22.failureOrCause(cause)), __tsplusTrace)(stream);
|
|
765
|
+
};
|
|
744
766
|
}
|
|
745
767
|
/**
|
|
746
768
|
* Switches over to the stream produced by the provided function in case this one
|
|
747
769
|
* fails. Allows recovery from all causes of failure, including interruption if the
|
|
748
770
|
* stream is uninterruptible.
|
|
749
771
|
*
|
|
750
|
-
* @tsplus
|
|
772
|
+
* @tsplus pipeable fncts.io.Stream catchAllCause
|
|
751
773
|
*/
|
|
752
774
|
|
|
753
775
|
|
|
754
|
-
function catchAllCause_1(
|
|
755
|
-
|
|
756
|
-
|
|
776
|
+
function catchAllCause_1(f, __tsplusTrace) {
|
|
777
|
+
return stream => {
|
|
778
|
+
const channel = tsplus_module_10.catchAllCause(cause => f(cause).channel)(stream.channel);
|
|
779
|
+
return new _definition2.Stream(channel);
|
|
780
|
+
};
|
|
757
781
|
}
|
|
758
782
|
/**
|
|
759
783
|
* Switches over to the stream produced by the provided function in case this one
|
|
760
784
|
* fails with some typed error.
|
|
761
785
|
*
|
|
762
|
-
* @tsplus
|
|
786
|
+
* @tsplus pipeable fncts.io.Stream catchJust
|
|
763
787
|
*/
|
|
764
788
|
|
|
765
789
|
|
|
766
|
-
function
|
|
767
|
-
return
|
|
790
|
+
function catchJust(pf, __tsplusTrace) {
|
|
791
|
+
return stream => {
|
|
792
|
+
return catchAll_1(e => tsplus_module_33.getOrElse(() => failNow_1(e, __tsplusTrace))(pf(e)), __tsplusTrace)(stream);
|
|
793
|
+
};
|
|
768
794
|
}
|
|
769
795
|
/**
|
|
770
796
|
* Switches over to the stream produced by the provided function in case this one
|
|
771
797
|
* fails with some errors. Allows recovery from all causes of failure, including interruption if the
|
|
772
798
|
* stream is uninterruptible.
|
|
773
799
|
*
|
|
774
|
-
* @tsplus
|
|
800
|
+
* @tsplus pipeable fncts.io.Stream catchJustCause
|
|
775
801
|
*/
|
|
776
802
|
|
|
777
803
|
|
|
778
|
-
function
|
|
779
|
-
return
|
|
804
|
+
function catchJustCause(pf, __tsplusTrace) {
|
|
805
|
+
return stream => {
|
|
806
|
+
return catchAllCause_1(cause => tsplus_module_33.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(pf(cause)), __tsplusTrace)(stream);
|
|
807
|
+
};
|
|
780
808
|
}
|
|
781
809
|
/**
|
|
782
810
|
* Returns a stream made of the concatenation in strict order of all the streams
|
|
783
811
|
* produced by passing each element of this stream to `f`
|
|
784
812
|
*
|
|
785
|
-
* @tsplus
|
|
813
|
+
* @tsplus pipeable fncts.io.Stream flatMap
|
|
786
814
|
*/
|
|
787
815
|
|
|
788
816
|
|
|
789
|
-
function flatMap_1(
|
|
790
|
-
return
|
|
817
|
+
function flatMap_1(f, __tsplusTrace) {
|
|
818
|
+
return stream => {
|
|
819
|
+
return new _definition2.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));
|
|
820
|
+
};
|
|
791
821
|
}
|
|
792
822
|
/**
|
|
793
823
|
* Exposes the underlying chunks of the stream as a stream of chunks of elements
|
|
@@ -797,24 +827,26 @@ function flatMap_1(stream, f, __tsplusTrace) {
|
|
|
797
827
|
|
|
798
828
|
|
|
799
829
|
function chunks_1(stream, __tsplusTrace) {
|
|
800
|
-
return mapChunks_1(
|
|
830
|
+
return mapChunks_1(tsplus_module_16.single, __tsplusTrace)(stream);
|
|
801
831
|
}
|
|
802
832
|
/**
|
|
803
833
|
* Performs the specified stream transformation with the chunk structure of
|
|
804
834
|
* the stream exposed.
|
|
805
835
|
*
|
|
806
|
-
* @tsplus
|
|
836
|
+
* @tsplus pipeable fncts.io.Stream chunksWith
|
|
807
837
|
*/
|
|
808
838
|
|
|
809
839
|
|
|
810
|
-
function chunksWith(
|
|
811
|
-
return
|
|
840
|
+
function chunksWith(f, __tsplusTrace) {
|
|
841
|
+
return self => {
|
|
842
|
+
return flattenChunks_1(f(chunks_1(self, __tsplusTrace)), __tsplusTrace);
|
|
843
|
+
};
|
|
812
844
|
}
|
|
813
845
|
|
|
814
846
|
function changesWithWriter(f, last, __tsplusTrace) {
|
|
815
847
|
return tsplus_module_10.readWithCause(chunk => {
|
|
816
|
-
const [newLast, newChunk] = tsplus_module_12.
|
|
817
|
-
return tsplus_module_11.
|
|
848
|
+
const [newLast, newChunk] = tsplus_module_12.foldLeft([last, tsplus_module_7.empty()], ([maybeLast, os], o1) => tsplus_module_17.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);
|
|
849
|
+
return tsplus_module_11.apSecond(changesWithWriter(f, newLast, __tsplusTrace))(tsplus_module_10.writeNow(newChunk));
|
|
818
850
|
}, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit);
|
|
819
851
|
}
|
|
820
852
|
/**
|
|
@@ -822,39 +854,43 @@ function changesWithWriter(f, last, __tsplusTrace) {
|
|
|
822
854
|
* previous element emitted, using the specified function to determine
|
|
823
855
|
* whether two elements are equal.
|
|
824
856
|
*
|
|
825
|
-
* @tsplus
|
|
857
|
+
* @tsplus pipeable fncts.io.Stream changesWith
|
|
826
858
|
*/
|
|
827
859
|
|
|
828
860
|
|
|
829
|
-
function
|
|
830
|
-
return
|
|
861
|
+
function changesWith(f, __tsplusTrace) {
|
|
862
|
+
return stream => {
|
|
863
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(changesWithWriter(f, tsplus_module_3.nothing(), __tsplusTrace))(stream.channel));
|
|
864
|
+
};
|
|
831
865
|
}
|
|
832
866
|
/**
|
|
833
867
|
* Transforms all elements of the stream for as long as the specified partial function is defined.
|
|
834
868
|
*
|
|
835
|
-
* @tsplus
|
|
869
|
+
* @tsplus pipeable fncts.io.Stream collectWhile
|
|
836
870
|
*/
|
|
837
871
|
|
|
838
872
|
|
|
839
|
-
function
|
|
840
|
-
|
|
841
|
-
const
|
|
873
|
+
function collectWhile(pf, __tsplusTrace) {
|
|
874
|
+
return stream => {
|
|
875
|
+
const loop = tsplus_module_10.readWith(inp => {
|
|
876
|
+
const mapped = tsplus_module_12.collectWhile(pf)(inp);
|
|
842
877
|
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
878
|
+
if (mapped.length === inp.length) {
|
|
879
|
+
return tsplus_module_11.apSecond(loop)(tsplus_module_10.writeNow(mapped));
|
|
880
|
+
} else {
|
|
881
|
+
return tsplus_module_10.writeNow(mapped);
|
|
882
|
+
}
|
|
883
|
+
}, tsplus_module_10.failNow, tsplus_module_11.succeedNow);
|
|
884
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
|
885
|
+
};
|
|
850
886
|
}
|
|
851
887
|
/**
|
|
852
888
|
* Effectfully transforms all elements of the stream for as long as the specified partial function is defined.
|
|
853
889
|
*/
|
|
854
890
|
|
|
855
891
|
|
|
856
|
-
function
|
|
857
|
-
return new _definition2.Stream(tsplus_module_10.
|
|
892
|
+
function collectWhileIO(stream, pf, __tsplusTrace) {
|
|
893
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(collectWhileIOLoop(tsplus_module_34.empty()[Symbol.iterator](), pf, __tsplusTrace))(stream.channel));
|
|
858
894
|
}
|
|
859
895
|
|
|
860
896
|
function collectWhileIOLoop(iterator, pf, __tsplusTrace) {
|
|
@@ -863,12 +899,12 @@ function collectWhileIOLoop(iterator, pf, __tsplusTrace) {
|
|
|
863
899
|
if (next.done) {
|
|
864
900
|
return tsplus_module_10.readWithCause(elem => collectWhileIOLoop(elem[Symbol.iterator](), pf, __tsplusTrace), tsplus_module_11.failCauseNow, tsplus_module_11.succeedNow);
|
|
865
901
|
} else {
|
|
866
|
-
return tsplus_module_10.unwrap(() =>
|
|
902
|
+
return tsplus_module_10.unwrap(() => tsplus_module_17.match(() => tsplus_module_1.succeedNow(tsplus_module_10.unit, __tsplusTrace), b => tsplus_module_1.map(b => tsplus_module_11.apSecond(collectWhileIOLoop(iterator, pf, __tsplusTrace))(tsplus_module_10.writeNow(tsplus_module_16.single(b))), __tsplusTrace)(b))(pf(next.value)));
|
|
867
903
|
}
|
|
868
904
|
}
|
|
869
905
|
|
|
870
906
|
function combineProducer(handoff, latch, __tsplusTrace) {
|
|
871
|
-
return tsplus_module_11.
|
|
907
|
+
return tsplus_module_11.apSecond(tsplus_module_10.readWithCause(value => tsplus_module_11.apSecond(combineProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_35.succeed(value))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_35.failCause(tsplus_module_22.map(tsplus_module_3.just)(cause)))(handoff)), () => tsplus_module_11.apSecond(combineProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_35.fail(tsplus_module_3.nothing()))(handoff)))))(tsplus_module_10.fromIO(() => tsplus_module_5.take(latch)));
|
|
872
908
|
}
|
|
873
909
|
/**
|
|
874
910
|
* Combines the elements from this stream and the specified stream by repeatedly applying the
|
|
@@ -878,20 +914,22 @@ function combineProducer(handoff, latch, __tsplusTrace) {
|
|
|
878
914
|
*
|
|
879
915
|
* Where possible, prefer `Stream#combineChunks` for a more efficient implementation.
|
|
880
916
|
*
|
|
881
|
-
* @tsplus
|
|
917
|
+
* @tsplus pipeable fncts.io.Stream combine
|
|
882
918
|
*/
|
|
883
919
|
|
|
884
920
|
|
|
885
|
-
function
|
|
886
|
-
return
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
921
|
+
function combine(that, s, f, __tsplusTrace) {
|
|
922
|
+
return stream => {
|
|
923
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right, latchL, latchR]) => {
|
|
924
|
+
const pullLeft = tsplus_module_1.flatMap(tsplus_module_1.fromExitNow, __tsplusTrace)(tsplus_module_1.apSecond(tsplus_module_5.take(left), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchL)));
|
|
925
|
+
const pullRight = tsplus_module_1.flatMap(tsplus_module_1.fromExitNow, __tsplusTrace)(tsplus_module_1.apSecond(tsplus_module_5.take(right), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchR)));
|
|
926
|
+
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;
|
|
927
|
+
}, __tsplusTrace)(tsplus_module_1.flatMap(left => tsplus_module_1.flatMap(right => tsplus_module_1.flatMap(latchL => tsplus_module_1.flatMap(latchR => tsplus_module_1.flatMap(() => tsplus_module_1.map(() => (0, _function.tuple)(left, right, latchL, latchR), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(combineProducer(right, latchR, __tsplusTrace))(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(that.channel))), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(combineProducer(left, latchL, __tsplusTrace))(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(stream.channel))), __tsplusTrace)), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()))));
|
|
928
|
+
};
|
|
891
929
|
}
|
|
892
930
|
|
|
893
931
|
function combineChunksProducer(handoff, latch, __tsplusTrace) {
|
|
894
|
-
return tsplus_module_11.
|
|
932
|
+
return tsplus_module_11.apSecond(tsplus_module_10.readWithCause(chunk => tsplus_module_11.apSecond(combineChunksProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_23.chunk(chunk))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_23.failCause(cause))(handoff)), () => tsplus_module_11.apSecond(combineChunksProducer(handoff, latch, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_23.end)(handoff)))))(tsplus_module_10.fromIO(() => tsplus_module_5.take(latch)));
|
|
895
933
|
}
|
|
896
934
|
/**
|
|
897
935
|
* Combines the chunks from this stream and the specified stream by repeatedly applying the
|
|
@@ -899,142 +937,158 @@ function combineChunksProducer(handoff, latch, __tsplusTrace) {
|
|
|
899
937
|
* it to the destination stream. `f` can maintain some internal state to control
|
|
900
938
|
* the combining process, with the initial state being specified by `s`.
|
|
901
939
|
*
|
|
902
|
-
* @tsplus
|
|
940
|
+
* @tsplus pipeable fncts.io.Stream combineChunks
|
|
903
941
|
*/
|
|
904
942
|
|
|
905
943
|
|
|
906
|
-
function
|
|
907
|
-
return
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
944
|
+
function combineChunks(that, s, f, __tsplusTrace) {
|
|
945
|
+
return stream => {
|
|
946
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right, latchL, latchR]) => {
|
|
947
|
+
const pullLeft = tsplus_module_1.flatMap(take => tsplus_module_23.done(take), __tsplusTrace)(tsplus_module_1.apSecond(tsplus_module_5.take(left), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchL)));
|
|
948
|
+
const pullRight = tsplus_module_1.flatMap(take => tsplus_module_23.done(take), __tsplusTrace)(tsplus_module_1.apSecond(tsplus_module_5.take(right), __tsplusTrace)(tsplus_module_5.offer(undefined)(latchR)));
|
|
949
|
+
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;
|
|
950
|
+
}, __tsplusTrace)(tsplus_module_1.flatMap(left => tsplus_module_1.flatMap(right => tsplus_module_1.flatMap(latchL => tsplus_module_1.flatMap(latchR => tsplus_module_1.flatMap(() => tsplus_module_1.map(() => (0, _function.tuple)(left, right, latchL, latchR), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(combineChunksProducer(right, latchR, __tsplusTrace))(that.channel)), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(combineChunksProducer(left, latchL, __tsplusTrace))(stream.channel)), __tsplusTrace)), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()))));
|
|
951
|
+
};
|
|
912
952
|
}
|
|
913
953
|
/**
|
|
914
954
|
* Concatenates the specified stream with this stream, resulting in a stream
|
|
915
955
|
* that emits the elements from this stream and then the elements from the specified stream.
|
|
916
956
|
*
|
|
917
|
-
* @tsplus
|
|
957
|
+
* @tsplus pipeable fncts.io.Stream concat
|
|
918
958
|
*/
|
|
919
959
|
|
|
920
960
|
|
|
921
|
-
function concat_1(
|
|
922
|
-
return
|
|
961
|
+
function concat_1(that, __tsplusTrace) {
|
|
962
|
+
return stream => {
|
|
963
|
+
return new _definition2.Stream(tsplus_module_11.apSecond(that.channel)(stream.channel));
|
|
964
|
+
};
|
|
923
965
|
}
|
|
924
966
|
/**
|
|
925
967
|
* Composes this stream with the specified stream to create a cartesian product of elements.
|
|
926
968
|
* The `that` stream would be run multiple times, for every element in the `this` stream.
|
|
927
969
|
*
|
|
928
|
-
* @tsplus
|
|
970
|
+
* @tsplus pipeable fncts.io.Stream cross
|
|
929
971
|
*/
|
|
930
972
|
|
|
931
973
|
|
|
932
|
-
function
|
|
933
|
-
return
|
|
974
|
+
function cross(that, __tsplusTrace) {
|
|
975
|
+
return stream => {
|
|
976
|
+
return new _definition2.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));
|
|
977
|
+
};
|
|
934
978
|
}
|
|
935
979
|
/**
|
|
936
980
|
* Composes this stream with the specified stream to create a cartesian product of elements
|
|
937
981
|
* with a specified function.
|
|
938
982
|
* The `fb` stream would be run multiple times, for every element in the `fa` stream.
|
|
939
983
|
*
|
|
940
|
-
* @tsplus
|
|
984
|
+
* @tsplus pipeable fncts.io.Stream crossWith
|
|
941
985
|
*/
|
|
942
986
|
|
|
943
987
|
|
|
944
|
-
function crossWith_1(
|
|
945
|
-
return
|
|
988
|
+
function crossWith_1(fb, f, __tsplusTrace) {
|
|
989
|
+
return fa => {
|
|
990
|
+
return flatMap_1(a => map_1(b => f(a, b), __tsplusTrace)(fb), __tsplusTrace)(fa);
|
|
991
|
+
};
|
|
946
992
|
}
|
|
947
993
|
/**
|
|
948
994
|
* Provides some of the environment required to run this effect,
|
|
949
995
|
* leaving the remainder `R0`.
|
|
950
996
|
*
|
|
951
|
-
* @tsplus
|
|
997
|
+
* @tsplus pipeable fncts.io.Stream contramapEnvironment
|
|
952
998
|
*/
|
|
953
999
|
|
|
954
1000
|
|
|
955
|
-
function
|
|
956
|
-
return
|
|
1001
|
+
function contramapEnvironment(f, __tsplusTrace) {
|
|
1002
|
+
return ra => {
|
|
1003
|
+
return flatMap_1(r0 => provideEnvironment_1(f(r0), __tsplusTrace)(ra), __tsplusTrace)(environment_1(__tsplusTrace));
|
|
1004
|
+
};
|
|
957
1005
|
}
|
|
958
1006
|
/**
|
|
959
|
-
* @tsplus
|
|
1007
|
+
* @tsplus pipeable fncts.io.Stream debounce
|
|
960
1008
|
*/
|
|
961
1009
|
|
|
962
1010
|
|
|
963
|
-
function
|
|
964
|
-
return
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1011
|
+
function debounce(duration, __tsplusTrace) {
|
|
1012
|
+
return stream => {
|
|
1013
|
+
return unwrap_1(tsplus_module_21.transplant(grafter => tsplus_module_1.map(handoff => {
|
|
1014
|
+
function enqueue(last, __tsplusTrace) {
|
|
1015
|
+
return tsplus_module_1.map(f => consumer(tsplus_module_36.previous(f), __tsplusTrace), __tsplusTrace)(grafter(tsplus_module_1.fork(tsplus_module_1.as(() => last, __tsplusTrace)(tsplus_module_37.sleep(duration, __tsplusTrace)), __tsplusTrace)));
|
|
1016
|
+
}
|
|
968
1017
|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1018
|
+
const producer = tsplus_module_10.readWithCause(inp => tsplus_module_17.match(() => producer, last => tsplus_module_11.apSecond(producer)(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_5.emit(tsplus_module_16.single(last)))(handoff))))(tsplus_module_12.last(inp)), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_5.halt(cause))(handoff)), () => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_5.end(new _SinkEndReason2.UpstreamEnd()))(handoff)));
|
|
1019
|
+
|
|
1020
|
+
function consumer(state, __tsplusTrace) {
|
|
1021
|
+
return tsplus_module_10.unwrap(() => tsplus_module_36.match({
|
|
1022
|
+
NotStarted: () => tsplus_module_1.map(signal => tsplus_module_5.matchSignal({
|
|
1023
|
+
Emit: ({
|
|
1024
|
+
els
|
|
1025
|
+
}) => tsplus_module_10.unwrap(() => enqueue(els, __tsplusTrace)),
|
|
1026
|
+
Halt: ({
|
|
1027
|
+
error
|
|
1028
|
+
}) => tsplus_module_11.failCauseNow(error),
|
|
1029
|
+
End: () => tsplus_module_10.unit
|
|
1030
|
+
})(signal), __tsplusTrace)(tsplus_module_5.take(handoff)),
|
|
1031
|
+
Current: ({
|
|
1032
|
+
fiber
|
|
1033
|
+
}) => tsplus_module_1.map(signal => tsplus_module_5.matchSignal({
|
|
1034
|
+
Emit: ({
|
|
1035
|
+
els
|
|
1036
|
+
}) => tsplus_module_10.unwrap(() => enqueue(els, __tsplusTrace)),
|
|
1037
|
+
Halt: ({
|
|
1038
|
+
error
|
|
1039
|
+
}) => tsplus_module_11.failCauseNow(error),
|
|
1040
|
+
End: () => tsplus_module_10.unit
|
|
1041
|
+
})(signal), __tsplusTrace)(tsplus_module_19.join(fiber, __tsplusTrace)),
|
|
1042
|
+
Previous: ({
|
|
1043
|
+
fiber
|
|
1044
|
+
}) => tsplus_module_21.raceWith(() => tsplus_module_5.take(handoff), (ex, current) => tsplus_module_30.match(cause => tsplus_module_1.as(() => tsplus_module_11.failCauseNow(cause), __tsplusTrace)(tsplus_module_20.interrupt(current, __tsplusTrace)), chunk => tsplus_module_1.succeedNow(tsplus_module_11.apSecond(consumer(tsplus_module_36.current(current), __tsplusTrace))(tsplus_module_10.writeNow(chunk)), __tsplusTrace))(ex), (ex, previous) => tsplus_module_30.match(cause => tsplus_module_1.as(() => tsplus_module_11.failCauseNow(cause), __tsplusTrace)(tsplus_module_20.interrupt(previous, __tsplusTrace)), signal => tsplus_module_5.matchSignal({
|
|
1045
|
+
Emit: ({
|
|
1046
|
+
els
|
|
1047
|
+
}) => tsplus_module_1.apSecond(enqueue(els, __tsplusTrace), __tsplusTrace)(tsplus_module_20.interrupt(previous, __tsplusTrace)),
|
|
1048
|
+
Halt: ({
|
|
1049
|
+
error
|
|
1050
|
+
}) => tsplus_module_1.as(() => tsplus_module_11.failCauseNow(error), __tsplusTrace)(tsplus_module_20.interrupt(previous, __tsplusTrace)),
|
|
1051
|
+
End: () => tsplus_module_1.map(chunk => tsplus_module_11.apSecond(tsplus_module_10.unit)(tsplus_module_10.writeNow(chunk)), __tsplusTrace)(tsplus_module_19.join(previous, __tsplusTrace))
|
|
1052
|
+
})(signal))(ex), __tsplusTrace)(tsplus_module_19.join(fiber, __tsplusTrace))
|
|
1053
|
+
})(state));
|
|
1054
|
+
}
|
|
1006
1055
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1056
|
+
return apSecond_1(new _definition2.Stream(consumer(tsplus_module_36.notStarted, __tsplusTrace)), __tsplusTrace)(scoped_1(() => tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(producer)(stream.channel)), __tsplusTrace), __tsplusTrace));
|
|
1057
|
+
}, __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace), __tsplusTrace);
|
|
1058
|
+
};
|
|
1009
1059
|
}
|
|
1010
1060
|
|
|
1011
1061
|
function defaultIfEmptyWriter(fb, __tsplusTrace) {
|
|
1012
|
-
return tsplus_module_10.readWith(i => tsplus_module_12.isEmpty(i) ? defaultIfEmptyWriter(fb, __tsplusTrace) : tsplus_module_11.
|
|
1062
|
+
return tsplus_module_10.readWith(i => tsplus_module_12.isEmpty(i) ? defaultIfEmptyWriter(fb, __tsplusTrace) : tsplus_module_11.apSecond(tsplus_module_10.id())(tsplus_module_10.writeNow(i)), tsplus_module_10.failNow, () => fb.channel);
|
|
1013
1063
|
}
|
|
1014
1064
|
/**
|
|
1015
1065
|
* Switches to the provided stream in case this one is empty.
|
|
1016
1066
|
*
|
|
1017
|
-
* @tsplus
|
|
1067
|
+
* @tsplus pipeable fncts.io.Stream defaultIfEmpty
|
|
1018
1068
|
*/
|
|
1019
1069
|
|
|
1020
1070
|
|
|
1021
|
-
function
|
|
1022
|
-
return
|
|
1071
|
+
function defaultIfEmpty(fb, __tsplusTrace) {
|
|
1072
|
+
return fa => {
|
|
1073
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(defaultIfEmptyWriter(fb, __tsplusTrace))(fa.channel));
|
|
1074
|
+
};
|
|
1023
1075
|
}
|
|
1024
1076
|
/**
|
|
1025
1077
|
* More powerful version of `broadcast`. Allows to provide a function that determines what
|
|
1026
1078
|
* queues should receive which elements. The decide function will receive the indices of the queues
|
|
1027
1079
|
* in the resulting list.
|
|
1028
1080
|
*
|
|
1029
|
-
* @tsplus
|
|
1081
|
+
* @tsplus pipeable fncts.io.Stream distributedWith
|
|
1030
1082
|
*/
|
|
1031
1083
|
|
|
1032
1084
|
|
|
1033
|
-
function
|
|
1034
|
-
return
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1085
|
+
function distributedWith(n, maximumLag, decide, __tsplusTrace) {
|
|
1086
|
+
return self => {
|
|
1087
|
+
return tsplus_module_1.flatMap(p => tsplus_module_1.flatMap(next => tsplus_module_1.flatMap(entries => {
|
|
1088
|
+
const [mappings, queues] = tsplus_module_12.foldRight([tsplus_module_38.makeDefault(), tsplus_module_7.empty()], ([mapping, queue], [mappings, queues]) => [tsplus_module_38.set(mapping[0], mapping[1])(mappings), tsplus_module_12.append(queue)(queues)])(entries);
|
|
1089
|
+
return tsplus_module_1.as(() => queues, __tsplusTrace)(tsplus_module_31.succeed_(a => tsplus_module_1.map(f => key => f(tsplus_module_33.toUndefined(tsplus_module_38.get(key)(mappings))), __tsplusTrace)(decide(a)), __tsplusTrace)(p));
|
|
1090
|
+
}, __tsplusTrace)(tsplus_module_1.sequenceIterable(tsplus_module_12.map(id => tsplus_module_1.map(([key, queue]) => [[key, id], queue], __tsplusTrace)(next))(tsplus_module_16.range(0, n)), __tsplusTrace)), __tsplusTrace)(distributedWithDynamic_1(maximumLag, a => tsplus_module_1.flatMap(f => f(a), __tsplusTrace)(tsplus_module_31.wait(p, __tsplusTrace)), () => tsplus_module_1.unit, __tsplusTrace)(self)), __tsplusTrace)(tsplus_module_32.make(__tsplusTrace));
|
|
1091
|
+
};
|
|
1038
1092
|
}
|
|
1039
1093
|
/**
|
|
1040
1094
|
* More powerful version of `ZStream#distributedWith`. This returns a function that will produce
|
|
@@ -1044,27 +1098,29 @@ function distributedWith_(self, n, maximumLag, decide, __tsplusTrace) {
|
|
|
1044
1098
|
* Downstream users can also shutdown queues manually. In this case the driver will
|
|
1045
1099
|
* continue but no longer backpressure on them.
|
|
1046
1100
|
*
|
|
1047
|
-
* @tsplus
|
|
1101
|
+
* @tsplus pipeable fncts.io.Stream distributedWithDynamic
|
|
1048
1102
|
*/
|
|
1049
1103
|
|
|
1050
1104
|
|
|
1051
|
-
function distributedWithDynamic_1(
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1105
|
+
function distributedWithDynamic_1(maximumLag, decide, done = () => tsplus_module_1.unit, __tsplusTrace) {
|
|
1106
|
+
return self => {
|
|
1107
|
+
const offer = queuesRef => a => tsplus_module_1.flatMap(shouldProcess => tsplus_module_1.flatMap(queues => tsplus_module_1.flatMap(ids => tsplus_module_12.isNonEmpty(ids) ? queuesRef.update(map => tsplus_module_38.removeMany(ids)(map), __tsplusTrace) : tsplus_module_1.unit, __tsplusTrace)(tsplus_module_1.foldLeft(queues, tsplus_module_7.empty(), (b, [id, queue]) => {
|
|
1108
|
+
if (shouldProcess(id)) {
|
|
1109
|
+
return tsplus_module_1.matchCauseIO(c => tsplus_module_22.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)(queue.offer(tsplus_module_35.succeed(a), __tsplusTrace));
|
|
1110
|
+
} else {
|
|
1111
|
+
return tsplus_module_1.succeedNow(b, __tsplusTrace);
|
|
1112
|
+
}
|
|
1113
|
+
}, __tsplusTrace)), __tsplusTrace)(queuesRef.get), __tsplusTrace)(decide(a));
|
|
1059
1114
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1115
|
+
return tsplus_module_1.flatMap(queuesRef => tsplus_module_1.map(add => add, __tsplusTrace)(tsplus_module_1.flatMap(queuesLock => tsplus_module_1.flatMap(newQueue => {
|
|
1116
|
+
const finalize = endTake => tsplus_module_39.withPermit(queuesLock, __tsplusTrace)(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_22.interrupted(c) ? tsplus_module_3.just(tsplus_module_1.unit) : tsplus_module_3.nothing(), __tsplusTrace)(queue.offer(endTake, __tsplusTrace)), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.map(map => tsplus_module_38.values(map), __tsplusTrace)(queuesRef.get)), __tsplusTrace)(newQueue.set(tsplus_module_1.flatMap(queue => tsplus_module_1.flatMap(() => {
|
|
1117
|
+
const id = Symbol();
|
|
1118
|
+
return tsplus_module_1.map(() => (0, _function.tuple)(id, queue), __tsplusTrace)(queuesRef.update(map => tsplus_module_38.set(id, queue)(map), __tsplusTrace));
|
|
1119
|
+
}, __tsplusTrace)(queue.offer(endTake, __tsplusTrace)), __tsplusTrace)(tsplus_module_25.makeBounded(1, __tsplusTrace)), __tsplusTrace)), __tsplusTrace));
|
|
1065
1120
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1121
|
+
return tsplus_module_1.map(() => tsplus_module_39.withPermit(queuesLock, __tsplusTrace)(tsplus_module_1.flatten(newQueue.get, __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_1.matchCauseIO(cause => finalize(tsplus_module_35.failCause(tsplus_module_22.map(tsplus_module_3.just)(cause))), () => finalize(tsplus_module_35.fail(tsplus_module_3.nothing())), __tsplusTrace)(runForeachScoped_1(offer(queuesRef), __tsplusTrace)(self)), __tsplusTrace));
|
|
1122
|
+
}, __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)(queuesRef.update(map => tsplus_module_38.set(id, queue)(map), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.succeed(() => Symbol(), __tsplusTrace)), __tsplusTrace)(tsplus_module_25.makeBounded(maximumLag, __tsplusTrace)), __tsplusTrace)), __tsplusTrace)(tsplus_module_41.atomically(tsplus_module_40.make(1, __tsplusTrace), __tsplusTrace))), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_6.make(() => tsplus_module_38.makeDefault(), __tsplusTrace), ref => tsplus_module_1.flatMap(qs => tsplus_module_1.foreach(tsplus_module_38.values(qs), q => q.shutdown, __tsplusTrace), __tsplusTrace)(ref.get), __tsplusTrace));
|
|
1123
|
+
};
|
|
1068
1124
|
}
|
|
1069
1125
|
/**
|
|
1070
1126
|
* Converts this stream to a stream that executes its effects but emits no
|
|
@@ -1080,43 +1136,49 @@ function drain(fa, __tsplusTrace) {
|
|
|
1080
1136
|
|
|
1081
1137
|
function dropLoop(r, __tsplusTrace) {
|
|
1082
1138
|
return tsplus_module_10.readWith(inp => {
|
|
1083
|
-
const dropped = tsplus_module_12.
|
|
1139
|
+
const dropped = tsplus_module_12.drop(r)(inp);
|
|
1084
1140
|
const leftover = Math.max(0, r - inp.length);
|
|
1085
1141
|
const more = tsplus_module_12.isEmpty(inp) || leftover > 0;
|
|
1086
|
-
return more ? dropLoop(leftover, __tsplusTrace) : tsplus_module_11.
|
|
1142
|
+
return more ? dropLoop(leftover, __tsplusTrace) : tsplus_module_11.apSecond(tsplus_module_10.id())(tsplus_module_10.write(() => dropped));
|
|
1087
1143
|
}, tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1088
1144
|
}
|
|
1089
1145
|
/**
|
|
1090
1146
|
* Drops the specified number of elements from this stream.
|
|
1091
1147
|
*
|
|
1092
|
-
* @tsplus
|
|
1148
|
+
* @tsplus pipeable fncts.io.Stream drop
|
|
1093
1149
|
*/
|
|
1094
1150
|
|
|
1095
1151
|
|
|
1096
|
-
function drop_1(
|
|
1097
|
-
return
|
|
1152
|
+
function drop_1(n, __tsplusTrace) {
|
|
1153
|
+
return stream => {
|
|
1154
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(dropLoop(n, __tsplusTrace))(stream.channel));
|
|
1155
|
+
};
|
|
1098
1156
|
}
|
|
1099
1157
|
/**
|
|
1100
1158
|
* Drops all elements of the stream for as long as the specified predicate
|
|
1101
1159
|
* evaluates to `true`.
|
|
1102
1160
|
*
|
|
1103
|
-
* @tsplus
|
|
1161
|
+
* @tsplus pipeable fncts.io.Stream dropWhile
|
|
1104
1162
|
*/
|
|
1105
1163
|
|
|
1106
1164
|
|
|
1107
|
-
function dropWhile_1(
|
|
1108
|
-
return
|
|
1165
|
+
function dropWhile_1(p, __tsplusTrace) {
|
|
1166
|
+
return stream => {
|
|
1167
|
+
return pipeThrough_1(tsplus_module_42.makeDropWhile(p, __tsplusTrace), __tsplusTrace)(stream);
|
|
1168
|
+
};
|
|
1109
1169
|
}
|
|
1110
1170
|
/**
|
|
1111
1171
|
* Drops all elements of the stream until the specified predicate evaluates
|
|
1112
1172
|
* to `true`.
|
|
1113
1173
|
*
|
|
1114
|
-
* @tsplus
|
|
1174
|
+
* @tsplus pipeable fncts.io.Stream dropUntil
|
|
1115
1175
|
*/
|
|
1116
1176
|
|
|
1117
1177
|
|
|
1118
|
-
function
|
|
1119
|
-
return
|
|
1178
|
+
function dropUntil(p, __tsplusTrace) {
|
|
1179
|
+
return stream => {
|
|
1180
|
+
return drop_1(1, __tsplusTrace)(dropWhile_1(tsplus_module_43.invert(p), __tsplusTrace)(stream));
|
|
1181
|
+
};
|
|
1120
1182
|
}
|
|
1121
1183
|
/**
|
|
1122
1184
|
* Returns a stream whose failures and successes have been lifted into an
|
|
@@ -1130,19 +1192,19 @@ function dropUntil_(stream, p, __tsplusTrace) {
|
|
|
1130
1192
|
|
|
1131
1193
|
|
|
1132
1194
|
function either(stream, __tsplusTrace) {
|
|
1133
|
-
return catchAll_1(
|
|
1195
|
+
return catchAll_1(e => succeedNow_1(tsplus_module_15.left(e), __tsplusTrace), __tsplusTrace)(map_1(tsplus_module_15.right, __tsplusTrace)(stream));
|
|
1134
1196
|
}
|
|
1135
1197
|
/**
|
|
1136
1198
|
* @tsplus static fncts.io.StreamOps empty
|
|
1137
1199
|
*/
|
|
1138
1200
|
|
|
1139
1201
|
|
|
1140
|
-
const empty_1 = /*#__PURE__*/fromChunkNow_1( /*#__PURE__*/tsplus_module_7.empty(), fileName_1 + ":
|
|
1202
|
+
const empty_1 = /*#__PURE__*/fromChunkNow_1( /*#__PURE__*/tsplus_module_7.empty(), fileName_1 + ":1219:70");
|
|
1141
1203
|
const empty = empty_1;
|
|
1142
1204
|
exports.empty = empty;
|
|
1143
1205
|
|
|
1144
1206
|
function endWhenWriter(fiber, __tsplusTrace) {
|
|
1145
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1207
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(maybeExit => tsplus_module_17.match(() => tsplus_module_10.readWith(inp => tsplus_module_11.apSecond(endWhenWriter(fiber, __tsplusTrace))(tsplus_module_10.writeNow(inp)), tsplus_module_10.failNow, () => tsplus_module_10.unit), exit => tsplus_module_30.match(tsplus_module_11.failCauseNow, () => tsplus_module_10.unit)(exit))(maybeExit), __tsplusTrace)(tsplus_module_44.poll(fiber, __tsplusTrace)));
|
|
1146
1208
|
}
|
|
1147
1209
|
/**
|
|
1148
1210
|
* Halts the evaluation of this stream when the provided IO completes. The given IO
|
|
@@ -1153,20 +1215,24 @@ function endWhenWriter(fiber, __tsplusTrace) {
|
|
|
1153
1215
|
*
|
|
1154
1216
|
* If the IO completes with a failure, the stream will emit that failure.
|
|
1155
1217
|
*
|
|
1156
|
-
* @tsplus
|
|
1218
|
+
* @tsplus pipeable fncts.io.Stream endWhen
|
|
1157
1219
|
*/
|
|
1158
1220
|
|
|
1159
1221
|
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1222
|
+
function endWhen(io, __tsplusTrace) {
|
|
1223
|
+
return stream => {
|
|
1224
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(fiber => tsplus_module_10.pipeTo(endWhenWriter(fiber, __tsplusTrace))(stream.channel), __tsplusTrace)(tsplus_module_14.forkScoped(io, __tsplusTrace))));
|
|
1225
|
+
};
|
|
1162
1226
|
}
|
|
1163
1227
|
/**
|
|
1164
|
-
* @tsplus
|
|
1228
|
+
* @tsplus pipeable fncts.io.Stream ensuring
|
|
1165
1229
|
*/
|
|
1166
1230
|
|
|
1167
1231
|
|
|
1168
|
-
function ensuring_1(
|
|
1169
|
-
return
|
|
1232
|
+
function ensuring_1(finalizer, __tsplusTrace) {
|
|
1233
|
+
return self => {
|
|
1234
|
+
return new _definition2.Stream(tsplus_module_10.ensuring(finalizer)(self.channel));
|
|
1235
|
+
};
|
|
1170
1236
|
}
|
|
1171
1237
|
/**
|
|
1172
1238
|
* @tsplus static fncts.io.StreamOps environment
|
|
@@ -1174,7 +1240,7 @@ function ensuring_1(self, finalizer, __tsplusTrace) {
|
|
|
1174
1240
|
|
|
1175
1241
|
|
|
1176
1242
|
function environment_1(__tsplusTrace) {
|
|
1177
|
-
return fromIO_1(
|
|
1243
|
+
return fromIO_1(tsplus_module_45.environment(__tsplusTrace), __tsplusTrace);
|
|
1178
1244
|
}
|
|
1179
1245
|
/**
|
|
1180
1246
|
* Accesses the environment of the stream.
|
|
@@ -1184,7 +1250,7 @@ function environment_1(__tsplusTrace) {
|
|
|
1184
1250
|
|
|
1185
1251
|
|
|
1186
1252
|
function environmentWith(f, __tsplusTrace) {
|
|
1187
|
-
return map_1(
|
|
1253
|
+
return map_1(f, __tsplusTrace)(environment_1(__tsplusTrace));
|
|
1188
1254
|
}
|
|
1189
1255
|
/**
|
|
1190
1256
|
* Accesses the environment of the stream in the context of an effect.
|
|
@@ -1194,7 +1260,7 @@ function environmentWith(f, __tsplusTrace) {
|
|
|
1194
1260
|
|
|
1195
1261
|
|
|
1196
1262
|
function environmentWithIO(f, __tsplusTrace) {
|
|
1197
|
-
return mapIO_1(
|
|
1263
|
+
return mapIO_1(f, __tsplusTrace)(environment_1(__tsplusTrace));
|
|
1198
1264
|
}
|
|
1199
1265
|
/**
|
|
1200
1266
|
* Accesses the environment of the stream in the context of a stream.
|
|
@@ -1204,7 +1270,7 @@ function environmentWithIO(f, __tsplusTrace) {
|
|
|
1204
1270
|
|
|
1205
1271
|
|
|
1206
1272
|
function environmentWithStream(f, __tsplusTrace) {
|
|
1207
|
-
return flatMap_1(
|
|
1273
|
+
return flatMap_1(f, __tsplusTrace)(environment_1(__tsplusTrace));
|
|
1208
1274
|
}
|
|
1209
1275
|
/**
|
|
1210
1276
|
* Halt a stream with the specified error
|
|
@@ -1247,16 +1313,20 @@ function failCause(cause, __tsplusTrace) {
|
|
|
1247
1313
|
return fromIO_1(tsplus_module_1.failCause(cause, __tsplusTrace), __tsplusTrace);
|
|
1248
1314
|
}
|
|
1249
1315
|
|
|
1250
|
-
function
|
|
1251
|
-
return
|
|
1316
|
+
function filter(predicate, __tsplusTrace) {
|
|
1317
|
+
return fa => {
|
|
1318
|
+
return mapChunks_1(chunk => tsplus_module_12.filter(predicate)(chunk), __tsplusTrace)(fa);
|
|
1319
|
+
};
|
|
1252
1320
|
}
|
|
1253
1321
|
/**
|
|
1254
|
-
* @tsplus
|
|
1322
|
+
* @tsplus pipeable fncts.io.Stream filterIO
|
|
1255
1323
|
*/
|
|
1256
1324
|
|
|
1257
1325
|
|
|
1258
|
-
function
|
|
1259
|
-
return
|
|
1326
|
+
function filterIO(f, __tsplusTrace) {
|
|
1327
|
+
return fa => {
|
|
1328
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(filterIOLoop(tsplus_module_34.empty()[Symbol.iterator](), f, __tsplusTrace))(fa.channel));
|
|
1329
|
+
};
|
|
1260
1330
|
}
|
|
1261
1331
|
|
|
1262
1332
|
function filterIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -1265,24 +1335,28 @@ function filterIOLoop(iterator, f, __tsplusTrace) {
|
|
|
1265
1335
|
if (next.done) {
|
|
1266
1336
|
return tsplus_module_10.readWithCause(elem => filterIOLoop(elem[Symbol.iterator](), f, __tsplusTrace), tsplus_module_11.failCauseNow, tsplus_module_11.succeedNow);
|
|
1267
1337
|
} else {
|
|
1268
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1338
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(b => b ? tsplus_module_11.apSecond(filterIOLoop(iterator, f, __tsplusTrace))(tsplus_module_10.writeNow(tsplus_module_16.single(next.value))) : filterIOLoop(iterator, f, __tsplusTrace), __tsplusTrace)(f(next.value)));
|
|
1269
1339
|
}
|
|
1270
1340
|
}
|
|
1271
1341
|
/**
|
|
1272
|
-
* @tsplus
|
|
1342
|
+
* @tsplus pipeable fncts.io.Stream filterMap
|
|
1273
1343
|
*/
|
|
1274
1344
|
|
|
1275
1345
|
|
|
1276
|
-
function filterMap_1(
|
|
1277
|
-
return
|
|
1346
|
+
function filterMap_1(f, __tsplusTrace) {
|
|
1347
|
+
return fa => {
|
|
1348
|
+
return mapChunks_1(chunk => tsplus_module_12.filterMap(f)(chunk), __tsplusTrace)(fa);
|
|
1349
|
+
};
|
|
1278
1350
|
}
|
|
1279
1351
|
/**
|
|
1280
|
-
* @tsplus
|
|
1352
|
+
* @tsplus pipeable fncts.io.Stream filterMapIO
|
|
1281
1353
|
*/
|
|
1282
1354
|
|
|
1283
1355
|
|
|
1284
|
-
function
|
|
1285
|
-
return
|
|
1356
|
+
function filterMapIO(f, __tsplusTrace) {
|
|
1357
|
+
return fa => {
|
|
1358
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(filterMapIOLoop(tsplus_module_34.empty()[Symbol.iterator](), f, __tsplusTrace))(fa.channel));
|
|
1359
|
+
};
|
|
1286
1360
|
}
|
|
1287
1361
|
|
|
1288
1362
|
function filterMapIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -1291,30 +1365,34 @@ function filterMapIOLoop(iterator, f, __tsplusTrace) {
|
|
|
1291
1365
|
if (next.done) {
|
|
1292
1366
|
return tsplus_module_10.readWithCause(elem => filterMapIOLoop(elem[Symbol.iterator](), f, __tsplusTrace), tsplus_module_11.failCauseNow, tsplus_module_11.succeedNow);
|
|
1293
1367
|
} else {
|
|
1294
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1368
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(b => tsplus_module_17.match(() => filterMapIOLoop(iterator, f, __tsplusTrace), b => tsplus_module_11.apSecond(filterMapIOLoop(iterator, f, __tsplusTrace))(tsplus_module_10.writeNow(tsplus_module_16.single(b))))(b), __tsplusTrace)(f(next.value)));
|
|
1295
1369
|
}
|
|
1296
1370
|
}
|
|
1297
1371
|
/**
|
|
1298
1372
|
* Finds the first element emitted by this stream that satisfies the provided predicate.
|
|
1299
1373
|
*
|
|
1300
|
-
* @tsplus
|
|
1374
|
+
* @tsplus pipeable fncts.io.Stream find
|
|
1301
1375
|
*/
|
|
1302
1376
|
|
|
1303
1377
|
|
|
1304
|
-
function
|
|
1305
|
-
|
|
1306
|
-
|
|
1378
|
+
function find(p, __tsplusTrace) {
|
|
1379
|
+
return stream => {
|
|
1380
|
+
const loop = tsplus_module_10.readWith(inp => tsplus_module_17.match(() => loop, a => tsplus_module_10.writeNow(tsplus_module_16.single(a)))(tsplus_module_12.find(p)(inp)), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1381
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
|
1382
|
+
};
|
|
1307
1383
|
}
|
|
1308
1384
|
/**
|
|
1309
1385
|
* Finds the first element emitted by this stream that satisfies the provided effectful predicate.
|
|
1310
1386
|
*
|
|
1311
|
-
* @tsplus
|
|
1387
|
+
* @tsplus pipeable fncts.io.Stream findIO
|
|
1312
1388
|
*/
|
|
1313
1389
|
|
|
1314
1390
|
|
|
1315
|
-
function
|
|
1316
|
-
|
|
1317
|
-
|
|
1391
|
+
function findIO(f, __tsplusTrace) {
|
|
1392
|
+
return stream => {
|
|
1393
|
+
const loop = tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(() => tsplus_module_1.map(maybeA => tsplus_module_17.match(() => loop, a => tsplus_module_10.writeNow(tsplus_module_16.single(a)))(maybeA), __tsplusTrace)(tsplus_module_46.findIO(f, __tsplusTrace)(inp))), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1394
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(loop)(stream.channel));
|
|
1395
|
+
};
|
|
1318
1396
|
}
|
|
1319
1397
|
/**
|
|
1320
1398
|
* Flattens this stream-of-streams into a stream made of the concatenation in
|
|
@@ -1325,7 +1403,7 @@ function findIO_(stream, f, __tsplusTrace) {
|
|
|
1325
1403
|
|
|
1326
1404
|
|
|
1327
1405
|
function flatten_1(self, __tsplusTrace) {
|
|
1328
|
-
return flatMap_1(
|
|
1406
|
+
return flatMap_1(_function.identity, __tsplusTrace)(self);
|
|
1329
1407
|
}
|
|
1330
1408
|
/**
|
|
1331
1409
|
* Unwraps `Exit` values that also signify end-of-stream by failing with `None`.
|
|
@@ -1338,13 +1416,13 @@ function flatten_1(self, __tsplusTrace) {
|
|
|
1338
1416
|
|
|
1339
1417
|
function flattenExitOption_1(stream, __tsplusTrace) {
|
|
1340
1418
|
const processChunk = (chunk, cont) => {
|
|
1341
|
-
const [toEmit, rest] = tsplus_module_12.
|
|
1342
|
-
const next =
|
|
1343
|
-
return tsplus_module_11.
|
|
1419
|
+
const [toEmit, rest] = tsplus_module_12.splitWhere(_ => !tsplus_module_47.isSuccess(_))(chunk);
|
|
1420
|
+
const next = tsplus_module_17.match(() => cont, exit => tsplus_module_30.match(cause => tsplus_module_17.match(() => tsplus_module_11.endNow(undefined), tsplus_module_11.failCauseNow)(tsplus_module_22.flipCauseOption(cause)), () => tsplus_module_11.endNow(undefined))(exit))(tsplus_module_12.head(rest));
|
|
1421
|
+
return tsplus_module_11.apSecond(next)(tsplus_module_10.writeNow(tsplus_module_12.filterMap(exit => tsplus_module_30.match(() => tsplus_module_3.nothing(), tsplus_module_3.just)(exit))(toEmit)));
|
|
1344
1422
|
};
|
|
1345
1423
|
|
|
1346
1424
|
const process = tsplus_module_10.readWithCause(chunk => processChunk(chunk, process), tsplus_module_11.failCauseNow, _ => tsplus_module_11.endNow(undefined));
|
|
1347
|
-
return new _definition2.Stream(tsplus_module_10.
|
|
1425
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(process)(stream.channel));
|
|
1348
1426
|
}
|
|
1349
1427
|
/**
|
|
1350
1428
|
* Unwraps `Exit` values and flatten chunks that also signify end-of-stream by failing with `None`.
|
|
@@ -1354,7 +1432,7 @@ function flattenExitOption_1(stream, __tsplusTrace) {
|
|
|
1354
1432
|
|
|
1355
1433
|
|
|
1356
1434
|
function flattenTake_1(stream, __tsplusTrace) {
|
|
1357
|
-
return flattenChunks_1(flattenExitOption_1(map_1(
|
|
1435
|
+
return flattenChunks_1(flattenExitOption_1(map_1(take => take.exit, __tsplusTrace)(stream), __tsplusTrace), __tsplusTrace);
|
|
1358
1436
|
}
|
|
1359
1437
|
/**
|
|
1360
1438
|
* Submerges the chunks carried by this stream into the stream's structure, while
|
|
@@ -1365,7 +1443,7 @@ function flattenTake_1(stream, __tsplusTrace) {
|
|
|
1365
1443
|
|
|
1366
1444
|
|
|
1367
1445
|
function flattenChunks_1(stream, __tsplusTrace) {
|
|
1368
|
-
return new _definition2.Stream(tsplus_module_10.
|
|
1446
|
+
return new _definition2.Stream(tsplus_module_10.mapOut(c => tsplus_module_12.flatten(c))(stream.channel));
|
|
1369
1447
|
}
|
|
1370
1448
|
/**
|
|
1371
1449
|
* Repeats this stream forever.
|
|
@@ -1405,7 +1483,7 @@ function fromChunk_1(c, __tsplusTrace) {
|
|
|
1405
1483
|
|
|
1406
1484
|
|
|
1407
1485
|
function scoped_1(stream, __tsplusTrace) {
|
|
1408
|
-
return new _definition2.Stream(tsplus_module_10.scoped(() => tsplus_module_1.
|
|
1486
|
+
return new _definition2.Stream(tsplus_module_10.scoped(() => tsplus_module_1.map(tsplus_module_16.single, __tsplusTrace)(stream())));
|
|
1409
1487
|
}
|
|
1410
1488
|
/**
|
|
1411
1489
|
* Creates a stream from an effect producing a value of type `A`
|
|
@@ -1415,7 +1493,7 @@ function scoped_1(stream, __tsplusTrace) {
|
|
|
1415
1493
|
|
|
1416
1494
|
|
|
1417
1495
|
function fromIO_1(fa, __tsplusTrace) {
|
|
1418
|
-
return fromIOMaybe_1(tsplus_module_1.
|
|
1496
|
+
return fromIOMaybe_1(tsplus_module_1.mapError(tsplus_module_3.just, __tsplusTrace)(fa), __tsplusTrace);
|
|
1419
1497
|
}
|
|
1420
1498
|
/**
|
|
1421
1499
|
* Creates a stream from an effect producing a value of type `A` or an empty Stream
|
|
@@ -1425,12 +1503,12 @@ function fromIO_1(fa, __tsplusTrace) {
|
|
|
1425
1503
|
|
|
1426
1504
|
|
|
1427
1505
|
function fromIOMaybe_1(fa, __tsplusTrace) {
|
|
1428
|
-
return new _definition2.Stream(tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1506
|
+
return new _definition2.Stream(tsplus_module_10.unwrap(() => tsplus_module_1.match(maybeError => tsplus_module_17.match(() => tsplus_module_10.unit, tsplus_module_10.failNow)(maybeError), a => tsplus_module_10.writeNow(tsplus_module_16.single(a)), __tsplusTrace)(fa)));
|
|
1429
1507
|
}
|
|
1430
1508
|
|
|
1431
1509
|
function fromAsyncIterableLoop(iterator, __tsplusTrace) {
|
|
1432
1510
|
return tsplus_module_10.unwrap(() => tsplus_module_1.async(k => {
|
|
1433
|
-
iterator.next().then(result => result.done ? k(tsplus_module_1.succeedNow(tsplus_module_11.end(() => undefined), __tsplusTrace)) : k(tsplus_module_1.succeedNow(tsplus_module_11.
|
|
1511
|
+
iterator.next().then(result => result.done ? k(tsplus_module_1.succeedNow(tsplus_module_11.end(() => undefined), __tsplusTrace)) : k(tsplus_module_1.succeedNow(tsplus_module_11.apSecond(fromAsyncIterableLoop(iterator, __tsplusTrace))(tsplus_module_10.writeNow(tsplus_module_16.single(result.value))), __tsplusTrace)));
|
|
1434
1512
|
}));
|
|
1435
1513
|
}
|
|
1436
1514
|
/**
|
|
@@ -1456,7 +1534,7 @@ function fromIterable(iterable, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE,
|
|
|
1456
1534
|
}
|
|
1457
1535
|
|
|
1458
1536
|
if (maxChunkSize === 1) {
|
|
1459
|
-
return tsplus_module_11.
|
|
1537
|
+
return tsplus_module_11.apSecond(loop(iterator))(tsplus_module_10.writeNow(tsplus_module_16.single(result.value)));
|
|
1460
1538
|
} else {
|
|
1461
1539
|
const out = Array(maxChunkSize);
|
|
1462
1540
|
out[0] = result.value;
|
|
@@ -1467,7 +1545,7 @@ function fromIterable(iterable, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE,
|
|
|
1467
1545
|
count++;
|
|
1468
1546
|
}
|
|
1469
1547
|
|
|
1470
|
-
return tsplus_module_11.
|
|
1548
|
+
return tsplus_module_11.apSecond(loop(iterator))(tsplus_module_10.writeNow(tsplus_module_16.from(out)));
|
|
1471
1549
|
}
|
|
1472
1550
|
}, __tsplusTrace));
|
|
1473
1551
|
|
|
@@ -1480,7 +1558,7 @@ function fromIterable(iterable, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE,
|
|
|
1480
1558
|
|
|
1481
1559
|
|
|
1482
1560
|
function fromIterableSingle(iterable, __tsplusTrace) {
|
|
1483
|
-
return flatMap_1(
|
|
1561
|
+
return flatMap_1(iterator => repeatIOMaybe_1(tsplus_module_1.defer(() => {
|
|
1484
1562
|
const value = iterator.next();
|
|
1485
1563
|
|
|
1486
1564
|
if (value.done) {
|
|
@@ -1488,7 +1566,7 @@ function fromIterableSingle(iterable, __tsplusTrace) {
|
|
|
1488
1566
|
} else {
|
|
1489
1567
|
return tsplus_module_1.succeedNow(value.value, __tsplusTrace);
|
|
1490
1568
|
}
|
|
1491
|
-
}, __tsplusTrace), __tsplusTrace), __tsplusTrace);
|
|
1569
|
+
}, __tsplusTrace), __tsplusTrace), __tsplusTrace)(fromIO_1(tsplus_module_1.succeed(() => iterable[Symbol.iterator](), __tsplusTrace), __tsplusTrace));
|
|
1492
1570
|
}
|
|
1493
1571
|
/**
|
|
1494
1572
|
* @tsplus static fncts.io.StreamOps fromPull
|
|
@@ -1496,7 +1574,7 @@ function fromIterableSingle(iterable, __tsplusTrace) {
|
|
|
1496
1574
|
|
|
1497
1575
|
|
|
1498
1576
|
function fromPull_1(scopedPull, __tsplusTrace) {
|
|
1499
|
-
return unwrapScoped_1(tsplus_module_1.
|
|
1577
|
+
return unwrapScoped_1(tsplus_module_1.map(pull => repeatIOChunkMaybe_1(pull, __tsplusTrace), __tsplusTrace)(scopedPull), __tsplusTrace);
|
|
1500
1578
|
}
|
|
1501
1579
|
/**
|
|
1502
1580
|
* Creates a stream from a `Queue` of values
|
|
@@ -1506,13 +1584,13 @@ function fromPull_1(scopedPull, __tsplusTrace) {
|
|
|
1506
1584
|
|
|
1507
1585
|
|
|
1508
1586
|
function fromQueue_1(queue, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1509
|
-
return repeatIOChunkMaybe_1(tsplus_module_1.
|
|
1510
|
-
if (down &&
|
|
1511
|
-
return
|
|
1587
|
+
return repeatIOChunkMaybe_1(tsplus_module_1.catchAllCause(c => tsplus_module_1.flatMap(down => {
|
|
1588
|
+
if (down && tsplus_module_22.interrupted(c)) {
|
|
1589
|
+
return tsplus_module_48.end;
|
|
1512
1590
|
} else {
|
|
1513
|
-
return
|
|
1591
|
+
return tsplus_module_48.failCause(c);
|
|
1514
1592
|
}
|
|
1515
|
-
}, __tsplusTrace), __tsplusTrace), __tsplusTrace);
|
|
1593
|
+
}, __tsplusTrace)(queue.isShutdown), __tsplusTrace)(tsplus_module_1.map(tsplus_module_16.from, __tsplusTrace)(queue.takeBetween(1, maxChunkSize, __tsplusTrace))), __tsplusTrace);
|
|
1516
1594
|
}
|
|
1517
1595
|
/**
|
|
1518
1596
|
* @tsplus static fncts.io.StreamOps fromQueueWithShutdown
|
|
@@ -1520,7 +1598,23 @@ function fromQueue_1(queue, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __ts
|
|
|
1520
1598
|
|
|
1521
1599
|
|
|
1522
1600
|
function fromQueueWithShutdown_1(queue, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1523
|
-
return ensuring_1(
|
|
1601
|
+
return ensuring_1(queue.shutdown, __tsplusTrace)(fromQueue_1(queue, maxChunkSize, __tsplusTrace));
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* @tsplus static fncts.io.StreamOps fromHub
|
|
1605
|
+
*/
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
function fromHub(hub, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1609
|
+
return flatMap_1(queue => fromQueueWithShutdown_1(queue, maxChunkSize, __tsplusTrace), __tsplusTrace)(scoped_1(() => hub().subscribe, __tsplusTrace));
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* @tsplus static fncts.io.StreamOps fromHubScoped
|
|
1613
|
+
*/
|
|
1614
|
+
|
|
1615
|
+
|
|
1616
|
+
function fromHubScoped(hub, maxChunkSize = _definition2.DEFAULT_CHUNK_SIZE, __tsplusTrace) {
|
|
1617
|
+
return tsplus_module_1.defer(() => tsplus_module_1.map(queue => fromQueueWithShutdown_1(queue, maxChunkSize, __tsplusTrace), __tsplusTrace)(hub().subscribe), __tsplusTrace);
|
|
1524
1618
|
}
|
|
1525
1619
|
/**
|
|
1526
1620
|
* Halt a stream with the specified exception
|
|
@@ -1544,7 +1638,7 @@ function halt_1(u, __tsplusTrace) {
|
|
|
1544
1638
|
}
|
|
1545
1639
|
|
|
1546
1640
|
function haltWhenWriter(fiber, __tsplusTrace) {
|
|
1547
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1641
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(maybeExit => tsplus_module_17.match(() => tsplus_module_10.readWith(i => tsplus_module_11.apSecond(haltWhenWriter(fiber, __tsplusTrace))(tsplus_module_10.writeNow(i)), tsplus_module_10.failNow, () => tsplus_module_10.unit), exit => tsplus_module_30.match(tsplus_module_11.failCauseNow, () => tsplus_module_10.unit)(exit))(maybeExit), __tsplusTrace)(tsplus_module_44.poll(fiber, __tsplusTrace)));
|
|
1548
1642
|
}
|
|
1549
1643
|
/**
|
|
1550
1644
|
* Halts the evaluation of this stream when the provided IO completes. The
|
|
@@ -1556,40 +1650,46 @@ function haltWhenWriter(fiber, __tsplusTrace) {
|
|
|
1556
1650
|
*
|
|
1557
1651
|
* If the IO completes with a failure, the stream will emit that failure.
|
|
1558
1652
|
*
|
|
1559
|
-
* @tsplus
|
|
1653
|
+
* @tsplus pipeable fncts.io.Stream haltWhen
|
|
1560
1654
|
*/
|
|
1561
1655
|
|
|
1562
1656
|
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1657
|
+
function haltWhen(io, __tsplusTrace) {
|
|
1658
|
+
return fa => {
|
|
1659
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(fiber => tsplus_module_10.pipeTo(haltWhenWriter(fiber, __tsplusTrace))(fa.channel), __tsplusTrace)(tsplus_module_14.forkScoped(io, __tsplusTrace))));
|
|
1660
|
+
};
|
|
1565
1661
|
}
|
|
1566
1662
|
|
|
1567
1663
|
function haltWhenFutureWriter(future, __tsplusTrace) {
|
|
1568
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1664
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(maybeIO => tsplus_module_17.match(() => tsplus_module_10.readWith(i => tsplus_module_11.apSecond(haltWhenFutureWriter(future, __tsplusTrace))(tsplus_module_10.writeNow(i)), tsplus_module_10.failNow, () => tsplus_module_10.unit), io => tsplus_module_10.unwrap(() => tsplus_module_1.match(tsplus_module_10.failNow, () => tsplus_module_10.unit, __tsplusTrace)(io)))(maybeIO), __tsplusTrace)(tsplus_module_31.poll(future, __tsplusTrace)));
|
|
1569
1665
|
}
|
|
1570
1666
|
/**
|
|
1571
1667
|
* Halts the evaluation of this stream when the provided promise resolves.
|
|
1572
1668
|
*
|
|
1573
1669
|
* If the promise completes with a failure, the stream will emit that failure.
|
|
1574
1670
|
*
|
|
1575
|
-
* @tsplus
|
|
1671
|
+
* @tsplus pipeable fncts.io.Stream haltWhen
|
|
1576
1672
|
*/
|
|
1577
1673
|
|
|
1578
1674
|
|
|
1579
|
-
function
|
|
1580
|
-
return
|
|
1675
|
+
function haltWhenFuture(future, __tsplusTrace) {
|
|
1676
|
+
return fa => {
|
|
1677
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(haltWhenFutureWriter(future, __tsplusTrace))(fa.channel));
|
|
1678
|
+
};
|
|
1581
1679
|
}
|
|
1582
1680
|
/**
|
|
1583
|
-
* @tsplus
|
|
1681
|
+
* @tsplus pipeable fncts.io.Stream interleave
|
|
1584
1682
|
*/
|
|
1585
1683
|
|
|
1586
1684
|
|
|
1587
|
-
function
|
|
1588
|
-
return
|
|
1685
|
+
function interleave(sb, __tsplusTrace) {
|
|
1686
|
+
return sa => {
|
|
1687
|
+
return interleaveWith_1(sb, forever_1(fromChunk_1(() => tsplus_module_16.make(true, false), __tsplusTrace), __tsplusTrace), __tsplusTrace)(sa);
|
|
1688
|
+
};
|
|
1589
1689
|
}
|
|
1590
1690
|
|
|
1591
1691
|
function interleaveWithProducer(handoff, __tsplusTrace) {
|
|
1592
|
-
return tsplus_module_10.readWithCause(value => tsplus_module_11.
|
|
1692
|
+
return tsplus_module_10.readWithCause(value => tsplus_module_11.apSecond(interleaveWithProducer(handoff, __tsplusTrace))(tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_23.single(value))(handoff))), cause => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_23.failCause(cause))(handoff)), () => tsplus_module_10.fromIO(() => tsplus_module_5.offer(tsplus_module_23.end)(handoff)));
|
|
1593
1693
|
}
|
|
1594
1694
|
/**
|
|
1595
1695
|
* Combines this stream and the specified stream deterministically using the
|
|
@@ -1599,33 +1699,35 @@ function interleaveWithProducer(handoff, __tsplusTrace) {
|
|
|
1599
1699
|
* `b`. If either this stream or the specified stream are exhausted further
|
|
1600
1700
|
* requests for values from that stream will be ignored.
|
|
1601
1701
|
*
|
|
1602
|
-
* @tsplus
|
|
1702
|
+
* @tsplus pipeable fncts.io.Stream interleaveWith
|
|
1603
1703
|
*/
|
|
1604
1704
|
|
|
1605
1705
|
|
|
1606
|
-
function interleaveWith_1(
|
|
1607
|
-
return
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1706
|
+
function interleaveWith_1(sb, b, __tsplusTrace) {
|
|
1707
|
+
return sa => {
|
|
1708
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(([left, right]) => {
|
|
1709
|
+
const process = (leftDone, rightDone) => tsplus_module_10.readWithCause(b => {
|
|
1710
|
+
if (b && !leftDone) {
|
|
1711
|
+
return tsplus_module_11.flatMap(take => tsplus_module_23.match(rightDone ? tsplus_module_10.unit : process(true, rightDone), tsplus_module_11.failCauseNow, chunk => tsplus_module_11.apSecond(process(leftDone, rightDone))(tsplus_module_10.writeNow(chunk)))(take))(tsplus_module_10.fromIO(() => tsplus_module_5.take(left)));
|
|
1712
|
+
}
|
|
1612
1713
|
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1714
|
+
if (!b && !rightDone) {
|
|
1715
|
+
return tsplus_module_11.flatMap(take => tsplus_module_23.match(leftDone ? tsplus_module_10.unit : process(leftDone, true), tsplus_module_11.failCauseNow, chunk => tsplus_module_11.apSecond(process(leftDone, rightDone))(tsplus_module_10.writeNow(chunk)))(take))(tsplus_module_10.fromIO(() => tsplus_module_5.take(right)));
|
|
1716
|
+
}
|
|
1616
1717
|
|
|
1617
|
-
|
|
1618
|
-
|
|
1718
|
+
return process(leftDone, rightDone);
|
|
1719
|
+
}, tsplus_module_11.failCauseNow, () => tsplus_module_10.unit);
|
|
1619
1720
|
|
|
1620
|
-
|
|
1621
|
-
|
|
1721
|
+
return tsplus_module_10.pipeTo(process(false, false))(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(b.channel));
|
|
1722
|
+
}, __tsplusTrace)(tsplus_module_1.flatMap(left => tsplus_module_1.flatMap(right => tsplus_module_1.flatMap(() => tsplus_module_1.map(() => (0, _function.tuple)(left, right), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(interleaveWithProducer(right, __tsplusTrace))(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(sb.channel))), __tsplusTrace)), __tsplusTrace)(tsplus_module_1.fork(tsplus_module_13.runScoped(tsplus_module_10.pipeTo(interleaveWithProducer(left, __tsplusTrace))(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(sa.channel))), __tsplusTrace)), __tsplusTrace)(tsplus_module_5.make()), __tsplusTrace)(tsplus_module_5.make()))));
|
|
1723
|
+
};
|
|
1622
1724
|
}
|
|
1623
1725
|
|
|
1624
1726
|
function intersperseWriter(middle, isFirst, __tsplusTrace) {
|
|
1625
1727
|
return tsplus_module_10.readWith(inp => {
|
|
1626
1728
|
const builder = tsplus_module_12.builder();
|
|
1627
1729
|
let flagResult = isFirst;
|
|
1628
|
-
tsplus_module_12.
|
|
1730
|
+
tsplus_module_12.forEach(a => {
|
|
1629
1731
|
if (flagResult) {
|
|
1630
1732
|
flagResult = false;
|
|
1631
1733
|
builder.append(a);
|
|
@@ -1633,8 +1735,8 @@ function intersperseWriter(middle, isFirst, __tsplusTrace) {
|
|
|
1633
1735
|
builder.append(middle);
|
|
1634
1736
|
builder.append(a);
|
|
1635
1737
|
}
|
|
1636
|
-
});
|
|
1637
|
-
return tsplus_module_11.
|
|
1738
|
+
})(inp);
|
|
1739
|
+
return tsplus_module_11.apSecond(intersperseWriter(middle, flagResult, __tsplusTrace))(tsplus_module_10.writeNow(builder.result()));
|
|
1638
1740
|
}, tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1639
1741
|
}
|
|
1640
1742
|
/**
|
|
@@ -1642,8 +1744,8 @@ function intersperseWriter(middle, isFirst, __tsplusTrace) {
|
|
|
1642
1744
|
*/
|
|
1643
1745
|
|
|
1644
1746
|
|
|
1645
|
-
function
|
|
1646
|
-
return new _definition2.Stream(tsplus_module_10.
|
|
1747
|
+
function intersperse(stream, middle, __tsplusTrace) {
|
|
1748
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(intersperseWriter(middle, true, __tsplusTrace))(stream.channel));
|
|
1647
1749
|
}
|
|
1648
1750
|
/**
|
|
1649
1751
|
* Interrupts the evaluation of this stream when the provided IO completes. The given
|
|
@@ -1653,47 +1755,55 @@ function intersperse_(stream, middle, __tsplusTrace) {
|
|
|
1653
1755
|
* If the IO completes with a failure before the stream completes, the returned stream
|
|
1654
1756
|
* will emit that failure.
|
|
1655
1757
|
*
|
|
1656
|
-
* @tsplus
|
|
1758
|
+
* @tsplus pipeable fncts.io.Stream interruptWhen
|
|
1657
1759
|
*/
|
|
1658
1760
|
|
|
1659
1761
|
|
|
1660
|
-
function
|
|
1661
|
-
return
|
|
1762
|
+
function interruptWhen(io, __tsplusTrace) {
|
|
1763
|
+
return stream => {
|
|
1764
|
+
return new _definition2.Stream(tsplus_module_49.interruptWhen(io)(stream.channel));
|
|
1765
|
+
};
|
|
1662
1766
|
}
|
|
1663
1767
|
/**
|
|
1664
|
-
* @tsplus
|
|
1768
|
+
* @tsplus pipeable fncts.io.Stream interruptWhen
|
|
1665
1769
|
*/
|
|
1666
1770
|
|
|
1667
1771
|
|
|
1668
|
-
function
|
|
1669
|
-
return
|
|
1772
|
+
function interruptWhenFuture(future, __tsplusTrace) {
|
|
1773
|
+
return fa => {
|
|
1774
|
+
return new _definition2.Stream(tsplus_module_49.interruptWhenFuture(future)(fa.channel));
|
|
1775
|
+
};
|
|
1670
1776
|
}
|
|
1671
1777
|
/**
|
|
1672
1778
|
* Transforms the elements of this stream using the supplied function.
|
|
1673
1779
|
*
|
|
1674
|
-
* @tsplus
|
|
1780
|
+
* @tsplus pipeable fncts.io.Stream map
|
|
1675
1781
|
*/
|
|
1676
1782
|
|
|
1677
1783
|
|
|
1678
|
-
function map_1(
|
|
1679
|
-
return
|
|
1784
|
+
function map_1(f, __tsplusTrace) {
|
|
1785
|
+
return stream => {
|
|
1786
|
+
return new _definition2.Stream(tsplus_module_10.mapOut(as => tsplus_module_12.map(f)(as))(stream.channel));
|
|
1787
|
+
};
|
|
1680
1788
|
}
|
|
1681
1789
|
|
|
1682
1790
|
function mapAccumAccumulator(currS, f, __tsplusTrace) {
|
|
1683
1791
|
return tsplus_module_10.readWith(inp => {
|
|
1684
|
-
const [nextS, bs] = tsplus_module_12.
|
|
1685
|
-
return tsplus_module_11.
|
|
1792
|
+
const [nextS, bs] = tsplus_module_12.mapAccum(currS, f)(inp);
|
|
1793
|
+
return tsplus_module_11.apSecond(mapAccumAccumulator(nextS, f, __tsplusTrace))(tsplus_module_10.writeNow(bs));
|
|
1686
1794
|
}, tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1687
1795
|
}
|
|
1688
1796
|
/**
|
|
1689
1797
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
1690
1798
|
*
|
|
1691
|
-
* @tsplus
|
|
1799
|
+
* @tsplus pipeable fncts.io.Stream mapAccum
|
|
1692
1800
|
*/
|
|
1693
1801
|
|
|
1694
1802
|
|
|
1695
|
-
function mapAccum_1(
|
|
1696
|
-
return
|
|
1803
|
+
function mapAccum_1(s, f, __tsplusTrace) {
|
|
1804
|
+
return stream => {
|
|
1805
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(mapAccumAccumulator(s, f, __tsplusTrace))(stream.channel));
|
|
1806
|
+
};
|
|
1697
1807
|
}
|
|
1698
1808
|
|
|
1699
1809
|
function mapAccumIOAccumulator(s, f, __tsplusTrace) {
|
|
@@ -1704,116 +1814,136 @@ function mapAccumIOAccumulator(s, f, __tsplusTrace) {
|
|
|
1704
1814
|
outputChunk.append(b);
|
|
1705
1815
|
}, __tsplusTrace);
|
|
1706
1816
|
|
|
1707
|
-
return tsplus_module_1.
|
|
1817
|
+
return tsplus_module_1.match(e => {
|
|
1708
1818
|
const partialResult = outputChunk.result();
|
|
1709
|
-
return tsplus_module_12.isNonEmpty(partialResult) ? tsplus_module_11.
|
|
1710
|
-
}, s => tsplus_module_11.
|
|
1819
|
+
return tsplus_module_12.isNonEmpty(partialResult) ? tsplus_module_11.apSecond(tsplus_module_10.failNow(e))(tsplus_module_10.writeNow(partialResult)) : tsplus_module_10.failNow(e);
|
|
1820
|
+
}, s => tsplus_module_11.apSecond(mapAccumIOAccumulator(s, f, __tsplusTrace))(tsplus_module_10.writeNow(outputChunk.result())), __tsplusTrace)(tsplus_module_1.foldLeft(inp, s, (s1, a) => tsplus_module_1.flatMap(([b, s2]) => tsplus_module_1.as(() => s2, __tsplusTrace)(emit(b)), __tsplusTrace)(f(s1, a)), __tsplusTrace));
|
|
1711
1821
|
}, __tsplusTrace)), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
1712
1822
|
}
|
|
1713
1823
|
/**
|
|
1714
1824
|
* Statefully and effectfully maps over the elements of this stream to produce
|
|
1715
1825
|
* new elements.
|
|
1716
1826
|
*
|
|
1717
|
-
* @tsplus
|
|
1827
|
+
* @tsplus pipeable fncts.io.Stream mapAccumIO
|
|
1718
1828
|
*/
|
|
1719
1829
|
|
|
1720
1830
|
|
|
1721
|
-
function mapAccumIO_1(
|
|
1722
|
-
return
|
|
1831
|
+
function mapAccumIO_1(s, f, __tsplusTrace) {
|
|
1832
|
+
return stream => {
|
|
1833
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(mapAccumIOAccumulator(s, f, __tsplusTrace))(stream.channel));
|
|
1834
|
+
};
|
|
1723
1835
|
}
|
|
1724
1836
|
/**
|
|
1725
1837
|
* Transforms the chunks emitted by this stream.
|
|
1726
1838
|
*
|
|
1727
|
-
* @tsplus
|
|
1839
|
+
* @tsplus pipeable fncts.io.Stream mapChunks
|
|
1728
1840
|
*/
|
|
1729
1841
|
|
|
1730
1842
|
|
|
1731
|
-
function mapChunks_1(
|
|
1732
|
-
return
|
|
1843
|
+
function mapChunks_1(f, __tsplusTrace) {
|
|
1844
|
+
return stream => {
|
|
1845
|
+
return new _definition2.Stream(tsplus_module_10.mapOut(f)(stream.channel));
|
|
1846
|
+
};
|
|
1733
1847
|
}
|
|
1734
1848
|
/**
|
|
1735
1849
|
* Effectfully transforms the chunks emitted by this stream.
|
|
1736
1850
|
*
|
|
1737
|
-
* @tsplus
|
|
1851
|
+
* @tsplus pipeable fncts.io.Stream mapChunksIO
|
|
1738
1852
|
*/
|
|
1739
1853
|
|
|
1740
1854
|
|
|
1741
|
-
function
|
|
1742
|
-
return
|
|
1855
|
+
function mapChunksIO(f, __tsplusTrace) {
|
|
1856
|
+
return stream => {
|
|
1857
|
+
return new _definition2.Stream(tsplus_module_10.mapOutIO_(f)(stream.channel));
|
|
1858
|
+
};
|
|
1743
1859
|
}
|
|
1744
1860
|
/**
|
|
1745
1861
|
* Maps each element to an iterable, and flattens the iterables into the
|
|
1746
1862
|
* output of this stream.
|
|
1747
1863
|
*
|
|
1748
|
-
* @tsplus
|
|
1864
|
+
* @tsplus pipeable fncts.io.Stream mapConcat
|
|
1749
1865
|
*/
|
|
1750
1866
|
|
|
1751
1867
|
|
|
1752
|
-
function
|
|
1753
|
-
return
|
|
1868
|
+
function mapConcat(f, __tsplusTrace) {
|
|
1869
|
+
return stream => {
|
|
1870
|
+
return mapConcatChunk_1(a => tsplus_module_16.from(f(a)), __tsplusTrace)(stream);
|
|
1871
|
+
};
|
|
1754
1872
|
}
|
|
1755
1873
|
/**
|
|
1756
1874
|
* Maps each element to a chunk, and flattens the chunks into the output of
|
|
1757
1875
|
* this stream.
|
|
1758
1876
|
*
|
|
1759
|
-
* @tsplus
|
|
1877
|
+
* @tsplus pipeable fncts.io.Stream mapConcatChunk
|
|
1760
1878
|
*/
|
|
1761
1879
|
|
|
1762
1880
|
|
|
1763
|
-
function mapConcatChunk_1(
|
|
1764
|
-
return
|
|
1881
|
+
function mapConcatChunk_1(f, __tsplusTrace) {
|
|
1882
|
+
return stream => {
|
|
1883
|
+
return mapChunks_1(c => tsplus_module_12.flatMap(f)(c), __tsplusTrace)(stream);
|
|
1884
|
+
};
|
|
1765
1885
|
}
|
|
1766
1886
|
/**
|
|
1767
1887
|
* Effectfully maps each element to a chunk, and flattens the chunks into
|
|
1768
1888
|
* the output of this stream.
|
|
1769
1889
|
*
|
|
1770
|
-
* @tsplus
|
|
1890
|
+
* @tsplus pipeable fncts.io.Stream mapConcatChunkIO
|
|
1771
1891
|
*/
|
|
1772
1892
|
|
|
1773
1893
|
|
|
1774
|
-
function
|
|
1775
|
-
return
|
|
1894
|
+
function mapConcatChunkIO(f, __tsplusTrace) {
|
|
1895
|
+
return stream => {
|
|
1896
|
+
return mapConcatChunk_1(_function.identity, __tsplusTrace)(mapIO_1(f, __tsplusTrace)(stream));
|
|
1897
|
+
};
|
|
1776
1898
|
}
|
|
1777
1899
|
/**
|
|
1778
1900
|
* Effectfully maps each element to an iterable, and flattens the iterables into
|
|
1779
1901
|
* the output of this stream.
|
|
1780
1902
|
*
|
|
1781
|
-
* @tsplus
|
|
1903
|
+
* @tsplus pipeable fncts.io.Stream mapConcatIO
|
|
1782
1904
|
*/
|
|
1783
1905
|
|
|
1784
1906
|
|
|
1785
|
-
function
|
|
1786
|
-
return
|
|
1907
|
+
function mapConcatIO(f, __tsplusTrace) {
|
|
1908
|
+
return stream => {
|
|
1909
|
+
return mapConcatChunk_1(_function.identity, __tsplusTrace)(mapIO_1(a => tsplus_module_1.map(tsplus_module_16.from, __tsplusTrace)(f(a)), __tsplusTrace)(stream));
|
|
1910
|
+
};
|
|
1787
1911
|
}
|
|
1788
1912
|
/**
|
|
1789
1913
|
* Transforms the errors emitted by this stream using `f`.
|
|
1790
1914
|
*
|
|
1791
|
-
* @tsplus
|
|
1915
|
+
* @tsplus pipeable fncts.io.Stream mapError
|
|
1792
1916
|
*/
|
|
1793
1917
|
|
|
1794
1918
|
|
|
1795
|
-
function mapError_1(
|
|
1796
|
-
return
|
|
1919
|
+
function mapError_1(f, __tsplusTrace) {
|
|
1920
|
+
return stream => {
|
|
1921
|
+
return new _definition2.Stream(tsplus_module_10.mapError(f)(stream.channel));
|
|
1922
|
+
};
|
|
1797
1923
|
}
|
|
1798
1924
|
/**
|
|
1799
1925
|
* Transforms the full causes of failures emitted by this stream.
|
|
1800
1926
|
*
|
|
1801
|
-
* @tsplus
|
|
1927
|
+
* @tsplus pipeable fncts.io.Stream mapErrorCause
|
|
1802
1928
|
*/
|
|
1803
1929
|
|
|
1804
1930
|
|
|
1805
|
-
function
|
|
1806
|
-
return
|
|
1931
|
+
function mapErrorCause(f, __tsplusTrace) {
|
|
1932
|
+
return fa => {
|
|
1933
|
+
return new _definition2.Stream(tsplus_module_10.mapErrorCause(f)(fa.channel));
|
|
1934
|
+
};
|
|
1807
1935
|
}
|
|
1808
1936
|
/**
|
|
1809
1937
|
* Maps over elements of the stream with the specified effectful function.
|
|
1810
1938
|
*
|
|
1811
|
-
* @tsplus
|
|
1939
|
+
* @tsplus pipeable fncts.io.Stream mapIO
|
|
1812
1940
|
*/
|
|
1813
1941
|
|
|
1814
1942
|
|
|
1815
|
-
function mapIO_1(
|
|
1816
|
-
return
|
|
1943
|
+
function mapIO_1(f, __tsplusTrace) {
|
|
1944
|
+
return stream => {
|
|
1945
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(mapIOLoop(tsplus_module_34.empty()[Symbol.iterator](), f, __tsplusTrace))(stream.channel));
|
|
1946
|
+
};
|
|
1817
1947
|
}
|
|
1818
1948
|
|
|
1819
1949
|
function mapIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -1822,7 +1952,7 @@ function mapIOLoop(iterator, f, __tsplusTrace) {
|
|
|
1822
1952
|
if (next.done) {
|
|
1823
1953
|
return tsplus_module_10.readWithCause(elem => mapIOLoop(elem[Symbol.iterator](), f, __tsplusTrace), tsplus_module_11.failCauseNow, tsplus_module_11.succeedNow);
|
|
1824
1954
|
} else {
|
|
1825
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
1955
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(b => tsplus_module_11.apSecond(mapIOLoop(iterator, f, __tsplusTrace))(tsplus_module_10.writeNow(tsplus_module_16.single(b))), __tsplusTrace)(f(next.value)));
|
|
1826
1956
|
}
|
|
1827
1957
|
}
|
|
1828
1958
|
/**
|
|
@@ -1832,12 +1962,14 @@ function mapIOLoop(iterator, f, __tsplusTrace) {
|
|
|
1832
1962
|
*
|
|
1833
1963
|
* @note This combinator destroys the chunking structure. It's recommended to use chunkN afterwards.
|
|
1834
1964
|
*
|
|
1835
|
-
* @tsplus
|
|
1965
|
+
* @tsplus pipeable fncts.io.Stream mapIOC
|
|
1836
1966
|
*/
|
|
1837
1967
|
|
|
1838
1968
|
|
|
1839
|
-
function
|
|
1840
|
-
return
|
|
1969
|
+
function mapIOC(n, f, __tsplusTrace) {
|
|
1970
|
+
return stream => {
|
|
1971
|
+
return new _definition2.Stream(tsplus_module_10.mapOut(tsplus_module_16.single)(tsplus_module_50.mapOutIOC(n, f)(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(stream.channel))));
|
|
1972
|
+
};
|
|
1841
1973
|
}
|
|
1842
1974
|
/**
|
|
1843
1975
|
* Maps each element of this stream to another stream and returns the
|
|
@@ -1845,92 +1977,108 @@ function mapIOC_(stream, n, f, __tsplusTrace) {
|
|
|
1845
1977
|
* concurrently. Up to `bufferSize` elements of the produced streams may be
|
|
1846
1978
|
* buffered in memory by this operator.
|
|
1847
1979
|
*
|
|
1848
|
-
* @tsplus
|
|
1980
|
+
* @tsplus pipeable fncts.io.Stream mergeMap
|
|
1849
1981
|
*/
|
|
1850
1982
|
|
|
1851
1983
|
|
|
1852
|
-
function mergeMap_1(
|
|
1853
|
-
return
|
|
1984
|
+
function mergeMap_1(f, n, bufferSize = 16, __tsplusTrace) {
|
|
1985
|
+
return ma => {
|
|
1986
|
+
return new _definition2.Stream(tsplus_module_51.mergeMap(a => f(a).channel, n, bufferSize)(tsplus_module_10.concatMap(tsplus_module_10.writeChunk)(ma.channel)));
|
|
1987
|
+
};
|
|
1854
1988
|
}
|
|
1855
1989
|
/**
|
|
1856
1990
|
* Maps over elements of the stream with the specified effectful function,
|
|
1857
1991
|
* executing up to `n` invocations of `f` concurrently. The element order
|
|
1858
1992
|
* is not enforced by this combinator, and elements may be reordered.
|
|
1859
1993
|
*
|
|
1860
|
-
* @tsplus
|
|
1994
|
+
* @tsplus pipeable fncts.io.Stream mergeMapIO
|
|
1861
1995
|
*/
|
|
1862
1996
|
|
|
1863
1997
|
|
|
1864
|
-
function
|
|
1865
|
-
return
|
|
1998
|
+
function mergeMapIO(f, n, bufferSize = 16, __tsplusTrace) {
|
|
1999
|
+
return stream => {
|
|
2000
|
+
return mergeMap_1(a => fromIO_1(f(a), __tsplusTrace), n, bufferSize, __tsplusTrace)(stream);
|
|
2001
|
+
};
|
|
1866
2002
|
}
|
|
1867
2003
|
/**
|
|
1868
|
-
* @tsplus
|
|
2004
|
+
* @tsplus pipeable fncts.io.Stream mergeEither
|
|
1869
2005
|
*/
|
|
1870
2006
|
|
|
1871
2007
|
|
|
1872
|
-
function mergeEither_1(
|
|
1873
|
-
return
|
|
2008
|
+
function mergeEither_1(fb, __tsplusTrace) {
|
|
2009
|
+
return fa => {
|
|
2010
|
+
return mergeWith_1(fb, tsplus_module_15.left, tsplus_module_15.right)(fa);
|
|
2011
|
+
};
|
|
1874
2012
|
}
|
|
1875
2013
|
|
|
1876
2014
|
function mergeWithHandler(terminate, __tsplusTrace) {
|
|
1877
|
-
return exit => terminate || !
|
|
2015
|
+
return exit => terminate || !tsplus_module_47.isSuccess(exit) ? tsplus_module_52.done(tsplus_module_1.fromExitNow(exit, __tsplusTrace)) : tsplus_module_52.wait(tsplus_module_1.fromExitNow);
|
|
1878
2016
|
}
|
|
1879
2017
|
/**
|
|
1880
|
-
* @tsplus
|
|
2018
|
+
* @tsplus pipeable fncts.io.Stream mergeWith
|
|
1881
2019
|
*/
|
|
1882
2020
|
|
|
1883
2021
|
|
|
1884
|
-
function mergeWith_1(
|
|
1885
|
-
return
|
|
2022
|
+
function mergeWith_1(sb, l, r, strategy = "Both", __tsplusTrace) {
|
|
2023
|
+
return sa => {
|
|
2024
|
+
return new _definition2.Stream(tsplus_module_53.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));
|
|
2025
|
+
};
|
|
1886
2026
|
}
|
|
1887
2027
|
/**
|
|
1888
2028
|
* Runs the specified effect if this stream fails, providing the error to the effect if it exists.
|
|
1889
2029
|
*
|
|
1890
2030
|
* Note: Unlike `IO.onError`, there is no guarantee that the provided effect will not be interrupted.
|
|
1891
2031
|
*
|
|
1892
|
-
* @tsplus
|
|
2032
|
+
* @tsplus pipeable fncts.io.Stream onError
|
|
1893
2033
|
*/
|
|
1894
2034
|
|
|
1895
2035
|
|
|
1896
|
-
function
|
|
1897
|
-
return
|
|
2036
|
+
function onError(cleanup, __tsplusTrace) {
|
|
2037
|
+
return stream => {
|
|
2038
|
+
return catchAllCause_1(cause => fromIO_1(tsplus_module_1.apSecond(tsplus_module_1.failCauseNow(cause, __tsplusTrace), __tsplusTrace)(cleanup(cause)), __tsplusTrace), __tsplusTrace)(stream);
|
|
2039
|
+
};
|
|
1898
2040
|
}
|
|
1899
2041
|
/**
|
|
1900
2042
|
* Switches to the provided stream in case this one fails with a typed error.
|
|
1901
2043
|
*
|
|
1902
2044
|
* See also Stream#catchAll
|
|
1903
2045
|
*
|
|
1904
|
-
* @tsplus
|
|
2046
|
+
* @tsplus pipeable fncts.io.Stream orElse
|
|
1905
2047
|
*/
|
|
1906
2048
|
|
|
1907
2049
|
|
|
1908
|
-
function orElse_1(
|
|
1909
|
-
return
|
|
2050
|
+
function orElse_1(that, __tsplusTrace) {
|
|
2051
|
+
return stream => {
|
|
2052
|
+
return new _definition2.Stream(tsplus_module_10.orElse(that().channel)(stream.channel));
|
|
2053
|
+
};
|
|
1910
2054
|
}
|
|
1911
2055
|
/**
|
|
1912
2056
|
* Switches to the provided stream in case this one fails with a typed error.
|
|
1913
2057
|
*
|
|
1914
2058
|
* See also ZStream#catchAll
|
|
1915
2059
|
*
|
|
1916
|
-
* @tsplus
|
|
2060
|
+
* @tsplus pipeable fncts.io.Stream orElseEither
|
|
1917
2061
|
*/
|
|
1918
2062
|
|
|
1919
2063
|
|
|
1920
|
-
function
|
|
1921
|
-
return
|
|
2064
|
+
function orElseEither(that, __tsplusTrace) {
|
|
2065
|
+
return stream => {
|
|
2066
|
+
return orElse_1(() => map_1(tsplus_module_15.right, __tsplusTrace)(that()), __tsplusTrace)(map_1(tsplus_module_15.left, __tsplusTrace)(stream));
|
|
2067
|
+
};
|
|
1922
2068
|
}
|
|
1923
2069
|
/**
|
|
1924
2070
|
* Fails with given error in case this one fails with a typed error.
|
|
1925
2071
|
*
|
|
1926
2072
|
* See also Stream#catchAll
|
|
1927
2073
|
*
|
|
1928
|
-
* @tsplus
|
|
2074
|
+
* @tsplus pipeable fncts.io.Stream orElseFail
|
|
1929
2075
|
*/
|
|
1930
2076
|
|
|
1931
2077
|
|
|
1932
|
-
function
|
|
1933
|
-
return
|
|
2078
|
+
function orElseFail(e, __tsplusTrace) {
|
|
2079
|
+
return stream => {
|
|
2080
|
+
return orElse_1(() => failNow_1(e(), __tsplusTrace), __tsplusTrace)(stream);
|
|
2081
|
+
};
|
|
1934
2082
|
}
|
|
1935
2083
|
/**
|
|
1936
2084
|
* Switches to the provided stream in case this one fails with the `None` value.
|
|
@@ -1939,54 +2087,64 @@ function orElseFail_(stream, e, __tsplusTrace) {
|
|
|
1939
2087
|
*/
|
|
1940
2088
|
|
|
1941
2089
|
|
|
1942
|
-
function
|
|
1943
|
-
return catchAll_1(
|
|
2090
|
+
function orElseOptional(stream, that, __tsplusTrace) {
|
|
2091
|
+
return catchAll_1(maybeError => tsplus_module_17.match(() => that(), e => failNow_1(tsplus_module_3.just(e), __tsplusTrace))(maybeError), __tsplusTrace)(stream);
|
|
1944
2092
|
}
|
|
1945
2093
|
/**
|
|
1946
2094
|
* Succeeds with the specified value if this one fails with a typed error.
|
|
1947
2095
|
*
|
|
1948
|
-
* @tsplus
|
|
2096
|
+
* @tsplus pipeable fncts.io.Stream orElseSucceed
|
|
1949
2097
|
*/
|
|
1950
2098
|
|
|
1951
2099
|
|
|
1952
|
-
function
|
|
1953
|
-
return
|
|
2100
|
+
function orElseSucceed(a, __tsplusTrace) {
|
|
2101
|
+
return stream => {
|
|
2102
|
+
return orElse_1(() => succeedNow_1(a(), __tsplusTrace), __tsplusTrace)(stream);
|
|
2103
|
+
};
|
|
1954
2104
|
}
|
|
1955
2105
|
/**
|
|
1956
|
-
* @tsplus
|
|
2106
|
+
* @tsplus pipeable fncts.io.Stream pipeThrough
|
|
1957
2107
|
*/
|
|
1958
2108
|
|
|
1959
2109
|
|
|
1960
|
-
function pipeThrough_1(
|
|
1961
|
-
return
|
|
2110
|
+
function pipeThrough_1(sa, __tsplusTrace) {
|
|
2111
|
+
return ma => {
|
|
2112
|
+
return new _definition2.Stream(tsplus_module_10.pipeToOrFail(sa.channel)(ma.channel));
|
|
2113
|
+
};
|
|
1962
2114
|
}
|
|
1963
2115
|
/**
|
|
1964
2116
|
* Provides the stream with its required environment, which eliminates
|
|
1965
2117
|
* its dependency on `R`.
|
|
1966
2118
|
*
|
|
1967
|
-
* @tsplus
|
|
2119
|
+
* @tsplus pipeable fncts.io.Stream provideEnvironment
|
|
1968
2120
|
*/
|
|
1969
2121
|
|
|
1970
2122
|
|
|
1971
|
-
function provideEnvironment_1(
|
|
1972
|
-
return
|
|
2123
|
+
function provideEnvironment_1(r, __tsplusTrace) {
|
|
2124
|
+
return ra => {
|
|
2125
|
+
return new _definition2.Stream(tsplus_module_10.provideEnvironment(() => r)(ra.channel));
|
|
2126
|
+
};
|
|
1973
2127
|
}
|
|
1974
2128
|
/**
|
|
1975
|
-
* @tsplus
|
|
2129
|
+
* @tsplus pipeable fncts.io.Stream provideLayer
|
|
1976
2130
|
*/
|
|
1977
2131
|
|
|
1978
2132
|
|
|
1979
|
-
function provideLayer_1(
|
|
1980
|
-
return
|
|
2133
|
+
function provideLayer_1(layer, __tsplusTrace) {
|
|
2134
|
+
return self => {
|
|
2135
|
+
return new _definition2.Stream(tsplus_module_10.unwrapScoped(() => tsplus_module_1.map(r => tsplus_module_10.provideEnvironment(() => r)(self.channel), __tsplusTrace)(tsplus_module_54.build(layer, __tsplusTrace))));
|
|
2136
|
+
};
|
|
1981
2137
|
}
|
|
1982
2138
|
/**
|
|
1983
|
-
* @tsplus
|
|
2139
|
+
* @tsplus pipeable fncts.io.Stream provideSomeLayer
|
|
1984
2140
|
*/
|
|
1985
2141
|
|
|
1986
2142
|
|
|
1987
|
-
function
|
|
1988
|
-
|
|
1989
|
-
|
|
2143
|
+
function provideSomeLayer(layer, __tsplusTrace) {
|
|
2144
|
+
return self => {
|
|
2145
|
+
// @ts-expect-error
|
|
2146
|
+
return provideLayer_1(tsplus_module_55.and(layer, __tsplusTrace)(tsplus_module_55.environment(__tsplusTrace)), __tsplusTrace)(self);
|
|
2147
|
+
};
|
|
1990
2148
|
}
|
|
1991
2149
|
|
|
1992
2150
|
class Rechunker {
|
|
@@ -2004,7 +2162,7 @@ class Rechunker {
|
|
|
2004
2162
|
const result = this.builder;
|
|
2005
2163
|
this.builder = [];
|
|
2006
2164
|
this.pos = 0;
|
|
2007
|
-
return
|
|
2165
|
+
return tsplus_module_16.from(result);
|
|
2008
2166
|
}
|
|
2009
2167
|
|
|
2010
2168
|
return null;
|
|
@@ -2012,7 +2170,7 @@ class Rechunker {
|
|
|
2012
2170
|
|
|
2013
2171
|
emitOfNotEmpty() {
|
|
2014
2172
|
if (this.pos !== 0) {
|
|
2015
|
-
return tsplus_module_10.writeNow(
|
|
2173
|
+
return tsplus_module_10.writeNow(tsplus_module_16.from(this.builder));
|
|
2016
2174
|
} else {
|
|
2017
2175
|
return tsplus_module_10.unit;
|
|
2018
2176
|
}
|
|
@@ -2027,7 +2185,7 @@ class Rechunker {
|
|
|
2027
2185
|
function rechunkProcess(rechunker, target, __tsplusTrace) {
|
|
2028
2186
|
return tsplus_module_10.readWithCause(chunk => {
|
|
2029
2187
|
if (chunk.length === target && rechunker.isEmpty) {
|
|
2030
|
-
return tsplus_module_11.
|
|
2188
|
+
return tsplus_module_11.apSecond(rechunkProcess(rechunker, target, __tsplusTrace))(tsplus_module_10.writeNow(chunk));
|
|
2031
2189
|
} else if (chunk.length > 0) {
|
|
2032
2190
|
const chunks = [];
|
|
2033
2191
|
let result = null;
|
|
@@ -2035,7 +2193,7 @@ function rechunkProcess(rechunker, target, __tsplusTrace) {
|
|
|
2035
2193
|
|
|
2036
2194
|
while (i < chunk.length) {
|
|
2037
2195
|
while (i < chunk.length && result === null) {
|
|
2038
|
-
result = rechunker.write(tsplus_module_12.
|
|
2196
|
+
result = rechunker.write(tsplus_module_12.unsafeGet(i)(chunk));
|
|
2039
2197
|
i += 1;
|
|
2040
2198
|
}
|
|
2041
2199
|
|
|
@@ -2045,23 +2203,25 @@ function rechunkProcess(rechunker, target, __tsplusTrace) {
|
|
|
2045
2203
|
}
|
|
2046
2204
|
}
|
|
2047
2205
|
|
|
2048
|
-
return tsplus_module_11.
|
|
2206
|
+
return tsplus_module_11.apSecond(rechunkProcess(rechunker, target, __tsplusTrace))(tsplus_module_10.writeAll(chunks));
|
|
2049
2207
|
} else {
|
|
2050
2208
|
return rechunkProcess(rechunker, target, __tsplusTrace);
|
|
2051
2209
|
}
|
|
2052
|
-
}, cause => tsplus_module_11.
|
|
2210
|
+
}, cause => tsplus_module_11.apSecond(tsplus_module_11.failCauseNow(cause))(rechunker.emitOfNotEmpty()), () => rechunker.emitOfNotEmpty());
|
|
2053
2211
|
}
|
|
2054
2212
|
/**
|
|
2055
2213
|
* Re-chunks the elements of the stream into chunks of
|
|
2056
2214
|
* `n` elements each.
|
|
2057
2215
|
* The last chunk might contain less than `n` elements
|
|
2058
2216
|
*
|
|
2059
|
-
* @tsplus
|
|
2217
|
+
* @tsplus pipeable fncts.io.Stream rechunk
|
|
2060
2218
|
*/
|
|
2061
2219
|
|
|
2062
2220
|
|
|
2063
|
-
function
|
|
2064
|
-
return
|
|
2221
|
+
function rechunk(n, __tsplusTrace) {
|
|
2222
|
+
return stream => {
|
|
2223
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(rechunkProcess(new Rechunker(n), n, __tsplusTrace))(stream.channel));
|
|
2224
|
+
};
|
|
2065
2225
|
}
|
|
2066
2226
|
/**
|
|
2067
2227
|
* Repeats the provided value infinitely.
|
|
@@ -2071,7 +2231,7 @@ function rechunk_(stream, n, __tsplusTrace) {
|
|
|
2071
2231
|
|
|
2072
2232
|
|
|
2073
2233
|
function repeatValue(a, __tsplusTrace) {
|
|
2074
|
-
return new _definition2.Stream(tsplus_module_10.repeated(tsplus_module_10.writeNow(
|
|
2234
|
+
return new _definition2.Stream(tsplus_module_10.repeated(tsplus_module_10.writeNow(tsplus_module_16.single(a))));
|
|
2075
2235
|
}
|
|
2076
2236
|
/**
|
|
2077
2237
|
* Creates a stream from an effect producing a value of type `A` which repeats forever.
|
|
@@ -2081,7 +2241,7 @@ function repeatValue(a, __tsplusTrace) {
|
|
|
2081
2241
|
|
|
2082
2242
|
|
|
2083
2243
|
function repeatIO(fa, __tsplusTrace) {
|
|
2084
|
-
return repeatIOMaybe_1(tsplus_module_1.
|
|
2244
|
+
return repeatIOMaybe_1(tsplus_module_1.mapError(tsplus_module_3.just, __tsplusTrace)(fa), __tsplusTrace);
|
|
2085
2245
|
}
|
|
2086
2246
|
/**
|
|
2087
2247
|
* Creates a stream from an effect producing values of type `A` until it fails with None.
|
|
@@ -2091,7 +2251,7 @@ function repeatIO(fa, __tsplusTrace) {
|
|
|
2091
2251
|
|
|
2092
2252
|
|
|
2093
2253
|
function repeatIOMaybe_1(fa, __tsplusTrace) {
|
|
2094
|
-
return repeatIOChunkMaybe_1(tsplus_module_1.
|
|
2254
|
+
return repeatIOChunkMaybe_1(tsplus_module_1.map(tsplus_module_16.single, __tsplusTrace)(fa), __tsplusTrace);
|
|
2095
2255
|
}
|
|
2096
2256
|
/**
|
|
2097
2257
|
* Creates a stream from an effect producing chunks of `A` values which repeats forever.
|
|
@@ -2101,7 +2261,7 @@ function repeatIOMaybe_1(fa, __tsplusTrace) {
|
|
|
2101
2261
|
|
|
2102
2262
|
|
|
2103
2263
|
function repeatIOChunk(fa, __tsplusTrace) {
|
|
2104
|
-
return repeatIOChunkMaybe_1(tsplus_module_1.
|
|
2264
|
+
return repeatIOChunkMaybe_1(tsplus_module_1.mapError(tsplus_module_3.just, __tsplusTrace)(fa), __tsplusTrace);
|
|
2105
2265
|
}
|
|
2106
2266
|
/**
|
|
2107
2267
|
* Creates a stream from an effect producing chunks of `A` values until it fails with None.
|
|
@@ -2111,17 +2271,19 @@ function repeatIOChunk(fa, __tsplusTrace) {
|
|
|
2111
2271
|
|
|
2112
2272
|
|
|
2113
2273
|
function repeatIOChunkMaybe_1(fa, __tsplusTrace) {
|
|
2114
|
-
return unfoldChunkIO_1(undefined, _ => tsplus_module_1.
|
|
2274
|
+
return unfoldChunkIO_1(undefined, _ => tsplus_module_1.catchAll(maybeError => tsplus_module_17.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);
|
|
2115
2275
|
}
|
|
2116
2276
|
/**
|
|
2117
2277
|
* Runs the sink on the stream to produce either the sink's result or an error.
|
|
2118
2278
|
*
|
|
2119
|
-
* @tsplus
|
|
2279
|
+
* @tsplus pipeable fncts.io.Stream run
|
|
2120
2280
|
*/
|
|
2121
2281
|
|
|
2122
2282
|
|
|
2123
|
-
function run_1(
|
|
2124
|
-
return
|
|
2283
|
+
function run_1(sink, __tsplusTrace) {
|
|
2284
|
+
return stream => {
|
|
2285
|
+
return tsplus_module_56.runDrain(tsplus_module_10.pipeToOrFail(sink.channel)(stream.channel));
|
|
2286
|
+
};
|
|
2125
2287
|
}
|
|
2126
2288
|
/**
|
|
2127
2289
|
* Runs the stream and collects all of its elements to a chunk.
|
|
@@ -2131,7 +2293,7 @@ function run_1(stream, sink, __tsplusTrace) {
|
|
|
2131
2293
|
|
|
2132
2294
|
|
|
2133
2295
|
function runCollect(stream, __tsplusTrace) {
|
|
2134
|
-
return run_1(
|
|
2296
|
+
return run_1(tsplus_module_42.makeCollectAll(__tsplusTrace), __tsplusTrace)(stream);
|
|
2135
2297
|
}
|
|
2136
2298
|
/**
|
|
2137
2299
|
* Runs the stream and collects ignore its elements.
|
|
@@ -2141,104 +2303,122 @@ function runCollect(stream, __tsplusTrace) {
|
|
|
2141
2303
|
|
|
2142
2304
|
|
|
2143
2305
|
function runDrain(stream, __tsplusTrace) {
|
|
2144
|
-
return run_1(
|
|
2306
|
+
return run_1(tsplus_module_42.drain, __tsplusTrace)(stream);
|
|
2145
2307
|
}
|
|
2146
2308
|
/**
|
|
2147
|
-
* @tsplus
|
|
2309
|
+
* @tsplus pipeable fncts.io.Stream runForeachScoped
|
|
2148
2310
|
*/
|
|
2149
2311
|
|
|
2150
2312
|
|
|
2151
|
-
function runForeachScoped_1(
|
|
2152
|
-
return
|
|
2313
|
+
function runForeachScoped_1(f, __tsplusTrace) {
|
|
2314
|
+
return self => {
|
|
2315
|
+
return runScoped_1(tsplus_module_42.makeForeach(f, __tsplusTrace), __tsplusTrace)(self);
|
|
2316
|
+
};
|
|
2153
2317
|
}
|
|
2154
2318
|
/**
|
|
2155
2319
|
* Like `into`, but provides the result as a `Managed` to allow for scope
|
|
2156
2320
|
* composition.
|
|
2157
2321
|
*
|
|
2158
|
-
* @tsplus
|
|
2322
|
+
* @tsplus pipeable fncts.io.Stream runIntoElementsScoped
|
|
2159
2323
|
*/
|
|
2160
2324
|
|
|
2161
2325
|
|
|
2162
|
-
function runIntoElementsScoped_1(
|
|
2163
|
-
|
|
2164
|
-
|
|
2326
|
+
function runIntoElementsScoped_1(queue, __tsplusTrace) {
|
|
2327
|
+
return stream => {
|
|
2328
|
+
const writer = tsplus_module_10.readWith(inp => tsplus_module_11.apSecond(writer)(tsplus_module_12.foldLeft(tsplus_module_10.unit, (channel, a) => tsplus_module_11.apSecond(tsplus_module_10.writeNow(tsplus_module_35.succeed(a)))(channel))(inp)), err => tsplus_module_10.writeNow(tsplus_module_35.fail(tsplus_module_3.just(err))), () => tsplus_module_10.writeNow(tsplus_module_35.fail(tsplus_module_3.nothing())));
|
|
2329
|
+
return tsplus_module_1.asUnit(tsplus_module_13.runScoped(tsplus_module_10.drain(tsplus_module_10.mapOutIO_(exit => queue.offer(exit, __tsplusTrace))(tsplus_module_10.pipeTo(writer)(stream.channel)))), __tsplusTrace);
|
|
2330
|
+
};
|
|
2165
2331
|
}
|
|
2166
2332
|
/**
|
|
2167
2333
|
* Like `Stream#into`, but provides the result as a `Managed` to allow for scope
|
|
2168
2334
|
* composition.
|
|
2169
2335
|
*
|
|
2170
|
-
* @tsplus
|
|
2336
|
+
* @tsplus pipeable fncts.io.Stream runIntoQueueScoped
|
|
2171
2337
|
*/
|
|
2172
2338
|
|
|
2173
2339
|
|
|
2174
|
-
function runIntoQueueScoped_1(
|
|
2175
|
-
|
|
2176
|
-
|
|
2340
|
+
function runIntoQueueScoped_1(queue, __tsplusTrace) {
|
|
2341
|
+
return stream => {
|
|
2342
|
+
const writer = tsplus_module_10.readWithCause(inp => tsplus_module_11.apSecond(writer)(tsplus_module_10.writeNow(tsplus_module_23.chunk(inp))), cause => tsplus_module_10.writeNow(tsplus_module_23.failCause(cause)), _ => tsplus_module_10.writeNow(tsplus_module_23.end));
|
|
2343
|
+
return tsplus_module_1.asUnit(tsplus_module_13.runScoped(tsplus_module_10.drain(tsplus_module_10.mapOutIO_(take => queue.offer(take, __tsplusTrace))(tsplus_module_10.pipeTo(writer)(stream.channel)))), __tsplusTrace);
|
|
2344
|
+
};
|
|
2177
2345
|
}
|
|
2178
2346
|
/**
|
|
2179
2347
|
* Like `Stream#runIntoHub`, but provides the result as a `Managed` to allow for scope
|
|
2180
2348
|
* composition.
|
|
2181
2349
|
*
|
|
2182
|
-
* @tsplus
|
|
2350
|
+
* @tsplus pipeable fncts.io.Stream runIntoHubScoped
|
|
2183
2351
|
*/
|
|
2184
2352
|
|
|
2185
2353
|
|
|
2186
|
-
function runIntoHubScoped_1(
|
|
2187
|
-
return
|
|
2354
|
+
function runIntoHubScoped_1(hub, __tsplusTrace) {
|
|
2355
|
+
return stream => {
|
|
2356
|
+
return runIntoQueueScoped_1(hub, __tsplusTrace)(stream);
|
|
2357
|
+
};
|
|
2188
2358
|
}
|
|
2189
2359
|
/**
|
|
2190
2360
|
* Runs the sink on the stream to produce either the sink's result or an error.
|
|
2191
2361
|
*
|
|
2192
|
-
* @tsplus
|
|
2362
|
+
* @tsplus pipeable fncts.io.Stream runScoped
|
|
2193
2363
|
*/
|
|
2194
2364
|
|
|
2195
2365
|
|
|
2196
|
-
function runScoped_1(
|
|
2197
|
-
return
|
|
2366
|
+
function runScoped_1(sink, __tsplusTrace) {
|
|
2367
|
+
return stream => {
|
|
2368
|
+
return tsplus_module_13.runScoped(tsplus_module_10.drain(tsplus_module_10.pipeToOrFail(sink.channel)(stream.channel)));
|
|
2369
|
+
};
|
|
2198
2370
|
}
|
|
2199
2371
|
/**
|
|
2200
2372
|
* Statefully maps over the elements of this stream to produce all intermediate results
|
|
2201
2373
|
* of type `B` given an initial B.
|
|
2202
2374
|
*
|
|
2203
|
-
* @tsplus
|
|
2375
|
+
* @tsplus pipeable fncts.io.Stream scan
|
|
2204
2376
|
*/
|
|
2205
2377
|
|
|
2206
2378
|
|
|
2207
|
-
function
|
|
2208
|
-
return
|
|
2379
|
+
function scan(b, f, __tsplusTrace) {
|
|
2380
|
+
return sa => {
|
|
2381
|
+
return scanIO_1(b, (b, a) => tsplus_module_1.succeedNow(f(b, a), __tsplusTrace), __tsplusTrace)(sa);
|
|
2382
|
+
};
|
|
2209
2383
|
}
|
|
2210
2384
|
/**
|
|
2211
2385
|
* Statefully and effectfully maps over the elements of this stream to produce all
|
|
2212
2386
|
* intermediate results of type `B` given an initial B.
|
|
2213
2387
|
*
|
|
2214
|
-
* @tsplus
|
|
2388
|
+
* @tsplus pipeable fncts.io.Stream scanIO
|
|
2215
2389
|
*/
|
|
2216
2390
|
|
|
2217
2391
|
|
|
2218
|
-
function scanIO_1(
|
|
2219
|
-
return
|
|
2392
|
+
function scanIO_1(b, f, __tsplusTrace) {
|
|
2393
|
+
return sa => {
|
|
2394
|
+
return concat_1(mapAccumIO_1(b, (b, a) => tsplus_module_1.map(b => [b, b], __tsplusTrace)(f(b, a)), __tsplusTrace)(sa), __tsplusTrace)(succeedNow_1(b, __tsplusTrace));
|
|
2395
|
+
};
|
|
2220
2396
|
}
|
|
2221
2397
|
/**
|
|
2222
2398
|
* Statefully maps over the elements of this stream to produce all
|
|
2223
2399
|
* intermediate results.
|
|
2224
2400
|
*
|
|
2225
|
-
* @tsplus
|
|
2401
|
+
* @tsplus pipeable fncts.io.Stream scanReduce
|
|
2226
2402
|
*/
|
|
2227
2403
|
|
|
2228
2404
|
|
|
2229
|
-
function
|
|
2230
|
-
return
|
|
2405
|
+
function scanReduce(f, __tsplusTrace) {
|
|
2406
|
+
return fa => {
|
|
2407
|
+
return scanReduceIO_1((b, a) => tsplus_module_1.succeedNow(f(b, a), __tsplusTrace), __tsplusTrace)(fa);
|
|
2408
|
+
};
|
|
2231
2409
|
}
|
|
2232
2410
|
/**
|
|
2233
2411
|
* Statefully and effectfully maps over the elements of this stream to produce
|
|
2234
2412
|
* all intermediate results.
|
|
2235
2413
|
*
|
|
2236
|
-
* @tsplus
|
|
2414
|
+
* @tsplus pipeable fncts.io.Stream scanReduceIO
|
|
2237
2415
|
*/
|
|
2238
2416
|
|
|
2239
2417
|
|
|
2240
|
-
function scanReduceIO_1(
|
|
2241
|
-
return
|
|
2418
|
+
function scanReduceIO_1(f, __tsplusTrace) {
|
|
2419
|
+
return fa => {
|
|
2420
|
+
return mapAccumIO_1(tsplus_module_3.nothing(), (s, a) => tsplus_module_17.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);
|
|
2421
|
+
};
|
|
2242
2422
|
}
|
|
2243
2423
|
/**
|
|
2244
2424
|
* Creates a single-valued pure stream
|
|
@@ -2248,7 +2428,7 @@ function scanReduceIO_1(fa, f, __tsplusTrace) {
|
|
|
2248
2428
|
|
|
2249
2429
|
|
|
2250
2430
|
function succeedNow_1(o, __tsplusTrace) {
|
|
2251
|
-
return fromChunkNow_1(
|
|
2431
|
+
return fromChunkNow_1(tsplus_module_16.single(o), __tsplusTrace);
|
|
2252
2432
|
}
|
|
2253
2433
|
/**
|
|
2254
2434
|
* Creates a single-valued pure stream
|
|
@@ -2258,16 +2438,16 @@ function succeedNow_1(o, __tsplusTrace) {
|
|
|
2258
2438
|
|
|
2259
2439
|
|
|
2260
2440
|
function succeed(a, __tsplusTrace) {
|
|
2261
|
-
return fromChunk_1(() =>
|
|
2441
|
+
return fromChunk_1(() => tsplus_module_16.single(a()), __tsplusTrace);
|
|
2262
2442
|
}
|
|
2263
2443
|
|
|
2264
2444
|
function takeLoop(n, __tsplusTrace) {
|
|
2265
2445
|
return tsplus_module_10.readWithCause(inp => {
|
|
2266
|
-
const taken = tsplus_module_12.
|
|
2446
|
+
const taken = tsplus_module_12.take(n)(inp);
|
|
2267
2447
|
const left = Math.max(n - taken.length, 0);
|
|
2268
2448
|
|
|
2269
2449
|
if (left > 0) {
|
|
2270
|
-
return tsplus_module_11.
|
|
2450
|
+
return tsplus_module_11.apSecond(takeLoop(left, __tsplusTrace))(tsplus_module_10.writeNow(taken));
|
|
2271
2451
|
} else {
|
|
2272
2452
|
return tsplus_module_10.writeNow(taken);
|
|
2273
2453
|
}
|
|
@@ -2276,28 +2456,32 @@ function takeLoop(n, __tsplusTrace) {
|
|
|
2276
2456
|
/**
|
|
2277
2457
|
* Takes the specified number of elements from this stream.
|
|
2278
2458
|
*
|
|
2279
|
-
* @tsplus
|
|
2459
|
+
* @tsplus pipeable fncts.io.Stream take
|
|
2280
2460
|
*/
|
|
2281
2461
|
|
|
2282
2462
|
|
|
2283
|
-
function
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2463
|
+
function take(n, __tsplusTrace) {
|
|
2464
|
+
return stream => {
|
|
2465
|
+
if (n <= 0) {
|
|
2466
|
+
return empty_1;
|
|
2467
|
+
}
|
|
2287
2468
|
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2469
|
+
if (!Number.isInteger(n)) {
|
|
2470
|
+
return halt_1(() => new tsplus_module_57.IllegalArgumentError(`${n} should be an integer`, "Stream.take"), __tsplusTrace);
|
|
2471
|
+
}
|
|
2291
2472
|
|
|
2292
|
-
|
|
2473
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(takeLoop(n, __tsplusTrace))(stream.channel));
|
|
2474
|
+
};
|
|
2293
2475
|
}
|
|
2294
2476
|
/**
|
|
2295
|
-
* @tsplus
|
|
2477
|
+
* @tsplus pipeable fncts.io.Stream takeUntilIO
|
|
2296
2478
|
*/
|
|
2297
2479
|
|
|
2298
2480
|
|
|
2299
|
-
function
|
|
2300
|
-
return
|
|
2481
|
+
function takeUntilIO(f, __tsplusTrace) {
|
|
2482
|
+
return ma => {
|
|
2483
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(takeUntilIOLoop(tsplus_module_34.empty()[Symbol.iterator](), f, __tsplusTrace))(ma.channel));
|
|
2484
|
+
};
|
|
2301
2485
|
}
|
|
2302
2486
|
|
|
2303
2487
|
function takeUntilIOLoop(iterator, f, __tsplusTrace) {
|
|
@@ -2306,19 +2490,19 @@ function takeUntilIOLoop(iterator, f, __tsplusTrace) {
|
|
|
2306
2490
|
if (next.done) {
|
|
2307
2491
|
return tsplus_module_10.readWithCause(elem => takeUntilIOLoop(elem[Symbol.iterator](), f, __tsplusTrace), tsplus_module_11.failCauseNow, tsplus_module_11.succeedNow);
|
|
2308
2492
|
} else {
|
|
2309
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
2493
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(b => b ? tsplus_module_10.writeNow(tsplus_module_16.single(next.value)) : tsplus_module_11.apSecond(takeUntilIOLoop(iterator, f, __tsplusTrace))(tsplus_module_10.writeNow(tsplus_module_16.single(next.value))), __tsplusTrace)(f(next.value)));
|
|
2310
2494
|
}
|
|
2311
2495
|
}
|
|
2312
2496
|
|
|
2313
2497
|
function takeUntilLoop(p, __tsplusTrace) {
|
|
2314
2498
|
return tsplus_module_10.readWith(chunk => {
|
|
2315
|
-
const taken = tsplus_module_12.
|
|
2316
|
-
const last = tsplus_module_12.
|
|
2499
|
+
const taken = tsplus_module_12.takeWhile(tsplus_module_43.invert(p))(chunk);
|
|
2500
|
+
const last = tsplus_module_12.take(1)(tsplus_module_12.drop(taken.length)(chunk));
|
|
2317
2501
|
|
|
2318
2502
|
if (tsplus_module_12.isEmpty(last)) {
|
|
2319
|
-
return tsplus_module_11.
|
|
2503
|
+
return tsplus_module_11.apSecond(takeUntilLoop(p, __tsplusTrace))(tsplus_module_10.writeNow(taken));
|
|
2320
2504
|
} else {
|
|
2321
|
-
return tsplus_module_10.writeNow(tsplus_module_12.
|
|
2505
|
+
return tsplus_module_10.writeNow(tsplus_module_12.concat(last)(taken));
|
|
2322
2506
|
}
|
|
2323
2507
|
}, tsplus_module_10.failNow, tsplus_module_11.succeedNow);
|
|
2324
2508
|
}
|
|
@@ -2326,20 +2510,24 @@ function takeUntilLoop(p, __tsplusTrace) {
|
|
|
2326
2510
|
* Takes all elements of the stream until the specified predicate evaluates
|
|
2327
2511
|
* to `true`.
|
|
2328
2512
|
*
|
|
2329
|
-
* @tsplus
|
|
2513
|
+
* @tsplus pipeable fncts.io.Stream takeUntil
|
|
2330
2514
|
*/
|
|
2331
2515
|
|
|
2332
2516
|
|
|
2333
|
-
function
|
|
2334
|
-
return
|
|
2517
|
+
function takeUntil(p, __tsplusTrace) {
|
|
2518
|
+
return fa => {
|
|
2519
|
+
return new _definition2.Stream(tsplus_module_10.pipeTo(takeUntilLoop(p, __tsplusTrace))(fa.channel));
|
|
2520
|
+
};
|
|
2335
2521
|
}
|
|
2336
2522
|
/**
|
|
2337
|
-
* @tsplus
|
|
2523
|
+
* @tsplus pipeable fncts.io.Stream tap
|
|
2338
2524
|
*/
|
|
2339
2525
|
|
|
2340
2526
|
|
|
2341
|
-
function
|
|
2342
|
-
return
|
|
2527
|
+
function tap(f, __tsplusTrace) {
|
|
2528
|
+
return ma => {
|
|
2529
|
+
return mapIO_1(a => tsplus_module_1.as(() => a, __tsplusTrace)(f(a)), __tsplusTrace)(ma);
|
|
2530
|
+
};
|
|
2343
2531
|
}
|
|
2344
2532
|
/**
|
|
2345
2533
|
* Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket
|
|
@@ -2347,16 +2535,18 @@ function tap_(ma, f, __tsplusTrace) {
|
|
|
2347
2535
|
* tokens up to a `units + burst` threshold. Chunks that do not meet the bandwidth constraints are dropped.
|
|
2348
2536
|
* The weight of each chunk is determined by the `costFn` function.
|
|
2349
2537
|
*
|
|
2350
|
-
* @tsplus
|
|
2538
|
+
* @tsplus pipeable fncts.io.Stream throttleEnforce
|
|
2351
2539
|
*/
|
|
2352
2540
|
|
|
2353
2541
|
|
|
2354
|
-
function
|
|
2355
|
-
return
|
|
2542
|
+
function throttleEnforce(costFn, units, duration, burst = 0, __tsplusTrace) {
|
|
2543
|
+
return sa => {
|
|
2544
|
+
return throttleEnforceIO_1(chunk => tsplus_module_1.succeedNow(costFn(chunk), __tsplusTrace), units, duration, burst, __tsplusTrace)(sa);
|
|
2545
|
+
};
|
|
2356
2546
|
}
|
|
2357
2547
|
|
|
2358
2548
|
function throttleEnforceIOLoop(costFn, units, duration, burst, tokens, timestamp, __tsplusTrace) {
|
|
2359
|
-
return tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
2549
|
+
return tsplus_module_10.readWith(inp => tsplus_module_10.unwrap(() => tsplus_module_1.zipWith(tsplus_module_37.currentTime, (weight, current) => {
|
|
2360
2550
|
const elapsed = current - timestamp;
|
|
2361
2551
|
const cycles = elapsed / duration;
|
|
2362
2552
|
|
|
@@ -2366,8 +2556,8 @@ function throttleEnforceIOLoop(costFn, units, duration, burst, tokens, timestamp
|
|
|
2366
2556
|
return sum < 0 ? max : Math.min(sum, max);
|
|
2367
2557
|
})();
|
|
2368
2558
|
|
|
2369
|
-
return weight <= available ? tsplus_module_11.
|
|
2370
|
-
}, __tsplusTrace)), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
2559
|
+
return weight <= available ? tsplus_module_11.apSecond(throttleEnforceIOLoop(costFn, units, duration, burst, available - weight, current, __tsplusTrace))(tsplus_module_10.writeNow(inp)) : throttleEnforceIOLoop(costFn, units, duration, burst, available - weight, current, __tsplusTrace);
|
|
2560
|
+
}, __tsplusTrace)(costFn(inp))), tsplus_module_10.failNow, () => tsplus_module_10.unit);
|
|
2371
2561
|
}
|
|
2372
2562
|
/**
|
|
2373
2563
|
* Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket
|
|
@@ -2375,23 +2565,27 @@ function throttleEnforceIOLoop(costFn, units, duration, burst, tokens, timestamp
|
|
|
2375
2565
|
* tokens up to a `units + burst` threshold. Chunks that do not meet the bandwidth constraints are dropped.
|
|
2376
2566
|
* The weight of each chunk is determined by the `costFn` effectful function.
|
|
2377
2567
|
*
|
|
2378
|
-
* @tsplus
|
|
2568
|
+
* @tsplus pipeable fncts.io.Stream throttleEnforceIO
|
|
2379
2569
|
*/
|
|
2380
2570
|
|
|
2381
2571
|
|
|
2382
|
-
function throttleEnforceIO_1(
|
|
2383
|
-
return
|
|
2572
|
+
function throttleEnforceIO_1(costFn, units, duration, burst = 0, __tsplusTrace) {
|
|
2573
|
+
return sa => {
|
|
2574
|
+
return new _definition2.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_37.currentTime)));
|
|
2575
|
+
};
|
|
2384
2576
|
}
|
|
2385
2577
|
/**
|
|
2386
2578
|
* Converts the stream to a managed hub of chunks. After the managed hub is used,
|
|
2387
2579
|
* the hub will never again produce values and should be discarded.
|
|
2388
2580
|
*
|
|
2389
|
-
* @tsplus
|
|
2581
|
+
* @tsplus pipeable fncts.io.Stream toHub
|
|
2390
2582
|
*/
|
|
2391
2583
|
|
|
2392
2584
|
|
|
2393
|
-
function toHub_1(
|
|
2394
|
-
return
|
|
2585
|
+
function toHub_1(capacity, __tsplusTrace) {
|
|
2586
|
+
return stream => {
|
|
2587
|
+
return tsplus_module_1.flatMap(hub => tsplus_module_1.map(() => hub, __tsplusTrace)(tsplus_module_1.fork(runIntoHubScoped_1(hub, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_29.makeBounded(capacity, __tsplusTrace), _ => _.shutdown, __tsplusTrace));
|
|
2588
|
+
};
|
|
2395
2589
|
}
|
|
2396
2590
|
/**
|
|
2397
2591
|
* Interpret the stream as a managed pull
|
|
@@ -2401,42 +2595,50 @@ function toHub_1(stream, capacity, __tsplusTrace) {
|
|
|
2401
2595
|
|
|
2402
2596
|
|
|
2403
2597
|
function toPull_1(stream, __tsplusTrace) {
|
|
2404
|
-
return tsplus_module_1.
|
|
2598
|
+
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)(tsplus_module_58.toPull(stream.channel));
|
|
2405
2599
|
}
|
|
2406
2600
|
/**
|
|
2407
2601
|
* Converts the stream to a managed queue of chunks. After the managed queue is used,
|
|
2408
2602
|
* the queue will never again produce values and should be discarded.
|
|
2409
2603
|
*
|
|
2410
|
-
* @tsplus
|
|
2604
|
+
* @tsplus pipeable fncts.io.Stream toQueue
|
|
2411
2605
|
*/
|
|
2412
2606
|
|
|
2413
2607
|
|
|
2414
|
-
function toQueue_1(
|
|
2415
|
-
return
|
|
2608
|
+
function toQueue_1(capacity = 2, __tsplusTrace) {
|
|
2609
|
+
return stream => {
|
|
2610
|
+
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(tsplus_module_1.fork(runIntoQueueScoped_1(queue, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeBounded(capacity, __tsplusTrace), _ => _.shutdown, __tsplusTrace));
|
|
2611
|
+
};
|
|
2416
2612
|
}
|
|
2417
2613
|
/**
|
|
2418
|
-
* @tsplus
|
|
2614
|
+
* @tsplus pipeable fncts.io.Stream toQueueDropping
|
|
2419
2615
|
*/
|
|
2420
2616
|
|
|
2421
2617
|
|
|
2422
|
-
function
|
|
2423
|
-
return
|
|
2618
|
+
function toQueueDropping(capacity = 2, __tsplusTrace) {
|
|
2619
|
+
return stream => {
|
|
2620
|
+
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(tsplus_module_1.fork(runIntoQueueScoped_1(queue, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeDropping(capacity, __tsplusTrace), _ => _.shutdown, __tsplusTrace));
|
|
2621
|
+
};
|
|
2424
2622
|
}
|
|
2425
2623
|
/**
|
|
2426
|
-
* @tsplus
|
|
2624
|
+
* @tsplus pipeable fncts.io.Stream toQueueOfElements
|
|
2427
2625
|
*/
|
|
2428
2626
|
|
|
2429
2627
|
|
|
2430
|
-
function toQueueOfElements_1(
|
|
2431
|
-
return
|
|
2628
|
+
function toQueueOfElements_1(capacity = 2, __tsplusTrace) {
|
|
2629
|
+
return stream => {
|
|
2630
|
+
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(tsplus_module_1.fork(runIntoElementsScoped_1(queue, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeBounded(capacity, __tsplusTrace), _ => _.shutdown, __tsplusTrace));
|
|
2631
|
+
};
|
|
2432
2632
|
}
|
|
2433
2633
|
/**
|
|
2434
|
-
* @tsplus
|
|
2634
|
+
* @tsplus pipeable fncts.io.Stream toQueueSliding
|
|
2435
2635
|
*/
|
|
2436
2636
|
|
|
2437
2637
|
|
|
2438
|
-
function
|
|
2439
|
-
return
|
|
2638
|
+
function toQueueSliding(capacity = 2, __tsplusTrace) {
|
|
2639
|
+
return stream => {
|
|
2640
|
+
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(tsplus_module_1.fork(runIntoQueueScoped_1(queue, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeSliding(capacity, __tsplusTrace), _ => _.shutdown, __tsplusTrace));
|
|
2641
|
+
};
|
|
2440
2642
|
}
|
|
2441
2643
|
/**
|
|
2442
2644
|
* Converts the stream into an unbounded managed queue. After the managed queue
|
|
@@ -2447,11 +2649,11 @@ function toQueueSliding_(stream, capacity = 2, __tsplusTrace) {
|
|
|
2447
2649
|
|
|
2448
2650
|
|
|
2449
2651
|
function toQueueUnbounded_1(stream, __tsplusTrace) {
|
|
2450
|
-
return tsplus_module_1.
|
|
2652
|
+
return tsplus_module_1.flatMap(queue => tsplus_module_1.map(() => queue, __tsplusTrace)(tsplus_module_1.fork(runIntoQueueScoped_1(queue, __tsplusTrace)(stream), __tsplusTrace)), __tsplusTrace)(tsplus_module_26.acquireRelease(() => tsplus_module_25.makeUnbounded(__tsplusTrace), _ => _.shutdown, __tsplusTrace));
|
|
2451
2653
|
}
|
|
2452
2654
|
|
|
2453
2655
|
function unfoldChunkIOLoop(s, f, __tsplusTrace) {
|
|
2454
|
-
return tsplus_module_10.unwrap(() => tsplus_module_1.
|
|
2656
|
+
return tsplus_module_10.unwrap(() => tsplus_module_1.map(m => tsplus_module_17.match(() => tsplus_module_10.unit, ([as, s]) => tsplus_module_11.flatMap(() => unfoldChunkIOLoop(s, f, __tsplusTrace))(tsplus_module_10.writeNow(as)))(m), __tsplusTrace)(f(s)));
|
|
2455
2657
|
}
|
|
2456
2658
|
/**
|
|
2457
2659
|
* Creates a stream by effectfully peeling off the "layers" of a value of type `S`
|
|
@@ -2471,11 +2673,11 @@ function unfoldChunkIO_1(s, f, __tsplusTrace) {
|
|
|
2471
2673
|
|
|
2472
2674
|
|
|
2473
2675
|
function unfoldIO_1(s, f, __tsplusTrace) {
|
|
2474
|
-
return unfoldChunkIO_1(s, _ => tsplus_module_1.
|
|
2676
|
+
return unfoldChunkIO_1(s, _ => tsplus_module_1.map(m => tsplus_module_33.map(([a, s]) => (0, _function.tuple)(tsplus_module_16.single(a), s))(m), __tsplusTrace)(f(_)), __tsplusTrace);
|
|
2475
2677
|
}
|
|
2476
2678
|
|
|
2477
2679
|
function unfoldChunkLoop(s, f, __tsplusTrace) {
|
|
2478
|
-
return
|
|
2680
|
+
return tsplus_module_17.match(() => tsplus_module_10.unit, ([as, s]) => tsplus_module_11.flatMap(() => unfoldChunkLoop(s, f, __tsplusTrace))(tsplus_module_10.writeNow(as)))(f(s));
|
|
2479
2681
|
}
|
|
2480
2682
|
/**
|
|
2481
2683
|
* @tsplus static fncts.io.StreamOps unfoldChunk
|
|
@@ -2491,7 +2693,7 @@ function unfoldChunk_1(s, f, __tsplusTrace) {
|
|
|
2491
2693
|
|
|
2492
2694
|
|
|
2493
2695
|
function unfold(s, f, __tsplusTrace) {
|
|
2494
|
-
return unfoldChunk_1(s, s =>
|
|
2696
|
+
return unfoldChunk_1(s, s => tsplus_module_33.map(([a, s]) => (0, _function.tuple)(tsplus_module_16.single(a), s))(f(s)), __tsplusTrace);
|
|
2495
2697
|
}
|
|
2496
2698
|
/**
|
|
2497
2699
|
* Creates a stream produced from an IO
|
|
@@ -2511,7 +2713,7 @@ function unwrap_1(stream, __tsplusTrace) {
|
|
|
2511
2713
|
|
|
2512
2714
|
|
|
2513
2715
|
function unwrapScoped_1(stream, __tsplusTrace) {
|
|
2514
|
-
return flatten_1(scoped_1(stream, __tsplusTrace), __tsplusTrace);
|
|
2716
|
+
return flatten_1(scoped_1(() => stream, __tsplusTrace), __tsplusTrace);
|
|
2515
2717
|
}
|
|
2516
2718
|
/**
|
|
2517
2719
|
* @tsplus getter fncts.io.Stream zipWithIndex
|
|
@@ -2519,7 +2721,7 @@ function unwrapScoped_1(stream, __tsplusTrace) {
|
|
|
2519
2721
|
|
|
2520
2722
|
|
|
2521
2723
|
function zipWithIndex_(self, __tsplusTrace) {
|
|
2522
|
-
return mapAccum_1(
|
|
2724
|
+
return mapAccum_1(0, (index, a) => [index + 1, [a, index]], __tsplusTrace)(self);
|
|
2523
2725
|
}
|
|
2524
2726
|
/**
|
|
2525
2727
|
* Zips the two streams so that when a value is emitted by either of the two
|
|
@@ -2530,15 +2732,17 @@ function zipWithIndex_(self, __tsplusTrace) {
|
|
|
2530
2732
|
* that emitted elements that are not the last value in chunks will never be
|
|
2531
2733
|
* used for zipping.
|
|
2532
2734
|
*
|
|
2533
|
-
* @tsplus
|
|
2735
|
+
* @tsplus pipeable fncts.io.Stream zipWithLatest
|
|
2534
2736
|
*/
|
|
2535
2737
|
|
|
2536
2738
|
|
|
2537
|
-
function
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2739
|
+
function zipWithLatest(fb, f, __tsplusTrace) {
|
|
2740
|
+
return fa => {
|
|
2741
|
+
function pullNonEmpty(pull, __tsplusTrace) {
|
|
2742
|
+
return tsplus_module_1.flatMap(chunk => tsplus_module_12.isNonEmpty(chunk) ? pullNonEmpty(pull, __tsplusTrace) : tsplus_module_1.succeedNow(chunk, __tsplusTrace), __tsplusTrace)(pull);
|
|
2743
|
+
}
|
|
2541
2744
|
|
|
2542
|
-
|
|
2745
|
+
return fromPull_1(tsplus_module_1.flatMap(left => tsplus_module_1.flatMap(right => toPull_1(flatMap_1(([l, r, leftFirst]) => flatMap_1(latest => concat_1(flatMap_1(fromChunkNow_1, __tsplusTrace)(mapIO_1(ab => tsplus_module_4.match(leftChunk => latest.modify(([_, rightLatest]) => (0, _function.tuple)(tsplus_module_12.map(a => f(a, rightLatest))(leftChunk), (0, _function.tuple)(tsplus_module_12.unsafeGet(leftChunk.length - 1)(leftChunk), rightLatest)), __tsplusTrace), rightChunk => latest.modify(([leftLatest, _]) => (0, _function.tuple)(tsplus_module_12.map(b => f(leftLatest, b))(rightChunk), (0, _function.tuple)(leftLatest, tsplus_module_12.unsafeGet(rightChunk.length - 1)(rightChunk))), __tsplusTrace))(ab), __tsplusTrace)(mergeEither_1(repeatIOMaybe_1(right, __tsplusTrace), __tsplusTrace)(repeatIOMaybe_1(left, __tsplusTrace)))), __tsplusTrace)(fromChunk_1(() => leftFirst ? tsplus_module_12.map(b => f(tsplus_module_12.unsafeGet(l.length - 1)(l), b))(r) : tsplus_module_12.map(a => f(a, tsplus_module_12.unsafeGet(r.length - 1)(r)))(l), __tsplusTrace)), __tsplusTrace)(fromIO_1(tsplus_module_6.make(() => (0, _function.tuple)(tsplus_module_12.unsafeGet(l.length - 1)(l), tsplus_module_12.unsafeGet(r.length - 1)(r)), __tsplusTrace), __tsplusTrace)), __tsplusTrace)(fromIOMaybe_1(tsplus_module_21.raceWith(() => right, (leftDone, rightFiber) => tsplus_module_1.zipWith(tsplus_module_19.join(rightFiber, __tsplusTrace), (l, r) => (0, _function.tuple)(l, r, true), __tsplusTrace)(tsplus_module_1.fromExitNow(leftDone, __tsplusTrace)), (rightDone, leftFiber) => tsplus_module_1.zipWith(tsplus_module_19.join(leftFiber, __tsplusTrace), (r, l) => (0, _function.tuple)(l, r, false), __tsplusTrace)(tsplus_module_1.fromExitNow(rightDone, __tsplusTrace)), __tsplusTrace)(left), __tsplusTrace)), __tsplusTrace), __tsplusTrace)(tsplus_module_1.map(pullNonEmpty, __tsplusTrace)(toPull_1(fb, __tsplusTrace))), __tsplusTrace)(tsplus_module_1.map(pullNonEmpty, __tsplusTrace)(toPull_1(fa, __tsplusTrace))), __tsplusTrace);
|
|
2746
|
+
};
|
|
2543
2747
|
}
|
|
2544
2748
|
//# sourceMappingURL=api.cjs.map
|