@fncts/io 0.0.47 → 0.0.49
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 +1 -1
- package/Channel/api.d.ts +80 -80
- package/Channel/core-api.d.ts +26 -26
- package/Console/definition.d.ts +1 -0
- package/CountdownLatch.d.ts +1 -0
- package/Fiber/FiberMessage.d.ts +6 -28
- package/Fiber/FiberRuntime.d.ts +108 -77
- package/Fiber/api/interruptAs.d.ts +2 -2
- package/Fiber/definition.d.ts +2 -0
- package/FiberScope/definition.d.ts +3 -0
- package/FiberSet.d.ts +2 -1
- package/Future/State.d.ts +59 -0
- package/Future/api.d.ts +8 -3
- package/Future/constructors.d.ts +1 -1
- package/Future/definition.d.ts +1 -17
- package/Future.d.ts +1 -0
- package/Hub/api.d.ts +15 -15
- package/IO/api/array.d.ts +22 -0
- package/IO/api/awaitAllChildren.d.ts +6 -0
- package/IO/api/cachedInvalidate.d.ts +15 -0
- package/IO/api/forkDaemon.d.ts +1 -1
- package/IO/api/onTermination.d.ts +1 -2
- package/IO/api/transplant.d.ts +11 -1
- package/IO/api.d.ts +247 -225
- package/IO/definition.d.ts +12 -25
- package/IO.d.ts +3 -1
- package/Random/definition.d.ts +1 -0
- package/Ref/Synchronized/api.d.ts +1 -1
- package/Semaphore/Reservation.d.ts +15 -0
- package/Semaphore/constructors.d.ts +13 -0
- package/Semaphore/definition.d.ts +29 -0
- package/Semaphore.d.ts +3 -40
- package/Stream/api.d.ts +164 -164
- package/_cjs/Cached/api.cjs +1 -2
- package/_cjs/Cached/api.cjs.map +1 -1
- package/_cjs/Cached/internal.cjs +1 -2
- package/_cjs/Cached/internal.cjs.map +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs +1 -2
- package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs +2 -3
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAll.cjs +1 -2
- package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +1 -2
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +2 -3
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeMap.cjs +1 -2
- package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +1 -2
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api/run.cjs +1 -2
- package/_cjs/Channel/api/run.cjs.map +1 -1
- package/_cjs/Channel/api/runCollect.cjs +1 -2
- package/_cjs/Channel/api/runCollect.cjs.map +1 -1
- package/_cjs/Channel/api/runDrain.cjs +1 -2
- package/_cjs/Channel/api/runDrain.cjs.map +1 -1
- package/_cjs/Channel/api/runScoped.cjs +3 -4
- package/_cjs/Channel/api/runScoped.cjs.map +1 -1
- package/_cjs/Channel/api/toPull.cjs +2 -3
- package/_cjs/Channel/api/toPull.cjs.map +1 -1
- package/_cjs/Channel/api/zipConcurrent.cjs +1 -2
- package/_cjs/Channel/api/zipConcurrent.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +206 -207
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/core-api.cjs +43 -42
- package/_cjs/Channel/core-api.cjs.map +1 -1
- package/_cjs/Channel/internal/AsyncInputConsumer.cjs +0 -4
- package/_cjs/Channel/internal/AsyncInputProducer.cjs +0 -4
- package/_cjs/Channel/internal/ChannelExecutor.cjs +4 -5
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelState.cjs +1 -2
- package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +1 -2
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/Clock/api.cjs +1 -2
- package/_cjs/Clock/api.cjs.map +1 -1
- package/_cjs/Clock/definition.cjs +1 -2
- package/_cjs/Clock/definition.cjs.map +1 -1
- package/_cjs/Clock/live.cjs +1 -2
- package/_cjs/Clock/live.cjs.map +1 -1
- package/_cjs/Console/api.cjs +1 -2
- package/_cjs/Console/api.cjs.map +1 -1
- package/_cjs/Console/definition.cjs +2 -2
- package/_cjs/Console/definition.cjs.map +1 -1
- package/_cjs/Console/live.cjs +1 -2
- package/_cjs/Console/live.cjs.map +1 -1
- package/_cjs/CountdownLatch.cjs +3 -3
- package/_cjs/CountdownLatch.cjs.map +1 -1
- package/_cjs/Differ/api.cjs +1 -2
- package/_cjs/Differ/api.cjs.map +1 -1
- package/_cjs/Fiber/FiberMessage.cjs +3 -24
- package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
- package/_cjs/Fiber/FiberRuntime.cjs +879 -636
- package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
- package/_cjs/Fiber/api/awaitAll.cjs +1 -2
- package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
- package/_cjs/Fiber/api/collectAll.cjs +2 -3
- package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
- package/_cjs/Fiber/api/fromIO.cjs +1 -2
- package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
- package/_cjs/Fiber/api/interrupt.cjs +2 -3
- package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAll.cjs +2 -3
- package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAs.cjs +5 -10
- package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptFork.cjs +2 -3
- package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
- package/_cjs/Fiber/api/join.cjs +1 -2
- package/_cjs/Fiber/api/join.cjs.map +1 -1
- package/_cjs/Fiber/api/joinAll.cjs +1 -2
- package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
- package/_cjs/Fiber/api/mapFiber.cjs +1 -2
- package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
- package/_cjs/Fiber/api/mapIO.cjs +2 -3
- package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
- package/_cjs/Fiber/api/zipWith.cjs +2 -3
- package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
- package/_cjs/Fiber/constructors.cjs +2 -3
- package/_cjs/Fiber/constructors.cjs.map +1 -1
- package/_cjs/Fiber/definition.cjs +6 -4
- package/_cjs/Fiber/definition.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScoped.cjs +1 -2
- package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScopedWith.cjs +1 -2
- package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
- package/_cjs/FiberRef/constructors.cjs +1 -2
- package/_cjs/FiberRef/constructors.cjs.map +1 -1
- package/_cjs/FiberRef/definition.cjs +1 -2
- package/_cjs/FiberRef/definition.cjs.map +1 -1
- package/_cjs/FiberRef/operations.cjs +1 -2
- package/_cjs/FiberRef/operations.cjs.map +1 -1
- package/_cjs/FiberRef/unsafe.cjs +1 -2
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/FiberRefs/Patch.cjs +1 -2
- package/_cjs/FiberRefs/Patch.cjs.map +1 -1
- package/_cjs/FiberRefs/api.cjs +1 -2
- package/_cjs/FiberRefs/api.cjs.map +1 -1
- package/_cjs/FiberRefs/definition.cjs +1 -2
- package/_cjs/FiberRefs/definition.cjs.map +1 -1
- package/_cjs/FiberScope/definition.cjs +29 -6
- package/_cjs/FiberScope/definition.cjs.map +1 -1
- package/_cjs/FiberSet.cjs +16 -15
- package/_cjs/FiberSet.cjs.map +1 -1
- package/_cjs/FiberStatus/definition.cjs +1 -2
- package/_cjs/FiberStatus/definition.cjs.map +1 -1
- package/_cjs/Future/State.cjs +108 -0
- package/_cjs/Future/State.cjs.map +1 -0
- package/_cjs/Future/api.cjs +71 -64
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Future/constructors.cjs +3 -4
- package/_cjs/Future/constructors.cjs.map +1 -1
- package/_cjs/Future/definition.cjs +1 -15
- package/_cjs/Future/definition.cjs.map +1 -1
- package/_cjs/Future.cjs +11 -0
- package/_cjs/Future.cjs.map +1 -1
- package/_cjs/Hub/api.cjs +56 -57
- package/_cjs/Hub/api.cjs.map +1 -1
- package/_cjs/Hub/internal.cjs +1 -2
- package/_cjs/Hub/internal.cjs.map +1 -1
- package/_cjs/IO/api/acquireRelease.cjs +1 -2
- package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseExit.cjs +1 -2
- package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs +1 -2
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +1 -2
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
- package/_cjs/IO/api/addFinalizer.cjs +1 -2
- package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/addFinalizerExit.cjs +1 -2
- package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/all.cjs +1 -2
- package/_cjs/IO/api/all.cjs.map +1 -1
- package/_cjs/IO/api/array.cjs +51 -0
- package/_cjs/IO/api/array.cjs.map +1 -0
- package/_cjs/IO/api/asyncIO.cjs +1 -2
- package/_cjs/IO/api/asyncIO.cjs.map +1 -1
- package/_cjs/IO/api/asyncInterrupt.cjs +1 -2
- package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
- package/_cjs/IO/api/awaitAllChildren.cjs +17 -0
- package/_cjs/IO/api/awaitAllChildren.cjs.map +1 -0
- package/_cjs/IO/api/blocking.cjs +1 -2
- package/_cjs/IO/api/blocking.cjs.map +1 -1
- package/_cjs/IO/api/bracket.cjs +1 -2
- package/_cjs/IO/api/bracket.cjs.map +1 -1
- package/_cjs/IO/api/bracketExit.cjs +1 -2
- package/_cjs/IO/api/bracketExit.cjs.map +1 -1
- package/_cjs/IO/api/cachedInvalidate.cjs +47 -0
- package/_cjs/IO/api/cachedInvalidate.cjs.map +1 -0
- package/_cjs/IO/api/clockWith.cjs +1 -2
- package/_cjs/IO/api/clockWith.cjs.map +1 -1
- package/_cjs/IO/api/concurrency.cjs +1 -2
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/concurrentFinalizers.cjs +1 -2
- package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
- package/_cjs/IO/api/consoleWith.cjs +1 -2
- package/_cjs/IO/api/consoleWith.cjs.map +1 -1
- package/_cjs/IO/api/daemonChildren.cjs +1 -2
- package/_cjs/IO/api/daemonChildren.cjs.map +1 -1
- package/_cjs/IO/api/delay.cjs +1 -2
- package/_cjs/IO/api/delay.cjs.map +1 -1
- package/_cjs/IO/api/descriptor.cjs +1 -2
- package/_cjs/IO/api/descriptor.cjs.map +1 -1
- package/_cjs/IO/api/diffFiberRefs.cjs +1 -2
- package/_cjs/IO/api/diffFiberRefs.cjs.map +1 -1
- package/_cjs/IO/api/disconnect.cjs +2 -3
- package/_cjs/IO/api/disconnect.cjs.map +1 -1
- package/_cjs/IO/api/ensuringChildren.cjs +1 -2
- package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
- package/_cjs/IO/api/environment.cjs +1 -2
- package/_cjs/IO/api/environment.cjs.map +1 -1
- package/_cjs/IO/api/foreachConcurrent.cjs +36 -30
- package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
- package/_cjs/IO/api/foreachExec.cjs +1 -2
- package/_cjs/IO/api/foreachExec.cjs.map +1 -1
- package/_cjs/IO/api/fork.cjs +2 -3
- package/_cjs/IO/api/fork.cjs.map +1 -1
- package/_cjs/IO/api/forkAll.cjs +1 -2
- package/_cjs/IO/api/forkAll.cjs.map +1 -1
- package/_cjs/IO/api/forkDaemon.cjs +5 -6
- package/_cjs/IO/api/forkDaemon.cjs.map +1 -1
- package/_cjs/IO/api/forkIn.cjs +1 -2
- package/_cjs/IO/api/forkIn.cjs.map +1 -1
- package/_cjs/IO/api/forkScoped.cjs +1 -2
- package/_cjs/IO/api/forkScoped.cjs.map +1 -1
- package/_cjs/IO/api/fulfill.cjs +1 -2
- package/_cjs/IO/api/fulfill.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +4 -5
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/memoize.cjs +1 -2
- package/_cjs/IO/api/memoize.cjs.map +1 -1
- package/_cjs/IO/api/onTermination.cjs +2 -3
- package/_cjs/IO/api/onTermination.cjs.map +1 -1
- package/_cjs/IO/api/once.cjs +1 -2
- package/_cjs/IO/api/once.cjs.map +1 -1
- package/_cjs/IO/api/patchFiberRefs.cjs +1 -2
- package/_cjs/IO/api/patchFiberRefs.cjs.map +1 -1
- package/_cjs/IO/api/provideLayer.cjs +1 -2
- package/_cjs/IO/api/provideLayer.cjs.map +1 -1
- package/_cjs/IO/api/provideScope.cjs +1 -2
- package/_cjs/IO/api/provideScope.cjs.map +1 -1
- package/_cjs/IO/api/provideSomeLayer.cjs +1 -2
- package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
- package/_cjs/IO/api/provideSomeRuntime.cjs +1 -2
- package/_cjs/IO/api/provideSomeRuntime.cjs.map +1 -1
- package/_cjs/IO/api/race.cjs +2 -3
- package/_cjs/IO/api/race.cjs.map +1 -1
- package/_cjs/IO/api/raceFirst.cjs +1 -2
- package/_cjs/IO/api/raceFirst.cjs.map +1 -1
- package/_cjs/IO/api/raceWith.cjs +1 -2
- package/_cjs/IO/api/raceWith.cjs.map +1 -1
- package/_cjs/IO/api/randomWith.cjs +1 -2
- package/_cjs/IO/api/randomWith.cjs.map +1 -1
- package/_cjs/IO/api/repeat.cjs +1 -2
- package/_cjs/IO/api/repeat.cjs.map +1 -1
- package/_cjs/IO/api/retry.cjs +1 -2
- package/_cjs/IO/api/retry.cjs.map +1 -1
- package/_cjs/IO/api/schedule.cjs +1 -2
- package/_cjs/IO/api/schedule.cjs.map +1 -1
- package/_cjs/IO/api/scope.cjs +1 -2
- package/_cjs/IO/api/scope.cjs.map +1 -1
- package/_cjs/IO/api/scopeWith.cjs +1 -2
- package/_cjs/IO/api/scopeWith.cjs.map +1 -1
- package/_cjs/IO/api/scoped.cjs +1 -2
- package/_cjs/IO/api/scoped.cjs.map +1 -1
- package/_cjs/IO/api/sleep.cjs +1 -2
- package/_cjs/IO/api/sleep.cjs.map +1 -1
- package/_cjs/IO/api/stateful.cjs +1 -2
- package/_cjs/IO/api/stateful.cjs.map +1 -1
- package/_cjs/IO/api/supervised.cjs +1 -2
- package/_cjs/IO/api/supervised.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +9 -11
- package/_cjs/IO/api/timeout.cjs.map +1 -1
- package/_cjs/IO/api/transplant.cjs +22 -7
- package/_cjs/IO/api/transplant.cjs.map +1 -1
- package/_cjs/IO/api/whenFiberRef.cjs +1 -2
- package/_cjs/IO/api/whenFiberRef.cjs.map +1 -1
- package/_cjs/IO/api/whenRef.cjs +1 -2
- package/_cjs/IO/api/whenRef.cjs.map +1 -1
- package/_cjs/IO/api/withChildren.cjs +1 -2
- package/_cjs/IO/api/withChildren.cjs.map +1 -1
- package/_cjs/IO/api/withEarlyRelease.cjs +1 -2
- package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizer.cjs +1 -2
- package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizerExit.cjs +1 -2
- package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/zipConcurrent.cjs +5 -6
- package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
- package/_cjs/IO/api.cjs +522 -473
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +2 -3
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +9 -10
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IO.cjs +33 -11
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/IOEnv/definition.cjs +1 -2
- package/_cjs/IOEnv/definition.cjs.map +1 -1
- package/_cjs/IOEnv/live.cjs +1 -2
- package/_cjs/IOEnv/live.cjs.map +1 -1
- package/_cjs/IOEnv/services.cjs +1 -2
- package/_cjs/IOEnv/services.cjs.map +1 -1
- package/_cjs/Layer/MemoMap.cjs +1 -2
- package/_cjs/Layer/MemoMap.cjs.map +1 -1
- package/_cjs/Layer/api.cjs +1 -2
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Logger/api.cjs +1 -2
- package/_cjs/Logger/api.cjs.map +1 -1
- package/_cjs/Logger/constructors.cjs +1 -2
- package/_cjs/Logger/constructors.cjs.map +1 -1
- package/_cjs/MVar/api.cjs +1 -2
- package/_cjs/MVar/api.cjs.map +1 -1
- package/_cjs/Push/api.cjs +2 -3
- package/_cjs/Push/api.cjs.map +1 -1
- package/_cjs/Push/internal.cjs +1 -2
- package/_cjs/Push/internal.cjs.map +1 -1
- package/_cjs/Queue/api/dimapIO.cjs +1 -2
- package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
- package/_cjs/Queue/api/filterInputIO.cjs +1 -2
- package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
- package/_cjs/Queue/api/filterOutputIO.cjs +1 -2
- package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
- package/_cjs/Queue/api/poll.cjs +1 -2
- package/_cjs/Queue/api/poll.cjs.map +1 -1
- package/_cjs/Queue/api/takeBetween.cjs +1 -2
- package/_cjs/Queue/api/takeBetween.cjs.map +1 -1
- package/_cjs/Queue/api/takeN.cjs +1 -2
- package/_cjs/Queue/api/takeN.cjs.map +1 -1
- package/_cjs/Queue/api/zipWithIO.cjs +1 -2
- package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
- package/_cjs/Queue/constructors.cjs +1 -2
- package/_cjs/Queue/constructors.cjs.map +1 -1
- package/_cjs/Queue/internal.cjs +1 -2
- package/_cjs/Queue/internal.cjs.map +1 -1
- package/_cjs/Queue/strategy.cjs +1 -2
- package/_cjs/Queue/strategy.cjs.map +1 -1
- package/_cjs/Random/api.cjs +1 -2
- package/_cjs/Random/api.cjs.map +1 -1
- package/_cjs/Random/definition.cjs +2 -2
- package/_cjs/Random/definition.cjs.map +1 -1
- package/_cjs/Random/live.cjs +1 -2
- package/_cjs/Random/live.cjs.map +1 -1
- package/_cjs/Ref/Atomic.cjs +1 -2
- package/_cjs/Ref/Atomic.cjs.map +1 -1
- package/_cjs/Ref/Derived.cjs +1 -2
- package/_cjs/Ref/Derived.cjs.map +1 -1
- package/_cjs/Ref/DerivedAll.cjs +1 -2
- package/_cjs/Ref/DerivedAll.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/api.cjs +2 -3
- package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/constructors.cjs +2 -3
- package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/definition.cjs +2 -3
- package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
- package/_cjs/Ref/api/collect.cjs +1 -2
- package/_cjs/Ref/api/collect.cjs.map +1 -1
- package/_cjs/Ref/api/dimap.cjs +1 -2
- package/_cjs/Ref/api/dimap.cjs.map +1 -1
- package/_cjs/Ref/api/filter.cjs +1 -2
- package/_cjs/Ref/api/filter.cjs.map +1 -1
- package/_cjs/Ref/api/modify.cjs +1 -2
- package/_cjs/Ref/api/modify.cjs.map +1 -1
- package/_cjs/Ref/api.cjs +1 -2
- package/_cjs/Ref/api.cjs.map +1 -1
- package/_cjs/Ref/constructors.cjs +1 -2
- package/_cjs/Ref/constructors.cjs.map +1 -1
- package/_cjs/RefSubject/Atomic.cjs +1 -2
- package/_cjs/RefSubject/Atomic.cjs.map +1 -1
- package/_cjs/RefSubject/Synchronized/api.cjs +1 -2
- package/_cjs/RefSubject/Synchronized/api.cjs.map +1 -1
- package/_cjs/RefSubject/Synchronized/definition.cjs +1 -2
- package/_cjs/RefSubject/Synchronized/definition.cjs.map +1 -1
- package/_cjs/RefSubject/api.cjs +1 -2
- package/_cjs/RefSubject/api.cjs.map +1 -1
- package/_cjs/Reloadable/api.cjs +1 -2
- package/_cjs/Reloadable/api.cjs.map +1 -1
- package/_cjs/Reloadable/constructors.cjs +1 -2
- package/_cjs/Reloadable/constructors.cjs.map +1 -1
- package/_cjs/Reloadable/definition.cjs +1 -2
- package/_cjs/Reloadable/definition.cjs.map +1 -1
- package/_cjs/RuntimeFlag.cjs +0 -4
- package/_cjs/RuntimeFlags/Patch.cjs +1 -2
- package/_cjs/RuntimeFlags/Patch.cjs.map +1 -1
- package/_cjs/RuntimeFlags/RuntimeFlags.cjs +1 -2
- package/_cjs/RuntimeFlags/RuntimeFlags.cjs.map +1 -1
- package/_cjs/STM/api/atomically.cjs +1 -2
- package/_cjs/STM/api/atomically.cjs.map +1 -1
- package/_cjs/STM/api/core-api.cjs +1 -2
- package/_cjs/STM/api/core-api.cjs.map +1 -1
- package/_cjs/STM/api.cjs +1 -2
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/STM/definition.cjs +2 -3
- package/_cjs/STM/definition.cjs.map +1 -1
- package/_cjs/STM/driver.cjs +1 -2
- package/_cjs/STM/driver.cjs.map +1 -1
- package/_cjs/STM/internal/CommitState.cjs +1 -2
- package/_cjs/STM/internal/CommitState.cjs.map +1 -1
- package/_cjs/STM/internal/Journal.cjs +1 -2
- package/_cjs/STM/internal/Journal.cjs.map +1 -1
- package/_cjs/Schedule/Decision.cjs +1 -2
- package/_cjs/Schedule/Decision.cjs.map +1 -1
- package/_cjs/Schedule/api/driver.cjs +1 -2
- package/_cjs/Schedule/api/driver.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +1 -2
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Scope/Finalizer/definition.cjs +1 -2
- package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/definition.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
- package/_cjs/Scope/api.cjs +1 -2
- package/_cjs/Scope/api.cjs.map +1 -1
- package/_cjs/Scope/definition.cjs +1 -2
- package/_cjs/Scope/definition.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +2 -3
- package/_cjs/ScopedRef/api.cjs.map +1 -1
- package/_cjs/Semaphore/Reservation.cjs +24 -0
- package/_cjs/Semaphore/Reservation.cjs.map +1 -0
- package/_cjs/Semaphore/constructors.cjs +25 -0
- package/_cjs/Semaphore/constructors.cjs.map +1 -0
- package/_cjs/Semaphore/definition.cjs +149 -0
- package/_cjs/Semaphore/definition.cjs.map +1 -0
- package/_cjs/Semaphore.cjs +31 -138
- package/_cjs/Semaphore.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +1 -2
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/State/api.cjs +1 -2
- package/_cjs/State/api.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +1 -2
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWith.cjs +1 -2
- package/_cjs/Stream/api/zipWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +1 -2
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
- package/_cjs/Stream/api.cjs +702 -703
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs +1 -2
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
- package/_cjs/Stream/internal/Pull.cjs +1 -2
- package/_cjs/Stream/internal/Pull.cjs.map +1 -1
- package/_cjs/Stream/internal/Take.cjs +1 -2
- package/_cjs/Stream/internal/Take.cjs.map +1 -1
- package/_cjs/Stream/internal/util.cjs +1 -2
- package/_cjs/Stream/internal/util.cjs.map +1 -1
- package/_cjs/Subject/Atomic.cjs +1 -2
- package/_cjs/Subject/Atomic.cjs.map +1 -1
- package/_cjs/Subject/api.cjs +1 -2
- package/_cjs/Subject/api.cjs.map +1 -1
- package/_cjs/SubscriptionRef.cjs +2 -3
- package/_cjs/SubscriptionRef.cjs.map +1 -1
- package/_cjs/Supervisor/api.cjs +1 -2
- package/_cjs/Supervisor/api.cjs.map +1 -1
- package/_cjs/Supervisor/constructors.cjs +1 -2
- package/_cjs/Supervisor/constructors.cjs.map +1 -1
- package/_cjs/Supervisor/definition.cjs +1 -2
- package/_cjs/Supervisor/definition.cjs.map +1 -1
- package/_cjs/SupervisorPatch.cjs +1 -2
- package/_cjs/SupervisorPatch.cjs.map +1 -1
- package/_cjs/TExit/definition.cjs +1 -2
- package/_cjs/TExit/definition.cjs.map +1 -1
- package/_cjs/TFuture/api.cjs +1 -2
- package/_cjs/TFuture/api.cjs.map +1 -1
- package/_cjs/TFuture/constructors.cjs +1 -2
- package/_cjs/TFuture/constructors.cjs.map +1 -1
- package/_cjs/TFuture/definition.cjs +1 -2
- package/_cjs/TFuture/definition.cjs.map +1 -1
- package/_cjs/TReentrantLock/api.cjs +1 -2
- package/_cjs/TReentrantLock/api.cjs.map +1 -1
- package/_cjs/TReentrantLock/definition.cjs +1 -2
- package/_cjs/TReentrantLock/definition.cjs.map +1 -1
- package/_cjs/TRef/api.cjs +1 -2
- package/_cjs/TRef/api.cjs.map +1 -1
- package/_cjs/TRef/constructors.cjs +1 -2
- package/_cjs/TRef/constructors.cjs.map +1 -1
- package/_cjs/TRef/definition.cjs +1 -2
- package/_cjs/TRef/definition.cjs.map +1 -1
- package/_cjs/TSemaphore/api.cjs +1 -2
- package/_cjs/TSemaphore/api.cjs.map +1 -1
- package/_cjs/TSemaphore/constructors.cjs +1 -2
- package/_cjs/TSemaphore/constructors.cjs.map +1 -1
- package/_cjs/TSemaphore/definition.cjs +1 -2
- package/_cjs/TSemaphore/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/filterIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/findIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/mapIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
- package/_cjs/data/Exit/foreachIO.cjs +1 -2
- package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
- package/_cjs/global.cjs +0 -4
- package/_cjs/index.cjs +0 -4
- package/_cjs/internal/HashedPair.cjs +1 -2
- package/_cjs/internal/HashedPair.cjs.map +1 -1
- package/_cjs/internal/Hub.cjs +1 -2
- package/_cjs/internal/Hub.cjs.map +1 -1
- package/_cjs/internal/MutableQueue.cjs +1 -2
- package/_cjs/internal/MutableQueue.cjs.map +1 -1
- package/_cjs/internal/Scheduler.cjs +1 -2
- package/_cjs/internal/Scheduler.cjs.map +1 -1
- package/_cjs/internal/StackTraceBuilder.cjs +1 -2
- package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
- package/_mjs/Cached/api.mjs.map +1 -1
- package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
- package/_mjs/Channel/api/runScoped.mjs +2 -2
- package/_mjs/Channel/api/runScoped.mjs.map +1 -1
- package/_mjs/Channel/api/toPull.mjs +1 -1
- package/_mjs/Channel/api/toPull.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +205 -205
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/core-api.mjs +43 -42
- package/_mjs/Channel/core-api.mjs.map +1 -1
- package/_mjs/Channel/internal/AsyncInputConsumer.mjs +1 -1
- package/_mjs/Channel/internal/AsyncInputProducer.mjs +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +3 -3
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
- package/_mjs/Console/definition.mjs +1 -0
- package/_mjs/Console/definition.mjs.map +1 -1
- package/_mjs/CountdownLatch.mjs +2 -1
- package/_mjs/CountdownLatch.mjs.map +1 -1
- package/_mjs/Fiber/FiberMessage.mjs +2 -20
- package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
- package/_mjs/Fiber/FiberRuntime.mjs +877 -633
- package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
- package/_mjs/Fiber/api/collectAll.mjs +1 -1
- package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interrupt.mjs +1 -1
- package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAs.mjs +4 -7
- package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
- package/_mjs/Fiber/api/mapIO.mjs +1 -1
- package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
- package/_mjs/Fiber/api/zipWith.mjs +1 -1
- package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
- package/_mjs/Fiber/constructors.mjs +1 -1
- package/_mjs/Fiber/constructors.mjs.map +1 -1
- package/_mjs/Fiber/definition.mjs +5 -2
- package/_mjs/Fiber/definition.mjs.map +1 -1
- package/_mjs/FiberScope/definition.mjs +28 -4
- package/_mjs/FiberScope/definition.mjs.map +1 -1
- package/_mjs/FiberSet.mjs +14 -12
- package/_mjs/FiberSet.mjs.map +1 -1
- package/_mjs/Future/State.mjs +96 -0
- package/_mjs/Future/State.mjs.map +1 -0
- package/_mjs/Future/api.mjs +67 -61
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Future/constructors.mjs +3 -3
- package/_mjs/Future/constructors.mjs.map +1 -1
- package/_mjs/Future/definition.mjs +0 -12
- package/_mjs/Future/definition.mjs.map +1 -1
- package/_mjs/Future.mjs +1 -0
- package/_mjs/Future.mjs.map +1 -1
- package/_mjs/Hub/api.mjs +55 -55
- package/_mjs/Hub/api.mjs.map +1 -1
- package/_mjs/IO/api/array.mjs +42 -0
- package/_mjs/IO/api/array.mjs.map +1 -0
- package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
- package/_mjs/IO/api/awaitAllChildren.mjs +10 -0
- package/_mjs/IO/api/awaitAllChildren.mjs.map +1 -0
- package/_mjs/IO/api/cachedInvalidate.mjs +39 -0
- package/_mjs/IO/api/cachedInvalidate.mjs.map +1 -0
- package/_mjs/IO/api/disconnect.mjs +1 -1
- package/_mjs/IO/api/disconnect.mjs.map +1 -1
- package/_mjs/IO/api/foreachConcurrent.mjs +35 -28
- package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
- package/_mjs/IO/api/fork.mjs +1 -1
- package/_mjs/IO/api/fork.mjs.map +1 -1
- package/_mjs/IO/api/forkDaemon.mjs +4 -4
- package/_mjs/IO/api/forkDaemon.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +3 -3
- package/_mjs/IO/api/onTermination.mjs +1 -1
- package/_mjs/IO/api/onTermination.mjs.map +1 -1
- package/_mjs/IO/api/race.mjs +1 -1
- package/_mjs/IO/api/race.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +8 -9
- package/_mjs/IO/api/timeout.mjs.map +1 -1
- package/_mjs/IO/api/transplant.mjs +19 -5
- package/_mjs/IO/api/transplant.mjs.map +1 -1
- package/_mjs/IO/api/zipConcurrent.mjs +4 -4
- package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
- package/_mjs/IO/api.mjs +515 -468
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +1 -1
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +8 -8
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IO.mjs +3 -1
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/IOEnv/definition.mjs.map +1 -1
- package/_mjs/Push/api.mjs +1 -1
- package/_mjs/Random/definition.mjs +1 -0
- package/_mjs/Random/definition.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/api.mjs +1 -1
- package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/constructors.mjs +1 -1
- package/_mjs/Ref/Synchronized/definition.mjs +1 -1
- package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
- package/_mjs/RuntimeFlag.mjs +1 -1
- package/_mjs/STM/definition.mjs +1 -1
- package/_mjs/ScopedRef/api.mjs +1 -1
- package/_mjs/ScopedRef/api.mjs.map +1 -1
- package/_mjs/Semaphore/Reservation.mjs +16 -0
- package/_mjs/Semaphore/Reservation.mjs.map +1 -0
- package/_mjs/Semaphore/constructors.mjs +17 -0
- package/_mjs/Semaphore/constructors.mjs.map +1 -0
- package/_mjs/Semaphore/definition.mjs +141 -0
- package/_mjs/Semaphore/definition.mjs.map +1 -0
- package/_mjs/Semaphore.mjs +4 -133
- package/_mjs/Semaphore.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +701 -701
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/SubscriptionRef.mjs +1 -1
- package/_mjs/global.mjs +1 -1
- package/_mjs/index.mjs +1 -1
- package/_src/Cached/api.ts +3 -3
- package/_src/Channel/api/toPull.ts +1 -1
- package/_src/Channel/api.ts +273 -272
- package/_src/Channel/core-api.ts +57 -55
- package/_src/Channel/internal/ChannelExecutor.ts +3 -3
- package/_src/Console/definition.ts +1 -0
- package/_src/CountdownLatch.ts +2 -0
- package/_src/Fiber/FiberMessage.ts +3 -28
- package/_src/Fiber/FiberRuntime.ts +988 -616
- package/_src/Fiber/api/interruptAs.ts +4 -3
- package/_src/Fiber/constructors.ts +1 -1
- package/_src/Fiber/definition.ts +4 -0
- package/_src/FiberScope/definition.ts +40 -2
- package/_src/FiberSet.ts +6 -2
- package/_src/Future/State.ts +128 -0
- package/_src/Future/api.ts +62 -51
- package/_src/Future/constructors.ts +4 -2
- package/_src/Future/definition.ts +2 -17
- package/_src/Future.ts +4 -3
- package/_src/Hub/api.ts +61 -61
- package/_src/IO/api/addFinalizerExit.ts +4 -4
- package/_src/IO/api/array.ts +49 -0
- package/_src/IO/api/asyncInterrupt.ts +1 -1
- package/_src/IO/api/awaitAllChildren.ts +6 -0
- package/_src/IO/api/cachedInvalidate.ts +42 -0
- package/_src/IO/api/foreachConcurrent.ts +39 -23
- package/_src/IO/api/fork.ts +1 -1
- package/_src/IO/api/forkDaemon.ts +2 -2
- package/_src/IO/api/memoize.ts +3 -3
- package/_src/IO/api/onTermination.ts +2 -2
- package/_src/IO/api/transplant.ts +26 -3
- package/_src/IO/api/zipConcurrent.ts +2 -2
- package/_src/IO/api.ts +547 -525
- package/_src/IO/definition.ts +4 -28
- package/_src/IO/runtime.ts +0 -1
- package/_src/IO.ts +65 -63
- package/_src/IOEnv/definition.ts +1 -4
- package/_src/Random/definition.ts +1 -0
- package/_src/Ref/Synchronized/api.ts +2 -2
- package/_src/Ref/Synchronized/definition.ts +1 -1
- package/_src/Semaphore/Reservation.ts +15 -0
- package/_src/Semaphore/constructors.ts +14 -0
- package/_src/Semaphore/definition.ts +180 -0
- package/_src/Semaphore.ts +5 -159
- package/_src/Stream/api.ts +679 -679
- package/package.json +4 -4
- package/IO/api/sequenceT.d.ts +0 -26
- package/_cjs/IO/api/sequenceT.cjs +0 -18
- package/_cjs/IO/api/sequenceT.cjs.map +0 -1
- package/_mjs/IO/api/sequenceT.mjs +0 -10
- package/_mjs/IO/api/sequenceT.mjs.map +0 -1
- package/_src/IO/api/sequenceT.ts +0 -16
package/_mjs/IO/api.mjs
CHANGED
@@ -1,53 +1,50 @@
|
|
1
1
|
const fileName_1 = "(@fncts/io) src/IO/api.ts";
|
2
|
-
import * as tsplus_module_1 from "@fncts/base/data/
|
3
|
-
import * as tsplus_module_2 from "@fncts/base/data/
|
4
|
-
import * as tsplus_module_3 from "@fncts/base/data/
|
2
|
+
import * as tsplus_module_1 from "@fncts/base/data/Cause/api";
|
3
|
+
import * as tsplus_module_2 from "@fncts/base/data/Maybe/constructors";
|
4
|
+
import * as tsplus_module_3 from "@fncts/base/data/FiberId/constructors";
|
5
5
|
import * as tsplus_module_4 from "@fncts/base/data/Either/destructors";
|
6
|
-
import * as tsplus_module_5 from "@fncts/base/
|
7
|
-
import * as tsplus_module_6 from "@fncts/base/
|
6
|
+
import * as tsplus_module_5 from "@fncts/base/data/Maybe/api";
|
7
|
+
import * as tsplus_module_6 from "@fncts/base/util/predicates";
|
8
8
|
import * as tsplus_module_7 from "@fncts/io/RuntimeFlags/RuntimeFlags";
|
9
9
|
import * as tsplus_module_8 from "@fncts/io/InterruptStatus/constructors";
|
10
10
|
import * as tsplus_module_9 from "@fncts/base/data/Either/constructors";
|
11
|
-
import * as tsplus_module_10 from "@fncts/base/
|
12
|
-
import * as tsplus_module_11 from "@fncts/base/collection/
|
13
|
-
import * as tsplus_module_12 from "@fncts/base/collection/
|
14
|
-
import * as tsplus_module_13 from "@fncts/base/
|
15
|
-
import * as tsplus_module_14 from "@fncts/base/
|
16
|
-
import * as tsplus_module_15 from "@fncts/base/
|
17
|
-
import * as tsplus_module_16 from "@fncts/base/data/
|
18
|
-
import * as tsplus_module_17 from "@fncts/base/data/
|
19
|
-
import * as tsplus_module_18 from "@fncts/base/data/
|
20
|
-
import * as tsplus_module_19 from "@fncts/base/
|
21
|
-
import * as tsplus_module_20 from "@fncts/base/collection/immutable/
|
22
|
-
import * as tsplus_module_21 from "@fncts/base/collection/immutable/
|
23
|
-
import * as tsplus_module_22 from "@fncts/base/collection/immutable/
|
24
|
-
import * as tsplus_module_23 from "@fncts/base/data/Exit/constructors";
|
25
|
-
export const async = async_1;
|
26
|
-
export const zipRight = zipRight_1;
|
11
|
+
import * as tsplus_module_10 from "@fncts/base/data/Exit/constructors";
|
12
|
+
import * as tsplus_module_11 from "@fncts/base/collection/immutable/Conc/api";
|
13
|
+
import * as tsplus_module_12 from "@fncts/base/collection/Iterable/api";
|
14
|
+
import * as tsplus_module_13 from "@fncts/base/collection/immutable/Conc/constructors";
|
15
|
+
import * as tsplus_module_14 from "@fncts/base/data/Maybe/definition";
|
16
|
+
import * as tsplus_module_15 from "@fncts/base/control/Eval/run";
|
17
|
+
import * as tsplus_module_16 from "@fncts/base/data/Exit/api";
|
18
|
+
import * as tsplus_module_17 from "@fncts/base/data/Maybe/destructors";
|
19
|
+
import * as tsplus_module_18 from "@fncts/base/data/exceptions";
|
20
|
+
import * as tsplus_module_19 from "@fncts/base/data/Trace/constructors";
|
21
|
+
import * as tsplus_module_20 from "@fncts/base/collection/immutable/Conc/api/empty";
|
22
|
+
import * as tsplus_module_21 from "@fncts/base/collection/immutable/List/api";
|
23
|
+
import * as tsplus_module_22 from "@fncts/base/collection/immutable/ReadonlyArray/constructors";
|
27
24
|
export const as = as_1;
|
28
25
|
export const asJust = asJust_1;
|
29
26
|
export const asUnit = asUnit_1;
|
30
|
-
export const
|
27
|
+
export const async = async_1;
|
31
28
|
export const catchAll = catchAll_1;
|
32
29
|
export const catchAllCause = catchAllCause_1;
|
33
|
-
export const
|
30
|
+
export const catchTagWith = catchTagWith_1;
|
34
31
|
export const collectIO = collectIO_1;
|
35
32
|
export const defer = defer_1;
|
36
33
|
export const either = either_1;
|
37
34
|
export const eventually = eventually_1;
|
38
35
|
export const fail = fail_1;
|
39
|
-
export const failNow = failNow_1;
|
40
|
-
export const refailCause = refailCause_1;
|
41
|
-
export const failCauseNow = failCauseNow_1;
|
42
36
|
export const failCause = failCause_1;
|
37
|
+
export const failCauseNow = failCauseNow_1;
|
38
|
+
export const failNow = failNow_1;
|
43
39
|
export const fiberIdWith = fiberIdWith_1;
|
44
40
|
export const filter = filter_1;
|
45
41
|
export const filterMapWithIndex = filterMapWithIndex_1;
|
46
42
|
export const filterOrElse = filterOrElse_1;
|
43
|
+
export const flatMap = flatMap_1;
|
47
44
|
export const foldLeft = foldLeft_1;
|
48
45
|
export const foreach = foreach_1;
|
49
|
-
export const foreachWithIndexDiscard = foreachWithIndexDiscard_1;
|
50
46
|
export const foreachDiscard = foreachDiscard_1;
|
47
|
+
export const foreachWithIndexDiscard = foreachWithIndexDiscard_1;
|
51
48
|
export const forever = forever_1;
|
52
49
|
export const fromPromiseCatch = fromPromiseCatch_1;
|
53
50
|
export const getOrFailWith = getOrFailWith_1;
|
@@ -59,21 +56,21 @@ export const loop = loop_1;
|
|
59
56
|
export const map = map_1;
|
60
57
|
export const mapError = mapError_1;
|
61
58
|
export const mapErrorCause = mapErrorCause_1;
|
59
|
+
export const match = match_1;
|
62
60
|
export const matchCauseIO = matchCauseIO_1;
|
63
61
|
export const matchIO = matchIO_1;
|
64
|
-
export const
|
62
|
+
export const refailCause = refailCause_1;
|
65
63
|
export const orElse = orElse_1;
|
66
64
|
export const orHaltWith = orHaltWith_1;
|
67
65
|
export const refineOrHaltWith = refineOrHaltWith_1;
|
68
66
|
export const rejectIO = rejectIO_1;
|
69
|
-
export const repeatN_ = repeatN_1;
|
70
67
|
export const repeatUntilIO = repeatUntilIO_1;
|
71
68
|
export const repeatWhileIO = repeatWhileIO_1;
|
72
69
|
export const retryUntilIO = retryUntilIO_1;
|
73
70
|
export const retryWhileIO = retryWhileIO_1;
|
74
71
|
export const sandbox = sandbox_1;
|
75
|
-
export const succeedNow = succeedNow_1;
|
76
72
|
export const succeed = succeed_1;
|
73
|
+
export const succeedNow = succeedNow_1;
|
77
74
|
export const summarized = summarized_1;
|
78
75
|
export const swap = swap_1;
|
79
76
|
export const swapWith = swapWith_1;
|
@@ -81,27 +78,17 @@ export const tryCatch = tryCatch_1;
|
|
81
78
|
export const tryOrElse = tryOrElse_1;
|
82
79
|
export const unrefineWith = unrefineWith_1;
|
83
80
|
export const unsandbox = unsandbox_1;
|
81
|
+
export const stackTrace = stackTrace_1;
|
84
82
|
export const whenIO = whenIO_1;
|
83
|
+
export const whileLoop = whileLoop_1;
|
85
84
|
export const withFiberRuntime = withFiberRuntime_1;
|
86
|
-
export const
|
85
|
+
export const zipRight = zipRight_1;
|
87
86
|
export const zipWith = zipWith_1;
|
88
87
|
export const gen = gen_1;
|
89
88
|
import { IOError } from "@fncts/base/data/exceptions";
|
90
89
|
import { identity, pipe, tuple } from "@fncts/base/data/function";
|
91
90
|
import { showWithOptions } from "@fncts/base/data/Showable";
|
92
91
|
import { IOPrimitive } from "@fncts/io/IO/definition";
|
93
|
-
/**
|
94
|
-
* Imports an asynchronous side-effect into a `IO`
|
95
|
-
*
|
96
|
-
* @tsplus static fncts.io.IOOps async
|
97
|
-
*/
|
98
|
-
function async_1(register, blockingOn = tsplus_module_1.none, __tsplusTrace) {
|
99
|
-
const io = new IOPrimitive(3 /* IOTag.Async */);
|
100
|
-
io.i0 = register;
|
101
|
-
io.i1 = () => blockingOn;
|
102
|
-
io.trace = __tsplusTrace;
|
103
|
-
return io;
|
104
|
-
}
|
105
92
|
/**
|
106
93
|
* Attempts to convert defects into a failure, throwing away all information
|
107
94
|
* about the cause of the failure.
|
@@ -109,27 +96,7 @@ function async_1(register, blockingOn = tsplus_module_1.none, __tsplusTrace) {
|
|
109
96
|
* @tsplus pipeable fncts.io.IO absorbWith
|
110
97
|
*/
|
111
98
|
export function absorbWith(f, __tsplusTrace) {
|
112
|
-
return ma => matchIO_1(cause => failNow_1(
|
113
|
-
}
|
114
|
-
/**
|
115
|
-
* @tsplus pipeable fncts.io.IO zipLeft
|
116
|
-
* @tsplus pipeable-operator fncts.io.IO <
|
117
|
-
*/
|
118
|
-
export function zipLeft(fb, __tsplusTrace) {
|
119
|
-
return self => {
|
120
|
-
return flatMap_1(a => map_1(() => a, __tsplusTrace)(fb), __tsplusTrace)(self);
|
121
|
-
};
|
122
|
-
}
|
123
|
-
/**
|
124
|
-
* Combine two effectful actions, keeping only the result of the second
|
125
|
-
*
|
126
|
-
* @tsplus pipeable fncts.io.IO zipRight
|
127
|
-
* @tsplus pipeable-operator fncts.io.IO >
|
128
|
-
*/
|
129
|
-
function zipRight_1(fb, __tsplusTrace) {
|
130
|
-
return self => {
|
131
|
-
return flatMap_1(() => fb, __tsplusTrace)(self);
|
132
|
-
};
|
99
|
+
return ma => matchIO_1(cause => failNow_1(tsplus_module_1.squashWith(f)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(sandbox_1(ma, __tsplusTrace));
|
133
100
|
}
|
134
101
|
/**
|
135
102
|
* @tsplus pipeable fncts.io.IO as
|
@@ -144,16 +111,16 @@ function as_1(b, __tsplusTrace) {
|
|
144
111
|
*
|
145
112
|
* @tsplus getter fncts.io.IO asJust
|
146
113
|
*/
|
147
|
-
function asJust_1(
|
148
|
-
return map_1(
|
114
|
+
function asJust_1(self, __tsplusTrace) {
|
115
|
+
return map_1(tsplus_module_2.just, __tsplusTrace)(self);
|
149
116
|
}
|
150
117
|
/**
|
151
118
|
* Maps the error value of this IO to an optional value.
|
152
119
|
*
|
153
120
|
* @tsplus getter fncts.io.IO asJustError
|
154
121
|
*/
|
155
|
-
export function asJustError(
|
156
|
-
return mapError_1(
|
122
|
+
export function asJustError(self, __tsplusTrace) {
|
123
|
+
return mapError_1(tsplus_module_2.just, __tsplusTrace)(self);
|
157
124
|
}
|
158
125
|
/**
|
159
126
|
* @tsplus getter fncts.io.IO asUnit
|
@@ -161,15 +128,27 @@ export function asJustError(ma, __tsplusTrace) {
|
|
161
128
|
function asUnit_1(self, __tsplusTrace) {
|
162
129
|
return as_1(() => undefined, __tsplusTrace)(self);
|
163
130
|
}
|
131
|
+
/**
|
132
|
+
* Imports an asynchronous side-effect into a `IO`
|
133
|
+
*
|
134
|
+
* @tsplus static fncts.io.IOOps async
|
135
|
+
*/
|
136
|
+
function async_1(register, blockingOn = tsplus_module_3.none, __tsplusTrace) {
|
137
|
+
const io = new IOPrimitive(3 /* IOTag.Async */);
|
138
|
+
io.i0 = register;
|
139
|
+
io.i1 = () => blockingOn;
|
140
|
+
io.trace = __tsplusTrace;
|
141
|
+
return io;
|
142
|
+
}
|
164
143
|
/**
|
165
144
|
* Returns an IO whose failure and success channels have been mapped by
|
166
145
|
* the specified pair of functions, `f` and `g`.
|
167
146
|
*
|
168
147
|
* @tsplus pipeable fncts.io.IO bimap
|
169
148
|
*/
|
170
|
-
export function bimap(
|
149
|
+
export function bimap(onFailure, onSuccess, __tsplusTrace) {
|
171
150
|
return self => {
|
172
|
-
return matchIO_1(e => failNow_1(
|
151
|
+
return matchIO_1(e => failNow_1(onFailure(e), __tsplusTrace), a => succeedNow_1(onSuccess(a), __tsplusTrace), __tsplusTrace)(self);
|
173
152
|
};
|
174
153
|
}
|
175
154
|
/**
|
@@ -180,22 +159,7 @@ export function bimap(f, g, __tsplusTrace) {
|
|
180
159
|
*/
|
181
160
|
export function bitap(onFailure, onSuccess, __tsplusTrace) {
|
182
161
|
return self => {
|
183
|
-
return matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(onFailure(e)), () => failCauseNow_1(cause, __tsplusTrace))(
|
184
|
-
};
|
185
|
-
}
|
186
|
-
/**
|
187
|
-
* Recovers from the specified error
|
188
|
-
*
|
189
|
-
* @tsplus pipeable fncts.io.IO catch
|
190
|
-
*/
|
191
|
-
function catchTagWith_1(tag, k, f, __tsplusTrace) {
|
192
|
-
return ma => {
|
193
|
-
return catchAll_1(e => {
|
194
|
-
if (tsplus_module_5.isObject(e) && tag in e && e[tag] === k) {
|
195
|
-
return f(e);
|
196
|
-
}
|
197
|
-
return failNow_1(e, __tsplusTrace);
|
198
|
-
}, __tsplusTrace)(ma);
|
162
|
+
return matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(onFailure(e)), () => failCauseNow_1(cause, __tsplusTrace))(tsplus_module_1.failureOrCause(cause)), a => zipRight_1(succeedNow_1(a, __tsplusTrace), __tsplusTrace)(onSuccess(a)), __tsplusTrace)(self);
|
199
163
|
};
|
200
164
|
}
|
201
165
|
/**
|
@@ -203,9 +167,9 @@ function catchTagWith_1(tag, k, f, __tsplusTrace) {
|
|
203
167
|
*
|
204
168
|
* @tsplus pipeable fncts.io.IO catchAll
|
205
169
|
*/
|
206
|
-
function catchAll_1(
|
207
|
-
return
|
208
|
-
return matchIO_1(
|
170
|
+
function catchAll_1(onFailure, __tsplusTrace) {
|
171
|
+
return self => {
|
172
|
+
return matchIO_1(onFailure, succeedNow_1, __tsplusTrace)(self);
|
209
173
|
};
|
210
174
|
}
|
211
175
|
/**
|
@@ -214,17 +178,17 @@ function catchAll_1(f, __tsplusTrace) {
|
|
214
178
|
*
|
215
179
|
* @tsplus pipeable fncts.io.IO catchAllCause
|
216
180
|
*/
|
217
|
-
function catchAllCause_1(
|
218
|
-
return
|
181
|
+
function catchAllCause_1(onFailure, __tsplusTrace) {
|
182
|
+
return self => matchCauseIO_1(onFailure, succeedNow_1, __tsplusTrace)(self);
|
219
183
|
}
|
220
184
|
/**
|
221
185
|
* Recovers from some or all of the error cases.
|
222
186
|
*
|
223
187
|
* @tsplus pipeable fncts.io.IO catchJust
|
224
188
|
*/
|
225
|
-
export function catchJust(
|
226
|
-
return
|
227
|
-
return matchCauseIO_1(cause => tsplus_module_4.match(e =>
|
189
|
+
export function catchJust(onFailure, __tsplusTrace) {
|
190
|
+
return self => {
|
191
|
+
return matchCauseIO_1(cause => tsplus_module_4.match(e => tsplus_module_5.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(onFailure(e)), failCauseNow_1)(tsplus_module_1.failureOrCause(cause)), succeedNow_1, __tsplusTrace)(self);
|
228
192
|
};
|
229
193
|
}
|
230
194
|
/**
|
@@ -232,9 +196,9 @@ export function catchJust(f, __tsplusTrace) {
|
|
232
196
|
*
|
233
197
|
* @tsplus pipeable fncts.io.IO catchJustCause
|
234
198
|
*/
|
235
|
-
export function catchJustCause(
|
236
|
-
return
|
237
|
-
return matchCauseIO_1(cause =>
|
199
|
+
export function catchJustCause(onFailure, __tsplusTrace) {
|
200
|
+
return self => {
|
201
|
+
return matchCauseIO_1(cause => tsplus_module_5.getOrElse(() => failCauseNow_1(cause, __tsplusTrace))(onFailure(cause)), succeedNow_1, __tsplusTrace)(self);
|
238
202
|
};
|
239
203
|
}
|
240
204
|
/**
|
@@ -247,9 +211,9 @@ export function catchJustCause(f, __tsplusTrace) {
|
|
247
211
|
*
|
248
212
|
* @tsplus pipeable fncts.io.IO catchJustDefect
|
249
213
|
*/
|
250
|
-
export function catchJustDefect(
|
251
|
-
return
|
252
|
-
return catchAll_1(a => a, __tsplusTrace)(unrefineWith_1(
|
214
|
+
export function catchJustDefect(onFailure, __tsplusTrace) {
|
215
|
+
return self => {
|
216
|
+
return catchAll_1(a => a, __tsplusTrace)(unrefineWith_1(onFailure, failNow_1, __tsplusTrace)(self));
|
253
217
|
};
|
254
218
|
}
|
255
219
|
/**
|
@@ -257,23 +221,38 @@ export function catchJustDefect(f, __tsplusTrace) {
|
|
257
221
|
*
|
258
222
|
* @tsplus pipeable IO catchTag
|
259
223
|
*/
|
260
|
-
export function catchTag(
|
261
|
-
return
|
262
|
-
return catchTagWith_1("_tag",
|
224
|
+
export function catchTag(tag, onFailure, __tsplusTrace) {
|
225
|
+
return self => {
|
226
|
+
return catchTagWith_1("_tag", tag, onFailure, __tsplusTrace)(self);
|
227
|
+
};
|
228
|
+
}
|
229
|
+
/**
|
230
|
+
* Recovers from the specified error
|
231
|
+
*
|
232
|
+
* @tsplus pipeable fncts.io.IO catch
|
233
|
+
*/
|
234
|
+
function catchTagWith_1(tagKey, tag, onFailure, __tsplusTrace) {
|
235
|
+
return self => {
|
236
|
+
return catchAll_1(e => {
|
237
|
+
if (tsplus_module_6.isObject(e) && tagKey in e && e[tagKey] === tag) {
|
238
|
+
return onFailure(e);
|
239
|
+
}
|
240
|
+
return failNow_1(e, __tsplusTrace);
|
241
|
+
}, __tsplusTrace)(self);
|
263
242
|
};
|
264
243
|
}
|
265
244
|
/**
|
266
245
|
* @tsplus getter fncts.io.IO cause
|
267
246
|
*/
|
268
|
-
export function cause(
|
269
|
-
return matchCauseIO_1(succeedNow_1, () => succeedNow_1(
|
247
|
+
export function cause(self, __tsplusTrace) {
|
248
|
+
return matchCauseIO_1(succeedNow_1, () => succeedNow_1(tsplus_module_1.empty(), __tsplusTrace), __tsplusTrace)(self);
|
270
249
|
}
|
271
250
|
/**
|
272
251
|
* @tsplus pipeable fncts.io.IO causeAsError
|
273
252
|
*/
|
274
253
|
export function causeAsError(__tsplusTrace) {
|
275
|
-
return
|
276
|
-
return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(
|
254
|
+
return self => {
|
255
|
+
return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(self);
|
277
256
|
};
|
278
257
|
}
|
279
258
|
/**
|
@@ -285,46 +264,28 @@ export function causeAsError(__tsplusTrace) {
|
|
285
264
|
export function checkInterruptible(f, __tsplusTrace) {
|
286
265
|
return withFiberRuntime_1((_, status) => f(tsplus_module_8.fromBoolean(tsplus_module_7.interruption(status.runtimeFlags))), __tsplusTrace);
|
287
266
|
}
|
288
|
-
/**
|
289
|
-
* Returns an IO that models the execution of this effect, followed by
|
290
|
-
* the passing of its value to the specified continuation function `f`,
|
291
|
-
* followed by the effect that it returns.
|
292
|
-
*
|
293
|
-
* @tsplus pipeable fncts.io.IO flatMap
|
294
|
-
*/
|
295
|
-
function flatMap_1(f, __tsplusTrace) {
|
296
|
-
return ma => {
|
297
|
-
const io = new IOPrimitive(5 /* IOTag.OnSuccess */);
|
298
|
-
io.i0 = ma;
|
299
|
-
io.i1 = f;
|
300
|
-
io.trace = __tsplusTrace;
|
301
|
-
return io;
|
302
|
-
};
|
303
|
-
}
|
304
|
-
/**
|
305
|
-
* @tsplus pipeable fncts.io.IO flatMapError
|
306
|
-
*/
|
307
|
-
export function flatMapError(f, __tsplusTrace) {
|
308
|
-
return ma => {
|
309
|
-
return swapWith_1(effect => flatMap_1(f, __tsplusTrace)(effect), __tsplusTrace)(ma);
|
310
|
-
};
|
311
|
-
}
|
312
267
|
/**
|
313
268
|
* @tsplus pipeable fncts.io.IO collect
|
314
269
|
*/
|
315
270
|
export function collect(f, pf, __tsplusTrace) {
|
316
|
-
return
|
317
|
-
return collectIO_1(f, a =>
|
271
|
+
return self => {
|
272
|
+
return collectIO_1(f, a => tsplus_module_5.map(succeedNow_1)(pf(a)), __tsplusTrace)(self);
|
318
273
|
};
|
319
274
|
}
|
320
275
|
/**
|
321
276
|
* @tsplus pipeable fncts.io.IO collectIO
|
322
277
|
*/
|
323
|
-
function collectIO_1(
|
324
|
-
return
|
325
|
-
return flatMap_1(a =>
|
278
|
+
function collectIO_1(onNothing, pf, __tsplusTrace) {
|
279
|
+
return self => {
|
280
|
+
return flatMap_1(a => tsplus_module_5.getOrElse(() => fail_1(onNothing, __tsplusTrace))(pf(a)), __tsplusTrace)(self);
|
326
281
|
};
|
327
282
|
}
|
283
|
+
/**
|
284
|
+
* @tsplus static fncts.io.IOOps if
|
285
|
+
*/
|
286
|
+
export function cond(b, onTrue, onFalse, __tsplusTrace) {
|
287
|
+
return ifIO_1(onTrue, onFalse, __tsplusTrace)(succeedNow_1(b, __tsplusTrace));
|
288
|
+
}
|
328
289
|
/**
|
329
290
|
* @tsplus static fncts.io.IOOps condIO
|
330
291
|
*/
|
@@ -340,7 +301,11 @@ export function condIO(b, onTrue, onFalse, __tsplusTrace) {
|
|
340
301
|
* @tsplus static fncts.io.IOOps defer
|
341
302
|
*/
|
342
303
|
function defer_1(io, __tsplusTrace) {
|
343
|
-
|
304
|
+
const out = new IOPrimitive(5 /* IOTag.OnSuccess */);
|
305
|
+
out.i0 = unit_1;
|
306
|
+
out.i1 = io;
|
307
|
+
out.trace = __tsplusTrace;
|
308
|
+
return out;
|
344
309
|
}
|
345
310
|
/**
|
346
311
|
* Returns a lazily constructed effect, whose construction may itself require effects.
|
@@ -353,7 +318,7 @@ export function deferTry(io, __tsplusTrace) {
|
|
353
318
|
try {
|
354
319
|
return io();
|
355
320
|
} catch (u) {
|
356
|
-
throw new IOError(
|
321
|
+
throw new IOError(tsplus_module_1.fail(u));
|
357
322
|
}
|
358
323
|
}, __tsplusTrace);
|
359
324
|
}
|
@@ -370,7 +335,7 @@ export function deferTryCatch(io, onThrow, __tsplusTrace) {
|
|
370
335
|
try {
|
371
336
|
return io();
|
372
337
|
} catch (u) {
|
373
|
-
throw new IOError(
|
338
|
+
throw new IOError(tsplus_module_1.fail(onThrow(u)));
|
374
339
|
}
|
375
340
|
}, __tsplusTrace);
|
376
341
|
}
|
@@ -379,51 +344,52 @@ export function deferTryCatch(io, onThrow, __tsplusTrace) {
|
|
379
344
|
*
|
380
345
|
* @tsplus getter fncts.io.IO either
|
381
346
|
*/
|
382
|
-
function either_1(
|
383
|
-
return match_1(tsplus_module_9.left, tsplus_module_9.right, __tsplusTrace)(
|
347
|
+
function either_1(self, __tsplusTrace) {
|
348
|
+
return match_1(tsplus_module_9.left, tsplus_module_9.right, __tsplusTrace)(self);
|
384
349
|
}
|
385
350
|
/**
|
386
351
|
* @tsplus pipeable fncts.io.IO errorAsCause
|
387
352
|
*/
|
388
353
|
export function errorAsCause(__tsplusTrace) {
|
389
|
-
return
|
390
|
-
return matchIO_1(failCauseNow_1, succeedNow_1, __tsplusTrace)(
|
354
|
+
return self => {
|
355
|
+
return matchIO_1(failCauseNow_1, succeedNow_1, __tsplusTrace)(self);
|
391
356
|
};
|
392
357
|
}
|
393
358
|
/**
|
394
359
|
* @tsplus getter fncts.io.IO eventually
|
395
360
|
*/
|
396
|
-
function eventually_1(
|
397
|
-
return orElse_1(() => eventually_1(
|
361
|
+
function eventually_1(self, __tsplusTrace) {
|
362
|
+
return orElse_1(() => eventually_1(self, __tsplusTrace), __tsplusTrace)(self);
|
363
|
+
}
|
364
|
+
/**
|
365
|
+
* @tsplus pipeable fncts.io.IO exitWith
|
366
|
+
*/
|
367
|
+
export function exitWith(f, __tsplusTrace) {
|
368
|
+
return self => {
|
369
|
+
return matchCauseIO_1(cause => f(tsplus_module_10.failCause(cause, __tsplusTrace)), a => f(tsplus_module_10.succeed(a, __tsplusTrace)), __tsplusTrace)(self);
|
370
|
+
};
|
398
371
|
}
|
399
372
|
/**
|
400
373
|
* @tsplus pipeable fncts.io.IO extend
|
401
374
|
*/
|
402
375
|
export function extend(f, __tsplusTrace) {
|
403
|
-
return
|
404
|
-
return matchIO_1(failNow_1, _ => succeed_1(() => f(
|
376
|
+
return self => {
|
377
|
+
return matchIO_1(failNow_1, _ => succeed_1(() => f(self), __tsplusTrace), __tsplusTrace)(self);
|
405
378
|
};
|
406
379
|
}
|
407
380
|
/**
|
408
381
|
* @tsplus static fncts.io.IOOps fail
|
409
382
|
*/
|
410
383
|
function fail_1(e, __tsplusTrace) {
|
411
|
-
return failCause_1(() =>
|
412
|
-
}
|
413
|
-
/**
|
414
|
-
* @tsplus static fncts.io.IOOps failNow
|
415
|
-
*/
|
416
|
-
function failNow_1(e, __tsplusTrace) {
|
417
|
-
return failCause_1(() => tsplus_module_2.fail(e), __tsplusTrace);
|
384
|
+
return failCause_1(() => tsplus_module_1.fail(e()), __tsplusTrace);
|
418
385
|
}
|
419
386
|
/**
|
420
|
-
*
|
387
|
+
* Returns an effect that models failure with the specified lazily-evaluated `Cause`.
|
388
|
+
*
|
389
|
+
* @tsplus static fncts.io.IOOps failCause
|
421
390
|
*/
|
422
|
-
function
|
423
|
-
|
424
|
-
io.i0 = () => cause;
|
425
|
-
io.trace = __tsplusTrace;
|
426
|
-
return io;
|
391
|
+
function failCause_1(cause, __tsplusTrace) {
|
392
|
+
return flatMap_1(trace => refailCause_1(() => tsplus_module_1.traced(cause(), trace), __tsplusTrace), __tsplusTrace)(stackTrace_1(__tsplusTrace));
|
427
393
|
}
|
428
394
|
/**
|
429
395
|
* Creates a `IO` that has failed with the specified `Cause`
|
@@ -437,24 +403,22 @@ function failCauseNow_1(cause, __tsplusTrace) {
|
|
437
403
|
return io;
|
438
404
|
}
|
439
405
|
/**
|
440
|
-
*
|
441
|
-
*
|
442
|
-
* @tsplus static fncts.io.IOOps failCause
|
406
|
+
* @tsplus static fncts.io.IOOps failNow
|
443
407
|
*/
|
444
|
-
function
|
445
|
-
return
|
408
|
+
function failNow_1(e, __tsplusTrace) {
|
409
|
+
return failCause_1(() => tsplus_module_1.fail(e), __tsplusTrace);
|
446
410
|
}
|
447
411
|
/**
|
448
412
|
* Returns the `FiberId` of the `Fiber` on which this `IO` is running
|
449
413
|
*
|
450
414
|
* @tsplus static fncts.io.IOOps fiberId
|
451
415
|
*/
|
452
|
-
export const fiberId = /*#__PURE__*/fiberIdWith_1(id => succeedNow_1(id, fileName_1 + ":
|
416
|
+
export const fiberId = /*#__PURE__*/fiberIdWith_1(id => succeedNow_1(id, fileName_1 + ":435:87"));
|
453
417
|
/**
|
454
418
|
* @tsplus static fncts.io.IOOps fiberIdWith
|
455
419
|
*/
|
456
420
|
function fiberIdWith_1(f) {
|
457
|
-
return withFiberRuntime_1(fiber => f(fiber.id), fileName_1 + ":
|
421
|
+
return withFiberRuntime_1(fiber => f(fiber.id), fileName_1 + ":441:29");
|
458
422
|
}
|
459
423
|
/**
|
460
424
|
* Filters the collection using the specified effectual predicate.
|
@@ -462,7 +426,7 @@ function fiberIdWith_1(f) {
|
|
462
426
|
* @tsplus static fncts.io.IOOps filter
|
463
427
|
*/
|
464
428
|
function filter_1(as, f, __tsplusTrace) {
|
465
|
-
return map_1(b => b.result(), __tsplusTrace)(
|
429
|
+
return map_1(b => b.result(), __tsplusTrace)(tsplus_module_12.foldLeft(succeedNow_1(tsplus_module_11.builder(), __tsplusTrace), (eff, a) => zipWith_1(f(a), (builder, p) => {
|
466
430
|
if (p) {
|
467
431
|
builder.append(a);
|
468
432
|
}
|
@@ -481,8 +445,8 @@ export function filterMap(as, f, __tsplusTrace) {
|
|
481
445
|
function filterMapWithIndex_1(as, f, __tsplusTrace) {
|
482
446
|
return defer_1(() => {
|
483
447
|
const bs = [];
|
484
|
-
return as_1(() =>
|
485
|
-
if (
|
448
|
+
return as_1(() => tsplus_module_13.from(bs), __tsplusTrace)(foreachWithIndexDiscard_1(as, (i, a) => map_1(b => {
|
449
|
+
if (tsplus_module_14.isJust(b)) {
|
486
450
|
bs.push(b.value);
|
487
451
|
}
|
488
452
|
}, __tsplusTrace)(f(i, a)), __tsplusTrace));
|
@@ -507,18 +471,42 @@ export function filterOrFail(predicate, failWith, __tsplusTrace) {
|
|
507
471
|
return filterOrElse_1(predicate, a => failNow_1(failWith(a), __tsplusTrace), __tsplusTrace)(fa);
|
508
472
|
};
|
509
473
|
}
|
474
|
+
export function filterOrHalt(predicate, haltWith, __tsplusTrace) {
|
475
|
+
return fa => {
|
476
|
+
return filterOrElse_1(predicate, a => haltNow_1(haltWith(a), __tsplusTrace), __tsplusTrace)(fa);
|
477
|
+
};
|
478
|
+
}
|
510
479
|
/**
|
511
480
|
* Returns an `IO` that yields the value of the first
|
512
481
|
* `IO` to succeed.
|
513
482
|
*
|
514
483
|
* @tsplus static fncts.io.IOOps firstSuccess
|
515
484
|
*/
|
516
|
-
export function firstSuccess(
|
517
|
-
return
|
485
|
+
export function firstSuccess(ios, __tsplusTrace) {
|
486
|
+
return ios.reduce((b, a) => orElse_1(() => a, __tsplusTrace)(b));
|
518
487
|
}
|
519
|
-
|
520
|
-
|
521
|
-
|
488
|
+
/**
|
489
|
+
* Returns an IO that models the execution of this effect, followed by
|
490
|
+
* the passing of its value to the specified continuation function `f`,
|
491
|
+
* followed by the effect that it returns.
|
492
|
+
*
|
493
|
+
* @tsplus pipeable fncts.io.IO flatMap
|
494
|
+
*/
|
495
|
+
function flatMap_1(f, __tsplusTrace) {
|
496
|
+
return self => {
|
497
|
+
const io = new IOPrimitive(5 /* IOTag.OnSuccess */);
|
498
|
+
io.i0 = self;
|
499
|
+
io.i1 = f;
|
500
|
+
io.trace = __tsplusTrace;
|
501
|
+
return io;
|
502
|
+
};
|
503
|
+
}
|
504
|
+
/**
|
505
|
+
* @tsplus pipeable fncts.io.IO flatMapError
|
506
|
+
*/
|
507
|
+
export function flatMapError(f, __tsplusTrace) {
|
508
|
+
return self => {
|
509
|
+
return swapWith_1(effect => flatMap_1(f, __tsplusTrace)(effect), __tsplusTrace)(self);
|
522
510
|
};
|
523
511
|
}
|
524
512
|
/**
|
@@ -531,33 +519,32 @@ export function flatten(self, __tsplusTrace) {
|
|
531
519
|
* Folds an `Iterable<A>` using an effectful function f, working sequentially from left to right.
|
532
520
|
*
|
533
521
|
* @tsplus static fncts.io.IOOps foldLeft
|
522
|
+
* @tsplus fluent fncts.Iterable foldLeftIO
|
534
523
|
*/
|
535
524
|
function foldLeft_1(as, b, f, __tsplusTrace) {
|
536
|
-
return
|
525
|
+
return tsplus_module_12.foldLeft(succeedNow_1(b, __tsplusTrace), (acc, el) => flatMap_1(a => f(a, el), __tsplusTrace)(acc))(as);
|
537
526
|
}
|
538
527
|
/**
|
539
528
|
* Combines an array of `IO`s using a `Monoid`
|
540
529
|
*
|
541
530
|
* @tsplus static fncts.io.IOOps foldMap
|
531
|
+
* @tsplus fluent fncts.Iterable foldMapIO
|
542
532
|
*/
|
543
|
-
export function foldMap(
|
544
|
-
return foldLeft_1(
|
545
|
-
}
|
546
|
-
function foldRightLoop(iterator, b, f, __tsplusTrace) {
|
547
|
-
const next = iterator.next();
|
548
|
-
return next.done ? b : f(next.value, foldRightLoop(iterator, b, f, __tsplusTrace));
|
533
|
+
export function foldMap(ios, f, /** @tsplus auto */M) {
|
534
|
+
return foldLeft_1(ios, M.nat, (m, a) => map_1(a => M.combine(f(a))(m), fileName_1 + ":645:49")(a), fileName_1 + ":645:21");
|
549
535
|
}
|
550
536
|
/**
|
551
537
|
* Performs a right-associative fold of an `Iterable<A>`
|
552
538
|
*
|
553
539
|
* @tsplus static fncts.io.IOOps foldRight
|
540
|
+
* @tsplus fluent fncts.Iterable foldRightIO
|
554
541
|
*/
|
555
542
|
export function foldRight(as, b, f, __tsplusTrace) {
|
556
543
|
return foldRightLoop(as[Symbol.iterator](), b, f, __tsplusTrace);
|
557
544
|
}
|
558
|
-
function
|
545
|
+
function foldRightLoop(iterator, b, f, __tsplusTrace) {
|
559
546
|
const next = iterator.next();
|
560
|
-
return next.done ?
|
547
|
+
return next.done ? b : f(next.value, foldRightLoop(iterator, b, f, __tsplusTrace));
|
561
548
|
}
|
562
549
|
/**
|
563
550
|
* Applies the function `f` to each element of the `Iterable<A>` and
|
@@ -567,16 +554,27 @@ function foreachWithIndexDiscardLoop(iterator, f, i = 0, __tsplusTrace) {
|
|
567
554
|
* If you do not need the results, see `foreachUnit` for a more efficient implementation.
|
568
555
|
*
|
569
556
|
* @tsplus static fncts.io.IOOps foreach
|
557
|
+
* @tsplus fluent fncts.Iterable foreachIO
|
570
558
|
*/
|
571
559
|
function foreach_1(as, f, __tsplusTrace) {
|
572
560
|
return defer_1(() => {
|
573
561
|
const acc = [];
|
574
|
-
return as_1(() =>
|
562
|
+
return as_1(() => tsplus_module_13.from(acc), __tsplusTrace)(foreachWithIndexDiscard_1(as, (_, a) => flatMap_1(b => {
|
575
563
|
acc.push(b);
|
576
564
|
return unit_1;
|
577
565
|
}, __tsplusTrace)(f(a)), __tsplusTrace));
|
578
566
|
}, __tsplusTrace);
|
579
567
|
}
|
568
|
+
/**
|
569
|
+
* Applies the function `f` to each element of the `Iterable<A>` and runs
|
570
|
+
* produced IOs sequentially.
|
571
|
+
*
|
572
|
+
* @tsplus static fncts.io.IOOps foreachDiscard
|
573
|
+
* @tsplus fluent fncts.Iterable foreachDiscardIO
|
574
|
+
*/
|
575
|
+
function foreachDiscard_1(as, f, __tsplusTrace) {
|
576
|
+
return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)), __tsplusTrace);
|
577
|
+
}
|
580
578
|
/**
|
581
579
|
* Applies the function `f` to each element of the `Iterable<A>` and
|
582
580
|
* returns the results in a new `Conc<B>`.
|
@@ -585,11 +583,12 @@ function foreach_1(as, f, __tsplusTrace) {
|
|
585
583
|
* If you do not need the results, see `foreachUnit` for a more efficient implementation.
|
586
584
|
*
|
587
585
|
* @tsplus static fncts.io.IOOps foreachWithIndex
|
586
|
+
* @tsplus fluent fncts.Iterable foreachWithIndexIO
|
588
587
|
*/
|
589
588
|
export function foreachWithIndex(as, f, __tsplusTrace) {
|
590
589
|
return defer_1(() => {
|
591
590
|
const acc = [];
|
592
|
-
return as_1(() =>
|
591
|
+
return as_1(() => tsplus_module_13.from(acc), __tsplusTrace)(foreachWithIndexDiscard_1(as, (i, a) => flatMap_1(b => {
|
593
592
|
acc.push(b);
|
594
593
|
return unit_1;
|
595
594
|
}, __tsplusTrace)(f(i, a)), __tsplusTrace));
|
@@ -597,18 +596,14 @@ export function foreachWithIndex(as, f, __tsplusTrace) {
|
|
597
596
|
}
|
598
597
|
/**
|
599
598
|
* @tsplus static fncts.io.IOOps foreachWithIndexDiscard
|
599
|
+
* @tsplus fluent fncts.Iterable foreachWithIndexDiscardIO
|
600
600
|
*/
|
601
601
|
function foreachWithIndexDiscard_1(as, f, __tsplusTrace) {
|
602
602
|
return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), f), __tsplusTrace);
|
603
603
|
}
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
*
|
608
|
-
* @tsplus static fncts.io.IOOps foreachDiscard
|
609
|
-
*/
|
610
|
-
function foreachDiscard_1(as, f, __tsplusTrace) {
|
611
|
-
return defer_1(() => foreachWithIndexDiscardLoop(as[Symbol.iterator](), (_, a) => f(a)), __tsplusTrace);
|
604
|
+
function foreachWithIndexDiscardLoop(iterator, f, i = 0, __tsplusTrace) {
|
605
|
+
const next = iterator.next();
|
606
|
+
return next.done ? unit_1 : flatMap_1(() => foreachWithIndexDiscardLoop(iterator, f, i + 1, __tsplusTrace), __tsplusTrace)(f(i, next.value));
|
612
607
|
}
|
613
608
|
/**
|
614
609
|
* Repeats this effect forever (until the first failure).
|
@@ -642,7 +637,7 @@ export function fromEitherNow(either, __tsplusTrace) {
|
|
642
637
|
* @tsplus getter fncts.Eval toIO
|
643
638
|
*/
|
644
639
|
export function fromEval(computation, __tsplusTrace) {
|
645
|
-
return succeed_1(() =>
|
640
|
+
return succeed_1(() => tsplus_module_15.run(computation), __tsplusTrace);
|
646
641
|
}
|
647
642
|
/**
|
648
643
|
* Creates a `IO` from an exit value
|
@@ -650,7 +645,7 @@ export function fromEval(computation, __tsplusTrace) {
|
|
650
645
|
* @tsplus static fncts.io.IOOps fromExit
|
651
646
|
*/
|
652
647
|
export function fromExit(exit, __tsplusTrace) {
|
653
|
-
return defer_1(() =>
|
648
|
+
return defer_1(() => tsplus_module_16.match(failCauseNow_1, succeedNow_1)(exit()), __tsplusTrace);
|
654
649
|
}
|
655
650
|
/**
|
656
651
|
* Creates a `IO` from an exit value
|
@@ -659,7 +654,7 @@ export function fromExit(exit, __tsplusTrace) {
|
|
659
654
|
* @tsplus getter fncts.Exit toIO
|
660
655
|
*/
|
661
656
|
export function fromExitNow(exit, __tsplusTrace) {
|
662
|
-
return
|
657
|
+
return tsplus_module_16.match(failCauseNow_1, succeedNow_1)(exit);
|
663
658
|
}
|
664
659
|
/**
|
665
660
|
* Lifts a `Maybe` into an `IO` but preserves the error as a `Maybe` in the error channel, making it easier to compose
|
@@ -668,14 +663,23 @@ export function fromExitNow(exit, __tsplusTrace) {
|
|
668
663
|
* @tsplus static fncts.io.IOOps fromMaybe
|
669
664
|
*/
|
670
665
|
export function fromMaybe(maybe, __tsplusTrace) {
|
671
|
-
return flatMap_1(m =>
|
666
|
+
return flatMap_1(m => tsplus_module_17.match(() => failNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), succeedNow_1)(m), __tsplusTrace)(succeed_1(maybe, __tsplusTrace));
|
672
667
|
}
|
673
668
|
/**
|
674
669
|
* @tsplus static fncts.io.IOOps fromMaybeNow
|
675
670
|
* @tsplus getter fncts.Maybe toIO
|
676
671
|
*/
|
677
672
|
export function fromMaybeNow(maybe, __tsplusTrace) {
|
678
|
-
return
|
673
|
+
return tsplus_module_17.match(() => failNow_1(new tsplus_module_18.NoSuchElementError("IO.fromMaybeNow"), __tsplusTrace), succeedNow_1)(maybe);
|
674
|
+
}
|
675
|
+
/**
|
676
|
+
* Create an IO that when executed will construct `promise` and wait for its result,
|
677
|
+
* errors will produce failure as `unknown`
|
678
|
+
*
|
679
|
+
* @tsplus static fncts.io.IOOps fromPromise
|
680
|
+
*/
|
681
|
+
export function fromPromise(promise, __tsplusTrace) {
|
682
|
+
return fromPromiseCatch_1(promise, identity, __tsplusTrace);
|
679
683
|
}
|
680
684
|
/**
|
681
685
|
* Create an IO that when executed will construct `promise` and wait for its result,
|
@@ -688,15 +692,6 @@ function fromPromiseCatch_1(promise, onReject, __tsplusTrace) {
|
|
688
692
|
promise().then(a => k(succeedNow_1(a, __tsplusTrace))).catch(e => k(failNow_1(onReject(e), __tsplusTrace)));
|
689
693
|
});
|
690
694
|
}
|
691
|
-
/**
|
692
|
-
* Create an IO that when executed will construct `promise` and wait for its result,
|
693
|
-
* errors will produce failure as `unknown`
|
694
|
-
*
|
695
|
-
* @tsplus static fncts.io.IOOps fromPromise
|
696
|
-
*/
|
697
|
-
export function fromPromise(promise, __tsplusTrace) {
|
698
|
-
return fromPromiseCatch_1(promise, identity, __tsplusTrace);
|
699
|
-
}
|
700
695
|
/**
|
701
696
|
* Like fromPromise but produces a defect in case of errors
|
702
697
|
*
|
@@ -713,7 +708,13 @@ export function fromPromiseHalt(promise, __tsplusTrace) {
|
|
713
708
|
* @tsplus getter fncts.io.IO get
|
714
709
|
*/
|
715
710
|
export function get(ma, __tsplusTrace) {
|
716
|
-
return matchCauseIO_1(cause => failCauseNow_1(
|
711
|
+
return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_1.map(tsplus_module_2.just)(cause), __tsplusTrace), ma => tsplus_module_17.match(() => failNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), succeedNow_1)(ma), __tsplusTrace)(ma);
|
712
|
+
}
|
713
|
+
/**
|
714
|
+
* @tsplus static fncts.io.IOOps getFiberRefs
|
715
|
+
*/
|
716
|
+
export function getFiberRefs(__tsplusTrace) {
|
717
|
+
return withFiberRuntime_1(fiberState => succeed_1(() => fiberState.getFiberRefs(), __tsplusTrace), __tsplusTrace);
|
717
718
|
}
|
718
719
|
/**
|
719
720
|
* Extracts the optional value, or returns the given 'orElse'.
|
@@ -722,7 +723,7 @@ export function get(ma, __tsplusTrace) {
|
|
722
723
|
*/
|
723
724
|
export function getOrElse(orElse, __tsplusTrace) {
|
724
725
|
return ma => {
|
725
|
-
return map_1(ma =>
|
726
|
+
return map_1(ma => tsplus_module_5.getOrElse(orElse)(ma), __tsplusTrace)(ma);
|
726
727
|
};
|
727
728
|
}
|
728
729
|
/**
|
@@ -732,17 +733,9 @@ export function getOrElse(orElse, __tsplusTrace) {
|
|
732
733
|
*/
|
733
734
|
export function getOrElseIO(orElse, __tsplusTrace) {
|
734
735
|
return ma => {
|
735
|
-
return flatMap_1(mab =>
|
736
|
+
return flatMap_1(mab => tsplus_module_5.getOrElse(orElse)(tsplus_module_5.map(succeedNow_1)(mab)), __tsplusTrace)(ma);
|
736
737
|
};
|
737
738
|
}
|
738
|
-
/**
|
739
|
-
* Lifts a Maybe into an IO. If the option is `Nothing`, fail with `onNothing`.
|
740
|
-
*
|
741
|
-
* @tsplus static fncts.io.IOOps getOrFailWith
|
742
|
-
*/
|
743
|
-
function getOrFailWith_1(maybe, onNothing, __tsplusTrace) {
|
744
|
-
return defer_1(() => tsplus_module_16.match(() => fail_1(onNothing, __tsplusTrace), succeedNow_1)(maybe), __tsplusTrace);
|
745
|
-
}
|
746
739
|
/**
|
747
740
|
* Lifts a Maybe into a IO, if the Maybe is `Nothing` it fails with Unit.
|
748
741
|
*
|
@@ -752,10 +745,12 @@ export function getOrFailUnit(option, __tsplusTrace) {
|
|
752
745
|
return getOrFailWith_1(option, () => undefined, __tsplusTrace);
|
753
746
|
}
|
754
747
|
/**
|
755
|
-
*
|
748
|
+
* Lifts a Maybe into an IO. If the option is `Nothing`, fail with `onNothing`.
|
749
|
+
*
|
750
|
+
* @tsplus static fncts.io.IOOps getOrFailWith
|
756
751
|
*/
|
757
|
-
|
758
|
-
return
|
752
|
+
function getOrFailWith_1(maybe, onNothing, __tsplusTrace) {
|
753
|
+
return defer_1(() => tsplus_module_17.match(() => fail_1(onNothing, __tsplusTrace), succeedNow_1)(maybe), __tsplusTrace);
|
759
754
|
}
|
760
755
|
/**
|
761
756
|
* Creates an `IO` that halts with the specified lazily-evaluated defect.
|
@@ -765,7 +760,7 @@ export function getFiberRefs(__tsplusTrace) {
|
|
765
760
|
* @tsplus static fncts.io.IOOps halt
|
766
761
|
*/
|
767
762
|
export function halt(e, __tsplusTrace) {
|
768
|
-
return failCause_1(() =>
|
763
|
+
return failCause_1(() => tsplus_module_1.halt(e(), tsplus_module_19.none), __tsplusTrace);
|
769
764
|
}
|
770
765
|
/**
|
771
766
|
* Creates an `IO` that halts with the specified defect
|
@@ -775,7 +770,7 @@ export function halt(e, __tsplusTrace) {
|
|
775
770
|
* @tsplus static fncts.io.IOOps haltNow
|
776
771
|
*/
|
777
772
|
function haltNow_1(e, __tsplusTrace) {
|
778
|
-
return failCauseNow_1(
|
773
|
+
return failCauseNow_1(tsplus_module_1.halt(e, tsplus_module_19.none), __tsplusTrace);
|
779
774
|
}
|
780
775
|
/**
|
781
776
|
* @tsplus pipeable fncts.io.IO ifIO
|
@@ -786,32 +781,26 @@ function ifIO_1(onFalse, onTrue, __tsplusTrace) {
|
|
786
781
|
};
|
787
782
|
}
|
788
783
|
/**
|
789
|
-
* @tsplus
|
784
|
+
* @tsplus getter fncts.io.IO ignore
|
790
785
|
*/
|
791
|
-
export function
|
792
|
-
return
|
793
|
-
}
|
794
|
-
/**
|
795
|
-
* @tsplus getter fncts.io.IO ignore
|
796
|
-
*/
|
797
|
-
export function ignore(fa, __tsplusTrace) {
|
798
|
-
return match_1(() => undefined, () => undefined, __tsplusTrace)(fa);
|
786
|
+
export function ignore(self, __tsplusTrace) {
|
787
|
+
return match_1(() => undefined, () => undefined, __tsplusTrace)(self);
|
799
788
|
}
|
800
789
|
/**
|
801
790
|
* Folds a `IO` to a boolean describing whether or not it is a failure
|
802
791
|
*
|
803
792
|
* @tsplus getter fncts.io.IO isFailure
|
804
793
|
*/
|
805
|
-
export function isFailure(
|
806
|
-
return match_1(() => true, () => false, __tsplusTrace)(
|
794
|
+
export function isFailure(self, __tsplusTrace) {
|
795
|
+
return match_1(() => true, () => false, __tsplusTrace)(self);
|
807
796
|
}
|
808
797
|
/**
|
809
798
|
* Folds a `IO` to a boolean describing whether or not it is a success
|
810
799
|
*
|
811
800
|
* @tsplus getter fncts.io.IO isSuccess
|
812
801
|
*/
|
813
|
-
export function isSuccess(
|
814
|
-
return match_1(() => false, () => true, __tsplusTrace)(
|
802
|
+
export function isSuccess(self, __tsplusTrace) {
|
803
|
+
return match_1(() => false, () => true, __tsplusTrace)(self);
|
815
804
|
}
|
816
805
|
/**
|
817
806
|
* Iterates with the specified effectual function. The moral equivalent of:
|
@@ -831,6 +820,12 @@ export function isSuccess(ma, __tsplusTrace) {
|
|
831
820
|
function iterate_1(initial, cont, body, __tsplusTrace) {
|
832
821
|
return cont(initial) ? flatMap_1(a => iterate_1(a, cont, body, __tsplusTrace), __tsplusTrace)(body(initial)) : succeedNow_1(initial, __tsplusTrace);
|
833
822
|
}
|
823
|
+
/**
|
824
|
+
* @tsplus getter fncts.io.IO just
|
825
|
+
*/
|
826
|
+
export function just(self) {
|
827
|
+
return matchIO_1(e => fail_1(() => tsplus_module_2.just(e, fileName_1 + ":1034:24"), fileName_1 + ":1034:19"), a => tsplus_module_17.match(() => fail_1(() => tsplus_module_2.nothing(fileName_1 + ":1035:41"), fileName_1 + ":1035:33"), succeedNow_1)(a), fileName_1 + ":1033:22")(self);
|
828
|
+
}
|
834
829
|
/**
|
835
830
|
* Returns an IO with the value on the left part.
|
836
831
|
*
|
@@ -839,27 +834,15 @@ function iterate_1(initial, cont, body, __tsplusTrace) {
|
|
839
834
|
export function left(a, __tsplusTrace) {
|
840
835
|
return flatMap_1(a => succeedNow_1(tsplus_module_9.left(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(succeed_1(a, __tsplusTrace));
|
841
836
|
}
|
842
|
-
/**
|
843
|
-
* @tsplus getter fncts.io.IO just
|
844
|
-
*/
|
845
|
-
export function just(self) {
|
846
|
-
return matchIO_1(e => fail_1(() => tsplus_module_3.just(e, fileName_1 + ":1088:24"), fileName_1 + ":1088:19"), a => tsplus_module_16.match(() => fail_1(() => tsplus_module_3.nothing(fileName_1 + ":1089:41"), fileName_1 + ":1089:33"), succeedNow_1)(a), fileName_1 + ":1087:22")(self);
|
847
|
-
}
|
848
837
|
/**
|
849
838
|
* @tsplus static fncts.io.IOOps log
|
850
839
|
*/
|
851
840
|
function log_1(message, __tsplusTrace) {
|
852
841
|
return withFiberRuntime_1(fiber => {
|
853
|
-
fiber.log(message,
|
842
|
+
fiber.log(message, tsplus_module_1.empty(), tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace);
|
854
843
|
return unit_1;
|
855
844
|
}, __tsplusTrace);
|
856
845
|
}
|
857
|
-
/**
|
858
|
-
* @tsplus static fncts.io.IOOps show
|
859
|
-
*/
|
860
|
-
export function show(message, options, __tsplusTrace) {
|
861
|
-
return log_1(() => showWithOptions(message, options), __tsplusTrace);
|
862
|
-
}
|
863
846
|
/**
|
864
847
|
* Loops with the specified effectual function, collecting the results into a
|
865
848
|
* list. The moral equivalent of:
|
@@ -880,9 +863,9 @@ export function show(message, options, __tsplusTrace) {
|
|
880
863
|
*/
|
881
864
|
function loop_1(initial, cont, inc, body, __tsplusTrace) {
|
882
865
|
if (cont(initial)) {
|
883
|
-
return flatMap_1(a => map_1(as =>
|
866
|
+
return flatMap_1(a => map_1(as => tsplus_module_11.prepend(a)(as), __tsplusTrace)(loop_1(inc(initial), cont, inc, body, __tsplusTrace)), __tsplusTrace)(body(initial));
|
884
867
|
} else {
|
885
|
-
return succeedNow_1(
|
868
|
+
return succeedNow_1(tsplus_module_20.empty(), __tsplusTrace);
|
886
869
|
}
|
887
870
|
}
|
888
871
|
/**
|
@@ -913,8 +896,8 @@ export function loopUnit(initial, cont, inc, body, __tsplusTrace) {
|
|
913
896
|
* @tsplus pipeable fncts.io.IO map
|
914
897
|
*/
|
915
898
|
function map_1(f, __tsplusTrace) {
|
916
|
-
return
|
917
|
-
return flatMap_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(
|
899
|
+
return self => {
|
900
|
+
return flatMap_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(self);
|
918
901
|
};
|
919
902
|
}
|
920
903
|
/**
|
@@ -927,16 +910,10 @@ function map_1(f, __tsplusTrace) {
|
|
927
910
|
* @tsplus pipeable fncts.io.IO mapError
|
928
911
|
*/
|
929
912
|
function mapError_1(f, __tsplusTrace) {
|
930
|
-
return
|
931
|
-
return matchCauseIO_1(cause => failCauseNow_1(
|
913
|
+
return self => {
|
914
|
+
return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_1.map(f)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
|
932
915
|
};
|
933
916
|
}
|
934
|
-
/**
|
935
|
-
* @tsplus static fncts.io.IOOps mapTryCatch
|
936
|
-
*/
|
937
|
-
export function mapTryCatch(io, f, onThrow, __tsplusTrace) {
|
938
|
-
return flatMap_1(a => tryCatch_1(() => f(a), onThrow, __tsplusTrace), __tsplusTrace)(io);
|
939
|
-
}
|
940
917
|
/**
|
941
918
|
* Returns an IO with its full cause of failure mapped using
|
942
919
|
* the specified function. This can be used to transform errors
|
@@ -945,8 +922,29 @@ export function mapTryCatch(io, f, onThrow, __tsplusTrace) {
|
|
945
922
|
* @tsplus pipeable fncts.io.IO mapErrorCause
|
946
923
|
*/
|
947
924
|
function mapErrorCause_1(f, __tsplusTrace) {
|
948
|
-
return
|
949
|
-
return matchCauseIO_1(cause => failCauseNow_1(f(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(
|
925
|
+
return self => {
|
926
|
+
return matchCauseIO_1(cause => failCauseNow_1(f(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
|
927
|
+
};
|
928
|
+
}
|
929
|
+
/**
|
930
|
+
* @tsplus static fncts.io.IOOps mapTryCatch
|
931
|
+
* @tsplus pipeable fncts.io.IO mapTryCatch
|
932
|
+
*/
|
933
|
+
export function mapTryCatch(f, onThrow, __tsplusTrace) {
|
934
|
+
return self => {
|
935
|
+
return flatMap_1(a => tryCatch_1(() => f(a), onThrow, __tsplusTrace), __tsplusTrace)(self);
|
936
|
+
};
|
937
|
+
}
|
938
|
+
/**
|
939
|
+
* Folds over the failure value or the success value to yield an IO that
|
940
|
+
* does not fail, but succeeds with the value returned by the left or right
|
941
|
+
* function passed to `match_`.
|
942
|
+
*
|
943
|
+
* @tsplus pipeable fncts.io.IO match
|
944
|
+
*/
|
945
|
+
function match_1(onFailure, onSuccess, __tsplusTrace) {
|
946
|
+
return self => {
|
947
|
+
return matchIO_1(e => succeedNow_1(onFailure(e), __tsplusTrace), a => succeedNow_1(onSuccess(a), __tsplusTrace), __tsplusTrace)(self);
|
950
948
|
};
|
951
949
|
}
|
952
950
|
/**
|
@@ -979,19 +977,7 @@ function matchCauseIO_1(onFailure, onSuccess, __tsplusTrace) {
|
|
979
977
|
*/
|
980
978
|
function matchIO_1(onFailure, onSuccess, __tsplusTrace) {
|
981
979
|
return self => {
|
982
|
-
return matchCauseIO_1(cause => tsplus_module_4.match(onFailure, failCauseNow_1)(
|
983
|
-
};
|
984
|
-
}
|
985
|
-
/**
|
986
|
-
* Folds over the failure value or the success value to yield an IO that
|
987
|
-
* does not fail, but succeeds with the value returned by the left or right
|
988
|
-
* function passed to `match_`.
|
989
|
-
*
|
990
|
-
* @tsplus pipeable fncts.io.IO match
|
991
|
-
*/
|
992
|
-
function match_1(onFailure, onSuccess, __tsplusTrace) {
|
993
|
-
return self => {
|
994
|
-
return matchIO_1(e => succeedNow_1(onFailure(e), __tsplusTrace), a => succeedNow_1(onSuccess(a), __tsplusTrace), __tsplusTrace)(self);
|
980
|
+
return matchCauseIO_1(cause => tsplus_module_4.match(onFailure, failCauseNow_1)(tsplus_module_1.failureOrCause(cause)), onSuccess, __tsplusTrace)(self);
|
995
981
|
};
|
996
982
|
}
|
997
983
|
/**
|
@@ -1000,42 +986,109 @@ function match_1(onFailure, onSuccess, __tsplusTrace) {
|
|
1000
986
|
* @tsplus pipeable fncts.io.IO matchTraceIO
|
1001
987
|
*/
|
1002
988
|
export function matchTraceIO(onFailure, onSuccess, __tsplusTrace) {
|
1003
|
-
return
|
1004
|
-
return matchCauseIO_1(cause => tsplus_module_4.match(([e, trace]) => onFailure(e, trace), failCauseNow_1)(
|
989
|
+
return self => {
|
990
|
+
return matchCauseIO_1(cause => tsplus_module_4.match(([e, trace]) => onFailure(e, trace), failCauseNow_1)(tsplus_module_1.failureTraceOrCause(cause)), onSuccess, __tsplusTrace)(self);
|
1005
991
|
};
|
1006
992
|
}
|
1007
993
|
/**
|
1008
994
|
* @tsplus getter fncts.io.IO maybe
|
1009
995
|
*/
|
1010
|
-
export function maybe(
|
1011
|
-
return match_1(() =>
|
996
|
+
export function maybe(self, __tsplusTrace) {
|
997
|
+
return match_1(() => tsplus_module_2.nothing(__tsplusTrace), tsplus_module_2.just, __tsplusTrace)(self);
|
1012
998
|
}
|
1013
999
|
/**
|
1014
1000
|
* @tsplus getter fncts.io.IO merge
|
1015
1001
|
*/
|
1016
|
-
export function merge(
|
1017
|
-
return matchIO_1(succeedNow_1, succeedNow_1, __tsplusTrace)(
|
1002
|
+
export function merge(self, __tsplusTrace) {
|
1003
|
+
return matchIO_1(succeedNow_1, succeedNow_1, __tsplusTrace)(self);
|
1018
1004
|
}
|
1019
1005
|
/**
|
1020
1006
|
* Merges an `Iterable<IO>` to a single IO, working sequentially.
|
1021
1007
|
*
|
1022
1008
|
* @tsplus static fncts.io.IOOps mergeAll
|
1023
1009
|
*/
|
1024
|
-
export function mergeAll(
|
1025
|
-
return
|
1010
|
+
export function mergeAll(ios, b, f, __tsplusTrace) {
|
1011
|
+
return tsplus_module_12.foldLeft(succeed_1(() => b, __tsplusTrace), (b, a) => zipWith_1(a, f, __tsplusTrace)(b))(ios);
|
1012
|
+
}
|
1013
|
+
/**
|
1014
|
+
* @tsplus static fncts.io.IOOps refailCause
|
1015
|
+
*/
|
1016
|
+
function refailCause_1(cause, __tsplusTrace) {
|
1017
|
+
const io = new IOPrimitive(1 /* IOTag.Fail */);
|
1018
|
+
io.i0 = cause;
|
1019
|
+
io.trace = __tsplusTrace;
|
1020
|
+
return io;
|
1021
|
+
}
|
1022
|
+
/**
|
1023
|
+
* @tsplus static fncts.io.IOOps refailCauseNow
|
1024
|
+
*/
|
1025
|
+
export function refailCauseNow(cause, __tsplusTrace) {
|
1026
|
+
const io = new IOPrimitive(1 /* IOTag.Fail */);
|
1027
|
+
io.i0 = () => cause;
|
1028
|
+
io.trace = __tsplusTrace;
|
1029
|
+
return io;
|
1030
|
+
}
|
1031
|
+
/**
|
1032
|
+
* @tsplus static fncts.io.IOOps show
|
1033
|
+
*/
|
1034
|
+
export function show(message, options, __tsplusTrace) {
|
1035
|
+
return log_1(() => showWithOptions(message, options), __tsplusTrace);
|
1026
1036
|
}
|
1027
1037
|
/**
|
1028
1038
|
* @tsplus static fncts.io.IOOps nothing
|
1029
1039
|
*/
|
1030
|
-
const nothing_1 = /*#__PURE__*/succeedNow_1(/*#__PURE__*/
|
1040
|
+
const nothing_1 = /*#__PURE__*/succeedNow_1(/*#__PURE__*/tsplus_module_2.nothing(fileName_1 + ":1311:45"), fileName_1 + ":1311:37");
|
1031
1041
|
export const nothing = nothing_1;
|
1042
|
+
/**
|
1043
|
+
* Returns an `IO` that submerges an `Either` into the `IO`.
|
1044
|
+
*
|
1045
|
+
* @tsplus getter fncts.io.IO absolve
|
1046
|
+
*/
|
1047
|
+
export function absolve(self, __tsplusTrace) {
|
1048
|
+
return flatMap_1(ea => tsplus_module_4.match(failNow_1, succeedNow_1)(ea), __tsplusTrace)(self);
|
1049
|
+
}
|
1050
|
+
/**
|
1051
|
+
* @tsplus static fncts.io.IOOps attempt
|
1052
|
+
*/
|
1053
|
+
export function attempt(effect, __tsplusTrace) {
|
1054
|
+
return defer_1(() => {
|
1055
|
+
try {
|
1056
|
+
return tsplus_module_10.succeed(effect(), __tsplusTrace);
|
1057
|
+
} catch (u) {
|
1058
|
+
return withFiberRuntime_1(fiberState => {
|
1059
|
+
if (!fiberState.isFatal(u)) {
|
1060
|
+
throw new IOError(tsplus_module_1.fail(u));
|
1061
|
+
} else {
|
1062
|
+
throw u;
|
1063
|
+
}
|
1064
|
+
}, __tsplusTrace);
|
1065
|
+
}
|
1066
|
+
}, __tsplusTrace);
|
1067
|
+
}
|
1068
|
+
/**
|
1069
|
+
* Exposes all parallel errors in a single call
|
1070
|
+
*
|
1071
|
+
* @tsplus pipeable fncts.io.IO concurrentErrors
|
1072
|
+
*/
|
1073
|
+
export function concurrentErrors(__tsplusTrace) {
|
1074
|
+
return self => {
|
1075
|
+
return matchCauseIO_1(cause => {
|
1076
|
+
const f = tsplus_module_1.failures(cause);
|
1077
|
+
if (tsplus_module_21.length(f) === 0) {
|
1078
|
+
return failCauseNow_1(cause, __tsplusTrace);
|
1079
|
+
} else {
|
1080
|
+
return failNow_1(f, __tsplusTrace);
|
1081
|
+
}
|
1082
|
+
}, succeedNow_1, __tsplusTrace)(self);
|
1083
|
+
};
|
1084
|
+
}
|
1032
1085
|
/**
|
1033
1086
|
* Converts an option on errors into an option on values.
|
1034
1087
|
*
|
1035
1088
|
* @tsplus getter fncts.io.IO optional
|
1036
1089
|
*/
|
1037
|
-
export function optional(
|
1038
|
-
return matchIO_1(me =>
|
1090
|
+
export function optional(self, __tsplusTrace) {
|
1091
|
+
return matchIO_1(me => tsplus_module_17.match(() => succeedNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), failNow_1)(me), a => succeedNow_1(tsplus_module_2.just(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
|
1039
1092
|
}
|
1040
1093
|
/**
|
1041
1094
|
* Returns the logical disjunction of the `Boolean` value returned by this
|
@@ -1046,17 +1099,17 @@ export function optional(ma, __tsplusTrace) {
|
|
1046
1099
|
* @tsplus pipeable fncts.io.IO or
|
1047
1100
|
* @tsplus pipeable-operator fncts.io.IO ||
|
1048
1101
|
*/
|
1049
|
-
export function or(
|
1050
|
-
return
|
1051
|
-
return flatMap_1(b => b ? succeedNow_1(true, __tsplusTrace) :
|
1102
|
+
export function or(or, __tsplusTrace) {
|
1103
|
+
return self => {
|
1104
|
+
return flatMap_1(b => b ? succeedNow_1(true, __tsplusTrace) : or, __tsplusTrace)(self);
|
1052
1105
|
};
|
1053
1106
|
}
|
1054
1107
|
/**
|
1055
1108
|
* @tsplus pipeable fncts.io.IO orElse
|
1056
1109
|
*/
|
1057
1110
|
function orElse_1(that, __tsplusTrace) {
|
1058
|
-
return
|
1059
|
-
return tryOrElse_1(that, succeedNow_1, __tsplusTrace)(
|
1111
|
+
return self => {
|
1112
|
+
return tryOrElse_1(that, succeedNow_1, __tsplusTrace)(self);
|
1060
1113
|
};
|
1061
1114
|
}
|
1062
1115
|
/**
|
@@ -1071,61 +1124,44 @@ export function orElseEither(that, __tsplusTrace) {
|
|
1071
1124
|
* @tsplus pipeable fncts.io.IO orElseFail
|
1072
1125
|
*/
|
1073
1126
|
export function orElseFail(e, __tsplusTrace) {
|
1074
|
-
return
|
1075
|
-
return orElse_1(() => fail_1(e, __tsplusTrace), __tsplusTrace)(
|
1127
|
+
return self => {
|
1128
|
+
return orElse_1(() => fail_1(e, __tsplusTrace), __tsplusTrace)(self);
|
1076
1129
|
};
|
1077
1130
|
}
|
1078
1131
|
/**
|
1079
1132
|
* @tsplus pipeable fncts.io.IO orElseMaybe
|
1080
1133
|
*/
|
1081
1134
|
export function orElseMaybe(that, __tsplusTrace) {
|
1082
|
-
return
|
1083
|
-
return catchAll_1(me =>
|
1135
|
+
return self => {
|
1136
|
+
return catchAll_1(me => tsplus_module_17.match(that, e => fail_1(() => tsplus_module_2.just(e, __tsplusTrace), __tsplusTrace))(me), __tsplusTrace)(self);
|
1084
1137
|
};
|
1085
1138
|
}
|
1086
1139
|
/**
|
1087
1140
|
* @tsplus pipeable fncts.io.IO orElseSucceed
|
1088
1141
|
*/
|
1089
1142
|
export function orElseSucceed(a, __tsplusTrace) {
|
1090
|
-
return
|
1091
|
-
return orElse_1(() => succeed_1(a, __tsplusTrace), __tsplusTrace)(
|
1143
|
+
return self => {
|
1144
|
+
return orElse_1(() => succeed_1(a, __tsplusTrace), __tsplusTrace)(self);
|
1092
1145
|
};
|
1093
1146
|
}
|
1094
1147
|
/**
|
1095
1148
|
* @tsplus getter fncts.io.IO orHalt
|
1096
1149
|
*/
|
1097
|
-
export function orHalt(
|
1098
|
-
return orHaltWith_1(identity, __tsplusTrace)(
|
1150
|
+
export function orHalt(self, __tsplusTrace) {
|
1151
|
+
return orHaltWith_1(identity, __tsplusTrace)(self);
|
1099
1152
|
}
|
1100
1153
|
/**
|
1101
1154
|
* @tsplus getter fncts.io.IO orHaltKeep
|
1102
1155
|
*/
|
1103
|
-
export function orHaltKeep(
|
1104
|
-
return matchCauseIO_1(cause => failCauseNow_1(
|
1156
|
+
export function orHaltKeep(self, __tsplusTrace) {
|
1157
|
+
return matchCauseIO_1(cause => failCauseNow_1(tsplus_module_1.flatMap(tsplus_module_1.halt)(cause), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
|
1105
1158
|
}
|
1106
1159
|
/**
|
1107
1160
|
* @tsplus pipeable fncts.io.IO orHaltWith
|
1108
1161
|
*/
|
1109
1162
|
function orHaltWith_1(f, __tsplusTrace) {
|
1110
|
-
return
|
1111
|
-
return matchIO_1(e => haltNow_1(f(e), __tsplusTrace), succeedNow_1, __tsplusTrace)(
|
1112
|
-
};
|
1113
|
-
}
|
1114
|
-
/**
|
1115
|
-
* Exposes all parallel errors in a single call
|
1116
|
-
*
|
1117
|
-
* @tsplus pipeable fncts.io.IO concurrentErrors
|
1118
|
-
*/
|
1119
|
-
export function concurrentErrors(__tsplusTrace) {
|
1120
|
-
return io => {
|
1121
|
-
return matchCauseIO_1(cause => {
|
1122
|
-
const f = tsplus_module_2.failures(cause);
|
1123
|
-
if (tsplus_module_20.length(f) === 0) {
|
1124
|
-
return failCauseNow_1(cause, __tsplusTrace);
|
1125
|
-
} else {
|
1126
|
-
return failNow_1(f, __tsplusTrace);
|
1127
|
-
}
|
1128
|
-
}, succeedNow_1, __tsplusTrace)(io);
|
1163
|
+
return self => {
|
1164
|
+
return matchIO_1(e => haltNow_1(f(e), __tsplusTrace), succeedNow_1, __tsplusTrace)(self);
|
1129
1165
|
};
|
1130
1166
|
}
|
1131
1167
|
/**
|
@@ -1135,7 +1171,7 @@ export function concurrentErrors(__tsplusTrace) {
|
|
1135
1171
|
* @tsplus static fncts.io.IOOps partition
|
1136
1172
|
*/
|
1137
1173
|
export function partition(as, f, __tsplusTrace) {
|
1138
|
-
return map_1(c =>
|
1174
|
+
return map_1(c => tsplus_module_11.separate(c), __tsplusTrace)(foreach_1(as, a => either_1(f(a), __tsplusTrace), __tsplusTrace));
|
1139
1175
|
}
|
1140
1176
|
/**
|
1141
1177
|
* Keeps some of the errors, and terminates the fiber with the rest
|
@@ -1143,8 +1179,8 @@ export function partition(as, f, __tsplusTrace) {
|
|
1143
1179
|
* @tsplus pipeable fncts.io.IO refineOrHalt
|
1144
1180
|
*/
|
1145
1181
|
export function refineOrHalt(pf, __tsplusTrace) {
|
1146
|
-
return
|
1147
|
-
return refineOrHaltWith_1(pf, identity, __tsplusTrace)(
|
1182
|
+
return self => {
|
1183
|
+
return refineOrHaltWith_1(pf, identity, __tsplusTrace)(self);
|
1148
1184
|
};
|
1149
1185
|
}
|
1150
1186
|
/**
|
@@ -1154,8 +1190,8 @@ export function refineOrHalt(pf, __tsplusTrace) {
|
|
1154
1190
|
* @tsplus pipeable fncts.io.IO refineOrHaltWith
|
1155
1191
|
*/
|
1156
1192
|
function refineOrHaltWith_1(pf, f, __tsplusTrace) {
|
1157
|
-
return
|
1158
|
-
return catchAll_1(e =>
|
1193
|
+
return self => {
|
1194
|
+
return catchAll_1(e => tsplus_module_17.match(() => haltNow_1(f(e), __tsplusTrace), failNow_1)(pf(e)), __tsplusTrace)(self);
|
1159
1195
|
};
|
1160
1196
|
}
|
1161
1197
|
/**
|
@@ -1165,8 +1201,8 @@ function refineOrHaltWith_1(pf, f, __tsplusTrace) {
|
|
1165
1201
|
* @tsplus pipeable fncts.io.IO reject
|
1166
1202
|
*/
|
1167
1203
|
export function reject(pf, __tsplusTrace) {
|
1168
|
-
return
|
1169
|
-
return rejectIO_1(a =>
|
1204
|
+
return self => {
|
1205
|
+
return rejectIO_1(a => tsplus_module_5.map(failNow_1)(pf(a)), __tsplusTrace)(self);
|
1170
1206
|
};
|
1171
1207
|
}
|
1172
1208
|
/**
|
@@ -1177,8 +1213,8 @@ export function reject(pf, __tsplusTrace) {
|
|
1177
1213
|
* @tsplus pipeable fncts.io.IO rejectIO
|
1178
1214
|
*/
|
1179
1215
|
function rejectIO_1(pf, __tsplusTrace) {
|
1180
|
-
return
|
1181
|
-
return flatMap_1(a =>
|
1216
|
+
return self => {
|
1217
|
+
return flatMap_1(a => tsplus_module_17.match(() => succeedNow_1(a, __tsplusTrace), io => flatMap_1(failNow_1, __tsplusTrace)(io))(pf(a)), __tsplusTrace)(self);
|
1182
1218
|
};
|
1183
1219
|
}
|
1184
1220
|
/**
|
@@ -1186,9 +1222,18 @@ function rejectIO_1(pf, __tsplusTrace) {
|
|
1186
1222
|
*
|
1187
1223
|
* @tsplus pipeable fncts.io.IO repeatN
|
1188
1224
|
*/
|
1189
|
-
function
|
1190
|
-
return
|
1191
|
-
return flatMap_1(a =>
|
1225
|
+
export function repeatN_(n, __tsplusTrace) {
|
1226
|
+
return self => {
|
1227
|
+
return flatMap_1(a => {
|
1228
|
+
let i = n;
|
1229
|
+
let s = a;
|
1230
|
+
return as_1(() => s, __tsplusTrace)(whileLoop_1(() => i > 0, () => {
|
1231
|
+
i -= 1;
|
1232
|
+
return self;
|
1233
|
+
}, a => {
|
1234
|
+
s = a;
|
1235
|
+
}));
|
1236
|
+
}, __tsplusTrace)(self);
|
1192
1237
|
};
|
1193
1238
|
}
|
1194
1239
|
/**
|
@@ -1197,8 +1242,8 @@ function repeatN_1(n, __tsplusTrace) {
|
|
1197
1242
|
* @tsplus pipeable fncts.io.IO repeatUntil
|
1198
1243
|
*/
|
1199
1244
|
export function repeatUntil(f, __tsplusTrace) {
|
1200
|
-
return
|
1201
|
-
return repeatUntilIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(
|
1245
|
+
return self => {
|
1246
|
+
return repeatUntilIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(self);
|
1202
1247
|
};
|
1203
1248
|
}
|
1204
1249
|
/**
|
@@ -1207,8 +1252,8 @@ export function repeatUntil(f, __tsplusTrace) {
|
|
1207
1252
|
* @tsplus pipeable fncts.io.IO repeatUntilIO
|
1208
1253
|
*/
|
1209
1254
|
function repeatUntilIO_1(f, __tsplusTrace) {
|
1210
|
-
return
|
1211
|
-
return flatMap_1(a => flatMap_1(b => b ? succeed_1(() => a, __tsplusTrace) : repeatUntilIO_1(f, __tsplusTrace)(
|
1255
|
+
return self => {
|
1256
|
+
return flatMap_1(a => flatMap_1(b => b ? succeed_1(() => a, __tsplusTrace) : repeatUntilIO_1(f, __tsplusTrace)(self), __tsplusTrace)(f(a)), __tsplusTrace)(self);
|
1212
1257
|
};
|
1213
1258
|
}
|
1214
1259
|
/**
|
@@ -1217,8 +1262,8 @@ function repeatUntilIO_1(f, __tsplusTrace) {
|
|
1217
1262
|
* @tsplus pipeable fncts.io.IO repeatWhile
|
1218
1263
|
*/
|
1219
1264
|
export function repeatWhile(f, __tsplusTrace) {
|
1220
|
-
return
|
1221
|
-
return repeatWhileIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(
|
1265
|
+
return self => {
|
1266
|
+
return repeatWhileIO_1(a => succeedNow_1(f(a), __tsplusTrace), __tsplusTrace)(self);
|
1222
1267
|
};
|
1223
1268
|
}
|
1224
1269
|
/**
|
@@ -1227,8 +1272,8 @@ export function repeatWhile(f, __tsplusTrace) {
|
|
1227
1272
|
* @tsplus pipeable fncts.io.IO repeatWhileIO
|
1228
1273
|
*/
|
1229
1274
|
function repeatWhileIO_1(f, __tsplusTrace) {
|
1230
|
-
return
|
1231
|
-
return flatMap_1(a => flatMap_1(b => b ? repeatWhileIO_1(f, __tsplusTrace)(
|
1275
|
+
return self => {
|
1276
|
+
return flatMap_1(a => flatMap_1(b => b ? repeatWhileIO_1(f, __tsplusTrace)(self) : succeed_1(() => a, __tsplusTrace), __tsplusTrace)(f(a)), __tsplusTrace)(self);
|
1232
1277
|
};
|
1233
1278
|
}
|
1234
1279
|
/**
|
@@ -1236,15 +1281,15 @@ function repeatWhileIO_1(f, __tsplusTrace) {
|
|
1236
1281
|
*/
|
1237
1282
|
export function replicate(n, __tsplusTrace) {
|
1238
1283
|
return self => {
|
1239
|
-
return tsplus_module_22.map(() => self)
|
1284
|
+
return tsplus_module_22.range(0, n).map(() => self);
|
1240
1285
|
};
|
1241
1286
|
}
|
1242
1287
|
/**
|
1243
1288
|
* @tsplus pipeable fncts.io.IO require
|
1244
1289
|
*/
|
1245
1290
|
export function require(error, __tsplusTrace) {
|
1246
|
-
return
|
1247
|
-
return flatMap_1(ma =>
|
1291
|
+
return self => {
|
1292
|
+
return flatMap_1(ma => tsplus_module_17.match(() => fail_1(error, __tsplusTrace), succeedNow_1)(ma), __tsplusTrace)(self);
|
1248
1293
|
};
|
1249
1294
|
}
|
1250
1295
|
/**
|
@@ -1253,16 +1298,16 @@ export function require(error, __tsplusTrace) {
|
|
1253
1298
|
*
|
1254
1299
|
* @tsplus getter fncts.io.IO result
|
1255
1300
|
*/
|
1256
|
-
export function result(
|
1257
|
-
return matchCauseIO_1(cause => succeedNow_1(
|
1301
|
+
export function result(self, __tsplusTrace) {
|
1302
|
+
return matchCauseIO_1(cause => succeedNow_1(tsplus_module_10.failCause(cause, __tsplusTrace), __tsplusTrace), a => succeedNow_1(tsplus_module_10.succeed(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
|
1258
1303
|
}
|
1259
1304
|
/**
|
1260
1305
|
* Recover from the unchecked failure of the `IO`. (opposite of `orHalt`)
|
1261
1306
|
*
|
1262
1307
|
* @tsplus getter fncts.io.IO resurrect
|
1263
1308
|
*/
|
1264
|
-
export function resurrect(
|
1265
|
-
return unrefineWith_1(
|
1309
|
+
export function resurrect(self, __tsplusTrace) {
|
1310
|
+
return unrefineWith_1(tsplus_module_2.just, identity, __tsplusTrace)(self);
|
1266
1311
|
}
|
1267
1312
|
/**
|
1268
1313
|
* Retries this effect until its error satisfies the specified predicate.
|
@@ -1270,8 +1315,8 @@ export function resurrect(io, __tsplusTrace) {
|
|
1270
1315
|
* @tsplus pipeable fncts.io.IO retryUntil
|
1271
1316
|
*/
|
1272
1317
|
export function retryUntil(f, __tsplusTrace) {
|
1273
|
-
return
|
1274
|
-
return retryUntilIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(
|
1318
|
+
return self => {
|
1319
|
+
return retryUntilIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(self);
|
1275
1320
|
};
|
1276
1321
|
}
|
1277
1322
|
/**
|
@@ -1280,8 +1325,8 @@ export function retryUntil(f, __tsplusTrace) {
|
|
1280
1325
|
* @tsplus pipeable fncts.io.IO retryUntilIO
|
1281
1326
|
*/
|
1282
1327
|
function retryUntilIO_1(f, __tsplusTrace) {
|
1283
|
-
return
|
1284
|
-
return catchAll_1(e => flatMap_1(b => b ? failNow_1(e, __tsplusTrace) : retryUntilIO_1(f, __tsplusTrace)(
|
1328
|
+
return self => {
|
1329
|
+
return catchAll_1(e => flatMap_1(b => b ? failNow_1(e, __tsplusTrace) : retryUntilIO_1(f, __tsplusTrace)(self), __tsplusTrace)(f(e)), __tsplusTrace)(self);
|
1285
1330
|
};
|
1286
1331
|
}
|
1287
1332
|
/**
|
@@ -1290,8 +1335,8 @@ function retryUntilIO_1(f, __tsplusTrace) {
|
|
1290
1335
|
* @tsplus pipeable fncts.io.IO retryWhile
|
1291
1336
|
*/
|
1292
1337
|
export function retryWhile(f, __tsplusTrace) {
|
1293
|
-
return
|
1294
|
-
return retryWhileIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(
|
1338
|
+
return self => {
|
1339
|
+
return retryWhileIO_1(e => succeedNow_1(f(e), __tsplusTrace), __tsplusTrace)(self);
|
1295
1340
|
};
|
1296
1341
|
}
|
1297
1342
|
/**
|
@@ -1300,8 +1345,8 @@ export function retryWhile(f, __tsplusTrace) {
|
|
1300
1345
|
* @tsplus pipeable fncts.io.IO retryWhileIO
|
1301
1346
|
*/
|
1302
1347
|
function retryWhileIO_1(f, __tsplusTrace) {
|
1303
|
-
return
|
1304
|
-
return catchAll_1(e => flatMap_1(b => b ? retryWhileIO_1(f, __tsplusTrace)(
|
1348
|
+
return self => {
|
1349
|
+
return catchAll_1(e => flatMap_1(b => b ? retryWhileIO_1(f, __tsplusTrace)(self) : fail_1(() => e, __tsplusTrace), __tsplusTrace)(f(e)), __tsplusTrace)(self);
|
1305
1350
|
};
|
1306
1351
|
}
|
1307
1352
|
/**
|
@@ -1309,15 +1354,15 @@ function retryWhileIO_1(f, __tsplusTrace) {
|
|
1309
1354
|
*
|
1310
1355
|
* @tsplus getter fncts.io.IO sandbox
|
1311
1356
|
*/
|
1312
|
-
function sandbox_1(
|
1313
|
-
return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(
|
1357
|
+
function sandbox_1(self, __tsplusTrace) {
|
1358
|
+
return matchCauseIO_1(failNow_1, succeedNow_1, __tsplusTrace)(self);
|
1314
1359
|
}
|
1315
1360
|
/**
|
1316
1361
|
* @tsplus pipeable fncts.io.IO sandboxWith
|
1317
1362
|
*/
|
1318
1363
|
export function sandboxWith(f, __tsplusTrace) {
|
1319
|
-
return
|
1320
|
-
return unsandbox_1(f(sandbox_1(
|
1364
|
+
return self => {
|
1365
|
+
return unsandbox_1(f(sandbox_1(self, __tsplusTrace)), __tsplusTrace);
|
1321
1366
|
};
|
1322
1367
|
}
|
1323
1368
|
/**
|
@@ -1332,17 +1377,6 @@ export function sequenceIterable(as, __tsplusTrace) {
|
|
1332
1377
|
export function sequenceIterableDiscard(as, __tsplusTrace) {
|
1333
1378
|
return foreachDiscard_1(as, identity, __tsplusTrace);
|
1334
1379
|
}
|
1335
|
-
/**
|
1336
|
-
* Creates a `IO` that has succeeded with a pure value
|
1337
|
-
*
|
1338
|
-
* @tsplus static fncts.io.IOOps succeedNow
|
1339
|
-
*/
|
1340
|
-
function succeedNow_1(value, __tsplusTrace) {
|
1341
|
-
const io = new IOPrimitive(0 /* IOTag.SucceedNow */);
|
1342
|
-
io.i0 = value;
|
1343
|
-
io.trace = __tsplusTrace;
|
1344
|
-
return io;
|
1345
|
-
}
|
1346
1380
|
/**
|
1347
1381
|
* Imports a total synchronous effect into a pure `IO` value.
|
1348
1382
|
* The effect must not throw any exceptions. If you wonder if the effect
|
@@ -1357,6 +1391,17 @@ function succeed_1(effect, __tsplusTrace) {
|
|
1357
1391
|
io.trace = __tsplusTrace;
|
1358
1392
|
return io;
|
1359
1393
|
}
|
1394
|
+
/**
|
1395
|
+
* Creates a `IO` that has succeeded with a pure value
|
1396
|
+
*
|
1397
|
+
* @tsplus static fncts.io.IOOps succeedNow
|
1398
|
+
*/
|
1399
|
+
function succeedNow_1(value, __tsplusTrace) {
|
1400
|
+
const io = new IOPrimitive(0 /* IOTag.SucceedNow */);
|
1401
|
+
io.i0 = value;
|
1402
|
+
io.trace = __tsplusTrace;
|
1403
|
+
return io;
|
1404
|
+
}
|
1360
1405
|
/**
|
1361
1406
|
* @tsplus pipeable fncts.io.IO summarized
|
1362
1407
|
*/
|
@@ -1375,8 +1420,8 @@ function summarized_1(summary, f, __tsplusTrace) {
|
|
1375
1420
|
*
|
1376
1421
|
* @tsplus getter fncts.io.IO swap
|
1377
1422
|
*/
|
1378
|
-
function swap_1(
|
1379
|
-
return matchIO_1(succeedNow_1, failNow_1, __tsplusTrace)(
|
1423
|
+
function swap_1(self, __tsplusTrace) {
|
1424
|
+
return matchIO_1(succeedNow_1, failNow_1, __tsplusTrace)(self);
|
1380
1425
|
}
|
1381
1426
|
/**
|
1382
1427
|
* Swaps the error/value parameters, applies the function `f` and flips the parameters back
|
@@ -1384,61 +1429,7 @@ function swap_1(pab, __tsplusTrace) {
|
|
1384
1429
|
* @tsplus pipeable fncts.io.IO swapWith
|
1385
1430
|
*/
|
1386
1431
|
function swapWith_1(f, __tsplusTrace) {
|
1387
|
-
return
|
1388
|
-
}
|
1389
|
-
/**
|
1390
|
-
* A more powerful variation of `timed` that allows specifying the clock.
|
1391
|
-
*
|
1392
|
-
* @tsplus pipeable fncts.io.IO timedWith
|
1393
|
-
*/
|
1394
|
-
export function timedWith(msTime, __tsplusTrace) {
|
1395
|
-
return ma => summarized_1(msTime, (start, end) => end - start, __tsplusTrace)(ma);
|
1396
|
-
}
|
1397
|
-
/**
|
1398
|
-
* @tsplus static fncts.io.IOOps attempt
|
1399
|
-
*/
|
1400
|
-
export function attempt(effect, __tsplusTrace) {
|
1401
|
-
return defer_1(() => {
|
1402
|
-
try {
|
1403
|
-
return tsplus_module_23.succeed(effect(), __tsplusTrace);
|
1404
|
-
} catch (u) {
|
1405
|
-
return withFiberRuntime_1(fiberState => {
|
1406
|
-
if (!fiberState.isFatal(u)) {
|
1407
|
-
throw new IOError(tsplus_module_2.fail(u));
|
1408
|
-
} else {
|
1409
|
-
throw u;
|
1410
|
-
}
|
1411
|
-
}, __tsplusTrace);
|
1412
|
-
}
|
1413
|
-
}, __tsplusTrace);
|
1414
|
-
}
|
1415
|
-
/**
|
1416
|
-
* Creates a `IO` that has succeeded with a pure value
|
1417
|
-
*
|
1418
|
-
* @tsplus static fncts.io.IOOps tryCatch
|
1419
|
-
*/
|
1420
|
-
function tryCatch_1(effect, onThrow, __tsplusTrace) {
|
1421
|
-
return defer_1(() => {
|
1422
|
-
try {
|
1423
|
-
return tsplus_module_23.succeed(effect(), __tsplusTrace);
|
1424
|
-
} catch (u) {
|
1425
|
-
return withFiberRuntime_1(fiberState => {
|
1426
|
-
if (!fiberState.isFatal(u)) {
|
1427
|
-
throw new IOError(tsplus_module_2.fail(onThrow(u)));
|
1428
|
-
} else {
|
1429
|
-
throw u;
|
1430
|
-
}
|
1431
|
-
}, __tsplusTrace);
|
1432
|
-
}
|
1433
|
-
}, __tsplusTrace);
|
1434
|
-
}
|
1435
|
-
/**
|
1436
|
-
* Returns an `IO` that submerges an `Either` into the `IO`.
|
1437
|
-
*
|
1438
|
-
* @tsplus getter fncts.io.IO absolve
|
1439
|
-
*/
|
1440
|
-
export function absolve(ma, __tsplusTrace) {
|
1441
|
-
return flatMap_1(ea => tsplus_module_4.match(failNow_1, succeedNow_1)(ea), __tsplusTrace)(ma);
|
1432
|
+
return self => swap_1(f(swap_1(self, __tsplusTrace)), __tsplusTrace);
|
1442
1433
|
}
|
1443
1434
|
/**
|
1444
1435
|
* Composes computations in sequence, using the return value of one computation as input for the next
|
@@ -1460,8 +1451,8 @@ export function tap(f, __tsplusTrace) {
|
|
1460
1451
|
* @tsplus pipeable fncts.io.IO tapCause
|
1461
1452
|
*/
|
1462
1453
|
export function tapCause(f, __tsplusTrace) {
|
1463
|
-
return
|
1464
|
-
return matchCauseIO_1(c => flatMap_1(() => failCauseNow_1(c, __tsplusTrace), __tsplusTrace)(f(c)), succeedNow_1, __tsplusTrace)(
|
1454
|
+
return self => {
|
1455
|
+
return matchCauseIO_1(c => flatMap_1(() => failCauseNow_1(c, __tsplusTrace), __tsplusTrace)(f(c)), succeedNow_1, __tsplusTrace)(self);
|
1465
1456
|
};
|
1466
1457
|
}
|
1467
1458
|
/**
|
@@ -1470,7 +1461,7 @@ export function tapCause(f, __tsplusTrace) {
|
|
1470
1461
|
* @tsplus pipeable fncts.io.IO tapError
|
1471
1462
|
*/
|
1472
1463
|
export function tapError(f, __tsplusTrace) {
|
1473
|
-
return self => matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(f(e)), _ => failCauseNow_1(cause, __tsplusTrace))(
|
1464
|
+
return self => matchCauseIO_1(cause => tsplus_module_4.match(e => flatMap_1(() => failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(f(e)), _ => failCauseNow_1(cause, __tsplusTrace))(tsplus_module_1.failureOrCause(cause)), succeedNow_1, __tsplusTrace)(self);
|
1474
1465
|
}
|
1475
1466
|
/**
|
1476
1467
|
* Returns an effect that effectually "peeks" at the cause of the failure of
|
@@ -1483,18 +1474,46 @@ export function tapErrorCause(f, __tsplusTrace) {
|
|
1483
1474
|
return matchCauseIO_1(cause => zipRight_1(failCauseNow_1(cause, __tsplusTrace), __tsplusTrace)(f(cause)), succeedNow_1, __tsplusTrace)(self);
|
1484
1475
|
};
|
1485
1476
|
}
|
1477
|
+
/**
|
1478
|
+
* A more powerful variation of `timed` that allows specifying the clock.
|
1479
|
+
*
|
1480
|
+
* @tsplus pipeable fncts.io.IO timedWith
|
1481
|
+
*/
|
1482
|
+
export function timedWith(msTime, __tsplusTrace) {
|
1483
|
+
return self => summarized_1(msTime, (start, end) => end - start, __tsplusTrace)(self);
|
1484
|
+
}
|
1485
|
+
/**
|
1486
|
+
* Creates a `IO` that has succeeded with a pure value
|
1487
|
+
*
|
1488
|
+
* @tsplus static fncts.io.IOOps tryCatch
|
1489
|
+
*/
|
1490
|
+
function tryCatch_1(effect, onThrow, __tsplusTrace) {
|
1491
|
+
return defer_1(() => {
|
1492
|
+
try {
|
1493
|
+
return tsplus_module_10.succeed(effect(), __tsplusTrace);
|
1494
|
+
} catch (u) {
|
1495
|
+
return withFiberRuntime_1(fiberState => {
|
1496
|
+
if (!fiberState.isFatal(u)) {
|
1497
|
+
throw new IOError(tsplus_module_1.fail(onThrow(u)));
|
1498
|
+
} else {
|
1499
|
+
throw u;
|
1500
|
+
}
|
1501
|
+
}, __tsplusTrace);
|
1502
|
+
}
|
1503
|
+
}, __tsplusTrace);
|
1504
|
+
}
|
1486
1505
|
/**
|
1487
1506
|
* @tsplus pipeable fncts.io.IO tryOrElse
|
1488
1507
|
*/
|
1489
1508
|
function tryOrElse_1(that, onSuccess, __tsplusTrace) {
|
1490
|
-
return
|
1491
|
-
return matchCauseIO_1(cause =>
|
1509
|
+
return self => {
|
1510
|
+
return matchCauseIO_1(cause => tsplus_module_17.match(that, failCauseNow_1)(tsplus_module_1.keepDefects(cause)), onSuccess, __tsplusTrace)(self);
|
1492
1511
|
};
|
1493
1512
|
}
|
1494
1513
|
/**
|
1495
1514
|
* @tsplus static fncts.io.IOOps unit
|
1496
1515
|
*/
|
1497
|
-
const unit_1 = /*#__PURE__*/succeedNow_1(undefined, fileName_1 + ":
|
1516
|
+
const unit_1 = /*#__PURE__*/succeedNow_1(undefined, fileName_1 + ":1866:45");
|
1498
1517
|
export const unit = unit_1;
|
1499
1518
|
/**
|
1500
1519
|
* Converts an option on errors into an option on values.
|
@@ -1502,7 +1521,7 @@ export const unit = unit_1;
|
|
1502
1521
|
* @tsplus getter fncts.io.IO unjust
|
1503
1522
|
*/
|
1504
1523
|
export function unjust(self, __tsplusTrace) {
|
1505
|
-
return matchIO_1(e =>
|
1524
|
+
return matchIO_1(e => tsplus_module_17.match(() => succeedNow_1(tsplus_module_2.nothing(__tsplusTrace), __tsplusTrace), failNow_1)(e), a => succeedNow_1(tsplus_module_2.just(a, __tsplusTrace), __tsplusTrace), __tsplusTrace)(self);
|
1506
1525
|
}
|
1507
1526
|
/**
|
1508
1527
|
* Takes some fiber failures and converts them into errors, using the
|
@@ -1511,8 +1530,8 @@ export function unjust(self, __tsplusTrace) {
|
|
1511
1530
|
* @tsplus pipeable fncts.io.IO unrefineWith
|
1512
1531
|
*/
|
1513
1532
|
function unrefineWith_1(pf, f, __tsplusTrace) {
|
1514
|
-
return
|
1515
|
-
return catchAllCause_1(cause =>
|
1533
|
+
return self => {
|
1534
|
+
return catchAllCause_1(cause => tsplus_module_17.match(() => failCauseNow_1(tsplus_module_1.map(f)(cause), __tsplusTrace), failNow_1)(tsplus_module_1.find(c => tsplus_module_1.isHalt(c) ? pf(c.value) : tsplus_module_2.nothing(__tsplusTrace))(cause)), __tsplusTrace)(self);
|
1516
1535
|
};
|
1517
1536
|
}
|
1518
1537
|
/**
|
@@ -1520,8 +1539,8 @@ function unrefineWith_1(pf, f, __tsplusTrace) {
|
|
1520
1539
|
*
|
1521
1540
|
* @tsplus getter fncts.io.IO unsandbox
|
1522
1541
|
*/
|
1523
|
-
function unsandbox_1(
|
1524
|
-
return mapErrorCause_1(cause =>
|
1542
|
+
function unsandbox_1(self, __tsplusTrace) {
|
1543
|
+
return mapErrorCause_1(cause => tsplus_module_1.flatten(cause), __tsplusTrace)(self);
|
1525
1544
|
}
|
1526
1545
|
/**
|
1527
1546
|
* Updates the `FiberRef` values for the fiber running this effect using the
|
@@ -1539,12 +1558,27 @@ export function updateFiberRefs(f, __tsplusTrace) {
|
|
1539
1558
|
* @tsplus fluent fncts.io.IO __call
|
1540
1559
|
*/
|
1541
1560
|
export const via = pipe;
|
1561
|
+
/**
|
1562
|
+
* @tsplus static fncts.io.IOOps stackTrace
|
1563
|
+
*/
|
1564
|
+
function stackTrace_1(__tsplusTrace) {
|
1565
|
+
return withFiberRuntime_1(state => succeedNow_1(state.generateStackTrace(), __tsplusTrace), __tsplusTrace);
|
1566
|
+
}
|
1567
|
+
/**
|
1568
|
+
* @tsplus static fncts.io.IOOps updateRuntimeFlags
|
1569
|
+
*/
|
1570
|
+
export function updateRuntimeFlags(patch, __tsplusTrace) {
|
1571
|
+
const io = new IOPrimitive(6 /* IOTag.UpdateRuntimeFlags */);
|
1572
|
+
io.i0 = patch;
|
1573
|
+
io.trace = __tsplusTrace;
|
1574
|
+
return io;
|
1575
|
+
}
|
1542
1576
|
/**
|
1543
1577
|
* @tsplus pipeable fncts.io.IO when
|
1544
1578
|
*/
|
1545
1579
|
export function when(b, __tsplusTrace) {
|
1546
|
-
return
|
1547
|
-
return whenIO_1(succeed_1(b, __tsplusTrace), __tsplusTrace)(
|
1580
|
+
return self => {
|
1581
|
+
return whenIO_1(succeed_1(b, __tsplusTrace), __tsplusTrace)(self);
|
1548
1582
|
};
|
1549
1583
|
}
|
1550
1584
|
/**
|
@@ -1554,33 +1588,26 @@ export function when(b, __tsplusTrace) {
|
|
1554
1588
|
* @tsplus static fncts.io.IOOps whenIO
|
1555
1589
|
*/
|
1556
1590
|
function whenIO_1(mb, __tsplusTrace) {
|
1557
|
-
return
|
1558
|
-
return flatMap_1(b => b ? asJust_1(
|
1591
|
+
return self => {
|
1592
|
+
return flatMap_1(b => b ? asJust_1(self, __tsplusTrace) : nothing_1, __tsplusTrace)(mb);
|
1559
1593
|
};
|
1560
1594
|
}
|
1561
1595
|
/**
|
1562
|
-
* @tsplus static fncts.io.IOOps
|
1596
|
+
* @tsplus static fncts.io.IOOps whileLoop
|
1563
1597
|
*/
|
1564
|
-
function
|
1565
|
-
const io = new IOPrimitive(
|
1566
|
-
io.i0 =
|
1567
|
-
io.
|
1598
|
+
function whileLoop_1(check, body, process, __tsPlusTrace) {
|
1599
|
+
const io = new IOPrimitive(9 /* IOTag.WhileLoop */);
|
1600
|
+
io.i0 = check;
|
1601
|
+
io.i1 = body;
|
1602
|
+
io.i2 = process;
|
1568
1603
|
return io;
|
1569
1604
|
}
|
1570
1605
|
/**
|
1571
|
-
* @tsplus static fncts.io.IOOps
|
1572
|
-
*/
|
1573
|
-
export function updateRuntimeFlags(patch, __tsplusTrace) {
|
1574
|
-
const io = new IOPrimitive(7 /* IOTag.UpdateRuntimeFlags */);
|
1575
|
-
io.i0 = patch;
|
1576
|
-
io.trace = __tsplusTrace;
|
1577
|
-
return io;
|
1578
|
-
}
|
1579
|
-
/**
|
1580
|
-
* @tsplus static fncts.io.IOOps stackTrace
|
1606
|
+
* @tsplus static fncts.io.IOOps withFiberRuntime
|
1581
1607
|
*/
|
1582
|
-
function
|
1583
|
-
const io = new IOPrimitive(
|
1608
|
+
function withFiberRuntime_1(onState, __tsplusTrace) {
|
1609
|
+
const io = new IOPrimitive(8 /* IOTag.Stateful */);
|
1610
|
+
io.i0 = onState;
|
1584
1611
|
io.trace = __tsplusTrace;
|
1585
1612
|
return io;
|
1586
1613
|
}
|
@@ -1591,7 +1618,7 @@ function stackTrace_1(__tsplusTrace) {
|
|
1591
1618
|
*
|
1592
1619
|
* @tsplus static fncts.io.IOOps yieldNow
|
1593
1620
|
*/
|
1594
|
-
const yieldNow_1 = /*#__PURE__*/new IOPrimitive(
|
1621
|
+
const yieldNow_1 = /*#__PURE__*/new IOPrimitive(10 /* IOTag.YieldNow */);
|
1595
1622
|
export const yieldNow = yieldNow_1;
|
1596
1623
|
/**
|
1597
1624
|
* @tsplus pipeable fncts.io.IO zip
|
@@ -1601,6 +1628,26 @@ export function zip(that, __tsplusTrace) {
|
|
1601
1628
|
return zipWith_1(that, tuple, __tsplusTrace)(self);
|
1602
1629
|
};
|
1603
1630
|
}
|
1631
|
+
/**
|
1632
|
+
* @tsplus pipeable fncts.io.IO zipLeft
|
1633
|
+
* @tsplus pipeable-operator fncts.io.IO <
|
1634
|
+
*/
|
1635
|
+
export function zipLeft(fb, __tsplusTrace) {
|
1636
|
+
return self => {
|
1637
|
+
return flatMap_1(a => map_1(() => a, __tsplusTrace)(fb), __tsplusTrace)(self);
|
1638
|
+
};
|
1639
|
+
}
|
1640
|
+
/**
|
1641
|
+
* Combine two effectful actions, keeping only the result of the second
|
1642
|
+
*
|
1643
|
+
* @tsplus pipeable fncts.io.IO zipRight
|
1644
|
+
* @tsplus pipeable-operator fncts.io.IO >
|
1645
|
+
*/
|
1646
|
+
function zipRight_1(fb, __tsplusTrace) {
|
1647
|
+
return self => {
|
1648
|
+
return flatMap_1(() => fb, __tsplusTrace)(self);
|
1649
|
+
};
|
1650
|
+
}
|
1604
1651
|
/**
|
1605
1652
|
* @tsplus pipeable fncts.io.IO zipWith
|
1606
1653
|
*/
|
@@ -1609,6 +1656,12 @@ function zipWith_1(that, f, __tsplusTrace) {
|
|
1609
1656
|
return flatMap_1(a => map_1(b => f(a, b), __tsplusTrace)(that), __tsplusTrace)(self);
|
1610
1657
|
};
|
1611
1658
|
}
|
1659
|
+
/**
|
1660
|
+
* @internal
|
1661
|
+
*/
|
1662
|
+
export const __adapter = _ => {
|
1663
|
+
return _;
|
1664
|
+
};
|
1612
1665
|
export class GenIO {
|
1613
1666
|
constructor(effect, _trace) {
|
1614
1667
|
this.effect = effect;
|
@@ -1618,12 +1671,6 @@ export class GenIO {
|
|
1618
1671
|
return yield this;
|
1619
1672
|
}
|
1620
1673
|
}
|
1621
|
-
/**
|
1622
|
-
* @internal
|
1623
|
-
*/
|
1624
|
-
export const __adapter = _ => {
|
1625
|
-
return _;
|
1626
|
-
};
|
1627
1674
|
const adapter = (_, __tsplusTrace) => {
|
1628
1675
|
return new GenIO(__adapter(_), __tsplusTrace);
|
1629
1676
|
};
|