@fncts/io 0.0.11 → 0.0.14
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 +3 -4
- package/Channel/UpstreamPullStrategy/definition.d.ts +1 -1
- package/Channel/api/interruptWhen.d.ts +1 -1
- package/Channel/api/mapOutIOC.d.ts +2 -2
- package/Channel/api/mergeAll.d.ts +1 -1
- package/Channel/api/mergeAllUnboundedWith.d.ts +1 -1
- package/Channel/api/mergeAllWith.d.ts +3 -3
- package/Channel/api/mergeMap.d.ts +1 -1
- package/Channel/api/mergeWith.d.ts +3 -3
- package/Channel/api/runScoped.d.ts +1 -2
- package/Channel/api/toPull.d.ts +2 -3
- package/Channel/api/zipC.d.ts +3 -3
- package/Channel/api.d.ts +56 -57
- package/Channel/core-api.d.ts +12 -12
- package/Channel/definition.d.ts +36 -22
- package/Channel/internal/AsyncInputConsumer.d.ts +1 -1
- package/Channel/internal/AsyncInputProducer.d.ts +1 -1
- package/Channel/internal/ChannelExecutor.d.ts +5 -5
- package/Channel/internal/ChannelState.d.ts +1 -1
- package/Channel/internal/MergeDecision.d.ts +2 -2
- package/Channel/internal/MergeState.d.ts +2 -2
- package/Channel/internal/SingleProducerAsyncInput.d.ts +5 -5
- package/Clock/api.d.ts +3 -3
- package/Clock/definition.d.ts +2 -2
- package/Clock/live.d.ts +3 -3
- package/Console/api.d.ts +1 -1
- package/Fiber/FiberContext.d.ts +12 -12
- package/Fiber/api/await.d.ts +2 -2
- package/Fiber/api/awaitAll.d.ts +2 -2
- package/Fiber/api/children.d.ts +1 -1
- package/Fiber/api/collectAll.d.ts +3 -3
- package/Fiber/api/evalOn.d.ts +1 -1
- package/Fiber/api/evalOnIO.d.ts +1 -1
- package/Fiber/api/fromIO.d.ts +1 -1
- package/Fiber/api/id.d.ts +2 -2
- package/Fiber/api/inheritRefs.d.ts +1 -1
- package/Fiber/api/interrupt.d.ts +2 -2
- package/Fiber/api/interruptAll.d.ts +3 -3
- package/Fiber/api/interruptAs.d.ts +3 -3
- package/Fiber/api/join.d.ts +1 -1
- package/Fiber/api/joinAll.d.ts +1 -1
- package/Fiber/api/mapFiber.d.ts +1 -1
- package/Fiber/api/mapIO.d.ts +2 -2
- package/Fiber/api/poll.d.ts +3 -3
- package/Fiber/api/zipWith.d.ts +1 -1
- package/Fiber/constructors.d.ts +8 -8
- package/Fiber/definition.d.ts +4 -4
- package/FiberRef/api/locallyScoped.d.ts +1 -2
- package/FiberRef/api/locallyScopedWith.d.ts +1 -2
- package/FiberRef/api.d.ts +8 -8
- package/FiberRef/constructors.d.ts +2 -3
- package/FiberRef/unsafe.d.ts +11 -5
- package/FiberRefs/api.d.ts +4 -4
- package/FiberRefs/definition.d.ts +3 -3
- package/FiberRefs/join.d.ts +2 -2
- package/FiberScope/constructors.d.ts +1 -1
- package/FiberScope/definition.d.ts +1 -1
- package/FiberState/api.d.ts +1 -1
- package/FiberState/constructors.d.ts +3 -3
- package/FiberState/definition.d.ts +3 -3
- package/FiberStatus/constructors.d.ts +1 -1
- package/FiberStatus/definition.d.ts +1 -1
- package/Future/api.d.ts +18 -18
- package/Future/constructors.d.ts +3 -3
- package/Future/definition.d.ts +2 -2
- package/Hub/api.d.ts +22 -23
- package/Hub/definition.d.ts +6 -7
- package/Hub/internal.d.ts +1 -2
- package/IO/api/acquireRelease.d.ts +2 -3
- package/IO/api/acquireReleaseExit.d.ts +3 -4
- package/IO/api/acquireReleaseInterruptible.d.ts +2 -3
- package/IO/api/acquireReleaseInterruptibleExit.d.ts +3 -4
- package/IO/api/addFinalizer.d.ts +2 -3
- package/IO/api/addFinalizerExit.d.ts +2 -3
- package/IO/api/asyncIO.d.ts +1 -1
- package/IO/api/bracket.d.ts +2 -2
- package/IO/api/bracketExit.d.ts +3 -3
- package/IO/api/clockWith.d.ts +1 -1
- package/IO/api/concurrency.d.ts +4 -4
- package/IO/api/concurrentFinalizers.d.ts +1 -2
- package/IO/api/consoleWith.d.ts +2 -2
- package/IO/api/core-scope.d.ts +4 -4
- package/IO/api/ensuringChildren.d.ts +1 -1
- package/IO/api/environment.d.ts +10 -12
- package/IO/api/foreachC.d.ts +2 -2
- package/IO/api/foreachExec.d.ts +1 -1
- package/IO/api/forkScoped.d.ts +1 -2
- package/IO/api/fulfill.d.ts +1 -1
- package/IO/api/interrupt.d.ts +8 -8
- package/IO/api/onExit.d.ts +2 -2
- package/IO/api/onTermination.d.ts +4 -4
- package/IO/api/provideLayer.d.ts +1 -1
- package/IO/api/provideSomeLayer.d.ts +1 -1
- package/IO/api/race.d.ts +1 -1
- package/IO/api/raceFirst.d.ts +1 -1
- package/IO/api/randomWith.d.ts +2 -2
- package/IO/api/repeat.d.ts +6 -6
- package/IO/api/retry.d.ts +5 -5
- package/IO/api/schedule.d.ts +3 -3
- package/IO/api/scope.d.ts +1 -2
- package/IO/api/scopeWith.d.ts +1 -2
- package/IO/api/scoped.d.ts +3 -4
- package/IO/api/sequenceT.d.ts +4 -4
- package/IO/api/sleep.d.ts +2 -2
- package/IO/api/stateful.d.ts +3 -4
- package/IO/api/timeout.d.ts +4 -4
- package/IO/api/withEarlyRelease.d.ts +1 -2
- package/IO/api/withFinalizer.d.ts +1 -2
- package/IO/api/withFinalizerExit.d.ts +2 -3
- package/IO/api/withRuntimeConfig.d.ts +2 -2
- package/IO/api/zipC.d.ts +4 -4
- package/IO/api.d.ts +94 -94
- package/IO/definition.d.ts +44 -34
- package/IO/runtime.d.ts +29 -16
- package/IOEnv/definition.d.ts +2 -3
- package/IOEnv/live.d.ts +1 -1
- package/IOEnv/services.d.ts +1 -1
- package/IOSpec.d.ts +7 -8
- package/Layer/MemoMap.d.ts +8 -9
- package/Layer/api.d.ts +41 -43
- package/Layer/definition.d.ts +22 -16
- package/Logger/api.d.ts +2 -2
- package/Logger/definition.d.ts +4 -4
- package/Queue/api/dimapIO.d.ts +6 -6
- package/Queue/api/filterInputIO.d.ts +6 -6
- package/Queue/api/filterOutputIO.d.ts +8 -8
- package/Queue/api/operations.d.ts +10 -10
- package/Queue/api/poll.d.ts +2 -2
- package/Queue/api/takeBetween.d.ts +1 -1
- package/Queue/api/zipWithIO.d.ts +9 -9
- package/Queue/constructors.d.ts +4 -4
- package/Queue/definition.d.ts +10 -10
- package/Queue/internal.d.ts +1 -1
- package/Queue/strategy.d.ts +10 -10
- package/Random/api.d.ts +8 -8
- package/Random/definition.d.ts +5 -5
- package/Random/live.d.ts +5 -5
- package/Ref/Atomic/Atomic.d.ts +4 -4
- package/Ref/Atomic/api.d.ts +11 -11
- package/Ref/Derived.d.ts +4 -4
- package/Ref/DerivedAll.d.ts +4 -4
- package/Ref/Synchronized/api.d.ts +16 -16
- package/Ref/Synchronized/constructors.d.ts +2 -2
- package/Ref/Synchronized/definition.d.ts +3 -3
- package/Ref/api/collect.d.ts +2 -2
- package/Ref/api/dimap.d.ts +8 -8
- package/Ref/api/filter.d.ts +3 -3
- package/Ref/api/get.d.ts +1 -1
- package/Ref/api/match.d.ts +1 -1
- package/Ref/api/matchAll.d.ts +1 -1
- package/Ref/api/modify.d.ts +10 -10
- package/Ref/api/set.d.ts +1 -1
- package/Ref/constructors.d.ts +3 -3
- package/Ref/definition.d.ts +15 -15
- package/RuntimeConfig.d.ts +2 -2
- package/STM/api/core-api.d.ts +5 -5
- package/STM/api/core-constructors.d.ts +9 -9
- package/STM/api.d.ts +60 -72
- package/STM/definition.d.ts +10 -9
- package/STM/driver.d.ts +2 -2
- package/STM/internal/CommitState.d.ts +1 -1
- package/STM/internal/Journal.d.ts +7 -6
- package/STM/internal/TryCommit.d.ts +1 -1
- package/Schedule/Decision.d.ts +10 -4
- package/Schedule/Driver.d.ts +4 -4
- package/Schedule/api/driver.d.ts +1 -1
- package/Schedule/api.d.ts +85 -73
- package/Schedule/definition.d.ts +1 -1
- package/Scope/Finalizer/definition.d.ts +3 -3
- package/Scope/ReleaseMap/api/releaseAll.d.ts +2 -2
- package/Scope/ReleaseMap/api.d.ts +7 -7
- package/Scope/ReleaseMap/definition.d.ts +3 -3
- package/Scope/api.d.ts +9 -10
- package/Scope/definition.d.ts +2 -2
- package/ScopedRef/api.d.ts +2 -3
- package/ScopedRef/definition.d.ts +1 -2
- package/Sink/api.d.ts +73 -74
- package/State/api.d.ts +2 -3
- package/Stream/api/zipAllWith.d.ts +3 -3
- package/Stream/api/zipWith.d.ts +1 -1
- package/Stream/api/zipWithChunks.d.ts +4 -4
- package/Stream/api.d.ts +171 -166
- package/Stream/definition.d.ts +3 -3
- package/Stream/internal/Handoff.d.ts +2 -2
- package/Stream/internal/Pull.d.ts +2 -2
- package/Stream/internal/Take.d.ts +4 -4
- package/Stream/internal/util.d.ts +1 -1
- package/Supervisor/api.d.ts +3 -3
- package/Supervisor/constructors.d.ts +6 -6
- package/Supervisor/definition.d.ts +3 -3
- package/TExit/constructors.d.ts +1 -1
- package/TExit/definition.d.ts +1 -1
- package/TFuture/api.d.ts +7 -7
- package/TFuture/constructors.d.ts +4 -4
- package/TFuture/definition.d.ts +3 -3
- package/TReentrantLock/api.d.ts +18 -19
- package/TReentrantLock/definition.d.ts +2 -2
- package/TRef/api.d.ts +15 -15
- package/TRef/constructors.d.ts +5 -5
- package/TRef/definition.d.ts +2 -2
- package/TSemaphore/api.d.ts +7 -7
- package/TSemaphore/constructors.d.ts +1 -1
- package/TSemaphore/definition.d.ts +1 -1
- package/_cjs/Cached/api.cjs +5 -5
- package/_cjs/Cached/api.cjs.map +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
- package/_cjs/Channel/api/mapOutIOC.cjs +2 -2
- package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +11 -11
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +5 -5
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api/run.cjs +3 -1
- package/_cjs/Channel/api/run.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +7 -7
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/core-api.cjs.map +1 -1
- package/_cjs/Channel/definition.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelExecutor.cjs +6 -6
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelState.cjs +2 -1
- package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +16 -16
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/Clock/live.cjs.map +1 -1
- package/_cjs/Console/api.cjs +5 -3
- package/_cjs/Console/api.cjs.map +1 -1
- package/_cjs/Fiber/FiberContext.cjs +8 -10
- package/_cjs/Fiber/FiberContext.cjs.map +1 -1
- package/_cjs/Fiber/api/await.cjs +1 -1
- package/_cjs/Fiber/api/await.cjs.map +1 -1
- package/_cjs/Fiber/api/awaitAll.cjs +2 -4
- package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
- package/_cjs/Fiber/api/children.cjs +1 -1
- package/_cjs/Fiber/api/children.cjs.map +1 -1
- package/_cjs/Fiber/api/collectAll.cjs +2 -4
- package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
- package/_cjs/Fiber/api/evalOn.cjs +1 -1
- package/_cjs/Fiber/api/evalOn.cjs.map +1 -1
- package/_cjs/Fiber/api/evalOnIO.cjs +2 -4
- package/_cjs/Fiber/api/evalOnIO.cjs.map +1 -1
- package/_cjs/Fiber/api/fromIO.cjs +2 -4
- package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
- package/_cjs/Fiber/api/id.cjs +1 -1
- package/_cjs/Fiber/api/id.cjs.map +1 -1
- package/_cjs/Fiber/api/inheritRefs.cjs +1 -1
- package/_cjs/Fiber/api/inheritRefs.cjs.map +1 -1
- package/_cjs/Fiber/api/interrupt.cjs +2 -4
- package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAll.cjs +4 -5
- package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAs.cjs +1 -1
- package/_cjs/Fiber/api/interruptAs.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 +2 -4
- package/_cjs/Fiber/api/join.cjs.map +1 -1
- package/_cjs/Fiber/api/joinAll.cjs +2 -4
- package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
- package/_cjs/Fiber/api/mapFiber.cjs +2 -4
- package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
- package/_cjs/Fiber/api/mapIO.cjs +4 -5
- package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
- package/_cjs/Fiber/api/poll.cjs +1 -1
- package/_cjs/Fiber/api/poll.cjs.map +1 -1
- package/_cjs/Fiber/api/zipWith.cjs +2 -4
- package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
- package/_cjs/Fiber/constructors.cjs +10 -11
- package/_cjs/Fiber/constructors.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScoped.cjs +2 -4
- package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScopedWith.cjs +2 -4
- package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
- package/_cjs/FiberRef/api.cjs +13 -14
- package/_cjs/FiberRef/api.cjs.map +1 -1
- package/_cjs/FiberRef/constructors.cjs +4 -6
- package/_cjs/FiberRef/constructors.cjs.map +1 -1
- package/_cjs/FiberRef/unsafe.cjs +9 -1
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/Future/api.cjs +30 -31
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Future/constructors.cjs +4 -5
- package/_cjs/Future/constructors.cjs.map +1 -1
- package/_cjs/Hub/api.cjs +44 -44
- package/_cjs/Hub/api.cjs.map +1 -1
- package/_cjs/Hub/internal.cjs +16 -24
- package/_cjs/Hub/internal.cjs.map +1 -1
- package/_cjs/IO/api/acquireRelease.cjs +2 -4
- package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
- 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/addFinalizer.cjs +1 -1
- package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/addFinalizerExit.cjs +5 -11
- package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/asyncIO.cjs +5 -7
- package/_cjs/IO/api/asyncIO.cjs.map +1 -1
- package/_cjs/IO/api/bracket.cjs +2 -2
- package/_cjs/IO/api/bracket.cjs.map +1 -1
- package/_cjs/IO/api/bracketExit.cjs +2 -4
- package/_cjs/IO/api/bracketExit.cjs.map +1 -1
- package/_cjs/IO/api/concurrency.cjs +7 -7
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/concurrentFinalizers.cjs +2 -4
- package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
- package/_cjs/IO/api/consoleWith.cjs +3 -3
- package/_cjs/IO/api/consoleWith.cjs.map +1 -1
- package/_cjs/IO/api/core-scope.cjs +4 -4
- package/_cjs/IO/api/core-scope.cjs.map +1 -1
- package/_cjs/IO/api/ensuringChildren.cjs +2 -4
- package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
- package/_cjs/IO/api/environment.cjs +6 -8
- package/_cjs/IO/api/environment.cjs.map +1 -1
- package/_cjs/IO/api/foreachC.cjs +25 -27
- package/_cjs/IO/api/foreachC.cjs.map +1 -1
- package/_cjs/IO/api/foreachExec.cjs +2 -4
- package/_cjs/IO/api/foreachExec.cjs.map +1 -1
- package/_cjs/IO/api/forkIn.cjs +1 -1
- 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 +2 -4
- package/_cjs/IO/api/fulfill.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +13 -13
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/memoize.cjs +4 -8
- package/_cjs/IO/api/memoize.cjs.map +1 -1
- package/_cjs/IO/api/onExit.cjs +2 -2
- package/_cjs/IO/api/onExit.cjs.map +1 -1
- package/_cjs/IO/api/onTermination.cjs +2 -2
- package/_cjs/IO/api/onTermination.cjs.map +1 -1
- package/_cjs/IO/api/once.cjs +1 -1
- package/_cjs/IO/api/once.cjs.map +1 -1
- package/_cjs/IO/api/provideLayer.cjs +2 -4
- package/_cjs/IO/api/provideLayer.cjs.map +1 -1
- package/_cjs/IO/api/provideSomeLayer.cjs +2 -3
- package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
- package/_cjs/IO/api/race.cjs +4 -6
- package/_cjs/IO/api/race.cjs.map +1 -1
- package/_cjs/IO/api/raceFirst.cjs +2 -4
- package/_cjs/IO/api/raceFirst.cjs.map +1 -1
- package/_cjs/IO/api/randomWith.cjs +3 -3
- package/_cjs/IO/api/randomWith.cjs.map +1 -1
- package/_cjs/IO/api/repeat.cjs +10 -11
- package/_cjs/IO/api/repeat.cjs.map +1 -1
- package/_cjs/IO/api/retry.cjs +8 -9
- package/_cjs/IO/api/retry.cjs.map +1 -1
- package/_cjs/IO/api/schedule.cjs +6 -7
- package/_cjs/IO/api/schedule.cjs.map +1 -1
- package/_cjs/IO/api/scope.cjs +1 -1
- package/_cjs/IO/api/scope.cjs.map +1 -1
- package/_cjs/IO/api/scopeWith.cjs +2 -4
- package/_cjs/IO/api/scopeWith.cjs.map +1 -1
- package/_cjs/IO/api/scoped.cjs +4 -5
- package/_cjs/IO/api/scoped.cjs.map +1 -1
- package/_cjs/IO/api/stateful.cjs +1 -1
- package/_cjs/IO/api/stateful.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +3 -4
- 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 +2 -4
- package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizer.cjs +2 -2
- package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizerExit.cjs +2 -4
- package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/withRuntimeConfig.cjs +2 -4
- package/_cjs/IO/api/withRuntimeConfig.cjs.map +1 -1
- package/_cjs/IO/api/zipC.cjs +5 -6
- package/_cjs/IO/api/zipC.cjs.map +1 -1
- package/_cjs/IO/api.cjs +112 -112
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +5 -8
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +69 -21
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IOEnv/live.cjs +3 -1
- package/_cjs/IOEnv/live.cjs.map +1 -1
- package/_cjs/Layer/MemoMap.cjs +45 -62
- package/_cjs/Layer/MemoMap.cjs.map +1 -1
- package/_cjs/Layer/api.cjs +84 -83
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Layer/definition.cjs +14 -7
- package/_cjs/Layer/definition.cjs.map +1 -1
- package/_cjs/Queue/api/dimapIO.cjs +14 -14
- package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
- package/_cjs/Queue/api/filterInputIO.cjs +6 -6
- package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
- package/_cjs/Queue/api/filterOutputIO.cjs +6 -6
- package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
- package/_cjs/Queue/api/operations.cjs +13 -13
- package/_cjs/Queue/api/operations.cjs.map +1 -1
- package/_cjs/Queue/api/poll.cjs +2 -4
- package/_cjs/Queue/api/poll.cjs.map +1 -1
- package/_cjs/Queue/api/takeBetween.cjs +10 -12
- package/_cjs/Queue/api/takeBetween.cjs.map +1 -1
- package/_cjs/Queue/api/zipWithIO.cjs +12 -12
- package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
- package/_cjs/Queue/constructors.cjs +8 -10
- package/_cjs/Queue/constructors.cjs.map +1 -1
- package/_cjs/Queue/internal.cjs +17 -17
- package/_cjs/Queue/internal.cjs.map +1 -1
- package/_cjs/Queue/strategy.cjs +16 -20
- package/_cjs/Queue/strategy.cjs.map +1 -1
- package/_cjs/Random/api.cjs +15 -13
- package/_cjs/Random/api.cjs.map +1 -1
- package/_cjs/Random/live.cjs +4 -4
- package/_cjs/Random/live.cjs.map +1 -1
- package/_cjs/Ref/Atomic/Atomic.cjs.map +1 -1
- package/_cjs/Ref/Atomic/api.cjs +19 -21
- package/_cjs/Ref/Atomic/api.cjs.map +1 -1
- package/_cjs/Ref/Derived.cjs.map +1 -1
- package/_cjs/Ref/DerivedAll.cjs +1 -1
- package/_cjs/Ref/DerivedAll.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/api.cjs +25 -26
- package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/constructors.cjs +8 -14
- package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/definition.cjs +1 -1
- package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
- package/_cjs/Ref/api/collect.cjs +1 -1
- package/_cjs/Ref/api/collect.cjs.map +1 -1
- package/_cjs/Ref/api/dimap.cjs +12 -12
- package/_cjs/Ref/api/dimap.cjs.map +1 -1
- package/_cjs/Ref/api/filter.cjs +2 -2
- package/_cjs/Ref/api/filter.cjs.map +1 -1
- package/_cjs/Ref/api/get.cjs +1 -1
- package/_cjs/Ref/api/get.cjs.map +1 -1
- package/_cjs/Ref/api/modify.cjs +29 -30
- package/_cjs/Ref/api/modify.cjs.map +1 -1
- package/_cjs/Ref/api/set.cjs +1 -1
- package/_cjs/Ref/api/set.cjs.map +1 -1
- package/_cjs/Ref/constructors.cjs +3 -4
- package/_cjs/Ref/constructors.cjs.map +1 -1
- package/_cjs/STM/api/core-api.cjs +8 -8
- package/_cjs/STM/api/core-api.cjs.map +1 -1
- package/_cjs/STM/api/core-constructors.cjs +6 -6
- package/_cjs/STM/api/core-constructors.cjs.map +1 -1
- package/_cjs/STM/api.cjs +129 -148
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/STM/definition.cjs.map +1 -1
- package/_cjs/STM/driver.cjs +10 -6
- package/_cjs/STM/driver.cjs.map +1 -1
- package/_cjs/STM/internal/Journal.cjs +20 -22
- package/_cjs/STM/internal/Journal.cjs.map +1 -1
- package/_cjs/Schedule/Decision.cjs +17 -0
- package/_cjs/Schedule/Decision.cjs.map +1 -1
- package/_cjs/Schedule/api/driver.cjs +18 -21
- package/_cjs/Schedule/api/driver.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +205 -180
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Scope/Finalizer/definition.cjs +4 -6
- package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +3 -5
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api.cjs +14 -15
- package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -1
- package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/definition.cjs +2 -4
- package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
- package/_cjs/Scope/api.cjs +20 -30
- package/_cjs/Scope/api.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +14 -22
- package/_cjs/ScopedRef/api.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +92 -88
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/State/api.cjs +5 -7
- package/_cjs/State/api.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +22 -24
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWith.cjs +2 -2
- package/_cjs/Stream/api/zipWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +20 -22
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
- package/_cjs/Stream/api.cjs +436 -419
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs +12 -12
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
- package/_cjs/Stream/internal/Pull.cjs +1 -1
- package/_cjs/Stream/internal/Pull.cjs.map +1 -1
- package/_cjs/Stream/internal/Take.cjs +1 -1
- package/_cjs/Stream/internal/Take.cjs.map +1 -1
- package/_cjs/Supervisor/api.cjs +3 -1
- package/_cjs/Supervisor/api.cjs.map +1 -1
- package/_cjs/Supervisor/constructors.cjs +14 -8
- package/_cjs/Supervisor/constructors.cjs.map +1 -1
- package/_cjs/TFuture/api.cjs +10 -10
- package/_cjs/TFuture/api.cjs.map +1 -1
- package/_cjs/TFuture/constructors.cjs +4 -4
- package/_cjs/TFuture/constructors.cjs.map +1 -1
- package/_cjs/TFuture/definition.cjs +2 -4
- package/_cjs/TFuture/definition.cjs.map +1 -1
- package/_cjs/TReentrantLock/api.cjs +41 -42
- package/_cjs/TReentrantLock/api.cjs.map +1 -1
- package/_cjs/TRef/api.cjs +40 -40
- package/_cjs/TRef/api.cjs.map +1 -1
- package/_cjs/TRef/constructors.cjs +6 -6
- package/_cjs/TRef/constructors.cjs.map +1 -1
- package/_cjs/TSemaphore/api.cjs +20 -21
- package/_cjs/TSemaphore/api.cjs.map +1 -1
- package/_cjs/TSemaphore/constructors.cjs +2 -2
- package/_cjs/TSemaphore/constructors.cjs.map +1 -1
- package/_cjs/TSemaphore/definition.cjs +2 -4
- package/_cjs/TSemaphore/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +1 -1
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/filterIO.cjs +5 -7
- package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/findIO.cjs +7 -9
- package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/mapIO.cjs +3 -5
- package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +7 -9
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc.cjs +26 -0
- package/_cjs/collection/immutable/Conc.cjs.map +1 -1
- package/_cjs/data/Exit/foreachIO.cjs +2 -4
- package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
- package/_cjs/global.cjs +6 -0
- package/_cjs/global.cjs.map +1 -0
- package/_cjs/index.cjs +6 -0
- package/_cjs/index.cjs.map +1 -0
- package/_cjs/internal/Scheduler.cjs +64 -14
- package/_cjs/internal/Scheduler.cjs.map +1 -1
- package/_mjs/Cached/api.mjs +5 -5
- package/_mjs/Cached/api.mjs.map +1 -1
- package/_mjs/Channel/api/interruptWhen.mjs +1 -1
- package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
- package/_mjs/Channel/api/mapOutIOC.mjs +2 -2
- package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +11 -11
- package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
- package/_mjs/Channel/api/mergeWith.mjs +6 -5
- package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
- package/_mjs/Channel/api/run.mjs +2 -1
- package/_mjs/Channel/api/run.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +7 -7
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/core-api.mjs.map +1 -1
- package/_mjs/Channel/definition.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +6 -6
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelState.mjs +2 -1
- package/_mjs/Channel/internal/ChannelState.mjs.map +1 -1
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +16 -16
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
- package/_mjs/Clock/live.mjs.map +1 -1
- package/_mjs/Console/api.mjs +4 -3
- package/_mjs/Console/api.mjs.map +1 -1
- package/_mjs/Fiber/FiberContext.mjs +9 -9
- package/_mjs/Fiber/FiberContext.mjs.map +1 -1
- package/_mjs/Fiber/api/await.mjs +1 -1
- package/_mjs/Fiber/api/await.mjs.map +1 -1
- package/_mjs/Fiber/api/awaitAll.mjs +2 -3
- package/_mjs/Fiber/api/awaitAll.mjs.map +1 -1
- package/_mjs/Fiber/api/children.mjs +1 -1
- package/_mjs/Fiber/api/children.mjs.map +1 -1
- package/_mjs/Fiber/api/collectAll.mjs +2 -3
- package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
- package/_mjs/Fiber/api/evalOn.mjs +1 -1
- package/_mjs/Fiber/api/evalOn.mjs.map +1 -1
- package/_mjs/Fiber/api/evalOnIO.mjs +2 -3
- package/_mjs/Fiber/api/evalOnIO.mjs.map +1 -1
- package/_mjs/Fiber/api/fromIO.mjs +2 -3
- package/_mjs/Fiber/api/fromIO.mjs.map +1 -1
- package/_mjs/Fiber/api/id.mjs +1 -1
- package/_mjs/Fiber/api/id.mjs.map +1 -1
- package/_mjs/Fiber/api/inheritRefs.mjs +1 -1
- package/_mjs/Fiber/api/inheritRefs.mjs.map +1 -1
- package/_mjs/Fiber/api/interrupt.mjs +2 -3
- package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs +4 -5
- package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAs.mjs +1 -1
- package/_mjs/Fiber/api/interruptAs.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 +2 -3
- package/_mjs/Fiber/api/join.mjs.map +1 -1
- package/_mjs/Fiber/api/joinAll.mjs +2 -3
- package/_mjs/Fiber/api/joinAll.mjs.map +1 -1
- package/_mjs/Fiber/api/mapFiber.mjs +2 -3
- package/_mjs/Fiber/api/mapFiber.mjs.map +1 -1
- package/_mjs/Fiber/api/mapIO.mjs +4 -5
- package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
- package/_mjs/Fiber/api/poll.mjs +1 -1
- package/_mjs/Fiber/api/poll.mjs.map +1 -1
- package/_mjs/Fiber/api/zipWith.mjs +2 -3
- package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
- package/_mjs/Fiber/constructors.mjs +10 -11
- package/_mjs/Fiber/constructors.mjs.map +1 -1
- package/_mjs/FiberRef/api/locallyScoped.mjs +2 -3
- package/_mjs/FiberRef/api/locallyScoped.mjs.map +1 -1
- package/_mjs/FiberRef/api/locallyScopedWith.mjs +2 -3
- package/_mjs/FiberRef/api/locallyScopedWith.mjs.map +1 -1
- package/_mjs/FiberRef/api.mjs +13 -14
- package/_mjs/FiberRef/api.mjs.map +1 -1
- package/_mjs/FiberRef/constructors.mjs +4 -5
- package/_mjs/FiberRef/constructors.mjs.map +1 -1
- package/_mjs/FiberRef/unsafe.mjs +6 -0
- package/_mjs/FiberRef/unsafe.mjs.map +1 -1
- package/_mjs/Future/api.mjs +30 -31
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Future/constructors.mjs +4 -5
- package/_mjs/Future/constructors.mjs.map +1 -1
- package/_mjs/Hub/api.mjs +44 -44
- package/_mjs/Hub/api.mjs.map +1 -1
- package/_mjs/Hub/internal.mjs +16 -24
- package/_mjs/Hub/internal.mjs.map +1 -1
- package/_mjs/IO/api/acquireRelease.mjs +2 -3
- package/_mjs/IO/api/acquireRelease.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/addFinalizer.mjs +1 -1
- package/_mjs/IO/api/addFinalizer.mjs.map +1 -1
- package/_mjs/IO/api/addFinalizerExit.mjs +5 -10
- package/_mjs/IO/api/addFinalizerExit.mjs.map +1 -1
- package/_mjs/IO/api/asyncIO.mjs +5 -6
- 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 -3
- package/_mjs/IO/api/bracketExit.mjs.map +1 -1
- package/_mjs/IO/api/concurrency.mjs +7 -7
- package/_mjs/IO/api/concurrency.mjs.map +1 -1
- package/_mjs/IO/api/concurrentFinalizers.mjs +2 -3
- package/_mjs/IO/api/concurrentFinalizers.mjs.map +1 -1
- package/_mjs/IO/api/consoleWith.mjs +3 -3
- package/_mjs/IO/api/consoleWith.mjs.map +1 -1
- package/_mjs/IO/api/core-scope.mjs +4 -4
- package/_mjs/IO/api/core-scope.mjs.map +1 -1
- package/_mjs/IO/api/ensuringChildren.mjs +2 -3
- package/_mjs/IO/api/ensuringChildren.mjs.map +1 -1
- package/_mjs/IO/api/environment.mjs +6 -8
- package/_mjs/IO/api/environment.mjs.map +1 -1
- package/_mjs/IO/api/foreachC.mjs +25 -26
- package/_mjs/IO/api/foreachC.mjs.map +1 -1
- package/_mjs/IO/api/foreachExec.mjs +2 -3
- package/_mjs/IO/api/foreachExec.mjs.map +1 -1
- package/_mjs/IO/api/forkIn.mjs +1 -1
- 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 +2 -3
- package/_mjs/IO/api/fulfill.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +13 -13
- package/_mjs/IO/api/interrupt.mjs.map +1 -1
- package/_mjs/IO/api/memoize.mjs +4 -8
- package/_mjs/IO/api/memoize.mjs.map +1 -1
- package/_mjs/IO/api/onExit.mjs +2 -2
- package/_mjs/IO/api/onExit.mjs.map +1 -1
- package/_mjs/IO/api/onTermination.mjs +2 -2
- package/_mjs/IO/api/onTermination.mjs.map +1 -1
- package/_mjs/IO/api/once.mjs +1 -1
- package/_mjs/IO/api/once.mjs.map +1 -1
- package/_mjs/IO/api/provideLayer.mjs +2 -3
- package/_mjs/IO/api/provideLayer.mjs.map +1 -1
- package/_mjs/IO/api/provideSomeLayer.mjs +2 -3
- package/_mjs/IO/api/provideSomeLayer.mjs.map +1 -1
- package/_mjs/IO/api/race.mjs +4 -5
- package/_mjs/IO/api/race.mjs.map +1 -1
- package/_mjs/IO/api/raceFirst.mjs +2 -3
- package/_mjs/IO/api/raceFirst.mjs.map +1 -1
- package/_mjs/IO/api/randomWith.mjs +3 -3
- package/_mjs/IO/api/randomWith.mjs.map +1 -1
- package/_mjs/IO/api/repeat.mjs +10 -11
- package/_mjs/IO/api/repeat.mjs.map +1 -1
- package/_mjs/IO/api/retry.mjs +8 -9
- package/_mjs/IO/api/retry.mjs.map +1 -1
- package/_mjs/IO/api/schedule.mjs +6 -7
- package/_mjs/IO/api/schedule.mjs.map +1 -1
- package/_mjs/IO/api/scope.mjs +1 -1
- package/_mjs/IO/api/scope.mjs.map +1 -1
- package/_mjs/IO/api/scopeWith.mjs +2 -3
- package/_mjs/IO/api/scopeWith.mjs.map +1 -1
- package/_mjs/IO/api/scoped.mjs +4 -5
- package/_mjs/IO/api/scoped.mjs.map +1 -1
- package/_mjs/IO/api/stateful.mjs +1 -1
- package/_mjs/IO/api/stateful.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +3 -4
- 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 +2 -3
- package/_mjs/IO/api/withEarlyRelease.mjs.map +1 -1
- package/_mjs/IO/api/withFinalizer.mjs +2 -2
- package/_mjs/IO/api/withFinalizer.mjs.map +1 -1
- package/_mjs/IO/api/withFinalizerExit.mjs +2 -3
- package/_mjs/IO/api/withFinalizerExit.mjs.map +1 -1
- package/_mjs/IO/api/withRuntimeConfig.mjs +2 -3
- package/_mjs/IO/api/withRuntimeConfig.mjs.map +1 -1
- package/_mjs/IO/api/zipC.mjs +5 -6
- package/_mjs/IO/api/zipC.mjs.map +1 -1
- package/_mjs/IO/api.mjs +112 -112
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +3 -5
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +61 -18
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IOEnv/live.mjs +2 -1
- package/_mjs/IOEnv/live.mjs.map +1 -1
- package/_mjs/Layer/MemoMap.mjs +43 -60
- package/_mjs/Layer/MemoMap.mjs.map +1 -1
- package/_mjs/Layer/api.mjs +84 -84
- package/_mjs/Layer/api.mjs.map +1 -1
- package/_mjs/Layer/definition.mjs +14 -7
- package/_mjs/Layer/definition.mjs.map +1 -1
- package/_mjs/Queue/api/dimapIO.mjs +14 -14
- package/_mjs/Queue/api/dimapIO.mjs.map +1 -1
- package/_mjs/Queue/api/filterInputIO.mjs +6 -6
- package/_mjs/Queue/api/filterInputIO.mjs.map +1 -1
- package/_mjs/Queue/api/filterOutputIO.mjs +6 -6
- package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -1
- package/_mjs/Queue/api/operations.mjs +13 -13
- package/_mjs/Queue/api/operations.mjs.map +1 -1
- package/_mjs/Queue/api/poll.mjs +2 -3
- package/_mjs/Queue/api/poll.mjs.map +1 -1
- package/_mjs/Queue/api/takeBetween.mjs +10 -11
- package/_mjs/Queue/api/takeBetween.mjs.map +1 -1
- package/_mjs/Queue/api/zipWithIO.mjs +12 -12
- package/_mjs/Queue/api/zipWithIO.mjs.map +1 -1
- package/_mjs/Queue/constructors.mjs +8 -9
- package/_mjs/Queue/constructors.mjs.map +1 -1
- package/_mjs/Queue/internal.mjs +17 -17
- package/_mjs/Queue/internal.mjs.map +1 -1
- package/_mjs/Queue/strategy.mjs +16 -20
- package/_mjs/Queue/strategy.mjs.map +1 -1
- package/_mjs/Random/api.mjs +14 -13
- package/_mjs/Random/api.mjs.map +1 -1
- package/_mjs/Random/live.mjs +4 -4
- package/_mjs/Random/live.mjs.map +1 -1
- package/_mjs/Ref/Atomic/Atomic.mjs.map +1 -1
- package/_mjs/Ref/Atomic/api.mjs +19 -20
- package/_mjs/Ref/Atomic/api.mjs.map +1 -1
- package/_mjs/Ref/Derived.mjs.map +1 -1
- package/_mjs/Ref/DerivedAll.mjs +1 -1
- package/_mjs/Ref/DerivedAll.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/api.mjs +25 -26
- package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/constructors.mjs +8 -13
- package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/definition.mjs +1 -1
- package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
- package/_mjs/Ref/api/collect.mjs +1 -1
- package/_mjs/Ref/api/collect.mjs.map +1 -1
- package/_mjs/Ref/api/dimap.mjs +12 -12
- package/_mjs/Ref/api/dimap.mjs.map +1 -1
- package/_mjs/Ref/api/filter.mjs +2 -2
- package/_mjs/Ref/api/filter.mjs.map +1 -1
- package/_mjs/Ref/api/get.mjs +1 -1
- package/_mjs/Ref/api/get.mjs.map +1 -1
- package/_mjs/Ref/api/modify.mjs +29 -30
- package/_mjs/Ref/api/modify.mjs.map +1 -1
- package/_mjs/Ref/api/set.mjs +1 -1
- package/_mjs/Ref/api/set.mjs.map +1 -1
- package/_mjs/Ref/constructors.mjs +3 -4
- package/_mjs/Ref/constructors.mjs.map +1 -1
- package/_mjs/STM/api/core-api.mjs +8 -8
- package/_mjs/STM/api/core-api.mjs.map +1 -1
- package/_mjs/STM/api/core-constructors.mjs +6 -6
- package/_mjs/STM/api/core-constructors.mjs.map +1 -1
- package/_mjs/STM/api.mjs +122 -142
- package/_mjs/STM/api.mjs.map +1 -1
- package/_mjs/STM/definition.mjs.map +1 -1
- package/_mjs/STM/driver.mjs +9 -6
- package/_mjs/STM/driver.mjs.map +1 -1
- package/_mjs/STM/internal/Journal.mjs +20 -21
- package/_mjs/STM/internal/Journal.mjs.map +1 -1
- package/_mjs/Schedule/Decision.mjs +9 -0
- package/_mjs/Schedule/Decision.mjs.map +1 -1
- package/_mjs/Schedule/api/driver.mjs +17 -20
- package/_mjs/Schedule/api/driver.mjs.map +1 -1
- package/_mjs/Schedule/api.mjs +198 -177
- package/_mjs/Schedule/api.mjs.map +1 -1
- package/_mjs/Scope/Finalizer/definition.mjs +4 -5
- package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs +3 -4
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/api.mjs +14 -15
- package/_mjs/Scope/ReleaseMap/api.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/constructors.mjs +1 -1
- package/_mjs/Scope/ReleaseMap/constructors.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/definition.mjs +2 -3
- package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
- package/_mjs/Scope/api.mjs +20 -30
- package/_mjs/Scope/api.mjs.map +1 -1
- package/_mjs/ScopedRef/api.mjs +14 -22
- package/_mjs/ScopedRef/api.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +92 -88
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/State/api.mjs +5 -6
- package/_mjs/State/api.mjs.map +1 -1
- package/_mjs/Stream/api/zipAllWith.mjs +22 -23
- package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
- package/_mjs/Stream/api/zipWith.mjs +2 -2
- package/_mjs/Stream/api/zipWith.mjs.map +1 -1
- package/_mjs/Stream/api/zipWithChunks.mjs +20 -21
- package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +430 -417
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/Stream/internal/Handoff.mjs +12 -12
- package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
- package/_mjs/Stream/internal/Pull.mjs +1 -1
- package/_mjs/Stream/internal/Pull.mjs.map +1 -1
- package/_mjs/Stream/internal/Take.mjs +1 -1
- package/_mjs/Stream/internal/Take.mjs.map +1 -1
- package/_mjs/Supervisor/api.mjs +2 -1
- package/_mjs/Supervisor/api.mjs.map +1 -1
- package/_mjs/Supervisor/constructors.mjs +9 -6
- package/_mjs/Supervisor/constructors.mjs.map +1 -1
- package/_mjs/TFuture/api.mjs +10 -10
- package/_mjs/TFuture/api.mjs.map +1 -1
- package/_mjs/TFuture/constructors.mjs +4 -4
- package/_mjs/TFuture/constructors.mjs.map +1 -1
- package/_mjs/TFuture/definition.mjs +2 -3
- package/_mjs/TFuture/definition.mjs.map +1 -1
- package/_mjs/TReentrantLock/api.mjs +41 -42
- package/_mjs/TReentrantLock/api.mjs.map +1 -1
- package/_mjs/TRef/api.mjs +40 -40
- package/_mjs/TRef/api.mjs.map +1 -1
- package/_mjs/TRef/constructors.mjs +6 -6
- package/_mjs/TRef/constructors.mjs.map +1 -1
- package/_mjs/TSemaphore/api.mjs +17 -18
- package/_mjs/TSemaphore/api.mjs.map +1 -1
- package/_mjs/TSemaphore/constructors.mjs +2 -2
- package/_mjs/TSemaphore/constructors.mjs.map +1 -1
- package/_mjs/TSemaphore/definition.mjs +2 -3
- package/_mjs/TSemaphore/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/dropUntilIO.mjs +1 -1
- package/_mjs/collection/immutable/Conc/dropUntilIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/dropWhileIO.mjs +1 -1
- package/_mjs/collection/immutable/Conc/dropWhileIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/filterIO.mjs +5 -6
- package/_mjs/collection/immutable/Conc/filterIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/findIO.mjs +7 -8
- package/_mjs/collection/immutable/Conc/findIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/mapIO.mjs +3 -4
- package/_mjs/collection/immutable/Conc/mapIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs +7 -8
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc.mjs +2 -0
- package/_mjs/collection/immutable/Conc.mjs.map +1 -1
- package/_mjs/data/Exit/foreachIO.mjs +2 -3
- package/_mjs/data/Exit/foreachIO.mjs.map +1 -1
- package/_mjs/global.mjs +2 -0
- package/_mjs/global.mjs.map +1 -0
- package/_mjs/index.mjs +2 -0
- package/_mjs/index.mjs.map +1 -0
- package/_mjs/internal/Scheduler.mjs +62 -15
- package/_mjs/internal/Scheduler.mjs.map +1 -1
- package/_src/Cached/api.ts +4 -3
- package/_src/Channel/api/interruptWhen.ts +1 -1
- package/_src/Channel/api/mapOutIOC.ts +2 -2
- package/_src/Channel/api/mergeAll.ts +1 -1
- package/_src/Channel/api/mergeAllUnboundedWith.ts +1 -1
- package/_src/Channel/api/mergeAllWith.ts +3 -3
- package/_src/Channel/api/mergeMap.ts +1 -1
- package/_src/Channel/api/mergeWith.ts +9 -9
- package/_src/Channel/api/runScoped.ts +1 -1
- package/_src/Channel/api/toPull.ts +1 -1
- package/_src/Channel/api/zipC.ts +3 -3
- package/_src/Channel/api.ts +73 -73
- package/_src/Channel/core-api.ts +11 -13
- package/_src/Channel/definition.ts +19 -19
- package/_src/Channel/internal/MergeDecision.ts +1 -1
- package/_src/Clock/live.ts +1 -1
- package/_src/Console/api.ts +1 -1
- package/_src/Fiber/FiberContext.ts +10 -8
- package/_src/Fiber/api/await.ts +1 -1
- package/_src/Fiber/api/awaitAll.ts +1 -1
- package/_src/Fiber/api/children.ts +1 -1
- package/_src/Fiber/api/collectAll.ts +4 -1
- package/_src/Fiber/api/evalOn.ts +6 -1
- package/_src/Fiber/api/evalOnIO.ts +2 -1
- package/_src/Fiber/api/fromIO.ts +1 -1
- package/_src/Fiber/api/id.ts +1 -1
- package/_src/Fiber/api/inheritRefs.ts +1 -1
- package/_src/Fiber/api/interrupt.ts +1 -1
- package/_src/Fiber/api/interruptAll.ts +2 -2
- package/_src/Fiber/api/interruptAs.ts +1 -1
- package/_src/Fiber/api/join.ts +1 -1
- package/_src/Fiber/api/joinAll.ts +1 -1
- package/_src/Fiber/api/mapFiber.ts +5 -1
- package/_src/Fiber/api/mapIO.ts +6 -2
- package/_src/Fiber/api/poll.ts +1 -1
- package/_src/Fiber/api/zipWith.ts +1 -0
- package/_src/Fiber/constructors.ts +5 -5
- package/_src/Fiber/definition.ts +1 -1
- package/_src/FiberRef/api/locallyScoped.ts +1 -1
- package/_src/FiberRef/api/locallyScopedWith.ts +5 -1
- package/_src/FiberRef/api.ts +7 -7
- package/_src/FiberRef/constructors.ts +4 -2
- package/_src/FiberRef/unsafe.ts +7 -0
- package/_src/Future/api.ts +24 -16
- package/_src/Future/constructors.ts +2 -2
- package/_src/Hub/api.ts +50 -23
- package/_src/Hub/definition.ts +6 -6
- package/_src/Hub/internal.ts +15 -15
- package/_src/IO/api/acquireRelease.ts +2 -1
- package/_src/IO/api/acquireReleaseExit.ts +1 -1
- package/_src/IO/api/acquireReleaseInterruptible.ts +1 -1
- package/_src/IO/api/acquireReleaseInterruptibleExit.ts +1 -1
- package/_src/IO/api/addFinalizer.ts +1 -4
- package/_src/IO/api/addFinalizerExit.ts +6 -5
- package/_src/IO/api/asyncIO.ts +4 -1
- package/_src/IO/api/bracket.ts +2 -1
- package/_src/IO/api/bracketExit.ts +2 -1
- package/_src/IO/api/concurrency.ts +6 -3
- package/_src/IO/api/concurrentFinalizers.ts +1 -1
- package/_src/IO/api/consoleWith.ts +1 -1
- package/_src/IO/api/core-scope.ts +1 -1
- package/_src/IO/api/ensuringChildren.ts +3 -2
- package/_src/IO/api/environment.ts +9 -11
- package/_src/IO/api/foreachC.ts +33 -6
- package/_src/IO/api/foreachExec.ts +1 -0
- package/_src/IO/api/forkScoped.ts +1 -1
- package/_src/IO/api/fulfill.ts +1 -1
- package/_src/IO/api/interrupt.ts +13 -5
- package/_src/IO/api/memoize.ts +3 -3
- package/_src/IO/api/onExit.ts +2 -1
- package/_src/IO/api/onTermination.ts +2 -2
- package/_src/IO/api/provideLayer.ts +1 -0
- package/_src/IO/api/provideSomeLayer.ts +1 -3
- package/_src/IO/api/race.ts +6 -2
- package/_src/IO/api/raceFirst.ts +6 -2
- package/_src/IO/api/randomWith.ts +1 -1
- package/_src/IO/api/repeat.ts +7 -7
- package/_src/IO/api/retry.ts +7 -7
- package/_src/IO/api/schedule.ts +4 -3
- package/_src/IO/api/scope.ts +1 -1
- package/_src/IO/api/scopeWith.ts +1 -1
- package/_src/IO/api/scoped.ts +2 -2
- package/_src/IO/api/sequenceT.ts +1 -1
- package/_src/IO/api/stateful.ts +1 -1
- package/_src/IO/api/timeout.ts +5 -1
- package/_src/IO/api/withChildren.ts +1 -1
- package/_src/IO/api/withEarlyRelease.ts +4 -1
- package/_src/IO/api/withFinalizer.ts +2 -1
- package/_src/IO/api/withFinalizerExit.ts +2 -1
- package/_src/IO/api/withRuntimeConfig.ts +5 -1
- package/_src/IO/api/zipC.ts +7 -2
- package/_src/IO/api.ts +125 -75
- package/_src/IO/definition.ts +32 -27
- package/_src/IO/runtime.ts +66 -12
- package/_src/IOEnv/definition.ts +1 -1
- package/_src/Layer/MemoMap.ts +41 -34
- package/_src/Layer/api.ts +82 -49
- package/_src/Layer/definition.ts +11 -8
- package/_src/Queue/api/dimapIO.ts +21 -11
- package/_src/Queue/api/filterInputIO.ts +6 -4
- package/_src/Queue/api/filterOutputIO.ts +8 -6
- package/_src/Queue/api/operations.ts +28 -10
- package/_src/Queue/api/poll.ts +4 -1
- package/_src/Queue/api/takeBetween.ts +6 -1
- package/_src/Queue/api/zipWithIO.ts +13 -10
- package/_src/Queue/constructors.ts +4 -4
- package/_src/Queue/definition.ts +10 -10
- package/_src/Queue/internal.ts +7 -7
- package/_src/Queue/strategy.ts +18 -10
- package/_src/Random/api.ts +5 -5
- package/_src/Random/definition.ts +5 -5
- package/_src/Random/live.ts +4 -4
- package/_src/Ref/Atomic/Atomic.ts +3 -3
- package/_src/Ref/Atomic/api.ts +10 -10
- package/_src/Ref/Derived.ts +3 -3
- package/_src/Ref/DerivedAll.ts +3 -3
- package/_src/Ref/Synchronized/api.ts +33 -18
- package/_src/Ref/Synchronized/constructors.ts +5 -5
- package/_src/Ref/Synchronized/definition.ts +2 -2
- package/_src/Ref/api/collect.ts +1 -0
- package/_src/Ref/api/dimap.ts +7 -0
- package/_src/Ref/api/filter.ts +2 -0
- package/_src/Ref/api/get.ts +5 -2
- package/_src/Ref/api/modify.ts +21 -9
- package/_src/Ref/api/set.ts +5 -1
- package/_src/Ref/constructors.ts +2 -2
- package/_src/Ref/definition.ts +14 -14
- package/_src/STM/api/core-api.ts +20 -7
- package/_src/STM/api/core-constructors.ts +7 -7
- package/_src/STM/api.ts +150 -116
- package/_src/STM/definition.ts +6 -6
- package/_src/STM/driver.ts +3 -3
- package/_src/STM/internal/Journal.ts +25 -16
- package/_src/Schedule/Decision.ts +10 -3
- package/_src/Schedule/Driver.ts +2 -2
- package/_src/Schedule/api/driver.ts +6 -6
- package/_src/Schedule/api.ts +182 -82
- package/_src/Schedule/definition.ts +1 -1
- package/_src/Scope/Finalizer/definition.ts +2 -2
- package/_src/Scope/ReleaseMap/api/releaseAll.ts +6 -1
- package/_src/Scope/ReleaseMap/api.ts +15 -5
- package/_src/Scope/ReleaseMap/definition.ts +1 -1
- package/_src/Scope/api.ts +23 -15
- package/_src/ScopedRef/api.ts +12 -17
- package/_src/ScopedRef/definition.ts +1 -1
- package/_src/Sink/api.ts +111 -85
- package/_src/State/api.ts +1 -1
- package/_src/Stream/api/zipAllWith.ts +5 -2
- package/_src/Stream/api/zipWith.ts +2 -1
- package/_src/Stream/api/zipWithChunks.ts +5 -2
- package/_src/Stream/api.ts +484 -216
- package/_src/Stream/definition.ts +3 -3
- package/_src/Stream/internal/Take.ts +1 -1
- package/_src/Supervisor/constructors.ts +7 -3
- package/_src/TFuture/api.ts +5 -5
- package/_src/TFuture/constructors.ts +2 -2
- package/_src/TFuture/definition.ts +1 -1
- package/_src/TReentrantLock/api.ts +18 -18
- package/_src/TRef/api.ts +36 -14
- package/_src/TRef/constructors.ts +4 -4
- package/_src/TSemaphore/api.ts +7 -7
- package/_src/TSemaphore/constructors.ts +1 -1
- package/_src/TSemaphore/definition.ts +1 -1
- package/_src/collection/immutable/Conc/filterIO.ts +5 -1
- package/_src/collection/immutable/Conc/findIO.ts +6 -1
- package/_src/collection/immutable/Conc/mapIO.ts +1 -1
- package/_src/collection/immutable/Conc/takeWhileIO.ts +5 -1
- package/_src/collection/immutable/Conc.ts +2 -0
- package/_src/data/Exit/foreachIO.ts +1 -0
- package/_src/global.ts +149 -0
- package/_src/index.ts +42 -0
- package/_src/internal/Scheduler.ts +59 -15
- package/collection/immutable/Conc/filterIO.d.ts +1 -1
- package/collection/immutable/Conc/findIO.d.ts +2 -2
- package/collection/immutable/Conc/mapIO.d.ts +1 -1
- package/collection/immutable/Conc/takeWhileIO.d.ts +1 -1
- package/collection/immutable/Conc.d.ts +2 -0
- package/data/Exit/foreachIO.d.ts +2 -2
- package/global.d.ts +149 -0
- package/index.d.ts +40 -0
- package/internal/Scheduler.d.ts +18 -1
- package/package.json +3 -3
package/_src/Stream/api.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { Take } from "./internal/Take.js";
|
|
|
21
21
|
*
|
|
22
22
|
* @tsplus getter fncts.io.Stream absolve
|
|
23
23
|
*/
|
|
24
|
-
export function absolve<R, E, E2, A>(self: Stream<R, E, Either<E2, A
|
|
24
|
+
export function absolve<R, E, E2, A>(self: Stream<R, E, Either<E2, A>>, __tsplusTrace?: string): Stream<R, E | E2, A> {
|
|
25
25
|
return self.mapIO((either) => IO.fromEither(either));
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -42,7 +42,8 @@ export function absolve<R, E, E2, A>(self: Stream<R, E, Either<E2, A>>): Stream<
|
|
|
42
42
|
export function aggregateAsync_<R, E, A extends A1, R1, E1, A1, B>(
|
|
43
43
|
stream: Stream<R, E, A>,
|
|
44
44
|
sink: Sink<R1, E1, A1, A1, B>,
|
|
45
|
-
|
|
45
|
+
__tsplusTrace?: string,
|
|
46
|
+
): Stream<R | R1, E | E1, B> {
|
|
46
47
|
return stream.aggregateAsyncWithin(sink, Schedule.forever);
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -55,7 +56,8 @@ export function aggregateAsyncWithin_<R, E, A extends A1, R1, E1, A1, B, R2, C>(
|
|
|
55
56
|
stream: Stream<R, E, A>,
|
|
56
57
|
sink: Sink<R1, E1, A1, A1, B>,
|
|
57
58
|
schedule: Schedule<R2, Maybe<B>, C>,
|
|
58
|
-
|
|
59
|
+
__tsplusTrace?: string,
|
|
60
|
+
): Stream<R | R1 | R2, E | E1, B> {
|
|
59
61
|
return stream.aggregateAsyncWithinEither(sink, schedule).filterMap((cb) => cb.match(() => Nothing(), Maybe.just));
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -77,7 +79,8 @@ export function aggregateAsyncWithinEither_<R, E, A extends A1, R1, E1, A1, B, R
|
|
|
77
79
|
stream: Stream<R, E, A>,
|
|
78
80
|
sink: Sink<R1, E1, A1, A1, B>,
|
|
79
81
|
schedule: Schedule<R2, Maybe<B>, C>,
|
|
80
|
-
|
|
82
|
+
__tsplusTrace?: string,
|
|
83
|
+
): Stream<R | R1 | R2, E | E1, Either<C, B>> {
|
|
81
84
|
type LocalHandoffSignal = HandoffSignal<E | E1, A1>;
|
|
82
85
|
|
|
83
86
|
const deps = IO.sequenceT(
|
|
@@ -89,13 +92,13 @@ export function aggregateAsyncWithinEither_<R, E, A extends A1, R1, E1, A1, B, R
|
|
|
89
92
|
);
|
|
90
93
|
|
|
91
94
|
return Stream.fromIO(deps).flatMap(([handoff, sinkEndReason, sinkLeftovers, scheduleDriver, consumed]) => {
|
|
92
|
-
const handoffProducer: Channel<
|
|
95
|
+
const handoffProducer: Channel<never, E | E1, Conc<A1>, unknown, never, never, any> = Channel.readWithCause(
|
|
93
96
|
(_in: Conc<A1>) => Channel.fromIO(handoff.offer(HandoffSignal.Emit(_in))).apSecond(handoffProducer),
|
|
94
97
|
(cause: Cause<E | E1>) => Channel.fromIO(handoff.offer(HandoffSignal.Halt(cause))),
|
|
95
98
|
(_: any) => Channel.fromIO(handoff.offer(HandoffSignal.End(new UpstreamEnd()))),
|
|
96
99
|
);
|
|
97
100
|
|
|
98
|
-
const handoffConsumer: Channel<
|
|
101
|
+
const handoffConsumer: Channel<never, unknown, unknown, unknown, E | E1, Conc<A1>, void> = Channel.unwrap(
|
|
99
102
|
sinkLeftovers.getAndSet(Conc.empty<A>()).flatMap((leftovers) => {
|
|
100
103
|
if (leftovers.isNonEmpty) {
|
|
101
104
|
return consumed.set(true) > IO.succeedNow(Channel.writeNow(leftovers) > handoffConsumer);
|
|
@@ -123,18 +126,18 @@ export function aggregateAsyncWithinEither_<R, E, A extends A1, R1, E1, A1, B, R
|
|
|
123
126
|
}),
|
|
124
127
|
);
|
|
125
128
|
|
|
126
|
-
function timeout(lastB: Maybe<B
|
|
129
|
+
function timeout(lastB: Maybe<B>, __tsplusTrace?: string): IO<R2, Nothing, C> {
|
|
127
130
|
return scheduleDriver.next(lastB);
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
const scheduledAggregator = (
|
|
131
134
|
sinkFiber: Fiber.Runtime<E | E1, readonly [Conc<Conc<A1>>, B]>,
|
|
132
135
|
scheduleFiber: Fiber.Runtime<Nothing, C>,
|
|
133
|
-
): Channel<R1
|
|
136
|
+
): Channel<R1 | R2, unknown, unknown, unknown, E | E1, Conc<Either<C, B>>, any> => {
|
|
134
137
|
const forkSink =
|
|
135
138
|
consumed.set(false) > handoffConsumer.pipeToOrFail(sink.channel).doneCollect.runScoped.forkScoped;
|
|
136
139
|
|
|
137
|
-
function handleSide(leftovers: Conc<Conc<A1>>, b: B, c: Maybe<C
|
|
140
|
+
function handleSide(leftovers: Conc<Conc<A1>>, b: B, c: Maybe<C>, __tsplusTrace?: string) {
|
|
138
141
|
return Channel.unwrap(
|
|
139
142
|
sinkLeftovers.set(leftovers.flatten) >
|
|
140
143
|
sinkEndReason.get.map((reason) =>
|
|
@@ -207,7 +210,8 @@ export function aggregateAsyncWithinEither_<R, E, A extends A1, R1, E1, A1, B, R
|
|
|
207
210
|
export function apFirst_<R, R1, E, E1, A, A1>(
|
|
208
211
|
stream: Stream<R, E, A>,
|
|
209
212
|
that: Stream<R1, E1, A1>,
|
|
210
|
-
|
|
213
|
+
__tsplusTrace?: string,
|
|
214
|
+
): Stream<R | R1, E | E1, A> {
|
|
211
215
|
return stream.crossWith(that, (a, _) => a);
|
|
212
216
|
}
|
|
213
217
|
|
|
@@ -221,7 +225,8 @@ export function apFirst_<R, R1, E, E1, A, A1>(
|
|
|
221
225
|
export function apSecond_<R, R1, E, E1, A, A1>(
|
|
222
226
|
stream: Stream<R, E, A>,
|
|
223
227
|
that: Stream<R1, E1, A1>,
|
|
224
|
-
|
|
228
|
+
__tsplusTrace?: string,
|
|
229
|
+
): Stream<R | R1, E | E1, A1> {
|
|
225
230
|
return stream.crossWith(that, (_, b) => b);
|
|
226
231
|
}
|
|
227
232
|
|
|
@@ -230,7 +235,7 @@ export function apSecond_<R, R1, E, E1, A, A1>(
|
|
|
230
235
|
*
|
|
231
236
|
* @tsplus fluent fncts.io.Stream as
|
|
232
237
|
*/
|
|
233
|
-
export function as_<R, E, A, B>(stream: Stream<R, E, A>, b: Lazy<B
|
|
238
|
+
export function as_<R, E, A, B>(stream: Stream<R, E, A>, b: Lazy<B>, __tsplusTrace?: string): Stream<R, E, B> {
|
|
234
239
|
return stream.map(() => b());
|
|
235
240
|
}
|
|
236
241
|
|
|
@@ -242,6 +247,7 @@ export function asyncInterrupt<R, E, A>(
|
|
|
242
247
|
resolve: (next: IO<R, Maybe<E>, Conc<A>>, offerCb?: (e: Exit<never, boolean>) => void) => void,
|
|
243
248
|
) => Either<Canceler<R>, Stream<R, E, A>>,
|
|
244
249
|
outputBuffer = 16,
|
|
250
|
+
__tsplusTrace?: string,
|
|
245
251
|
): Stream<R, E, A> {
|
|
246
252
|
return Stream.unwrapScoped(
|
|
247
253
|
Do((Δ) => {
|
|
@@ -257,7 +263,7 @@ export function asyncInterrupt<R, E, A>(
|
|
|
257
263
|
);
|
|
258
264
|
return eitherStream.match(
|
|
259
265
|
(canceler) => {
|
|
260
|
-
const loop: Channel<
|
|
266
|
+
const loop: Channel<never, unknown, unknown, unknown, E, Conc<A>, void> = Channel.unwrap(
|
|
261
267
|
output.take
|
|
262
268
|
.flatMap((take) => take.done)
|
|
263
269
|
.match(
|
|
@@ -286,6 +292,7 @@ export function asyncMaybe<R, E, A>(
|
|
|
286
292
|
resolve: (next: IO<R, Maybe<E>, Conc<A>>, offerCb?: (e: Exit<never, boolean>) => void) => void,
|
|
287
293
|
) => Maybe<Stream<R, E, A>>,
|
|
288
294
|
outputBuffer = 16,
|
|
295
|
+
__tsplusTrace?: string,
|
|
289
296
|
): Stream<R, E, A> {
|
|
290
297
|
return Stream.asyncInterrupt((k) => register(k).match(() => Either.left(IO.unit), Either.right), outputBuffer);
|
|
291
298
|
}
|
|
@@ -296,6 +303,7 @@ export function asyncMaybe<R, E, A>(
|
|
|
296
303
|
export function async<R, E, A>(
|
|
297
304
|
register: (resolve: (next: IO<R, Maybe<E>, Conc<A>>, offerCb?: (e: Exit<never, boolean>) => void) => void) => void,
|
|
298
305
|
outputBuffer = 16,
|
|
306
|
+
__tsplusTrace?: string,
|
|
299
307
|
): Stream<R, E, A> {
|
|
300
308
|
return Stream.asyncMaybe((cb) => {
|
|
301
309
|
register(cb);
|
|
@@ -311,7 +319,8 @@ export function asyncIO<R, E, A, R1 = R, E1 = E>(
|
|
|
311
319
|
resolve: (next: IO<R, Maybe<E>, Conc<A>>, offerCb?: (e: Exit<never, boolean>) => void) => void,
|
|
312
320
|
) => IO<R1, E1, unknown>,
|
|
313
321
|
outputBuffer = 16,
|
|
314
|
-
|
|
322
|
+
__tsplusTrace?: string,
|
|
323
|
+
): Stream<R | R1, E | E1, A> {
|
|
315
324
|
return new Stream(
|
|
316
325
|
Channel.unwrapScoped(
|
|
317
326
|
Do((Δ) => {
|
|
@@ -325,7 +334,7 @@ export function asyncIO<R, E, A, R1 = R, E1 = E>(
|
|
|
325
334
|
),
|
|
326
335
|
),
|
|
327
336
|
);
|
|
328
|
-
const loop: Channel<
|
|
337
|
+
const loop: Channel<never, unknown, unknown, unknown, E, Conc<A>, void> = Channel.unwrap(
|
|
329
338
|
output.take
|
|
330
339
|
.flatMap((take) => take.done)
|
|
331
340
|
.matchCauseIO(
|
|
@@ -349,7 +358,12 @@ export function asyncIO<R, E, A, R1 = R, E1 = E>(
|
|
|
349
358
|
* Returns a stream whose failure and success channels have been mapped by
|
|
350
359
|
* the specified pair of functions, `f` and `g`.
|
|
351
360
|
*/
|
|
352
|
-
export function bimap_<R, E, E1, A, A1>(
|
|
361
|
+
export function bimap_<R, E, E1, A, A1>(
|
|
362
|
+
stream: Stream<R, E, A>,
|
|
363
|
+
f: (e: E) => E1,
|
|
364
|
+
g: (a: A) => A1,
|
|
365
|
+
__tsplusTrace?: string,
|
|
366
|
+
): Stream<R, E1, A1> {
|
|
353
367
|
return stream.mapError(f).map(g);
|
|
354
368
|
}
|
|
355
369
|
|
|
@@ -362,7 +376,8 @@ export function bimap_<R, E, E1, A, A1>(stream: Stream<R, E, A>, f: (e: E) => E1
|
|
|
362
376
|
export function acquireRelease_<R, E, A, R1>(
|
|
363
377
|
acquire: IO<R, E, A>,
|
|
364
378
|
release: (a: A) => IO<R1, never, unknown>,
|
|
365
|
-
|
|
379
|
+
__tsplusTrace?: string,
|
|
380
|
+
): Stream<R | R1, E, A> {
|
|
366
381
|
return Stream.scoped(IO.acquireRelease(acquire, release));
|
|
367
382
|
}
|
|
368
383
|
|
|
@@ -375,7 +390,8 @@ export function acquireRelease_<R, E, A, R1>(
|
|
|
375
390
|
export function acquireReleaseExit_<R, E, A, R1>(
|
|
376
391
|
acquire: IO<R, E, A>,
|
|
377
392
|
release: (a: A, exit: Exit<any, any>) => IO<R1, never, unknown>,
|
|
378
|
-
|
|
393
|
+
__tsplusTrace?: string,
|
|
394
|
+
): Stream<R | R1, E, A> {
|
|
379
395
|
return Stream.scoped(IO.acquireReleaseExit(acquire, release));
|
|
380
396
|
}
|
|
381
397
|
|
|
@@ -390,7 +406,8 @@ export function broadcast_<R, E, A>(
|
|
|
390
406
|
stream: Stream<R, E, A>,
|
|
391
407
|
n: number,
|
|
392
408
|
maximumLag: number,
|
|
393
|
-
|
|
409
|
+
__tsplusTrace?: string,
|
|
410
|
+
): IO<R | Scope, never, Conc<Stream<unknown, E, A>>> {
|
|
394
411
|
return stream
|
|
395
412
|
.broadcastedQueues(n, maximumLag)
|
|
396
413
|
.map((c) => c.map((hub) => Stream.fromQueueWithShutdown(hub).flattenTake));
|
|
@@ -406,7 +423,8 @@ export function broadcast_<R, E, A>(
|
|
|
406
423
|
export function broadcastDynamic_<R, E, A>(
|
|
407
424
|
stream: Stream<R, E, A>,
|
|
408
425
|
maximumLag: number,
|
|
409
|
-
|
|
426
|
+
__tsplusTrace?: string,
|
|
427
|
+
): IO<R | Scope, never, Stream<unknown, E, A>> {
|
|
410
428
|
return stream
|
|
411
429
|
.broadcastedQueuesDynamic(maximumLag)
|
|
412
430
|
.map((scoped) => Stream.scoped(scoped).flatMap(Stream.fromQueue).flattenTake);
|
|
@@ -424,7 +442,8 @@ export function broadcastedQueues_<R, E, A>(
|
|
|
424
442
|
stream: Stream<R, E, A>,
|
|
425
443
|
n: number,
|
|
426
444
|
maximumLag: number,
|
|
427
|
-
|
|
445
|
+
__tsplusTrace?: string,
|
|
446
|
+
): IO<R | Scope, never, Conc<Hub.Dequeue<unknown, never, Take<E, A>>>> {
|
|
428
447
|
return Do((Δ) => {
|
|
429
448
|
const hub = Δ(Hub.makeBounded<Take<E, A>>(maximumLag));
|
|
430
449
|
const queues = Δ(IO.sequenceIterable(Conc.replicate(n, hub.subscribe)));
|
|
@@ -444,7 +463,8 @@ export function broadcastedQueues_<R, E, A>(
|
|
|
444
463
|
export function broadcastedQueuesDynamic_<R, E, A>(
|
|
445
464
|
stream: Stream<R, E, A>,
|
|
446
465
|
maximumLag: number,
|
|
447
|
-
|
|
466
|
+
__tsplusTrace?: string,
|
|
467
|
+
): IO<R | Scope, never, IO<Scope, never, Hub.Dequeue<never, never, Take<E, A>>>> {
|
|
448
468
|
return stream.toHub(maximumLag).map((hub) => hub.subscribe);
|
|
449
469
|
}
|
|
450
470
|
|
|
@@ -454,18 +474,17 @@ export function broadcastedQueuesDynamic_<R, E, A>(
|
|
|
454
474
|
*
|
|
455
475
|
* @tsplus fluent fncts.io.Stream buffer
|
|
456
476
|
*/
|
|
457
|
-
export function buffer_<R, E, A>(stream: Stream<R, E, A>, capacity: number): Stream<R, E, A> {
|
|
477
|
+
export function buffer_<R, E, A>(stream: Stream<R, E, A>, capacity: number, __tsplusTrace?: string): Stream<R, E, A> {
|
|
458
478
|
const queue = toQueueOfElements_(stream, capacity);
|
|
459
479
|
return new Stream(
|
|
460
480
|
Channel.unwrapScoped(
|
|
461
481
|
queue.map((queue) => {
|
|
462
|
-
const process: Channel<
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
),
|
|
482
|
+
const process: Channel<never, unknown, unknown, unknown, E, Conc<A>, void> = Channel.fromIO(queue.take).flatMap(
|
|
483
|
+
(exit: Exit<Maybe<E>, A>) =>
|
|
484
|
+
exit.match(
|
|
485
|
+
(cause) => cause.flipCauseMaybe.match(() => Channel.endNow(undefined), Channel.failCauseNow),
|
|
486
|
+
(value) => Channel.writeNow(Conc.single(value)).apSecond(process),
|
|
487
|
+
),
|
|
469
488
|
);
|
|
470
489
|
return process;
|
|
471
490
|
}),
|
|
@@ -476,17 +495,20 @@ export function buffer_<R, E, A>(stream: Stream<R, E, A>, capacity: number): Str
|
|
|
476
495
|
/**
|
|
477
496
|
* @tsplus fluent fncts.io.Stream bufferChunks
|
|
478
497
|
*/
|
|
479
|
-
export function bufferChunks_<R, E, A>(
|
|
498
|
+
export function bufferChunks_<R, E, A>(
|
|
499
|
+
stream: Stream<R, E, A>,
|
|
500
|
+
capacity: number,
|
|
501
|
+
__tsplusTrace?: string,
|
|
502
|
+
): Stream<R, E, A> {
|
|
480
503
|
const queue = stream.toQueue(capacity);
|
|
481
504
|
return new Stream(
|
|
482
505
|
Channel.unwrapScoped(
|
|
483
506
|
queue.map((queue) => {
|
|
484
|
-
const process: Channel<
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
),
|
|
507
|
+
const process: Channel<never, unknown, unknown, unknown, E, Conc<A>, void> = Channel.fromIO(queue.take).flatMap(
|
|
508
|
+
(take: Take<E, A>) =>
|
|
509
|
+
take.match(Channel.endNow(undefined), Channel.failCauseNow, (value) =>
|
|
510
|
+
Channel.writeNow(value).apSecond(process),
|
|
511
|
+
),
|
|
490
512
|
);
|
|
491
513
|
return process;
|
|
492
514
|
}),
|
|
@@ -500,18 +522,17 @@ export function bufferChunks_<R, E, A>(stream: Stream<R, E, A>, capacity: number
|
|
|
500
522
|
*
|
|
501
523
|
* @tsplus getter fncts.io.Stream bufferUnbounded
|
|
502
524
|
*/
|
|
503
|
-
export function bufferUnbounded<R, E, A>(stream: Stream<R, E, A
|
|
525
|
+
export function bufferUnbounded<R, E, A>(stream: Stream<R, E, A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
504
526
|
const queue = stream.toQueueUnbounded;
|
|
505
527
|
|
|
506
528
|
return new Stream(
|
|
507
529
|
Channel.unwrapScoped(
|
|
508
530
|
queue.map((queue) => {
|
|
509
|
-
const process: Channel<
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
),
|
|
531
|
+
const process: Channel<never, unknown, unknown, unknown, E, Conc<A>, void> = Channel.fromIO(queue.take).flatMap(
|
|
532
|
+
(take) =>
|
|
533
|
+
take.match(Channel.endNow(undefined), Channel.failCauseNow, (value) =>
|
|
534
|
+
Channel.writeNow(value).apSecond(process),
|
|
535
|
+
),
|
|
515
536
|
);
|
|
516
537
|
|
|
517
538
|
return process;
|
|
@@ -520,11 +541,12 @@ export function bufferUnbounded<R, E, A>(stream: Stream<R, E, A>): Stream<R, E,
|
|
|
520
541
|
);
|
|
521
542
|
}
|
|
522
543
|
|
|
523
|
-
function bufferSignalProducer<
|
|
544
|
+
function bufferSignalProducer<E, A>(
|
|
524
545
|
queue: Queue<readonly [Take<E, A>, Future<never, void>]>,
|
|
525
546
|
ref: Ref<Future<never, void>>,
|
|
526
|
-
|
|
527
|
-
|
|
547
|
+
__tsplusTrace?: string,
|
|
548
|
+
): Channel<never, E, Conc<A>, unknown, never, never, unknown> {
|
|
549
|
+
const terminate = (take: Take<E, A>): Channel<never, E, Conc<A>, unknown, never, never, unknown> =>
|
|
528
550
|
Channel.fromIO(
|
|
529
551
|
Do((Δ) => {
|
|
530
552
|
const latch = Δ(ref.get);
|
|
@@ -551,8 +573,9 @@ function bufferSignalProducer<R, E, A>(
|
|
|
551
573
|
|
|
552
574
|
function bufferSignalConsumer<R, E, A>(
|
|
553
575
|
queue: Queue<readonly [Take<E, A>, Future<never, void>]>,
|
|
576
|
+
__tsplusTrace?: string,
|
|
554
577
|
): Channel<R, unknown, unknown, unknown, E, Conc<A>, void> {
|
|
555
|
-
const process: Channel<
|
|
578
|
+
const process: Channel<never, unknown, unknown, unknown, E, Conc<A>, void> = Channel.fromIO(queue.take).flatMap(
|
|
556
579
|
([take, promise]) =>
|
|
557
580
|
Channel.fromIO(promise.succeed(undefined)).apSecond(
|
|
558
581
|
take.match(Channel.endNow(undefined), Channel.failCauseNow, (value) =>
|
|
@@ -572,7 +595,8 @@ function bufferSignalConsumer<R, E, A>(
|
|
|
572
595
|
export function catchAll_<R, R1, E, E1, A, A1>(
|
|
573
596
|
stream: Stream<R, E, A>,
|
|
574
597
|
f: (e: E) => Stream<R1, E1, A1>,
|
|
575
|
-
|
|
598
|
+
__tsplusTrace?: string,
|
|
599
|
+
): Stream<R | R1, E1, A | A1> {
|
|
576
600
|
return stream.catchAllCause((cause) => cause.failureOrCause.match(f, Stream.failCauseNow));
|
|
577
601
|
}
|
|
578
602
|
|
|
@@ -586,8 +610,9 @@ export function catchAll_<R, R1, E, E1, A, A1>(
|
|
|
586
610
|
export function catchAllCause_<R, R1, E, E1, A, A1>(
|
|
587
611
|
stream: Stream<R, E, A>,
|
|
588
612
|
f: (cause: Cause<E>) => Stream<R1, E1, A1>,
|
|
589
|
-
|
|
590
|
-
|
|
613
|
+
__tsplusTrace?: string,
|
|
614
|
+
): Stream<R | R1, E1, A | A1> {
|
|
615
|
+
const channel: Channel<R | R1, unknown, unknown, unknown, E1, Conc<A | A1>, unknown> = stream.channel.catchAllCause(
|
|
591
616
|
(cause) => f(cause).channel,
|
|
592
617
|
);
|
|
593
618
|
return new Stream(channel);
|
|
@@ -602,7 +627,8 @@ export function catchAllCause_<R, R1, E, E1, A, A1>(
|
|
|
602
627
|
export function catchJust_<R, R1, E, E1, A, A1>(
|
|
603
628
|
stream: Stream<R, E, A>,
|
|
604
629
|
pf: (e: E) => Maybe<Stream<R1, E1, A1>>,
|
|
605
|
-
|
|
630
|
+
__tsplusTrace?: string,
|
|
631
|
+
): Stream<R | R1, E | E1, A | A1> {
|
|
606
632
|
return stream.catchAll((e) => pf(e).getOrElse(Stream.failNow(e)));
|
|
607
633
|
}
|
|
608
634
|
|
|
@@ -616,7 +642,8 @@ export function catchJust_<R, R1, E, E1, A, A1>(
|
|
|
616
642
|
export function catchJustCause_<R, R1, E, E1, A, A1>(
|
|
617
643
|
stream: Stream<R, E, A>,
|
|
618
644
|
pf: (e: Cause<E>) => Maybe<Stream<R1, E1, A1>>,
|
|
619
|
-
|
|
645
|
+
__tsplusTrace?: string,
|
|
646
|
+
): Stream<R | R1, E | E1, A | A1> {
|
|
620
647
|
return stream.catchAllCause((cause) => pf(cause).getOrElse(Stream.failCauseNow(cause)));
|
|
621
648
|
}
|
|
622
649
|
|
|
@@ -629,7 +656,8 @@ export function catchJustCause_<R, R1, E, E1, A, A1>(
|
|
|
629
656
|
export function flatMap_<R, E, A, R1, E1, B>(
|
|
630
657
|
stream: Stream<R, E, A>,
|
|
631
658
|
f: (a: A) => Stream<R1, E1, B>,
|
|
632
|
-
|
|
659
|
+
__tsplusTrace?: string,
|
|
660
|
+
): Stream<R | R1, E | E1, B> {
|
|
633
661
|
return new Stream(
|
|
634
662
|
stream.channel.concatMap((as) =>
|
|
635
663
|
as
|
|
@@ -646,13 +674,28 @@ export function flatMap_<R, E, A, R1, E1, B>(
|
|
|
646
674
|
*
|
|
647
675
|
* @tsplus getter fncts.io.Stream chunks
|
|
648
676
|
*/
|
|
649
|
-
export function chunks<R, E, A>(stream: Stream<R, E, A
|
|
677
|
+
export function chunks<R, E, A>(stream: Stream<R, E, A>, __tsplusTrace?: string): Stream<R, E, Conc<A>> {
|
|
650
678
|
return stream.mapChunks(Conc.single);
|
|
651
679
|
}
|
|
652
680
|
|
|
681
|
+
/**
|
|
682
|
+
* Performs the specified stream transformation with the chunk structure of
|
|
683
|
+
* the stream exposed.
|
|
684
|
+
*
|
|
685
|
+
* @tsplus fluent fncts.io.Stream chunksWith
|
|
686
|
+
*/
|
|
687
|
+
export function chunksWith<R, E, A, R1, E1, B>(
|
|
688
|
+
self: Stream<R, E, A>,
|
|
689
|
+
f: (_: Stream<R, E, Conc<A>>) => Stream<R1, E1, Conc<B>>,
|
|
690
|
+
__tsplusTrace?: string,
|
|
691
|
+
): Stream<R1, E1, B> {
|
|
692
|
+
return f(self.chunks).flattenChunks;
|
|
693
|
+
}
|
|
694
|
+
|
|
653
695
|
function changesWithWriter<R, E, A>(
|
|
654
696
|
f: (x: A, y: A) => boolean,
|
|
655
697
|
last: Maybe<A>,
|
|
698
|
+
__tsplusTrace?: string,
|
|
656
699
|
): Channel<R, E, Conc<A>, unknown, E, Conc<A>, void> {
|
|
657
700
|
return Channel.readWithCause(
|
|
658
701
|
(chunk: Conc<A>) => {
|
|
@@ -676,7 +719,11 @@ function changesWithWriter<R, E, A>(
|
|
|
676
719
|
*
|
|
677
720
|
* @tsplus fluent fncts.io.Stream changesWith
|
|
678
721
|
*/
|
|
679
|
-
export function changesWith_<R, E, A>(
|
|
722
|
+
export function changesWith_<R, E, A>(
|
|
723
|
+
stream: Stream<R, E, A>,
|
|
724
|
+
f: (x: A, y: A) => boolean,
|
|
725
|
+
__tsplusTrace?: string,
|
|
726
|
+
): Stream<R, E, A> {
|
|
680
727
|
return new Stream(stream.channel.pipeTo(changesWithWriter<R, E, A>(f, Nothing())));
|
|
681
728
|
}
|
|
682
729
|
|
|
@@ -685,7 +732,11 @@ export function changesWith_<R, E, A>(stream: Stream<R, E, A>, f: (x: A, y: A) =
|
|
|
685
732
|
*
|
|
686
733
|
* @tsplus fluent fncts.io.Stream collectWhile
|
|
687
734
|
*/
|
|
688
|
-
export function collectWhile_<R, E, A, A1>(
|
|
735
|
+
export function collectWhile_<R, E, A, A1>(
|
|
736
|
+
stream: Stream<R, E, A>,
|
|
737
|
+
pf: (a: A) => Maybe<A1>,
|
|
738
|
+
__tsplusTrace?: string,
|
|
739
|
+
): Stream<R, E, A1> {
|
|
689
740
|
const loop: Channel<R, E, Conc<A>, unknown, E, Conc<A1>, any> = Channel.readWith(
|
|
690
741
|
(inp) => {
|
|
691
742
|
const mapped = inp.collectWhile(pf);
|
|
@@ -709,14 +760,16 @@ export function collectWhile_<R, E, A, A1>(stream: Stream<R, E, A>, pf: (a: A) =
|
|
|
709
760
|
export function collectWhileIO_<R, E, A, R1, E1, B>(
|
|
710
761
|
stream: Stream<R, E, A>,
|
|
711
762
|
pf: (a: A) => Maybe<IO<R1, E1, B>>,
|
|
712
|
-
|
|
763
|
+
__tsplusTrace?: string,
|
|
764
|
+
): Stream<R | R1, E | E1, B> {
|
|
713
765
|
return new Stream(stream.channel.pipeTo(collectWhileIOLoop(Iterable.empty<A>()[Symbol.iterator](), pf)));
|
|
714
766
|
}
|
|
715
767
|
|
|
716
768
|
function collectWhileIOLoop<R, E, A, R1, E1, B>(
|
|
717
769
|
iterator: Iterator<A>,
|
|
718
770
|
pf: (a: A) => Maybe<IO<R1, E1, B>>,
|
|
719
|
-
|
|
771
|
+
__tsplusTrace?: string,
|
|
772
|
+
): Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<B>, unknown> {
|
|
720
773
|
const next = iterator.next();
|
|
721
774
|
if (next.done) {
|
|
722
775
|
return Channel.readWithCause(
|
|
@@ -737,7 +790,8 @@ function collectWhileIOLoop<R, E, A, R1, E1, B>(
|
|
|
737
790
|
function combineProducer<Err, Elem>(
|
|
738
791
|
handoff: Handoff<Exit<Maybe<Err>, Elem>>,
|
|
739
792
|
latch: Handoff<void>,
|
|
740
|
-
|
|
793
|
+
__tsplusTrace?: string,
|
|
794
|
+
): Channel<never, Err, Elem, unknown, never, never, any> {
|
|
741
795
|
return Channel.fromIO(latch.take).apSecond(
|
|
742
796
|
Channel.readWithCause(
|
|
743
797
|
(value) => Channel.fromIO(handoff.offer(Exit.succeed(value))).apSecond(combineProducer(handoff, latch)),
|
|
@@ -766,7 +820,8 @@ export function combine_<R, E, A, R1, E1, A1, S, R2, A2>(
|
|
|
766
820
|
eff1: IO<R, Maybe<E>, A>,
|
|
767
821
|
eff2: IO<R1, Maybe<E1>, A1>,
|
|
768
822
|
) => IO<R2, never, Exit<Maybe<E | E1>, readonly [A2, S]>>,
|
|
769
|
-
|
|
823
|
+
__tsplusTrace?: string,
|
|
824
|
+
): Stream<R | R1 | R2, E | E1, A2> {
|
|
770
825
|
return new Stream(
|
|
771
826
|
Channel.unwrapScoped(
|
|
772
827
|
Do((Δ) => {
|
|
@@ -790,7 +845,8 @@ export function combine_<R, E, A, R1, E1, A1, S, R2, A2>(
|
|
|
790
845
|
function combineChunksProducer<Err, Elem>(
|
|
791
846
|
handoff: Handoff<Take<Err, Elem>>,
|
|
792
847
|
latch: Handoff<void>,
|
|
793
|
-
|
|
848
|
+
__tsplusTrace?: string,
|
|
849
|
+
): Channel<never, Err, Conc<Elem>, unknown, never, never, any> {
|
|
794
850
|
return Channel.fromIO(latch.take).apSecond(
|
|
795
851
|
Channel.readWithCause(
|
|
796
852
|
(chunk) => Channel.fromIO(handoff.offer(Take.chunk(chunk))).apSecond(combineChunksProducer(handoff, latch)),
|
|
@@ -817,7 +873,8 @@ export function combineChunks_<R, E, A, R1, E1, A1, S, R2, A2>(
|
|
|
817
873
|
l: IO<R, Maybe<E>, Conc<A>>,
|
|
818
874
|
r: IO<R1, Maybe<E1>, Conc<A1>>,
|
|
819
875
|
) => IO<R2, never, Exit<Maybe<E | E1>, readonly [Conc<A2>, S]>>,
|
|
820
|
-
|
|
876
|
+
__tsplusTrace?: string,
|
|
877
|
+
): Stream<R1 | R | R2, E | E1, A2> {
|
|
821
878
|
return new Stream(
|
|
822
879
|
Channel.unwrapScoped(
|
|
823
880
|
Do((Δ) => {
|
|
@@ -853,8 +910,9 @@ export function combineChunks_<R, E, A, R1, E1, A1, S, R2, A2>(
|
|
|
853
910
|
export function concat_<R, R1, E, E1, A, A1>(
|
|
854
911
|
stream: Stream<R, E, A>,
|
|
855
912
|
that: Stream<R1, E1, A1>,
|
|
856
|
-
|
|
857
|
-
|
|
913
|
+
__tsplusTrace?: string,
|
|
914
|
+
): Stream<R | R1, E | E1, A | A1> {
|
|
915
|
+
return new Stream<R | R1, E | E1, A | A1>(stream.channel.apSecond(that.channel));
|
|
858
916
|
}
|
|
859
917
|
|
|
860
918
|
/**
|
|
@@ -866,7 +924,8 @@ export function concat_<R, R1, E, E1, A, A1>(
|
|
|
866
924
|
export function cross_<R, E, A, R1, E1, B>(
|
|
867
925
|
stream: Stream<R, E, A>,
|
|
868
926
|
that: Stream<R1, E1, B>,
|
|
869
|
-
|
|
927
|
+
__tsplusTrace?: string,
|
|
928
|
+
): Stream<R | R1, E | E1, readonly [A, B]> {
|
|
870
929
|
return new Stream(
|
|
871
930
|
stream.channel.concatMap((as) => that.channel.mapOut((bs) => as.flatMap((a) => bs.map((b) => tuple(a, b))))),
|
|
872
931
|
);
|
|
@@ -883,7 +942,8 @@ export function crossWith_<R, E, A, R1, E1, B, C>(
|
|
|
883
942
|
fa: Stream<R, E, A>,
|
|
884
943
|
fb: Stream<R1, E1, B>,
|
|
885
944
|
f: (a: A, b: B) => C,
|
|
886
|
-
|
|
945
|
+
__tsplusTrace?: string,
|
|
946
|
+
): Stream<R | R1, E | E1, C> {
|
|
887
947
|
return fa.flatMap((a) => fb.map((b) => f(a, b)));
|
|
888
948
|
}
|
|
889
949
|
|
|
@@ -896,6 +956,7 @@ export function crossWith_<R, E, A, R1, E1, B, C>(
|
|
|
896
956
|
export function contramapEnvironment_<R, E, A, R0>(
|
|
897
957
|
ra: Stream<R, E, A>,
|
|
898
958
|
f: (r0: Environment<R0>) => Environment<R>,
|
|
959
|
+
__tsplusTrace?: string,
|
|
899
960
|
): Stream<R0, E, A> {
|
|
900
961
|
return Stream.environment<R0>().flatMap((r0) => ra.provideEnvironment(f(r0)));
|
|
901
962
|
}
|
|
@@ -903,12 +964,16 @@ export function contramapEnvironment_<R, E, A, R0>(
|
|
|
903
964
|
/**
|
|
904
965
|
* @tsplus fluent fncts.io.Stream debounce
|
|
905
966
|
*/
|
|
906
|
-
export function debounce_<R, E, A>(
|
|
967
|
+
export function debounce_<R, E, A>(
|
|
968
|
+
stream: Stream<R, E, A>,
|
|
969
|
+
duration: Lazy<Duration>,
|
|
970
|
+
__tsplusTrace?: string,
|
|
971
|
+
): Stream<R, E, A> {
|
|
907
972
|
return Stream.unwrap(
|
|
908
973
|
IO.transplant((grafter) =>
|
|
909
974
|
Do((Δ) => {
|
|
910
975
|
const handoff = Δ(Handoff<HandoffSignal<E, A>>());
|
|
911
|
-
function enqueue(last: Conc<A
|
|
976
|
+
function enqueue(last: Conc<A>, __tsplusTrace?: string) {
|
|
912
977
|
return grafter(Clock.sleep(duration).as(last).fork).map((f) => consumer(DebounceState.Previous(f)));
|
|
913
978
|
}
|
|
914
979
|
const producer: Channel<R, E, Conc<A>, unknown, E, never, unknown> = Channel.readWithCause(
|
|
@@ -920,7 +985,10 @@ export function debounce_<R, E, A>(stream: Stream<R, E, A>, duration: Lazy<Durat
|
|
|
920
985
|
(cause: Cause<E>) => Channel.fromIO(handoff.offer(HandoffSignal.Halt(cause))),
|
|
921
986
|
() => Channel.fromIO(handoff.offer(HandoffSignal.End(new UpstreamEnd()))),
|
|
922
987
|
);
|
|
923
|
-
function consumer(
|
|
988
|
+
function consumer(
|
|
989
|
+
state: DebounceState<E, A>,
|
|
990
|
+
__tsplusTrace?: string,
|
|
991
|
+
): Channel<R, unknown, unknown, unknown, E, Conc<A>, unknown> {
|
|
924
992
|
return Channel.unwrap(
|
|
925
993
|
state.match({
|
|
926
994
|
NotStarted: () =>
|
|
@@ -973,7 +1041,8 @@ export function debounce_<R, E, A>(stream: Stream<R, E, A>, duration: Lazy<Durat
|
|
|
973
1041
|
|
|
974
1042
|
function defaultIfEmptyWriter<R, E, A, R1, E1, B>(
|
|
975
1043
|
fb: Stream<R1, E1, B>,
|
|
976
|
-
|
|
1044
|
+
__tsplusTrace?: string,
|
|
1045
|
+
): Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<A | B>, unknown> {
|
|
977
1046
|
return Channel.readWith(
|
|
978
1047
|
(i: Conc<A>) =>
|
|
979
1048
|
i.isEmpty ? defaultIfEmptyWriter(fb) : Channel.writeNow(i).apSecond(Channel.id<E, Conc<A>, unknown>()),
|
|
@@ -990,7 +1059,8 @@ function defaultIfEmptyWriter<R, E, A, R1, E1, B>(
|
|
|
990
1059
|
export function defaultIfEmpty_<R, E, A, R1, E1, B>(
|
|
991
1060
|
fa: Stream<R, E, A>,
|
|
992
1061
|
fb: Stream<R1, E1, B>,
|
|
993
|
-
|
|
1062
|
+
__tsplusTrace?: string,
|
|
1063
|
+
): Stream<R | R1, E | E1, A | B> {
|
|
994
1064
|
return new Stream(fa.channel.pipeTo(defaultIfEmptyWriter(fb)));
|
|
995
1065
|
}
|
|
996
1066
|
|
|
@@ -1006,7 +1076,8 @@ export function distributedWith_<R, E, A>(
|
|
|
1006
1076
|
n: number,
|
|
1007
1077
|
maximumLag: number,
|
|
1008
1078
|
decide: (_: A) => UIO<(_: number) => boolean>,
|
|
1009
|
-
|
|
1079
|
+
__tsplusTrace?: string,
|
|
1080
|
+
): IO<R | Scope, never, Conc<Queue.Dequeue<Exit<Maybe<E>, A>>>> {
|
|
1010
1081
|
return Future.make<never, (a: A) => UIO<(_: symbol) => boolean>>().flatMap((p) =>
|
|
1011
1082
|
self
|
|
1012
1083
|
.distributedWithDynamic(
|
|
@@ -1043,7 +1114,8 @@ export function distributedWithDynamic_<R, E, A>(
|
|
|
1043
1114
|
maximumLag: number,
|
|
1044
1115
|
decide: (a: A) => UIO<(_: symbol) => boolean>,
|
|
1045
1116
|
done: (exit: Exit<Maybe<E>, never>) => UIO<any> = () => IO.unit,
|
|
1046
|
-
|
|
1117
|
+
__tsplusTrace?: string,
|
|
1118
|
+
): IO<R | Scope, never, UIO<readonly [symbol, Queue.Dequeue<Exit<Maybe<E>, A>>]>> {
|
|
1047
1119
|
const offer = (queuesRef: Ref<HashMap<symbol, Queue<Exit<Maybe<E>, A>>>>) => (a: A) =>
|
|
1048
1120
|
Do((Δ) => {
|
|
1049
1121
|
const shouldProcess = Δ(decide(a));
|
|
@@ -1130,11 +1202,11 @@ export function distributedWithDynamic_<R, E, A>(
|
|
|
1130
1202
|
*
|
|
1131
1203
|
* @tsplus getter fncts.io.Stream drain
|
|
1132
1204
|
*/
|
|
1133
|
-
export function drain<R, E, A>(fa: Stream<R, E, A
|
|
1205
|
+
export function drain<R, E, A>(fa: Stream<R, E, A>, __tsplusTrace?: string): Stream<R, E, void> {
|
|
1134
1206
|
return new Stream(fa.channel.drain);
|
|
1135
1207
|
}
|
|
1136
1208
|
|
|
1137
|
-
function dropLoop<R, E, A>(r: number): Channel<R, E, Conc<A>, unknown, E, Conc<A>, unknown> {
|
|
1209
|
+
function dropLoop<R, E, A>(r: number, __tsplusTrace?: string): Channel<R, E, Conc<A>, unknown, E, Conc<A>, unknown> {
|
|
1138
1210
|
return Channel.readWith(
|
|
1139
1211
|
(inp: Conc<A>) => {
|
|
1140
1212
|
const dropped = inp.drop(r);
|
|
@@ -1152,7 +1224,7 @@ function dropLoop<R, E, A>(r: number): Channel<R, E, Conc<A>, unknown, E, Conc<A
|
|
|
1152
1224
|
*
|
|
1153
1225
|
* @tsplus fluent fncts.io.Stream drop
|
|
1154
1226
|
*/
|
|
1155
|
-
export function drop_<R, E, A>(stream: Stream<R, E, A>, n: number): Stream<R, E, A> {
|
|
1227
|
+
export function drop_<R, E, A>(stream: Stream<R, E, A>, n: number, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1156
1228
|
return new Stream(stream.channel.pipeTo(dropLoop(n)));
|
|
1157
1229
|
}
|
|
1158
1230
|
|
|
@@ -1162,7 +1234,7 @@ export function drop_<R, E, A>(stream: Stream<R, E, A>, n: number): Stream<R, E,
|
|
|
1162
1234
|
*
|
|
1163
1235
|
* @tsplus fluent fncts.io.Stream dropWhile
|
|
1164
1236
|
*/
|
|
1165
|
-
export function dropWhile_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A
|
|
1237
|
+
export function dropWhile_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1166
1238
|
return stream.pipeThrough(Sink.dropWhile(p));
|
|
1167
1239
|
}
|
|
1168
1240
|
|
|
@@ -1172,7 +1244,7 @@ export function dropWhile_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A>): S
|
|
|
1172
1244
|
*
|
|
1173
1245
|
* @tsplus fluent fncts.io.Stream dropUntil
|
|
1174
1246
|
*/
|
|
1175
|
-
export function dropUntil_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A
|
|
1247
|
+
export function dropUntil_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1176
1248
|
return stream.dropWhile(p.invert).drop(1);
|
|
1177
1249
|
}
|
|
1178
1250
|
|
|
@@ -1185,24 +1257,25 @@ export function dropUntil_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A>): S
|
|
|
1185
1257
|
*
|
|
1186
1258
|
* @tsplus getter fncts.io.Stream either
|
|
1187
1259
|
*/
|
|
1188
|
-
export function either<R, E, A>(stream: Stream<R, E, A
|
|
1260
|
+
export function either<R, E, A>(stream: Stream<R, E, A>, __tsplusTrace?: string): Stream<R, never, Either<E, A>> {
|
|
1189
1261
|
return stream.map(Either.right).catchAll((e) => Stream.succeedNow(Either.left(e)));
|
|
1190
1262
|
}
|
|
1191
1263
|
|
|
1192
1264
|
/**
|
|
1193
1265
|
* @tsplus static fncts.io.StreamOps empty
|
|
1194
1266
|
*/
|
|
1195
|
-
export const empty: Stream<
|
|
1267
|
+
export const empty: Stream<never, never, never> = Stream.fromChunkNow(Conc.empty<never>());
|
|
1196
1268
|
|
|
1197
1269
|
function endWhenWriter<E, A, E1>(
|
|
1198
1270
|
fiber: Fiber<E1, any>,
|
|
1199
|
-
|
|
1271
|
+
__tsplusTrace?: string,
|
|
1272
|
+
): Channel<never, E | E1, Conc<A>, unknown, E | E1, Conc<A>, void> {
|
|
1200
1273
|
return Channel.unwrap(
|
|
1201
1274
|
fiber.poll.map((maybeExit) =>
|
|
1202
1275
|
maybeExit.match(
|
|
1203
1276
|
() =>
|
|
1204
1277
|
Channel.readWith(
|
|
1205
|
-
(inp: Conc<A>) => Channel.writeNow(inp).apSecond(endWhenWriter(fiber)),
|
|
1278
|
+
(inp: Conc<A>) => Channel.writeNow(inp).apSecond(endWhenWriter<E, A, E1>(fiber)),
|
|
1206
1279
|
Channel.failNow,
|
|
1207
1280
|
() => Channel.unit,
|
|
1208
1281
|
),
|
|
@@ -1223,21 +1296,29 @@ function endWhenWriter<E, A, E1>(
|
|
|
1223
1296
|
*
|
|
1224
1297
|
* @tsplus fluent fncts.io.Stream endWhen
|
|
1225
1298
|
*/
|
|
1226
|
-
export function endWhen_<R, E, A, R1, E1>(
|
|
1299
|
+
export function endWhen_<R, E, A, R1, E1>(
|
|
1300
|
+
stream: Stream<R, E, A>,
|
|
1301
|
+
io: IO<R1, E1, any>,
|
|
1302
|
+
__tsplusTrace?: string,
|
|
1303
|
+
): Stream<R | R1, E | E1, A> {
|
|
1227
1304
|
return new Stream(Channel.unwrapScoped(io.forkScoped.map((fiber) => stream.channel.pipeTo(endWhenWriter(fiber)))));
|
|
1228
1305
|
}
|
|
1229
1306
|
|
|
1230
1307
|
/**
|
|
1231
1308
|
* @tsplus fluent fncts.io.Stream ensuring
|
|
1232
1309
|
*/
|
|
1233
|
-
export function ensuring_<R, E, A, R1>(
|
|
1310
|
+
export function ensuring_<R, E, A, R1>(
|
|
1311
|
+
self: Stream<R, E, A>,
|
|
1312
|
+
finalizer: IO<R1, never, any>,
|
|
1313
|
+
__tsplusTrace?: string,
|
|
1314
|
+
): Stream<R | R1, E, A> {
|
|
1234
1315
|
return new Stream(self.channel.ensuring(finalizer));
|
|
1235
1316
|
}
|
|
1236
1317
|
|
|
1237
1318
|
/**
|
|
1238
1319
|
* @tsplus static fncts.io.StreamOps environment
|
|
1239
1320
|
*/
|
|
1240
|
-
export function environment<R>(): Stream<R, never, Environment<R>> {
|
|
1321
|
+
export function environment<R>(__tsplusTrace?: string): Stream<R, never, Environment<R>> {
|
|
1241
1322
|
return Stream.fromIO(IO.environment<R>());
|
|
1242
1323
|
}
|
|
1243
1324
|
|
|
@@ -1246,7 +1327,7 @@ export function environment<R>(): Stream<R, never, Environment<R>> {
|
|
|
1246
1327
|
*
|
|
1247
1328
|
* @tsplus static fncts.io.StreamOps environmentWith
|
|
1248
1329
|
*/
|
|
1249
|
-
export function environmentWith<R, A>(f: (r: Environment<R>) => A): Stream<R, never, A> {
|
|
1330
|
+
export function environmentWith<R, A>(f: (r: Environment<R>) => A, __tsplusTrace?: string): Stream<R, never, A> {
|
|
1250
1331
|
return Stream.environment<R>().map(f);
|
|
1251
1332
|
}
|
|
1252
1333
|
|
|
@@ -1255,7 +1336,10 @@ export function environmentWith<R, A>(f: (r: Environment<R>) => A): Stream<R, ne
|
|
|
1255
1336
|
*
|
|
1256
1337
|
* @tsplus static fncts.io.StreamOps environmentWithIO
|
|
1257
1338
|
*/
|
|
1258
|
-
export function environmentWithIO<R0, R, E, A>(
|
|
1339
|
+
export function environmentWithIO<R0, R, E, A>(
|
|
1340
|
+
f: (r0: Environment<R0>) => IO<R, E, A>,
|
|
1341
|
+
__tsplusTrace?: string,
|
|
1342
|
+
): Stream<R0 | R, E, A> {
|
|
1259
1343
|
return Stream.environment<R0>().mapIO(f);
|
|
1260
1344
|
}
|
|
1261
1345
|
|
|
@@ -1264,7 +1348,10 @@ export function environmentWithIO<R0, R, E, A>(f: (r0: Environment<R0>) => IO<R,
|
|
|
1264
1348
|
*
|
|
1265
1349
|
* @tsplus static fncts.io.StreamOps environmentWithStream
|
|
1266
1350
|
*/
|
|
1267
|
-
export function environmentWithStream<R0, R, E, A>(
|
|
1351
|
+
export function environmentWithStream<R0, R, E, A>(
|
|
1352
|
+
f: (r0: Environment<R0>) => Stream<R, E, A>,
|
|
1353
|
+
__tsplusTrace?: string,
|
|
1354
|
+
): Stream<R0 | R, E, A> {
|
|
1268
1355
|
return Stream.environment<R0>().flatMap(f);
|
|
1269
1356
|
}
|
|
1270
1357
|
|
|
@@ -1273,7 +1360,7 @@ export function environmentWithStream<R0, R, E, A>(f: (r0: Environment<R0>) => S
|
|
|
1273
1360
|
*
|
|
1274
1361
|
* @tsplus static fncts.io.StreamOps failNow
|
|
1275
1362
|
*/
|
|
1276
|
-
export function failNow<E>(error: E): Stream<
|
|
1363
|
+
export function failNow<E>(error: E, __tsplusTrace?: string): Stream<never, E, never> {
|
|
1277
1364
|
return new Stream(Channel.failNow(error));
|
|
1278
1365
|
}
|
|
1279
1366
|
|
|
@@ -1282,7 +1369,7 @@ export function failNow<E>(error: E): Stream<unknown, E, never> {
|
|
|
1282
1369
|
*
|
|
1283
1370
|
* @tsplus static fncts.io.StreamOps fail
|
|
1284
1371
|
*/
|
|
1285
|
-
export function fail<E>(error: Lazy<E
|
|
1372
|
+
export function fail<E>(error: Lazy<E>, __tsplusTrace?: string): Stream<never, E, never> {
|
|
1286
1373
|
return new Stream(Channel.fail(error));
|
|
1287
1374
|
}
|
|
1288
1375
|
|
|
@@ -1291,7 +1378,7 @@ export function fail<E>(error: Lazy<E>): Stream<unknown, E, never> {
|
|
|
1291
1378
|
*
|
|
1292
1379
|
* @tsplus static fncts.io.StreamOps failCauseNow
|
|
1293
1380
|
*/
|
|
1294
|
-
export function failCauseNow<E>(cause: Cause<E
|
|
1381
|
+
export function failCauseNow<E>(cause: Cause<E>, __tsplusTrace?: string): Stream<never, E, never> {
|
|
1295
1382
|
return Stream.fromIO(IO.failCauseNow(cause));
|
|
1296
1383
|
}
|
|
1297
1384
|
|
|
@@ -1300,7 +1387,7 @@ export function failCauseNow<E>(cause: Cause<E>): Stream<unknown, E, never> {
|
|
|
1300
1387
|
*
|
|
1301
1388
|
* @tsplus static fncts.io.StreamOps failCause
|
|
1302
1389
|
*/
|
|
1303
|
-
export function failCause<E>(cause: Lazy<Cause<E
|
|
1390
|
+
export function failCause<E>(cause: Lazy<Cause<E>>, __tsplusTrace?: string): Stream<never, E, never> {
|
|
1304
1391
|
return Stream.fromIO(IO.failCause(cause));
|
|
1305
1392
|
}
|
|
1306
1393
|
|
|
@@ -1309,7 +1396,11 @@ export function failCause<E>(cause: Lazy<Cause<E>>): Stream<unknown, E, never> {
|
|
|
1309
1396
|
*/
|
|
1310
1397
|
export function filter_<R, E, A, B extends A>(fa: Stream<R, E, A>, refinement: Refinement<A, B>): Stream<R, E, B>;
|
|
1311
1398
|
export function filter_<R, E, A>(fa: Stream<R, E, A>, predicate: Predicate<A>): Stream<R, E, A>;
|
|
1312
|
-
export function filter_<R, E, A>(
|
|
1399
|
+
export function filter_<R, E, A>(
|
|
1400
|
+
fa: Stream<R, E, A>,
|
|
1401
|
+
predicate: Predicate<A>,
|
|
1402
|
+
__tsplusTrace?: string,
|
|
1403
|
+
): Stream<R, E, A> {
|
|
1313
1404
|
return fa.mapChunks((chunk) => chunk.filter(predicate));
|
|
1314
1405
|
}
|
|
1315
1406
|
|
|
@@ -1319,14 +1410,16 @@ export function filter_<R, E, A>(fa: Stream<R, E, A>, predicate: Predicate<A>):
|
|
|
1319
1410
|
export function filterIO_<R, E, A, R1, E1>(
|
|
1320
1411
|
fa: Stream<R, E, A>,
|
|
1321
1412
|
f: (a: A) => IO<R1, E1, boolean>,
|
|
1322
|
-
|
|
1413
|
+
__tsplusTrace?: string,
|
|
1414
|
+
): Stream<R | R1, E | E1, A> {
|
|
1323
1415
|
return new Stream(fa.channel.pipeTo(filterIOLoop(Iterable.empty<A>()[Symbol.iterator](), f)));
|
|
1324
1416
|
}
|
|
1325
1417
|
|
|
1326
1418
|
function filterIOLoop<R, E, A, R1, E1>(
|
|
1327
1419
|
iterator: Iterator<A>,
|
|
1328
1420
|
f: (a: A) => IO<R1, E1, boolean>,
|
|
1329
|
-
|
|
1421
|
+
__tsplusTrace?: string,
|
|
1422
|
+
): Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<A>, unknown> {
|
|
1330
1423
|
const next = iterator.next();
|
|
1331
1424
|
if (next.done) {
|
|
1332
1425
|
return Channel.readWithCause(
|
|
@@ -1348,7 +1441,11 @@ function filterIOLoop<R, E, A, R1, E1>(
|
|
|
1348
1441
|
/**
|
|
1349
1442
|
* @tsplus fluent fncts.io.Stream filterMap
|
|
1350
1443
|
*/
|
|
1351
|
-
export function filterMap_<R, E, A, B>(
|
|
1444
|
+
export function filterMap_<R, E, A, B>(
|
|
1445
|
+
fa: Stream<R, E, A>,
|
|
1446
|
+
f: (a: A) => Maybe<B>,
|
|
1447
|
+
__tsplusTrace?: string,
|
|
1448
|
+
): Stream<R, E, B> {
|
|
1352
1449
|
return fa.mapChunks((chunk) => chunk.filterMap(f));
|
|
1353
1450
|
}
|
|
1354
1451
|
|
|
@@ -1358,14 +1455,16 @@ export function filterMap_<R, E, A, B>(fa: Stream<R, E, A>, f: (a: A) => Maybe<B
|
|
|
1358
1455
|
export function filterMapIO_<R, E, A, R1, E1, B>(
|
|
1359
1456
|
fa: Stream<R, E, A>,
|
|
1360
1457
|
f: (a: A) => IO<R1, E1, Maybe<B>>,
|
|
1361
|
-
|
|
1458
|
+
__tsplusTrace?: string,
|
|
1459
|
+
): Stream<R | R1, E | E1, B> {
|
|
1362
1460
|
return new Stream(fa.channel.pipeTo(filterMapIOLoop<R, E, A, R1, E1, B>(Iterable.empty<A>()[Symbol.iterator](), f)));
|
|
1363
1461
|
}
|
|
1364
1462
|
|
|
1365
1463
|
function filterMapIOLoop<R, E, A, R1, E1, B>(
|
|
1366
1464
|
iterator: Iterator<A>,
|
|
1367
1465
|
f: (a: A) => IO<R1, E1, Maybe<B>>,
|
|
1368
|
-
|
|
1466
|
+
__tsplusTrace?: string,
|
|
1467
|
+
): Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<B>, unknown> {
|
|
1369
1468
|
const next = iterator.next();
|
|
1370
1469
|
if (next.done) {
|
|
1371
1470
|
return Channel.readWithCause(
|
|
@@ -1377,7 +1476,7 @@ function filterMapIOLoop<R, E, A, R1, E1, B>(
|
|
|
1377
1476
|
return Channel.unwrap(
|
|
1378
1477
|
f(next.value).map((b) =>
|
|
1379
1478
|
b.match(
|
|
1380
|
-
() => filterMapIOLoop(iterator, f),
|
|
1479
|
+
() => filterMapIOLoop<R, E, A, R1, E1, B>(iterator, f),
|
|
1381
1480
|
(b) => Channel.writeNow(Conc.single(b)) > filterMapIOLoop<R, E, A, R1, E1, B>(iterator, f),
|
|
1382
1481
|
),
|
|
1383
1482
|
),
|
|
@@ -1390,7 +1489,7 @@ function filterMapIOLoop<R, E, A, R1, E1, B>(
|
|
|
1390
1489
|
*
|
|
1391
1490
|
* @tsplus fluent fncts.io.Stream find
|
|
1392
1491
|
*/
|
|
1393
|
-
export function find_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A
|
|
1492
|
+
export function find_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1394
1493
|
const loop: Channel<R, E, Conc<A>, unknown, E, Conc<A>, unknown> = Channel.readWith(
|
|
1395
1494
|
(inp: Conc<A>) =>
|
|
1396
1495
|
inp.find(p).match(
|
|
@@ -1411,8 +1510,9 @@ export function find_<R, E, A>(stream: Stream<R, E, A>, p: Predicate<A>): Stream
|
|
|
1411
1510
|
export function findIO_<R, E, A, R1, E1>(
|
|
1412
1511
|
stream: Stream<R, E, A>,
|
|
1413
1512
|
f: (a: A) => IO<R1, E1, boolean>,
|
|
1414
|
-
|
|
1415
|
-
|
|
1513
|
+
__tsplusTrace?: string,
|
|
1514
|
+
): Stream<R | R1, E | E1, A> {
|
|
1515
|
+
const loop: Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<A>, unknown> = Channel.readWith(
|
|
1416
1516
|
(inp: Conc<A>) =>
|
|
1417
1517
|
Channel.unwrap(
|
|
1418
1518
|
inp.findIO(f).map((maybeA) =>
|
|
@@ -1434,7 +1534,10 @@ export function findIO_<R, E, A, R1, E1>(
|
|
|
1434
1534
|
*
|
|
1435
1535
|
* @tsplus getter fncts.io.Stream flatten
|
|
1436
1536
|
*/
|
|
1437
|
-
export function flatten<R, E, R1, E1, A>(
|
|
1537
|
+
export function flatten<R, E, R1, E1, A>(
|
|
1538
|
+
self: Stream<R, E, Stream<R1, E1, A>>,
|
|
1539
|
+
__tsplusTrace?: string,
|
|
1540
|
+
): Stream<R | R1, E | E1, A> {
|
|
1438
1541
|
return self.flatMap(identity);
|
|
1439
1542
|
}
|
|
1440
1543
|
|
|
@@ -1445,7 +1548,10 @@ export function flatten<R, E, R1, E1, A>(self: Stream<R, E, Stream<R1, E1, A>>):
|
|
|
1445
1548
|
*
|
|
1446
1549
|
* @tsplus getter fncts.io.Stream flattenExitOption
|
|
1447
1550
|
*/
|
|
1448
|
-
export function flattenExitOption<R, E, E1, A>(
|
|
1551
|
+
export function flattenExitOption<R, E, E1, A>(
|
|
1552
|
+
stream: Stream<R, E, Exit<Maybe<E1>, A>>,
|
|
1553
|
+
__tsplusTrace?: string,
|
|
1554
|
+
): Stream<R, E | E1, A> {
|
|
1449
1555
|
const processChunk = (
|
|
1450
1556
|
chunk: Conc<Exit<Maybe<E1>, A>>,
|
|
1451
1557
|
cont: Channel<R, E, Conc<Exit<Maybe<E1>, A>>, unknown, E | E1, Conc<A>, any>,
|
|
@@ -1477,7 +1583,10 @@ export function flattenExitOption<R, E, E1, A>(stream: Stream<R, E, Exit<Maybe<E
|
|
|
1477
1583
|
*
|
|
1478
1584
|
* @tsplus getter fncts.io.Stream flattenTake
|
|
1479
1585
|
*/
|
|
1480
|
-
export function flattenTake<R, E, E1, A>(
|
|
1586
|
+
export function flattenTake<R, E, E1, A>(
|
|
1587
|
+
stream: Stream<R, E, Take<E1, A>>,
|
|
1588
|
+
__tsplusTrace?: string,
|
|
1589
|
+
): Stream<R, E | E1, A> {
|
|
1481
1590
|
return stream.map((take) => take.exit).flattenExitOption.flattenChunks;
|
|
1482
1591
|
}
|
|
1483
1592
|
|
|
@@ -1487,7 +1596,7 @@ export function flattenTake<R, E, E1, A>(stream: Stream<R, E, Take<E1, A>>): Str
|
|
|
1487
1596
|
*
|
|
1488
1597
|
* @tsplus getter fncts.io.Stream flattenChunks
|
|
1489
1598
|
*/
|
|
1490
|
-
export function flattenChunks<R, E, A>(stream: Stream<R, E, Conc<A
|
|
1599
|
+
export function flattenChunks<R, E, A>(stream: Stream<R, E, Conc<A>>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1491
1600
|
return new Stream(stream.channel.mapOut((c) => c.flatten));
|
|
1492
1601
|
}
|
|
1493
1602
|
|
|
@@ -1496,7 +1605,7 @@ export function flattenChunks<R, E, A>(stream: Stream<R, E, Conc<A>>): Stream<R,
|
|
|
1496
1605
|
*
|
|
1497
1606
|
* @tsplus getter fncts.io.Stream forever
|
|
1498
1607
|
*/
|
|
1499
|
-
export function forever<R, E, A>(stream: Stream<R, E, A
|
|
1608
|
+
export function forever<R, E, A>(stream: Stream<R, E, A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1500
1609
|
return new Stream(stream.channel.repeated);
|
|
1501
1610
|
}
|
|
1502
1611
|
|
|
@@ -1505,7 +1614,7 @@ export function forever<R, E, A>(stream: Stream<R, E, A>): Stream<R, E, A> {
|
|
|
1505
1614
|
*
|
|
1506
1615
|
* @tsplus static fncts.io.StreamOps fromChunkNow
|
|
1507
1616
|
*/
|
|
1508
|
-
export function fromChunkNow<O>(c: Conc<O
|
|
1617
|
+
export function fromChunkNow<O>(c: Conc<O>, __tsplusTrace?: string): Stream<never, never, O> {
|
|
1509
1618
|
return new Stream(Channel.defer(() => (c.isEmpty ? Channel.unit : Channel.writeNow(c))));
|
|
1510
1619
|
}
|
|
1511
1620
|
|
|
@@ -1514,7 +1623,7 @@ export function fromChunkNow<O>(c: Conc<O>): Stream<unknown, never, O> {
|
|
|
1514
1623
|
*
|
|
1515
1624
|
* @tsplus static fncts.io.StreamOps fromChunk
|
|
1516
1625
|
*/
|
|
1517
|
-
export function fromChunk<O>(c: Lazy<Conc<O
|
|
1626
|
+
export function fromChunk<O>(c: Lazy<Conc<O>>, __tsplusTrace?: string): Stream<never, never, O> {
|
|
1518
1627
|
return new Stream(Channel.unwrap(IO.succeedNow(Channel.write(c))));
|
|
1519
1628
|
}
|
|
1520
1629
|
|
|
@@ -1523,7 +1632,7 @@ export function fromChunk<O>(c: Lazy<Conc<O>>): Stream<unknown, never, O> {
|
|
|
1523
1632
|
*
|
|
1524
1633
|
* @tsplus static fncts.io.StreamOps scoped
|
|
1525
1634
|
*/
|
|
1526
|
-
export function scoped<R, E, A>(stream: IO<R
|
|
1635
|
+
export function scoped<R, E, A>(stream: IO<R, E, A>, __tsplusTrace?: string): Stream<Exclude<R, Scope>, E, A> {
|
|
1527
1636
|
return new Stream(Channel.scoped(stream.map(Conc.single)));
|
|
1528
1637
|
}
|
|
1529
1638
|
|
|
@@ -1532,7 +1641,7 @@ export function scoped<R, E, A>(stream: IO<R & Has<Scope>, E, A>): Stream<R, E,
|
|
|
1532
1641
|
*
|
|
1533
1642
|
* @tsplus static fncts.io.StreamOps fromIO
|
|
1534
1643
|
*/
|
|
1535
|
-
export function fromIO<R, E, A>(fa: IO<R, E, A
|
|
1644
|
+
export function fromIO<R, E, A>(fa: IO<R, E, A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1536
1645
|
return Stream.fromIOMaybe(fa.mapError(Maybe.just));
|
|
1537
1646
|
}
|
|
1538
1647
|
|
|
@@ -1541,7 +1650,7 @@ export function fromIO<R, E, A>(fa: IO<R, E, A>): Stream<R, E, A> {
|
|
|
1541
1650
|
*
|
|
1542
1651
|
* @tsplus static fncts.io.StreamOps fromIOMaybe
|
|
1543
1652
|
*/
|
|
1544
|
-
export function fromIOMaybe<R, E, A>(fa: IO<R, Maybe<E>, A
|
|
1653
|
+
export function fromIOMaybe<R, E, A>(fa: IO<R, Maybe<E>, A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
1545
1654
|
return new Stream(
|
|
1546
1655
|
Channel.unwrap(
|
|
1547
1656
|
fa.match(
|
|
@@ -1554,6 +1663,7 @@ export function fromIOMaybe<R, E, A>(fa: IO<R, Maybe<E>, A>): Stream<R, E, A> {
|
|
|
1554
1663
|
|
|
1555
1664
|
function fromAsyncIterableLoop<A>(
|
|
1556
1665
|
iterator: AsyncIterator<A>,
|
|
1666
|
+
__tsplusTrace?: string,
|
|
1557
1667
|
): Channel<unknown, unknown, unknown, unknown, never, Conc<A>, unknown> {
|
|
1558
1668
|
return Channel.unwrap(
|
|
1559
1669
|
IO.async<unknown, never, Channel<unknown, unknown, unknown, unknown, never, Conc<A>, unknown>>((k) => {
|
|
@@ -1571,14 +1681,18 @@ function fromAsyncIterableLoop<A>(
|
|
|
1571
1681
|
/**
|
|
1572
1682
|
* @tsplus static fncts.io.StreamOps fromAsyncIterable
|
|
1573
1683
|
*/
|
|
1574
|
-
export function fromAsyncIterable<A>(iterable: AsyncIterable<A
|
|
1684
|
+
export function fromAsyncIterable<A>(iterable: AsyncIterable<A>, __tsplusTrace?: string): Stream<unknown, never, A> {
|
|
1575
1685
|
return new Stream(fromAsyncIterableLoop(iterable[Symbol.asyncIterator]()));
|
|
1576
1686
|
}
|
|
1577
1687
|
|
|
1578
1688
|
/**
|
|
1579
1689
|
* @tsplus static fncts.io.StreamOps fromIterable
|
|
1580
1690
|
*/
|
|
1581
|
-
export function fromIterable<A>(
|
|
1691
|
+
export function fromIterable<A>(
|
|
1692
|
+
iterable: Iterable<A>,
|
|
1693
|
+
maxChunkSize = DEFAULT_CHUNK_SIZE,
|
|
1694
|
+
__tsplusTrace?: string,
|
|
1695
|
+
): Stream<unknown, never, A> {
|
|
1582
1696
|
return Stream.unwrap(
|
|
1583
1697
|
IO.succeed(() => {
|
|
1584
1698
|
const loop = (iterator: Iterator<A>): Channel<unknown, unknown, unknown, unknown, never, Conc<A>, unknown> =>
|
|
@@ -1610,7 +1724,7 @@ export function fromIterable<A>(iterable: Iterable<A>, maxChunkSize = DEFAULT_CH
|
|
|
1610
1724
|
/**
|
|
1611
1725
|
* @tsplus static fncts.io.StreamOps fromIterableSingle
|
|
1612
1726
|
*/
|
|
1613
|
-
export function fromIterableSingle<A>(iterable: Iterable<A
|
|
1727
|
+
export function fromIterableSingle<A>(iterable: Iterable<A>, __tsplusTrace?: string): Stream<unknown, never, A> {
|
|
1614
1728
|
return Stream.fromIO(IO.succeed(iterable[Symbol.iterator]())).flatMap((iterator) =>
|
|
1615
1729
|
Stream.repeatIOMaybe(
|
|
1616
1730
|
IO.defer(() => {
|
|
@@ -1628,8 +1742,15 @@ export function fromIterableSingle<A>(iterable: Iterable<A>): Stream<unknown, ne
|
|
|
1628
1742
|
/**
|
|
1629
1743
|
* @tsplus static fncts.io.StreamOps fromPull
|
|
1630
1744
|
*/
|
|
1631
|
-
export function fromPull<R, E, A>(
|
|
1632
|
-
|
|
1745
|
+
export function fromPull<R, E, A>(
|
|
1746
|
+
scopedPull: IO<R, never, IO<R, Maybe<E>, Conc<A>>>,
|
|
1747
|
+
__tsplusTrace?: string,
|
|
1748
|
+
): Stream<Exclude<R, Scope>, E, A> {
|
|
1749
|
+
return Stream.unwrapScoped(scopedPull.map((pull) => Stream.repeatIOChunkMaybe(pull))) as Stream<
|
|
1750
|
+
Exclude<R, Scope>,
|
|
1751
|
+
E,
|
|
1752
|
+
A
|
|
1753
|
+
>;
|
|
1633
1754
|
}
|
|
1634
1755
|
|
|
1635
1756
|
/**
|
|
@@ -1640,6 +1761,7 @@ export function fromPull<R, E, A>(scopedPull: IO<R & Has<Scope>, never, IO<R, Ma
|
|
|
1640
1761
|
export function fromQueue_<R, E, O>(
|
|
1641
1762
|
queue: PQueue<never, R, unknown, E, never, O>,
|
|
1642
1763
|
maxChunkSize: number = DEFAULT_CHUNK_SIZE,
|
|
1764
|
+
__tsplusTrace?: string,
|
|
1643
1765
|
): Stream<R, E, O> {
|
|
1644
1766
|
return repeatIOChunkMaybe(
|
|
1645
1767
|
queue
|
|
@@ -1663,6 +1785,7 @@ export function fromQueue_<R, E, O>(
|
|
|
1663
1785
|
export function fromQueueWithShutdown<R, E, A>(
|
|
1664
1786
|
queue: PQueue<never, R, unknown, E, never, A>,
|
|
1665
1787
|
maxChunkSize: number = DEFAULT_CHUNK_SIZE,
|
|
1788
|
+
__tsplusTrace?: string,
|
|
1666
1789
|
): Stream<R, E, A> {
|
|
1667
1790
|
return Stream.fromQueue(queue, maxChunkSize).ensuring(queue.shutdown);
|
|
1668
1791
|
}
|
|
@@ -1672,7 +1795,7 @@ export function fromQueueWithShutdown<R, E, A>(
|
|
|
1672
1795
|
*
|
|
1673
1796
|
* @tsplus static fncts.io.StreamOps haltNow
|
|
1674
1797
|
*/
|
|
1675
|
-
export function haltNow(u: unknown): Stream<
|
|
1798
|
+
export function haltNow(u: unknown, __tsplusTrace?: string): Stream<never, never, never> {
|
|
1676
1799
|
return new Stream(Channel.halt(u));
|
|
1677
1800
|
}
|
|
1678
1801
|
|
|
@@ -1681,19 +1804,20 @@ export function haltNow(u: unknown): Stream<unknown, never, never> {
|
|
|
1681
1804
|
*
|
|
1682
1805
|
* @tsplus static fncts.io.StreamOps halt
|
|
1683
1806
|
*/
|
|
1684
|
-
export function halt(u: Lazy<unknown
|
|
1807
|
+
export function halt(u: Lazy<unknown>, __tsplusTrace?: string): Stream<never, never, never> {
|
|
1685
1808
|
return new Stream(Channel.halt(u));
|
|
1686
1809
|
}
|
|
1687
1810
|
|
|
1688
|
-
function haltWhenWriter<
|
|
1811
|
+
function haltWhenWriter<E, A, E1>(
|
|
1689
1812
|
fiber: Fiber<E1, any>,
|
|
1690
|
-
|
|
1813
|
+
__tsplusTrace?: string,
|
|
1814
|
+
): Channel<never, E | E1, Conc<A>, unknown, E | E1, Conc<A>, void> {
|
|
1691
1815
|
return Channel.unwrap(
|
|
1692
1816
|
fiber.poll.map((maybeExit) =>
|
|
1693
1817
|
maybeExit.match(
|
|
1694
1818
|
() =>
|
|
1695
1819
|
Channel.readWith(
|
|
1696
|
-
(i: Conc<A>) => Channel.writeNow(i).apSecond(haltWhenWriter<
|
|
1820
|
+
(i: Conc<A>) => Channel.writeNow(i).apSecond(haltWhenWriter<E, A, E1>(fiber)),
|
|
1697
1821
|
Channel.failNow,
|
|
1698
1822
|
() => Channel.unit,
|
|
1699
1823
|
),
|
|
@@ -1715,12 +1839,17 @@ function haltWhenWriter<R, E, A, R1, E1>(
|
|
|
1715
1839
|
*
|
|
1716
1840
|
* @tsplus fluent fncts.io.Stream haltWhen
|
|
1717
1841
|
*/
|
|
1718
|
-
export function haltWhen_<R, E, A, R1, E1>(
|
|
1842
|
+
export function haltWhen_<R, E, A, R1, E1>(
|
|
1843
|
+
fa: Stream<R, E, A>,
|
|
1844
|
+
io: IO<R1, E1, any>,
|
|
1845
|
+
__tsplusTrace?: string,
|
|
1846
|
+
): Stream<R | R1, E | E1, A> {
|
|
1719
1847
|
return new Stream(Channel.unwrapScoped(io.forkScoped.map((fiber) => fa.channel.pipeTo(haltWhenWriter(fiber)))));
|
|
1720
1848
|
}
|
|
1721
1849
|
|
|
1722
1850
|
function haltWhenFutureWriter<R, E, A, E1>(
|
|
1723
1851
|
future: Future<E1, unknown>,
|
|
1852
|
+
__tsplusTrace?: string,
|
|
1724
1853
|
): Channel<R, E | E1, Conc<A>, unknown, E | E1, Conc<A>, void> {
|
|
1725
1854
|
return Channel.unwrap(
|
|
1726
1855
|
future.poll.map((maybeIO) =>
|
|
@@ -1744,7 +1873,11 @@ function haltWhenFutureWriter<R, E, A, E1>(
|
|
|
1744
1873
|
*
|
|
1745
1874
|
* @tsplus fluent fncts.io.Stream haltWhen
|
|
1746
1875
|
*/
|
|
1747
|
-
export function haltWhenFuture_<R, E, A, E1>(
|
|
1876
|
+
export function haltWhenFuture_<R, E, A, E1>(
|
|
1877
|
+
fa: Stream<R, E, A>,
|
|
1878
|
+
future: Future<E1, any>,
|
|
1879
|
+
__tsplusTrace?: string,
|
|
1880
|
+
): Stream<R, E | E1, A> {
|
|
1748
1881
|
return new Stream(fa.channel.pipeTo(haltWhenFutureWriter(future)));
|
|
1749
1882
|
}
|
|
1750
1883
|
|
|
@@ -1754,11 +1887,15 @@ export function haltWhenFuture_<R, E, A, E1>(fa: Stream<R, E, A>, future: Future
|
|
|
1754
1887
|
export function interleave_<R, E, A, R1, E1, B>(
|
|
1755
1888
|
sa: Stream<R, E, A>,
|
|
1756
1889
|
sb: Stream<R1, E1, B>,
|
|
1757
|
-
|
|
1890
|
+
__tsplusTrace?: string,
|
|
1891
|
+
): Stream<R | R1, E | E1, A | B> {
|
|
1758
1892
|
return sa.interleaveWith(sb, Stream.fromChunk(Conc(true, false)).forever);
|
|
1759
1893
|
}
|
|
1760
1894
|
|
|
1761
|
-
function interleaveWithProducer<
|
|
1895
|
+
function interleaveWithProducer<E, A>(
|
|
1896
|
+
handoff: Handoff<Take<E, A>>,
|
|
1897
|
+
__tsplusTrace?: string,
|
|
1898
|
+
): Channel<never, E, A, unknown, never, never, void> {
|
|
1762
1899
|
return Channel.readWithCause(
|
|
1763
1900
|
(value: A) => Channel.fromIO(handoff.offer(Take.single(value))).apSecond(interleaveWithProducer(handoff)),
|
|
1764
1901
|
(cause) => Channel.fromIO(handoff.offer(Take.failCause(cause))),
|
|
@@ -1780,7 +1917,8 @@ export function interleaveWith_<R, E, A, R1, E1, B, R2, E2>(
|
|
|
1780
1917
|
sa: Stream<R, E, A>,
|
|
1781
1918
|
sb: Stream<R1, E1, B>,
|
|
1782
1919
|
b: Stream<R2, E2, boolean>,
|
|
1783
|
-
|
|
1920
|
+
__tsplusTrace?: string,
|
|
1921
|
+
): Stream<R | R1 | R2, E | E1 | E2, A | B> {
|
|
1784
1922
|
return new Stream(
|
|
1785
1923
|
Channel.unwrapScoped(
|
|
1786
1924
|
Do((Δ) => {
|
|
@@ -1793,7 +1931,7 @@ export function interleaveWith_<R, E, A, R1, E1, B, R2, E2>(
|
|
|
1793
1931
|
const process = (
|
|
1794
1932
|
leftDone: boolean,
|
|
1795
1933
|
rightDone: boolean,
|
|
1796
|
-
): Channel<R
|
|
1934
|
+
): Channel<R | R1 | R2, E | E1 | E2, boolean, unknown, E | E1 | E2, Conc<A | B>, void> =>
|
|
1797
1935
|
Channel.readWithCause(
|
|
1798
1936
|
(b: boolean) => {
|
|
1799
1937
|
if (b && !leftDone) {
|
|
@@ -1824,6 +1962,7 @@ export function interleaveWith_<R, E, A, R1, E1, B, R2, E2>(
|
|
|
1824
1962
|
function intersperseWriter<R, E, A, A1>(
|
|
1825
1963
|
middle: A1,
|
|
1826
1964
|
isFirst: boolean,
|
|
1965
|
+
__tsplusTrace?: string,
|
|
1827
1966
|
): Channel<R, E, Conc<A>, unknown, E, Conc<A | A1>, void> {
|
|
1828
1967
|
return Channel.readWith(
|
|
1829
1968
|
(inp: Conc<A>) => {
|
|
@@ -1848,7 +1987,11 @@ function intersperseWriter<R, E, A, A1>(
|
|
|
1848
1987
|
/**
|
|
1849
1988
|
* Intersperse stream with provided element
|
|
1850
1989
|
*/
|
|
1851
|
-
export function intersperse_<R, E, A, A1>(
|
|
1990
|
+
export function intersperse_<R, E, A, A1>(
|
|
1991
|
+
stream: Stream<R, E, A>,
|
|
1992
|
+
middle: A1,
|
|
1993
|
+
__tsplusTrace?: string,
|
|
1994
|
+
): Stream<R, E, A | A1> {
|
|
1852
1995
|
return new Stream(stream.channel.pipeTo(intersperseWriter(middle, true)));
|
|
1853
1996
|
}
|
|
1854
1997
|
|
|
@@ -1865,7 +2008,8 @@ export function intersperse_<R, E, A, A1>(stream: Stream<R, E, A>, middle: A1):
|
|
|
1865
2008
|
export function interruptWhen_<R, E, A, R1, E1>(
|
|
1866
2009
|
stream: Stream<R, E, A>,
|
|
1867
2010
|
io: IO<R1, E1, any>,
|
|
1868
|
-
|
|
2011
|
+
__tsplusTrace?: string,
|
|
2012
|
+
): Stream<R | R1, E | E1, A> {
|
|
1869
2013
|
return new Stream(stream.channel.interruptWhen(io));
|
|
1870
2014
|
}
|
|
1871
2015
|
|
|
@@ -1875,6 +2019,7 @@ export function interruptWhen_<R, E, A, R1, E1>(
|
|
|
1875
2019
|
export function interruptWhenFuture_<R, E, A, E1>(
|
|
1876
2020
|
fa: Stream<R, E, A>,
|
|
1877
2021
|
future: Future<E1, unknown>,
|
|
2022
|
+
__tsplusTrace?: string,
|
|
1878
2023
|
): Stream<R, E | E1, A> {
|
|
1879
2024
|
return new Stream(fa.channel.interruptWhen(future));
|
|
1880
2025
|
}
|
|
@@ -1884,14 +2029,15 @@ export function interruptWhenFuture_<R, E, A, E1>(
|
|
|
1884
2029
|
*
|
|
1885
2030
|
* @tsplus fluent fncts.io.Stream map
|
|
1886
2031
|
*/
|
|
1887
|
-
export function map_<R, E, A, B>(stream: Stream<R, E, A>, f: (o: A) => B): Stream<R, E, B> {
|
|
2032
|
+
export function map_<R, E, A, B>(stream: Stream<R, E, A>, f: (o: A) => B, __tsplusTrace?: string): Stream<R, E, B> {
|
|
1888
2033
|
return new Stream(stream.channel.mapOut((as) => as.map(f)));
|
|
1889
2034
|
}
|
|
1890
2035
|
|
|
1891
2036
|
function mapAccumAccumulator<S, E = never, A = never, B = never>(
|
|
1892
2037
|
currS: S,
|
|
1893
2038
|
f: (s: S, a: A) => readonly [S, B],
|
|
1894
|
-
|
|
2039
|
+
__tsplusTrace?: string,
|
|
2040
|
+
): Channel<never, E, Conc<A>, unknown, E, Conc<B>, void> {
|
|
1895
2041
|
return Channel.readWith(
|
|
1896
2042
|
(inp: Conc<A>) => {
|
|
1897
2043
|
const [nextS, bs] = inp.mapAccum(currS, f);
|
|
@@ -1911,6 +2057,7 @@ export function mapAccum_<R, E, A, S, B>(
|
|
|
1911
2057
|
stream: Stream<R, E, A>,
|
|
1912
2058
|
s: S,
|
|
1913
2059
|
f: (s: S, a: A) => readonly [S, B],
|
|
2060
|
+
__tsplusTrace?: string,
|
|
1914
2061
|
): Stream<R, E, B> {
|
|
1915
2062
|
return new Stream(stream.channel.pipeTo(mapAccumAccumulator(s, f)));
|
|
1916
2063
|
}
|
|
@@ -1918,7 +2065,8 @@ export function mapAccum_<R, E, A, S, B>(
|
|
|
1918
2065
|
function mapAccumIOAccumulator<R, E, A, R1, E1, S, B>(
|
|
1919
2066
|
s: S,
|
|
1920
2067
|
f: (s: S, a: A) => IO<R1, E1, readonly [B, S]>,
|
|
1921
|
-
|
|
2068
|
+
__tsplusTrace?: string,
|
|
2069
|
+
): Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<B>, void> {
|
|
1922
2070
|
return Channel.readWith(
|
|
1923
2071
|
(inp: Conc<A>) =>
|
|
1924
2072
|
Channel.unwrap(
|
|
@@ -1935,7 +2083,7 @@ function mapAccumIOAccumulator<R, E, A, R1, E1, S, B>(
|
|
|
1935
2083
|
? Channel.writeNow(partialResult).apSecond(Channel.failNow(e))
|
|
1936
2084
|
: Channel.failNow(e);
|
|
1937
2085
|
},
|
|
1938
|
-
(s) => Channel.writeNow(outputChunk.result()).apSecond(mapAccumIOAccumulator(s, f)),
|
|
2086
|
+
(s) => Channel.writeNow(outputChunk.result()).apSecond(mapAccumIOAccumulator<R, E, A, R1, E1, S, B>(s, f)),
|
|
1939
2087
|
);
|
|
1940
2088
|
}),
|
|
1941
2089
|
),
|
|
@@ -1954,7 +2102,8 @@ export function mapAccumIO_<R, E, A, R1, E1, S, B>(
|
|
|
1954
2102
|
stream: Stream<R, E, A>,
|
|
1955
2103
|
s: S,
|
|
1956
2104
|
f: (s: S, a: A) => IO<R1, E1, readonly [B, S]>,
|
|
1957
|
-
|
|
2105
|
+
__tsplusTrace?: string,
|
|
2106
|
+
): Stream<R | R1, E | E1, B> {
|
|
1958
2107
|
return new Stream(stream.channel.pipeTo(mapAccumIOAccumulator(s, f)));
|
|
1959
2108
|
}
|
|
1960
2109
|
|
|
@@ -1963,7 +2112,11 @@ export function mapAccumIO_<R, E, A, R1, E1, S, B>(
|
|
|
1963
2112
|
*
|
|
1964
2113
|
* @tsplus fluent fncts.io.Stream mapChunks
|
|
1965
2114
|
*/
|
|
1966
|
-
export function mapChunks_<R, E, A, A1>(
|
|
2115
|
+
export function mapChunks_<R, E, A, A1>(
|
|
2116
|
+
stream: Stream<R, E, A>,
|
|
2117
|
+
f: (chunk: Conc<A>) => Conc<A1>,
|
|
2118
|
+
__tsplusTrace?: string,
|
|
2119
|
+
): Stream<R, E, A1> {
|
|
1967
2120
|
return new Stream(stream.channel.mapOut(f));
|
|
1968
2121
|
}
|
|
1969
2122
|
|
|
@@ -1975,7 +2128,8 @@ export function mapChunks_<R, E, A, A1>(stream: Stream<R, E, A>, f: (chunk: Conc
|
|
|
1975
2128
|
export function mapChunksIO_<R, E, A, R1, E1, B>(
|
|
1976
2129
|
stream: Stream<R, E, A>,
|
|
1977
2130
|
f: (chunk: Conc<A>) => IO<R1, E1, Conc<B>>,
|
|
1978
|
-
|
|
2131
|
+
__tsplusTrace?: string,
|
|
2132
|
+
): Stream<R | R1, E | E1, B> {
|
|
1979
2133
|
return new Stream(stream.channel.mapOutIO(f));
|
|
1980
2134
|
}
|
|
1981
2135
|
|
|
@@ -1985,7 +2139,11 @@ export function mapChunksIO_<R, E, A, R1, E1, B>(
|
|
|
1985
2139
|
*
|
|
1986
2140
|
* @tsplus fluent fncts.io.Stream mapConcat
|
|
1987
2141
|
*/
|
|
1988
|
-
export function mapConcat_<R, E, A, B>(
|
|
2142
|
+
export function mapConcat_<R, E, A, B>(
|
|
2143
|
+
stream: Stream<R, E, A>,
|
|
2144
|
+
f: (a: A) => Iterable<B>,
|
|
2145
|
+
__tsplusTrace?: string,
|
|
2146
|
+
): Stream<R, E, B> {
|
|
1989
2147
|
return stream.mapConcatChunk((a) => Conc.from(f(a)));
|
|
1990
2148
|
}
|
|
1991
2149
|
|
|
@@ -1995,7 +2153,11 @@ export function mapConcat_<R, E, A, B>(stream: Stream<R, E, A>, f: (a: A) => Ite
|
|
|
1995
2153
|
*
|
|
1996
2154
|
* @tsplus fluent fncts.io.Stream mapConcatChunk
|
|
1997
2155
|
*/
|
|
1998
|
-
export function mapConcatChunk_<R, E, A, B>(
|
|
2156
|
+
export function mapConcatChunk_<R, E, A, B>(
|
|
2157
|
+
stream: Stream<R, E, A>,
|
|
2158
|
+
f: (a: A) => Conc<B>,
|
|
2159
|
+
__tsplusTrace?: string,
|
|
2160
|
+
): Stream<R, E, B> {
|
|
1999
2161
|
return stream.mapChunks((c) => c.flatMap(f));
|
|
2000
2162
|
}
|
|
2001
2163
|
|
|
@@ -2008,7 +2170,8 @@ export function mapConcatChunk_<R, E, A, B>(stream: Stream<R, E, A>, f: (a: A) =
|
|
|
2008
2170
|
export function mapConcatChunkIO_<R, E, A, R1, E1, B>(
|
|
2009
2171
|
stream: Stream<R, E, A>,
|
|
2010
2172
|
f: (a: A) => IO<R1, E1, Conc<B>>,
|
|
2011
|
-
|
|
2173
|
+
__tsplusTrace?: string,
|
|
2174
|
+
): Stream<R | R1, E | E1, B> {
|
|
2012
2175
|
return stream.mapIO(f).mapConcatChunk(identity);
|
|
2013
2176
|
}
|
|
2014
2177
|
|
|
@@ -2021,7 +2184,8 @@ export function mapConcatChunkIO_<R, E, A, R1, E1, B>(
|
|
|
2021
2184
|
export function mapConcatIO_<R, E, A, R1, E1, B>(
|
|
2022
2185
|
stream: Stream<R, E, A>,
|
|
2023
2186
|
f: (a: A) => IO<R1, E1, Iterable<B>>,
|
|
2024
|
-
|
|
2187
|
+
__tsplusTrace?: string,
|
|
2188
|
+
): Stream<R | R1, E | E1, B> {
|
|
2025
2189
|
return stream.mapIO((a) => f(a).map(Conc.from)).mapConcatChunk(identity);
|
|
2026
2190
|
}
|
|
2027
2191
|
|
|
@@ -2030,7 +2194,11 @@ export function mapConcatIO_<R, E, A, R1, E1, B>(
|
|
|
2030
2194
|
*
|
|
2031
2195
|
* @tsplus fluent fncts.io.Stream mapError
|
|
2032
2196
|
*/
|
|
2033
|
-
export function mapError_<R, E, E1, A>(
|
|
2197
|
+
export function mapError_<R, E, E1, A>(
|
|
2198
|
+
stream: Stream<R, E, A>,
|
|
2199
|
+
f: (e: E) => E1,
|
|
2200
|
+
__tsplusTrace?: string,
|
|
2201
|
+
): Stream<R, E1, A> {
|
|
2034
2202
|
return new Stream(stream.channel.mapError(f));
|
|
2035
2203
|
}
|
|
2036
2204
|
|
|
@@ -2039,7 +2207,11 @@ export function mapError_<R, E, E1, A>(stream: Stream<R, E, A>, f: (e: E) => E1)
|
|
|
2039
2207
|
*
|
|
2040
2208
|
* @tsplus fluent fncts.io.Stream mapErrorCause
|
|
2041
2209
|
*/
|
|
2042
|
-
export function mapErrorCause_<R, E, A, E1>(
|
|
2210
|
+
export function mapErrorCause_<R, E, A, E1>(
|
|
2211
|
+
fa: Stream<R, E, A>,
|
|
2212
|
+
f: (e: Cause<E>) => Cause<E1>,
|
|
2213
|
+
__tsplusTrace?: string,
|
|
2214
|
+
): Stream<R, E1, A> {
|
|
2043
2215
|
return new Stream(fa.channel.mapErrorCause(f));
|
|
2044
2216
|
}
|
|
2045
2217
|
|
|
@@ -2051,14 +2223,16 @@ export function mapErrorCause_<R, E, A, E1>(fa: Stream<R, E, A>, f: (e: Cause<E>
|
|
|
2051
2223
|
export function mapIO_<R, E, A, R1, E1, B>(
|
|
2052
2224
|
stream: Stream<R, E, A>,
|
|
2053
2225
|
f: (a: A) => IO<R1, E1, B>,
|
|
2054
|
-
|
|
2226
|
+
__tsplusTrace?: string,
|
|
2227
|
+
): Stream<R | R1, E | E1, B> {
|
|
2055
2228
|
return new Stream(stream.channel.pipeTo(mapIOLoop(Iterable.empty<A>()[Symbol.iterator](), f)));
|
|
2056
2229
|
}
|
|
2057
2230
|
|
|
2058
2231
|
function mapIOLoop<R, E, A, R1, E1, B>(
|
|
2059
2232
|
iterator: Iterator<A>,
|
|
2060
2233
|
f: (a: A) => IO<R1, E1, B>,
|
|
2061
|
-
|
|
2234
|
+
__tsplusTrace?: string,
|
|
2235
|
+
): Channel<R | R1, E, Conc<A>, unknown, E | E1, Conc<B>, unknown> {
|
|
2062
2236
|
const next = iterator.next();
|
|
2063
2237
|
if (next.done) {
|
|
2064
2238
|
return Channel.readWithCause(
|
|
@@ -2086,7 +2260,8 @@ export function mapIOC_<R, E, A, R1, E1, B>(
|
|
|
2086
2260
|
stream: Stream<R, E, A>,
|
|
2087
2261
|
n: number,
|
|
2088
2262
|
f: (a: A) => IO<R1, E1, B>,
|
|
2089
|
-
|
|
2263
|
+
__tsplusTrace?: string,
|
|
2264
|
+
): Stream<R | R1, E | E1, B> {
|
|
2090
2265
|
return new Stream(stream.channel.concatMap(Channel.writeChunk).mapOutIOC(n, f).mapOut(Conc.single));
|
|
2091
2266
|
}
|
|
2092
2267
|
|
|
@@ -2103,7 +2278,8 @@ export function mergeMap_<R, E, A, R1, E1, B>(
|
|
|
2103
2278
|
f: (a: A) => Stream<R1, E1, B>,
|
|
2104
2279
|
n: number,
|
|
2105
2280
|
bufferSize = 16,
|
|
2106
|
-
|
|
2281
|
+
__tsplusTrace?: string,
|
|
2282
|
+
): Stream<R | R1, E | E1, B> {
|
|
2107
2283
|
return new Stream(ma.channel.concatMap(Channel.writeChunk).mergeMap((a) => f(a).channel, n, bufferSize));
|
|
2108
2284
|
}
|
|
2109
2285
|
|
|
@@ -2119,7 +2295,8 @@ export function mergeMapIO_<R, E, A, R1, E1, B>(
|
|
|
2119
2295
|
f: (a: A) => IO<R1, E1, B>,
|
|
2120
2296
|
n: number,
|
|
2121
2297
|
bufferSize = 16,
|
|
2122
|
-
|
|
2298
|
+
__tsplusTrace?: string,
|
|
2299
|
+
): Stream<R | R1, E | E1, B> {
|
|
2123
2300
|
return stream.mergeMap((a) => Stream.fromIO(f(a)), n, bufferSize);
|
|
2124
2301
|
}
|
|
2125
2302
|
|
|
@@ -2129,12 +2306,14 @@ export function mergeMapIO_<R, E, A, R1, E1, B>(
|
|
|
2129
2306
|
export function mergeEither_<R, E, A, R1, E1, B>(
|
|
2130
2307
|
fa: Stream<R, E, A>,
|
|
2131
2308
|
fb: Stream<R1, E1, B>,
|
|
2132
|
-
|
|
2309
|
+
__tsplusTrace?: string,
|
|
2310
|
+
): Stream<R | R1, E | E1, Either<A, B>> {
|
|
2133
2311
|
return fa.mergeWith(fb, Either.left, Either.right);
|
|
2134
2312
|
}
|
|
2135
2313
|
|
|
2136
2314
|
export function mergeWithHandler<R, E>(
|
|
2137
2315
|
terminate: boolean,
|
|
2316
|
+
__tsplusTrace?: string,
|
|
2138
2317
|
): (exit: Exit<E, unknown>) => MergeDecision<R, E, unknown, E, unknown> {
|
|
2139
2318
|
return (exit) =>
|
|
2140
2319
|
terminate || !exit.isSuccess() ? MergeDecision.Done(IO.fromExitNow(exit)) : MergeDecision.Await(IO.fromExitNow);
|
|
@@ -2151,8 +2330,9 @@ export function mergeWith_<R, E, A, R1, E1, A1, B, C>(
|
|
|
2151
2330
|
l: (a: A) => B,
|
|
2152
2331
|
r: (b: A1) => C,
|
|
2153
2332
|
strategy: TerminationStrategy = "Both",
|
|
2154
|
-
|
|
2155
|
-
|
|
2333
|
+
__tsplusTrace?: string,
|
|
2334
|
+
): Stream<R | R1, E | E1, B | C> {
|
|
2335
|
+
return new Stream<R | R1, E | E1, B | C>(
|
|
2156
2336
|
sa
|
|
2157
2337
|
.map(l)
|
|
2158
2338
|
.channel.mergeWith(
|
|
@@ -2173,7 +2353,8 @@ export function mergeWith_<R, E, A, R1, E1, A1, B, C>(
|
|
|
2173
2353
|
export function onError_<R, E, A, R1>(
|
|
2174
2354
|
stream: Stream<R, E, A>,
|
|
2175
2355
|
cleanup: (e: Cause<E>) => IO<R1, never, any>,
|
|
2176
|
-
|
|
2356
|
+
__tsplusTrace?: string,
|
|
2357
|
+
): Stream<R | R1, E, A> {
|
|
2177
2358
|
return stream.catchAllCause((cause) => fromIO(cleanup(cause).apSecond(IO.failCauseNow(cause))));
|
|
2178
2359
|
}
|
|
2179
2360
|
|
|
@@ -2187,8 +2368,9 @@ export function onError_<R, E, A, R1>(
|
|
|
2187
2368
|
export function orElse_<R, E, A, R1, E1, A1>(
|
|
2188
2369
|
stream: Stream<R, E, A>,
|
|
2189
2370
|
that: Lazy<Stream<R1, E1, A1>>,
|
|
2190
|
-
|
|
2191
|
-
|
|
2371
|
+
__tsplusTrace?: string,
|
|
2372
|
+
): Stream<R | R1, E1, A | A1> {
|
|
2373
|
+
return new Stream<R | R1, E1, A | A1>(stream.channel.orElse(that().channel));
|
|
2192
2374
|
}
|
|
2193
2375
|
|
|
2194
2376
|
/**
|
|
@@ -2201,7 +2383,8 @@ export function orElse_<R, E, A, R1, E1, A1>(
|
|
|
2201
2383
|
export function orElseEither_<R, E, A, R1, E1, A1>(
|
|
2202
2384
|
stream: Stream<R, E, A>,
|
|
2203
2385
|
that: Lazy<Stream<R1, E1, A1>>,
|
|
2204
|
-
|
|
2386
|
+
__tsplusTrace?: string,
|
|
2387
|
+
): Stream<R | R1, E1, Either<A, A1>> {
|
|
2205
2388
|
return stream.map(Either.left).orElse(that().map(Either.right));
|
|
2206
2389
|
}
|
|
2207
2390
|
|
|
@@ -2212,7 +2395,11 @@ export function orElseEither_<R, E, A, R1, E1, A1>(
|
|
|
2212
2395
|
*
|
|
2213
2396
|
* @tsplus fluent fncts.io.Stream orElseFail
|
|
2214
2397
|
*/
|
|
2215
|
-
export function orElseFail_<R, E, A, E1>(
|
|
2398
|
+
export function orElseFail_<R, E, A, E1>(
|
|
2399
|
+
stream: Stream<R, E, A>,
|
|
2400
|
+
e: Lazy<E1>,
|
|
2401
|
+
__tsplusTrace?: string,
|
|
2402
|
+
): Stream<R, E1, A> {
|
|
2216
2403
|
return stream.orElse(Stream.failNow(e()));
|
|
2217
2404
|
}
|
|
2218
2405
|
|
|
@@ -2224,7 +2411,8 @@ export function orElseFail_<R, E, A, E1>(stream: Stream<R, E, A>, e: Lazy<E1>):
|
|
|
2224
2411
|
export function orElseOptional_<R, E, A, R1, E1, A1>(
|
|
2225
2412
|
stream: Stream<R, Maybe<E>, A>,
|
|
2226
2413
|
that: Lazy<Stream<R1, Maybe<E1>, A1>>,
|
|
2227
|
-
|
|
2414
|
+
__tsplusTrace?: string,
|
|
2415
|
+
): Stream<R | R1, Maybe<E | E1>, A | A1> {
|
|
2228
2416
|
return stream.catchAll((maybeError) =>
|
|
2229
2417
|
maybeError.match(
|
|
2230
2418
|
() => that(),
|
|
@@ -2238,7 +2426,11 @@ export function orElseOptional_<R, E, A, R1, E1, A1>(
|
|
|
2238
2426
|
*
|
|
2239
2427
|
* @tsplus fluent fncts.io.Stream orElseSucceed
|
|
2240
2428
|
*/
|
|
2241
|
-
export function orElseSucceed_<R, E, A, A1>(
|
|
2429
|
+
export function orElseSucceed_<R, E, A, A1>(
|
|
2430
|
+
stream: Stream<R, E, A>,
|
|
2431
|
+
a: Lazy<A1>,
|
|
2432
|
+
__tsplusTrace?: string,
|
|
2433
|
+
): Stream<R, never, A | A1> {
|
|
2242
2434
|
return stream.orElse(Stream.succeedNow(a()));
|
|
2243
2435
|
}
|
|
2244
2436
|
|
|
@@ -2248,7 +2440,8 @@ export function orElseSucceed_<R, E, A, A1>(stream: Stream<R, E, A>, a: Lazy<A1>
|
|
|
2248
2440
|
export function pipeThrough_<R, E, A, R1, E1, L, Z>(
|
|
2249
2441
|
ma: Stream<R, E, A>,
|
|
2250
2442
|
sa: Sink<R1, E1, A, L, Z>,
|
|
2251
|
-
|
|
2443
|
+
__tsplusTrace?: string,
|
|
2444
|
+
): Stream<R | R1, E | E1, L> {
|
|
2252
2445
|
return new Stream(ma.channel.pipeToOrFail(sa.channel));
|
|
2253
2446
|
}
|
|
2254
2447
|
|
|
@@ -2258,7 +2451,11 @@ export function pipeThrough_<R, E, A, R1, E1, L, Z>(
|
|
|
2258
2451
|
*
|
|
2259
2452
|
* @tsplus fluent fncts.io.Stream provideEnvironment
|
|
2260
2453
|
*/
|
|
2261
|
-
export function provideEnvironment_<R, E, A>(
|
|
2454
|
+
export function provideEnvironment_<R, E, A>(
|
|
2455
|
+
ra: Stream<R, E, A>,
|
|
2456
|
+
r: Environment<R>,
|
|
2457
|
+
__tsplusTrace?: string,
|
|
2458
|
+
): Stream<never, E, A> {
|
|
2262
2459
|
return new Stream(ra.channel.provideEnvironment(r));
|
|
2263
2460
|
}
|
|
2264
2461
|
|
|
@@ -2280,7 +2477,7 @@ export function provideSomeLayer_<R, E, A, RIn, E1, ROut>(
|
|
|
2280
2477
|
self: Stream<R, E, A>,
|
|
2281
2478
|
layer: Layer<RIn, E1, ROut>,
|
|
2282
2479
|
__tsplusTrace?: string,
|
|
2283
|
-
): Stream<RIn
|
|
2480
|
+
): Stream<RIn | Exclude<R, ROut>, E | E1, A> {
|
|
2284
2481
|
// @ts-expect-error
|
|
2285
2482
|
return self.provideLayer(Layer.environment<RIn>().and(layer));
|
|
2286
2483
|
}
|
|
@@ -2306,7 +2503,7 @@ class Rechunker<A> {
|
|
|
2306
2503
|
return null;
|
|
2307
2504
|
}
|
|
2308
2505
|
|
|
2309
|
-
emitOfNotEmpty(): Channel<
|
|
2506
|
+
emitOfNotEmpty(): Channel<never, unknown, unknown, unknown, never, Conc<A>, void> {
|
|
2310
2507
|
if (this.pos !== 0) {
|
|
2311
2508
|
return Channel.writeNow(Conc.from(this.builder));
|
|
2312
2509
|
} else {
|
|
@@ -2323,7 +2520,8 @@ class Rechunker<A> {
|
|
|
2323
2520
|
function rechunkProcess<E, In>(
|
|
2324
2521
|
rechunker: Rechunker<In>,
|
|
2325
2522
|
target: number,
|
|
2326
|
-
|
|
2523
|
+
__tsplusTrace?: string,
|
|
2524
|
+
): Channel<never, E, Conc<In>, unknown, E, Conc<In>, unknown> {
|
|
2327
2525
|
return Channel.readWithCause(
|
|
2328
2526
|
(chunk: Conc<In>) => {
|
|
2329
2527
|
if (chunk.length === target && rechunker.isEmpty) {
|
|
@@ -2360,7 +2558,7 @@ function rechunkProcess<E, In>(
|
|
|
2360
2558
|
*
|
|
2361
2559
|
* @tsplus fluent fncts.io.Stream rechunk
|
|
2362
2560
|
*/
|
|
2363
|
-
export function rechunk_<R, E, A>(stream: Stream<R, E, A>, n: number): Stream<R, E, A> {
|
|
2561
|
+
export function rechunk_<R, E, A>(stream: Stream<R, E, A>, n: number, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2364
2562
|
return new Stream(stream.channel.pipeTo(rechunkProcess(new Rechunker(n), n)));
|
|
2365
2563
|
}
|
|
2366
2564
|
|
|
@@ -2369,7 +2567,7 @@ export function rechunk_<R, E, A>(stream: Stream<R, E, A>, n: number): Stream<R,
|
|
|
2369
2567
|
*
|
|
2370
2568
|
* @tsplus static fncts.io.StreamOps repeatValue
|
|
2371
2569
|
*/
|
|
2372
|
-
export function repeatValue<A>(a: A): Stream<unknown, never, A> {
|
|
2570
|
+
export function repeatValue<A>(a: A, __tsplusTrace?: string): Stream<unknown, never, A> {
|
|
2373
2571
|
return new Stream(Channel.writeNow(Conc.single(a)).repeated);
|
|
2374
2572
|
}
|
|
2375
2573
|
|
|
@@ -2378,7 +2576,7 @@ export function repeatValue<A>(a: A): Stream<unknown, never, A> {
|
|
|
2378
2576
|
*
|
|
2379
2577
|
* @tsplus static fncts.io.StreamOps repeatIO
|
|
2380
2578
|
*/
|
|
2381
|
-
export function repeatIO<R, E, A>(fa: IO<R, E, A
|
|
2579
|
+
export function repeatIO<R, E, A>(fa: IO<R, E, A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2382
2580
|
return Stream.repeatIOMaybe(fa.mapError(Maybe.just));
|
|
2383
2581
|
}
|
|
2384
2582
|
|
|
@@ -2387,7 +2585,7 @@ export function repeatIO<R, E, A>(fa: IO<R, E, A>): Stream<R, E, A> {
|
|
|
2387
2585
|
*
|
|
2388
2586
|
* @tsplus static fncts.io.StreamOps repeatIOMaybe
|
|
2389
2587
|
*/
|
|
2390
|
-
export function repeatIOMaybe<R, E, A>(fa: IO<R, Maybe<E>, A
|
|
2588
|
+
export function repeatIOMaybe<R, E, A>(fa: IO<R, Maybe<E>, A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2391
2589
|
return repeatIOChunkMaybe(fa.map(Conc.single));
|
|
2392
2590
|
}
|
|
2393
2591
|
|
|
@@ -2396,7 +2594,7 @@ export function repeatIOMaybe<R, E, A>(fa: IO<R, Maybe<E>, A>): Stream<R, E, A>
|
|
|
2396
2594
|
*
|
|
2397
2595
|
* @tsplus static fncts.io.StreamOps repeatIOChunk
|
|
2398
2596
|
*/
|
|
2399
|
-
export function repeatIOChunk<R, E, A>(fa: IO<R, E, Conc<A
|
|
2597
|
+
export function repeatIOChunk<R, E, A>(fa: IO<R, E, Conc<A>>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2400
2598
|
return repeatIOChunkMaybe(fa.mapError(Maybe.just));
|
|
2401
2599
|
}
|
|
2402
2600
|
|
|
@@ -2405,7 +2603,7 @@ export function repeatIOChunk<R, E, A>(fa: IO<R, E, Conc<A>>): Stream<R, E, A> {
|
|
|
2405
2603
|
*
|
|
2406
2604
|
* @tsplus static fncts.io.StreamOps repeatIOChunkMaybe
|
|
2407
2605
|
*/
|
|
2408
|
-
export function repeatIOChunkMaybe<R, E, A>(fa: IO<R, Maybe<E>, Conc<A
|
|
2606
|
+
export function repeatIOChunkMaybe<R, E, A>(fa: IO<R, Maybe<E>, Conc<A>>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2409
2607
|
return Stream.unfoldChunkIO(undefined, (_) =>
|
|
2410
2608
|
fa
|
|
2411
2609
|
.map((chunk) => Maybe.just(tuple(chunk, undefined)))
|
|
@@ -2421,7 +2619,8 @@ export function repeatIOChunkMaybe<R, E, A>(fa: IO<R, Maybe<E>, Conc<A>>): Strea
|
|
|
2421
2619
|
export function run_<R, E, A, R2, E2, Z>(
|
|
2422
2620
|
stream: Stream<R, E, A>,
|
|
2423
2621
|
sink: Sink<R2, E2, A, unknown, Z>,
|
|
2424
|
-
|
|
2622
|
+
__tsplusTrace?: string,
|
|
2623
|
+
): IO<R | R2, E | E2, Z> {
|
|
2425
2624
|
return stream.channel.pipeToOrFail(sink.channel).runDrain;
|
|
2426
2625
|
}
|
|
2427
2626
|
|
|
@@ -2430,7 +2629,7 @@ export function run_<R, E, A, R2, E2, Z>(
|
|
|
2430
2629
|
*
|
|
2431
2630
|
* @tsplus getter fncts.io.Stream runCollect
|
|
2432
2631
|
*/
|
|
2433
|
-
export function runCollect<R, E, A>(stream: Stream<R, E, A
|
|
2632
|
+
export function runCollect<R, E, A>(stream: Stream<R, E, A>, __tsplusTrace?: string): IO<R, E, Conc<A>> {
|
|
2434
2633
|
return stream.run(Sink.collectAll());
|
|
2435
2634
|
}
|
|
2436
2635
|
|
|
@@ -2439,7 +2638,7 @@ export function runCollect<R, E, A>(stream: Stream<R, E, A>): IO<R, E, Conc<A>>
|
|
|
2439
2638
|
*
|
|
2440
2639
|
* @tsplus getter fncts.io.Stream runDrain
|
|
2441
2640
|
*/
|
|
2442
|
-
export function runDrain<R, E, A>(stream: Stream<R, E, A
|
|
2641
|
+
export function runDrain<R, E, A>(stream: Stream<R, E, A>, __tsplusTrace?: string): IO<R, E, void> {
|
|
2443
2642
|
return stream.run(Sink.drain);
|
|
2444
2643
|
}
|
|
2445
2644
|
|
|
@@ -2449,7 +2648,8 @@ export function runDrain<R, E, A>(stream: Stream<R, E, A>): IO<R, E, void> {
|
|
|
2449
2648
|
export function runForeachScoped_<R, E, A, R2, E2>(
|
|
2450
2649
|
self: Stream<R, E, A>,
|
|
2451
2650
|
f: (a: A) => IO<R2, E2, any>,
|
|
2452
|
-
|
|
2651
|
+
__tsplusTrace?: string,
|
|
2652
|
+
): IO<R | R2 | Scope, E | E2, void> {
|
|
2453
2653
|
return self.runScoped(Sink.foreach(f));
|
|
2454
2654
|
}
|
|
2455
2655
|
|
|
@@ -2462,8 +2662,9 @@ export function runForeachScoped_<R, E, A, R2, E2>(
|
|
|
2462
2662
|
export function runIntoElementsScoped_<R, E, A, R1, E1>(
|
|
2463
2663
|
stream: Stream<R, E, A>,
|
|
2464
2664
|
queue: PQueue<R1, unknown, never, never, Exit<Maybe<E | E1>, A>, unknown>,
|
|
2465
|
-
|
|
2466
|
-
|
|
2665
|
+
__tsplusTrace?: string,
|
|
2666
|
+
): IO<R | R1 | Scope, E | E1, void> {
|
|
2667
|
+
const writer: Channel<R | R1, E, Conc<A>, unknown, never, Exit<Maybe<E | E1>, A>, unknown> = Channel.readWith(
|
|
2467
2668
|
(inp: Conc<A>) =>
|
|
2468
2669
|
inp
|
|
2469
2670
|
.foldLeft(
|
|
@@ -2486,7 +2687,8 @@ export function runIntoElementsScoped_<R, E, A, R1, E1>(
|
|
|
2486
2687
|
export function runIntoQueueScoped_<R, R1, E extends E1, E1, A>(
|
|
2487
2688
|
stream: Stream<R, E, A>,
|
|
2488
2689
|
queue: PQueue<R1, never, never, unknown, Take<E1, A>, any>,
|
|
2489
|
-
|
|
2690
|
+
__tsplusTrace?: string,
|
|
2691
|
+
): IO<R | R1 | Scope, E | E1, void> {
|
|
2490
2692
|
const writer: Channel<R, E, Conc<A>, unknown, E, Take<E | E1, A>, any> = Channel.readWithCause(
|
|
2491
2693
|
(inp) => Channel.writeNow(Take.chunk(inp)).apSecond(writer),
|
|
2492
2694
|
(cause) => Channel.writeNow(Take.failCause(cause)),
|
|
@@ -2505,7 +2707,8 @@ export function runIntoQueueScoped_<R, R1, E extends E1, E1, A>(
|
|
|
2505
2707
|
export function runIntoHubScoped_<R, R1, E extends E1, E1, A>(
|
|
2506
2708
|
stream: Stream<R, E, A>,
|
|
2507
2709
|
hub: PHub<R1, never, never, unknown, Take<E1, A>, any>,
|
|
2508
|
-
|
|
2710
|
+
__tsplusTrace?: string,
|
|
2711
|
+
): IO<R | R1 | Scope, E | E1, void> {
|
|
2509
2712
|
return stream.runIntoQueueScoped(hub.toQueue);
|
|
2510
2713
|
}
|
|
2511
2714
|
|
|
@@ -2517,7 +2720,8 @@ export function runIntoHubScoped_<R, R1, E extends E1, E1, A>(
|
|
|
2517
2720
|
export function runScoped_<R, E, A, R2, E2, Z>(
|
|
2518
2721
|
stream: Stream<R, E, A>,
|
|
2519
2722
|
sink: Sink<R2, E2, A, unknown, Z>,
|
|
2520
|
-
|
|
2723
|
+
__tsplusTrace?: string,
|
|
2724
|
+
): IO<R | R2 | Scope, E | E2, Z> {
|
|
2521
2725
|
return stream.channel.pipeToOrFail(sink.channel).drain.runScoped;
|
|
2522
2726
|
}
|
|
2523
2727
|
|
|
@@ -2527,7 +2731,12 @@ export function runScoped_<R, E, A, R2, E2, Z>(
|
|
|
2527
2731
|
*
|
|
2528
2732
|
* @tsplus fluent fncts.io.Stream scan
|
|
2529
2733
|
*/
|
|
2530
|
-
export function scan_<R, E, A, B>(
|
|
2734
|
+
export function scan_<R, E, A, B>(
|
|
2735
|
+
sa: Stream<R, E, A>,
|
|
2736
|
+
b: B,
|
|
2737
|
+
f: (b: B, a: A) => B,
|
|
2738
|
+
__tsplusTrace?: string,
|
|
2739
|
+
): Stream<R, E, B> {
|
|
2531
2740
|
return sa.scanIO(b, (b, a) => IO.succeedNow(f(b, a)));
|
|
2532
2741
|
}
|
|
2533
2742
|
|
|
@@ -2541,7 +2750,8 @@ export function scanIO_<R, E, A, R1, E1, B>(
|
|
|
2541
2750
|
sa: Stream<R, E, A>,
|
|
2542
2751
|
b: B,
|
|
2543
2752
|
f: (b: B, a: A) => IO<R1, E1, B>,
|
|
2544
|
-
|
|
2753
|
+
__tsplusTrace?: string,
|
|
2754
|
+
): Stream<R | R1, E | E1, B> {
|
|
2545
2755
|
return Stream.succeedNow(b).concat(sa.mapAccumIO(b, (b, a) => f(b, a).map((b) => [b, b])));
|
|
2546
2756
|
}
|
|
2547
2757
|
|
|
@@ -2551,7 +2761,11 @@ export function scanIO_<R, E, A, R1, E1, B>(
|
|
|
2551
2761
|
*
|
|
2552
2762
|
* @tsplus fluent fncts.io.Stream scanReduce
|
|
2553
2763
|
*/
|
|
2554
|
-
export function scanReduce_<R, E, A extends B, B>(
|
|
2764
|
+
export function scanReduce_<R, E, A extends B, B>(
|
|
2765
|
+
fa: Stream<R, E, A>,
|
|
2766
|
+
f: (b: B, a: A) => B,
|
|
2767
|
+
__tsplusTrace?: string,
|
|
2768
|
+
): Stream<R, E, B> {
|
|
2555
2769
|
return fa.scanReduceIO((b, a) => IO.succeedNow(f(b, a)));
|
|
2556
2770
|
}
|
|
2557
2771
|
|
|
@@ -2564,7 +2778,8 @@ export function scanReduce_<R, E, A extends B, B>(fa: Stream<R, E, A>, f: (b: B,
|
|
|
2564
2778
|
export function scanReduceIO_<R, E, A extends B, R1, E1, B>(
|
|
2565
2779
|
fa: Stream<R, E, A>,
|
|
2566
2780
|
f: (b: B, a: A) => IO<R1, E1, B>,
|
|
2567
|
-
|
|
2781
|
+
__tsplusTrace?: string,
|
|
2782
|
+
): Stream<R | R1, E | E1, B> {
|
|
2568
2783
|
return fa.mapAccumIO(Nothing<B>(), (s, a) =>
|
|
2569
2784
|
s.match(
|
|
2570
2785
|
() => IO.succeedNow([a, Just(a)]),
|
|
@@ -2578,7 +2793,7 @@ export function scanReduceIO_<R, E, A extends B, R1, E1, B>(
|
|
|
2578
2793
|
*
|
|
2579
2794
|
* @tsplus static fncts.io.StreamOps succeedNow
|
|
2580
2795
|
*/
|
|
2581
|
-
export function succeedNow<O>(o: O): Stream<
|
|
2796
|
+
export function succeedNow<O>(o: O, __tsplusTrace?: string): Stream<never, never, O> {
|
|
2582
2797
|
return fromChunkNow(Conc.single(o));
|
|
2583
2798
|
}
|
|
2584
2799
|
|
|
@@ -2587,11 +2802,11 @@ export function succeedNow<O>(o: O): Stream<unknown, never, O> {
|
|
|
2587
2802
|
*
|
|
2588
2803
|
* @tsplus static fncts.io.StreamOps succeed
|
|
2589
2804
|
*/
|
|
2590
|
-
export function succeed<A>(a: Lazy<A
|
|
2805
|
+
export function succeed<A>(a: Lazy<A>, __tsplusTrace?: string): Stream<never, never, A> {
|
|
2591
2806
|
return fromChunk(Conc.single(a()));
|
|
2592
2807
|
}
|
|
2593
2808
|
|
|
2594
|
-
function takeLoop<E, A>(n: number): Channel<
|
|
2809
|
+
function takeLoop<E, A>(n: number, __tsplusTrace?: string): Channel<never, E, Conc<A>, unknown, E, Conc<A>, unknown> {
|
|
2595
2810
|
return Channel.readWithCause(
|
|
2596
2811
|
(inp) => {
|
|
2597
2812
|
const taken = inp.take(n);
|
|
@@ -2612,7 +2827,7 @@ function takeLoop<E, A>(n: number): Channel<unknown, E, Conc<A>, unknown, E, Con
|
|
|
2612
2827
|
*
|
|
2613
2828
|
* @tsplus fluent fncts.io.Stream take
|
|
2614
2829
|
*/
|
|
2615
|
-
export function take_<R, E, A>(stream: Stream<R, E, A>, n: number): Stream<R, E, A> {
|
|
2830
|
+
export function take_<R, E, A>(stream: Stream<R, E, A>, n: number, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2616
2831
|
if (n <= 0) {
|
|
2617
2832
|
return empty;
|
|
2618
2833
|
}
|
|
@@ -2628,14 +2843,16 @@ export function take_<R, E, A>(stream: Stream<R, E, A>, n: number): Stream<R, E,
|
|
|
2628
2843
|
export function takeUntilIO_<R, E, A, R1, E1>(
|
|
2629
2844
|
ma: Stream<R, E, A>,
|
|
2630
2845
|
f: (a: A) => IO<R1, E1, boolean>,
|
|
2631
|
-
|
|
2846
|
+
__tsplusTrace?: string,
|
|
2847
|
+
): Stream<R | R1, E | E1, A> {
|
|
2632
2848
|
return new Stream(ma.channel.pipeTo(takeUntilIOLoop(Iterable.empty<A>()[Symbol.iterator](), f)));
|
|
2633
2849
|
}
|
|
2634
2850
|
|
|
2635
|
-
function takeUntilIOLoop<
|
|
2851
|
+
function takeUntilIOLoop<E, A, R1, E1>(
|
|
2636
2852
|
iterator: Iterator<A>,
|
|
2637
2853
|
f: (a: A) => IO<R1, E1, boolean>,
|
|
2638
|
-
|
|
2854
|
+
__tsplusTrace?: string,
|
|
2855
|
+
): Channel<R1, E, Conc<A>, unknown, E | E1, Conc<A>, unknown> {
|
|
2639
2856
|
const next = iterator.next();
|
|
2640
2857
|
if (next.done) {
|
|
2641
2858
|
return Channel.readWithCause(
|
|
@@ -2648,13 +2865,16 @@ function takeUntilIOLoop<R, E, A, R1, E1>(
|
|
|
2648
2865
|
f(next.value).map((b) =>
|
|
2649
2866
|
b
|
|
2650
2867
|
? Channel.writeNow(Conc.single(next.value))
|
|
2651
|
-
: Channel.writeNow(Conc.single(next.value)) > takeUntilIOLoop<
|
|
2868
|
+
: Channel.writeNow(Conc.single(next.value)) > takeUntilIOLoop<E, A, R1, E1>(iterator, f),
|
|
2652
2869
|
),
|
|
2653
2870
|
);
|
|
2654
2871
|
}
|
|
2655
2872
|
}
|
|
2656
2873
|
|
|
2657
|
-
function takeUntilLoop<R, E, A>(
|
|
2874
|
+
function takeUntilLoop<R, E, A>(
|
|
2875
|
+
p: Predicate<A>,
|
|
2876
|
+
__tsplusTrace?: string,
|
|
2877
|
+
): Channel<R, E, Conc<A>, unknown, E, Conc<A>, unknown> {
|
|
2658
2878
|
return Channel.readWith(
|
|
2659
2879
|
(chunk: Conc<A>) => {
|
|
2660
2880
|
const taken = chunk.takeWhile(p.invert);
|
|
@@ -2676,14 +2896,18 @@ function takeUntilLoop<R, E, A>(p: Predicate<A>): Channel<R, E, Conc<A>, unknown
|
|
|
2676
2896
|
*
|
|
2677
2897
|
* @tsplus fluent fncts.io.Stream takeUntil
|
|
2678
2898
|
*/
|
|
2679
|
-
export function takeUntil_<R, E, A>(fa: Stream<R, E, A>, p: Predicate<A
|
|
2899
|
+
export function takeUntil_<R, E, A>(fa: Stream<R, E, A>, p: Predicate<A>, __tsplusTrace?: string): Stream<R, E, A> {
|
|
2680
2900
|
return new Stream(fa.channel.pipeTo(takeUntilLoop(p)));
|
|
2681
2901
|
}
|
|
2682
2902
|
|
|
2683
2903
|
/**
|
|
2684
2904
|
* @tsplus fluent fncts.io.Stream tap
|
|
2685
2905
|
*/
|
|
2686
|
-
export function tap_<R, E, A, R1, E1>(
|
|
2906
|
+
export function tap_<R, E, A, R1, E1>(
|
|
2907
|
+
ma: Stream<R, E, A>,
|
|
2908
|
+
f: (a: A) => IO<R1, E1, any>,
|
|
2909
|
+
__tsplusTrace?: string,
|
|
2910
|
+
): Stream<R | R1, E | E1, A> {
|
|
2687
2911
|
return ma.mapIO((a) => f(a).as(a));
|
|
2688
2912
|
}
|
|
2689
2913
|
|
|
@@ -2701,6 +2925,7 @@ export function throttleEnforce_<R, E, A>(
|
|
|
2701
2925
|
units: number,
|
|
2702
2926
|
duration: number,
|
|
2703
2927
|
burst = 0,
|
|
2928
|
+
__tsplusTrace?: string,
|
|
2704
2929
|
): Stream<R, E, A> {
|
|
2705
2930
|
return sa.throttleEnforceIO((chunk) => IO.succeedNow(costFn(chunk)), units, duration, burst);
|
|
2706
2931
|
}
|
|
@@ -2712,6 +2937,7 @@ function throttleEnforceIOLoop<E, A, R1, E1>(
|
|
|
2712
2937
|
burst: number,
|
|
2713
2938
|
tokens: number,
|
|
2714
2939
|
timestamp: number,
|
|
2940
|
+
__tsplusTrace?: string,
|
|
2715
2941
|
): Channel<R1, E | E1, Conc<A>, unknown, E | E1, Conc<A>, void> {
|
|
2716
2942
|
return Channel.readWith(
|
|
2717
2943
|
(inp: Conc<A>) =>
|
|
@@ -2728,9 +2954,9 @@ function throttleEnforceIOLoop<E, A, R1, E1>(
|
|
|
2728
2954
|
|
|
2729
2955
|
return weight <= available
|
|
2730
2956
|
? Channel.writeNow(inp).apSecond(
|
|
2731
|
-
throttleEnforceIOLoop(costFn, units, duration, burst, available - weight, current),
|
|
2957
|
+
throttleEnforceIOLoop<E, A, R1, E1>(costFn, units, duration, burst, available - weight, current),
|
|
2732
2958
|
)
|
|
2733
|
-
: throttleEnforceIOLoop(costFn, units, duration, burst, available - weight, current);
|
|
2959
|
+
: throttleEnforceIOLoop<E, A, R1, E1>(costFn, units, duration, burst, available - weight, current);
|
|
2734
2960
|
}),
|
|
2735
2961
|
),
|
|
2736
2962
|
Channel.failNow,
|
|
@@ -2752,7 +2978,8 @@ export function throttleEnforceIO_<R, E, A, R1, E1>(
|
|
|
2752
2978
|
units: number,
|
|
2753
2979
|
duration: number,
|
|
2754
2980
|
burst = 0,
|
|
2755
|
-
|
|
2981
|
+
__tsplusTrace?: string,
|
|
2982
|
+
): Stream<R | R1, E | E1, A> {
|
|
2756
2983
|
return new Stream(
|
|
2757
2984
|
Channel.fromIO(Clock.currentTime).flatMap((current) =>
|
|
2758
2985
|
sa.channel.pipeTo(throttleEnforceIOLoop(costFn, units, duration, burst, units, current)),
|
|
@@ -2766,7 +2993,11 @@ export function throttleEnforceIO_<R, E, A, R1, E1>(
|
|
|
2766
2993
|
*
|
|
2767
2994
|
* @tsplus fluent fncts.io.Stream toHub
|
|
2768
2995
|
*/
|
|
2769
|
-
export function toHub_<R, E, A>(
|
|
2996
|
+
export function toHub_<R, E, A>(
|
|
2997
|
+
stream: Stream<R, E, A>,
|
|
2998
|
+
capacity: number,
|
|
2999
|
+
__tsplusTrace?: string,
|
|
3000
|
+
): IO<R | Scope, never, Hub<Take<E, A>>> {
|
|
2770
3001
|
return Do((Δ) => {
|
|
2771
3002
|
const hub = Δ(IO.acquireRelease(Hub.makeBounded<Take<E, A>>(capacity), (_) => _.shutdown));
|
|
2772
3003
|
Δ(stream.runIntoHubScoped(hub).fork);
|
|
@@ -2779,7 +3010,10 @@ export function toHub_<R, E, A>(stream: Stream<R, E, A>, capacity: number): IO<R
|
|
|
2779
3010
|
*
|
|
2780
3011
|
* @tsplus getter fncts.io.Stream toPull
|
|
2781
3012
|
*/
|
|
2782
|
-
export function toPull<R, E, A>(
|
|
3013
|
+
export function toPull<R, E, A>(
|
|
3014
|
+
stream: Stream<R, E, A>,
|
|
3015
|
+
__tsplusTrace?: string,
|
|
3016
|
+
): IO<R | Scope, never, IO<R, Maybe<E>, Conc<A>>> {
|
|
2783
3017
|
return stream.channel.toPull.map((io) =>
|
|
2784
3018
|
io.mapError(Maybe.just).flatMap((r) => r.match(() => IO.failNow(Nothing()), IO.succeedNow)),
|
|
2785
3019
|
);
|
|
@@ -2791,7 +3025,11 @@ export function toPull<R, E, A>(stream: Stream<R, E, A>): IO<R & Has<Scope>, nev
|
|
|
2791
3025
|
*
|
|
2792
3026
|
* @tsplus fluent fncts.io.Stream toQueue
|
|
2793
3027
|
*/
|
|
2794
|
-
export function toQueue_<R, E, A>(
|
|
3028
|
+
export function toQueue_<R, E, A>(
|
|
3029
|
+
stream: Stream<R, E, A>,
|
|
3030
|
+
capacity = 2,
|
|
3031
|
+
__tsplusTrace?: string,
|
|
3032
|
+
): IO<R | Scope, never, Queue<Take<E, A>>> {
|
|
2795
3033
|
return Do((Δ) => {
|
|
2796
3034
|
const queue = Δ(IO.acquireRelease(Queue.makeBounded<Take<E, A>>(capacity), (_) => _.shutdown));
|
|
2797
3035
|
Δ(stream.runIntoQueueScoped(queue).fork);
|
|
@@ -2805,7 +3043,8 @@ export function toQueue_<R, E, A>(stream: Stream<R, E, A>, capacity = 2): IO<R &
|
|
|
2805
3043
|
export function toQueueDropping_<R, E, A>(
|
|
2806
3044
|
stream: Stream<R, E, A>,
|
|
2807
3045
|
capacity = 2,
|
|
2808
|
-
|
|
3046
|
+
__tsplusTrace?: string,
|
|
3047
|
+
): IO<R | Scope, never, Queue.Dequeue<Take<E, A>>> {
|
|
2809
3048
|
return Do((Δ) => {
|
|
2810
3049
|
const queue = Δ(IO.acquireRelease(Queue.makeDropping<Take<E, A>>(capacity), (_) => _.shutdown));
|
|
2811
3050
|
Δ(stream.runIntoQueueScoped(queue).fork);
|
|
@@ -2819,7 +3058,8 @@ export function toQueueDropping_<R, E, A>(
|
|
|
2819
3058
|
export function toQueueOfElements_<R, E, A>(
|
|
2820
3059
|
stream: Stream<R, E, A>,
|
|
2821
3060
|
capacity = 2,
|
|
2822
|
-
|
|
3061
|
+
__tsplusTrace?: string,
|
|
3062
|
+
): IO<R | Scope, never, Queue.Dequeue<Exit<Maybe<E>, A>>> {
|
|
2823
3063
|
return Do((Δ) => {
|
|
2824
3064
|
const queue = Δ(IO.acquireRelease(Queue.makeBounded<Exit<Maybe<E>, A>>(capacity), (_) => _.shutdown));
|
|
2825
3065
|
Δ(stream.runIntoElementsScoped(queue).fork);
|
|
@@ -2833,7 +3073,8 @@ export function toQueueOfElements_<R, E, A>(
|
|
|
2833
3073
|
export function toQueueSliding_<R, E, A>(
|
|
2834
3074
|
stream: Stream<R, E, A>,
|
|
2835
3075
|
capacity = 2,
|
|
2836
|
-
|
|
3076
|
+
__tsplusTrace?: string,
|
|
3077
|
+
): IO<R | Scope, never, Queue.Dequeue<Take<E, A>>> {
|
|
2837
3078
|
return Do((Δ) => {
|
|
2838
3079
|
const queue = Δ(IO.acquireRelease(Queue.makeSliding<Take<E, A>>(capacity), (_) => _.shutdown));
|
|
2839
3080
|
Δ(stream.runIntoQueueScoped(queue).fork);
|
|
@@ -2847,7 +3088,10 @@ export function toQueueSliding_<R, E, A>(
|
|
|
2847
3088
|
*
|
|
2848
3089
|
* @tsplus getter fncts.io.Stream toQueueUnbounded
|
|
2849
3090
|
*/
|
|
2850
|
-
export function toQueueUnbounded<R, E, A>(
|
|
3091
|
+
export function toQueueUnbounded<R, E, A>(
|
|
3092
|
+
stream: Stream<R, E, A>,
|
|
3093
|
+
__tsplusTrace?: string,
|
|
3094
|
+
): IO<R | Scope, never, Queue<Take<E, A>>> {
|
|
2851
3095
|
return Do((Δ) => {
|
|
2852
3096
|
const queue = Δ(IO.acquireRelease(Queue.makeUnbounded<Take<E, A>>(), (_) => _.shutdown));
|
|
2853
3097
|
Δ(stream.runIntoQueueScoped(queue).fork);
|
|
@@ -2858,6 +3102,7 @@ export function toQueueUnbounded<R, E, A>(stream: Stream<R, E, A>): IO<R & Has<S
|
|
|
2858
3102
|
function unfoldChunkIOLoop<S, R, E, A>(
|
|
2859
3103
|
s: S,
|
|
2860
3104
|
f: (s: S) => IO<R, E, Maybe<readonly [Conc<A>, S]>>,
|
|
3105
|
+
__tsplusTrace?: string,
|
|
2861
3106
|
): Channel<R, unknown, unknown, unknown, E, Conc<A>, unknown> {
|
|
2862
3107
|
return Channel.unwrap(
|
|
2863
3108
|
f(s).map((m) =>
|
|
@@ -2874,7 +3119,11 @@ function unfoldChunkIOLoop<S, R, E, A>(
|
|
|
2874
3119
|
*
|
|
2875
3120
|
* @tsplus static fncts.io.StreamOps unfoldChunkIO
|
|
2876
3121
|
*/
|
|
2877
|
-
export function unfoldChunkIO<R, E, A, S>(
|
|
3122
|
+
export function unfoldChunkIO<R, E, A, S>(
|
|
3123
|
+
s: S,
|
|
3124
|
+
f: (s: S) => IO<R, E, Maybe<readonly [Conc<A>, S]>>,
|
|
3125
|
+
__tsplusTrace?: string,
|
|
3126
|
+
): Stream<R, E, A> {
|
|
2878
3127
|
return new Stream(unfoldChunkIOLoop(s, f));
|
|
2879
3128
|
}
|
|
2880
3129
|
|
|
@@ -2883,14 +3132,19 @@ export function unfoldChunkIO<R, E, A, S>(s: S, f: (s: S) => IO<R, E, Maybe<read
|
|
|
2883
3132
|
*
|
|
2884
3133
|
* @tsplus static fncts.io.StreamOps unfoldIO
|
|
2885
3134
|
*/
|
|
2886
|
-
export function unfoldIO<S, R, E, A>(
|
|
3135
|
+
export function unfoldIO<S, R, E, A>(
|
|
3136
|
+
s: S,
|
|
3137
|
+
f: (s: S) => IO<R, E, Maybe<readonly [A, S]>>,
|
|
3138
|
+
__tsplusTrace?: string,
|
|
3139
|
+
): Stream<R, E, A> {
|
|
2887
3140
|
return unfoldChunkIO(s, (_) => f(_).map((m) => m.map(([a, s]) => tuple(Conc.single(a), s))));
|
|
2888
3141
|
}
|
|
2889
3142
|
|
|
2890
3143
|
function unfoldChunkLoop<S, A>(
|
|
2891
3144
|
s: S,
|
|
2892
3145
|
f: (s: S) => Maybe<readonly [Conc<A>, S]>,
|
|
2893
|
-
|
|
3146
|
+
__tsplusTrace?: string,
|
|
3147
|
+
): Channel<never, unknown, unknown, unknown, never, Conc<A>, unknown> {
|
|
2894
3148
|
return f(s).match(
|
|
2895
3149
|
() => Channel.unit,
|
|
2896
3150
|
([as, s]) => Channel.writeNow(as).flatMap(() => unfoldChunkLoop(s, f)),
|
|
@@ -2900,14 +3154,22 @@ function unfoldChunkLoop<S, A>(
|
|
|
2900
3154
|
/**
|
|
2901
3155
|
* @tsplus static fncts.io.StreamOps unfoldChunk
|
|
2902
3156
|
*/
|
|
2903
|
-
export function unfoldChunk<S, A>(
|
|
3157
|
+
export function unfoldChunk<S, A>(
|
|
3158
|
+
s: S,
|
|
3159
|
+
f: (s: S) => Maybe<readonly [Conc<A>, S]>,
|
|
3160
|
+
__tsplusTrace?: string,
|
|
3161
|
+
): Stream<never, never, A> {
|
|
2904
3162
|
return new Stream(Channel.defer(unfoldChunkLoop(s, f)));
|
|
2905
3163
|
}
|
|
2906
3164
|
|
|
2907
3165
|
/**
|
|
2908
3166
|
* @tsplus static fncts.io.StreamOps unfold
|
|
2909
3167
|
*/
|
|
2910
|
-
export function unfold<S, A>(
|
|
3168
|
+
export function unfold<S, A>(
|
|
3169
|
+
s: S,
|
|
3170
|
+
f: (s: S) => Maybe<readonly [A, S]>,
|
|
3171
|
+
__tsplusTrace?: string,
|
|
3172
|
+
): Stream<never, never, A> {
|
|
2911
3173
|
return Stream.unfoldChunk(s, (s) => f(s).map(([a, s]) => tuple(Conc.single(a), s)));
|
|
2912
3174
|
}
|
|
2913
3175
|
|
|
@@ -2916,7 +3178,10 @@ export function unfold<S, A>(s: S, f: (s: S) => Maybe<readonly [A, S]>): Stream<
|
|
|
2916
3178
|
*
|
|
2917
3179
|
* @tsplus static fncts.io.StreamOps unwrap
|
|
2918
3180
|
*/
|
|
2919
|
-
export function unwrap<R, E, R1, E1, A>(
|
|
3181
|
+
export function unwrap<R, E, R1, E1, A>(
|
|
3182
|
+
stream: IO<R, E, Stream<R1, E1, A>>,
|
|
3183
|
+
__tsplusTrace?: string,
|
|
3184
|
+
): Stream<R | R1, E | E1, A> {
|
|
2920
3185
|
return Stream.fromIO(stream).flatten;
|
|
2921
3186
|
}
|
|
2922
3187
|
|
|
@@ -2926,8 +3191,9 @@ export function unwrap<R, E, R1, E1, A>(stream: IO<R, E, Stream<R1, E1, A>>): St
|
|
|
2926
3191
|
* @tsplus static fncts.io.StreamOps unwrapScoped
|
|
2927
3192
|
*/
|
|
2928
3193
|
export function unwrapScoped<R0, E0, R, E, A>(
|
|
2929
|
-
stream: IO<R0
|
|
2930
|
-
|
|
3194
|
+
stream: IO<R0, E0, Stream<R, E, A>>,
|
|
3195
|
+
__tsplusTrace?: string,
|
|
3196
|
+
): Stream<R | Exclude<R0, Scope>, E0 | E, A> {
|
|
2931
3197
|
return Stream.scoped(stream).flatten;
|
|
2932
3198
|
}
|
|
2933
3199
|
|
|
@@ -2936,7 +3202,7 @@ export function unwrapScoped<R0, E0, R, E, A>(
|
|
|
2936
3202
|
*/
|
|
2937
3203
|
export function zipWithIndex_<R, E, A>(
|
|
2938
3204
|
self: Stream<R, E, A>,
|
|
2939
|
-
|
|
3205
|
+
__tsplusTrace?: string,
|
|
2940
3206
|
): Stream<R, E, readonly [A, number]> {
|
|
2941
3207
|
return self.mapAccum(0, (index, a) => [index + 1, [a, index]]);
|
|
2942
3208
|
}
|
|
@@ -2956,8 +3222,9 @@ export function zipWithLatest_<R, E, A, R1, E1, B, C>(
|
|
|
2956
3222
|
fa: Stream<R, E, A>,
|
|
2957
3223
|
fb: Stream<R1, E1, B>,
|
|
2958
3224
|
f: (a: A, b: B) => C,
|
|
2959
|
-
|
|
2960
|
-
|
|
3225
|
+
__tsplusTrace?: string,
|
|
3226
|
+
): Stream<R | R1, E | E1, C> {
|
|
3227
|
+
function pullNonEmpty<R, E, A>(pull: IO<R, Maybe<E>, Conc<A>>, __tsplusTrace?: string): IO<R, Maybe<E>, Conc<A>> {
|
|
2961
3228
|
return pull.flatMap((chunk) => (chunk.isNonEmpty ? pullNonEmpty(pull) : IO.succeedNow(chunk)));
|
|
2962
3229
|
}
|
|
2963
3230
|
return Stream.fromPull(
|
|
@@ -2968,7 +3235,8 @@ export function zipWithLatest_<R, E, A, R1, E1, B, C>(
|
|
|
2968
3235
|
Stream.fromIOMaybe(
|
|
2969
3236
|
left.raceWith(
|
|
2970
3237
|
right,
|
|
2971
|
-
(leftDone
|
|
3238
|
+
(leftDone: Exit<Maybe<E | E1>, Conc<A>>, rightFiber) =>
|
|
3239
|
+
IO.fromExitNow(leftDone).zipWith(rightFiber.join, (l, r) => tuple(l, r, true)),
|
|
2972
3240
|
(rightDone, leftFiber) => IO.fromExitNow(rightDone).zipWith(leftFiber.join, (r, l) => tuple(l, r, false)),
|
|
2973
3241
|
),
|
|
2974
3242
|
).flatMap(([l, r, leftFirst]) =>
|