@fncts/io 0.0.1
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 +27 -0
- package/Cached/definition.d.ts +18 -0
- package/Cached/internal.d.ts +10 -0
- package/Cached.d.ts +3 -0
- package/CancellerState.d.ts +42 -0
- package/Channel/ChildExecutorDecision/api.d.ts +6 -0
- package/Channel/ChildExecutorDecision/definition.d.ts +35 -0
- package/Channel/ChildExecutorDecision.d.ts +2 -0
- package/Channel/UpstreamPullRequest/api.d.ts +16 -0
- package/Channel/UpstreamPullRequest/definition.d.ts +20 -0
- package/Channel/UpstreamPullRequest.d.ts +2 -0
- package/Channel/UpstreamPullStrategy/definition.d.ts +26 -0
- package/Channel/UpstreamPullStrategy.d.ts +1 -0
- package/Channel/api/interruptWhen.d.ts +23 -0
- package/Channel/api/mapOutIOC.d.ts +8 -0
- package/Channel/api/mergeAll.d.ts +7 -0
- package/Channel/api/mergeAllUnboundedWith.d.ts +6 -0
- package/Channel/api/mergeAllWith.d.ts +11 -0
- package/Channel/api/mergeMap.d.ts +7 -0
- package/Channel/api/mergeWith.d.ts +14 -0
- package/Channel/api/run.d.ts +8 -0
- package/Channel/api/runCollect.d.ts +8 -0
- package/Channel/api/runDrain.d.ts +8 -0
- package/Channel/api/runScoped.d.ts +10 -0
- package/Channel/api/toPull.d.ts +11 -0
- package/Channel/api/zipC.d.ts +16 -0
- package/Channel/api.d.ts +420 -0
- package/Channel/core-api.d.ts +78 -0
- package/Channel/definition.d.ts +164 -0
- package/Channel/internal/AsyncInputConsumer.d.ts +8 -0
- package/Channel/internal/AsyncInputProducer.d.ts +8 -0
- package/Channel/internal/ChannelExecutor.d.ts +51 -0
- package/Channel/internal/ChannelState.d.ts +44 -0
- package/Channel/internal/MergeDecision.d.ts +51 -0
- package/Channel/internal/MergeState.d.ts +50 -0
- package/Channel/internal/SingleProducerAsyncInput.d.ts +71 -0
- package/Channel.d.ts +3 -0
- package/Clock/api.d.ts +11 -0
- package/Clock/definition.d.ts +14 -0
- package/Clock/live.d.ts +7 -0
- package/Clock.d.ts +3 -0
- package/Console/api.d.ts +11 -0
- package/Console/definition.d.ts +15 -0
- package/Console/live.d.ts +11 -0
- package/Console.d.ts +3 -0
- package/Fiber/FiberContext.d.ts +145 -0
- package/Fiber/api/await.d.ts +8 -0
- package/Fiber/api/awaitAll.d.ts +10 -0
- package/Fiber/api/children.d.ts +8 -0
- package/Fiber/api/collectAll.d.ts +11 -0
- package/Fiber/api/evalOn.d.ts +7 -0
- package/Fiber/api/evalOnIO.d.ts +9 -0
- package/Fiber/api/fromIO.d.ts +8 -0
- package/Fiber/api/id.d.ts +7 -0
- package/Fiber/api/inheritRefs.d.ts +7 -0
- package/Fiber/api/interrupt.d.ts +11 -0
- package/Fiber/api/interruptAll.d.ts +15 -0
- package/Fiber/api/interruptAs.d.ts +9 -0
- package/Fiber/api/interruptFork.d.ts +10 -0
- package/Fiber/api/join.d.ts +12 -0
- package/Fiber/api/joinAll.d.ts +11 -0
- package/Fiber/api/location.d.ts +7 -0
- package/Fiber/api/mapFiber.d.ts +9 -0
- package/Fiber/api/mapIO.d.ts +14 -0
- package/Fiber/api/poll.d.ts +9 -0
- package/Fiber/api/zipWith.d.ts +9 -0
- package/Fiber/constructors.d.ts +29 -0
- package/Fiber/definition.d.ts +102 -0
- package/Fiber.d.ts +23 -0
- package/FiberDescriptor.d.ts +18 -0
- package/FiberRef/api/locallyScoped.d.ts +9 -0
- package/FiberRef/api/locallyScopedWith.d.ts +9 -0
- package/FiberRef/api.d.ts +89 -0
- package/FiberRef/constructors.d.ts +63 -0
- package/FiberRef/definition.d.ts +41 -0
- package/FiberRef.d.ts +5 -0
- package/FiberRefs/api.d.ts +15 -0
- package/FiberRefs/definition.d.ts +14 -0
- package/FiberRefs/join.d.ts +8 -0
- package/FiberRefs.d.ts +3 -0
- package/FiberScope/constructors.d.ts +16 -0
- package/FiberScope/definition.d.ts +24 -0
- package/FiberScope.d.ts +2 -0
- package/FiberState/api.d.ts +7 -0
- package/FiberState/constructors.d.ts +22 -0
- package/FiberState/definition.d.ts +38 -0
- package/FiberState.d.ts +3 -0
- package/FiberStatus/constructors.d.ts +22 -0
- package/FiberStatus/definition.d.ts +59 -0
- package/FiberStatus.d.ts +2 -0
- package/Future/api.d.ts +113 -0
- package/Future/constructors.d.ts +21 -0
- package/Future/definition.d.ts +27 -0
- package/Future.d.ts +3 -0
- package/Hub/api.d.ts +191 -0
- package/Hub/definition.d.ts +89 -0
- package/Hub/internal.d.ts +97 -0
- package/Hub.d.ts +2 -0
- package/IO/api/acquireRelease.d.ts +10 -0
- package/IO/api/acquireReleaseExit.d.ts +11 -0
- package/IO/api/acquireReleaseInterruptible.d.ts +9 -0
- package/IO/api/acquireReleaseInterruptibleExit.d.ts +10 -0
- package/IO/api/addFinalizer.d.ts +9 -0
- package/IO/api/addFinalizerExit.d.ts +9 -0
- package/IO/api/bracket.d.ts +26 -0
- package/IO/api/bracketExit.d.ts +14 -0
- package/IO/api/clockWith.d.ts +12 -0
- package/IO/api/concurrency.d.ts +35 -0
- package/IO/api/concurrentFinalizers.d.ts +8 -0
- package/IO/api/consoleWith.d.ts +12 -0
- package/IO/api/core-scope.d.ts +77 -0
- package/IO/api/environment.d.ts +74 -0
- package/IO/api/foreachC.d.ts +29 -0
- package/IO/api/foreachExec.d.ts +12 -0
- package/IO/api/forkAll.d.ts +10 -0
- package/IO/api/forkIn.d.ts +9 -0
- package/IO/api/forkScoped.d.ts +8 -0
- package/IO/api/fulfill.d.ts +10 -0
- package/IO/api/interrupt.d.ts +108 -0
- package/IO/api/memoize.d.ts +6 -0
- package/IO/api/onExit.d.ts +7 -0
- package/IO/api/once.d.ts +6 -0
- package/IO/api/provideLayer.d.ts +7 -0
- package/IO/api/provideSomeLayer.d.ts +13 -0
- package/IO/api/race.d.ts +13 -0
- package/IO/api/raceFirst.d.ts +16 -0
- package/IO/api/randomWith.d.ts +12 -0
- package/IO/api/repeat.d.ts +20 -0
- package/IO/api/retry.d.ts +19 -0
- package/IO/api/schedule.d.ts +13 -0
- package/IO/api/scope.d.ts +8 -0
- package/IO/api/scopeWith.d.ts +8 -0
- package/IO/api/scoped.d.ts +14 -0
- package/IO/api/sequenceT.d.ts +10 -0
- package/IO/api/sleep.d.ts +6 -0
- package/IO/api/stateful.d.ts +10 -0
- package/IO/api/withChildren.d.ts +7 -0
- package/IO/api/withFinalizer.d.ts +8 -0
- package/IO/api/withFinalizerExit.d.ts +9 -0
- package/IO/api/withRuntimeConfig.d.ts +10 -0
- package/IO/api/zipC.d.ts +6 -0
- package/IO/api/zipWithC.d.ts +9 -0
- package/IO/api.d.ts +1130 -0
- package/IO/definition.d.ts +338 -0
- package/IO/runtime.d.ts +43 -0
- package/IO.d.ts +47 -0
- package/IOEnv/definition.d.ts +16 -0
- package/IOEnv/live.d.ts +6 -0
- package/IOEnv/services.d.ts +8 -0
- package/IOEnv.d.ts +3 -0
- package/IOSpec.d.ts +3 -0
- package/InterruptStatus/constructors.d.ts +16 -0
- package/InterruptStatus/definition.d.ts +12 -0
- package/InterruptStatus.d.ts +2 -0
- package/Layer/MemoMap.d.ts +43 -0
- package/Layer/api.d.ts +209 -0
- package/Layer/definition.d.ts +75 -0
- package/Layer.d.ts +3 -0
- package/LogLevel.d.ts +74 -0
- package/LogSpan.d.ts +14 -0
- package/Logger/api.d.ts +14 -0
- package/Logger/constructors.d.ts +10 -0
- package/Logger/definition.d.ts +18 -0
- package/Logger.d.ts +3 -0
- package/Queue/api/dimapIO.d.ts +41 -0
- package/Queue/api/filterInputIO.d.ts +32 -0
- package/Queue/api/filterOutputIO.d.ts +31 -0
- package/Queue/api/operations.d.ts +82 -0
- package/Queue/api/poll.d.ts +9 -0
- package/Queue/api/takeBetween.d.ts +11 -0
- package/Queue/api/zipWithIO.d.ts +44 -0
- package/Queue/api.d.ts +7 -0
- package/Queue/constructors.d.ts +22 -0
- package/Queue/definition.d.ts +129 -0
- package/Queue/internal.d.ts +12 -0
- package/Queue/strategy.d.ts +33 -0
- package/Queue.d.ts +5 -0
- package/Random/api.d.ts +42 -0
- package/Random/definition.d.ts +21 -0
- package/Random/live.d.ts +20 -0
- package/Random.d.ts +3 -0
- package/Ref/Atomic/Atomic.d.ts +18 -0
- package/Ref/Atomic/api.d.ts +53 -0
- package/Ref/Atomic.d.ts +2 -0
- package/Ref/Derived.d.ts +14 -0
- package/Ref/DerivedAll.d.ts +14 -0
- package/Ref/Synchronized/api.d.ts +100 -0
- package/Ref/Synchronized/constructors.d.ts +7 -0
- package/Ref/Synchronized/definition.d.ts +41 -0
- package/Ref/api/collect.d.ts +11 -0
- package/Ref/api/dimap.d.ts +56 -0
- package/Ref/api/filter.d.ts +20 -0
- package/Ref/api/get.d.ts +9 -0
- package/Ref/api/match.d.ts +13 -0
- package/Ref/api/matchAll.d.ts +11 -0
- package/Ref/api/modify.d.ts +79 -0
- package/Ref/api/set.d.ts +10 -0
- package/Ref/api.d.ts +23 -0
- package/Ref/constructors.d.ts +13 -0
- package/Ref/definition.d.ts +74 -0
- package/Ref.d.ts +9 -0
- package/RuntimeConfig.d.ts +34 -0
- package/STM/api/core-api.d.ts +35 -0
- package/STM/api/core-constructors.d.ts +45 -0
- package/STM/api.d.ts +379 -0
- package/STM/definition.d.ts +105 -0
- package/STM/driver.d.ts +15 -0
- package/STM/internal/CommitState.d.ts +47 -0
- package/STM/internal/Entry.d.ts +37 -0
- package/STM/internal/Journal.d.ts +101 -0
- package/STM/internal/TryCommit.d.ts +21 -0
- package/STM/internal/Versioned.d.ts +7 -0
- package/STM.d.ts +5 -0
- package/Schedule/Decision.d.ts +38 -0
- package/Schedule/Driver.d.ts +19 -0
- package/Schedule/Interval.d.ts +71 -0
- package/Schedule/api/driver.d.ts +7 -0
- package/Schedule/api.d.ts +359 -0
- package/Schedule/definition.d.ts +51 -0
- package/Schedule.d.ts +5 -0
- package/Scope/Finalizer/definition.d.ts +26 -0
- package/Scope/Finalizer.d.ts +1 -0
- package/Scope/ReleaseMap/api/releaseAll.d.ts +9 -0
- package/Scope/ReleaseMap/api.d.ts +30 -0
- package/Scope/ReleaseMap/constructors.d.ts +12 -0
- package/Scope/ReleaseMap/definition.d.ts +38 -0
- package/Scope/ReleaseMap.d.ts +3 -0
- package/Scope/api.d.ts +61 -0
- package/Scope/definition.d.ts +32 -0
- package/Scope.d.ts +2 -0
- package/ScopedRef/api.d.ts +9 -0
- package/ScopedRef/definition.d.ts +14 -0
- package/ScopedRef.d.ts +2 -0
- package/Sink/api.d.ts +35 -0
- package/Sink/definition.d.ts +15 -0
- package/Sink.d.ts +2 -0
- package/State/api.d.ts +25 -0
- package/State/definition.d.ts +14 -0
- package/State/internal.d.ts +10 -0
- package/State.d.ts +2 -0
- package/Stream/api/zipAllWith.d.ts +10 -0
- package/Stream/api/zipWith.d.ts +6 -0
- package/Stream/api/zipWithChunks.d.ts +11 -0
- package/Stream/api.d.ts +1087 -0
- package/Stream/definition.d.ts +38 -0
- package/Stream/internal/DebounceState.d.ts +61 -0
- package/Stream/internal/Handoff.d.ts +111 -0
- package/Stream/internal/Pull.d.ts +48 -0
- package/Stream/internal/SinkEndReason.d.ts +39 -0
- package/Stream/internal/Take.d.ts +128 -0
- package/Stream/internal/util.d.ts +3 -0
- package/Stream.d.ts +2 -0
- package/Supervisor/api.d.ts +10 -0
- package/Supervisor/constructors.d.ts +34 -0
- package/Supervisor/definition.d.ts +35 -0
- package/Supervisor.d.ts +3 -0
- package/TExit/constructors.d.ts +32 -0
- package/TExit/definition.d.ts +90 -0
- package/TExit.d.ts +2 -0
- package/TFuture/api.d.ts +29 -0
- package/TFuture/constructors.d.ts +16 -0
- package/TFuture/definition.d.ts +22 -0
- package/TFuture.d.ts +3 -0
- package/TRef/api.d.ts +85 -0
- package/TRef/constructors.d.ts +32 -0
- package/TRef/definition.d.ts +87 -0
- package/TRef.d.ts +3 -0
- package/TSemaphore/api.d.ts +38 -0
- package/TSemaphore/constructors.d.ts +13 -0
- package/TSemaphore/definition.d.ts +20 -0
- package/TSemaphore.d.ts +3 -0
- package/TxnId.d.ts +12 -0
- package/_cjs/Cached/api.cjs +85 -0
- package/_cjs/Cached/api.cjs.map +1 -0
- package/_cjs/Cached/definition.cjs +33 -0
- package/_cjs/Cached/definition.cjs.map +1 -0
- package/_cjs/Cached/internal.cjs +18 -0
- package/_cjs/Cached/internal.cjs.map +1 -0
- package/_cjs/Cached.cjs +45 -0
- package/_cjs/Cached.cjs.map +1 -0
- package/_cjs/CancellerState.cjs +64 -0
- package/_cjs/CancellerState.cjs.map +1 -0
- package/_cjs/Channel/ChildExecutorDecision/api.cjs +29 -0
- package/_cjs/Channel/ChildExecutorDecision/api.cjs.map +1 -0
- package/_cjs/Channel/ChildExecutorDecision/definition.cjs +39 -0
- package/_cjs/Channel/ChildExecutorDecision/definition.cjs.map +1 -0
- package/_cjs/Channel/ChildExecutorDecision.cjs +32 -0
- package/_cjs/Channel/ChildExecutorDecision.cjs.map +1 -0
- package/_cjs/Channel/UpstreamPullRequest/api.cjs +44 -0
- package/_cjs/Channel/UpstreamPullRequest/api.cjs.map +1 -0
- package/_cjs/Channel/UpstreamPullRequest/definition.cjs +29 -0
- package/_cjs/Channel/UpstreamPullRequest/definition.cjs.map +1 -0
- package/_cjs/Channel/UpstreamPullRequest.cjs +32 -0
- package/_cjs/Channel/UpstreamPullRequest.cjs.map +1 -0
- package/_cjs/Channel/UpstreamPullStrategy/definition.cjs +33 -0
- package/_cjs/Channel/UpstreamPullStrategy/definition.cjs.map +1 -0
- package/_cjs/Channel/UpstreamPullStrategy.cjs +19 -0
- package/_cjs/Channel/UpstreamPullStrategy.cjs.map +1 -0
- package/_cjs/Channel/api/interruptWhen.cjs +54 -0
- package/_cjs/Channel/api/interruptWhen.cjs.map +1 -0
- package/_cjs/Channel/api/mapOutIOC.cjs +63 -0
- package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -0
- package/_cjs/Channel/api/mergeAll.cjs +20 -0
- package/_cjs/Channel/api/mergeAll.cjs.map +1 -0
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +20 -0
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -0
- package/_cjs/Channel/api/mergeAllWith.cjs +97 -0
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -0
- package/_cjs/Channel/api/mergeMap.cjs +22 -0
- package/_cjs/Channel/api/mergeMap.cjs.map +1 -0
- package/_cjs/Channel/api/mergeWith.cjs +98 -0
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -0
- package/_cjs/Channel/api/run.cjs +24 -0
- package/_cjs/Channel/api/run.cjs.map +1 -0
- package/_cjs/Channel/api/runCollect.cjs +22 -0
- package/_cjs/Channel/api/runCollect.cjs.map +1 -0
- package/_cjs/Channel/api/runDrain.cjs +24 -0
- package/_cjs/Channel/api/runDrain.cjs.map +1 -0
- package/_cjs/Channel/api/runScoped.cjs +70 -0
- package/_cjs/Channel/api/runScoped.cjs.map +1 -0
- package/_cjs/Channel/api/toPull.cjs +63 -0
- package/_cjs/Channel/api/toPull.cjs.map +1 -0
- package/_cjs/Channel/api/zipC.cjs +51 -0
- package/_cjs/Channel/api/zipC.cjs.map +1 -0
- package/_cjs/Channel/api.cjs +875 -0
- package/_cjs/Channel/api.cjs.map +1 -0
- package/_cjs/Channel/core-api.cjs +149 -0
- package/_cjs/Channel/core-api.cjs.map +1 -0
- package/_cjs/Channel/definition.cjs +262 -0
- package/_cjs/Channel/definition.cjs.map +1 -0
- package/_cjs/Channel/internal/AsyncInputConsumer.cjs +6 -0
- package/_cjs/Channel/internal/AsyncInputConsumer.cjs.map +1 -0
- package/_cjs/Channel/internal/AsyncInputProducer.cjs +6 -0
- package/_cjs/Channel/internal/AsyncInputProducer.cjs.map +1 -0
- package/_cjs/Channel/internal/ChannelExecutor.cjs +954 -0
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -0
- package/_cjs/Channel/internal/ChannelState.cjs +100 -0
- package/_cjs/Channel/internal/ChannelState.cjs.map +1 -0
- package/_cjs/Channel/internal/MergeDecision.cjs +85 -0
- package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -0
- package/_cjs/Channel/internal/MergeState.cjs +73 -0
- package/_cjs/Channel/internal/MergeState.cjs.map +1 -0
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +276 -0
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -0
- package/_cjs/Channel.cjs +45 -0
- package/_cjs/Channel.cjs.map +1 -0
- package/_cjs/Clock/api.cjs +30 -0
- package/_cjs/Clock/api.cjs.map +1 -0
- package/_cjs/Clock/definition.cjs +27 -0
- package/_cjs/Clock/definition.cjs.map +1 -0
- package/_cjs/Clock/live.cjs +45 -0
- package/_cjs/Clock/live.cjs.map +1 -0
- package/_cjs/Clock.cjs +45 -0
- package/_cjs/Clock.cjs.map +1 -0
- package/_cjs/Console/api.cjs +29 -0
- package/_cjs/Console/api.cjs.map +1 -0
- package/_cjs/Console/definition.cjs +27 -0
- package/_cjs/Console/definition.cjs.map +1 -0
- package/_cjs/Console/live.cjs +40 -0
- package/_cjs/Console/live.cjs.map +1 -0
- package/_cjs/Console.cjs +45 -0
- package/_cjs/Console.cjs.map +1 -0
- package/_cjs/Fiber/FiberContext.cjs +1219 -0
- package/_cjs/Fiber/FiberContext.cjs.map +1 -0
- package/_cjs/Fiber/api/await.cjs +15 -0
- package/_cjs/Fiber/api/await.cjs.map +1 -0
- package/_cjs/Fiber/api/awaitAll.cjs +28 -0
- package/_cjs/Fiber/api/awaitAll.cjs.map +1 -0
- package/_cjs/Fiber/api/children.cjs +15 -0
- package/_cjs/Fiber/api/children.cjs.map +1 -0
- package/_cjs/Fiber/api/collectAll.cjs +61 -0
- package/_cjs/Fiber/api/collectAll.cjs.map +1 -0
- package/_cjs/Fiber/api/evalOn.cjs +28 -0
- package/_cjs/Fiber/api/evalOn.cjs.map +1 -0
- package/_cjs/Fiber/api/evalOnIO.cjs +33 -0
- package/_cjs/Fiber/api/evalOnIO.cjs.map +1 -0
- package/_cjs/Fiber/api/fromIO.cjs +26 -0
- package/_cjs/Fiber/api/fromIO.cjs.map +1 -0
- package/_cjs/Fiber/api/id.cjs +15 -0
- package/_cjs/Fiber/api/id.cjs.map +1 -0
- package/_cjs/Fiber/api/inheritRefs.cjs +15 -0
- package/_cjs/Fiber/api/inheritRefs.cjs.map +1 -0
- package/_cjs/Fiber/api/interrupt.cjs +27 -0
- package/_cjs/Fiber/api/interrupt.cjs.map +1 -0
- package/_cjs/Fiber/api/interruptAll.cjs +42 -0
- package/_cjs/Fiber/api/interruptAll.cjs.map +1 -0
- package/_cjs/Fiber/api/interruptAs.cjs +15 -0
- package/_cjs/Fiber/api/interruptAs.cjs.map +1 -0
- package/_cjs/Fiber/api/interruptFork.cjs +28 -0
- package/_cjs/Fiber/api/interruptFork.cjs.map +1 -0
- package/_cjs/Fiber/api/join.cjs +29 -0
- package/_cjs/Fiber/api/join.cjs.map +1 -0
- package/_cjs/Fiber/api/joinAll.cjs +30 -0
- package/_cjs/Fiber/api/joinAll.cjs.map +1 -0
- package/_cjs/Fiber/api/location.cjs +21 -0
- package/_cjs/Fiber/api/location.cjs.map +1 -0
- package/_cjs/Fiber/api/mapFiber.cjs +31 -0
- package/_cjs/Fiber/api/mapFiber.cjs.map +1 -0
- package/_cjs/Fiber/api/mapIO.cjs +57 -0
- package/_cjs/Fiber/api/mapIO.cjs.map +1 -0
- package/_cjs/Fiber/api/poll.cjs +15 -0
- package/_cjs/Fiber/api/poll.cjs.map +1 -0
- package/_cjs/Fiber/api/zipWith.cjs +50 -0
- package/_cjs/Fiber/api/zipWith.cjs.map +1 -0
- package/_cjs/Fiber/constructors.cjs +70 -0
- package/_cjs/Fiber/constructors.cjs.map +1 -0
- package/_cjs/Fiber/definition.cjs +48 -0
- package/_cjs/Fiber/definition.cjs.map +1 -0
- package/_cjs/Fiber.cjs +305 -0
- package/_cjs/Fiber.cjs.map +1 -0
- package/_cjs/FiberDescriptor.cjs +26 -0
- package/_cjs/FiberDescriptor.cjs.map +1 -0
- package/_cjs/FiberRef/api/locallyScoped.cjs +26 -0
- package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -0
- package/_cjs/FiberRef/api/locallyScopedWith.cjs +24 -0
- package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -0
- package/_cjs/FiberRef/api.cjs +182 -0
- package/_cjs/FiberRef/api.cjs.map +1 -0
- package/_cjs/FiberRef/constructors.cjs +116 -0
- package/_cjs/FiberRef/constructors.cjs.map +1 -0
- package/_cjs/FiberRef/definition.cjs +76 -0
- package/_cjs/FiberRef/definition.cjs.map +1 -0
- package/_cjs/FiberRef.cjs +71 -0
- package/_cjs/FiberRef.cjs.map +1 -0
- package/_cjs/FiberRefs/api.cjs +31 -0
- package/_cjs/FiberRefs/api.cjs.map +1 -0
- package/_cjs/FiberRefs/definition.cjs +24 -0
- package/_cjs/FiberRefs/definition.cjs.map +1 -0
- package/_cjs/FiberRefs/join.cjs +110 -0
- package/_cjs/FiberRefs/join.cjs.map +1 -0
- package/_cjs/FiberRefs.cjs +45 -0
- package/_cjs/FiberRefs.cjs.map +1 -0
- package/_cjs/FiberScope/constructors.cjs +28 -0
- package/_cjs/FiberScope/constructors.cjs.map +1 -0
- package/_cjs/FiberScope/definition.cjs +60 -0
- package/_cjs/FiberScope/definition.cjs.map +1 -0
- package/_cjs/FiberScope.cjs +32 -0
- package/_cjs/FiberScope.cjs.map +1 -0
- package/_cjs/FiberState/api.cjs +26 -0
- package/_cjs/FiberState/api.cjs.map +1 -0
- package/_cjs/FiberState/constructors.cjs +44 -0
- package/_cjs/FiberState/constructors.cjs.map +1 -0
- package/_cjs/FiberState/definition.cjs +46 -0
- package/_cjs/FiberState/definition.cjs.map +1 -0
- package/_cjs/FiberState.cjs +45 -0
- package/_cjs/FiberState.cjs.map +1 -0
- package/_cjs/FiberStatus/constructors.cjs +42 -0
- package/_cjs/FiberStatus/constructors.cjs.map +1 -0
- package/_cjs/FiberStatus/definition.cjs +107 -0
- package/_cjs/FiberStatus/definition.cjs.map +1 -0
- package/_cjs/FiberStatus.cjs +32 -0
- package/_cjs/FiberStatus.cjs.map +1 -0
- package/_cjs/Future/api.cjs +292 -0
- package/_cjs/Future/api.cjs.map +1 -0
- package/_cjs/Future/constructors.cjs +55 -0
- package/_cjs/Future/constructors.cjs.map +1 -0
- package/_cjs/Future/definition.cjs +45 -0
- package/_cjs/Future/definition.cjs.map +1 -0
- package/_cjs/Future.cjs +45 -0
- package/_cjs/Future.cjs.map +1 -0
- package/_cjs/Hub/api.cjs +456 -0
- package/_cjs/Hub/api.cjs.map +1 -0
- package/_cjs/Hub/definition.cjs +28 -0
- package/_cjs/Hub/definition.cjs.map +1 -0
- package/_cjs/Hub/internal.cjs +449 -0
- package/_cjs/Hub/internal.cjs.map +1 -0
- package/_cjs/Hub.cjs +32 -0
- package/_cjs/Hub.cjs.map +1 -0
- package/_cjs/IO/api/acquireRelease.cjs +23 -0
- package/_cjs/IO/api/acquireRelease.cjs.map +1 -0
- package/_cjs/IO/api/acquireReleaseExit.cjs +25 -0
- package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -0
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs +20 -0
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -0
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +22 -0
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -0
- package/_cjs/IO/api/addFinalizer.cjs +20 -0
- package/_cjs/IO/api/addFinalizer.cjs.map +1 -0
- package/_cjs/IO/api/addFinalizerExit.cjs +32 -0
- package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -0
- package/_cjs/IO/api/bracket.cjs +40 -0
- package/_cjs/IO/api/bracket.cjs.map +1 -0
- package/_cjs/IO/api/bracketExit.cjs +37 -0
- package/_cjs/IO/api/bracketExit.cjs.map +1 -0
- package/_cjs/IO/api/clockWith.cjs +40 -0
- package/_cjs/IO/api/clockWith.cjs.map +1 -0
- package/_cjs/IO/api/concurrency.cjs +72 -0
- package/_cjs/IO/api/concurrency.cjs.map +1 -0
- package/_cjs/IO/api/concurrentFinalizers.cjs +28 -0
- package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -0
- package/_cjs/IO/api/consoleWith.cjs +40 -0
- package/_cjs/IO/api/consoleWith.cjs.map +1 -0
- package/_cjs/IO/api/core-scope.cjs +168 -0
- package/_cjs/IO/api/core-scope.cjs.map +1 -0
- package/_cjs/IO/api/environment.cjs +153 -0
- package/_cjs/IO/api/environment.cjs.map +1 -0
- package/_cjs/IO/api/foreachC.cjs +152 -0
- package/_cjs/IO/api/foreachC.cjs.map +1 -0
- package/_cjs/IO/api/foreachExec.cjs +33 -0
- package/_cjs/IO/api/foreachExec.cjs.map +1 -0
- package/_cjs/IO/api/forkAll.cjs +25 -0
- package/_cjs/IO/api/forkAll.cjs.map +1 -0
- package/_cjs/IO/api/forkIn.cjs +33 -0
- package/_cjs/IO/api/forkIn.cjs.map +1 -0
- package/_cjs/IO/api/forkScoped.cjs +30 -0
- package/_cjs/IO/api/forkScoped.cjs.map +1 -0
- package/_cjs/IO/api/fulfill.cjs +32 -0
- package/_cjs/IO/api/fulfill.cjs.map +1 -0
- package/_cjs/IO/api/interrupt.cjs +204 -0
- package/_cjs/IO/api/interrupt.cjs.map +1 -0
- package/_cjs/IO/api/memoize.cjs +30 -0
- package/_cjs/IO/api/memoize.cjs.map +1 -0
- package/_cjs/IO/api/onExit.cjs +22 -0
- package/_cjs/IO/api/onExit.cjs.map +1 -0
- package/_cjs/IO/api/once.cjs +24 -0
- package/_cjs/IO/api/once.cjs.map +1 -0
- package/_cjs/IO/api/provideLayer.cjs +30 -0
- package/_cjs/IO/api/provideLayer.cjs.map +1 -0
- package/_cjs/IO/api/provideSomeLayer.cjs +37 -0
- package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -0
- package/_cjs/IO/api/race.cjs +47 -0
- package/_cjs/IO/api/race.cjs.map +1 -0
- package/_cjs/IO/api/raceFirst.cjs +35 -0
- package/_cjs/IO/api/raceFirst.cjs.map +1 -0
- package/_cjs/IO/api/randomWith.cjs +40 -0
- package/_cjs/IO/api/randomWith.cjs.map +1 -0
- package/_cjs/IO/api/repeat.cjs +59 -0
- package/_cjs/IO/api/repeat.cjs.map +1 -0
- package/_cjs/IO/api/retry.cjs +56 -0
- package/_cjs/IO/api/retry.cjs.map +1 -0
- package/_cjs/IO/api/schedule.cjs +43 -0
- package/_cjs/IO/api/schedule.cjs.map +1 -0
- package/_cjs/IO/api/scope.cjs +23 -0
- package/_cjs/IO/api/scope.cjs.map +1 -0
- package/_cjs/IO/api/scopeWith.cjs +24 -0
- package/_cjs/IO/api/scopeWith.cjs.map +1 -0
- package/_cjs/IO/api/scoped.cjs +36 -0
- package/_cjs/IO/api/scoped.cjs.map +1 -0
- package/_cjs/IO/api/sequenceT.cjs +24 -0
- package/_cjs/IO/api/sequenceT.cjs.map +1 -0
- package/_cjs/IO/api/sleep.cjs +20 -0
- package/_cjs/IO/api/sleep.cjs.map +1 -0
- package/_cjs/IO/api/stateful.cjs +24 -0
- package/_cjs/IO/api/stateful.cjs.map +1 -0
- package/_cjs/IO/api/withChildren.cjs +24 -0
- package/_cjs/IO/api/withChildren.cjs.map +1 -0
- package/_cjs/IO/api/withFinalizer.cjs +20 -0
- package/_cjs/IO/api/withFinalizer.cjs.map +1 -0
- package/_cjs/IO/api/withFinalizerExit.cjs +22 -0
- package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -0
- package/_cjs/IO/api/withRuntimeConfig.cjs +27 -0
- package/_cjs/IO/api/withRuntimeConfig.cjs.map +1 -0
- package/_cjs/IO/api/zipC.cjs +22 -0
- package/_cjs/IO/api/zipC.cjs.map +1 -0
- package/_cjs/IO/api/zipWithC.cjs +40 -0
- package/_cjs/IO/api/zipWithC.cjs.map +1 -0
- package/_cjs/IO/api.cjs +2142 -0
- package/_cjs/IO/api.cjs.map +1 -0
- package/_cjs/IO/definition.cjs +558 -0
- package/_cjs/IO/definition.cjs.map +1 -0
- package/_cjs/IO/runtime.cjs +144 -0
- package/_cjs/IO/runtime.cjs.map +1 -0
- package/_cjs/IO.cjs +617 -0
- package/_cjs/IO.cjs.map +1 -0
- package/_cjs/IOEnv/definition.cjs +34 -0
- package/_cjs/IOEnv/definition.cjs.map +1 -0
- package/_cjs/IOEnv/live.cjs +31 -0
- package/_cjs/IOEnv/live.cjs.map +1 -0
- package/_cjs/IOEnv/services.cjs +21 -0
- package/_cjs/IOEnv/services.cjs.map +1 -0
- package/_cjs/IOEnv.cjs +45 -0
- package/_cjs/IOEnv.cjs.map +1 -0
- package/_cjs/InterruptStatus/constructors.cjs +36 -0
- package/_cjs/InterruptStatus/constructors.cjs.map +1 -0
- package/_cjs/InterruptStatus/definition.cjs +30 -0
- package/_cjs/InterruptStatus/definition.cjs.map +1 -0
- package/_cjs/InterruptStatus.cjs +32 -0
- package/_cjs/InterruptStatus.cjs.map +1 -0
- package/_cjs/Layer/MemoMap.cjs +215 -0
- package/_cjs/Layer/MemoMap.cjs.map +1 -0
- package/_cjs/Layer/api.cjs +426 -0
- package/_cjs/Layer/api.cjs.map +1 -0
- package/_cjs/Layer/definition.cjs +137 -0
- package/_cjs/Layer/definition.cjs.map +1 -0
- package/_cjs/Layer.cjs +45 -0
- package/_cjs/Layer.cjs.map +1 -0
- package/_cjs/LogLevel.cjs +111 -0
- package/_cjs/LogLevel.cjs.map +1 -0
- package/_cjs/LogSpan.cjs +43 -0
- package/_cjs/LogSpan.cjs.map +1 -0
- package/_cjs/Logger/api.cjs +37 -0
- package/_cjs/Logger/api.cjs.map +1 -0
- package/_cjs/Logger/constructors.cjs +80 -0
- package/_cjs/Logger/constructors.cjs.map +1 -0
- package/_cjs/Logger/definition.cjs +20 -0
- package/_cjs/Logger/definition.cjs.map +1 -0
- package/_cjs/Logger.cjs +45 -0
- package/_cjs/Logger.cjs.map +1 -0
- package/_cjs/Queue/api/dimapIO.cjs +120 -0
- package/_cjs/Queue/api/dimapIO.cjs.map +1 -0
- package/_cjs/Queue/api/filterInputIO.cjs +84 -0
- package/_cjs/Queue/api/filterInputIO.cjs.map +1 -0
- package/_cjs/Queue/api/filterOutputIO.cjs +89 -0
- package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -0
- package/_cjs/Queue/api/operations.cjs +147 -0
- package/_cjs/Queue/api/operations.cjs.map +1 -0
- package/_cjs/Queue/api/poll.cjs +29 -0
- package/_cjs/Queue/api/poll.cjs.map +1 -0
- package/_cjs/Queue/api/takeBetween.cjs +59 -0
- package/_cjs/Queue/api/takeBetween.cjs.map +1 -0
- package/_cjs/Queue/api/zipWithIO.cjs +99 -0
- package/_cjs/Queue/api/zipWithIO.cjs.map +1 -0
- package/_cjs/Queue/api.cjs +97 -0
- package/_cjs/Queue/api.cjs.map +1 -0
- package/_cjs/Queue/constructors.cjs +55 -0
- package/_cjs/Queue/constructors.cjs.map +1 -0
- package/_cjs/Queue/definition.cjs +29 -0
- package/_cjs/Queue/definition.cjs.map +1 -0
- package/_cjs/Queue/internal.cjs +255 -0
- package/_cjs/Queue/internal.cjs.map +1 -0
- package/_cjs/Queue/strategy.cjs +172 -0
- package/_cjs/Queue/strategy.cjs.map +1 -0
- package/_cjs/Queue.cjs +71 -0
- package/_cjs/Queue.cjs.map +1 -0
- package/_cjs/Random/api.cjs +76 -0
- package/_cjs/Random/api.cjs.map +1 -0
- package/_cjs/Random/definition.cjs +28 -0
- package/_cjs/Random/definition.cjs.map +1 -0
- package/_cjs/Random/live.cjs +57 -0
- package/_cjs/Random/live.cjs.map +1 -0
- package/_cjs/Random.cjs +45 -0
- package/_cjs/Random.cjs.map +1 -0
- package/_cjs/Ref/Atomic/Atomic.cjs +64 -0
- package/_cjs/Ref/Atomic/Atomic.cjs.map +1 -0
- package/_cjs/Ref/Atomic/api.cjs +154 -0
- package/_cjs/Ref/Atomic/api.cjs.map +1 -0
- package/_cjs/Ref/Atomic.cjs +32 -0
- package/_cjs/Ref/Atomic.cjs.map +1 -0
- package/_cjs/Ref/Derived.cjs +55 -0
- package/_cjs/Ref/Derived.cjs.map +1 -0
- package/_cjs/Ref/DerivedAll.cjs +55 -0
- package/_cjs/Ref/DerivedAll.cjs.map +1 -0
- package/_cjs/Ref/Synchronized/api.cjs +197 -0
- package/_cjs/Ref/Synchronized/api.cjs.map +1 -0
- package/_cjs/Ref/Synchronized/constructors.cjs +38 -0
- package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -0
- package/_cjs/Ref/Synchronized/definition.cjs +88 -0
- package/_cjs/Ref/Synchronized/definition.cjs.map +1 -0
- package/_cjs/Ref/api/collect.cjs +31 -0
- package/_cjs/Ref/api/collect.cjs.map +1 -0
- package/_cjs/Ref/api/dimap.cjs +110 -0
- package/_cjs/Ref/api/dimap.cjs.map +1 -0
- package/_cjs/Ref/api/filter.cjs +45 -0
- package/_cjs/Ref/api/filter.cjs.map +1 -0
- package/_cjs/Ref/api/get.cjs +20 -0
- package/_cjs/Ref/api/get.cjs.map +1 -0
- package/_cjs/Ref/api/match.cjs +26 -0
- package/_cjs/Ref/api/match.cjs.map +1 -0
- package/_cjs/Ref/api/matchAll.cjs +24 -0
- package/_cjs/Ref/api/matchAll.cjs.map +1 -0
- package/_cjs/Ref/api/modify.cjs +240 -0
- package/_cjs/Ref/api/modify.cjs.map +1 -0
- package/_cjs/Ref/api/set.cjs +21 -0
- package/_cjs/Ref/api/set.cjs.map +1 -0
- package/_cjs/Ref/api.cjs +158 -0
- package/_cjs/Ref/api.cjs.map +1 -0
- package/_cjs/Ref/constructors.cjs +35 -0
- package/_cjs/Ref/constructors.cjs.map +1 -0
- package/_cjs/Ref/definition.cjs +23 -0
- package/_cjs/Ref/definition.cjs.map +1 -0
- package/_cjs/Ref.cjs +123 -0
- package/_cjs/Ref.cjs.map +1 -0
- package/_cjs/RuntimeConfig.cjs +55 -0
- package/_cjs/RuntimeConfig.cjs.map +1 -0
- package/_cjs/STM/api/core-api.cjs +83 -0
- package/_cjs/STM/api/core-api.cjs.map +1 -0
- package/_cjs/STM/api/core-constructors.cjs +90 -0
- package/_cjs/STM/api/core-constructors.cjs.map +1 -0
- package/_cjs/STM/api.cjs +758 -0
- package/_cjs/STM/api.cjs.map +1 -0
- package/_cjs/STM/definition.cjs +213 -0
- package/_cjs/STM/definition.cjs.map +1 -0
- package/_cjs/STM/driver.cjs +184 -0
- package/_cjs/STM/driver.cjs.map +1 -0
- package/_cjs/STM/internal/CommitState.cjs +89 -0
- package/_cjs/STM/internal/CommitState.cjs.map +1 -0
- package/_cjs/STM/internal/Entry.cjs +89 -0
- package/_cjs/STM/internal/Entry.cjs.map +1 -0
- package/_cjs/STM/internal/Journal.cjs +414 -0
- package/_cjs/STM/internal/Journal.cjs.map +1 -0
- package/_cjs/STM/internal/TryCommit.cjs +35 -0
- package/_cjs/STM/internal/TryCommit.cjs.map +1 -0
- package/_cjs/STM/internal/Versioned.cjs +19 -0
- package/_cjs/STM/internal/Versioned.cjs.map +1 -0
- package/_cjs/STM.cjs +71 -0
- package/_cjs/STM.cjs.map +1 -0
- package/_cjs/Schedule/Decision.cjs +67 -0
- package/_cjs/Schedule/Decision.cjs.map +1 -0
- package/_cjs/Schedule/Driver.cjs +32 -0
- package/_cjs/Schedule/Driver.cjs.map +1 -0
- package/_cjs/Schedule/Interval.cjs +154 -0
- package/_cjs/Schedule/Interval.cjs.map +1 -0
- package/_cjs/Schedule/api/driver.cjs +50 -0
- package/_cjs/Schedule/api/driver.cjs.map +1 -0
- package/_cjs/Schedule/api.cjs +790 -0
- package/_cjs/Schedule/api.cjs.map +1 -0
- package/_cjs/Schedule/definition.cjs +41 -0
- package/_cjs/Schedule/definition.cjs.map +1 -0
- package/_cjs/Schedule.cjs +71 -0
- package/_cjs/Schedule.cjs.map +1 -0
- package/_cjs/Scope/Finalizer/definition.cjs +24 -0
- package/_cjs/Scope/Finalizer/definition.cjs.map +1 -0
- package/_cjs/Scope/Finalizer.cjs +19 -0
- package/_cjs/Scope/Finalizer.cjs.map +1 -0
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +46 -0
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -0
- package/_cjs/Scope/ReleaseMap/api.cjs +110 -0
- package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -0
- package/_cjs/Scope/ReleaseMap/constructors.cjs +39 -0
- package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -0
- package/_cjs/Scope/ReleaseMap/definition.cjs +39 -0
- package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -0
- package/_cjs/Scope/ReleaseMap.cjs +45 -0
- package/_cjs/Scope/ReleaseMap.cjs.map +1 -0
- package/_cjs/Scope/api.cjs +178 -0
- package/_cjs/Scope/api.cjs.map +1 -0
- package/_cjs/Scope/definition.cjs +45 -0
- package/_cjs/Scope/definition.cjs.map +1 -0
- package/_cjs/Scope.cjs +32 -0
- package/_cjs/Scope.cjs.map +1 -0
- package/_cjs/ScopedRef/api.cjs +73 -0
- package/_cjs/ScopedRef/api.cjs.map +1 -0
- package/_cjs/ScopedRef/definition.cjs +23 -0
- package/_cjs/ScopedRef/definition.cjs.map +1 -0
- package/_cjs/ScopedRef.cjs +32 -0
- package/_cjs/ScopedRef.cjs.map +1 -0
- package/_cjs/Sink/api.cjs +102 -0
- package/_cjs/Sink/api.cjs.map +1 -0
- package/_cjs/Sink/definition.cjs +25 -0
- package/_cjs/Sink/definition.cjs.map +1 -0
- package/_cjs/Sink.cjs +32 -0
- package/_cjs/Sink.cjs.map +1 -0
- package/_cjs/State/api.cjs +76 -0
- package/_cjs/State/api.cjs.map +1 -0
- package/_cjs/State/definition.cjs +30 -0
- package/_cjs/State/definition.cjs.map +1 -0
- package/_cjs/State/internal.cjs +18 -0
- package/_cjs/State/internal.cjs.map +1 -0
- package/_cjs/State.cjs +32 -0
- package/_cjs/State.cjs.map +1 -0
- package/_cjs/Stream/api/zipAllWith.cjs +127 -0
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -0
- package/_cjs/Stream/api/zipWith.cjs +22 -0
- package/_cjs/Stream/api/zipWith.cjs.map +1 -0
- package/_cjs/Stream/api/zipWithChunks.cjs +100 -0
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -0
- package/_cjs/Stream/api.cjs +2517 -0
- package/_cjs/Stream/api.cjs.map +1 -0
- package/_cjs/Stream/definition.cjs +55 -0
- package/_cjs/Stream/definition.cjs.map +1 -0
- package/_cjs/Stream/internal/DebounceState.cjs +99 -0
- package/_cjs/Stream/internal/DebounceState.cjs.map +1 -0
- package/_cjs/Stream/internal/Handoff.cjs +222 -0
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -0
- package/_cjs/Stream/internal/Pull.cjs +89 -0
- package/_cjs/Stream/internal/Pull.cjs.map +1 -0
- package/_cjs/Stream/internal/SinkEndReason.cjs +87 -0
- package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -0
- package/_cjs/Stream/internal/Take.cjs +249 -0
- package/_cjs/Stream/internal/Take.cjs.map +1 -0
- package/_cjs/Stream/internal/util.cjs +34 -0
- package/_cjs/Stream/internal/util.cjs.map +1 -0
- package/_cjs/Stream.cjs +32 -0
- package/_cjs/Stream.cjs.map +1 -0
- package/_cjs/Supervisor/api.cjs +56 -0
- package/_cjs/Supervisor/api.cjs.map +1 -0
- package/_cjs/Supervisor/constructors.cjs +92 -0
- package/_cjs/Supervisor/constructors.cjs.map +1 -0
- package/_cjs/Supervisor/definition.cjs +89 -0
- package/_cjs/Supervisor/definition.cjs.map +1 -0
- package/_cjs/Supervisor.cjs +45 -0
- package/_cjs/Supervisor.cjs.map +1 -0
- package/_cjs/TExit/constructors.cjs +59 -0
- package/_cjs/TExit/constructors.cjs.map +1 -0
- package/_cjs/TExit/definition.cjs +214 -0
- package/_cjs/TExit/definition.cjs.map +1 -0
- package/_cjs/TExit.cjs +32 -0
- package/_cjs/TExit.cjs.map +1 -0
- package/_cjs/TFuture/api.cjs +76 -0
- package/_cjs/TFuture/api.cjs.map +1 -0
- package/_cjs/TFuture/constructors.cjs +42 -0
- package/_cjs/TFuture/constructors.cjs.map +1 -0
- package/_cjs/TFuture/definition.cjs +16 -0
- package/_cjs/TFuture/definition.cjs.map +1 -0
- package/_cjs/TFuture.cjs +45 -0
- package/_cjs/TFuture.cjs.map +1 -0
- package/_cjs/TRef/api.cjs +372 -0
- package/_cjs/TRef/api.cjs.map +1 -0
- package/_cjs/TRef/constructors.cjs +98 -0
- package/_cjs/TRef/constructors.cjs.map +1 -0
- package/_cjs/TRef/definition.cjs +101 -0
- package/_cjs/TRef/definition.cjs.map +1 -0
- package/_cjs/TRef.cjs +45 -0
- package/_cjs/TRef.cjs.map +1 -0
- package/_cjs/TSemaphore/api.cjs +104 -0
- package/_cjs/TSemaphore/api.cjs.map +1 -0
- package/_cjs/TSemaphore/constructors.cjs +34 -0
- package/_cjs/TSemaphore/constructors.cjs.map +1 -0
- package/_cjs/TSemaphore/definition.cjs +16 -0
- package/_cjs/TSemaphore/definition.cjs.map +1 -0
- package/_cjs/TSemaphore.cjs +45 -0
- package/_cjs/TSemaphore.cjs.map +1 -0
- package/_cjs/TxnId.cjs +21 -0
- package/_cjs/TxnId.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/findIO.cjs +54 -0
- package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/mapIO.cjs +29 -0
- package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +53 -0
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc.cjs +45 -0
- package/_cjs/collection/immutable/Conc.cjs.map +1 -0
- package/_cjs/data/Exit/foreachIO.cjs +29 -0
- package/_cjs/data/Exit/foreachIO.cjs.map +1 -0
- package/_cjs/internal/HashedPair.cjs +37 -0
- package/_cjs/internal/HashedPair.cjs.map +1 -0
- package/_cjs/internal/Hub.cjs +758 -0
- package/_cjs/internal/Hub.cjs.map +1 -0
- package/_cjs/internal/MutableQueue.cjs +315 -0
- package/_cjs/internal/MutableQueue.cjs.map +1 -0
- package/_cjs/internal/Scheduler.cjs +33 -0
- package/_cjs/internal/Scheduler.cjs.map +1 -0
- package/_cjs/internal/StackTraceBuilder.cjs +36 -0
- package/_cjs/internal/StackTraceBuilder.cjs.map +1 -0
- package/_mjs/Cached/api.mjs +57 -0
- package/_mjs/Cached/api.mjs.map +1 -0
- package/_mjs/Cached/definition.mjs +22 -0
- package/_mjs/Cached/definition.mjs.map +1 -0
- package/_mjs/Cached/internal.mjs +8 -0
- package/_mjs/Cached/internal.mjs.map +1 -0
- package/_mjs/Cached.mjs +5 -0
- package/_mjs/Cached.mjs.map +1 -0
- package/_mjs/CancellerState.mjs +44 -0
- package/_mjs/CancellerState.mjs.map +1 -0
- package/_mjs/Channel/ChildExecutorDecision/api.mjs +22 -0
- package/_mjs/Channel/ChildExecutorDecision/api.mjs.map +1 -0
- package/_mjs/Channel/ChildExecutorDecision/definition.mjs +25 -0
- package/_mjs/Channel/ChildExecutorDecision/definition.mjs.map +1 -0
- package/_mjs/Channel/ChildExecutorDecision.mjs +4 -0
- package/_mjs/Channel/ChildExecutorDecision.mjs.map +1 -0
- package/_mjs/Channel/UpstreamPullRequest/api.mjs +34 -0
- package/_mjs/Channel/UpstreamPullRequest/api.mjs.map +1 -0
- package/_mjs/Channel/UpstreamPullRequest/definition.mjs +16 -0
- package/_mjs/Channel/UpstreamPullRequest/definition.mjs.map +1 -0
- package/_mjs/Channel/UpstreamPullRequest.mjs +4 -0
- package/_mjs/Channel/UpstreamPullRequest.mjs.map +1 -0
- package/_mjs/Channel/UpstreamPullStrategy/definition.mjs +21 -0
- package/_mjs/Channel/UpstreamPullStrategy/definition.mjs.map +1 -0
- package/_mjs/Channel/UpstreamPullStrategy.mjs +3 -0
- package/_mjs/Channel/UpstreamPullStrategy.mjs.map +1 -0
- package/_mjs/Channel/api/interruptWhen.mjs +35 -0
- package/_mjs/Channel/api/interruptWhen.mjs.map +1 -0
- package/_mjs/Channel/api/mapOutIOC.mjs +32 -0
- package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -0
- package/_mjs/Channel/api/mergeAll.mjs +9 -0
- package/_mjs/Channel/api/mergeAll.mjs.map +1 -0
- package/_mjs/Channel/api/mergeAllUnboundedWith.mjs +9 -0
- package/_mjs/Channel/api/mergeAllUnboundedWith.mjs.map +1 -0
- package/_mjs/Channel/api/mergeAllWith.mjs +58 -0
- package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -0
- package/_mjs/Channel/api/mergeMap.mjs +10 -0
- package/_mjs/Channel/api/mergeMap.mjs.map +1 -0
- package/_mjs/Channel/api/mergeWith.mjs +74 -0
- package/_mjs/Channel/api/mergeWith.mjs.map +1 -0
- package/_mjs/Channel/api/run.mjs +12 -0
- package/_mjs/Channel/api/run.mjs.map +1 -0
- package/_mjs/Channel/api/runCollect.mjs +10 -0
- package/_mjs/Channel/api/runCollect.mjs.map +1 -0
- package/_mjs/Channel/api/runDrain.mjs +12 -0
- package/_mjs/Channel/api/runDrain.mjs.map +1 -0
- package/_mjs/Channel/api/runScoped.mjs +55 -0
- package/_mjs/Channel/api/runScoped.mjs.map +1 -0
- package/_mjs/Channel/api/toPull.mjs +46 -0
- package/_mjs/Channel/api/toPull.mjs.map +1 -0
- package/_mjs/Channel/api/zipC.mjs +30 -0
- package/_mjs/Channel/api/zipC.mjs.map +1 -0
- package/_mjs/Channel/api.mjs +727 -0
- package/_mjs/Channel/api.mjs.map +1 -0
- package/_mjs/Channel/core-api.mjs +123 -0
- package/_mjs/Channel/core-api.mjs.map +1 -0
- package/_mjs/Channel/definition.mjs +195 -0
- package/_mjs/Channel/definition.mjs.map +1 -0
- package/_mjs/Channel/internal/AsyncInputConsumer.mjs +2 -0
- package/_mjs/Channel/internal/AsyncInputConsumer.mjs.map +1 -0
- package/_mjs/Channel/internal/AsyncInputProducer.mjs +2 -0
- package/_mjs/Channel/internal/AsyncInputProducer.mjs.map +1 -0
- package/_mjs/Channel/internal/ChannelExecutor.mjs +913 -0
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -0
- package/_mjs/Channel/internal/ChannelState.mjs +67 -0
- package/_mjs/Channel/internal/ChannelState.mjs.map +1 -0
- package/_mjs/Channel/internal/MergeDecision.mjs +61 -0
- package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -0
- package/_mjs/Channel/internal/MergeState.mjs +51 -0
- package/_mjs/Channel/internal/MergeState.mjs.map +1 -0
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +234 -0
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -0
- package/_mjs/Channel.mjs +5 -0
- package/_mjs/Channel.mjs.map +1 -0
- package/_mjs/Clock/api.mjs +15 -0
- package/_mjs/Clock/api.mjs.map +1 -0
- package/_mjs/Clock/definition.mjs +13 -0
- package/_mjs/Clock/definition.mjs.map +1 -0
- package/_mjs/Clock/live.mjs +30 -0
- package/_mjs/Clock/live.mjs.map +1 -0
- package/_mjs/Clock.mjs +5 -0
- package/_mjs/Clock.mjs.map +1 -0
- package/_mjs/Console/api.mjs +16 -0
- package/_mjs/Console/api.mjs.map +1 -0
- package/_mjs/Console/definition.mjs +13 -0
- package/_mjs/Console/definition.mjs.map +1 -0
- package/_mjs/Console/live.mjs +23 -0
- package/_mjs/Console/live.mjs.map +1 -0
- package/_mjs/Console.mjs +5 -0
- package/_mjs/Console.mjs.map +1 -0
- package/_mjs/Fiber/FiberContext.mjs +1141 -0
- package/_mjs/Fiber/FiberContext.mjs.map +1 -0
- package/_mjs/Fiber/api/await.mjs +8 -0
- package/_mjs/Fiber/api/await.mjs.map +1 -0
- package/_mjs/Fiber/api/awaitAll.mjs +14 -0
- package/_mjs/Fiber/api/awaitAll.mjs.map +1 -0
- package/_mjs/Fiber/api/children.mjs +8 -0
- package/_mjs/Fiber/api/children.mjs.map +1 -0
- package/_mjs/Fiber/api/collectAll.mjs +31 -0
- package/_mjs/Fiber/api/collectAll.mjs.map +1 -0
- package/_mjs/Fiber/api/evalOn.mjs +17 -0
- package/_mjs/Fiber/api/evalOn.mjs.map +1 -0
- package/_mjs/Fiber/api/evalOnIO.mjs +17 -0
- package/_mjs/Fiber/api/evalOnIO.mjs.map +1 -0
- package/_mjs/Fiber/api/fromIO.mjs +13 -0
- package/_mjs/Fiber/api/fromIO.mjs.map +1 -0
- package/_mjs/Fiber/api/id.mjs +8 -0
- package/_mjs/Fiber/api/id.mjs.map +1 -0
- package/_mjs/Fiber/api/inheritRefs.mjs +8 -0
- package/_mjs/Fiber/api/inheritRefs.mjs.map +1 -0
- package/_mjs/Fiber/api/interrupt.mjs +15 -0
- package/_mjs/Fiber/api/interrupt.mjs.map +1 -0
- package/_mjs/Fiber/api/interruptAll.mjs +25 -0
- package/_mjs/Fiber/api/interruptAll.mjs.map +1 -0
- package/_mjs/Fiber/api/interruptAs.mjs +8 -0
- package/_mjs/Fiber/api/interruptAs.mjs.map +1 -0
- package/_mjs/Fiber/api/interruptFork.mjs +15 -0
- package/_mjs/Fiber/api/interruptFork.mjs.map +1 -0
- package/_mjs/Fiber/api/join.mjs +17 -0
- package/_mjs/Fiber/api/join.mjs.map +1 -0
- package/_mjs/Fiber/api/joinAll.mjs +16 -0
- package/_mjs/Fiber/api/joinAll.mjs.map +1 -0
- package/_mjs/Fiber/api/location.mjs +10 -0
- package/_mjs/Fiber/api/location.mjs.map +1 -0
- package/_mjs/Fiber/api/mapFiber.mjs +16 -0
- package/_mjs/Fiber/api/mapFiber.mjs.map +1 -0
- package/_mjs/Fiber/api/mapIO.mjs +33 -0
- package/_mjs/Fiber/api/mapIO.mjs.map +1 -0
- package/_mjs/Fiber/api/poll.mjs +8 -0
- package/_mjs/Fiber/api/poll.mjs.map +1 -0
- package/_mjs/Fiber/api/zipWith.mjs +26 -0
- package/_mjs/Fiber/api/zipWith.mjs.map +1 -0
- package/_mjs/Fiber/constructors.mjs +45 -0
- package/_mjs/Fiber/constructors.mjs.map +1 -0
- package/_mjs/Fiber/definition.mjs +27 -0
- package/_mjs/Fiber/definition.mjs.map +1 -0
- package/_mjs/Fiber.mjs +27 -0
- package/_mjs/Fiber.mjs.map +1 -0
- package/_mjs/FiberDescriptor.mjs +17 -0
- package/_mjs/FiberDescriptor.mjs.map +1 -0
- package/_mjs/FiberRef/api/locallyScoped.mjs +12 -0
- package/_mjs/FiberRef/api/locallyScoped.mjs.map +1 -0
- package/_mjs/FiberRef/api/locallyScopedWith.mjs +11 -0
- package/_mjs/FiberRef/api/locallyScopedWith.mjs.map +1 -0
- package/_mjs/FiberRef/api.mjs +139 -0
- package/_mjs/FiberRef/api.mjs.map +1 -0
- package/_mjs/FiberRef/constructors.mjs +82 -0
- package/_mjs/FiberRef/constructors.mjs.map +1 -0
- package/_mjs/FiberRef/definition.mjs +50 -0
- package/_mjs/FiberRef/definition.mjs.map +1 -0
- package/_mjs/FiberRef.mjs +9 -0
- package/_mjs/FiberRef.mjs.map +1 -0
- package/_mjs/FiberRefs/api.mjs +17 -0
- package/_mjs/FiberRefs/api.mjs.map +1 -0
- package/_mjs/FiberRefs/definition.mjs +14 -0
- package/_mjs/FiberRefs/definition.mjs.map +1 -0
- package/_mjs/FiberRefs/join.mjs +90 -0
- package/_mjs/FiberRefs/join.mjs.map +1 -0
- package/_mjs/FiberRefs.mjs +5 -0
- package/_mjs/FiberRefs.mjs.map +1 -0
- package/_mjs/FiberScope/constructors.mjs +18 -0
- package/_mjs/FiberScope/constructors.mjs.map +1 -0
- package/_mjs/FiberScope/definition.mjs +41 -0
- package/_mjs/FiberScope/definition.mjs.map +1 -0
- package/_mjs/FiberScope.mjs +4 -0
- package/_mjs/FiberScope.mjs.map +1 -0
- package/_mjs/FiberState/api.mjs +15 -0
- package/_mjs/FiberState/api.mjs.map +1 -0
- package/_mjs/FiberState/constructors.mjs +26 -0
- package/_mjs/FiberState/constructors.mjs.map +1 -0
- package/_mjs/FiberState/definition.mjs +26 -0
- package/_mjs/FiberState/definition.mjs.map +1 -0
- package/_mjs/FiberState.mjs +5 -0
- package/_mjs/FiberState.mjs.map +1 -0
- package/_mjs/FiberStatus/constructors.mjs +28 -0
- package/_mjs/FiberStatus/constructors.mjs.map +1 -0
- package/_mjs/FiberStatus/definition.mjs +88 -0
- package/_mjs/FiberStatus/definition.mjs.map +1 -0
- package/_mjs/FiberStatus.mjs +4 -0
- package/_mjs/FiberStatus.mjs.map +1 -0
- package/_mjs/Future/api.mjs +249 -0
- package/_mjs/Future/api.mjs.map +1 -0
- package/_mjs/Future/constructors.mjs +36 -0
- package/_mjs/Future/constructors.mjs.map +1 -0
- package/_mjs/Future/definition.mjs +30 -0
- package/_mjs/Future/definition.mjs.map +1 -0
- package/_mjs/Future.mjs +5 -0
- package/_mjs/Future.mjs.map +1 -0
- package/_mjs/Hub/api.mjs +384 -0
- package/_mjs/Hub/api.mjs.map +1 -0
- package/_mjs/Hub/definition.mjs +15 -0
- package/_mjs/Hub/definition.mjs.map +1 -0
- package/_mjs/Hub/internal.mjs +400 -0
- package/_mjs/Hub/internal.mjs.map +1 -0
- package/_mjs/Hub.mjs +4 -0
- package/_mjs/Hub.mjs.map +1 -0
- package/_mjs/IO/api/acquireRelease.mjs +11 -0
- package/_mjs/IO/api/acquireRelease.mjs.map +1 -0
- package/_mjs/IO/api/acquireReleaseExit.mjs +12 -0
- package/_mjs/IO/api/acquireReleaseExit.mjs.map +1 -0
- package/_mjs/IO/api/acquireReleaseInterruptible.mjs +9 -0
- package/_mjs/IO/api/acquireReleaseInterruptible.mjs.map +1 -0
- package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs +10 -0
- package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs.map +1 -0
- package/_mjs/IO/api/addFinalizer.mjs +9 -0
- package/_mjs/IO/api/addFinalizer.mjs.map +1 -0
- package/_mjs/IO/api/addFinalizerExit.mjs +17 -0
- package/_mjs/IO/api/addFinalizerExit.mjs.map +1 -0
- package/_mjs/IO/api/bracket.mjs +29 -0
- package/_mjs/IO/api/bracket.mjs.map +1 -0
- package/_mjs/IO/api/bracketExit.mjs +22 -0
- package/_mjs/IO/api/bracketExit.mjs.map +1 -0
- package/_mjs/IO/api/clockWith.mjs +21 -0
- package/_mjs/IO/api/clockWith.mjs.map +1 -0
- package/_mjs/IO/api/concurrency.mjs +49 -0
- package/_mjs/IO/api/concurrency.mjs.map +1 -0
- package/_mjs/IO/api/concurrentFinalizers.mjs +13 -0
- package/_mjs/IO/api/concurrentFinalizers.mjs.map +1 -0
- package/_mjs/IO/api/consoleWith.mjs +21 -0
- package/_mjs/IO/api/consoleWith.mjs.map +1 -0
- package/_mjs/IO/api/core-scope.mjs +130 -0
- package/_mjs/IO/api/core-scope.mjs.map +1 -0
- package/_mjs/IO/api/environment.mjs +116 -0
- package/_mjs/IO/api/environment.mjs.map +1 -0
- package/_mjs/IO/api/foreachC.mjs +119 -0
- package/_mjs/IO/api/foreachC.mjs.map +1 -0
- package/_mjs/IO/api/foreachExec.mjs +18 -0
- package/_mjs/IO/api/foreachExec.mjs.map +1 -0
- package/_mjs/IO/api/forkAll.mjs +13 -0
- package/_mjs/IO/api/forkAll.mjs.map +1 -0
- package/_mjs/IO/api/forkIn.mjs +18 -0
- package/_mjs/IO/api/forkIn.mjs.map +1 -0
- package/_mjs/IO/api/forkScoped.mjs +15 -0
- package/_mjs/IO/api/forkScoped.mjs.map +1 -0
- package/_mjs/IO/api/fulfill.mjs +18 -0
- package/_mjs/IO/api/fulfill.mjs.map +1 -0
- package/_mjs/IO/api/interrupt.mjs +171 -0
- package/_mjs/IO/api/interrupt.mjs.map +1 -0
- package/_mjs/IO/api/memoize.mjs +16 -0
- package/_mjs/IO/api/memoize.mjs.map +1 -0
- package/_mjs/IO/api/onExit.mjs +10 -0
- package/_mjs/IO/api/onExit.mjs.map +1 -0
- package/_mjs/IO/api/once.mjs +11 -0
- package/_mjs/IO/api/once.mjs.map +1 -0
- package/_mjs/IO/api/provideLayer.mjs +14 -0
- package/_mjs/IO/api/provideLayer.mjs.map +1 -0
- package/_mjs/IO/api/provideSomeLayer.mjs +21 -0
- package/_mjs/IO/api/provideSomeLayer.mjs.map +1 -0
- package/_mjs/IO/api/race.mjs +29 -0
- package/_mjs/IO/api/race.mjs.map +1 -0
- package/_mjs/IO/api/raceFirst.mjs +22 -0
- package/_mjs/IO/api/raceFirst.mjs.map +1 -0
- package/_mjs/IO/api/randomWith.mjs +21 -0
- package/_mjs/IO/api/randomWith.mjs.map +1 -0
- package/_mjs/IO/api/repeat.mjs +38 -0
- package/_mjs/IO/api/repeat.mjs.map +1 -0
- package/_mjs/IO/api/retry.mjs +36 -0
- package/_mjs/IO/api/retry.mjs.map +1 -0
- package/_mjs/IO/api/schedule.mjs +27 -0
- package/_mjs/IO/api/schedule.mjs.map +1 -0
- package/_mjs/IO/api/scope.mjs +9 -0
- package/_mjs/IO/api/scope.mjs.map +1 -0
- package/_mjs/IO/api/scopeWith.mjs +11 -0
- package/_mjs/IO/api/scopeWith.mjs.map +1 -0
- package/_mjs/IO/api/scoped.mjs +20 -0
- package/_mjs/IO/api/scoped.mjs.map +1 -0
- package/_mjs/IO/api/sequenceT.mjs +11 -0
- package/_mjs/IO/api/sequenceT.mjs.map +1 -0
- package/_mjs/IO/api/sleep.mjs +9 -0
- package/_mjs/IO/api/sleep.mjs.map +1 -0
- package/_mjs/IO/api/stateful.mjs +11 -0
- package/_mjs/IO/api/stateful.mjs.map +1 -0
- package/_mjs/IO/api/withChildren.mjs +11 -0
- package/_mjs/IO/api/withChildren.mjs.map +1 -0
- package/_mjs/IO/api/withFinalizer.mjs +9 -0
- package/_mjs/IO/api/withFinalizer.mjs.map +1 -0
- package/_mjs/IO/api/withFinalizerExit.mjs +10 -0
- package/_mjs/IO/api/withFinalizerExit.mjs.map +1 -0
- package/_mjs/IO/api/withRuntimeConfig.mjs +14 -0
- package/_mjs/IO/api/withRuntimeConfig.mjs.map +1 -0
- package/_mjs/IO/api/zipC.mjs +10 -0
- package/_mjs/IO/api/zipC.mjs.map +1 -0
- package/_mjs/IO/api/zipWithC.mjs +23 -0
- package/_mjs/IO/api/zipWithC.mjs.map +1 -0
- package/_mjs/IO/api.mjs +1804 -0
- package/_mjs/IO/api.mjs.map +1 -0
- package/_mjs/IO/definition.mjs +444 -0
- package/_mjs/IO/definition.mjs.map +1 -0
- package/_mjs/IO/runtime.mjs +97 -0
- package/_mjs/IO/runtime.mjs.map +1 -0
- package/_mjs/IO.mjs +51 -0
- package/_mjs/IO.mjs.map +1 -0
- package/_mjs/IOEnv/definition.mjs +14 -0
- package/_mjs/IOEnv/definition.mjs.map +1 -0
- package/_mjs/IOEnv/live.mjs +13 -0
- package/_mjs/IOEnv/live.mjs.map +1 -0
- package/_mjs/IOEnv/services.mjs +8 -0
- package/_mjs/IOEnv/services.mjs.map +1 -0
- package/_mjs/IOEnv.mjs +5 -0
- package/_mjs/IOEnv.mjs.map +1 -0
- package/_mjs/InterruptStatus/constructors.mjs +21 -0
- package/_mjs/InterruptStatus/constructors.mjs.map +1 -0
- package/_mjs/InterruptStatus/definition.mjs +21 -0
- package/_mjs/InterruptStatus/definition.mjs.map +1 -0
- package/_mjs/InterruptStatus.mjs +4 -0
- package/_mjs/InterruptStatus.mjs.map +1 -0
- package/_mjs/Layer/MemoMap.mjs +171 -0
- package/_mjs/Layer/MemoMap.mjs.map +1 -0
- package/_mjs/Layer/api.mjs +338 -0
- package/_mjs/Layer/api.mjs.map +1 -0
- package/_mjs/Layer/definition.mjs +104 -0
- package/_mjs/Layer/definition.mjs.map +1 -0
- package/_mjs/Layer.mjs +5 -0
- package/_mjs/Layer.mjs.map +1 -0
- package/_mjs/LogLevel.mjs +85 -0
- package/_mjs/LogLevel.mjs.map +1 -0
- package/_mjs/LogSpan.mjs +32 -0
- package/_mjs/LogSpan.mjs.map +1 -0
- package/_mjs/Logger/api.mjs +23 -0
- package/_mjs/Logger/api.mjs.map +1 -0
- package/_mjs/Logger/constructors.mjs +63 -0
- package/_mjs/Logger/constructors.mjs.map +1 -0
- package/_mjs/Logger/definition.mjs +11 -0
- package/_mjs/Logger/definition.mjs.map +1 -0
- package/_mjs/Logger.mjs +5 -0
- package/_mjs/Logger.mjs.map +1 -0
- package/_mjs/Queue/api/dimapIO.mjs +97 -0
- package/_mjs/Queue/api/dimapIO.mjs.map +1 -0
- package/_mjs/Queue/api/filterInputIO.mjs +63 -0
- package/_mjs/Queue/api/filterInputIO.mjs.map +1 -0
- package/_mjs/Queue/api/filterOutputIO.mjs +68 -0
- package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -0
- package/_mjs/Queue/api/operations.mjs +122 -0
- package/_mjs/Queue/api/operations.mjs.map +1 -0
- package/_mjs/Queue/api/poll.mjs +15 -0
- package/_mjs/Queue/api/poll.mjs.map +1 -0
- package/_mjs/Queue/api/takeBetween.mjs +44 -0
- package/_mjs/Queue/api/takeBetween.mjs.map +1 -0
- package/_mjs/Queue/api/zipWithIO.mjs +75 -0
- package/_mjs/Queue/api/zipWithIO.mjs.map +1 -0
- package/_mjs/Queue/api.mjs +9 -0
- package/_mjs/Queue/api.mjs.map +1 -0
- package/_mjs/Queue/constructors.mjs +34 -0
- package/_mjs/Queue/constructors.mjs.map +1 -0
- package/_mjs/Queue/definition.mjs +17 -0
- package/_mjs/Queue/definition.mjs.map +1 -0
- package/_mjs/Queue/internal.mjs +224 -0
- package/_mjs/Queue/internal.mjs.map +1 -0
- package/_mjs/Queue/strategy.mjs +147 -0
- package/_mjs/Queue/strategy.mjs.map +1 -0
- package/_mjs/Queue.mjs +7 -0
- package/_mjs/Queue.mjs.map +1 -0
- package/_mjs/Random/api.mjs +52 -0
- package/_mjs/Random/api.mjs.map +1 -0
- package/_mjs/Random/definition.mjs +13 -0
- package/_mjs/Random/definition.mjs.map +1 -0
- package/_mjs/Random/live.mjs +40 -0
- package/_mjs/Random/live.mjs.map +1 -0
- package/_mjs/Random.mjs +5 -0
- package/_mjs/Random.mjs.map +1 -0
- package/_mjs/Ref/Atomic/Atomic.mjs +47 -0
- package/_mjs/Ref/Atomic/Atomic.mjs.map +1 -0
- package/_mjs/Ref/Atomic/api.mjs +124 -0
- package/_mjs/Ref/Atomic/api.mjs.map +1 -0
- package/_mjs/Ref/Atomic.mjs +4 -0
- package/_mjs/Ref/Atomic.mjs.map +1 -0
- package/_mjs/Ref/Derived.mjs +35 -0
- package/_mjs/Ref/Derived.mjs.map +1 -0
- package/_mjs/Ref/DerivedAll.mjs +35 -0
- package/_mjs/Ref/DerivedAll.mjs.map +1 -0
- package/_mjs/Ref/Synchronized/api.mjs +155 -0
- package/_mjs/Ref/Synchronized/api.mjs.map +1 -0
- package/_mjs/Ref/Synchronized/constructors.mjs +20 -0
- package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -0
- package/_mjs/Ref/Synchronized/definition.mjs +66 -0
- package/_mjs/Ref/Synchronized/definition.mjs.map +1 -0
- package/_mjs/Ref/api/collect.mjs +17 -0
- package/_mjs/Ref/api/collect.mjs.map +1 -0
- package/_mjs/Ref/api/dimap.mjs +84 -0
- package/_mjs/Ref/api/dimap.mjs.map +1 -0
- package/_mjs/Ref/api/filter.mjs +29 -0
- package/_mjs/Ref/api/filter.mjs.map +1 -0
- package/_mjs/Ref/api/get.mjs +13 -0
- package/_mjs/Ref/api/get.mjs.map +1 -0
- package/_mjs/Ref/api/match.mjs +18 -0
- package/_mjs/Ref/api/match.mjs.map +1 -0
- package/_mjs/Ref/api/matchAll.mjs +16 -0
- package/_mjs/Ref/api/matchAll.mjs.map +1 -0
- package/_mjs/Ref/api/modify.mjs +205 -0
- package/_mjs/Ref/api/modify.mjs.map +1 -0
- package/_mjs/Ref/api/set.mjs +14 -0
- package/_mjs/Ref/api/set.mjs.map +1 -0
- package/_mjs/Ref/api.mjs +34 -0
- package/_mjs/Ref/api.mjs.map +1 -0
- package/_mjs/Ref/constructors.mjs +19 -0
- package/_mjs/Ref/constructors.mjs.map +1 -0
- package/_mjs/Ref/definition.mjs +10 -0
- package/_mjs/Ref/definition.mjs.map +1 -0
- package/_mjs/Ref.mjs +13 -0
- package/_mjs/Ref.mjs.map +1 -0
- package/_mjs/RuntimeConfig.mjs +34 -0
- package/_mjs/RuntimeConfig.mjs.map +1 -0
- package/_mjs/STM/api/core-api.mjs +61 -0
- package/_mjs/STM/api/core-api.mjs.map +1 -0
- package/_mjs/STM/api/core-constructors.mjs +68 -0
- package/_mjs/STM/api/core-constructors.mjs.map +1 -0
- package/_mjs/STM/api.mjs +633 -0
- package/_mjs/STM/api.mjs.map +1 -0
- package/_mjs/STM/definition.mjs +148 -0
- package/_mjs/STM/definition.mjs.map +1 -0
- package/_mjs/STM/driver.mjs +166 -0
- package/_mjs/STM/driver.mjs.map +1 -0
- package/_mjs/STM/internal/CommitState.mjs +68 -0
- package/_mjs/STM/internal/CommitState.mjs.map +1 -0
- package/_mjs/STM/internal/Entry.mjs +70 -0
- package/_mjs/STM/internal/Entry.mjs.map +1 -0
- package/_mjs/STM/internal/Journal.mjs +377 -0
- package/_mjs/STM/internal/Journal.mjs.map +1 -0
- package/_mjs/STM/internal/TryCommit.mjs +22 -0
- package/_mjs/STM/internal/TryCommit.mjs.map +1 -0
- package/_mjs/STM/internal/Versioned.mjs +9 -0
- package/_mjs/STM/internal/Versioned.mjs.map +1 -0
- package/_mjs/STM.mjs +9 -0
- package/_mjs/STM.mjs.map +1 -0
- package/_mjs/Schedule/Decision.mjs +48 -0
- package/_mjs/Schedule/Decision.mjs.map +1 -0
- package/_mjs/Schedule/Driver.mjs +21 -0
- package/_mjs/Schedule/Driver.mjs.map +1 -0
- package/_mjs/Schedule/Interval.mjs +114 -0
- package/_mjs/Schedule/Interval.mjs.map +1 -0
- package/_mjs/Schedule/api/driver.mjs +30 -0
- package/_mjs/Schedule/api/driver.mjs.map +1 -0
- package/_mjs/Schedule/api.mjs +642 -0
- package/_mjs/Schedule/api.mjs.map +1 -0
- package/_mjs/Schedule/definition.mjs +32 -0
- package/_mjs/Schedule/definition.mjs.map +1 -0
- package/_mjs/Schedule.mjs +7 -0
- package/_mjs/Schedule.mjs.map +1 -0
- package/_mjs/Scope/Finalizer/definition.mjs +9 -0
- package/_mjs/Scope/Finalizer/definition.mjs.map +1 -0
- package/_mjs/Scope/Finalizer.mjs +3 -0
- package/_mjs/Scope/Finalizer.mjs.map +1 -0
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs +26 -0
- package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs.map +1 -0
- package/_mjs/Scope/ReleaseMap/api.mjs +84 -0
- package/_mjs/Scope/ReleaseMap/api.mjs.map +1 -0
- package/_mjs/Scope/ReleaseMap/constructors.mjs +21 -0
- package/_mjs/Scope/ReleaseMap/constructors.mjs.map +1 -0
- package/_mjs/Scope/ReleaseMap/definition.mjs +21 -0
- package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -0
- package/_mjs/Scope/ReleaseMap.mjs +5 -0
- package/_mjs/Scope/ReleaseMap.mjs.map +1 -0
- package/_mjs/Scope/api.mjs +140 -0
- package/_mjs/Scope/api.mjs.map +1 -0
- package/_mjs/Scope/definition.mjs +25 -0
- package/_mjs/Scope/definition.mjs.map +1 -0
- package/_mjs/Scope.mjs +4 -0
- package/_mjs/Scope.mjs.map +1 -0
- package/_mjs/ScopedRef/api.mjs +50 -0
- package/_mjs/ScopedRef/api.mjs.map +1 -0
- package/_mjs/ScopedRef/definition.mjs +13 -0
- package/_mjs/ScopedRef/definition.mjs.map +1 -0
- package/_mjs/ScopedRef.mjs +4 -0
- package/_mjs/ScopedRef.mjs.map +1 -0
- package/_mjs/Sink/api.mjs +76 -0
- package/_mjs/Sink/api.mjs.map +1 -0
- package/_mjs/Sink/definition.mjs +16 -0
- package/_mjs/Sink/definition.mjs.map +1 -0
- package/_mjs/Sink.mjs +4 -0
- package/_mjs/Sink.mjs.map +1 -0
- package/_mjs/State/api.mjs +53 -0
- package/_mjs/State/api.mjs.map +1 -0
- package/_mjs/State/definition.mjs +19 -0
- package/_mjs/State/definition.mjs.map +1 -0
- package/_mjs/State/internal.mjs +8 -0
- package/_mjs/State/internal.mjs.map +1 -0
- package/_mjs/State.mjs +4 -0
- package/_mjs/State.mjs.map +1 -0
- package/_mjs/Stream/api/zipAllWith.mjs +106 -0
- package/_mjs/Stream/api/zipAllWith.mjs.map +1 -0
- package/_mjs/Stream/api/zipWith.mjs +10 -0
- package/_mjs/Stream/api/zipWith.mjs.map +1 -0
- package/_mjs/Stream/api/zipWithChunks.mjs +83 -0
- package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -0
- package/_mjs/Stream/api.mjs +2178 -0
- package/_mjs/Stream/api.mjs.map +1 -0
- package/_mjs/Stream/definition.mjs +41 -0
- package/_mjs/Stream/definition.mjs.map +1 -0
- package/_mjs/Stream/internal/DebounceState.mjs +72 -0
- package/_mjs/Stream/internal/DebounceState.mjs.map +1 -0
- package/_mjs/Stream/internal/Handoff.mjs +162 -0
- package/_mjs/Stream/internal/Handoff.mjs.map +1 -0
- package/_mjs/Stream/internal/Pull.mjs +56 -0
- package/_mjs/Stream/internal/Pull.mjs.map +1 -0
- package/_mjs/Stream/internal/SinkEndReason.mjs +66 -0
- package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -0
- package/_mjs/Stream/internal/Take.mjs +191 -0
- package/_mjs/Stream/internal/Take.mjs.map +1 -0
- package/_mjs/Stream/internal/util.mjs +19 -0
- package/_mjs/Stream/internal/util.mjs.map +1 -0
- package/_mjs/Stream.mjs +4 -0
- package/_mjs/Stream.mjs.map +1 -0
- package/_mjs/Supervisor/api.mjs +44 -0
- package/_mjs/Supervisor/api.mjs.map +1 -0
- package/_mjs/Supervisor/constructors.mjs +69 -0
- package/_mjs/Supervisor/constructors.mjs.map +1 -0
- package/_mjs/Supervisor/definition.mjs +74 -0
- package/_mjs/Supervisor/definition.mjs.map +1 -0
- package/_mjs/Supervisor.mjs +5 -0
- package/_mjs/Supervisor.mjs.map +1 -0
- package/_mjs/TExit/constructors.mjs +40 -0
- package/_mjs/TExit/constructors.mjs.map +1 -0
- package/_mjs/TExit/definition.mjs +173 -0
- package/_mjs/TExit/definition.mjs.map +1 -0
- package/_mjs/TExit.mjs +4 -0
- package/_mjs/TExit.mjs.map +1 -0
- package/_mjs/TFuture/api.mjs +47 -0
- package/_mjs/TFuture/api.mjs.map +1 -0
- package/_mjs/TFuture/constructors.mjs +23 -0
- package/_mjs/TFuture/constructors.mjs.map +1 -0
- package/_mjs/TFuture/definition.mjs +3 -0
- package/_mjs/TFuture/definition.mjs.map +1 -0
- package/_mjs/TFuture.mjs +5 -0
- package/_mjs/TFuture.mjs.map +1 -0
- package/_mjs/TRef/api.mjs +327 -0
- package/_mjs/TRef/api.mjs.map +1 -0
- package/_mjs/TRef/constructors.mjs +72 -0
- package/_mjs/TRef/constructors.mjs.map +1 -0
- package/_mjs/TRef/definition.mjs +71 -0
- package/_mjs/TRef/definition.mjs.map +1 -0
- package/_mjs/TRef.mjs +5 -0
- package/_mjs/TRef.mjs.map +1 -0
- package/_mjs/TSemaphore/api.mjs +74 -0
- package/_mjs/TSemaphore/api.mjs.map +1 -0
- package/_mjs/TSemaphore/constructors.mjs +19 -0
- package/_mjs/TSemaphore/constructors.mjs.map +1 -0
- package/_mjs/TSemaphore/definition.mjs +3 -0
- package/_mjs/TSemaphore/definition.mjs.map +1 -0
- package/_mjs/TSemaphore.mjs +5 -0
- package/_mjs/TSemaphore.mjs.map +1 -0
- package/_mjs/TxnId.mjs +11 -0
- package/_mjs/TxnId.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/findIO.mjs +40 -0
- package/_mjs/collection/immutable/Conc/findIO.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/mapIO.mjs +16 -0
- package/_mjs/collection/immutable/Conc/mapIO.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs +39 -0
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc.mjs +5 -0
- package/_mjs/collection/immutable/Conc.mjs.map +1 -0
- package/_mjs/data/Exit/foreachIO.mjs +15 -0
- package/_mjs/data/Exit/foreachIO.mjs.map +1 -0
- package/_mjs/internal/HashedPair.mjs +20 -0
- package/_mjs/internal/HashedPair.mjs.map +1 -0
- package/_mjs/internal/Hub.mjs +723 -0
- package/_mjs/internal/Hub.mjs.map +1 -0
- package/_mjs/internal/MutableQueue.mjs +276 -0
- package/_mjs/internal/MutableQueue.mjs.map +1 -0
- package/_mjs/internal/Scheduler.mjs +18 -0
- package/_mjs/internal/Scheduler.mjs.map +1 -0
- package/_mjs/internal/StackTraceBuilder.mjs +21 -0
- package/_mjs/internal/StackTraceBuilder.mjs.map +1 -0
- package/_src/Cached/api.ts +54 -0
- package/_src/Cached/definition.ts +23 -0
- package/_src/Cached/internal.ts +10 -0
- package/_src/Cached.ts +5 -0
- package/_src/CancellerState.ts +47 -0
- package/_src/Channel/ChildExecutorDecision/api.ts +23 -0
- package/_src/Channel/ChildExecutorDecision/definition.ts +48 -0
- package/_src/Channel/ChildExecutorDecision.ts +4 -0
- package/_src/Channel/UpstreamPullRequest/api.ts +36 -0
- package/_src/Channel/UpstreamPullRequest/definition.ts +21 -0
- package/_src/Channel/UpstreamPullRequest.ts +4 -0
- package/_src/Channel/UpstreamPullStrategy/definition.ts +38 -0
- package/_src/Channel/UpstreamPullStrategy.ts +3 -0
- package/_src/Channel/api/interruptWhen.ts +37 -0
- package/_src/Channel/api/mapOutIOC.ts +63 -0
- package/_src/Channel/api/mergeAll.ts +21 -0
- package/_src/Channel/api/mergeAllUnboundedWith.ts +30 -0
- package/_src/Channel/api/mergeAllWith.ts +141 -0
- package/_src/Channel/api/mergeMap.ts +27 -0
- package/_src/Channel/api/mergeWith.ts +200 -0
- package/_src/Channel/api/run.ts +10 -0
- package/_src/Channel/api/runCollect.ts +8 -0
- package/_src/Channel/api/runDrain.ts +10 -0
- package/_src/Channel/api/runScoped.ts +45 -0
- package/_src/Channel/api/toPull.ts +38 -0
- package/_src/Channel/api/zipC.ts +104 -0
- package/_src/Channel/api.ts +1258 -0
- package/_src/Channel/core-api.ts +230 -0
- package/_src/Channel/definition.ts +322 -0
- package/_src/Channel/internal/AsyncInputConsumer.ts +6 -0
- package/_src/Channel/internal/AsyncInputProducer.ts +6 -0
- package/_src/Channel/internal/ChannelExecutor.ts +1078 -0
- package/_src/Channel/internal/ChannelState.ts +61 -0
- package/_src/Channel/internal/MergeDecision.ts +65 -0
- package/_src/Channel/internal/MergeState.ts +63 -0
- package/_src/Channel/internal/SingleProducerAsyncInput.ts +186 -0
- package/_src/Channel.ts +5 -0
- package/_src/Clock/api.ts +11 -0
- package/_src/Clock/definition.ts +13 -0
- package/_src/Clock/live.ts +21 -0
- package/_src/Clock.ts +5 -0
- package/_src/Console/api.ts +13 -0
- package/_src/Console/definition.ts +14 -0
- package/_src/Console/live.ts +18 -0
- package/_src/Console.ts +5 -0
- package/_src/Fiber/FiberContext.ts +1101 -0
- package/_src/Fiber/api/await.ts +7 -0
- package/_src/Fiber/api/awaitAll.ts +8 -0
- package/_src/Fiber/api/children.ts +7 -0
- package/_src/Fiber/api/collectAll.ts +32 -0
- package/_src/Fiber/api/evalOn.ts +12 -0
- package/_src/Fiber/api/evalOnIO.ts +18 -0
- package/_src/Fiber/api/fromIO.ts +8 -0
- package/_src/Fiber/api/id.ts +7 -0
- package/_src/Fiber/api/inheritRefs.ts +7 -0
- package/_src/Fiber/api/interrupt.ts +11 -0
- package/_src/Fiber/api/interruptAll.ts +17 -0
- package/_src/Fiber/api/interruptAs.ts +7 -0
- package/_src/Fiber/api/interruptFork.ts +10 -0
- package/_src/Fiber/api/join.ts +13 -0
- package/_src/Fiber/api/joinAll.ts +12 -0
- package/_src/Fiber/api/location.ts +7 -0
- package/_src/Fiber/api/mapFiber.ts +9 -0
- package/_src/Fiber/api/mapIO.ts +31 -0
- package/_src/Fiber/api/poll.ts +7 -0
- package/_src/Fiber/api/zipWith.ts +25 -0
- package/_src/Fiber/constructors.ts +43 -0
- package/_src/Fiber/definition.ts +128 -0
- package/_src/Fiber.ts +28 -0
- package/_src/FiberDescriptor.ts +19 -0
- package/_src/FiberRef/api/locallyScoped.ts +9 -0
- package/_src/FiberRef/api/locallyScopedWith.ts +6 -0
- package/_src/FiberRef/api.ts +135 -0
- package/_src/FiberRef/constructors.ts +98 -0
- package/_src/FiberRef/definition.ts +64 -0
- package/_src/FiberRef.ts +10 -0
- package/_src/FiberRefs/api.ts +15 -0
- package/_src/FiberRefs/definition.ts +11 -0
- package/_src/FiberRefs/join.ts +67 -0
- package/_src/FiberRefs.ts +5 -0
- package/_src/FiberScope/constructors.ts +19 -0
- package/_src/FiberScope/definition.ts +38 -0
- package/_src/FiberScope.ts +4 -0
- package/_src/FiberState/api.ts +12 -0
- package/_src/FiberState/constructors.ts +33 -0
- package/_src/FiberState/definition.ts +44 -0
- package/_src/FiberState.ts +5 -0
- package/_src/FiberStatus/constructors.ts +35 -0
- package/_src/FiberStatus/definition.ts +87 -0
- package/_src/FiberStatus.ts +4 -0
- package/_src/Future/api.ts +204 -0
- package/_src/Future/constructors.ts +28 -0
- package/_src/Future/definition.ts +24 -0
- package/_src/Future.ts +5 -0
- package/_src/Hub/api.ts +434 -0
- package/_src/Hub/definition.ts +102 -0
- package/_src/Hub/internal.ts +493 -0
- package/_src/Hub.ts +4 -0
- package/_src/IO/api/acquireRelease.ts +10 -0
- package/_src/IO/api/acquireReleaseExit.ts +11 -0
- package/_src/IO/api/acquireReleaseInterruptible.ts +10 -0
- package/_src/IO/api/acquireReleaseInterruptibleExit.ts +10 -0
- package/_src/IO/api/addFinalizer.ts +9 -0
- package/_src/IO/api/addFinalizerExit.ts +12 -0
- package/_src/IO/api/bracket.ts +30 -0
- package/_src/IO/api/bracketExit.ts +32 -0
- package/_src/IO/api/clockWith.ts +11 -0
- package/_src/IO/api/concurrency.ts +42 -0
- package/_src/IO/api/concurrentFinalizers.ts +11 -0
- package/_src/IO/api/consoleWith.ts +13 -0
- package/_src/IO/api/core-scope.ts +138 -0
- package/_src/IO/api/environment.ts +126 -0
- package/_src/IO/api/foreachC.ts +178 -0
- package/_src/IO/api/foreachExec.ts +19 -0
- package/_src/IO/api/forkAll.ts +9 -0
- package/_src/IO/api/forkIn.ts +15 -0
- package/_src/IO/api/forkScoped.ts +11 -0
- package/_src/IO/api/fulfill.ts +10 -0
- package/_src/IO/api/interrupt.ts +169 -0
- package/_src/IO/api/memoize.ts +10 -0
- package/_src/IO/api/onExit.ts +12 -0
- package/_src/IO/api/once.ts +6 -0
- package/_src/IO/api/provideLayer.ts +12 -0
- package/_src/IO/api/provideSomeLayer.ts +23 -0
- package/_src/IO/api/race.ts +32 -0
- package/_src/IO/api/raceFirst.ts +17 -0
- package/_src/IO/api/randomWith.ts +11 -0
- package/_src/IO/api/repeat.ts +49 -0
- package/_src/IO/api/retry.ts +42 -0
- package/_src/IO/api/schedule.ts +31 -0
- package/_src/IO/api/scope.ts +4 -0
- package/_src/IO/api/scopeWith.ts +6 -0
- package/_src/IO/api/scoped.ts +13 -0
- package/_src/IO/api/sequenceT.ts +12 -0
- package/_src/IO/api/sleep.ts +6 -0
- package/_src/IO/api/stateful.ts +15 -0
- package/_src/IO/api/withChildren.ts +13 -0
- package/_src/IO/api/withFinalizer.ts +9 -0
- package/_src/IO/api/withFinalizerExit.ts +9 -0
- package/_src/IO/api/withRuntimeConfig.ts +16 -0
- package/_src/IO/api/zipC.ts +8 -0
- package/_src/IO/api/zipWithC.ts +41 -0
- package/_src/IO/api.ts +2126 -0
- package/_src/IO/definition.ts +429 -0
- package/_src/IO/runtime.ts +99 -0
- package/_src/IO.ts +52 -0
- package/_src/IOEnv/definition.ts +20 -0
- package/_src/IOEnv/live.ts +8 -0
- package/_src/IOEnv/services.ts +10 -0
- package/_src/IOEnv.ts +5 -0
- package/_src/InterruptStatus/constructors.ts +16 -0
- package/_src/InterruptStatus/definition.ts +17 -0
- package/_src/InterruptStatus.ts +4 -0
- package/_src/Layer/MemoMap.ts +170 -0
- package/_src/Layer/api.ts +378 -0
- package/_src/Layer/definition.ts +111 -0
- package/_src/Layer.ts +5 -0
- package/_src/LogLevel.ts +79 -0
- package/_src/LogSpan.ts +27 -0
- package/_src/Logger/api.ts +24 -0
- package/_src/Logger/constructors.ts +59 -0
- package/_src/Logger/definition.ts +22 -0
- package/_src/Logger.ts +5 -0
- package/_src/Queue/api/dimapIO.ts +120 -0
- package/_src/Queue/api/filterInputIO.ts +73 -0
- package/_src/Queue/api/filterOutputIO.ts +74 -0
- package/_src/Queue/api/operations.ts +121 -0
- package/_src/Queue/api/poll.ts +11 -0
- package/_src/Queue/api/takeBetween.ts +40 -0
- package/_src/Queue/api/zipWithIO.ts +96 -0
- package/_src/Queue/api.ts +9 -0
- package/_src/Queue/constructors.ts +33 -0
- package/_src/Queue/definition.ts +134 -0
- package/_src/Queue/internal.ts +240 -0
- package/_src/Queue/strategy.ts +177 -0
- package/_src/Queue.ts +7 -0
- package/_src/Random/api.ts +51 -0
- package/_src/Random/definition.ts +21 -0
- package/_src/Random/live.ts +36 -0
- package/_src/Random.ts +5 -0
- package/_src/Ref/Atomic/Atomic.ts +56 -0
- package/_src/Ref/Atomic/api.ts +120 -0
- package/_src/Ref/Atomic.ts +4 -0
- package/_src/Ref/Derived.ts +71 -0
- package/_src/Ref/DerivedAll.ts +75 -0
- package/_src/Ref/Synchronized/api.ts +234 -0
- package/_src/Ref/Synchronized/constructors.ts +12 -0
- package/_src/Ref/Synchronized/definition.ts +126 -0
- package/_src/Ref/api/collect.ts +18 -0
- package/_src/Ref/api/dimap.ts +108 -0
- package/_src/Ref/api/filter.ts +33 -0
- package/_src/Ref/api/get.ts +14 -0
- package/_src/Ref/api/match.ts +24 -0
- package/_src/Ref/api/matchAll.ts +23 -0
- package/_src/Ref/api/modify.ts +225 -0
- package/_src/Ref/api/set.ts +15 -0
- package/_src/Ref/api.ts +39 -0
- package/_src/Ref/constructors.ts +15 -0
- package/_src/Ref/definition.ts +104 -0
- package/_src/Ref.ts +14 -0
- package/_src/RuntimeConfig.ts +37 -0
- package/_src/STM/api/core-api.ts +60 -0
- package/_src/STM/api/core-constructors.ts +65 -0
- package/_src/STM/api.ts +685 -0
- package/_src/STM/definition.ts +155 -0
- package/_src/STM/driver.ts +131 -0
- package/_src/STM/internal/CommitState.ts +75 -0
- package/_src/STM/internal/Entry.ts +76 -0
- package/_src/STM/internal/Journal.ts +341 -0
- package/_src/STM/internal/TryCommit.ts +23 -0
- package/_src/STM/internal/Versioned.ts +7 -0
- package/_src/STM.ts +10 -0
- package/_src/Schedule/Decision.ts +51 -0
- package/_src/Schedule/Driver.ts +24 -0
- package/_src/Schedule/Interval.ts +103 -0
- package/_src/Schedule/api/driver.ts +38 -0
- package/_src/Schedule/api.ts +887 -0
- package/_src/Schedule/definition.ts +60 -0
- package/_src/Schedule.ts +7 -0
- package/_src/Scope/Finalizer/definition.ts +26 -0
- package/_src/Scope/Finalizer.ts +3 -0
- package/_src/Scope/ReleaseMap/api/releaseAll.ts +28 -0
- package/_src/Scope/ReleaseMap/api.ts +86 -0
- package/_src/Scope/ReleaseMap/constructors.ts +17 -0
- package/_src/Scope/ReleaseMap/definition.ts +37 -0
- package/_src/Scope/ReleaseMap.ts +5 -0
- package/_src/Scope/api.ts +117 -0
- package/_src/Scope/definition.ts +31 -0
- package/_src/Scope.ts +4 -0
- package/_src/ScopedRef/api.ts +50 -0
- package/_src/ScopedRef/definition.ts +13 -0
- package/_src/ScopedRef.ts +4 -0
- package/_src/Sink/api.ts +88 -0
- package/_src/Sink/definition.ts +12 -0
- package/_src/Sink.ts +4 -0
- package/_src/State/api.ts +49 -0
- package/_src/State/definition.ts +19 -0
- package/_src/State/internal.ts +10 -0
- package/_src/State.ts +4 -0
- package/_src/Stream/api/zipAllWith.ts +135 -0
- package/_src/Stream/api/zipWith.ts +12 -0
- package/_src/Stream/api/zipWithChunks.ts +89 -0
- package/_src/Stream/api.ts +2931 -0
- package/_src/Stream/definition.ts +42 -0
- package/_src/Stream/internal/DebounceState.ts +79 -0
- package/_src/Stream/internal/Handoff.ts +174 -0
- package/_src/Stream/internal/Pull.ts +58 -0
- package/_src/Stream/internal/SinkEndReason.ts +59 -0
- package/_src/Stream/internal/Take.ts +192 -0
- package/_src/Stream/internal/util.ts +19 -0
- package/_src/Stream.ts +4 -0
- package/_src/Supervisor/api.ts +36 -0
- package/_src/Supervisor/constructors.ts +65 -0
- package/_src/Supervisor/definition.ts +70 -0
- package/_src/Supervisor.ts +5 -0
- package/_src/TExit/constructors.ts +39 -0
- package/_src/TExit/definition.ts +147 -0
- package/_src/TExit.ts +4 -0
- package/_src/TFuture/api.ts +42 -0
- package/_src/TFuture/constructors.ts +14 -0
- package/_src/TFuture/definition.ts +23 -0
- package/_src/TFuture.ts +5 -0
- package/_src/TRef/api.ts +312 -0
- package/_src/TRef/constructors.ts +69 -0
- package/_src/TRef/definition.ts +230 -0
- package/_src/TRef.ts +5 -0
- package/_src/TSemaphore/api.ts +68 -0
- package/_src/TSemaphore/constructors.ts +14 -0
- package/_src/TSemaphore/definition.ts +21 -0
- package/_src/TSemaphore.ts +5 -0
- package/_src/TxnId.ts +19 -0
- package/_src/collection/immutable/Conc/findIO.ts +37 -0
- package/_src/collection/immutable/Conc/mapIO.ts +13 -0
- package/_src/collection/immutable/Conc/takeWhileIO.ts +32 -0
- package/_src/collection/immutable/Conc.ts +5 -0
- package/_src/data/Exit/foreachIO.ts +15 -0
- package/_src/internal/HashedPair.ts +15 -0
- package/_src/internal/Hub.ts +754 -0
- package/_src/internal/MutableQueue.ts +295 -0
- package/_src/internal/Scheduler.ts +15 -0
- package/_src/internal/StackTraceBuilder.ts +16 -0
- package/collection/immutable/Conc/findIO.d.ts +8 -0
- package/collection/immutable/Conc/mapIO.d.ts +7 -0
- package/collection/immutable/Conc/takeWhileIO.d.ts +7 -0
- package/collection/immutable/Conc.d.ts +3 -0
- package/data/Exit/foreachIO.d.ts +9 -0
- package/internal/HashedPair.d.ts +9 -0
- package/internal/Hub.d.ts +121 -0
- package/internal/MutableQueue.d.ts +125 -0
- package/internal/Scheduler.d.ts +1 -0
- package/internal/StackTraceBuilder.d.ts +8 -0
- package/package.json +17 -0
package/_src/IO/api.ts
ADDED
@@ -0,0 +1,2126 @@
|
|
1
|
+
import type * as P from "@fncts/base/typeclass";
|
2
|
+
import type { _E, _R } from "@fncts/base/types";
|
3
|
+
import type { FiberContext } from "@fncts/io/Fiber/FiberContext";
|
4
|
+
import type { Canceler } from "@fncts/io/IO/definition";
|
5
|
+
|
6
|
+
import { identity, pipe, tuple } from "@fncts/base/data/function";
|
7
|
+
import {
|
8
|
+
Async,
|
9
|
+
Chain,
|
10
|
+
Defer,
|
11
|
+
DeferWith,
|
12
|
+
Ensuring,
|
13
|
+
Fail,
|
14
|
+
FiberRefModifyAll,
|
15
|
+
Fork,
|
16
|
+
GetDescriptor,
|
17
|
+
GetInterrupt,
|
18
|
+
IO,
|
19
|
+
IOError,
|
20
|
+
Logged,
|
21
|
+
Match,
|
22
|
+
SetRuntimeConfig,
|
23
|
+
Succeed,
|
24
|
+
SucceedNow,
|
25
|
+
Supervise,
|
26
|
+
Yield,
|
27
|
+
} from "@fncts/io/IO/definition";
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Imports an asynchronous side-effect into a `IO`
|
31
|
+
*
|
32
|
+
* @tsplus static fncts.io.IOOps async
|
33
|
+
*/
|
34
|
+
export function async<R, E, A>(
|
35
|
+
register: (resolve: (_: IO<R, E, A>) => void) => void,
|
36
|
+
blockingOn: FiberId = FiberId.none,
|
37
|
+
__tsplusTrace?: string,
|
38
|
+
): IO<R, E, A> {
|
39
|
+
return IO.asyncMaybe(
|
40
|
+
(cb) => {
|
41
|
+
register(cb);
|
42
|
+
return Nothing();
|
43
|
+
},
|
44
|
+
blockingOn,
|
45
|
+
__tsplusTrace,
|
46
|
+
);
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Imports an asynchronous effect into a pure `IO`, possibly returning the value synchronously.
|
51
|
+
*
|
52
|
+
* If the register function returns a value synchronously, then the callback
|
53
|
+
* function must not be called. Otherwise the callback function must be called at most once.
|
54
|
+
*
|
55
|
+
* @tsplus static fncts.io.IOOps asyncMaybe
|
56
|
+
*/
|
57
|
+
export function asyncMaybe<R, E, A>(
|
58
|
+
register: (resolve: (_: IO<R, E, A>) => void) => Maybe<IO<R, E, A>>,
|
59
|
+
blockingOn: FiberId = FiberId.none,
|
60
|
+
__tsplusTrace?: string,
|
61
|
+
): IO<R, E, A> {
|
62
|
+
return asyncInterrupt(
|
63
|
+
(cb) => register(cb).match(() => Either.left(IO.unit), Either.right),
|
64
|
+
blockingOn,
|
65
|
+
__tsplusTrace,
|
66
|
+
);
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Imports an asynchronous side-effect into an IO. The side-effect
|
71
|
+
* has the option of returning the value synchronously, which is useful in
|
72
|
+
* cases where it cannot be determined if the effect is synchronous or
|
73
|
+
* asynchronous until the side-effect is actually executed. The effect also
|
74
|
+
* has the option of returning a canceler, which will be used by the runtime
|
75
|
+
* to cancel the asynchronous effect if the fiber executing the effect is
|
76
|
+
* interrupted.
|
77
|
+
*
|
78
|
+
* If the register function returns a value synchronously, then the callback
|
79
|
+
* function must not be called. Otherwise the callback function must be called
|
80
|
+
* at most once.
|
81
|
+
*
|
82
|
+
* The list of fibers, that may complete the async callback, is used to
|
83
|
+
* provide better diagnostics.
|
84
|
+
*
|
85
|
+
* @tsplus static fncts.io.IOOps asyncInterrupt
|
86
|
+
*/
|
87
|
+
export function asyncInterrupt<R, E, A>(
|
88
|
+
register: (cb: (resolve: IO<R, E, A>) => void) => Either<Canceler<R>, IO<R, E, A>>,
|
89
|
+
blockingOn: FiberId = FiberId.none,
|
90
|
+
__tsplusTrace?: string,
|
91
|
+
): IO<R, E, A> {
|
92
|
+
return new Async(register, blockingOn, __tsplusTrace);
|
93
|
+
}
|
94
|
+
|
95
|
+
// /**
|
96
|
+
// * Attempts to convert defects into a failure, throwing away all information
|
97
|
+
// * about the cause of the failure.
|
98
|
+
// *
|
99
|
+
// * @tsplus fluent fncts.io.IO absorbWith
|
100
|
+
// */
|
101
|
+
// export function absorbWith_<R, E, A>(ma: IO<R, E, A>, f: (e: E) => unknown, __tsplusTrace?: string) {
|
102
|
+
// return ma.sandbox.matchIO((cause) => IO.failNow(cause.squash(f)), IO.succeedNow)
|
103
|
+
// }
|
104
|
+
|
105
|
+
/**
|
106
|
+
* @tsplus fluent fncts.io.IO apFirst
|
107
|
+
* @tsplus operator fncts.io.IO <
|
108
|
+
*/
|
109
|
+
export function apFirst_<R, E, A, R1, E1, B>(
|
110
|
+
self: IO<R, E, A>,
|
111
|
+
fb: IO<R1, E1, B>,
|
112
|
+
__tsplusTrace?: string,
|
113
|
+
): IO<R1 & R, E1 | E, A> {
|
114
|
+
return self.flatMap((a) => fb.map(() => a));
|
115
|
+
}
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Combine two effectful actions, keeping only the result of the second
|
119
|
+
*
|
120
|
+
* @tsplus fluent fncts.io.IO apSecond
|
121
|
+
* @tsplus operator fncts.io.IO >
|
122
|
+
*/
|
123
|
+
export function apSecond_<R, E, A, R1, E1, B>(
|
124
|
+
self: IO<R, E, A>,
|
125
|
+
fb: IO<R1, E1, B>,
|
126
|
+
__tsplusTrace?: string,
|
127
|
+
): IO<R1 & R, E1 | E, B> {
|
128
|
+
return self.flatMap(() => fb);
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* @tsplus fluent fncts.io.IO as
|
133
|
+
*/
|
134
|
+
export function as_<R, E, A, B>(self: IO<R, E, A>, b: Lazy<B>): IO<R, E, B> {
|
135
|
+
return self.map(() => b());
|
136
|
+
}
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Maps the success value of this effect to an optional value.
|
140
|
+
*
|
141
|
+
* @tsplus getter fncts.io.IO asJust
|
142
|
+
*/
|
143
|
+
export function asJust<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, E, Maybe<A>> {
|
144
|
+
return ma.map(Maybe.just);
|
145
|
+
}
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Maps the error value of this IO to an optional value.
|
149
|
+
*
|
150
|
+
* @tsplus getter fncts.io.IO asJustError
|
151
|
+
*/
|
152
|
+
export function asJustError<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, Maybe<E>, A> {
|
153
|
+
return ma.mapError(Maybe.just);
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* @tsplus getter fncts.io.IO asUnit
|
158
|
+
*/
|
159
|
+
export function asUnit<R, E, A>(self: IO<R, E, A>): IO<R, E, void> {
|
160
|
+
return self.as(undefined);
|
161
|
+
}
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Returns an IO whose failure and success channels have been mapped by
|
165
|
+
* the specified pair of functions, `f` and `g`.
|
166
|
+
*
|
167
|
+
* @tsplus fluent fncts.io.IO bimap
|
168
|
+
*/
|
169
|
+
export function bimap_<R, E, A, E1, B>(
|
170
|
+
self: IO<R, E, A>,
|
171
|
+
f: (e: E) => E1,
|
172
|
+
g: (a: A) => B,
|
173
|
+
__tsplusTrace?: string,
|
174
|
+
): IO<R, E1, B> {
|
175
|
+
return self.matchIO(
|
176
|
+
(e) => IO.failNow(f(e)),
|
177
|
+
(a) => IO.succeedNow(g(a)),
|
178
|
+
);
|
179
|
+
}
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Returns an IO that effectfully "peeks" at the failure or success of
|
183
|
+
* this effect.
|
184
|
+
*
|
185
|
+
* @tsplus fluent fncts.io.IO bitap
|
186
|
+
*/
|
187
|
+
export function bitap_<R, E, A, R1, E1, R2, E2>(
|
188
|
+
self: IO<R, E, A>,
|
189
|
+
onFailure: (e: E) => IO<R1, E1, any>,
|
190
|
+
onSuccess: (a: A) => IO<R2, E2, any>,
|
191
|
+
__tsplusTrace?: string,
|
192
|
+
): IO<R & R1 & R2, E | E1 | E2, A> {
|
193
|
+
return self.matchCauseIO(
|
194
|
+
(cause) =>
|
195
|
+
cause.failureOrCause.match(
|
196
|
+
(e) => onFailure(e).flatMap(() => IO.failCauseNow(cause)),
|
197
|
+
() => IO.failCauseNow(cause),
|
198
|
+
),
|
199
|
+
(a) => onSuccess(a).apSecond(IO.succeedNow(a)),
|
200
|
+
);
|
201
|
+
}
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Recovers from the specified error
|
205
|
+
*
|
206
|
+
* @tsplus fluent fncts.io.IO catch
|
207
|
+
*/
|
208
|
+
export function catch_<N extends keyof E, K extends E[N] & string, R, E, A, R1, E1, A1>(
|
209
|
+
ma: IO<R, E, A>,
|
210
|
+
tag: N,
|
211
|
+
k: K,
|
212
|
+
f: (e: Extract<E, { [n in N]: K }>) => IO<R1, E1, A1>,
|
213
|
+
__tsplusTrace?: string,
|
214
|
+
): IO<R & R1, Exclude<E, { [n in N]: K }> | E1, A | A1> {
|
215
|
+
return ma.catchAll((e) => {
|
216
|
+
if (tag in e && e[tag] === k) {
|
217
|
+
return f(e as any);
|
218
|
+
}
|
219
|
+
return IO.failNow(e as any);
|
220
|
+
});
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Recovers from all errors
|
225
|
+
*
|
226
|
+
* @tsplus fluent fncts.io.IO catchAll
|
227
|
+
*/
|
228
|
+
export function catchAll_<R, E, A, R1, E1, A1>(
|
229
|
+
ma: IO<R, E, A>,
|
230
|
+
f: (e: E) => IO<R1, E1, A1>,
|
231
|
+
__tsplusTrace?: string,
|
232
|
+
): IO<R & R1, E1, A | A1> {
|
233
|
+
return ma.matchIO(f, IO.succeedNow);
|
234
|
+
}
|
235
|
+
|
236
|
+
/**
|
237
|
+
*
|
238
|
+
* Recovers from all errors with provided cause.
|
239
|
+
*
|
240
|
+
* @tsplus fluent fncts.io.IO catchAllCause
|
241
|
+
*/
|
242
|
+
export function catchAllCause_<R, E, A, R1, E1, A1>(
|
243
|
+
ma: IO<R, E, A>,
|
244
|
+
f: (_: Cause<E>) => IO<R1, E1, A1>,
|
245
|
+
__tsplusTrace?: string,
|
246
|
+
) {
|
247
|
+
return ma.matchCauseIO(f, IO.succeedNow);
|
248
|
+
}
|
249
|
+
|
250
|
+
/**
|
251
|
+
* Recovers from some or all of the error cases.
|
252
|
+
*
|
253
|
+
* @tsplus fluent fncts.io.IO catchJust
|
254
|
+
*/
|
255
|
+
export function catchJust_<R, E, A, R1, E1, A1>(
|
256
|
+
ma: IO<R, E, A>,
|
257
|
+
f: (e: E) => Maybe<IO<R1, E1, A1>>,
|
258
|
+
__tsplusTrace?: string,
|
259
|
+
): IO<R & R1, E | E1, A | A1> {
|
260
|
+
return ma.matchCauseIO(
|
261
|
+
(cause) => cause.failureOrCause.match((e) => f(e).getOrElse(IO.failCauseNow(cause)), IO.failCauseNow),
|
262
|
+
IO.succeedNow,
|
263
|
+
);
|
264
|
+
}
|
265
|
+
|
266
|
+
/**
|
267
|
+
* Recovers from some or all of the error cases with provided cause.
|
268
|
+
*
|
269
|
+
* @tsplus fluent fncts.io.IO catchJustCause
|
270
|
+
*/
|
271
|
+
export function catchJustCause_<R, E, A, R1, E1, A1>(
|
272
|
+
ma: IO<R, E, A>,
|
273
|
+
f: (_: Cause<E>) => Maybe<IO<R1, E1, A1>>,
|
274
|
+
): IO<R & R1, E | E1, A | A1> {
|
275
|
+
return ma.matchCauseIO((cause) => f(cause).getOrElse(IO.failCauseNow(cause)), IO.succeedNow);
|
276
|
+
}
|
277
|
+
|
278
|
+
/**
|
279
|
+
* Recovers from some or all of the defects with provided partial function.
|
280
|
+
*
|
281
|
+
* *WARNING*: There is no sensible way to recover from defects. This
|
282
|
+
* method should be used only at the boundary between IO and an external
|
283
|
+
* system, to transmit information on a defect for diagnostic or explanatory
|
284
|
+
* purposes.
|
285
|
+
*
|
286
|
+
* @tsplus fluent fncts.io.IO catchJustDefect
|
287
|
+
*/
|
288
|
+
export function catchJustDefect_<R, E, A, R1, E1, A1>(
|
289
|
+
ma: IO<R, E, A>,
|
290
|
+
f: (_: unknown) => Maybe<IO<R1, E1, A1>>,
|
291
|
+
__tsplusTrace?: string,
|
292
|
+
): IO<R & R1, E | E1, A | A1> {
|
293
|
+
return ma.unrefineWith(f, IO.failNow).catchAll(identity);
|
294
|
+
}
|
295
|
+
|
296
|
+
/**
|
297
|
+
* Recovers from the specified error
|
298
|
+
*
|
299
|
+
* @tsplus fluent IO catchTag
|
300
|
+
*/
|
301
|
+
export function catchTag_<K extends E["_tag"] & string, R, E extends { _tag: string }, A, R1, E1, A1>(
|
302
|
+
ma: IO<R, E, A>,
|
303
|
+
k: K,
|
304
|
+
f: (e: Extract<E, { _tag: K }>) => IO<R1, E1, A1>,
|
305
|
+
__tsplusTrace?: string,
|
306
|
+
): IO<R & R1, Exclude<E, { _tag: K }> | E1, A | A1> {
|
307
|
+
return ma.catch("_tag", k, f);
|
308
|
+
}
|
309
|
+
|
310
|
+
/**
|
311
|
+
* @tsplus getter fncts.io.IO cause
|
312
|
+
*/
|
313
|
+
export function cause<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, never, Cause<E>> {
|
314
|
+
return ma.matchCauseIO(IO.succeedNow, () => IO.succeedNow(Cause.empty()));
|
315
|
+
}
|
316
|
+
|
317
|
+
/**
|
318
|
+
* @tsplus fluent fncts.io.IO causeAsError
|
319
|
+
*/
|
320
|
+
export function causeAsError<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, Cause<E>, A> {
|
321
|
+
return ma.matchCauseIO(IO.failNow, IO.succeedNow);
|
322
|
+
}
|
323
|
+
|
324
|
+
/**
|
325
|
+
* Returns an IO that models the execution of this effect, followed by
|
326
|
+
* the passing of its value to the specified continuation function `f`,
|
327
|
+
* followed by the effect that it returns.
|
328
|
+
*
|
329
|
+
* @tsplus fluent fncts.io.IO flatMap
|
330
|
+
*/
|
331
|
+
export function flatMap_<R, E, A, R1, E1, B>(
|
332
|
+
ma: IO<R, E, A>,
|
333
|
+
f: (a: A) => IO<R1, E1, B>,
|
334
|
+
__tsplusTrace?: string,
|
335
|
+
): IO<R & R1, E | E1, B> {
|
336
|
+
return new Chain(ma, f, __tsplusTrace);
|
337
|
+
}
|
338
|
+
|
339
|
+
/**
|
340
|
+
* @tsplus fluent fncts.io.IO flatMapError
|
341
|
+
*/
|
342
|
+
export function flatMapError_<R, R1, E, E1, A>(ma: IO<R, E, A>, f: (e: E) => IO<R1, never, E1>): IO<R & R1, E1, A> {
|
343
|
+
return ma.swapWith((effect) => effect.flatMap(f));
|
344
|
+
}
|
345
|
+
|
346
|
+
/**
|
347
|
+
* Checks the interrupt status, and produces the IO returned by the
|
348
|
+
* specified callback.
|
349
|
+
*
|
350
|
+
* @tsplus static fncts.io.IOOps checkInterruptible
|
351
|
+
*/
|
352
|
+
export function checkInterruptible<R, E, A>(
|
353
|
+
f: (i: InterruptStatus) => IO<R, E, A>,
|
354
|
+
__tsplusTrace?: string,
|
355
|
+
): IO<R, E, A> {
|
356
|
+
return new GetInterrupt(f, __tsplusTrace);
|
357
|
+
}
|
358
|
+
|
359
|
+
/**
|
360
|
+
* @tsplus fluent fncts.io.IO collect
|
361
|
+
*/
|
362
|
+
export function collect_<R, E, A, E1, A1>(
|
363
|
+
ma: IO<R, E, A>,
|
364
|
+
f: Lazy<E1>,
|
365
|
+
pf: (a: A) => Maybe<A1>,
|
366
|
+
__tsplusTrace?: string,
|
367
|
+
): IO<R, E | E1, A1> {
|
368
|
+
return ma.collectIO(f, (a) => pf(a).map(IO.succeedNow));
|
369
|
+
}
|
370
|
+
|
371
|
+
/**
|
372
|
+
* @tsplus fluent fncts.io.IO collectIO
|
373
|
+
*/
|
374
|
+
export function collectIO_<R, E, A, R1, E1, A1, E2>(
|
375
|
+
ma: IO<R, E, A>,
|
376
|
+
f: Lazy<E2>,
|
377
|
+
pf: (a: A) => Maybe<IO<R1, E1, A1>>,
|
378
|
+
__tsplusTrace?: string,
|
379
|
+
): IO<R & R1, E | E1 | E2, A1> {
|
380
|
+
return ma.flatMap((a) => pf(a).getOrElse(IO.fail(f)));
|
381
|
+
}
|
382
|
+
|
383
|
+
/**
|
384
|
+
* @tsplus static fncts.io.IOOps condIO
|
385
|
+
*/
|
386
|
+
export function condIO_<R, R1, E, A>(b: boolean, onTrue: URIO<R, A>, onFalse: URIO<R1, E>): IO<R & R1, E, A> {
|
387
|
+
return b ? onTrue : onFalse.flatMap(IO.failNow);
|
388
|
+
}
|
389
|
+
|
390
|
+
/**
|
391
|
+
* Returns a lazily constructed effect, whose construction may itself require
|
392
|
+
* effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == unknown)
|
393
|
+
* it is conceptually equivalent to `flatten(succeedWith(io))`. If you wonder if the effect throws exceptions,
|
394
|
+
* do not use this method, use `IO.deferTryCatch`.
|
395
|
+
*
|
396
|
+
* @tsplus static fncts.io.IOOps defer
|
397
|
+
*/
|
398
|
+
export function defer<R, E, A>(io: Lazy<IO<R, E, A>>, __tsplusTrace?: string): IO<R, E, A> {
|
399
|
+
return new Defer(io, __tsplusTrace);
|
400
|
+
}
|
401
|
+
|
402
|
+
/**
|
403
|
+
* Returns a lazily constructed effect, whose construction may itself require
|
404
|
+
* effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == unknown)
|
405
|
+
* it is conceptually equivalent to `flatten(effectTotal(io))`. If you wonder if the effect throws exceptions,
|
406
|
+
* do not use this method, use `IO.deferTryCatchWith`.
|
407
|
+
*
|
408
|
+
* @tsplus static fncts.io.IOOps deferWith
|
409
|
+
*/
|
410
|
+
export function deferWith<R, E, A>(
|
411
|
+
io: (runtimeConfig: RuntimeConfig, id: FiberId) => IO<R, E, A>,
|
412
|
+
__tsplusTrace?: string,
|
413
|
+
): IO<R, E, A> {
|
414
|
+
return new DeferWith(io, __tsplusTrace);
|
415
|
+
}
|
416
|
+
|
417
|
+
/**
|
418
|
+
* Returns a lazily constructed effect, whose construction may itself require effects.
|
419
|
+
* When no environment is required (i.e., when R == unknown) it is conceptually equivalent to `flatten(try(io))`.
|
420
|
+
*
|
421
|
+
* @tsplus static fncts.io.IOOps deferTry
|
422
|
+
*/
|
423
|
+
export function deferTry<R, E, A>(io: () => IO<R, E, A>, __tsplusTrace?: string): IO<R, unknown, A> {
|
424
|
+
return IO.defer(() => {
|
425
|
+
try {
|
426
|
+
return io();
|
427
|
+
} catch (u) {
|
428
|
+
throw new IOError(Exit.fail(u));
|
429
|
+
}
|
430
|
+
}, __tsplusTrace);
|
431
|
+
}
|
432
|
+
|
433
|
+
/**
|
434
|
+
* Returns a lazily constructed effect, whose construction may itself require effects.
|
435
|
+
* When no environment is required (i.e., when R == unknown) it is conceptually equivalent to `flatten(effect(io))`.
|
436
|
+
*
|
437
|
+
* @tsplus static IOOps deferTryWith
|
438
|
+
*/
|
439
|
+
export function deferTryWith<R, E, A>(
|
440
|
+
io: (runtimeConfig: RuntimeConfig, id: FiberId) => IO<R, E, A>,
|
441
|
+
): IO<R, unknown, A> {
|
442
|
+
return IO.deferWith((runtimeConfig, id) => {
|
443
|
+
try {
|
444
|
+
return io(runtimeConfig, id);
|
445
|
+
} catch (u) {
|
446
|
+
throw new IOError(Exit.fail(u));
|
447
|
+
}
|
448
|
+
});
|
449
|
+
}
|
450
|
+
|
451
|
+
/**
|
452
|
+
* Returns a lazily constructed effect, whose construction may itself require effects,
|
453
|
+
* translating any thrown exceptions into typed failed effects and mapping the error.
|
454
|
+
*
|
455
|
+
* When no environment is required (i.e., when R == unknown) it is conceptually equivalent to `flatten(effect(io))`.
|
456
|
+
*
|
457
|
+
* @tsplus static IOOps deferTryCatch
|
458
|
+
*/
|
459
|
+
export function deferTryCatch<R, E, A, E1>(io: () => IO<R, E, A>, onThrow: (error: unknown) => E1): IO<R, E | E1, A> {
|
460
|
+
return IO.defer(() => {
|
461
|
+
try {
|
462
|
+
return io();
|
463
|
+
} catch (u) {
|
464
|
+
throw new IOError(Exit.fail(onThrow(u)));
|
465
|
+
}
|
466
|
+
});
|
467
|
+
}
|
468
|
+
|
469
|
+
/**
|
470
|
+
* Returns a lazily constructed effect, whose construction may itself require effects,
|
471
|
+
* translating any thrown exceptions into typed failed effects and mapping the error.
|
472
|
+
*
|
473
|
+
* When no environment is required (i.e., when R == unknown) it is conceptually equivalent to `flatten(effect(io))`.
|
474
|
+
*
|
475
|
+
* @tsplus static IOOps deferTryCatchWith
|
476
|
+
*/
|
477
|
+
export function deferTryCatchWith<R, E, A, E1>(
|
478
|
+
io: (runtimeConfig: RuntimeConfig, id: FiberId) => IO<R, E, A>,
|
479
|
+
onThrow: (error: unknown) => E1,
|
480
|
+
): IO<R, E | E1, A> {
|
481
|
+
return IO.deferWith((runtimeConfig, id) => {
|
482
|
+
try {
|
483
|
+
return io(runtimeConfig, id);
|
484
|
+
} catch (u) {
|
485
|
+
throw new IOError(Exit.fail(onThrow(u)));
|
486
|
+
}
|
487
|
+
});
|
488
|
+
}
|
489
|
+
|
490
|
+
/**
|
491
|
+
* @tsplus static fncts.io.IOOps descriptor
|
492
|
+
*/
|
493
|
+
export const descriptor = descriptorWith(IO.succeedNow);
|
494
|
+
|
495
|
+
/**
|
496
|
+
* Constructs an IO based on information about the current fiber, such as
|
497
|
+
* its identity.
|
498
|
+
*
|
499
|
+
* @tsplus static fncts.io.IOOps descriptorWith
|
500
|
+
*/
|
501
|
+
export function descriptorWith<R, E, A>(f: (d: FiberDescriptor) => IO<R, E, A>, __tsplusTrace?: string): IO<R, E, A> {
|
502
|
+
return new GetDescriptor(f, __tsplusTrace);
|
503
|
+
}
|
504
|
+
|
505
|
+
/**
|
506
|
+
* Folds an `IO` that may fail with `E` or succeed with `A` into one that never fails but succeeds with `Either<E, A>`
|
507
|
+
*
|
508
|
+
* @tsplus getter fncts.io.IO either
|
509
|
+
*/
|
510
|
+
export function either<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): URIO<R, Either<E, A>> {
|
511
|
+
return ma.match(Either.left, Either.right);
|
512
|
+
}
|
513
|
+
|
514
|
+
/**
|
515
|
+
* @tsplus fluent fncts.io.IO ensuring
|
516
|
+
*/
|
517
|
+
export function ensuring_<R, E, A, R1>(
|
518
|
+
self: IO<R, E, A>,
|
519
|
+
finalizer: IO<R1, never, any>,
|
520
|
+
__tsplusTrace?: string,
|
521
|
+
): IO<R & R1, E, A> {
|
522
|
+
return new Ensuring(self, finalizer, __tsplusTrace);
|
523
|
+
}
|
524
|
+
|
525
|
+
/**
|
526
|
+
* @tsplus fluent fncts.io.IO errorAsCause
|
527
|
+
*/
|
528
|
+
export function errorAsCause<R, E, A>(ma: IO<R, Cause<E>, A>, __tsplusTrace?: string): IO<R, E, A> {
|
529
|
+
return ma.matchIO(IO.failCauseNow, IO.succeedNow);
|
530
|
+
}
|
531
|
+
|
532
|
+
/**
|
533
|
+
* @tsplus getter fncts.io.IO eventually
|
534
|
+
*/
|
535
|
+
export function eventually<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, never, A> {
|
536
|
+
return ma.orElse(ma.eventually);
|
537
|
+
}
|
538
|
+
|
539
|
+
/**
|
540
|
+
* @tsplus fluent fncts.io.IO extend
|
541
|
+
*/
|
542
|
+
export function extend_<R, E, A, B>(wa: IO<R, E, A>, f: (wa: IO<R, E, A>) => B, __tsplusTrace?: string): IO<R, E, B> {
|
543
|
+
return wa.matchIO(IO.failNow, (_) => IO.succeed(f(wa)));
|
544
|
+
}
|
545
|
+
|
546
|
+
/**
|
547
|
+
* @tsplus static fncts.io.IOOps fail
|
548
|
+
*/
|
549
|
+
export function fail<E>(e: Lazy<E>, __tsplusTrace?: string): FIO<E, never> {
|
550
|
+
return new Fail(() => Cause.fail(e()), __tsplusTrace);
|
551
|
+
}
|
552
|
+
|
553
|
+
/**
|
554
|
+
* @tsplus static fncts.io.IOOps failNow
|
555
|
+
*/
|
556
|
+
export function failNow<E>(e: E, __tsplusTrace?: string): FIO<E, never> {
|
557
|
+
return new Fail(() => Cause.fail(e), __tsplusTrace);
|
558
|
+
}
|
559
|
+
|
560
|
+
/**
|
561
|
+
* Creates a `IO` that has failed with the specified `Cause`
|
562
|
+
*
|
563
|
+
* @tsplus static fncts.io.IOOps failCauseNow
|
564
|
+
*/
|
565
|
+
export function failCauseNow<E>(cause: Cause<E>, __tsplusTrace?: string): FIO<E, never> {
|
566
|
+
return new Fail(() => cause, __tsplusTrace);
|
567
|
+
}
|
568
|
+
|
569
|
+
/**
|
570
|
+
* Returns an effect that models failure with the specified lazily-evaluated `Cause`.
|
571
|
+
*
|
572
|
+
* @tsplus static fncts.io.IOOps failCause
|
573
|
+
*/
|
574
|
+
export function failCause<E = never, A = never>(cause: Lazy<Cause<E>>, __tsplusTrace?: string): FIO<E, A> {
|
575
|
+
return new Fail(cause, __tsplusTrace);
|
576
|
+
}
|
577
|
+
|
578
|
+
/**
|
579
|
+
* Returns the `FiberId` of the `Fiber` on which this `IO` is running
|
580
|
+
*
|
581
|
+
* @tsplus static fncts.io.IOOps fiberId
|
582
|
+
*/
|
583
|
+
export const fiberId: IO<unknown, never, FiberId> = IO.descriptorWith((d) => IO.succeedNow(d.id));
|
584
|
+
|
585
|
+
/**
|
586
|
+
* Filters the collection using the specified effectual predicate.
|
587
|
+
*
|
588
|
+
* @tsplus static fncts.io.IOOps filter
|
589
|
+
*/
|
590
|
+
export function filter_<A, R, E>(
|
591
|
+
as: Iterable<A>,
|
592
|
+
f: (a: A) => IO<R, E, boolean>,
|
593
|
+
__tsplusTrace?: string,
|
594
|
+
): IO<R, E, Conc<A>> {
|
595
|
+
return as
|
596
|
+
.foldLeft(IO.succeedNow(Conc.builder<A>()) as IO<R, E, ConcBuilder<A>>, (eff, a) =>
|
597
|
+
eff.zipWith(f(a), (builder, p) => {
|
598
|
+
if (p) {
|
599
|
+
builder.append(a);
|
600
|
+
}
|
601
|
+
return builder;
|
602
|
+
}),
|
603
|
+
)
|
604
|
+
.map((b) => b.result());
|
605
|
+
}
|
606
|
+
|
607
|
+
/**
|
608
|
+
* @tsplus static fncts.io.IOOps filterMap
|
609
|
+
*/
|
610
|
+
export function filterMap_<A, R, E, B>(
|
611
|
+
as: Iterable<A>,
|
612
|
+
f: (a: A) => IO<R, E, Maybe<B>>,
|
613
|
+
__tsplusTrace?: string,
|
614
|
+
): IO<R, E, Conc<B>> {
|
615
|
+
return IO.filterMapWithIndex(as, (_, a) => f(a));
|
616
|
+
}
|
617
|
+
|
618
|
+
/**
|
619
|
+
* @tsplus static fncts.io.IOOps filterMapWithIndex
|
620
|
+
*/
|
621
|
+
export function filterMapWithIndex_<A, R, E, B>(
|
622
|
+
as: Iterable<A>,
|
623
|
+
f: (i: number, a: A) => IO<R, E, Maybe<B>>,
|
624
|
+
__tsplusTrace?: string,
|
625
|
+
): IO<R, E, Conc<B>> {
|
626
|
+
return IO.defer(() => {
|
627
|
+
const bs: Array<B> = [];
|
628
|
+
return IO.foreachWithIndexDiscard(as, (i, a) =>
|
629
|
+
f(i, a).map((b) => {
|
630
|
+
if (b.isJust()) {
|
631
|
+
bs.push(b.value);
|
632
|
+
}
|
633
|
+
}),
|
634
|
+
).as(Conc.from(bs));
|
635
|
+
});
|
636
|
+
}
|
637
|
+
|
638
|
+
/**
|
639
|
+
* Filters the collection using the specified effectual predicate, removing
|
640
|
+
* all elements that satisfy the predicate.
|
641
|
+
*
|
642
|
+
* @tsplus static fncts.io.IOOps filterNot
|
643
|
+
*/
|
644
|
+
export function filterNot_<A, R, E>(
|
645
|
+
as: Iterable<A>,
|
646
|
+
f: (a: A) => IO<R, E, boolean>,
|
647
|
+
__tsplusTrace?: string,
|
648
|
+
): IO<R, E, Conc<A>> {
|
649
|
+
return IO.filter(as, (a) => f(a).map((b) => !b));
|
650
|
+
}
|
651
|
+
|
652
|
+
/**
|
653
|
+
* Applies `or` if the predicate fails.
|
654
|
+
*
|
655
|
+
* @tsplus fluent fncts.io.IO filterOrElse
|
656
|
+
*/
|
657
|
+
export function filterOrElse_<R, E, A, B extends A, R1, E1, A1>(
|
658
|
+
fa: IO<R, E, A>,
|
659
|
+
refinement: Refinement<A, B>,
|
660
|
+
or: (a: Exclude<A, B>) => IO<R1, E1, A1>,
|
661
|
+
__tsplusTrace?: string,
|
662
|
+
): IO<R & R1, E | E1, B | A1>;
|
663
|
+
export function filterOrElse_<R, E, A, R1, E1, A1>(
|
664
|
+
fa: IO<R, E, A>,
|
665
|
+
predicate: Predicate<A>,
|
666
|
+
or: (a: A) => IO<R1, E1, A1>,
|
667
|
+
__tsplusTrace?: string,
|
668
|
+
): IO<R & R1, E | E1, A | A1>;
|
669
|
+
export function filterOrElse_<R, E, A, R1, E1, A1>(
|
670
|
+
fa: IO<R, E, A>,
|
671
|
+
predicate: Predicate<A>,
|
672
|
+
or: unknown,
|
673
|
+
__tsplusTrace?: string,
|
674
|
+
): IO<R & R1, E | E1, A | A1> {
|
675
|
+
return flatMap_(
|
676
|
+
fa,
|
677
|
+
(a): IO<R1, E1, A | A1> => (predicate(a) ? IO.succeedNow(a) : IO.defer((or as (a: A) => IO<R1, E1, A1>)(a))),
|
678
|
+
);
|
679
|
+
}
|
680
|
+
|
681
|
+
/**
|
682
|
+
* Fails with `failWith` if the predicate fails.
|
683
|
+
*
|
684
|
+
* @tsplus fluent fncts.io.IO filterOrFail
|
685
|
+
*/
|
686
|
+
export function filterOrFail_<R, E, A, B extends A, E1>(
|
687
|
+
fa: IO<R, E, A>,
|
688
|
+
refinement: Refinement<A, B>,
|
689
|
+
failWith: (a: Exclude<A, B>) => E1,
|
690
|
+
): IO<R, E | E1, B>;
|
691
|
+
export function filterOrFail_<R, E, A, E1>(
|
692
|
+
fa: IO<R, E, A>,
|
693
|
+
predicate: Predicate<A>,
|
694
|
+
failWith: (a: A) => E1,
|
695
|
+
): IO<R, E | E1, A>;
|
696
|
+
export function filterOrFail_<R, E, A, E1>(
|
697
|
+
fa: IO<R, E, A>,
|
698
|
+
predicate: Predicate<A>,
|
699
|
+
failWith: unknown,
|
700
|
+
): IO<R, E | E1, A> {
|
701
|
+
return filterOrElse_(fa, predicate, (a) => IO.failNow((failWith as (a: A) => E1)(a)));
|
702
|
+
}
|
703
|
+
|
704
|
+
/**
|
705
|
+
* Returns an `IO` that yields the value of the first
|
706
|
+
* `IO` to succeed.
|
707
|
+
*
|
708
|
+
* @tsplus static fncts.io.IOOps firstSuccess
|
709
|
+
*/
|
710
|
+
export function firstSuccess<R, E, A>(mas: NonEmptyArray<IO<R, E, A>>): IO<R, E, A> {
|
711
|
+
return mas.reduce((b, a) => b.orElse(a));
|
712
|
+
}
|
713
|
+
|
714
|
+
/**
|
715
|
+
* Halts with specified `unknown` if the predicate fails.
|
716
|
+
*
|
717
|
+
* @tsplus fluent fncts.io.IO filterOrHalt
|
718
|
+
*/
|
719
|
+
export function filterOrHalt_<R, E, A, B extends A>(
|
720
|
+
fa: IO<R, E, A>,
|
721
|
+
refinement: Refinement<A, B>,
|
722
|
+
haltWith: (a: Exclude<A, B>) => unknown,
|
723
|
+
__tsplusTrace?: string,
|
724
|
+
): IO<R, E, A>;
|
725
|
+
export function filterOrHalt_<R, E, A>(
|
726
|
+
fa: IO<R, E, A>,
|
727
|
+
predicate: Predicate<A>,
|
728
|
+
haltWith: (a: A) => unknown,
|
729
|
+
__tsplusTrace?: string,
|
730
|
+
): IO<R, E, A>;
|
731
|
+
export function filterOrHalt_<R, E, A>(
|
732
|
+
fa: IO<R, E, A>,
|
733
|
+
predicate: Predicate<A>,
|
734
|
+
haltWith: unknown,
|
735
|
+
__tsplusTrace?: string,
|
736
|
+
): IO<R, E, A> {
|
737
|
+
return fa.filterOrElse(predicate, (a) => IO.haltNow((haltWith as (a: A) => unknown)(a)));
|
738
|
+
}
|
739
|
+
|
740
|
+
/**
|
741
|
+
* @tsplus getter fncts.io.IO flatten
|
742
|
+
*/
|
743
|
+
export function flatten<R, E, R1, E1, A>(self: IO<R, E, IO<R1, E1, A>>): IO<R & R1, E | E1, A> {
|
744
|
+
return self.flatMap(identity);
|
745
|
+
}
|
746
|
+
|
747
|
+
/**
|
748
|
+
* Folds an `Iterable<A>` using an effectful function f, working sequentially from left to right.
|
749
|
+
*
|
750
|
+
* @tsplus static fncts.io.IOOps foldLeft
|
751
|
+
*/
|
752
|
+
export function foldLeft_<A, B, R, E>(
|
753
|
+
as: Iterable<A>,
|
754
|
+
b: B,
|
755
|
+
f: (b: B, a: A) => IO<R, E, B>,
|
756
|
+
__tsplusTrace?: string,
|
757
|
+
): IO<R, E, B> {
|
758
|
+
return as.foldLeft(IO.succeedNow(b) as IO<R, E, B>, (acc, el) => acc.flatMap((a) => f(a, el)));
|
759
|
+
}
|
760
|
+
|
761
|
+
/**
|
762
|
+
* Combines an array of `IO`s using a `Monoid`
|
763
|
+
*
|
764
|
+
* @constrained
|
765
|
+
* @tsplus static fncts.io.IOOps foldMap
|
766
|
+
*/
|
767
|
+
export function foldMap_<M>(M: P.Monoid<M>) {
|
768
|
+
return <R, E, A>(as: Iterable<IO<R, E, A>>, f: (a: A) => M): IO<R, E, M> =>
|
769
|
+
IO.foldLeft(as, M.nat, (m, a) => a.map((a) => M.combine_(m, f(a))));
|
770
|
+
}
|
771
|
+
|
772
|
+
function foldRightLoop<A, B, R, E>(
|
773
|
+
iterator: Iterator<A>,
|
774
|
+
b: UIO<B>,
|
775
|
+
f: (a: A, b: IO<R, E, B>) => IO<R, E, B>,
|
776
|
+
): IO<R, E, B> {
|
777
|
+
const next = iterator.next();
|
778
|
+
return next.done ? b : f(next.value, foldRightLoop(iterator, b, f));
|
779
|
+
}
|
780
|
+
|
781
|
+
/**
|
782
|
+
* Performs a right-associative fold of an `Iterable<A>`
|
783
|
+
*
|
784
|
+
* @tsplus static fncts.io.IOOps foldRight
|
785
|
+
*/
|
786
|
+
export function foldRight_<A, B, R, E>(
|
787
|
+
as: Iterable<A>,
|
788
|
+
b: UIO<B>,
|
789
|
+
f: (a: A, b: IO<R, E, B>) => IO<R, E, B>,
|
790
|
+
): IO<R, E, B> {
|
791
|
+
return foldRightLoop(as[Symbol.iterator](), b, f);
|
792
|
+
}
|
793
|
+
|
794
|
+
function foreachWithIndexDiscardLoop<A, R, E, B>(
|
795
|
+
iterator: Iterator<A>,
|
796
|
+
f: (i: number, a: A) => IO<R, E, B>,
|
797
|
+
i = 0,
|
798
|
+
): IO<R, E, void> {
|
799
|
+
const next = iterator.next();
|
800
|
+
return next.done ? IO.unit : f(i, next.value).flatMap(() => foreachWithIndexDiscardLoop(iterator, f, i + 1));
|
801
|
+
}
|
802
|
+
|
803
|
+
/**
|
804
|
+
* Applies the function `f` to each element of the `Iterable<A>` and
|
805
|
+
* returns the results in a new `Conc<B>`.
|
806
|
+
*
|
807
|
+
* For a parallel version of this method, see `foreachC`.
|
808
|
+
* If you do not need the results, see `foreachUnit` for a more efficient implementation.
|
809
|
+
*
|
810
|
+
* @tsplus static fncts.io.IOOps foreach
|
811
|
+
*/
|
812
|
+
export function foreach_<A, R, E, B>(
|
813
|
+
as: Iterable<A>,
|
814
|
+
f: (a: A) => IO<R, E, B>,
|
815
|
+
__tsplusTrace?: string,
|
816
|
+
): IO<R, E, Conc<B>> {
|
817
|
+
return IO.defer(() => {
|
818
|
+
const acc: Array<B> = [];
|
819
|
+
return IO.foreachWithIndexDiscard(as, (_, a) =>
|
820
|
+
f(a).flatMap((b) => {
|
821
|
+
acc.push(b);
|
822
|
+
return IO.unit;
|
823
|
+
}),
|
824
|
+
).as(Conc.from(acc));
|
825
|
+
});
|
826
|
+
}
|
827
|
+
|
828
|
+
/**
|
829
|
+
* Applies the function `f` to each element of the `Iterable<A>` and
|
830
|
+
* returns the results in a new `Conc<B>`.
|
831
|
+
*
|
832
|
+
* For a parallel version of this method, see `foreachC`.
|
833
|
+
* If you do not need the results, see `foreachUnit` for a more efficient implementation.
|
834
|
+
*
|
835
|
+
* @tsplus static fncts.io.IOOps foreachWithIndex
|
836
|
+
*/
|
837
|
+
export function foreachWithIndex_<A, R, E, B>(as: Iterable<A>, f: (i: number, a: A) => IO<R, E, B>): IO<R, E, Conc<B>> {
|
838
|
+
return IO.defer(() => {
|
839
|
+
const acc: Array<B> = [];
|
840
|
+
return IO.foreachWithIndexDiscard(as, (i, a) =>
|
841
|
+
f(i, a).flatMap((b) => {
|
842
|
+
acc.push(b);
|
843
|
+
return IO.unit;
|
844
|
+
}),
|
845
|
+
).as(Conc.from(acc));
|
846
|
+
});
|
847
|
+
}
|
848
|
+
|
849
|
+
/**
|
850
|
+
* @tsplus static fncts.io.IOOps foreachWithIndexDiscard
|
851
|
+
*/
|
852
|
+
export function foreachWithIndexDiscard_<A, R, E, B>(
|
853
|
+
as: Iterable<A>,
|
854
|
+
f: (i: number, a: A) => IO<R, E, B>,
|
855
|
+
): IO<R, E, void> {
|
856
|
+
return IO.defer(foreachWithIndexDiscardLoop(as[Symbol.iterator](), f));
|
857
|
+
}
|
858
|
+
|
859
|
+
/**
|
860
|
+
* Applies the function `f` to each element of the `Iterable<A>` and runs
|
861
|
+
* produced IOs sequentially.
|
862
|
+
*
|
863
|
+
* @tsplus static fncts.io.IOOps foreachDiscard
|
864
|
+
*/
|
865
|
+
export function foreachDiscard_<A, R, E, B>(as: Iterable<A>, f: (a: A) => IO<R, E, B>): IO<R, E, void> {
|
866
|
+
return IO.defer(foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)));
|
867
|
+
}
|
868
|
+
|
869
|
+
/**
|
870
|
+
* Repeats this effect forever (until the first failure).
|
871
|
+
*
|
872
|
+
* @tsplus getter fncts.io.IO forever
|
873
|
+
*/
|
874
|
+
export function forever<R, E, A>(ma: IO<R, E, A>): IO<R, E, never> {
|
875
|
+
return ma.apSecond(IO.yieldNow).flatMap(() => ma.forever);
|
876
|
+
}
|
877
|
+
|
878
|
+
/**
|
879
|
+
* Returns an IO that forks this IO into its own separate fiber,
|
880
|
+
* returning the fiber immediately, without waiting for it to begin executing
|
881
|
+
* the IO.
|
882
|
+
*
|
883
|
+
* You can use the `fork` method whenever you want to execute an IO in a
|
884
|
+
* new fiber, concurrently and without "blocking" the fiber executing other
|
885
|
+
* IOs. Using fibers can be tricky, so instead of using this method
|
886
|
+
* directly, consider other higher-level methods, such as `raceWith`,
|
887
|
+
* `zipPar`, and so forth.
|
888
|
+
*
|
889
|
+
* The fiber returned by this method has methods interrupt the fiber and to
|
890
|
+
* wait for it to finish executing the IO. See `Fiber` for more
|
891
|
+
* information.
|
892
|
+
*
|
893
|
+
* Whenever you use this method to launch a new fiber, the new fiber is
|
894
|
+
* attached to the parent fiber's scope. This means when the parent fiber
|
895
|
+
* terminates, the child fiber will be terminated as well, ensuring that no
|
896
|
+
* fibers leak. This behavior is called "None supervision", and if this
|
897
|
+
* behavior is not desired, you may use the `forkDaemon` or `forkIn`
|
898
|
+
* methods.
|
899
|
+
*
|
900
|
+
* @tsplus getter fncts.io.IO fork
|
901
|
+
*/
|
902
|
+
export function fork<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): URIO<R, FiberContext<E, A>> {
|
903
|
+
return new Fork(ma, Nothing(), __tsplusTrace);
|
904
|
+
}
|
905
|
+
|
906
|
+
/**
|
907
|
+
* Lifts an `Either` into an `IO`
|
908
|
+
*
|
909
|
+
* @tsplus static fncts.io.IOOps fromEither
|
910
|
+
*/
|
911
|
+
export function fromEither<E, A>(either: Lazy<Either<E, A>>, __tsplusTrace?: string): IO<unknown, E, A> {
|
912
|
+
return IO.succeed(either).flatMap((ea) => ea.match(IO.failNow, IO.succeedNow));
|
913
|
+
}
|
914
|
+
|
915
|
+
/**
|
916
|
+
* Lifts an `Either` into an `IO`
|
917
|
+
*
|
918
|
+
* @tsplus static fncts.io.IOOps fromEitherNow
|
919
|
+
*/
|
920
|
+
export function fromEitherNow<E, A>(either: Either<E, A>, __tsplusTrace?: string): IO<unknown, E, A> {
|
921
|
+
return either.match(IO.failNow, IO.succeedNow);
|
922
|
+
}
|
923
|
+
|
924
|
+
/**
|
925
|
+
* Lifts an `Eval` into an `IO`
|
926
|
+
*
|
927
|
+
* @tsplus static fncts.io.IOOps fromEval
|
928
|
+
*/
|
929
|
+
export function fromEval<A>(computation: Eval<A>, __tsplusTrace?: string): IO<unknown, never, A> {
|
930
|
+
return IO.succeed(computation.run);
|
931
|
+
}
|
932
|
+
|
933
|
+
/**
|
934
|
+
* Creates a `IO` from an exit value
|
935
|
+
*
|
936
|
+
* @tsplus static fncts.io.IOOps fromExit
|
937
|
+
*/
|
938
|
+
export function fromExit<E, A>(exit: Lazy<Exit<E, A>>, __tsplusTrace?: string): FIO<E, A> {
|
939
|
+
return IO.defer(exit().match(IO.failCauseNow, IO.succeedNow));
|
940
|
+
}
|
941
|
+
|
942
|
+
/**
|
943
|
+
* Creates a `IO` from an exit value
|
944
|
+
*
|
945
|
+
* @tsplus static fncts.io.IOOps fromExitNow
|
946
|
+
*/
|
947
|
+
export function fromExitNow<E, A>(exit: Exit<E, A>, __tsplusTrace?: string): FIO<E, A> {
|
948
|
+
return exit.match(IO.failCauseNow, IO.succeedNow);
|
949
|
+
}
|
950
|
+
|
951
|
+
/**
|
952
|
+
* Lifts a `Maybe` into an `IO` but preserves the error as a `Maybe` in the error channel, making it easier to compose
|
953
|
+
* in some scenarios.
|
954
|
+
*
|
955
|
+
* @tsplus static fncts.io.IOOps fromMaybe
|
956
|
+
*/
|
957
|
+
export function fromMaybe<A>(maybe: Lazy<Maybe<A>>, __tsplusTrace?: string): FIO<Maybe<never>, A> {
|
958
|
+
return IO.succeed(maybe).flatMap((m) => m.match(() => IO.failNow(Nothing()), IO.succeedNow));
|
959
|
+
}
|
960
|
+
|
961
|
+
/**
|
962
|
+
* @tsplus static fncts.io.IOOps fromMaybeNow
|
963
|
+
*/
|
964
|
+
export function fromMaybeNow<A = never>(maybe: Maybe<A>, __tsplusTrace?: string): IO<unknown, Maybe<never>, A> {
|
965
|
+
return maybe.match(() => IO.failNow(Nothing()), IO.succeedNow);
|
966
|
+
}
|
967
|
+
|
968
|
+
/**
|
969
|
+
* Create an IO that when executed will construct `promise` and wait for its result,
|
970
|
+
* errors will be handled using `onReject`
|
971
|
+
*
|
972
|
+
* @tsplus static fncts.io.IOOps fromPromiseCatch
|
973
|
+
*/
|
974
|
+
export function fromPromiseCatch<E, A>(
|
975
|
+
promise: Lazy<Promise<A>>,
|
976
|
+
onReject: (reason: unknown) => E,
|
977
|
+
__tsplusTrace?: string,
|
978
|
+
): FIO<E, A> {
|
979
|
+
return IO.async((k) => {
|
980
|
+
promise()
|
981
|
+
.then((a) => k(IO.succeedNow(a)))
|
982
|
+
.catch((e) => k(IO.failNow(onReject(e))));
|
983
|
+
});
|
984
|
+
}
|
985
|
+
|
986
|
+
/**
|
987
|
+
* Create an IO that when executed will construct `promise` and wait for its result,
|
988
|
+
* errors will produce failure as `unknown`
|
989
|
+
*
|
990
|
+
* @tsplus static fncts.io.IOOps fromPromise
|
991
|
+
*/
|
992
|
+
export function fromPromise<A>(promise: Lazy<Promise<A>>, __tsplusTrace?: string): FIO<unknown, A> {
|
993
|
+
return IO.fromPromiseCatch(promise, identity);
|
994
|
+
}
|
995
|
+
|
996
|
+
/**
|
997
|
+
* Like fromPromise but produces a defect in case of errors
|
998
|
+
*
|
999
|
+
* @tsplus static fncts.io.IOOps fromPromiseHalt
|
1000
|
+
*/
|
1001
|
+
export function fromPromiseHalt<A>(promise: Lazy<Promise<A>>, __tsplusTrace?: string): FIO<never, A> {
|
1002
|
+
return async((k) => {
|
1003
|
+
promise()
|
1004
|
+
.then((a) => k(IO.succeedNow(a)))
|
1005
|
+
.catch((e) => k(IO.haltNow(e)));
|
1006
|
+
});
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
/**
|
1010
|
+
* Unwraps the optional success of an `IO`, but can fail with a `Nothing` value.
|
1011
|
+
*
|
1012
|
+
* @tsplus getter fncts.io.IO get
|
1013
|
+
*/
|
1014
|
+
export function get<R, E, A>(ma: IO<R, E, Maybe<A>>): IO<R, Maybe<E>, A> {
|
1015
|
+
return ma.matchCauseIO(
|
1016
|
+
(cause) => IO.failCauseNow(cause.map(Maybe.just)),
|
1017
|
+
(ma) => ma.match(() => IO.failNow(Nothing()), IO.succeedNow),
|
1018
|
+
);
|
1019
|
+
}
|
1020
|
+
|
1021
|
+
/**
|
1022
|
+
* Extracts the optional value, or returns the given 'orElse'.
|
1023
|
+
*
|
1024
|
+
* @tsplus fluent fncts.io.IO getOrElse
|
1025
|
+
*/
|
1026
|
+
export function getOrElse_<R, E, A, B>(ma: IO<R, E, Maybe<A>>, orElse: Lazy<B>): IO<R, E, A | B> {
|
1027
|
+
return ma.map((ma) => ma.getOrElse(orElse));
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
/**
|
1031
|
+
* Extracts the optional value, or executes the effect 'orElse'.
|
1032
|
+
*
|
1033
|
+
* @tsplus fluent fncts.io.IO getOrElseIO
|
1034
|
+
*/
|
1035
|
+
export function getOrElseIO_<R, E, A, R1, E1, B>(
|
1036
|
+
ma: IO<R, E, Maybe<A>>,
|
1037
|
+
orElse: Lazy<IO<R1, E1, B>>,
|
1038
|
+
): IO<R & R1, E | E1, A | B> {
|
1039
|
+
return (ma as IO<R, E, Maybe<A | B>>).flatMap((mab) => mab.map(IO.succeedNow).getOrElse(orElse));
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
/**
|
1043
|
+
* Lifts a Maybe into an IO. If the option is `Nothing`, fail with `onNothing`.
|
1044
|
+
*
|
1045
|
+
* @tsplus static fncts.io.IOOps getOrFailWith
|
1046
|
+
*/
|
1047
|
+
export function getOrFailWith_<E, A>(maybe: Maybe<A>, onNothing: Lazy<E>): FIO<E, A> {
|
1048
|
+
return IO.defer(maybe.match(() => IO.fail(onNothing), IO.succeedNow));
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
/**
|
1052
|
+
* Lifts a Maybe into a IO, if the Maybe is `Nothing` it fails with Unit.
|
1053
|
+
*
|
1054
|
+
* @tsplus static fncts.io.IOOps getOrFailUnit
|
1055
|
+
*/
|
1056
|
+
export function getOrFailUnit<A>(option: Maybe<A>): FIO<void, A> {
|
1057
|
+
return IO.getOrFailWith(option, undefined);
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
/**
|
1061
|
+
* Creates an `IO` that halts with the specified lazily-evaluated defect.
|
1062
|
+
* This method can be used for terminating a fiber because a defect has been
|
1063
|
+
* detected in the code.
|
1064
|
+
*
|
1065
|
+
* @tsplus static fncts.io.IOOps halt
|
1066
|
+
*/
|
1067
|
+
export function halt(e: Lazy<unknown>, __tsplusTrace?: string): UIO<never> {
|
1068
|
+
return IO.failCause(() => Cause.halt(e(), Trace.none), __tsplusTrace);
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
/**
|
1072
|
+
* Creates an `IO` that halts with the specified defect
|
1073
|
+
* This method can be used for terminating a fiber because a defect has been
|
1074
|
+
* detected in the code.
|
1075
|
+
*
|
1076
|
+
* @tsplus static fncts.io.IOOps haltNow
|
1077
|
+
*/
|
1078
|
+
export function haltNow(e: unknown, __tsplusTrace?: string): UIO<never> {
|
1079
|
+
return IO.failCauseNow(Cause.halt(e, Trace.none), __tsplusTrace);
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
/**
|
1083
|
+
* @tsplus fluent fncts.io.IO ifIO
|
1084
|
+
*/
|
1085
|
+
export function ifIO_<R, E, R1, E1, B, R2, E2, C>(
|
1086
|
+
self: IO<R, E, boolean>,
|
1087
|
+
onFalse: Lazy<IO<R1, E1, B>>,
|
1088
|
+
onTrue: Lazy<IO<R2, E2, C>>,
|
1089
|
+
): IO<R & R1 & R2, E | E1 | E2, B | C> {
|
1090
|
+
return self.flatMap((b) => (b ? onTrue() : onFalse()));
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
/**
|
1094
|
+
* @tsplus static fncts.io.IOOps if
|
1095
|
+
*/
|
1096
|
+
export function if_<R, E, A, R1, E1, A1>(
|
1097
|
+
b: boolean,
|
1098
|
+
onTrue: Lazy<IO<R, E, A>>,
|
1099
|
+
onFalse: Lazy<IO<R1, E1, A1>>,
|
1100
|
+
__tsplusTrace?: string,
|
1101
|
+
): IO<R & R1, E | E1, A | A1> {
|
1102
|
+
return IO.succeedNow(b).ifIO(onTrue, onFalse);
|
1103
|
+
}
|
1104
|
+
|
1105
|
+
/**
|
1106
|
+
* @tsplus getter fncts.io.IO ignore
|
1107
|
+
*/
|
1108
|
+
export function ignore<R, E, A>(fa: IO<R, E, A>): URIO<R, void> {
|
1109
|
+
return fa.match(
|
1110
|
+
() => undefined,
|
1111
|
+
() => undefined,
|
1112
|
+
);
|
1113
|
+
}
|
1114
|
+
|
1115
|
+
/**
|
1116
|
+
* Folds a `IO` to a boolean describing whether or not it is a failure
|
1117
|
+
*
|
1118
|
+
* @tsplus getter fncts.io.IO isFailure
|
1119
|
+
*/
|
1120
|
+
export function isFailure<R, E, A>(ma: IO<R, E, A>): IO<R, never, boolean> {
|
1121
|
+
return ma.match(
|
1122
|
+
() => true,
|
1123
|
+
() => false,
|
1124
|
+
);
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
/**
|
1128
|
+
* Folds a `IO` to a boolean describing whether or not it is a success
|
1129
|
+
*
|
1130
|
+
* @tsplus getter fncts.io.IO isSuccess
|
1131
|
+
*/
|
1132
|
+
export function isSuccess<R, E, A>(ma: IO<R, E, A>): IO<R, never, boolean> {
|
1133
|
+
return ma.match(
|
1134
|
+
() => false,
|
1135
|
+
() => true,
|
1136
|
+
);
|
1137
|
+
}
|
1138
|
+
/**
|
1139
|
+
* Iterates with the specified effectual function. The moral equivalent of:
|
1140
|
+
*
|
1141
|
+
* ```typescript
|
1142
|
+
* let s = initial;
|
1143
|
+
*
|
1144
|
+
* while (cont(s)) {
|
1145
|
+
* s = body(s);
|
1146
|
+
* }
|
1147
|
+
*
|
1148
|
+
* return s;
|
1149
|
+
* ```
|
1150
|
+
*
|
1151
|
+
* @tsplus static fncts.io.IOOps iterate
|
1152
|
+
*/
|
1153
|
+
export function iterate_<R, E, A>(
|
1154
|
+
initial: A,
|
1155
|
+
cont: (a: A) => boolean,
|
1156
|
+
body: (a: A) => IO<R, E, A>,
|
1157
|
+
__tsplusTrace?: string,
|
1158
|
+
): IO<R, E, A> {
|
1159
|
+
return cont(initial) ? body(initial).flatMap((a) => IO.iterate(a, cont, body)) : IO.succeedNow(initial);
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
/**
|
1163
|
+
* Returns an IO with the value on the left part.
|
1164
|
+
*
|
1165
|
+
* @tsplus static fncts.io.IOOps left
|
1166
|
+
*/
|
1167
|
+
export function left<A>(a: Lazy<A>): UIO<Either<A, never>> {
|
1168
|
+
return IO.succeed(a).flatMap((a) => IO.succeedNow(Either.left(a)));
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
/**
|
1172
|
+
* @tsplus static fncts.io.IOOps log
|
1173
|
+
*/
|
1174
|
+
export function log(message: Lazy<string>, __tsplusTrace?: string): UIO<void> {
|
1175
|
+
return new Logged(message, Cause.empty(), Nothing(), __tsplusTrace);
|
1176
|
+
}
|
1177
|
+
|
1178
|
+
/**
|
1179
|
+
* Loops with the specified effectual function, collecting the results into a
|
1180
|
+
* list. The moral equivalent of:
|
1181
|
+
*
|
1182
|
+
* ```typescript
|
1183
|
+
* let s = initial
|
1184
|
+
* let as = [] as readonly A[]
|
1185
|
+
*
|
1186
|
+
* while (cont(s)) {
|
1187
|
+
* as = [body(s), ...as]
|
1188
|
+
* s = inc(s)
|
1189
|
+
* }
|
1190
|
+
*
|
1191
|
+
* A.reverse(as)
|
1192
|
+
* ```
|
1193
|
+
*
|
1194
|
+
* @tsplus static fncts.io.IOOps loop
|
1195
|
+
*/
|
1196
|
+
export function loop_<A, R, E, B>(
|
1197
|
+
initial: A,
|
1198
|
+
cont: (a: A) => boolean,
|
1199
|
+
inc: (b: A) => A,
|
1200
|
+
body: (b: A) => IO<R, E, B>,
|
1201
|
+
__tsplusTrace?: string,
|
1202
|
+
): IO<R, E, Conc<B>> {
|
1203
|
+
if (cont(initial)) {
|
1204
|
+
return body(initial).flatMap((a) => IO.loop(inc(initial), cont, inc, body).map((as) => as.prepend(a)));
|
1205
|
+
} else {
|
1206
|
+
return IO.succeedNow(Conc.empty());
|
1207
|
+
}
|
1208
|
+
}
|
1209
|
+
|
1210
|
+
/**
|
1211
|
+
* Loops with the specified effectual function purely for its effects. The
|
1212
|
+
* moral equivalent of:
|
1213
|
+
*
|
1214
|
+
* ```
|
1215
|
+
* var s = initial
|
1216
|
+
*
|
1217
|
+
* while (cont(s)) {
|
1218
|
+
* body(s)
|
1219
|
+
* s = inc(s)
|
1220
|
+
* }
|
1221
|
+
* ```
|
1222
|
+
*
|
1223
|
+
* @tsplus static fncts.io.IOOps loopUnit
|
1224
|
+
*/
|
1225
|
+
export function loopUnit_<A, R, E>(
|
1226
|
+
initial: A,
|
1227
|
+
cont: (a: A) => boolean,
|
1228
|
+
inc: (a: A) => A,
|
1229
|
+
body: (a: A) => IO<R, E, any>,
|
1230
|
+
__tsplusTrace?: string,
|
1231
|
+
): IO<R, E, void> {
|
1232
|
+
if (cont(initial)) {
|
1233
|
+
return body(initial).flatMap(() => IO.loop(inc(initial), cont, inc, body)).asUnit;
|
1234
|
+
} else {
|
1235
|
+
return IO.unit;
|
1236
|
+
}
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
/**
|
1240
|
+
* Returns an `IO` whose success is mapped by the specified function `f`.
|
1241
|
+
*
|
1242
|
+
* @tsplus fluent fncts.io.IO map
|
1243
|
+
*/
|
1244
|
+
export function map_<R, E, A, B>(fa: IO<R, E, A>, f: (a: A) => B, __tsplusTrace?: string): IO<R, E, B> {
|
1245
|
+
return fa.flatMap((a) => IO.succeedNow(f(a)));
|
1246
|
+
}
|
1247
|
+
|
1248
|
+
/**
|
1249
|
+
* Map covariantly over the first argument.
|
1250
|
+
*
|
1251
|
+
* Returns an IO with its error channel mapped using the specified
|
1252
|
+
* function. This can be used to lift a "smaller" error into a "larger"
|
1253
|
+
* error.
|
1254
|
+
*
|
1255
|
+
* @tsplus fluent fncts.io.IO mapError
|
1256
|
+
*/
|
1257
|
+
export function mapError_<R, E, A, E1>(fea: IO<R, E, A>, f: (e: E) => E1, __tsplusTrace?: string): IO<R, E1, A> {
|
1258
|
+
return fea.matchCauseIO((cause) => IO.failCauseNow(cause.map(f)), IO.succeedNow);
|
1259
|
+
}
|
1260
|
+
|
1261
|
+
/**
|
1262
|
+
* @tsplus static fncts.io.IOOps mapTryCatch
|
1263
|
+
*/
|
1264
|
+
export function mapTryCatch_<R, E, A, E1, B>(
|
1265
|
+
io: IO<R, E, A>,
|
1266
|
+
f: (a: A) => B,
|
1267
|
+
onThrow: (u: unknown) => E1,
|
1268
|
+
__tsplusTrace?: string,
|
1269
|
+
): IO<R, E | E1, B> {
|
1270
|
+
return io.flatMap((a) => IO.tryCatch(() => f(a), onThrow));
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
/**
|
1274
|
+
* Returns an IO with its full cause of failure mapped using
|
1275
|
+
* the specified function. This can be used to transform errors
|
1276
|
+
* while preserving the original structure of Cause.
|
1277
|
+
*
|
1278
|
+
* @tsplus fluent fncts.io.IO mapErrorCause
|
1279
|
+
*/
|
1280
|
+
export function mapErrorCause_<R, E, A, E1>(
|
1281
|
+
ma: IO<R, E, A>,
|
1282
|
+
f: (cause: Cause<E>) => Cause<E1>,
|
1283
|
+
__tsplusTrace?: string,
|
1284
|
+
): IO<R, E1, A> {
|
1285
|
+
return ma.matchCauseIO((cause) => IO.failCauseNow(f(cause)), IO.succeedNow);
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
/**
|
1289
|
+
* A more powerful version of `match_` that allows recovering from any kind of failure except interruptions.
|
1290
|
+
*
|
1291
|
+
* @tsplus fluent fncts.io.IO matchCause
|
1292
|
+
*/
|
1293
|
+
export function matchCause_<R, E, A, A1, A2>(
|
1294
|
+
self: IO<R, E, A>,
|
1295
|
+
onFailure: (cause: Cause<E>) => A1,
|
1296
|
+
onSuccess: (a: A) => A2,
|
1297
|
+
__tsplusTrace?: string,
|
1298
|
+
): IO<R, never, A1 | A2> {
|
1299
|
+
return self.matchCauseIO(
|
1300
|
+
(cause) => IO.succeedNow(onFailure(cause)),
|
1301
|
+
(a) => IO.succeedNow(onSuccess(a)),
|
1302
|
+
);
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
/**
|
1306
|
+
* A more powerful version of `matchIO` that allows recovering from any kind of failure except interruptions.
|
1307
|
+
*
|
1308
|
+
* @tsplus fluent fncts.io.IO matchCauseIO
|
1309
|
+
*/
|
1310
|
+
export function matchCauseIO_<R, E, A, R1, E1, A1, R2, E2, A2>(
|
1311
|
+
self: IO<R, E, A>,
|
1312
|
+
onFailure: (cause: Cause<E>) => IO<R1, E1, A1>,
|
1313
|
+
onSuccess: (a: A) => IO<R2, E2, A2>,
|
1314
|
+
__tsplusTrace?: string,
|
1315
|
+
): IO<R & R1 & R2, E1 | E2, A1 | A2> {
|
1316
|
+
return new Match(self, onFailure, onSuccess, __tsplusTrace);
|
1317
|
+
}
|
1318
|
+
|
1319
|
+
/**
|
1320
|
+
* @tsplus fluent fncts.io.IO matchIO
|
1321
|
+
*/
|
1322
|
+
export function matchIO_<R, R1, R2, E, E1, E2, A, A1, A2>(
|
1323
|
+
self: IO<R, E, A>,
|
1324
|
+
onFailure: (e: E) => IO<R1, E1, A1>,
|
1325
|
+
onSuccess: (a: A) => IO<R2, E2, A2>,
|
1326
|
+
__tsplusTrace?: string,
|
1327
|
+
): IO<R & R1 & R2, E1 | E2, A1 | A2> {
|
1328
|
+
return self.matchCauseIO((cause) => cause.failureOrCause.match(onFailure, IO.failCauseNow), onSuccess);
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
/**
|
1332
|
+
* Folds over the failure value or the success value to yield an IO that
|
1333
|
+
* does not fail, but succeeds with the value returned by the left or right
|
1334
|
+
* function passed to `match_`.
|
1335
|
+
*
|
1336
|
+
* @tsplus fluent fncts.io.IO match
|
1337
|
+
*/
|
1338
|
+
export function match_<R, E, A, B, C>(
|
1339
|
+
self: IO<R, E, A>,
|
1340
|
+
onFailure: (e: E) => B,
|
1341
|
+
onSuccess: (a: A) => C,
|
1342
|
+
__tsplusTrace?: string,
|
1343
|
+
): IO<R, never, B | C> {
|
1344
|
+
return self.matchIO(
|
1345
|
+
(e) => IO.succeedNow(onFailure(e)),
|
1346
|
+
(a) => IO.succeedNow(onSuccess(a)),
|
1347
|
+
);
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
/**
|
1351
|
+
* A version of `matchIO` that gives you the (optional) trace of the error.
|
1352
|
+
*
|
1353
|
+
* @tsplus fluent fncts.io.IO matchTraceIO
|
1354
|
+
*/
|
1355
|
+
export function matchTraceIO_<R, E, A, R1, E1, A1, R2, E2, A2>(
|
1356
|
+
ma: IO<R, E, A>,
|
1357
|
+
onFailure: (e: E, trace: Trace) => IO<R1, E1, A1>,
|
1358
|
+
onSuccess: (a: A) => IO<R2, E2, A2>,
|
1359
|
+
__tsplusTrace?: string,
|
1360
|
+
): IO<R & R1 & R2, E1 | E2, A1 | A2> {
|
1361
|
+
return ma.matchCauseIO(
|
1362
|
+
(cause) => cause.failureTraceOrCause.match(([e, trace]) => onFailure(e, trace), IO.failCauseNow),
|
1363
|
+
onSuccess,
|
1364
|
+
);
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
/**
|
1368
|
+
* @tsplus getter fncts.io.IO maybe
|
1369
|
+
*/
|
1370
|
+
export function maybe<R, E, A>(io: IO<R, E, A>, __tsplusTrace?: string): URIO<R, Maybe<A>> {
|
1371
|
+
return io.match(() => Nothing(), Maybe.just);
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
/**
|
1375
|
+
* @tsplus getter fncts.io.IO merge
|
1376
|
+
*/
|
1377
|
+
export function merge<R, E, A>(io: IO<R, E, A>, __tsplusTrace?: string): IO<R, never, A | E> {
|
1378
|
+
return io.matchIO(IO.succeedNow, IO.succeedNow);
|
1379
|
+
}
|
1380
|
+
|
1381
|
+
/**
|
1382
|
+
* Merges an `Iterable<IO>` to a single IO, working sequentially.
|
1383
|
+
*
|
1384
|
+
* @tsplus static fncts.io.IOOps mergeAll
|
1385
|
+
*/
|
1386
|
+
export function mergeAll_<R, E, A, B>(
|
1387
|
+
fas: Iterable<IO<R, E, A>>,
|
1388
|
+
b: B,
|
1389
|
+
f: (b: B, a: A) => B,
|
1390
|
+
__tsplusTrace?: string,
|
1391
|
+
): IO<R, E, B> {
|
1392
|
+
return fas.foldLeft(IO.succeed(b) as IO<R, E, B>, (b, a) => b.zipWith(a, f));
|
1393
|
+
}
|
1394
|
+
|
1395
|
+
/**
|
1396
|
+
* Returns a `IO` that will never produce anything. The moral equivalent of
|
1397
|
+
* `while(true) {}`, only without the wasted CPU cycles.
|
1398
|
+
*
|
1399
|
+
* @tsplus static fncts.io.IOOps never
|
1400
|
+
*/
|
1401
|
+
export const never: UIO<never> = defer(() =>
|
1402
|
+
asyncInterrupt<unknown, never, never>(() => {
|
1403
|
+
const interval = setInterval(() => {
|
1404
|
+
//
|
1405
|
+
}, 60000);
|
1406
|
+
return Either.left(
|
1407
|
+
IO.succeed(() => {
|
1408
|
+
clearInterval(interval);
|
1409
|
+
}),
|
1410
|
+
);
|
1411
|
+
}),
|
1412
|
+
);
|
1413
|
+
|
1414
|
+
/**
|
1415
|
+
* Converts an option on errors into an option on values.
|
1416
|
+
*
|
1417
|
+
* @tsplus getter fncts.io.IO optional
|
1418
|
+
*/
|
1419
|
+
export function optional<R, E, A>(ma: IO<R, Maybe<E>, A>): IO<R, E, Maybe<A>> {
|
1420
|
+
return ma.matchIO(
|
1421
|
+
(me) => me.match(() => IO.succeedNow(Nothing()), IO.failNow),
|
1422
|
+
(a) => IO.succeedNow(Just(a)),
|
1423
|
+
);
|
1424
|
+
}
|
1425
|
+
|
1426
|
+
/**
|
1427
|
+
* Returns the logical disjunction of the `Boolean` value returned by this
|
1428
|
+
* effect and the `Boolean` value returned by the specified effect. This
|
1429
|
+
* operator has "short circuiting" behavior so if the value returned by this
|
1430
|
+
* effect is true the specified effect will not be evaluated.
|
1431
|
+
*
|
1432
|
+
* @tsplus fluent fncts.io.IO or
|
1433
|
+
*/
|
1434
|
+
export function or_<R, E, R1, E1>(
|
1435
|
+
ma: IO<R, E, boolean>,
|
1436
|
+
mb: IO<R1, E1, boolean>,
|
1437
|
+
__tsplusTrace?: string,
|
1438
|
+
): IO<R & R1, E | E1, boolean> {
|
1439
|
+
return ma.flatMap((b) => (b ? IO.succeedNow(true) : mb));
|
1440
|
+
}
|
1441
|
+
|
1442
|
+
/**
|
1443
|
+
* @tsplus fluent fncts.io.IO orElse
|
1444
|
+
*/
|
1445
|
+
export function orElse_<R, E, A, R1, E1, A1>(
|
1446
|
+
ma: IO<R, E, A>,
|
1447
|
+
that: Lazy<IO<R1, E1, A1>>,
|
1448
|
+
__tsplusTrace?: string,
|
1449
|
+
): IO<R & R1, E1, A | A1> {
|
1450
|
+
return tryOrElse_(ma, that, IO.succeedNow);
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
/**
|
1454
|
+
* @tsplus fluent fncts.io.IO orElseEither
|
1455
|
+
*/
|
1456
|
+
export function orElseEither_<R, E, A, R1, E1, A1>(
|
1457
|
+
self: IO<R, E, A>,
|
1458
|
+
that: Lazy<IO<R1, E1, A1>>,
|
1459
|
+
__tsplusTrace?: string,
|
1460
|
+
): IO<R & R1, E1, Either<A, A1>> {
|
1461
|
+
return self.tryOrElse(that().map(Either.right), (a) => IO.succeedNow(Either.left(a)));
|
1462
|
+
}
|
1463
|
+
|
1464
|
+
/**
|
1465
|
+
* @tsplus fluent fncts.io.IO orElseFail
|
1466
|
+
*/
|
1467
|
+
export function orElseFail_<R, E, A, E1>(ma: IO<R, E, A>, e: Lazy<E1>): IO<R, E1, A> {
|
1468
|
+
return ma.orElse(IO.fail(e));
|
1469
|
+
}
|
1470
|
+
|
1471
|
+
/**
|
1472
|
+
* @tsplus fluent fncts.io.IO orElseMaybe
|
1473
|
+
*/
|
1474
|
+
export function orElseMaybe_<R, E, A, R1, E1, A1>(
|
1475
|
+
ma: IO<R, Maybe<E>, A>,
|
1476
|
+
that: Lazy<IO<R1, Maybe<E1>, A1>>,
|
1477
|
+
__tsplusTrace?: string,
|
1478
|
+
): IO<R & R1, Maybe<E | E1>, A | A1> {
|
1479
|
+
return ma.catchAll((me) => me.match(that, (e) => IO.fail(Just(e))));
|
1480
|
+
}
|
1481
|
+
|
1482
|
+
/**
|
1483
|
+
* @tsplus fluent fncts.io.IO orElseSucceed
|
1484
|
+
*/
|
1485
|
+
export function orElseSucceed_<R, E, A, A1>(ma: IO<R, E, A>, a: Lazy<A1>, __tsplusTrace?: string): IO<R, E, A | A1> {
|
1486
|
+
return ma.orElse(IO.succeed(a));
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
/**
|
1490
|
+
* @tsplus getter fncts.io.IO orHalt
|
1491
|
+
*/
|
1492
|
+
export function orHalt<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, never, A> {
|
1493
|
+
return ma.orHaltWith(identity);
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
/**
|
1497
|
+
* @tsplus getter fncts.io.IO orHaltKeep
|
1498
|
+
*/
|
1499
|
+
export function orHaltKeep<R, E, A>(ma: IO<R, E, A>): IO<R, never, A> {
|
1500
|
+
return ma.matchCauseIO((cause) => IO.failCauseNow(cause.flatMap(Cause.halt)), IO.succeedNow);
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
/**
|
1504
|
+
* @tsplus fluent fncts.io.IO orHaltWith
|
1505
|
+
*/
|
1506
|
+
export function orHaltWith_<R, E, A>(ma: IO<R, E, A>, f: (e: E) => unknown, __tsplusTrace?: string): IO<R, never, A> {
|
1507
|
+
return matchIO_(ma, (e) => IO.haltNow(f(e)), IO.succeedNow);
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
/**
|
1511
|
+
* Exposes all parallel errors in a single call
|
1512
|
+
*
|
1513
|
+
* @tsplus fluent fncts.io.IO parallelErrors
|
1514
|
+
*/
|
1515
|
+
export function parallelErrors<R, E, A>(io: IO<R, E, A>): IO<R, List<E>, A> {
|
1516
|
+
return io.matchCauseIO((cause) => {
|
1517
|
+
const f = cause.failures;
|
1518
|
+
if (f.length === 0) {
|
1519
|
+
return IO.failCauseNow(cause as Cause<never>);
|
1520
|
+
} else {
|
1521
|
+
return IO.failNow(f);
|
1522
|
+
}
|
1523
|
+
}, IO.succeedNow);
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
/**
|
1527
|
+
* Feeds elements of type `A` to a function `f` that returns an IO.
|
1528
|
+
* Collects all successes and failures in a separated fashion.
|
1529
|
+
*
|
1530
|
+
* @tsplus static fncts.io.IOOps partition
|
1531
|
+
*/
|
1532
|
+
export function partition_<R, E, A, B>(
|
1533
|
+
as: Iterable<A>,
|
1534
|
+
f: (a: A) => IO<R, E, B>,
|
1535
|
+
__tsplusTrace?: string,
|
1536
|
+
): IO<R, never, readonly [Conc<E>, Conc<B>]> {
|
1537
|
+
return IO.foreach(as, (a) => f(a).either).map((c) => c.separate);
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
/**
|
1541
|
+
* Keeps some of the errors, and terminates the fiber with the rest
|
1542
|
+
*
|
1543
|
+
* @tsplus fluent fncts.io.IO refineOrHalt
|
1544
|
+
*/
|
1545
|
+
export function refineOrHalt_<R, E, A, E1>(
|
1546
|
+
fa: IO<R, E, A>,
|
1547
|
+
pf: (e: E) => Maybe<E1>,
|
1548
|
+
__tsplusTrace?: string,
|
1549
|
+
): IO<R, E1, A> {
|
1550
|
+
return fa.refineOrHaltWith(pf, identity);
|
1551
|
+
}
|
1552
|
+
|
1553
|
+
/**
|
1554
|
+
* Keeps some of the errors, and terminates the fiber with the rest, using
|
1555
|
+
* the specified function to convert the `E` into a `Throwable`.
|
1556
|
+
*
|
1557
|
+
* @tsplus fluent fncts.io.IO refineOrHaltWith
|
1558
|
+
*/
|
1559
|
+
export function refineOrHaltWith_<R, E, A, E1>(
|
1560
|
+
fa: IO<R, E, A>,
|
1561
|
+
pf: (e: E) => Maybe<E1>,
|
1562
|
+
f: (e: E) => unknown,
|
1563
|
+
): IO<R, E1, A> {
|
1564
|
+
return fa.catchAll((e) => pf(e).match(() => IO.haltNow(f(e)), IO.failNow));
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
/**
|
1568
|
+
* Fail with the returned value if the partial function `pf` matches, otherwise
|
1569
|
+
* continue with the held value.
|
1570
|
+
*
|
1571
|
+
* @tsplus fluent fncts.io.IO reject
|
1572
|
+
*/
|
1573
|
+
export function reject_<R, E, A, E1>(
|
1574
|
+
fa: IO<R, E, A>,
|
1575
|
+
pf: (a: A) => Maybe<E1>,
|
1576
|
+
__tsplusTrace?: string,
|
1577
|
+
): IO<R, E | E1, A> {
|
1578
|
+
return fa.rejectIO((a) => pf(a).map(IO.failNow));
|
1579
|
+
}
|
1580
|
+
|
1581
|
+
/**
|
1582
|
+
* Continue with the returned computation if the partial function `pf` matches,
|
1583
|
+
* translating the successful match into a failure, otherwise continue with
|
1584
|
+
* the held value.
|
1585
|
+
*
|
1586
|
+
* @tsplus fluent fncts.io.IO rejectIO
|
1587
|
+
*/
|
1588
|
+
export function rejectIO_<R, E, A, R1, E1>(
|
1589
|
+
fa: IO<R, E, A>,
|
1590
|
+
pf: (a: A) => Maybe<IO<R1, E1, E1>>,
|
1591
|
+
__tsplusTrace?: string,
|
1592
|
+
): IO<R & R1, E | E1, A> {
|
1593
|
+
return fa.flatMap((a) =>
|
1594
|
+
pf(a).match(
|
1595
|
+
() => IO.succeedNow(a),
|
1596
|
+
(io) => io.flatMap(IO.failNow),
|
1597
|
+
),
|
1598
|
+
);
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
/**
|
1602
|
+
* Repeats this effect the specified number of times.
|
1603
|
+
*
|
1604
|
+
* @tsplus fluent fncts.io.IO repeatN
|
1605
|
+
*/
|
1606
|
+
export function repeatN_<R, E, A>(ma: IO<R, E, A>, n: number, __tsplusTrace?: string): IO<R, E, A> {
|
1607
|
+
return ma.flatMap((a) => (n <= 0 ? IO.succeed(a) : ma.repeatN(n - 1)));
|
1608
|
+
}
|
1609
|
+
|
1610
|
+
/**
|
1611
|
+
* Repeats this effect until its result satisfies the specified predicate.
|
1612
|
+
*
|
1613
|
+
* @tsplus fluent fncts.io.IO repeatUntil
|
1614
|
+
*/
|
1615
|
+
export function repeatUntil_<R, E, A>(ma: IO<R, E, A>, f: (a: A) => boolean, __tsplusTrace?: string): IO<R, E, A> {
|
1616
|
+
return ma.repeatUntilIO((a) => IO.succeedNow(f(a)));
|
1617
|
+
}
|
1618
|
+
|
1619
|
+
/**
|
1620
|
+
* Repeats this effect until its error satisfies the specified effectful predicate.
|
1621
|
+
*
|
1622
|
+
* @tsplus fluent fncts.io.IO repeatUntilIO
|
1623
|
+
*/
|
1624
|
+
export function repeatUntilIO_<R, E, A, R1, E1>(
|
1625
|
+
ma: IO<R, E, A>,
|
1626
|
+
f: (a: A) => IO<R1, E1, boolean>,
|
1627
|
+
__tsplusTrace?: string,
|
1628
|
+
): IO<R & R1, E | E1, A> {
|
1629
|
+
return ma.flatMap((a) => f(a).flatMap((b) => (b ? IO.succeed(a) : ma.repeatUntilIO(f))));
|
1630
|
+
}
|
1631
|
+
|
1632
|
+
/**
|
1633
|
+
* Repeats this effect while its error satisfies the specified predicate.
|
1634
|
+
*
|
1635
|
+
* @tsplus fluent fncts.io.IO repeatWhile
|
1636
|
+
*/
|
1637
|
+
export function repeatWhile_<R, E, A>(ma: IO<R, E, A>, f: (a: A) => boolean): IO<R, E, A> {
|
1638
|
+
return ma.repeatWhileIO((a) => IO.succeedNow(f(a)));
|
1639
|
+
}
|
1640
|
+
|
1641
|
+
/**
|
1642
|
+
* Repeats this effect while its error satisfies the specified effectful predicate.
|
1643
|
+
*
|
1644
|
+
* @tsplus fluent fncts.io.IO repeatWhileIO
|
1645
|
+
*/
|
1646
|
+
export function repeatWhileIO_<R, E, A, R1, E1>(
|
1647
|
+
ma: IO<R, E, A>,
|
1648
|
+
f: (a: A) => IO<R1, E1, boolean>,
|
1649
|
+
__tsplusTrace?: string,
|
1650
|
+
): IO<R & R1, E | E1, A> {
|
1651
|
+
return ma.flatMap((a) => f(a).flatMap((b) => (b ? ma.repeatWhileIO(f) : IO.succeed(a))));
|
1652
|
+
}
|
1653
|
+
|
1654
|
+
/**
|
1655
|
+
* @tsplus fluent fncts.io.IO replicate
|
1656
|
+
*/
|
1657
|
+
export function replicate_<R, E, A>(self: IO<R, E, A>, n: number, __tsplusTrace?: string): ImmutableArray<IO<R, E, A>> {
|
1658
|
+
return ImmutableArray.range(0, n).map(() => self);
|
1659
|
+
}
|
1660
|
+
|
1661
|
+
/**
|
1662
|
+
* @tsplus fluent fncts.io.IO require
|
1663
|
+
*/
|
1664
|
+
export function require_<R, E, A>(ma: IO<R, E, Maybe<A>>, error: Lazy<E>, __tsplusTrace?: string): IO<R, E, A> {
|
1665
|
+
return ma.flatMap((ma) => ma.match(() => IO.fail(error), IO.succeedNow));
|
1666
|
+
}
|
1667
|
+
|
1668
|
+
/**
|
1669
|
+
* Returns an IO that semantically runs the IO on a fiber,
|
1670
|
+
* producing an `Exit` for the completion value of the fiber.
|
1671
|
+
*
|
1672
|
+
* @tsplus getter fncts.io.IO result
|
1673
|
+
*/
|
1674
|
+
export function result<R, E, A>(ma: IO<R, E, A>, __tsplusTrace?: string): IO<R, never, Exit<E, A>> {
|
1675
|
+
return ma.matchCauseIO(
|
1676
|
+
(cause) => IO.succeedNow(Exit.failCause(cause)),
|
1677
|
+
(a) => IO.succeedNow(Exit.succeed(a)),
|
1678
|
+
);
|
1679
|
+
}
|
1680
|
+
|
1681
|
+
/**
|
1682
|
+
* Recover from the unchecked failure of the `IO`. (opposite of `orHalt`)
|
1683
|
+
*
|
1684
|
+
* @trace call
|
1685
|
+
*/
|
1686
|
+
export function resurrect<R, E, A>(io: IO<R, E, A>): IO<R, unknown, A> {
|
1687
|
+
return io.unrefineWith(Maybe.just, identity);
|
1688
|
+
}
|
1689
|
+
|
1690
|
+
/**
|
1691
|
+
* Retries this effect until its error satisfies the specified predicate.
|
1692
|
+
*
|
1693
|
+
* @tsplus fluent fncts.io.IO retryUntil
|
1694
|
+
*/
|
1695
|
+
export function retryUntil_<R, E, A>(fa: IO<R, E, A>, f: (e: E) => boolean, __tsplusTrace?: string): IO<R, E, A> {
|
1696
|
+
return fa.retryUntilIO((e) => IO.succeedNow(f(e)));
|
1697
|
+
}
|
1698
|
+
|
1699
|
+
/**
|
1700
|
+
* Retries this effect until its error satisfies the specified effectful predicate.
|
1701
|
+
*
|
1702
|
+
* @tsplus fluent fncts.io.IO retryUntilIO
|
1703
|
+
*/
|
1704
|
+
export function retryUntilIO_<R, E, A, R1, E1>(
|
1705
|
+
fa: IO<R, E, A>,
|
1706
|
+
f: (e: E) => IO<R1, E1, boolean>,
|
1707
|
+
__tsplusTrace?: string,
|
1708
|
+
): IO<R & R1, E | E1, A> {
|
1709
|
+
return fa.catchAll((e) => f(e).flatMap((b) => (b ? IO.failNow(e) : fa.retryUntilIO(f))));
|
1710
|
+
}
|
1711
|
+
|
1712
|
+
/**
|
1713
|
+
* Retries this effect while its error satisfies the specified predicate.
|
1714
|
+
*
|
1715
|
+
* @tsplus fluent fncts.io.IO retryWhile
|
1716
|
+
*/
|
1717
|
+
export function retryWhile_<R, E, A>(fa: IO<R, E, A>, f: (e: E) => boolean, __tsplusTrace?: string): IO<R, E, A> {
|
1718
|
+
return fa.retryWhileIO((e) => IO.succeedNow(f(e)));
|
1719
|
+
}
|
1720
|
+
|
1721
|
+
/**
|
1722
|
+
* Retries this effect while its error satisfies the specified effectful predicate.
|
1723
|
+
*
|
1724
|
+
* @tsplus fluent fncts.io.IO retryWhileIO
|
1725
|
+
*/
|
1726
|
+
export function retryWhileIO_<R, E, A, R1, E1>(
|
1727
|
+
fa: IO<R, E, A>,
|
1728
|
+
f: (e: E) => IO<R1, E1, boolean>,
|
1729
|
+
__tsplusTrace?: string,
|
1730
|
+
): IO<R & R1, E | E1, A> {
|
1731
|
+
return fa.catchAll((e) => f(e).flatMap((b) => (b ? fa.retryWhileIO(f) : IO.fail(e))));
|
1732
|
+
}
|
1733
|
+
|
1734
|
+
/**
|
1735
|
+
* Retrieves the runtimeConfig that this effect is running on.
|
1736
|
+
*
|
1737
|
+
* @tsplus static fncts.io.IOOps runtimeConfig
|
1738
|
+
*/
|
1739
|
+
export const runtimeConfig: UIO<RuntimeConfig> = IO.deferWith((runtimeConfig) => IO.succeedNow(runtimeConfig));
|
1740
|
+
|
1741
|
+
/**
|
1742
|
+
* Exposes the full cause of failure of this effect.
|
1743
|
+
*
|
1744
|
+
* @tsplus getter fncts.io.IO sandbox
|
1745
|
+
*/
|
1746
|
+
export function sandbox<R, E, A>(fa: IO<R, E, A>, __tsplusTrace?: string): IO<R, Cause<E>, A> {
|
1747
|
+
return fa.matchCauseIO(IO.failNow, IO.succeedNow);
|
1748
|
+
}
|
1749
|
+
|
1750
|
+
/**
|
1751
|
+
* @tsplus fluent fncts.io.IO sandboxWith
|
1752
|
+
*/
|
1753
|
+
export function sandboxWith_<R, E, A, E1>(
|
1754
|
+
ma: IO<R, E, A>,
|
1755
|
+
f: (_: IO<R, Cause<E>, A>) => IO<R, Cause<E1>, A>,
|
1756
|
+
__tsplusTrace?: string,
|
1757
|
+
): IO<R, E1, A> {
|
1758
|
+
return f(ma.sandbox).unsandbox;
|
1759
|
+
}
|
1760
|
+
|
1761
|
+
/**
|
1762
|
+
* Sets the runtime configuration to the specified value.
|
1763
|
+
* @tsplus static fncts.io.IOOps setRuntimeConfig
|
1764
|
+
*/
|
1765
|
+
export function setRuntimeConfig(runtimeConfig: Lazy<RuntimeConfig>, __tsplusTrace?: string): UIO<void> {
|
1766
|
+
return IO.defer(new SetRuntimeConfig(runtimeConfig(), __tsplusTrace));
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
/**
|
1770
|
+
* @tsplus static fncts.io.IOOps sequenceIterable
|
1771
|
+
*/
|
1772
|
+
export function sequenceIterable<R, E, A>(as: Iterable<IO<R, E, A>>): IO<R, E, Conc<A>> {
|
1773
|
+
return IO.foreach(as, identity);
|
1774
|
+
}
|
1775
|
+
|
1776
|
+
/**
|
1777
|
+
* @tsplus static fncts.io.IOOps sequenceIterableDiscard
|
1778
|
+
*/
|
1779
|
+
export function sequenceIterableDiscard<R, E, A>(as: Iterable<IO<R, E, A>>, __tsplusTrace?: string): IO<R, E, void> {
|
1780
|
+
return IO.foreachDiscard(as, identity);
|
1781
|
+
}
|
1782
|
+
|
1783
|
+
/**
|
1784
|
+
* Creates a `IO` that has succeeded with a pure value
|
1785
|
+
*
|
1786
|
+
* @tsplus static fncts.io.IOOps succeedNow
|
1787
|
+
*/
|
1788
|
+
export function succeedNow<A>(value: A, __tsplusTrace?: string): IO<unknown, never, A> {
|
1789
|
+
return new SucceedNow(value, __tsplusTrace);
|
1790
|
+
}
|
1791
|
+
|
1792
|
+
/**
|
1793
|
+
* Imports a total synchronous effect into a pure `IO` value.
|
1794
|
+
* The effect must not throw any exceptions. If you wonder if the effect
|
1795
|
+
* throws exceptions, then do not use this method, use `IO.try`
|
1796
|
+
*
|
1797
|
+
* @tsplus static fncts.io.IOOps succeed
|
1798
|
+
* @tsplus static fncts.io.IOOps __call
|
1799
|
+
*/
|
1800
|
+
export function succeed<A>(effect: Lazy<A>, __tsplusTrace?: string): UIO<A> {
|
1801
|
+
return new Succeed(effect, __tsplusTrace);
|
1802
|
+
}
|
1803
|
+
|
1804
|
+
/**
|
1805
|
+
*
|
1806
|
+
* Returns an IO with the behavior of this one, but where all child
|
1807
|
+
* fibers forked in the effect are reported to the specified supervisor.
|
1808
|
+
*
|
1809
|
+
* @tsplus fluent fncts.io.IO supervised
|
1810
|
+
*/
|
1811
|
+
export function supervised_<R, E, A>(
|
1812
|
+
fa: IO<R, E, A>,
|
1813
|
+
supervisor: Supervisor<any>,
|
1814
|
+
__tsplusTrace?: string,
|
1815
|
+
): IO<R, E, A> {
|
1816
|
+
return new Supervise(fa, supervisor);
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
/**
|
1820
|
+
* @tsplus fluent fncts.io.IO summarized
|
1821
|
+
*/
|
1822
|
+
export function summarized_<R, E, A, R1, E1, B, C>(
|
1823
|
+
ma: IO<R, E, A>,
|
1824
|
+
summary: IO<R1, E1, B>,
|
1825
|
+
f: (start: B, end: B) => C,
|
1826
|
+
__tsplusTrace?: string,
|
1827
|
+
): IO<R & R1, E | E1, readonly [C, A]> {
|
1828
|
+
return gen(function* (_) {
|
1829
|
+
const start = yield* _(summary);
|
1830
|
+
const value = yield* _(ma);
|
1831
|
+
const end = yield* _(summary);
|
1832
|
+
return tuple(f(start, end), value);
|
1833
|
+
});
|
1834
|
+
}
|
1835
|
+
|
1836
|
+
/**
|
1837
|
+
* Swaps the positions of a Bifunctor's arguments
|
1838
|
+
*
|
1839
|
+
* @tsplus getter fncts.io.IO swap
|
1840
|
+
*/
|
1841
|
+
export function swap<R, E, A>(pab: IO<R, E, A>): IO<R, A, E> {
|
1842
|
+
return pab.matchIO(IO.succeedNow, IO.failNow);
|
1843
|
+
}
|
1844
|
+
|
1845
|
+
/**
|
1846
|
+
* Swaps the error/value parameters, applies the function `f` and flips the parameters back
|
1847
|
+
*
|
1848
|
+
* @tsplus fluent fncts.io.IO swapWith
|
1849
|
+
*/
|
1850
|
+
export function swapWith_<R, E, A, R1, E1, A1>(fa: IO<R, E, A>, f: (ma: IO<R, A, E>) => IO<R1, A1, E1>) {
|
1851
|
+
return f(fa.swap).swap;
|
1852
|
+
}
|
1853
|
+
|
1854
|
+
/**
|
1855
|
+
* A more powerful variation of `timed` that allows specifying the clock.
|
1856
|
+
*
|
1857
|
+
* @tsplus fluent fncts.io.IO timedWith
|
1858
|
+
*/
|
1859
|
+
export function timedWith_<R, E, A, R1, E1>(ma: IO<R, E, A>, msTime: IO<R1, E1, number>, __tsplusTrace?: string) {
|
1860
|
+
return ma.summarized(msTime, (start, end) => end - start);
|
1861
|
+
}
|
1862
|
+
|
1863
|
+
/**
|
1864
|
+
* Creates a `IO` that has succeeded with a pure value
|
1865
|
+
*
|
1866
|
+
* @tsplus static fncts.io.IOOps tryCatch
|
1867
|
+
*/
|
1868
|
+
export function tryCatch<E, A>(effect: Lazy<A>, onThrow: (error: unknown) => E, __tsplusTrace?: string): FIO<E, A> {
|
1869
|
+
return IO.succeed(() => {
|
1870
|
+
try {
|
1871
|
+
return effect();
|
1872
|
+
} catch (u) {
|
1873
|
+
throw new IOError(Exit.fail(onThrow(u)));
|
1874
|
+
}
|
1875
|
+
});
|
1876
|
+
}
|
1877
|
+
|
1878
|
+
/**
|
1879
|
+
* Returns an `IO` that submerges an `Either` into the `IO`.
|
1880
|
+
*
|
1881
|
+
* @tsplus getter fncts.io.IO absolve
|
1882
|
+
*/
|
1883
|
+
export function absolve<R, E, E1, A>(ma: IO<R, E, Either<E1, A>>, __tsplusTrace?: string): IO<R, E | E1, A> {
|
1884
|
+
return ma.flatMap((ea) => ea.match(IO.failNow, IO.succeedNow));
|
1885
|
+
}
|
1886
|
+
|
1887
|
+
/**
|
1888
|
+
* Composes computations in sequence, using the return value of one computation as input for the next
|
1889
|
+
* and keeping only the result of the first
|
1890
|
+
*
|
1891
|
+
* Returns an IO that effectfully "peeks" at the success of this effect.
|
1892
|
+
*
|
1893
|
+
* @tsplus fluent fncts.io.IO tap
|
1894
|
+
*/
|
1895
|
+
export function tap_<R, E, A, R1, E1, B>(
|
1896
|
+
self: IO<R, E, A>,
|
1897
|
+
f: (a: A) => IO<R1, E1, B>,
|
1898
|
+
__tsplusTrace?: string,
|
1899
|
+
): IO<R1 & R, E1 | E, A> {
|
1900
|
+
return self.flatMap((a) => f(a).map(() => a));
|
1901
|
+
}
|
1902
|
+
|
1903
|
+
/**
|
1904
|
+
* Returns an IO that effectually "peeks" at the cause of the failure of
|
1905
|
+
* this IO.
|
1906
|
+
*
|
1907
|
+
* @tsplus fluent fncts.io.IO tapCause
|
1908
|
+
*/
|
1909
|
+
export function tapCause_<R2, A2, R, E, E2>(
|
1910
|
+
ma: IO<R2, E2, A2>,
|
1911
|
+
f: (e: Cause<E2>) => IO<R, E, any>,
|
1912
|
+
__tsplusTrace?: string,
|
1913
|
+
): IO<R2 & R, E | E2, A2> {
|
1914
|
+
return ma.matchCauseIO((c) => f(c).flatMap(() => IO.failCauseNow(c)), IO.succeedNow);
|
1915
|
+
}
|
1916
|
+
|
1917
|
+
/**
|
1918
|
+
* Returns an IO that effectfully "peeks" at the failure of this effect.
|
1919
|
+
*
|
1920
|
+
* @tsplus fluent fncts.io.IO tapError
|
1921
|
+
*/
|
1922
|
+
export function tapError_<R, E, A, R1, E1>(self: IO<R, E, A>, f: (e: E) => IO<R1, E1, any>, __tsplusTrace?: string) {
|
1923
|
+
return self.matchCauseIO(
|
1924
|
+
(cause) =>
|
1925
|
+
cause.failureOrCause.match(
|
1926
|
+
(e) => f(e).flatMap(() => IO.failCauseNow(cause)),
|
1927
|
+
(_) => IO.failCauseNow(cause),
|
1928
|
+
),
|
1929
|
+
IO.succeedNow,
|
1930
|
+
);
|
1931
|
+
}
|
1932
|
+
|
1933
|
+
/**
|
1934
|
+
* Returns an effect that effectually "peeks" at the cause of the failure of
|
1935
|
+
* this effect.
|
1936
|
+
*
|
1937
|
+
* @tsplus fluent fncts.io.IO tapErrorCause
|
1938
|
+
*/
|
1939
|
+
export function tapErrorCause_<R, E, A, R1, E1>(
|
1940
|
+
self: IO<R, E, A>,
|
1941
|
+
f: (e: Cause<E>) => IO<R1, E1, any>,
|
1942
|
+
__tsplusTrace?: string,
|
1943
|
+
): IO<R & R1, E | E1, A> {
|
1944
|
+
return self.matchCauseIO((cause) => f(cause).apSecond(IO.failCauseNow(cause)), IO.succeedNow);
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
/**
|
1948
|
+
* @tsplus fluent fncts.io.IO tryOrElse
|
1949
|
+
*/
|
1950
|
+
export function tryOrElse_<R, E, A, R1, E1, A1, R2, E2, A2>(
|
1951
|
+
ma: IO<R, E, A>,
|
1952
|
+
that: Lazy<IO<R1, E1, A1>>,
|
1953
|
+
onSuccess: (a: A) => IO<R2, E2, A2>,
|
1954
|
+
__tsplusTrace?: string,
|
1955
|
+
): IO<R & R1 & R2, E1 | E2, A1 | A2> {
|
1956
|
+
return ma.matchCauseIO((cause) => cause.keepDefects.match(that, IO.failCauseNow), onSuccess);
|
1957
|
+
}
|
1958
|
+
|
1959
|
+
/**
|
1960
|
+
* @tsplus static fncts.io.IOOps unit
|
1961
|
+
*/
|
1962
|
+
export const unit: UIO<void> = IO.succeedNow(undefined);
|
1963
|
+
|
1964
|
+
/**
|
1965
|
+
* Converts an option on errors into an option on values.
|
1966
|
+
*
|
1967
|
+
* @tsplus getter fncts.io.IO unjust
|
1968
|
+
*/
|
1969
|
+
export function unjust<R, E, A>(self: IO<R, Maybe<E>, A>): IO<R, E, Maybe<A>> {
|
1970
|
+
return self.matchIO(
|
1971
|
+
(e) => e.match(() => IO.succeedNow(Nothing()), IO.failNow),
|
1972
|
+
(a) => IO.succeedNow(Just(a)),
|
1973
|
+
);
|
1974
|
+
}
|
1975
|
+
|
1976
|
+
/**
|
1977
|
+
* Takes some fiber failures and converts them into errors, using the
|
1978
|
+
* specified function to convert the `E` into an `E1 | E2`.
|
1979
|
+
*
|
1980
|
+
* @tsplus fluent fncts.io.IO unrefineWith
|
1981
|
+
*/
|
1982
|
+
export function unrefineWith_<R, E, A, E1, E2>(
|
1983
|
+
fa: IO<R, E, A>,
|
1984
|
+
pf: (u: unknown) => Maybe<E1>,
|
1985
|
+
f: (e: E) => E2,
|
1986
|
+
__tsplusTrace?: string,
|
1987
|
+
): IO<R, E1 | E2, A> {
|
1988
|
+
return fa.catchAllCause((cause) =>
|
1989
|
+
cause.find((c) => (c.isHalt() ? pf(c.value) : Nothing())).match(() => IO.failCauseNow(cause.map(f)), IO.failNow),
|
1990
|
+
);
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
/**
|
1994
|
+
* The inverse operation `sandbox`
|
1995
|
+
*
|
1996
|
+
* @tsplus getter fncts.io.IO unsandbox
|
1997
|
+
*/
|
1998
|
+
export function unsandbox<R, E, A>(ma: IO<R, Cause<E>, A>): IO<R, E, A> {
|
1999
|
+
return ma.mapErrorCause((cause) => cause.flatten);
|
2000
|
+
}
|
2001
|
+
|
2002
|
+
/**
|
2003
|
+
* Updates the `FiberRef` values for the fiber running this effect using the
|
2004
|
+
* specified function
|
2005
|
+
*
|
2006
|
+
* @tsplus static fncts.io.IOOps updateFiberRefs
|
2007
|
+
*/
|
2008
|
+
export function updateFiberRefs(
|
2009
|
+
f: (fiberId: FiberId.Runtime, fiberRefs: FiberRefs) => FiberRefs,
|
2010
|
+
__tsplusTrace?: string,
|
2011
|
+
): UIO<void> {
|
2012
|
+
return new FiberRefModifyAll((fiberId, fiberRefs) => [undefined, f(fiberId, fiberRefs)], __tsplusTrace);
|
2013
|
+
}
|
2014
|
+
|
2015
|
+
/**
|
2016
|
+
* @tsplus fluent fncts.io.IO __call
|
2017
|
+
*/
|
2018
|
+
export const via: typeof pipe = pipe;
|
2019
|
+
|
2020
|
+
/**
|
2021
|
+
* @tsplus fluent fncts.io.IO when
|
2022
|
+
*/
|
2023
|
+
export function when_<R, E, A>(ma: IO<R, E, A>, b: Lazy<boolean>, __tsplusTrace?: string): IO<R, E, void> {
|
2024
|
+
return ma.whenIO(IO.succeed(b));
|
2025
|
+
}
|
2026
|
+
|
2027
|
+
/**
|
2028
|
+
* The moral equivalent of `if (p) exp` when `p` has side-effects
|
2029
|
+
*
|
2030
|
+
* @tsplus fluent fncts.io.IO whenIO
|
2031
|
+
*/
|
2032
|
+
export function whenIO_<R, E, A, R1, E1>(ma: IO<R, E, A>, mb: IO<R1, E1, boolean>): IO<R1 & R, E | E1, void> {
|
2033
|
+
return mb.flatMap((b) => (b ? ma.asUnit : IO.unit));
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
/**
|
2037
|
+
* Returns an effect that yields to the runtime system, starting on a fresh
|
2038
|
+
* stack. Manual use of this method can improve fairness, at the cost of
|
2039
|
+
* overhead.
|
2040
|
+
*
|
2041
|
+
* @tsplus static fncts.io.IOOps yieldNow
|
2042
|
+
*/
|
2043
|
+
export const yieldNow: UIO<void> = new Yield();
|
2044
|
+
|
2045
|
+
/**
|
2046
|
+
* @tsplus fluent fncts.io.IO zip
|
2047
|
+
*/
|
2048
|
+
export function zip_<R, E, A, R1, E1, B>(self: IO<R, E, A>, that: IO<R1, E1, B>): IO<R & R1, E | E1, readonly [A, B]> {
|
2049
|
+
return self.zipWith(that, tuple);
|
2050
|
+
}
|
2051
|
+
|
2052
|
+
/**
|
2053
|
+
* @tsplus fluent fncts.io.IO zipWith
|
2054
|
+
*/
|
2055
|
+
export function zipWith_<R, E, A, R1, E1, B, C>(
|
2056
|
+
self: IO<R, E, A>,
|
2057
|
+
that: IO<R1, E1, B>,
|
2058
|
+
f: (a: A, b: B) => C,
|
2059
|
+
): IO<R & R1, E | E1, C> {
|
2060
|
+
return self.flatMap((a) => that.map((b) => f(a, b)));
|
2061
|
+
}
|
2062
|
+
|
2063
|
+
export class GenIO<R, E, A> {
|
2064
|
+
readonly _R!: (_R: R) => void;
|
2065
|
+
readonly _E!: () => E;
|
2066
|
+
readonly _A!: () => A;
|
2067
|
+
|
2068
|
+
constructor(readonly effect: IO<R, E, A>, readonly _trace?: string) {}
|
2069
|
+
|
2070
|
+
*[Symbol.iterator](): Generator<GenIO<R, E, A>, A, any> {
|
2071
|
+
return yield this;
|
2072
|
+
}
|
2073
|
+
}
|
2074
|
+
|
2075
|
+
/**
|
2076
|
+
* @internal
|
2077
|
+
*/
|
2078
|
+
export const __adapter = (_: any) => {
|
2079
|
+
// if (Either.isEither(_)) {
|
2080
|
+
// return IO.fromEither(_);
|
2081
|
+
// }
|
2082
|
+
// if (Maybe.isMaybe(_)) {
|
2083
|
+
// return __
|
2084
|
+
// ? _._tag === "Nothing"
|
2085
|
+
// ? IO.failNow(__())
|
2086
|
+
// : IO.succeed(_.value)
|
2087
|
+
// : getOrFail(_);
|
2088
|
+
// }
|
2089
|
+
// if (isTag(_)) {
|
2090
|
+
// return service(_);
|
2091
|
+
// }
|
2092
|
+
// if (S.isSync(_)) {
|
2093
|
+
// return fromSync(_);
|
2094
|
+
// }
|
2095
|
+
return _;
|
2096
|
+
};
|
2097
|
+
|
2098
|
+
const adapter = (_: any, __tsplusTrace?: string) => {
|
2099
|
+
return new GenIO(__adapter(_), __tsplusTrace);
|
2100
|
+
};
|
2101
|
+
|
2102
|
+
/**
|
2103
|
+
* @tsplus static fncts.io.IOOps gen
|
2104
|
+
* @gen
|
2105
|
+
*/
|
2106
|
+
export function gen<T extends GenIO<any, any, any>, A>(
|
2107
|
+
f: (i: { <R, E, A>(_: IO<R, E, A>, __tsplusTrace?: string): GenIO<R, E, A> }) => Generator<T, A, any>,
|
2108
|
+
): IO<_R<T>, _E<T>, A> {
|
2109
|
+
return IO.defer(() => {
|
2110
|
+
const iterator = f(adapter as any);
|
2111
|
+
const state = iterator.next();
|
2112
|
+
|
2113
|
+
const run = (state: IteratorYieldResult<T> | IteratorReturnResult<A>): IO<any, any, A> => {
|
2114
|
+
if (state.done) {
|
2115
|
+
return IO.succeed(state.value);
|
2116
|
+
}
|
2117
|
+
const f = (val: any) => {
|
2118
|
+
const next = iterator.next(val);
|
2119
|
+
return run(next);
|
2120
|
+
};
|
2121
|
+
return state.value.effect.flatMap(f);
|
2122
|
+
};
|
2123
|
+
|
2124
|
+
return run(state);
|
2125
|
+
});
|
2126
|
+
}
|