@typed/fx 1.31.0 → 2.0.0-beta.0
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/README.md +344 -2
- package/dist/Fx/Fx.d.ts +96 -0
- package/dist/Fx/Fx.d.ts.map +1 -0
- package/dist/Fx/Fx.js +35 -0
- package/dist/Fx/TypeId.d.ts +20 -0
- package/dist/Fx/TypeId.d.ts.map +1 -0
- package/dist/Fx/TypeId.js +15 -0
- package/dist/Fx/combinators/catch.d.ts +53 -0
- package/dist/Fx/combinators/catch.d.ts.map +1 -0
- package/dist/Fx/combinators/catch.js +69 -0
- package/dist/Fx/combinators/causes.d.ts +12 -0
- package/dist/Fx/combinators/causes.d.ts.map +1 -0
- package/dist/Fx/combinators/causes.js +16 -0
- package/dist/Fx/combinators/compact.d.ts +12 -0
- package/dist/Fx/combinators/compact.d.ts.map +1 -0
- package/dist/Fx/combinators/compact.js +11 -0
- package/dist/Fx/combinators/continueWith.d.ts +51 -0
- package/dist/Fx/combinators/continueWith.d.ts.map +1 -0
- package/dist/Fx/combinators/continueWith.js +41 -0
- package/dist/Fx/combinators/ensuring.d.ts +16 -0
- package/dist/Fx/combinators/ensuring.d.ts.map +1 -0
- package/dist/Fx/combinators/ensuring.js +13 -0
- package/dist/Fx/combinators/exhaustLatestMap.d.ts +15 -0
- package/dist/Fx/combinators/exhaustLatestMap.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustLatestMap.js +48 -0
- package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts +13 -0
- package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustLatestMapEffect.js +14 -0
- package/dist/Fx/combinators/exhaustMap.d.ts +11 -0
- package/dist/Fx/combinators/exhaustMap.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustMap.js +19 -0
- package/dist/Fx/combinators/exhaustMapEffect.d.ts +11 -0
- package/dist/Fx/combinators/exhaustMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustMapEffect.js +12 -0
- package/dist/Fx/combinators/exit.d.ts +12 -0
- package/dist/Fx/combinators/exit.d.ts.map +1 -0
- package/dist/Fx/combinators/exit.js +11 -0
- package/dist/Fx/combinators/filter.d.ts +14 -0
- package/dist/Fx/combinators/filter.d.ts.map +1 -0
- package/dist/Fx/combinators/filter.js +12 -0
- package/dist/Fx/combinators/filterEffect.d.ts +15 -0
- package/dist/Fx/combinators/filterEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterEffect.js +12 -0
- package/dist/Fx/combinators/filterMap.d.ts +15 -0
- package/dist/Fx/combinators/filterMap.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMap.js +12 -0
- package/dist/Fx/combinators/filterMapEffect.d.ts +16 -0
- package/dist/Fx/combinators/filterMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapEffect.js +12 -0
- package/dist/Fx/combinators/filterMapLoop.d.ts +17 -0
- package/dist/Fx/combinators/filterMapLoop.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoop.js +14 -0
- package/dist/Fx/combinators/filterMapLoopCause.d.ts +18 -0
- package/dist/Fx/combinators/filterMapLoopCause.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoopCause.js +14 -0
- package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts +18 -0
- package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoopCauseEffect.js +13 -0
- package/dist/Fx/combinators/filterMapLoopEffect.d.ts +17 -0
- package/dist/Fx/combinators/filterMapLoopEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoopEffect.js +13 -0
- package/dist/Fx/combinators/flatMap.d.ts +23 -0
- package/dist/Fx/combinators/flatMap.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMap.js +21 -0
- package/dist/Fx/combinators/flatMapConcurrently.d.ts +12 -0
- package/dist/Fx/combinators/flatMapConcurrently.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMapConcurrently.js +22 -0
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts +12 -0
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.js +13 -0
- package/dist/Fx/combinators/flatMapEffect.d.ts +24 -0
- package/dist/Fx/combinators/flatMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMapEffect.js +14 -0
- package/dist/Fx/combinators/flip.d.ts +11 -0
- package/dist/Fx/combinators/flip.d.ts.map +1 -0
- package/dist/Fx/combinators/flip.js +11 -0
- package/dist/Fx/combinators/gen.d.ts +20 -0
- package/dist/Fx/combinators/gen.d.ts.map +1 -0
- package/dist/Fx/combinators/gen.js +14 -0
- package/dist/Fx/combinators/genScoped.d.ts +20 -0
- package/dist/Fx/combinators/genScoped.d.ts.map +1 -0
- package/dist/Fx/combinators/genScoped.js +13 -0
- package/dist/Fx/combinators/index.d.ts +52 -0
- package/dist/Fx/combinators/index.d.ts.map +1 -0
- package/dist/Fx/combinators/index.js +51 -0
- package/dist/Fx/combinators/keyed.d.ts +44 -0
- package/dist/Fx/combinators/keyed.d.ts.map +1 -0
- package/dist/Fx/combinators/keyed.js +199 -0
- package/dist/Fx/combinators/loop.d.ts +16 -0
- package/dist/Fx/combinators/loop.d.ts.map +1 -0
- package/dist/Fx/combinators/loop.js +14 -0
- package/dist/Fx/combinators/loopCause.d.ts +16 -0
- package/dist/Fx/combinators/loopCause.d.ts.map +1 -0
- package/dist/Fx/combinators/loopCause.js +13 -0
- package/dist/Fx/combinators/loopCauseEffect.d.ts +17 -0
- package/dist/Fx/combinators/loopCauseEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/loopCauseEffect.js +13 -0
- package/dist/Fx/combinators/loopEffect.d.ts +16 -0
- package/dist/Fx/combinators/loopEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/loopEffect.js +13 -0
- package/dist/Fx/combinators/map.d.ts +14 -0
- package/dist/Fx/combinators/map.d.ts.map +1 -0
- package/dist/Fx/combinators/map.js +12 -0
- package/dist/Fx/combinators/mapEffect.d.ts +15 -0
- package/dist/Fx/combinators/mapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/mapEffect.js +12 -0
- package/dist/Fx/combinators/mergeAll.d.ts +11 -0
- package/dist/Fx/combinators/mergeAll.d.ts.map +1 -0
- package/dist/Fx/combinators/mergeAll.js +15 -0
- package/dist/Fx/combinators/mergeOrdered.d.ts +14 -0
- package/dist/Fx/combinators/mergeOrdered.d.ts.map +1 -0
- package/dist/Fx/combinators/mergeOrdered.js +89 -0
- package/dist/Fx/combinators/onError.d.ts +17 -0
- package/dist/Fx/combinators/onError.d.ts.map +1 -0
- package/dist/Fx/combinators/onError.js +14 -0
- package/dist/Fx/combinators/onExit.d.ts +16 -0
- package/dist/Fx/combinators/onExit.d.ts.map +1 -0
- package/dist/Fx/combinators/onExit.js +39 -0
- package/dist/Fx/combinators/onInterrupt.d.ts +16 -0
- package/dist/Fx/combinators/onInterrupt.d.ts.map +1 -0
- package/dist/Fx/combinators/onInterrupt.js +38 -0
- package/dist/Fx/combinators/provide.d.ts +23 -0
- package/dist/Fx/combinators/provide.d.ts.map +1 -0
- package/dist/Fx/combinators/provide.js +27 -0
- package/dist/Fx/combinators/skip.d.ts +14 -0
- package/dist/Fx/combinators/skip.d.ts.map +1 -0
- package/dist/Fx/combinators/skip.js +11 -0
- package/dist/Fx/combinators/skipRepeats.d.ts +11 -0
- package/dist/Fx/combinators/skipRepeats.d.ts.map +1 -0
- package/dist/Fx/combinators/skipRepeats.js +12 -0
- package/dist/Fx/combinators/skipRepeatsWith.d.ts +12 -0
- package/dist/Fx/combinators/skipRepeatsWith.d.ts.map +1 -0
- package/dist/Fx/combinators/skipRepeatsWith.js +20 -0
- package/dist/Fx/combinators/slice.d.ts +23 -0
- package/dist/Fx/combinators/slice.d.ts.map +1 -0
- package/dist/Fx/combinators/slice.js +12 -0
- package/dist/Fx/combinators/switchMap.d.ts +13 -0
- package/dist/Fx/combinators/switchMap.d.ts.map +1 -0
- package/dist/Fx/combinators/switchMap.js +33 -0
- package/dist/Fx/combinators/switchMapEffect.d.ts +13 -0
- package/dist/Fx/combinators/switchMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/switchMapEffect.js +14 -0
- package/dist/Fx/combinators/take.d.ts +14 -0
- package/dist/Fx/combinators/take.d.ts.map +1 -0
- package/dist/Fx/combinators/take.js +11 -0
- package/dist/Fx/combinators/takeUntil.d.ts +28 -0
- package/dist/Fx/combinators/takeUntil.d.ts.map +1 -0
- package/dist/Fx/combinators/takeUntil.js +31 -0
- package/dist/Fx/combinators/tapEffect.d.ts +15 -0
- package/dist/Fx/combinators/tapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/tapEffect.js +18 -0
- package/dist/Fx/combinators/tuple.d.ts +27 -0
- package/dist/Fx/combinators/tuple.d.ts.map +1 -0
- package/dist/Fx/combinators/tuple.js +46 -0
- package/dist/Fx/combinators/unwrap.d.ts +12 -0
- package/dist/Fx/combinators/unwrap.d.ts.map +1 -0
- package/dist/Fx/combinators/unwrap.js +14 -0
- package/dist/Fx/combinators/unwrapScoped.d.ts +15 -0
- package/dist/Fx/combinators/unwrapScoped.d.ts.map +1 -0
- package/dist/Fx/combinators/unwrapScoped.js +16 -0
- package/dist/Fx/combinators/when.d.ts +36 -0
- package/dist/Fx/combinators/when.d.ts.map +1 -0
- package/dist/Fx/combinators/when.js +28 -0
- package/dist/Fx/combinators/withSpan.d.ts +4 -0
- package/dist/Fx/combinators/withSpan.d.ts.map +1 -0
- package/dist/Fx/combinators/withSpan.js +6 -0
- package/dist/Fx/constructors/at.d.ts +16 -0
- package/dist/Fx/constructors/at.d.ts.map +1 -0
- package/dist/Fx/constructors/at.js +13 -0
- package/dist/Fx/constructors/die.d.ts +11 -0
- package/dist/Fx/constructors/die.d.ts.map +1 -0
- package/dist/Fx/constructors/die.js +12 -0
- package/dist/Fx/constructors/empty.d.ts +8 -0
- package/dist/Fx/constructors/empty.d.ts.map +1 -0
- package/dist/Fx/constructors/empty.js +8 -0
- package/dist/Fx/constructors/fail.d.ts +11 -0
- package/dist/Fx/constructors/fail.d.ts.map +1 -0
- package/dist/Fx/constructors/fail.js +12 -0
- package/dist/Fx/constructors/failCause.d.ts +12 -0
- package/dist/Fx/constructors/failCause.d.ts.map +1 -0
- package/dist/Fx/constructors/failCause.js +11 -0
- package/dist/Fx/constructors/fn.d.ts +47 -0
- package/dist/Fx/constructors/fn.d.ts.map +1 -0
- package/dist/Fx/constructors/fn.js +23 -0
- package/dist/Fx/constructors/fromEffect.d.ts +21 -0
- package/dist/Fx/constructors/fromEffect.d.ts.map +1 -0
- package/dist/Fx/constructors/fromEffect.js +21 -0
- package/dist/Fx/constructors/fromFailures.d.ts +10 -0
- package/dist/Fx/constructors/fromFailures.d.ts.map +1 -0
- package/dist/Fx/constructors/fromFailures.js +13 -0
- package/dist/Fx/constructors/fromIterable.d.ts +12 -0
- package/dist/Fx/constructors/fromIterable.d.ts.map +1 -0
- package/dist/Fx/constructors/fromIterable.js +12 -0
- package/dist/Fx/constructors/fromSchedule.d.ts +13 -0
- package/dist/Fx/constructors/fromSchedule.d.ts.map +1 -0
- package/dist/Fx/constructors/fromSchedule.js +13 -0
- package/dist/Fx/constructors/fromYieldable.d.ts +12 -0
- package/dist/Fx/constructors/fromYieldable.d.ts.map +1 -0
- package/dist/Fx/constructors/fromYieldable.js +12 -0
- package/dist/Fx/constructors/index.d.ts +16 -0
- package/dist/Fx/constructors/index.d.ts.map +1 -0
- package/dist/Fx/constructors/index.js +15 -0
- package/dist/Fx/constructors/interrupt.d.ts +10 -0
- package/dist/Fx/constructors/interrupt.d.ts.map +1 -0
- package/dist/Fx/constructors/interrupt.js +12 -0
- package/dist/Fx/constructors/make.d.ts +40 -0
- package/dist/Fx/constructors/make.d.ts.map +1 -0
- package/dist/Fx/constructors/make.js +61 -0
- package/dist/Fx/constructors/periodic.d.ts +12 -0
- package/dist/Fx/constructors/periodic.d.ts.map +1 -0
- package/dist/Fx/constructors/periodic.js +12 -0
- package/dist/Fx/constructors/succeed.d.ts +32 -0
- package/dist/Fx/constructors/succeed.d.ts.map +1 -0
- package/dist/Fx/constructors/succeed.js +32 -0
- package/dist/Fx/constructors/suspend.d.ts +3 -0
- package/dist/Fx/constructors/suspend.d.ts.map +1 -0
- package/dist/Fx/constructors/suspend.js +3 -0
- package/dist/Fx/index.d.ts +7 -0
- package/dist/Fx/index.d.ts.map +1 -0
- package/dist/Fx/index.js +6 -0
- package/dist/Fx/internal/DeferredRef.d.ts +29 -0
- package/dist/Fx/internal/DeferredRef.d.ts.map +1 -0
- package/dist/{esm → Fx}/internal/DeferredRef.js +21 -15
- package/dist/Fx/internal/UnionToTuple.d.ts.map +1 -0
- package/dist/Fx/internal/UnionToTuple.js +1 -0
- package/dist/{dts → Fx}/internal/diff.d.ts +3 -1
- package/dist/Fx/internal/diff.d.ts.map +1 -0
- package/dist/{esm → Fx}/internal/diff.js +37 -23
- package/dist/Fx/internal/equivalence.d.ts +4 -0
- package/dist/Fx/internal/equivalence.d.ts.map +1 -0
- package/dist/Fx/internal/equivalence.js +10 -0
- package/dist/Fx/internal/multicast.d.ts +10 -0
- package/dist/Fx/internal/multicast.d.ts.map +1 -0
- package/dist/Fx/internal/multicast.js +32 -0
- package/dist/Fx/internal/ring-buffer.d.ts +14 -0
- package/dist/Fx/internal/ring-buffer.d.ts.map +1 -0
- package/dist/Fx/internal/ring-buffer.js +52 -0
- package/dist/Fx/internal/scope.d.ts +11 -0
- package/dist/Fx/internal/scope.d.ts.map +1 -0
- package/dist/Fx/internal/scope.js +12 -0
- package/dist/Fx/internal/yieldable.d.ts +17 -0
- package/dist/Fx/internal/yieldable.d.ts.map +1 -0
- package/dist/Fx/internal/yieldable.js +20 -0
- package/dist/Fx/run/collect.d.ts +45 -0
- package/dist/Fx/run/collect.d.ts.map +1 -0
- package/dist/Fx/run/collect.js +51 -0
- package/dist/Fx/run/first.d.ts +14 -0
- package/dist/Fx/run/first.d.ts.map +1 -0
- package/dist/Fx/run/first.js +16 -0
- package/dist/Fx/run/fork.d.ts +29 -0
- package/dist/Fx/run/fork.d.ts.map +1 -0
- package/dist/Fx/run/fork.js +27 -0
- package/dist/Fx/run/index.d.ts +6 -0
- package/dist/Fx/run/index.d.ts.map +1 -0
- package/dist/Fx/run/index.js +5 -0
- package/dist/Fx/run/observe.d.ts +53 -0
- package/dist/Fx/run/observe.d.ts.map +1 -0
- package/dist/Fx/run/observe.js +55 -0
- package/dist/Fx/run/runPromise.d.ts +25 -0
- package/dist/Fx/run/runPromise.d.ts.map +1 -0
- package/dist/Fx/run/runPromise.js +23 -0
- package/dist/Fx/stream.d.ts +7 -0
- package/dist/Fx/stream.d.ts.map +1 -0
- package/dist/Fx/stream.js +7 -0
- package/dist/Fx.d.ts +2 -0
- package/dist/Fx.d.ts.map +1 -0
- package/dist/Fx.js +1 -0
- package/dist/Push/Push.d.ts +312 -0
- package/dist/Push/Push.d.ts.map +1 -0
- package/dist/Push/Push.js +289 -0
- package/dist/Push/index.d.ts +2 -0
- package/dist/Push/index.d.ts.map +1 -0
- package/dist/Push/index.js +1 -0
- package/dist/Push.d.ts +2 -0
- package/dist/Push.d.ts.map +1 -0
- package/dist/Push.js +1 -0
- package/dist/{dts → RefSubject}/RefArray.d.ts +68 -18
- package/dist/RefSubject/RefArray.d.ts.map +1 -0
- package/dist/{esm → RefSubject}/RefArray.js +80 -12
- package/dist/RefSubject/RefBigDecimal.d.ts +183 -0
- package/dist/RefSubject/RefBigDecimal.d.ts.map +1 -0
- package/dist/RefSubject/RefBigDecimal.js +161 -0
- package/dist/RefSubject/RefBigInt.d.ts +138 -0
- package/dist/RefSubject/RefBigInt.d.ts.map +1 -0
- package/dist/RefSubject/RefBigInt.js +126 -0
- package/dist/RefSubject/RefBoolean.d.ts +135 -0
- package/dist/RefSubject/RefBoolean.d.ts.map +1 -0
- package/dist/RefSubject/RefBoolean.js +124 -0
- package/dist/RefSubject/RefCause.d.ts +100 -0
- package/dist/RefSubject/RefCause.d.ts.map +1 -0
- package/dist/RefSubject/RefCause.js +93 -0
- package/dist/{dts → RefSubject}/RefChunk.d.ts +157 -71
- package/dist/RefSubject/RefChunk.d.ts.map +1 -0
- package/dist/{esm → RefSubject}/RefChunk.js +142 -52
- package/dist/RefSubject/RefDateTime.d.ts +155 -0
- package/dist/RefSubject/RefDateTime.d.ts.map +1 -0
- package/dist/RefSubject/RefDateTime.js +101 -0
- package/dist/RefSubject/RefDuration.d.ts +126 -0
- package/dist/RefSubject/RefDuration.d.ts.map +1 -0
- package/dist/RefSubject/RefDuration.js +115 -0
- package/dist/RefSubject/RefGraph.d.ts +239 -0
- package/dist/RefSubject/RefGraph.d.ts.map +1 -0
- package/dist/RefSubject/RefGraph.js +272 -0
- package/dist/RefSubject/RefHashMap.d.ts +228 -0
- package/dist/RefSubject/RefHashMap.d.ts.map +1 -0
- package/dist/RefSubject/RefHashMap.js +212 -0
- package/dist/RefSubject/RefHashRing.d.ts +123 -0
- package/dist/RefSubject/RefHashRing.d.ts.map +1 -0
- package/dist/RefSubject/RefHashRing.js +115 -0
- package/dist/RefSubject/RefHashSet.d.ts +179 -0
- package/dist/RefSubject/RefHashSet.d.ts.map +1 -0
- package/dist/RefSubject/RefHashSet.js +164 -0
- package/dist/RefSubject/RefIterable.d.ts +257 -0
- package/dist/RefSubject/RefIterable.d.ts.map +1 -0
- package/dist/RefSubject/RefIterable.js +237 -0
- package/dist/RefSubject/RefOption.d.ts +124 -0
- package/dist/RefSubject/RefOption.d.ts.map +1 -0
- package/dist/RefSubject/RefOption.js +115 -0
- package/dist/RefSubject/RefRecord.d.ts +264 -0
- package/dist/RefSubject/RefRecord.d.ts.map +1 -0
- package/dist/RefSubject/RefRecord.js +249 -0
- package/dist/RefSubject/RefResult.d.ts +121 -0
- package/dist/RefSubject/RefResult.d.ts.map +1 -0
- package/dist/RefSubject/RefResult.js +107 -0
- package/dist/RefSubject/RefString.d.ts +147 -0
- package/dist/RefSubject/RefString.d.ts.map +1 -0
- package/dist/RefSubject/RefString.js +137 -0
- package/dist/RefSubject/RefStruct.d.ts +123 -0
- package/dist/RefSubject/RefStruct.d.ts.map +1 -0
- package/dist/RefSubject/RefStruct.js +113 -0
- package/dist/RefSubject/RefSubject.d.ts +1010 -0
- package/dist/RefSubject/RefSubject.d.ts.map +1 -0
- package/dist/RefSubject/RefSubject.js +1310 -0
- package/dist/RefSubject/RefTrie.d.ts +216 -0
- package/dist/RefSubject/RefTrie.d.ts.map +1 -0
- package/dist/RefSubject/RefTrie.js +201 -0
- package/dist/RefSubject/RefTuple.d.ts +107 -0
- package/dist/RefSubject/RefTuple.d.ts.map +1 -0
- package/dist/RefSubject/RefTuple.js +94 -0
- package/dist/RefSubject/index.d.ts +22 -0
- package/dist/RefSubject/index.d.ts.map +1 -0
- package/dist/RefSubject/index.js +21 -0
- package/dist/RefSubject.d.ts +2 -0
- package/dist/RefSubject.d.ts.map +1 -0
- package/dist/RefSubject.js +1 -0
- package/dist/Sink/Sink.d.ts +94 -0
- package/dist/Sink/Sink.d.ts.map +1 -0
- package/dist/Sink/Sink.js +34 -0
- package/dist/Sink/combinators.d.ts +171 -0
- package/dist/Sink/combinators.d.ts.map +1 -0
- package/dist/{esm/Sink.js → Sink/combinators.js} +265 -352
- package/dist/Sink/index.d.ts +3 -0
- package/dist/Sink/index.d.ts.map +1 -0
- package/dist/Sink/index.js +2 -0
- package/dist/Sink.d.ts +2 -0
- package/dist/Sink.d.ts.map +1 -0
- package/dist/Sink.js +1 -0
- package/dist/Subject/Subject.d.ts +152 -0
- package/dist/Subject/Subject.d.ts.map +1 -0
- package/dist/Subject/Subject.js +272 -0
- package/dist/Subject/index.d.ts +2 -0
- package/dist/Subject/index.d.ts.map +1 -0
- package/dist/Subject/index.js +1 -0
- package/dist/Subject.d.ts +2 -0
- package/dist/Subject.d.ts.map +1 -0
- package/dist/Subject.js +1 -0
- package/dist/Versioned/Versioned.d.ts +176 -0
- package/dist/Versioned/Versioned.d.ts.map +1 -0
- package/dist/Versioned/Versioned.js +228 -0
- package/dist/Versioned/index.d.ts +2 -0
- package/dist/Versioned/index.d.ts.map +1 -0
- package/dist/Versioned/index.js +1 -0
- package/dist/Versioned.d.ts +2 -0
- package/dist/Versioned.d.ts.map +1 -0
- package/dist/Versioned.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/package.json +19 -191
- package/src/Fx/Fx.ts +164 -0
- package/src/Fx/TypeId.ts +25 -0
- package/src/Fx/combinators/catch.ts +165 -0
- package/src/Fx/combinators/causes.ts +23 -0
- package/src/Fx/combinators/compact.ts +15 -0
- package/src/Fx/combinators/continueWith.ts +78 -0
- package/src/Fx/combinators/ensuring.ts +23 -0
- package/src/Fx/combinators/exhaustLatestMap.ts +74 -0
- package/src/Fx/combinators/exhaustLatestMapEffect.ts +25 -0
- package/src/Fx/combinators/exhaustMap.ts +36 -0
- package/src/Fx/combinators/exhaustMapEffect.ts +23 -0
- package/src/Fx/combinators/exit.ts +15 -0
- package/src/Fx/combinators/filter.ts +22 -0
- package/src/Fx/combinators/filterEffect.ts +31 -0
- package/src/Fx/combinators/filterMap.ts +23 -0
- package/src/Fx/combinators/filterMapEffect.ts +32 -0
- package/src/Fx/combinators/filterMapLoop.ts +35 -0
- package/src/Fx/combinators/filterMapLoopCause.ts +36 -0
- package/src/Fx/combinators/filterMapLoopCauseEffect.ts +46 -0
- package/src/Fx/combinators/filterMapLoopEffect.ts +36 -0
- package/src/Fx/combinators/flatMap.ts +51 -0
- package/src/Fx/combinators/flatMapConcurrently.ts +36 -0
- package/src/Fx/combinators/flatMapConcurrentlyEffect.ts +26 -0
- package/src/Fx/combinators/flatMapEffect.ts +42 -0
- package/src/Fx/combinators/flip.ts +14 -0
- package/src/Fx/combinators/gen.ts +24 -0
- package/src/Fx/combinators/genScoped.ts +24 -0
- package/src/Fx/combinators/index.ts +51 -0
- package/src/Fx/combinators/keyed.ts +369 -0
- package/src/Fx/combinators/loop.ts +27 -0
- package/src/Fx/combinators/loopCause.ts +34 -0
- package/src/Fx/combinators/loopCauseEffect.ts +36 -0
- package/src/Fx/combinators/loopEffect.ts +34 -0
- package/src/Fx/combinators/map.ts +22 -0
- package/src/Fx/combinators/mapEffect.ts +32 -0
- package/src/Fx/combinators/mergeAll.ts +22 -0
- package/src/Fx/combinators/mergeOrdered.ts +123 -0
- package/src/Fx/combinators/onError.ts +40 -0
- package/src/Fx/combinators/onExit.ts +82 -0
- package/src/Fx/combinators/onInterrupt.ts +87 -0
- package/src/Fx/combinators/provide.ts +62 -0
- package/src/Fx/combinators/skip.ts +20 -0
- package/src/Fx/combinators/skipRepeats.ts +15 -0
- package/src/Fx/combinators/skipRepeatsWith.ts +40 -0
- package/src/Fx/combinators/slice.ts +32 -0
- package/src/Fx/combinators/switchMap.ts +55 -0
- package/src/Fx/combinators/switchMapEffect.ts +25 -0
- package/src/Fx/combinators/take.ts +17 -0
- package/src/Fx/combinators/takeUntil.ts +50 -0
- package/src/Fx/combinators/tapEffect.ts +39 -0
- package/src/Fx/combinators/tuple.ts +79 -0
- package/src/Fx/combinators/unwrap.ts +21 -0
- package/src/Fx/combinators/unwrapScoped.ts +26 -0
- package/src/Fx/combinators/when.ts +64 -0
- package/src/Fx/combinators/withSpan.ts +24 -0
- package/src/Fx/constructors/at.ts +23 -0
- package/src/Fx/constructors/die.ts +17 -0
- package/src/Fx/constructors/empty.ts +10 -0
- package/src/Fx/constructors/fail.ts +14 -0
- package/src/Fx/constructors/failCause.ts +14 -0
- package/src/Fx/constructors/fn.ts +245 -0
- package/src/Fx/constructors/fromEffect.ts +24 -0
- package/src/Fx/constructors/fromFailures.ts +19 -0
- package/src/Fx/constructors/fromIterable.ts +15 -0
- package/src/Fx/constructors/fromSchedule.ts +18 -0
- package/src/Fx/constructors/fromYieldable.ts +17 -0
- package/src/Fx/constructors/index.ts +15 -0
- package/src/Fx/constructors/interrupt.ts +13 -0
- package/src/Fx/constructors/make.ts +103 -0
- package/src/Fx/constructors/periodic.ts +15 -0
- package/src/Fx/constructors/succeed.ts +37 -0
- package/src/Fx/constructors/suspend.ts +6 -0
- package/src/Fx/index.ts +6 -0
- package/src/Fx/internal/DeferredRef.ts +87 -0
- package/src/Fx/internal/UnionToTuple.ts +12 -0
- package/src/Fx/internal/diff.ts +191 -0
- package/src/Fx/internal/equivalence.ts +12 -0
- package/src/Fx/internal/multicast.ts +51 -0
- package/src/Fx/internal/ring-buffer.ts +60 -0
- package/src/Fx/internal/scope.ts +58 -0
- package/src/Fx/internal/yieldable.ts +31 -0
- package/src/Fx/run/collect.ts +79 -0
- package/src/Fx/run/first.ts +20 -0
- package/src/Fx/run/fork.ts +40 -0
- package/src/Fx/run/index.ts +5 -0
- package/src/Fx/run/observe.ts +114 -0
- package/src/Fx/run/runPromise.ts +32 -0
- package/src/Fx/stream.ts +42 -0
- package/src/Fx.catch.test.ts +61 -0
- package/src/Fx.fn.test.ts +51 -0
- package/src/Fx.lifecycle.test.ts +80 -0
- package/src/Fx.test.ts +71 -0
- package/src/Fx.ts +1 -2591
- package/src/Push/Push.ts +903 -0
- package/src/Push/index.ts +1 -0
- package/src/Push.test.ts +26 -0
- package/src/Push.ts +1 -480
- package/src/{RefArray.ts → RefSubject/RefArray.ts} +246 -248
- package/src/RefSubject/RefBigDecimal.test.ts +56 -0
- package/src/RefSubject/RefBigDecimal.ts +295 -0
- package/src/RefSubject/RefBigInt.test.ts +56 -0
- package/src/RefSubject/RefBigInt.ts +189 -0
- package/src/RefSubject/RefBoolean.test.ts +57 -0
- package/src/RefSubject/RefBoolean.ts +185 -0
- package/src/RefSubject/RefCause.test.ts +53 -0
- package/src/RefSubject/RefCause.ts +146 -0
- package/src/RefSubject/RefChunk.ts +510 -0
- package/src/RefSubject/RefDateTime.test.ts +43 -0
- package/src/RefSubject/RefDateTime.ts +264 -0
- package/src/RefSubject/RefDuration.test.ts +49 -0
- package/src/RefSubject/RefDuration.ts +188 -0
- package/src/RefSubject/RefGraph.ts +650 -0
- package/src/RefSubject/RefHashMap.ts +465 -0
- package/src/RefSubject/RefHashRing.ts +262 -0
- package/src/RefSubject/RefHashSet.ts +308 -0
- package/src/RefSubject/RefIterable.ts +445 -0
- package/src/RefSubject/RefOption.test.ts +67 -0
- package/src/RefSubject/RefOption.ts +193 -0
- package/src/RefSubject/RefRecord.ts +612 -0
- package/src/RefSubject/RefResult.test.ts +63 -0
- package/src/RefSubject/RefResult.ts +209 -0
- package/src/RefSubject/RefString.test.ts +61 -0
- package/src/RefSubject/RefString.ts +256 -0
- package/src/RefSubject/RefStruct.test.ts +60 -0
- package/src/RefSubject/RefStruct.ts +253 -0
- package/src/RefSubject/RefSubject.ts +2545 -0
- package/src/RefSubject/RefTrie.ts +356 -0
- package/src/RefSubject/RefTuple.test.ts +60 -0
- package/src/RefSubject/RefTuple.ts +231 -0
- package/src/RefSubject/index.ts +21 -0
- package/src/RefSubject.test.ts +65 -0
- package/src/RefSubject.ts +1 -2488
- package/src/Sink/Sink.ts +159 -0
- package/src/Sink/combinators.ts +993 -0
- package/src/Sink/index.ts +2 -0
- package/src/Sink.ts +1 -1044
- package/src/Subject/Subject.ts +441 -0
- package/src/Subject/index.ts +1 -0
- package/src/Subject.test.ts +47 -0
- package/src/Subject.ts +1 -330
- package/src/Versioned/Versioned.ts +521 -0
- package/src/Versioned/index.ts +1 -0
- package/src/Versioned.test.ts +23 -0
- package/src/Versioned.ts +1 -357
- package/src/index.ts +7 -130
- package/tsconfig.json +6 -0
- package/AsyncData/package.json +0 -6
- package/Emitter/package.json +0 -6
- package/Form/package.json +0 -6
- package/FormEntry/package.json +0 -6
- package/Fx/package.json +0 -6
- package/Idle/package.json +0 -6
- package/LICENSE +0 -21
- package/Match/package.json +0 -6
- package/Pull/package.json +0 -6
- package/Push/package.json +0 -6
- package/RefArray/package.json +0 -6
- package/RefChunk/package.json +0 -6
- package/RefHashMap/package.json +0 -6
- package/RefHashSet/package.json +0 -6
- package/RefSubject/package.json +0 -6
- package/Sink/package.json +0 -6
- package/Stream/package.json +0 -6
- package/Subject/package.json +0 -6
- package/TypeId/package.json +0 -6
- package/Typeclass/package.json +0 -6
- package/Versioned/package.json +0 -6
- package/dist/cjs/AsyncData.js +0 -188
- package/dist/cjs/AsyncData.js.map +0 -1
- package/dist/cjs/Emitter.js +0 -44
- package/dist/cjs/Emitter.js.map +0 -1
- package/dist/cjs/Form.js +0 -178
- package/dist/cjs/Form.js.map +0 -1
- package/dist/cjs/FormEntry.js +0 -110
- package/dist/cjs/FormEntry.js.map +0 -1
- package/dist/cjs/Fx.js +0 -998
- package/dist/cjs/Fx.js.map +0 -1
- package/dist/cjs/Idle.js +0 -190
- package/dist/cjs/Idle.js.map +0 -1
- package/dist/cjs/Match.js +0 -191
- package/dist/cjs/Match.js.map +0 -1
- package/dist/cjs/Pull.js +0 -52
- package/dist/cjs/Pull.js.map +0 -1
- package/dist/cjs/Push.js +0 -168
- package/dist/cjs/Push.js.map +0 -1
- package/dist/cjs/RefArray.js +0 -253
- package/dist/cjs/RefArray.js.map +0 -1
- package/dist/cjs/RefChunk.js +0 -212
- package/dist/cjs/RefChunk.js.map +0 -1
- package/dist/cjs/RefHashMap.js +0 -198
- package/dist/cjs/RefHashMap.js.map +0 -1
- package/dist/cjs/RefHashSet.js +0 -99
- package/dist/cjs/RefHashSet.js.map +0 -1
- package/dist/cjs/RefSubject.js +0 -1115
- package/dist/cjs/RefSubject.js.map +0 -1
- package/dist/cjs/Sink.js +0 -662
- package/dist/cjs/Sink.js.map +0 -1
- package/dist/cjs/Stream.js +0 -87
- package/dist/cjs/Stream.js.map +0 -1
- package/dist/cjs/Subject.js +0 -205
- package/dist/cjs/Subject.js.map +0 -1
- package/dist/cjs/TypeId.js +0 -32
- package/dist/cjs/TypeId.js.map +0 -1
- package/dist/cjs/Typeclass.js +0 -380
- package/dist/cjs/Typeclass.js.map +0 -1
- package/dist/cjs/Versioned.js +0 -172
- package/dist/cjs/Versioned.js.map +0 -1
- package/dist/cjs/index.js +0 -89
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/internal/DeferredRef.js +0 -67
- package/dist/cjs/internal/DeferredRef.js.map +0 -1
- package/dist/cjs/internal/UnionToTuple.js +0 -6
- package/dist/cjs/internal/UnionToTuple.js.map +0 -1
- package/dist/cjs/internal/bounds.js +0 -26
- package/dist/cjs/internal/bounds.js.map +0 -1
- package/dist/cjs/internal/core.js +0 -1774
- package/dist/cjs/internal/core.js.map +0 -1
- package/dist/cjs/internal/diff.js +0 -122
- package/dist/cjs/internal/diff.js.map +0 -1
- package/dist/cjs/internal/effect-loop-operator.js +0 -288
- package/dist/cjs/internal/effect-loop-operator.js.map +0 -1
- package/dist/cjs/internal/effect-operator.js +0 -156
- package/dist/cjs/internal/effect-operator.js.map +0 -1
- package/dist/cjs/internal/effect-producer.js +0 -74
- package/dist/cjs/internal/effect-producer.js.map +0 -1
- package/dist/cjs/internal/helpers.js +0 -317
- package/dist/cjs/internal/helpers.js.map +0 -1
- package/dist/cjs/internal/keyed.js +0 -168
- package/dist/cjs/internal/keyed.js.map +0 -1
- package/dist/cjs/internal/loop-operator.js +0 -213
- package/dist/cjs/internal/loop-operator.js.map +0 -1
- package/dist/cjs/internal/operator.js +0 -79
- package/dist/cjs/internal/operator.js.map +0 -1
- package/dist/cjs/internal/protos.js +0 -48
- package/dist/cjs/internal/protos.js.map +0 -1
- package/dist/cjs/internal/provide.js +0 -100
- package/dist/cjs/internal/provide.js.map +0 -1
- package/dist/cjs/internal/requestIdleCallback.js +0 -22
- package/dist/cjs/internal/requestIdleCallback.js.map +0 -1
- package/dist/cjs/internal/share.js +0 -74
- package/dist/cjs/internal/share.js.map +0 -1
- package/dist/cjs/internal/strategies.js +0 -34
- package/dist/cjs/internal/strategies.js.map +0 -1
- package/dist/cjs/internal/sync-operator.js +0 -120
- package/dist/cjs/internal/sync-operator.js.map +0 -1
- package/dist/cjs/internal/sync-producer.js +0 -118
- package/dist/cjs/internal/sync-producer.js.map +0 -1
- package/dist/cjs/internal/withKey.js +0 -63
- package/dist/cjs/internal/withKey.js.map +0 -1
- package/dist/dts/AsyncData.d.ts +0 -179
- package/dist/dts/AsyncData.d.ts.map +0 -1
- package/dist/dts/Emitter.d.ts +0 -24
- package/dist/dts/Emitter.d.ts.map +0 -1
- package/dist/dts/Form.d.ts +0 -145
- package/dist/dts/Form.d.ts.map +0 -1
- package/dist/dts/FormEntry.d.ts +0 -65
- package/dist/dts/FormEntry.d.ts.map +0 -1
- package/dist/dts/Fx.d.ts +0 -1678
- package/dist/dts/Fx.d.ts.map +0 -1
- package/dist/dts/Idle.d.ts +0 -84
- package/dist/dts/Idle.d.ts.map +0 -1
- package/dist/dts/Match.d.ts +0 -60
- package/dist/dts/Match.d.ts.map +0 -1
- package/dist/dts/Pull.d.ts +0 -37
- package/dist/dts/Pull.d.ts.map +0 -1
- package/dist/dts/Push.d.ts +0 -176
- package/dist/dts/Push.d.ts.map +0 -1
- package/dist/dts/RefArray.d.ts.map +0 -1
- package/dist/dts/RefChunk.d.ts.map +0 -1
- package/dist/dts/RefHashMap.d.ts +0 -189
- package/dist/dts/RefHashMap.d.ts.map +0 -1
- package/dist/dts/RefHashSet.d.ts +0 -100
- package/dist/dts/RefHashSet.d.ts.map +0 -1
- package/dist/dts/RefSubject.d.ts +0 -601
- package/dist/dts/RefSubject.d.ts.map +0 -1
- package/dist/dts/Sink.d.ts +0 -252
- package/dist/dts/Sink.d.ts.map +0 -1
- package/dist/dts/Stream.d.ts +0 -66
- package/dist/dts/Stream.d.ts.map +0 -1
- package/dist/dts/Subject.d.ts +0 -61
- package/dist/dts/Subject.d.ts.map +0 -1
- package/dist/dts/TypeId.d.ts +0 -51
- package/dist/dts/TypeId.d.ts.map +0 -1
- package/dist/dts/Typeclass.d.ts +0 -284
- package/dist/dts/Typeclass.d.ts.map +0 -1
- package/dist/dts/Versioned.d.ts +0 -117
- package/dist/dts/Versioned.d.ts.map +0 -1
- package/dist/dts/index.d.ts +0 -111
- package/dist/dts/index.d.ts.map +0 -1
- package/dist/dts/internal/DeferredRef.d.ts +0 -22
- package/dist/dts/internal/DeferredRef.d.ts.map +0 -1
- package/dist/dts/internal/UnionToTuple.d.ts.map +0 -1
- package/dist/dts/internal/bounds.d.ts +0 -9
- package/dist/dts/internal/bounds.d.ts.map +0 -1
- package/dist/dts/internal/core.d.ts +0 -237
- package/dist/dts/internal/core.d.ts.map +0 -1
- package/dist/dts/internal/diff.d.ts.map +0 -1
- package/dist/dts/internal/effect-loop-operator.d.ts +0 -34
- package/dist/dts/internal/effect-loop-operator.d.ts.map +0 -1
- package/dist/dts/internal/effect-operator.d.ts +0 -40
- package/dist/dts/internal/effect-operator.d.ts.map +0 -1
- package/dist/dts/internal/effect-producer.d.ts +0 -25
- package/dist/dts/internal/effect-producer.d.ts.map +0 -1
- package/dist/dts/internal/helpers.d.ts +0 -60
- package/dist/dts/internal/helpers.d.ts.map +0 -1
- package/dist/dts/internal/keyed.d.ts +0 -4
- package/dist/dts/internal/keyed.d.ts.map +0 -1
- package/dist/dts/internal/loop-operator.d.ts +0 -40
- package/dist/dts/internal/loop-operator.d.ts.map +0 -1
- package/dist/dts/internal/operator.d.ts +0 -16
- package/dist/dts/internal/operator.d.ts.map +0 -1
- package/dist/dts/internal/protos.d.ts +0 -23
- package/dist/dts/internal/protos.d.ts.map +0 -1
- package/dist/dts/internal/provide.d.ts +0 -46
- package/dist/dts/internal/provide.d.ts.map +0 -1
- package/dist/dts/internal/requestIdleCallback.d.ts +0 -3
- package/dist/dts/internal/requestIdleCallback.d.ts.map +0 -1
- package/dist/dts/internal/share.d.ts +0 -33
- package/dist/dts/internal/share.d.ts.map +0 -1
- package/dist/dts/internal/strategies.d.ts +0 -9
- package/dist/dts/internal/strategies.d.ts.map +0 -1
- package/dist/dts/internal/sync-operator.d.ts +0 -32
- package/dist/dts/internal/sync-operator.d.ts.map +0 -1
- package/dist/dts/internal/sync-producer.d.ts +0 -36
- package/dist/dts/internal/sync-producer.d.ts.map +0 -1
- package/dist/dts/internal/withKey.d.ts +0 -4
- package/dist/dts/internal/withKey.d.ts.map +0 -1
- package/dist/esm/AsyncData.js +0 -156
- package/dist/esm/AsyncData.js.map +0 -1
- package/dist/esm/Emitter.js +0 -33
- package/dist/esm/Emitter.js.map +0 -1
- package/dist/esm/Form.js +0 -163
- package/dist/esm/Form.js.map +0 -1
- package/dist/esm/FormEntry.js +0 -100
- package/dist/esm/FormEntry.js.map +0 -1
- package/dist/esm/Fx.js +0 -984
- package/dist/esm/Fx.js.map +0 -1
- package/dist/esm/Idle.js +0 -178
- package/dist/esm/Idle.js.map +0 -1
- package/dist/esm/Match.js +0 -185
- package/dist/esm/Match.js.map +0 -1
- package/dist/esm/Pull.js +0 -41
- package/dist/esm/Pull.js.map +0 -1
- package/dist/esm/Push.js +0 -159
- package/dist/esm/Push.js.map +0 -1
- package/dist/esm/RefArray.js.map +0 -1
- package/dist/esm/RefChunk.js.map +0 -1
- package/dist/esm/RefHashMap.js +0 -176
- package/dist/esm/RefHashMap.js.map +0 -1
- package/dist/esm/RefHashSet.js +0 -86
- package/dist/esm/RefHashSet.js.map +0 -1
- package/dist/esm/RefSubject.js +0 -1076
- package/dist/esm/RefSubject.js.map +0 -1
- package/dist/esm/Sink.js.map +0 -1
- package/dist/esm/Stream.js +0 -76
- package/dist/esm/Stream.js.map +0 -1
- package/dist/esm/Subject.js +0 -198
- package/dist/esm/Subject.js.map +0 -1
- package/dist/esm/TypeId.js +0 -26
- package/dist/esm/TypeId.js.map +0 -1
- package/dist/esm/Typeclass.js +0 -375
- package/dist/esm/Typeclass.js.map +0 -1
- package/dist/esm/Versioned.js +0 -149
- package/dist/esm/Versioned.js.map +0 -1
- package/dist/esm/index.js +0 -111
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internal/DeferredRef.js.map +0 -1
- package/dist/esm/internal/UnionToTuple.js +0 -2
- package/dist/esm/internal/UnionToTuple.js.map +0 -1
- package/dist/esm/internal/bounds.js +0 -13
- package/dist/esm/internal/bounds.js.map +0 -1
- package/dist/esm/internal/core.js +0 -1606
- package/dist/esm/internal/core.js.map +0 -1
- package/dist/esm/internal/diff.js.map +0 -1
- package/dist/esm/internal/effect-loop-operator.js +0 -269
- package/dist/esm/internal/effect-loop-operator.js.map +0 -1
- package/dist/esm/internal/effect-operator.js +0 -134
- package/dist/esm/internal/effect-operator.js.map +0 -1
- package/dist/esm/internal/effect-producer.js +0 -47
- package/dist/esm/internal/effect-producer.js.map +0 -1
- package/dist/esm/internal/helpers.js +0 -299
- package/dist/esm/internal/helpers.js.map +0 -1
- package/dist/esm/internal/keyed.js +0 -153
- package/dist/esm/internal/keyed.js.map +0 -1
- package/dist/esm/internal/loop-operator.js +0 -186
- package/dist/esm/internal/loop-operator.js.map +0 -1
- package/dist/esm/internal/operator.js +0 -68
- package/dist/esm/internal/operator.js.map +0 -1
- package/dist/esm/internal/protos.js +0 -39
- package/dist/esm/internal/protos.js.map +0 -1
- package/dist/esm/internal/provide.js +0 -72
- package/dist/esm/internal/provide.js.map +0 -1
- package/dist/esm/internal/requestIdleCallback.js +0 -16
- package/dist/esm/internal/requestIdleCallback.js.map +0 -1
- package/dist/esm/internal/share.js +0 -62
- package/dist/esm/internal/share.js.map +0 -1
- package/dist/esm/internal/strategies.js +0 -8
- package/dist/esm/internal/strategies.js.map +0 -1
- package/dist/esm/internal/sync-operator.js +0 -95
- package/dist/esm/internal/sync-operator.js.map +0 -1
- package/dist/esm/internal/sync-producer.js +0 -90
- package/dist/esm/internal/sync-producer.js.map +0 -1
- package/dist/esm/internal/withKey.js +0 -56
- package/dist/esm/internal/withKey.js.map +0 -1
- package/dist/esm/package.json +0 -4
- package/src/AsyncData.ts +0 -453
- package/src/Emitter.ts +0 -59
- package/src/Form.ts +0 -489
- package/src/FormEntry.ts +0 -214
- package/src/Idle.ts +0 -294
- package/src/Match.ts +0 -314
- package/src/Pull.ts +0 -95
- package/src/RefChunk.ts +0 -407
- package/src/RefHashMap.ts +0 -335
- package/src/RefHashSet.ts +0 -179
- package/src/Stream.ts +0 -140
- package/src/TypeId.ts +0 -59
- package/src/Typeclass.ts +0 -459
- package/src/internal/DeferredRef.ts +0 -72
- package/src/internal/UnionToTuple.ts +0 -11
- package/src/internal/bounds.ts +0 -21
- package/src/internal/core.ts +0 -2771
- package/src/internal/diff.ts +0 -171
- package/src/internal/effect-loop-operator.ts +0 -466
- package/src/internal/effect-operator.ts +0 -317
- package/src/internal/effect-producer.ts +0 -125
- package/src/internal/helpers.ts +0 -538
- package/src/internal/keyed.ts +0 -235
- package/src/internal/loop-operator.ts +0 -266
- package/src/internal/operator.ts +0 -87
- package/src/internal/protos.ts +0 -57
- package/src/internal/provide.ts +0 -151
- package/src/internal/requestIdleCallback.ts +0 -19
- package/src/internal/share.ts +0 -97
- package/src/internal/strategies.ts +0 -15
- package/src/internal/sync-operator.ts +0 -166
- package/src/internal/sync-producer.ts +0 -148
- package/src/internal/withKey.ts +0 -82
- /package/dist/{dts → Fx}/internal/UnionToTuple.d.ts +0 -0
|
@@ -1,92 +1,64 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sink is a data structure which can be used to consume values from a stream.
|
|
3
|
-
* @since 1.20.0
|
|
4
|
-
*/
|
|
5
|
-
import * as C from "@typed/context";
|
|
6
1
|
import * as Cause from "effect/Cause";
|
|
7
|
-
import * as Clock from "effect/Clock";
|
|
8
2
|
import * as Effect from "effect/Effect";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
3
|
+
import * as Exit from "effect/Exit";
|
|
4
|
+
import { dual, flow, identity } from "effect/Function";
|
|
5
|
+
import * as MutableRef from "effect/MutableRef";
|
|
11
6
|
import * as Option from "effect/Option";
|
|
12
|
-
|
|
13
|
-
* @since 1.20.0
|
|
14
|
-
*/
|
|
15
|
-
export function make(onFailure, onSuccess) {
|
|
16
|
-
return {
|
|
17
|
-
onFailure,
|
|
18
|
-
onSuccess
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @since 1.20.0
|
|
23
|
-
*/
|
|
24
|
-
export function withEarlyExit(sink, f) {
|
|
25
|
-
return Effect.asyncEffect((resume) => {
|
|
26
|
-
const earlyExit = {
|
|
27
|
-
...sink,
|
|
28
|
-
earlyExit: Effect.sync(() => resume(Effect.void))
|
|
29
|
-
};
|
|
30
|
-
return Effect.matchCauseEffect(f(earlyExit), {
|
|
31
|
-
onFailure: (cause) => Effect.asVoid(sink.onFailure(cause)),
|
|
32
|
-
onSuccess: () => earlyExit.earlyExit
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Transform the input value of a Sink.
|
|
38
|
-
* @since 1.18.0
|
|
39
|
-
* @category combinators
|
|
40
|
-
*/
|
|
41
|
-
export const map = dual(2, function map(sink, f) {
|
|
42
|
-
return new MapSink(sink, f);
|
|
43
|
-
});
|
|
7
|
+
import * as Ref from "effect/Ref";
|
|
44
8
|
class MapSink {
|
|
45
9
|
sink;
|
|
46
10
|
f;
|
|
47
11
|
constructor(sink, f) {
|
|
48
12
|
this.sink = sink;
|
|
49
13
|
this.f = f;
|
|
50
|
-
this.onFailure = this.onFailure.bind(this);
|
|
51
14
|
this.onSuccess = this.onSuccess.bind(this);
|
|
52
|
-
|
|
53
|
-
onFailure(cause) {
|
|
54
|
-
return this.sink.onFailure(cause);
|
|
15
|
+
this.onFailure = this.onFailure.bind(this);
|
|
55
16
|
}
|
|
56
17
|
onSuccess(value) {
|
|
57
18
|
return this.sink.onSuccess(this.f(value));
|
|
58
19
|
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @since 1.20.0
|
|
62
|
-
*/
|
|
63
|
-
export function filter(sink, predicate) {
|
|
64
|
-
return new FilterSink(sink, predicate);
|
|
65
|
-
}
|
|
66
|
-
class FilterSink {
|
|
67
|
-
sink;
|
|
68
|
-
predicate;
|
|
69
|
-
constructor(sink, predicate) {
|
|
70
|
-
this.sink = sink;
|
|
71
|
-
this.predicate = predicate;
|
|
72
|
-
this.onFailure = this.onFailure.bind(this);
|
|
73
|
-
this.onSuccess = this.onSuccess.bind(this);
|
|
74
|
-
}
|
|
75
20
|
onFailure(cause) {
|
|
76
21
|
return this.sink.onFailure(cause);
|
|
77
22
|
}
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
23
|
+
static make(sink, f) {
|
|
24
|
+
if (sink instanceof MapSink) {
|
|
25
|
+
return new MapSink(sink.sink, flow(f, sink.f));
|
|
26
|
+
}
|
|
27
|
+
if (sink instanceof FilterMapSink) {
|
|
28
|
+
return new FilterMapSink(sink.sink, flow(f, sink.f));
|
|
29
|
+
}
|
|
30
|
+
return new MapSink(sink, f);
|
|
83
31
|
}
|
|
84
32
|
}
|
|
85
33
|
/**
|
|
86
|
-
*
|
|
34
|
+
* Transforms values before they reach the sink using a pure function.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { Effect } from "effect"
|
|
39
|
+
* import * as Sink from "@typed/fx/Sink"
|
|
40
|
+
* import { Fx } from "@typed/fx"
|
|
41
|
+
*
|
|
42
|
+
* const program = Effect.gen(function* () {
|
|
43
|
+
* const sink = Sink.make(
|
|
44
|
+
* (cause) => Effect.void,
|
|
45
|
+
* (value: number) => Effect.sync(() => console.log("Received:", value))
|
|
46
|
+
* )
|
|
47
|
+
*
|
|
48
|
+
* // Map string inputs to numbers
|
|
49
|
+
* const mapped = Sink.map(sink, (str: string) => parseInt(str))
|
|
50
|
+
*
|
|
51
|
+
* // Run an Fx with the mapped sink
|
|
52
|
+
* yield* Fx.fromIterable(["1", "2", "3"]).run(mapped)
|
|
53
|
+
* // Output: "Received: 1", "Received: 2", "Received: 3"
|
|
54
|
+
* })
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @since 1.0.0
|
|
58
|
+
* @category combinators
|
|
87
59
|
*/
|
|
88
|
-
export function
|
|
89
|
-
return
|
|
60
|
+
export function map(sink, f) {
|
|
61
|
+
return MapSink.make(sink, f);
|
|
90
62
|
}
|
|
91
63
|
class FilterMapSink {
|
|
92
64
|
sink;
|
|
@@ -94,130 +66,134 @@ class FilterMapSink {
|
|
|
94
66
|
constructor(sink, f) {
|
|
95
67
|
this.sink = sink;
|
|
96
68
|
this.f = f;
|
|
97
|
-
this.onFailure = this.onFailure.bind(this);
|
|
98
69
|
this.onSuccess = this.onSuccess.bind(this);
|
|
99
|
-
}
|
|
100
|
-
onFailure(cause) {
|
|
101
|
-
return this.sink.onFailure(cause);
|
|
102
|
-
}
|
|
103
|
-
onSuccess(value) {
|
|
104
|
-
const option = this.f(value);
|
|
105
|
-
if (Option.isSome(option))
|
|
106
|
-
return this.sink.onSuccess(option.value);
|
|
107
|
-
else
|
|
108
|
-
return Effect.void;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* @since 1.20.0
|
|
113
|
-
*/
|
|
114
|
-
export const mapEffect = dual(2, function mapEffect(sink, f) {
|
|
115
|
-
return new MapEffectSink(sink, f);
|
|
116
|
-
});
|
|
117
|
-
class MapEffectSink {
|
|
118
|
-
sink;
|
|
119
|
-
f;
|
|
120
|
-
constructor(sink, f) {
|
|
121
|
-
this.sink = sink;
|
|
122
|
-
this.f = f;
|
|
123
70
|
this.onFailure = this.onFailure.bind(this);
|
|
124
|
-
this.onSuccess = this.onSuccess.bind(this);
|
|
125
|
-
}
|
|
126
|
-
onFailure(cause) {
|
|
127
|
-
return this.sink.onFailure(cause);
|
|
128
71
|
}
|
|
129
72
|
onSuccess(value) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*/
|
|
136
|
-
export const filterMapEffect = dual(2, function filterMapEffect(sink, f) {
|
|
137
|
-
return new FilterMapEffectSink(sink, f);
|
|
138
|
-
});
|
|
139
|
-
class FilterMapEffectSink {
|
|
140
|
-
sink;
|
|
141
|
-
f;
|
|
142
|
-
constructor(sink, f) {
|
|
143
|
-
this.sink = sink;
|
|
144
|
-
this.f = f;
|
|
145
|
-
this.onFailure = this.onFailure.bind(this);
|
|
146
|
-
this.onSuccess = this.onSuccess.bind(this);
|
|
73
|
+
const a = this.f(value);
|
|
74
|
+
return Option.match(a, {
|
|
75
|
+
onSome: (a) => this.sink.onSuccess(a),
|
|
76
|
+
onNone: () => Effect.void,
|
|
77
|
+
});
|
|
147
78
|
}
|
|
148
79
|
onFailure(cause) {
|
|
149
80
|
return this.sink.onFailure(cause);
|
|
150
81
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
});
|
|
82
|
+
static make(sink, f) {
|
|
83
|
+
if (sink instanceof FilterMapSink) {
|
|
84
|
+
return new FilterMapSink(sink.sink, flow(f, Option.flatMap(sink.f)));
|
|
85
|
+
}
|
|
86
|
+
if (sink instanceof MapSink) {
|
|
87
|
+
return new FilterMapSink(sink.sink, flow(f, Option.map(sink.f)));
|
|
88
|
+
}
|
|
89
|
+
return new FilterMapSink(sink, f);
|
|
161
90
|
}
|
|
162
91
|
}
|
|
163
92
|
/**
|
|
164
|
-
*
|
|
93
|
+
* Filters and transforms values before they reach the sink using a function that returns an `Option`.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* import { Effect, Option } from "effect"
|
|
98
|
+
* import * as Sink from "@typed/fx/Sink"
|
|
99
|
+
* import { Fx } from "@typed/fx"
|
|
100
|
+
*
|
|
101
|
+
* const program = Effect.gen(function* () {
|
|
102
|
+
* const sink = Sink.make(
|
|
103
|
+
* (cause) => Effect.void,
|
|
104
|
+
* (value: number) => Effect.sync(() => console.log("Even:", value))
|
|
105
|
+
* )
|
|
106
|
+
*
|
|
107
|
+
* // Only pass through even numbers
|
|
108
|
+
* const filtered = Sink.filterMap(sink, (n: number) =>
|
|
109
|
+
* n % 2 === 0 ? Option.some(n) : Option.none()
|
|
110
|
+
* )
|
|
111
|
+
*
|
|
112
|
+
* yield* Fx.fromIterable([1, 2, 3, 4, 5]).run(filtered)
|
|
113
|
+
* // Output: "Even: 2", "Even: 4"
|
|
114
|
+
* })
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @since 1.0.0
|
|
118
|
+
* @category combinators
|
|
165
119
|
*/
|
|
166
|
-
export
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
sink;
|
|
171
|
-
f;
|
|
172
|
-
constructor(sink, f) {
|
|
173
|
-
this.sink = sink;
|
|
174
|
-
this.f = f;
|
|
175
|
-
this.onFailure = this.onFailure.bind(this);
|
|
176
|
-
this.onSuccess = this.onSuccess.bind(this);
|
|
177
|
-
}
|
|
178
|
-
onFailure(cause) {
|
|
179
|
-
return this.sink.onFailure(cause);
|
|
180
|
-
}
|
|
181
|
-
onSuccess(value) {
|
|
182
|
-
return Effect.matchCauseEffect(this.f(value), {
|
|
183
|
-
onFailure: (cause) => this.sink.onFailure(cause),
|
|
184
|
-
onSuccess: (b) => {
|
|
185
|
-
if (b)
|
|
186
|
-
return this.sink.onSuccess(value);
|
|
187
|
-
else
|
|
188
|
-
return Effect.void;
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}
|
|
120
|
+
export function filterMap(sink, f) {
|
|
121
|
+
return FilterMapSink.make(sink, f);
|
|
122
|
+
}
|
|
123
|
+
export function compact(sink) {
|
|
124
|
+
return filterMap(sink, identity);
|
|
192
125
|
}
|
|
193
126
|
/**
|
|
194
|
-
*
|
|
127
|
+
* Filters values before they reach the sink using a predicate function.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* import { Effect } from "effect"
|
|
132
|
+
* import * as Sink from "@typed/fx/Sink"
|
|
133
|
+
* import { Fx } from "@typed/fx"
|
|
134
|
+
*
|
|
135
|
+
* const program = Effect.gen(function* () {
|
|
136
|
+
* const sink = Sink.make(
|
|
137
|
+
* (cause) => Effect.void,
|
|
138
|
+
* (value: number) => Effect.sync(() => console.log("Positive:", value))
|
|
139
|
+
* )
|
|
140
|
+
*
|
|
141
|
+
* // Only pass through positive numbers
|
|
142
|
+
* const filtered = Sink.filter(sink, (n) => n > 0)
|
|
143
|
+
*
|
|
144
|
+
* yield* Fx.fromIterable([-2, -1, 0, 1, 2]).run(filtered)
|
|
145
|
+
* // Output: "Positive: 1", "Positive: 2"
|
|
146
|
+
* })
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @since 1.0.0
|
|
150
|
+
* @category combinators
|
|
195
151
|
*/
|
|
196
|
-
export
|
|
197
|
-
return
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
this.onFailure = this.onFailure.bind(this);
|
|
206
|
-
this.onSuccess = this.onSuccess.bind(this);
|
|
207
|
-
}
|
|
208
|
-
onFailure(cause) {
|
|
209
|
-
return this.sink.onFailure(cause);
|
|
210
|
-
}
|
|
211
|
-
onSuccess(value) {
|
|
212
|
-
return Effect.matchCauseEffect(this.f(value), {
|
|
213
|
-
onFailure: (cause) => this.sink.onFailure(cause),
|
|
214
|
-
onSuccess: () => this.sink.onSuccess(value)
|
|
152
|
+
export function filter(sink, f) {
|
|
153
|
+
return filterMap(sink, Option.liftPredicate(f));
|
|
154
|
+
}
|
|
155
|
+
export function withEarlyExit(sink, f) {
|
|
156
|
+
return Effect.servicesWith((services) => Effect.callback(function (resume, signal) {
|
|
157
|
+
let exited = false;
|
|
158
|
+
const earlyExit = Effect.sync(() => {
|
|
159
|
+
exited = true;
|
|
160
|
+
resume(Effect.void);
|
|
215
161
|
});
|
|
216
|
-
|
|
162
|
+
const onSuccess = (a) => {
|
|
163
|
+
if (exited)
|
|
164
|
+
return Effect.void;
|
|
165
|
+
return sink.onSuccess(a);
|
|
166
|
+
};
|
|
167
|
+
const onFailure = (cause) => {
|
|
168
|
+
if (exited)
|
|
169
|
+
return Effect.void;
|
|
170
|
+
return sink.onFailure(cause);
|
|
171
|
+
};
|
|
172
|
+
const sinkWithEarlyExit = {
|
|
173
|
+
onSuccess,
|
|
174
|
+
onFailure,
|
|
175
|
+
earlyExit,
|
|
176
|
+
};
|
|
177
|
+
f(sinkWithEarlyExit, { signal, scheduler: this }).pipe(Effect.flatMap(() => earlyExit), (_) => Effect.runForkWith(services)(_, { scheduler: this, signal }));
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
export function withState(sink, state, f) {
|
|
181
|
+
return withEarlyExit(sink, (sink, params) => f({ ...sink, state: Ref.makeUnsafe(state) }, params));
|
|
182
|
+
}
|
|
183
|
+
export function withStateSemaphore(sink, state, f) {
|
|
184
|
+
return withEarlyExit(sink, (sink, params) => {
|
|
185
|
+
const stateRef = MutableRef.make(state);
|
|
186
|
+
const semaphore = Effect.makeSemaphoreUnsafe(1);
|
|
187
|
+
const lock = semaphore.withPermits(1);
|
|
188
|
+
const modifyEffect = (f) => Effect.suspend(() => f(MutableRef.get(stateRef))).pipe(Effect.flatMap(([c, b]) => {
|
|
189
|
+
MutableRef.set(stateRef, b);
|
|
190
|
+
return Effect.succeed(c);
|
|
191
|
+
}), lock);
|
|
192
|
+
const updateEffect = (f) => modifyEffect((state) => f(state).pipe(Effect.map((b) => [b, b])));
|
|
193
|
+
const get = modifyEffect((state) => Effect.succeed([state, state]));
|
|
194
|
+
return f({ ...sink, modifyEffect, updateEffect, get }, params);
|
|
195
|
+
});
|
|
217
196
|
}
|
|
218
|
-
/**
|
|
219
|
-
* @since 1.20.0
|
|
220
|
-
*/
|
|
221
197
|
export const loop = dual(3, function loop(sink, seed, f) {
|
|
222
198
|
return new LoopSink(sink, seed, f);
|
|
223
199
|
});
|
|
@@ -241,9 +217,6 @@ class LoopSink {
|
|
|
241
217
|
return this.sink.onSuccess(c);
|
|
242
218
|
}
|
|
243
219
|
}
|
|
244
|
-
/**
|
|
245
|
-
* @since 1.20.0
|
|
246
|
-
*/
|
|
247
220
|
export const loopCause = dual(3, function loopCause(sink, seed, f) {
|
|
248
221
|
return new LoopCauseSink(sink, seed, f);
|
|
249
222
|
});
|
|
@@ -267,9 +240,6 @@ class LoopCauseSink {
|
|
|
267
240
|
return this.sink.onSuccess(value);
|
|
268
241
|
}
|
|
269
242
|
}
|
|
270
|
-
/**
|
|
271
|
-
* @since 1.20.0
|
|
272
|
-
*/
|
|
273
243
|
export const filterMapLoop = dual(3, function filterMapLoop(sink, seed, f) {
|
|
274
244
|
return new FilterMapLoopSink(sink, seed, f);
|
|
275
245
|
});
|
|
@@ -292,13 +262,9 @@ class FilterMapLoopSink {
|
|
|
292
262
|
this.seed = acc;
|
|
293
263
|
if (Option.isSome(option))
|
|
294
264
|
return this.sink.onSuccess(option.value);
|
|
295
|
-
|
|
296
|
-
return Effect.void;
|
|
265
|
+
return Effect.void;
|
|
297
266
|
}
|
|
298
267
|
}
|
|
299
|
-
/**
|
|
300
|
-
* @since 1.20.0
|
|
301
|
-
*/
|
|
302
268
|
export const filterMapLoopCause = dual(3, function filterMapLoopCause(sink, seed, f) {
|
|
303
269
|
return new FilterMapLoopCauseSink(sink, seed, f);
|
|
304
270
|
});
|
|
@@ -318,16 +284,12 @@ class FilterMapLoopCauseSink {
|
|
|
318
284
|
this.seed = acc;
|
|
319
285
|
if (Option.isSome(option))
|
|
320
286
|
return this.sink.onFailure(option.value);
|
|
321
|
-
|
|
322
|
-
return Effect.void;
|
|
287
|
+
return Effect.void;
|
|
323
288
|
}
|
|
324
289
|
onSuccess(value) {
|
|
325
290
|
return this.sink.onSuccess(value);
|
|
326
291
|
}
|
|
327
292
|
}
|
|
328
|
-
/**
|
|
329
|
-
* @since 1.20.0
|
|
330
|
-
*/
|
|
331
293
|
export const loopEffect = dual(3, function loopEffect(sink, seed, f) {
|
|
332
294
|
return new LoopEffectSink(sink, seed, f);
|
|
333
295
|
});
|
|
@@ -351,13 +313,10 @@ class LoopEffectSink {
|
|
|
351
313
|
onSuccess: ([c, acc]) => {
|
|
352
314
|
this.seed = acc;
|
|
353
315
|
return this.sink.onSuccess(c);
|
|
354
|
-
}
|
|
316
|
+
},
|
|
355
317
|
});
|
|
356
318
|
}
|
|
357
319
|
}
|
|
358
|
-
/**
|
|
359
|
-
* @since 1.20.0
|
|
360
|
-
*/
|
|
361
320
|
export const filterMapLoopEffect = dual(3, function filterMapLoopEffect(sink, seed, f) {
|
|
362
321
|
return new FilterMapLoopEffectSink(sink, seed, f);
|
|
363
322
|
});
|
|
@@ -382,15 +341,11 @@ class FilterMapLoopEffectSink {
|
|
|
382
341
|
this.seed = acc;
|
|
383
342
|
if (Option.isSome(option))
|
|
384
343
|
return this.sink.onSuccess(option.value);
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
344
|
+
return Effect.void;
|
|
345
|
+
},
|
|
388
346
|
});
|
|
389
347
|
}
|
|
390
348
|
}
|
|
391
|
-
/**
|
|
392
|
-
* @since 1.20.0
|
|
393
|
-
*/
|
|
394
349
|
export const loopCauseEffect = dual(3, function loopCauseEffect(sink, seed, f) {
|
|
395
350
|
return new LoopCauseEffectSink(sink, seed, f);
|
|
396
351
|
});
|
|
@@ -407,20 +362,17 @@ class LoopCauseEffectSink {
|
|
|
407
362
|
}
|
|
408
363
|
onFailure(cause) {
|
|
409
364
|
return Effect.matchCauseEffect(this.f(this.seed, cause), {
|
|
410
|
-
onFailure: (cause2) => this.sink.onFailure(Cause.
|
|
365
|
+
onFailure: (cause2) => this.sink.onFailure(Cause.fromReasons([...cause.reasons, ...cause2.reasons])),
|
|
411
366
|
onSuccess: ([c, acc]) => {
|
|
412
367
|
this.seed = acc;
|
|
413
368
|
return this.sink.onFailure(c);
|
|
414
|
-
}
|
|
369
|
+
},
|
|
415
370
|
});
|
|
416
371
|
}
|
|
417
372
|
onSuccess(value) {
|
|
418
373
|
return this.sink.onSuccess(value);
|
|
419
374
|
}
|
|
420
375
|
}
|
|
421
|
-
/**
|
|
422
|
-
* @since 1.20.0
|
|
423
|
-
*/
|
|
424
376
|
export function filterMapLoopCauseEffect(sink, seed, f) {
|
|
425
377
|
return new FilterMapLoopCauseEffectSink(sink, seed, f);
|
|
426
378
|
}
|
|
@@ -442,31 +394,27 @@ class FilterMapLoopCauseEffectSink {
|
|
|
442
394
|
this.seed = acc;
|
|
443
395
|
if (Option.isSome(option))
|
|
444
396
|
return this.sink.onFailure(option.value);
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
397
|
+
return Effect.void;
|
|
398
|
+
},
|
|
448
399
|
});
|
|
449
400
|
}
|
|
450
401
|
onSuccess(value) {
|
|
451
402
|
return this.sink.onSuccess(value);
|
|
452
403
|
}
|
|
453
404
|
}
|
|
454
|
-
/**
|
|
455
|
-
* @since 1.20.0
|
|
456
|
-
*/
|
|
457
405
|
export const slice = dual(3, function slice(sink, bounds, f) {
|
|
458
406
|
return withEarlyExit(sink, (s) => f(new SliceSink(s, bounds)));
|
|
459
407
|
});
|
|
460
408
|
class SliceSink {
|
|
461
|
-
sink;
|
|
462
|
-
bounds;
|
|
463
409
|
drop;
|
|
464
410
|
take;
|
|
411
|
+
sink;
|
|
412
|
+
bounds;
|
|
465
413
|
constructor(sink, bounds) {
|
|
466
414
|
this.sink = sink;
|
|
467
415
|
this.bounds = bounds;
|
|
468
|
-
this.drop = this.bounds.
|
|
469
|
-
this.take = this.bounds.
|
|
416
|
+
this.drop = this.bounds.skip;
|
|
417
|
+
this.take = this.bounds.take;
|
|
470
418
|
this.onFailure = this.onFailure.bind(this);
|
|
471
419
|
this.onSuccess = this.onSuccess.bind(this);
|
|
472
420
|
}
|
|
@@ -484,20 +432,15 @@ class SliceSink {
|
|
|
484
432
|
return this.sink.earlyExit;
|
|
485
433
|
}
|
|
486
434
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
*/
|
|
490
|
-
export const takeWhile = dual(3, function takeWhile(sink, predicate, f) {
|
|
491
|
-
return withEarlyExit(sink, (s) => f(new TakeWhileSink(s, predicate)));
|
|
435
|
+
export const mapEffect = dual(2, function mapEffect(sink, f) {
|
|
436
|
+
return new MapEffectSink(sink, f);
|
|
492
437
|
});
|
|
493
|
-
class
|
|
438
|
+
class MapEffectSink {
|
|
494
439
|
sink;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
constructor(sink, predicate) {
|
|
440
|
+
f;
|
|
441
|
+
constructor(sink, f) {
|
|
498
442
|
this.sink = sink;
|
|
499
|
-
this.
|
|
500
|
-
this.take = true;
|
|
443
|
+
this.f = f;
|
|
501
444
|
this.onFailure = this.onFailure.bind(this);
|
|
502
445
|
this.onSuccess = this.onSuccess.bind(this);
|
|
503
446
|
}
|
|
@@ -505,35 +448,18 @@ class TakeWhileSink {
|
|
|
505
448
|
return this.sink.onFailure(cause);
|
|
506
449
|
}
|
|
507
450
|
onSuccess(value) {
|
|
508
|
-
|
|
509
|
-
return this.sink.onSuccess(value);
|
|
510
|
-
else {
|
|
511
|
-
this.take = false;
|
|
512
|
-
return this.sink.earlyExit;
|
|
513
|
-
}
|
|
451
|
+
return Effect.matchCauseEffect(this.f(value), this.sink);
|
|
514
452
|
}
|
|
515
453
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
*/
|
|
519
|
-
export const dropWhile = dual(2, function dropWhile(sink, predicate) {
|
|
520
|
-
return filterMapLoop(sink, true, (drop, a) => {
|
|
521
|
-
const drop2 = drop && predicate(a);
|
|
522
|
-
return [drop2 ? Option.none() : Option.some(a), drop2];
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
/**
|
|
526
|
-
* @since 2.0.0
|
|
527
|
-
*/
|
|
528
|
-
export const dropAfter = dual(3, function dropAfter(sink, predicate, f) {
|
|
529
|
-
return withEarlyExit(sink, (s) => f(new DropAfterSink(s, predicate)));
|
|
454
|
+
export const filterMapEffect = dual(2, function filterMapEffect(sink, f) {
|
|
455
|
+
return new FilterMapEffectSink(sink, f);
|
|
530
456
|
});
|
|
531
|
-
class
|
|
457
|
+
class FilterMapEffectSink {
|
|
532
458
|
sink;
|
|
533
|
-
|
|
534
|
-
constructor(sink,
|
|
459
|
+
f;
|
|
460
|
+
constructor(sink, f) {
|
|
535
461
|
this.sink = sink;
|
|
536
|
-
this.
|
|
462
|
+
this.f = f;
|
|
537
463
|
this.onFailure = this.onFailure.bind(this);
|
|
538
464
|
this.onSuccess = this.onSuccess.bind(this);
|
|
539
465
|
}
|
|
@@ -541,26 +467,26 @@ class DropAfterSink {
|
|
|
541
467
|
return this.sink.onFailure(cause);
|
|
542
468
|
}
|
|
543
469
|
onSuccess(value) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
470
|
+
return Effect.matchCauseEffect(this.f(value), {
|
|
471
|
+
onFailure: (cause) => this.sink.onFailure(cause),
|
|
472
|
+
onSuccess: (option) => {
|
|
473
|
+
if (Option.isSome(option))
|
|
474
|
+
return this.sink.onSuccess(option.value);
|
|
475
|
+
else
|
|
476
|
+
return Effect.void;
|
|
477
|
+
},
|
|
478
|
+
});
|
|
548
479
|
}
|
|
549
480
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
*/
|
|
553
|
-
export const takeWhileEffect = dual(3, function takeWhileEffect(sink, predicate, f) {
|
|
554
|
-
return withEarlyExit(sink, (s) => f(new TakeWhileEffectSink(s, predicate)));
|
|
481
|
+
export const filterEffect = dual(2, function filterEffect(sink, f) {
|
|
482
|
+
return new FilterEffectSink(sink, f);
|
|
555
483
|
});
|
|
556
|
-
class
|
|
484
|
+
class FilterEffectSink {
|
|
557
485
|
sink;
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
constructor(sink, predicate) {
|
|
486
|
+
f;
|
|
487
|
+
constructor(sink, f) {
|
|
561
488
|
this.sink = sink;
|
|
562
|
-
this.
|
|
563
|
-
this.take = true;
|
|
489
|
+
this.f = f;
|
|
564
490
|
this.onFailure = this.onFailure.bind(this);
|
|
565
491
|
this.onSuccess = this.onSuccess.bind(this);
|
|
566
492
|
}
|
|
@@ -568,106 +494,93 @@ class TakeWhileEffectSink {
|
|
|
568
494
|
return this.sink.onFailure(cause);
|
|
569
495
|
}
|
|
570
496
|
onSuccess(value) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
});
|
|
581
|
-
}
|
|
582
|
-
else
|
|
583
|
-
return this.sink.earlyExit;
|
|
497
|
+
return Effect.matchCauseEffect(this.f(value), {
|
|
498
|
+
onFailure: (cause) => this.sink.onFailure(cause),
|
|
499
|
+
onSuccess: (b) => {
|
|
500
|
+
if (b)
|
|
501
|
+
return this.sink.onSuccess(value);
|
|
502
|
+
else
|
|
503
|
+
return Effect.void;
|
|
504
|
+
},
|
|
505
|
+
});
|
|
584
506
|
}
|
|
585
507
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
*/
|
|
589
|
-
export const dropWhileEffect = dual(2, function dropWhileEffect(sink, predicate) {
|
|
590
|
-
return filterMapLoopEffect(sink, true, (drop, a) => {
|
|
591
|
-
if (drop === false)
|
|
592
|
-
return Effect.succeed([Option.some(a), drop]);
|
|
593
|
-
return Effect.map(predicate(a), (b) => [b ? Option.none() : Option.some(a), b]);
|
|
594
|
-
});
|
|
595
|
-
});
|
|
596
|
-
/**
|
|
597
|
-
* @since 1.20.0
|
|
598
|
-
*/
|
|
599
|
-
export const dropAfterEffect = dual(2, function dropAfterEffect(sink, predicate) {
|
|
600
|
-
return filterMapLoopEffect(sink, false, (drop, a) => {
|
|
601
|
-
if (drop === true)
|
|
602
|
-
return Effect.succeed([Option.none(), drop]);
|
|
603
|
-
return Effect.map(predicate(a), (b) => [Option.some(a), b]);
|
|
604
|
-
});
|
|
605
|
-
});
|
|
606
|
-
/**
|
|
607
|
-
* @since 1.20.0
|
|
608
|
-
*/
|
|
609
|
-
export const provide = dual(2, function provide(sink, ctx) {
|
|
610
|
-
return make((cause) => Effect.provide(sink.onFailure(cause), ctx), (a) => Effect.provide(sink.onSuccess(a), ctx));
|
|
611
|
-
});
|
|
612
|
-
/**
|
|
613
|
-
* @since 1.20.0
|
|
614
|
-
*/
|
|
615
|
-
export const setSpan = dual(2, function setSpan(self, span) {
|
|
616
|
-
return make((cause) => addEvent(self.onFailure(cause), "fx.failure", span, {
|
|
617
|
-
"cause": Cause.pretty(cause)
|
|
618
|
-
}), (a) => addEvent(self.onSuccess(a), "fx.success", span, {
|
|
619
|
-
"value": JSON.stringify(a)
|
|
620
|
-
}));
|
|
508
|
+
export const tapEffect = dual(2, function tapEffect(sink, f) {
|
|
509
|
+
return new TapEffectSink(sink, f);
|
|
621
510
|
});
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
511
|
+
class TapEffectSink {
|
|
512
|
+
sink;
|
|
513
|
+
f;
|
|
514
|
+
constructor(sink, f) {
|
|
515
|
+
this.sink = sink;
|
|
516
|
+
this.f = f;
|
|
517
|
+
this.onFailure = this.onFailure.bind(this);
|
|
518
|
+
this.onSuccess = this.onSuccess.bind(this);
|
|
519
|
+
}
|
|
520
|
+
onFailure(cause) {
|
|
521
|
+
return this.sink.onFailure(cause);
|
|
522
|
+
}
|
|
523
|
+
onSuccess(value) {
|
|
524
|
+
return Effect.matchCauseEffect(this.f(value), {
|
|
525
|
+
onFailure: (cause) => this.sink.onFailure(cause),
|
|
526
|
+
onSuccess: () => this.sink.onSuccess(value),
|
|
527
|
+
});
|
|
528
|
+
}
|
|
631
529
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
530
|
+
export const flip = (sink) => new FlipSink(sink);
|
|
531
|
+
class FlipSink {
|
|
532
|
+
sink;
|
|
533
|
+
constructor(sink) {
|
|
534
|
+
this.sink = sink;
|
|
636
535
|
}
|
|
637
536
|
onSuccess(value) {
|
|
638
|
-
return this.
|
|
537
|
+
return this.sink.onFailure(Cause.fail(value));
|
|
639
538
|
}
|
|
640
539
|
onFailure(cause) {
|
|
641
|
-
|
|
540
|
+
const fail = cause.reasons.find((failure) => failure._tag === "Fail");
|
|
541
|
+
if (!fail)
|
|
542
|
+
return this.sink.onFailure(cause);
|
|
543
|
+
return this.sink.onSuccess(fail.error);
|
|
642
544
|
}
|
|
643
|
-
make = (sink) => Layer.flatMap(Layer.context(), (ctx) => this.tag.layer(provide(sink, ctx)));
|
|
644
545
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
});
|
|
651
|
-
class FromTag {
|
|
652
|
-
tag;
|
|
653
|
-
f;
|
|
654
|
-
get;
|
|
655
|
-
constructor(tag, f) {
|
|
656
|
-
this.tag = tag;
|
|
657
|
-
this.f = f;
|
|
658
|
-
this.get = Effect.map(tag, f);
|
|
546
|
+
export const exit = (sink) => new ExitSink(sink);
|
|
547
|
+
class ExitSink {
|
|
548
|
+
sink;
|
|
549
|
+
constructor(sink) {
|
|
550
|
+
this.sink = sink;
|
|
659
551
|
}
|
|
660
552
|
onSuccess(value) {
|
|
661
|
-
return
|
|
553
|
+
return this.sink.onSuccess(Exit.succeed(value));
|
|
662
554
|
}
|
|
663
555
|
onFailure(cause) {
|
|
664
|
-
return
|
|
556
|
+
return this.sink.onSuccess(Exit.failCause(cause));
|
|
665
557
|
}
|
|
666
558
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
559
|
+
export const dropAfter = dual(3, function dropAfter(sink, predicate, f) {
|
|
560
|
+
return withEarlyExit(sink, (s) => f(new DropAfterSink(s, predicate)).pipe(Effect.catchCause(sink.onFailure)));
|
|
561
|
+
});
|
|
562
|
+
class DropAfterSink {
|
|
563
|
+
sink;
|
|
564
|
+
predicate;
|
|
565
|
+
constructor(sink, predicate) {
|
|
566
|
+
this.sink = sink;
|
|
567
|
+
this.predicate = predicate;
|
|
568
|
+
this.onFailure = this.onFailure.bind(this);
|
|
569
|
+
this.onSuccess = this.onSuccess.bind(this);
|
|
570
|
+
}
|
|
571
|
+
onFailure(cause) {
|
|
572
|
+
return this.sink.onFailure(cause);
|
|
573
|
+
}
|
|
574
|
+
onSuccess(value) {
|
|
575
|
+
if (this.predicate(value)) {
|
|
576
|
+
return Effect.flatMap(this.sink.onSuccess(value), () => this.sink.earlyExit);
|
|
577
|
+
}
|
|
578
|
+
return this.sink.onSuccess(value);
|
|
579
|
+
}
|
|
672
580
|
}
|
|
673
|
-
|
|
581
|
+
export const skipInterrupt = (sink) => {
|
|
582
|
+
return {
|
|
583
|
+
onSuccess: (value) => sink.onSuccess(value),
|
|
584
|
+
onFailure: (cause) => cause.reasons.every(Cause.isInterruptReason) ? Effect.void : sink.onFailure(cause),
|
|
585
|
+
};
|
|
586
|
+
};
|