effect 2.0.0-next.38 → 2.0.0-next.39
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/Bigint/dist/effect-Bigint.esm.js +346 -5
- package/Boolean/dist/effect-Boolean.esm.js +230 -5
- package/Brand/dist/effect-Brand.esm.js +204 -20
- package/Cache/dist/effect-Cache.cjs.dev.js +13 -13
- package/Cache/dist/effect-Cache.cjs.prod.js +13 -13
- package/Cache/dist/effect-Cache.esm.js +111 -74
- package/Cause/dist/effect-Cause.esm.js +668 -33
- package/Channel/dist/effect-Channel.cjs.dev.js +36 -36
- package/Channel/dist/effect-Channel.cjs.prod.js +36 -36
- package/Channel/dist/effect-Channel.esm.js +1001 -107
- package/ChannelChildExecutorDecision/dist/effect-ChannelChildExecutorDecision.esm.js +112 -3
- package/ChannelMergeDecision/dist/effect-ChannelMergeDecision.esm.js +60 -3
- package/ChannelMergeState/dist/effect-ChannelMergeState.esm.js +101 -3
- package/ChannelMergeStrategy/dist/effect-ChannelMergeStrategy.esm.js +84 -3
- package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.dev.js +28 -28
- package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.prod.js +28 -28
- package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.esm.js +47 -91
- package/ChannelUpstreamPullRequest/dist/effect-ChannelUpstreamPullRequest.esm.js +84 -3
- package/ChannelUpstreamPullStrategy/dist/effect-ChannelUpstreamPullStrategy.esm.js +83 -3
- package/Chunk/dist/effect-Chunk.esm.js +1084 -20
- package/Clock/dist/effect-Clock.cjs.dev.js +3 -3
- package/Clock/dist/effect-Clock.cjs.prod.js +3 -3
- package/Clock/dist/effect-Clock.esm.js +78 -42
- package/Config/dist/effect-Config.esm.js +321 -37
- package/ConfigError/dist/effect-ConfigError.esm.js +185 -21
- package/ConfigProvider/dist/effect-ConfigProvider.esm.js +198 -39
- package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.esm.js +70 -24
- package/ConfigSecret/dist/effect-ConfigSecret.esm.js +63 -22
- package/Console/dist/effect-Console.cjs.dev.js +22 -22
- package/Console/dist/effect-Console.cjs.prod.js +22 -22
- package/Console/dist/effect-Console.esm.js +154 -83
- package/Context/dist/effect-Context.esm.js +295 -17
- package/Data/dist/effect-Data.esm.js +163 -7
- package/DefaultServices/dist/effect-DefaultServices.cjs.dev.js +3 -3
- package/DefaultServices/dist/effect-DefaultServices.cjs.prod.js +3 -3
- package/DefaultServices/dist/effect-DefaultServices.esm.js +24 -42
- package/Deferred/dist/effect-Deferred.esm.js +206 -33
- package/Differ/dist/effect-Differ.esm.js +137 -26
- package/Duration/dist/effect-Duration.cjs.dev.js +2 -1
- package/Duration/dist/effect-Duration.cjs.mjs +1 -0
- package/Duration/dist/effect-Duration.cjs.prod.js +2 -1
- package/Duration/dist/effect-Duration.esm.js +438 -16
- package/Effect/dist/effect-Effect.cjs.dev.js +26 -26
- package/Effect/dist/effect-Effect.cjs.prod.js +26 -26
- package/Effect/dist/effect-Effect.esm.js +3093 -89
- package/Effectable/dist/effect-Effectable.esm.js +77 -10
- package/Either/dist/effect-Either.esm.js +442 -13
- package/Encoding/dist/effect-Encoding.esm.js +123 -14
- package/Equal/dist/effect-Equal.esm.js +57 -6
- package/Equivalence/dist/effect-Equivalence.esm.js +196 -2
- package/Error/dist/effect-Error.cjs.dev.js +27 -27
- package/Error/dist/effect-Error.cjs.prod.js +27 -27
- package/Error/dist/effect-Error.esm.js +47 -91
- package/ExecutionStrategy/dist/effect-ExecutionStrategy.esm.js +99 -2
- package/Exit/dist/effect-Exit.esm.js +332 -33
- package/Fiber/dist/effect-Fiber.cjs.dev.js +18 -18
- package/Fiber/dist/effect-Fiber.cjs.prod.js +18 -18
- package/Fiber/dist/effect-Fiber.esm.js +423 -77
- package/FiberId/dist/effect-FiberId.esm.js +161 -20
- package/FiberRef/dist/effect-FiberRef.cjs.dev.js +14 -14
- package/FiberRef/dist/effect-FiberRef.cjs.prod.js +14 -14
- package/FiberRef/dist/effect-FiberRef.esm.js +289 -75
- package/FiberRefs/dist/effect-FiberRefs.esm.js +107 -34
- package/FiberRefsPatch/dist/effect-FiberRefsPatch.esm.js +76 -35
- package/FiberStatus/dist/effect-FiberStatus.esm.js +89 -7
- package/Function/dist/effect-Function.esm.js +492 -1
- package/GlobalValue/dist/effect-GlobalValue.esm.js +20 -1
- package/GroupBy/dist/effect-GroupBy.cjs.dev.js +37 -37
- package/GroupBy/dist/effect-GroupBy.cjs.prod.js +37 -37
- package/GroupBy/dist/effect-GroupBy.esm.js +63 -108
- package/Hash/dist/effect-Hash.esm.js +164 -5
- package/HashMap/dist/effect-HashMap.esm.js +287 -18
- package/HashSet/dist/effect-HashSet.esm.js +227 -18
- package/Hub/dist/effect-Hub.cjs.dev.js +13 -13
- package/Hub/dist/effect-Hub.cjs.prod.js +13 -13
- package/Hub/dist/effect-Hub.esm.js +148 -74
- package/Inspectable/dist/effect-Inspectable.esm.js +38 -1
- package/KeyedPool/dist/effect-KeyedPool.cjs.dev.js +14 -14
- package/KeyedPool/dist/effect-KeyedPool.cjs.prod.js +14 -14
- package/KeyedPool/dist/effect-KeyedPool.esm.js +104 -75
- package/Layer/dist/effect-Layer.cjs.dev.js +22 -22
- package/Layer/dist/effect-Layer.cjs.prod.js +22 -22
- package/Layer/dist/effect-Layer.esm.js +557 -83
- package/List/dist/effect-List.esm.js +816 -21
- package/LogLevel/dist/effect-LogLevel.esm.js +202 -33
- package/LogSpan/dist/effect-LogSpan.esm.js +24 -1
- package/Logger/dist/effect-Logger.cjs.dev.js +24 -24
- package/Logger/dist/effect-Logger.cjs.prod.js +24 -24
- package/Logger/dist/effect-Logger.esm.js +198 -85
- package/Metric/dist/effect-Metric.cjs.dev.js +12 -12
- package/Metric/dist/effect-Metric.cjs.prod.js +12 -12
- package/Metric/dist/effect-Metric.esm.js +395 -71
- package/MetricBoundaries/dist/effect-MetricBoundaries.esm.js +52 -22
- package/MetricHook/dist/effect-MetricHook.cjs.dev.js +3 -3
- package/MetricHook/dist/effect-MetricHook.cjs.prod.js +3 -3
- package/MetricHook/dist/effect-MetricHook.esm.js +68 -27
- package/MetricKey/dist/effect-MetricKey.cjs.dev.js +4 -4
- package/MetricKey/dist/effect-MetricKey.cjs.prod.js +4 -4
- package/MetricKey/dist/effect-MetricKey.esm.js +104 -23
- package/MetricKeyType/dist/effect-MetricKeyType.cjs.dev.js +3 -3
- package/MetricKeyType/dist/effect-MetricKeyType.cjs.prod.js +3 -3
- package/MetricKeyType/dist/effect-MetricKeyType.esm.js +147 -18
- package/MetricLabel/dist/effect-MetricLabel.esm.js +41 -9
- package/MetricPair/dist/effect-MetricPair.esm.js +38 -3
- package/MetricPolling/dist/effect-MetricPolling.cjs.dev.js +18 -18
- package/MetricPolling/dist/effect-MetricPolling.cjs.prod.js +18 -18
- package/MetricPolling/dist/effect-MetricPolling.esm.js +84 -77
- package/MetricRegistry/dist/effect-MetricRegistry.cjs.dev.js +5 -5
- package/MetricRegistry/dist/effect-MetricRegistry.cjs.prod.js +5 -5
- package/MetricRegistry/dist/effect-MetricRegistry.esm.js +28 -33
- package/MetricState/dist/effect-MetricState.esm.js +151 -9
- package/MutableHashMap/dist/effect-MutableHashMap.esm.js +128 -20
- package/MutableHashSet/dist/effect-MutableHashSet.esm.js +90 -21
- package/MutableList/dist/effect-MutableList.esm.js +264 -4
- package/MutableQueue/dist/effect-MutableQueue.esm.js +187 -22
- package/MutableRef/dist/effect-MutableRef.esm.js +156 -9
- package/NonEmptyIterable/dist/effect-NonEmptyIterable.esm.js +28 -1
- package/Number/dist/effect-Number.esm.js +369 -5
- package/Option/dist/effect-Option.esm.js +1071 -15
- package/Order/dist/effect-Order.esm.js +263 -2
- package/Ordering/dist/effect-Ordering.esm.js +88 -2
- package/Pipeable/dist/effect-Pipeable.esm.js +44 -1
- package/Pool/dist/effect-Pool.cjs.dev.js +14 -14
- package/Pool/dist/effect-Pool.cjs.prod.js +14 -14
- package/Pool/dist/effect-Pool.esm.js +104 -75
- package/Predicate/dist/effect-Predicate.esm.js +634 -2
- package/Queue/dist/effect-Queue.cjs.dev.js +13 -13
- package/Queue/dist/effect-Queue.cjs.prod.js +13 -13
- package/Queue/dist/effect-Queue.esm.js +328 -74
- package/Random/dist/effect-Random.cjs.dev.js +3 -3
- package/Random/dist/effect-Random.cjs.prod.js +3 -3
- package/Random/dist/effect-Random.esm.js +83 -42
- package/ReadonlyArray/dist/effect-ReadonlyArray.esm.js +1445 -19
- package/ReadonlyRecord/dist/effect-ReadonlyRecord.esm.js +518 -17
- package/RedBlackTree/dist/effect-RedBlackTree.esm.js +314 -22
- package/Ref/dist/effect-Ref.esm.js +111 -33
- package/Reloadable/dist/effect-Reloadable.cjs.dev.js +23 -23
- package/Reloadable/dist/effect-Reloadable.cjs.prod.js +23 -23
- package/Reloadable/dist/effect-Reloadable.esm.js +88 -84
- package/Request/dist/effect-Request.cjs.dev.js +13 -13
- package/Request/dist/effect-Request.cjs.prod.js +13 -13
- package/Request/dist/effect-Request.esm.js +160 -74
- package/RequestBlock/dist/effect-RequestBlock.cjs.dev.js +28 -28
- package/RequestBlock/dist/effect-RequestBlock.cjs.prod.js +28 -28
- package/RequestBlock/dist/effect-RequestBlock.esm.js +103 -91
- package/RequestResolver/dist/effect-RequestResolver.cjs.dev.js +28 -28
- package/RequestResolver/dist/effect-RequestResolver.cjs.prod.js +28 -28
- package/RequestResolver/dist/effect-RequestResolver.esm.js +191 -91
- package/Resource/dist/effect-Resource.cjs.dev.js +19 -19
- package/Resource/dist/effect-Resource.cjs.prod.js +19 -19
- package/Resource/dist/effect-Resource.esm.js +70 -79
- package/Runtime/dist/effect-Runtime.cjs.dev.js +20 -20
- package/Runtime/dist/effect-Runtime.cjs.prod.js +20 -20
- package/Runtime/dist/effect-Runtime.esm.js +157 -79
- package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.dev.js +24 -24
- package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.prod.js +24 -24
- package/RuntimeFlags/dist/effect-RuntimeFlags.esm.js +305 -85
- package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.esm.js +158 -27
- package/STM/dist/effect-STM.cjs.dev.js +41 -41
- package/STM/dist/effect-STM.cjs.prod.js +41 -41
- package/STM/dist/effect-STM.esm.js +1193 -112
- package/Schedule/dist/effect-Schedule.cjs.dev.js +11 -11
- package/Schedule/dist/effect-Schedule.cjs.prod.js +11 -11
- package/Schedule/dist/effect-Schedule.esm.js +957 -57
- package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.dev.js +4 -4
- package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.prod.js +4 -4
- package/ScheduleDecision/dist/effect-ScheduleDecision.esm.js +48 -24
- package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.dev.js +2 -2
- package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.prod.js +2 -2
- package/ScheduleInterval/dist/effect-ScheduleInterval.esm.js +130 -17
- package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.dev.js +3 -3
- package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.prod.js +3 -3
- package/ScheduleIntervals/dist/effect-ScheduleIntervals.esm.js +105 -23
- package/Scheduler/dist/effect-Scheduler.esm.js +326 -34
- package/Scope/dist/effect-Scope.cjs.dev.js +12 -12
- package/Scope/dist/effect-Scope.cjs.prod.js +12 -12
- package/Scope/dist/effect-Scope.esm.js +117 -71
- package/ScopedCache/dist/effect-ScopedCache.cjs.dev.js +14 -14
- package/ScopedCache/dist/effect-ScopedCache.cjs.prod.js +14 -14
- package/ScopedCache/dist/effect-ScopedCache.esm.js +52 -75
- package/ScopedRef/dist/effect-ScopedRef.cjs.dev.js +19 -19
- package/ScopedRef/dist/effect-ScopedRef.cjs.prod.js +19 -19
- package/ScopedRef/dist/effect-ScopedRef.esm.js +71 -79
- package/Sink/dist/effect-Sink.cjs.dev.js +32 -32
- package/Sink/dist/effect-Sink.cjs.prod.js +32 -32
- package/Sink/dist/effect-Sink.esm.js +997 -101
- package/SortedMap/dist/effect-SortedMap.esm.js +168 -23
- package/SortedSet/dist/effect-SortedSet.esm.js +263 -23
- package/Stream/dist/effect-Stream.cjs.dev.js +37 -37
- package/Stream/dist/effect-Stream.cjs.prod.js +37 -37
- package/Stream/dist/effect-Stream.esm.js +2879 -108
- package/StreamHaltStrategy/dist/effect-StreamHaltStrategy.esm.js +97 -2
- package/String/dist/effect-String.esm.js +600 -17
- package/Struct/dist/effect-Struct.esm.js +125 -4
- package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.dev.js +37 -37
- package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.prod.js +37 -37
- package/SubscriptionRef/dist/effect-SubscriptionRef.esm.js +160 -108
- package/Supervisor/dist/effect-Supervisor.cjs.dev.js +24 -24
- package/Supervisor/dist/effect-Supervisor.cjs.prod.js +24 -24
- package/Supervisor/dist/effect-Supervisor.esm.js +148 -85
- package/Symbol/dist/effect-Symbol.esm.js +30 -4
- package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.dev.js +18 -18
- package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.prod.js +18 -18
- package/SynchronizedRef/dist/effect-SynchronizedRef.esm.js +160 -78
- package/TArray/dist/effect-TArray.cjs.dev.js +43 -43
- package/TArray/dist/effect-TArray.cjs.prod.js +43 -43
- package/TArray/dist/effect-TArray.esm.js +367 -114
- package/TDeferred/dist/effect-TDeferred.cjs.dev.js +42 -42
- package/TDeferred/dist/effect-TDeferred.cjs.prod.js +42 -42
- package/TDeferred/dist/effect-TDeferred.esm.js +63 -113
- package/THub/dist/effect-THub.cjs.dev.js +44 -44
- package/THub/dist/effect-THub.cjs.prod.js +44 -44
- package/THub/dist/effect-THub.esm.js +157 -115
- package/TMap/dist/effect-TMap.cjs.dev.js +45 -45
- package/TMap/dist/effect-TMap.cjs.prod.js +45 -45
- package/TMap/dist/effect-TMap.esm.js +373 -116
- package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.dev.js +41 -41
- package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.prod.js +41 -41
- package/TPriorityQueue/dist/effect-TPriorityQueue.esm.js +184 -113
- package/TQueue/dist/effect-TQueue.cjs.dev.js +44 -44
- package/TQueue/dist/effect-TQueue.cjs.prod.js +44 -44
- package/TQueue/dist/effect-TQueue.esm.js +293 -115
- package/TRandom/dist/effect-TRandom.cjs.dev.js +43 -43
- package/TRandom/dist/effect-TRandom.cjs.prod.js +43 -43
- package/TRandom/dist/effect-TRandom.esm.js +93 -114
- package/TReentrantLock/dist/effect-TReentrantLock.cjs.dev.js +41 -41
- package/TReentrantLock/dist/effect-TReentrantLock.cjs.prod.js +41 -41
- package/TReentrantLock/dist/effect-TReentrantLock.esm.js +199 -112
- package/TRef/dist/effect-TRef.cjs.dev.js +41 -41
- package/TRef/dist/effect-TRef.cjs.prod.js +41 -41
- package/TRef/dist/effect-TRef.esm.js +116 -112
- package/TSemaphore/dist/effect-TSemaphore.cjs.dev.js +43 -43
- package/TSemaphore/dist/effect-TSemaphore.cjs.prod.js +43 -43
- package/TSemaphore/dist/effect-TSemaphore.esm.js +97 -114
- package/TSet/dist/effect-TSet.cjs.dev.js +45 -45
- package/TSet/dist/effect-TSet.cjs.prod.js +45 -45
- package/TSet/dist/effect-TSet.esm.js +268 -116
- package/Take/dist/effect-Take.cjs.dev.js +28 -28
- package/Take/dist/effect-Take.cjs.prod.js +28 -28
- package/Take/dist/effect-Take.esm.js +190 -91
- package/TestAnnotation/dist/effect-TestAnnotation.esm.js +111 -26
- package/TestAnnotationMap/dist/effect-TestAnnotationMap.esm.js +101 -2
- package/TestAnnotations/dist/effect-TestAnnotations.cjs.dev.js +7 -7
- package/TestAnnotations/dist/effect-TestAnnotations.cjs.prod.js +7 -7
- package/TestAnnotations/dist/effect-TestAnnotations.esm.js +83 -59
- package/TestClock/dist/effect-TestClock.cjs.dev.js +24 -24
- package/TestClock/dist/effect-TestClock.cjs.prod.js +24 -24
- package/TestClock/dist/effect-TestClock.esm.js +411 -87
- package/TestConfig/dist/effect-TestConfig.esm.js +27 -18
- package/TestContext/dist/effect-TestContext.cjs.dev.js +31 -31
- package/TestContext/dist/effect-TestContext.cjs.prod.js +31 -31
- package/TestContext/dist/effect-TestContext.esm.js +29 -98
- package/TestLive/dist/effect-TestLive.cjs.dev.js +3 -3
- package/TestLive/dist/effect-TestLive.cjs.prod.js +3 -3
- package/TestLive/dist/effect-TestLive.esm.js +48 -42
- package/TestServices/dist/effect-TestServices.cjs.dev.js +29 -29
- package/TestServices/dist/effect-TestServices.cjs.prod.js +29 -29
- package/TestServices/dist/effect-TestServices.esm.js +269 -96
- package/TestSized/dist/effect-TestSized.esm.js +50 -33
- package/Tracer/dist/effect-Tracer.cjs.dev.js +3 -3
- package/Tracer/dist/effect-Tracer.cjs.prod.js +3 -3
- package/Tracer/dist/effect-Tracer.esm.js +68 -42
- package/Tuple/dist/effect-Tuple.esm.js +173 -4
- package/Unify/dist/effect-Unify.esm.js +40 -2
- package/Utils/dist/effect-Utils.esm.js +352 -3
- package/dist/{Cache-e7468f24.cjs.dev.js → Cache-1688e584.cjs.dev.js} +1 -1
- package/dist/{Cache-65f7e875.cjs.prod.js → Cache-8f2f2b55.cjs.prod.js} +1 -1
- package/dist/{Channel-482334e0.cjs.prod.js → Channel-2ce019f1.cjs.prod.js} +2 -2
- package/dist/{Channel-4099f225.cjs.dev.js → Channel-544108d2.cjs.dev.js} +2 -2
- package/dist/{ChannelSingleProducerAsyncInput-e1260219.cjs.dev.js → ChannelSingleProducerAsyncInput-62f4749c.cjs.dev.js} +1 -1
- package/dist/{ChannelSingleProducerAsyncInput-9d23aac3.cjs.prod.js → ChannelSingleProducerAsyncInput-6e0084c3.cjs.prod.js} +1 -1
- package/dist/{Clock-0b777b1b.cjs.prod.js → Clock-09ecce0a.cjs.prod.js} +1 -1
- package/dist/{Clock-80bf3b4b.cjs.dev.js → Clock-bec722c1.cjs.dev.js} +1 -1
- package/dist/{Console-69b2fba9.cjs.prod.js → Console-150b7b40.cjs.prod.js} +3 -3
- package/dist/{Console-ff87924b.cjs.dev.js → Console-4825ee9f.cjs.dev.js} +3 -3
- package/dist/{DefaultServices-c1a6b148.cjs.dev.js → DefaultServices-d5740d37.cjs.dev.js} +1 -1
- package/dist/{DefaultServices-6a83f0aa.cjs.prod.js → DefaultServices-df7495bb.cjs.prod.js} +1 -1
- package/dist/{Duration-011e7325.cjs.prod.js → Duration-0bc08d03.cjs.prod.js} +8 -0
- package/dist/{Duration-5ac57eb4.cjs.dev.js → Duration-604874d1.cjs.dev.js} +8 -0
- package/dist/{Effect-f0659a90.cjs.prod.js → Effect-1442090f.cjs.prod.js} +9 -9
- package/dist/{Effect-8392a3cd.cjs.dev.js → Effect-6e9780e6.cjs.dev.js} +9 -9
- package/dist/{Error-5edcd83a.cjs.dev.js → Error-5ab157f2.cjs.dev.js} +1 -1
- package/dist/{Error-d7f0de14.cjs.prod.js → Error-e9d25c53.cjs.prod.js} +1 -1
- package/dist/{Fiber-c797d281.cjs.dev.js → Fiber-6432d5f7.cjs.dev.js} +3 -3
- package/dist/{Fiber-3b2a4091.cjs.prod.js → Fiber-e61b3c65.cjs.prod.js} +3 -3
- package/dist/{FiberRef-61cd9abe.cjs.dev.js → FiberRef-1db44a9b.cjs.dev.js} +2 -2
- package/dist/{FiberRef-0b332631.cjs.prod.js → FiberRef-efb4a3ac.cjs.prod.js} +2 -2
- package/dist/{GroupBy-bd212344.cjs.dev.js → GroupBy-8a8149b4.cjs.dev.js} +1 -1
- package/dist/{GroupBy-bb08aeb2.cjs.prod.js → GroupBy-b74084af.cjs.prod.js} +1 -1
- package/dist/{Hub-926961e9.cjs.prod.js → Hub-6e64debd.cjs.prod.js} +2 -2
- package/dist/{Hub-af0194fd.cjs.dev.js → Hub-74834668.cjs.dev.js} +2 -2
- package/dist/{KeyedPool-f7b4675c.cjs.dev.js → KeyedPool-b05481e9.cjs.dev.js} +3 -3
- package/dist/{KeyedPool-0ddba691.cjs.prod.js → KeyedPool-cd8abf95.cjs.prod.js} +3 -3
- package/dist/{Layer-ec0ab71c.cjs.prod.js → Layer-297269fd.cjs.prod.js} +1 -1
- package/dist/{Layer-6ad0ac38.cjs.dev.js → Layer-c69f3fdc.cjs.dev.js} +1 -1
- package/dist/{Logger-620f1fa9.cjs.dev.js → Logger-680763c7.cjs.dev.js} +2 -2
- package/dist/{Logger-3df1180d.cjs.prod.js → Logger-7a664cc3.cjs.prod.js} +2 -2
- package/dist/{Metric-ebc35919.cjs.dev.js → Metric-09d012ff.cjs.dev.js} +1 -1
- package/dist/{Metric-9607aa06.cjs.prod.js → Metric-b7563a68.cjs.prod.js} +1 -1
- package/dist/{MetricHook-fdc68e37.cjs.dev.js → MetricHook-3104e93b.cjs.dev.js} +1 -1
- package/dist/{MetricHook-a742d813.cjs.prod.js → MetricHook-efd05d72.cjs.prod.js} +1 -1
- package/dist/{MetricKey-b17b2c9a.cjs.prod.js → MetricKey-9cfcaec8.cjs.prod.js} +1 -1
- package/dist/{MetricKey-be3afc49.cjs.dev.js → MetricKey-c3ba437e.cjs.dev.js} +1 -1
- package/dist/{MetricKeyType-3dfa6802.cjs.prod.js → MetricKeyType-6d2d9036.cjs.prod.js} +1 -1
- package/dist/{MetricKeyType-fba3e0ec.cjs.dev.js → MetricKeyType-c1d7ebe8.cjs.dev.js} +1 -1
- package/dist/{MetricPolling-061de6b9.cjs.dev.js → MetricPolling-5af0ff67.cjs.dev.js} +3 -3
- package/dist/{MetricPolling-6e5e4b2e.cjs.prod.js → MetricPolling-a0a4e798.cjs.prod.js} +3 -3
- package/dist/{MetricRegistry-4df5e56b.cjs.dev.js → MetricRegistry-e4af936b.cjs.dev.js} +1 -1
- package/dist/{MetricRegistry-da2c65bd.cjs.prod.js → MetricRegistry-ff6df283.cjs.prod.js} +1 -1
- package/dist/{Pool-d8e4142e.cjs.prod.js → Pool-54389592.cjs.prod.js} +1 -1
- package/dist/{Pool-e8a79a57.cjs.dev.js → Pool-fe1b506a.cjs.dev.js} +1 -1
- package/dist/{Queue-de055f1c.cjs.prod.js → Queue-5f954287.cjs.prod.js} +1 -1
- package/dist/{Queue-55a39179.cjs.dev.js → Queue-8d082fe4.cjs.dev.js} +1 -1
- package/dist/{Random-d6a2f801.cjs.dev.js → Random-35304046.cjs.dev.js} +1 -1
- package/dist/{Random-ade126e8.cjs.prod.js → Random-b4709b6a.cjs.prod.js} +1 -1
- package/dist/{Reloadable-5f1ed95c.cjs.prod.js → Reloadable-2b8ba75d.cjs.prod.js} +5 -5
- package/dist/{Reloadable-e8bcb00e.cjs.dev.js → Reloadable-b01c9297.cjs.dev.js} +5 -5
- package/dist/{Request-45226c5f.cjs.prod.js → Request-53592fe4.cjs.prod.js} +2 -2
- package/dist/{Request-9d12c3ba.cjs.dev.js → Request-d3b63af6.cjs.dev.js} +2 -2
- package/dist/{RequestBlock-0e9f377b.cjs.dev.js → RequestBlock-1aa4c3bd.cjs.dev.js} +1 -1
- package/dist/{RequestBlock-d4c7c31d.cjs.prod.js → RequestBlock-8c3b51d1.cjs.prod.js} +1 -1
- package/dist/{RequestResolver-8764ee8c.cjs.prod.js → RequestResolver-133197d5.cjs.prod.js} +2 -2
- package/dist/{RequestResolver-b287a04a.cjs.dev.js → RequestResolver-86c21b80.cjs.dev.js} +2 -2
- package/dist/{Resource-f95cf55a.cjs.prod.js → Resource-2530fe45.cjs.prod.js} +3 -3
- package/dist/{Resource-4f2b627f.cjs.dev.js → Resource-e50b4b25.cjs.dev.js} +3 -3
- package/dist/{Runtime-969e6cb2.cjs.prod.js → Runtime-0d643f0c.cjs.prod.js} +1 -1
- package/dist/{Runtime-dc0234a0.cjs.dev.js → Runtime-c4b887ff.cjs.dev.js} +1 -1
- package/dist/{RuntimeFlags-7a400d83.cjs.prod.js → RuntimeFlags-9d8fac5a.cjs.prod.js} +1 -1
- package/dist/{RuntimeFlags-60dfc3f5.cjs.dev.js → RuntimeFlags-f67e3984.cjs.dev.js} +1 -1
- package/dist/{STM-b8d9766d.cjs.prod.js → STM-23270be2.cjs.prod.js} +2 -2
- package/dist/{STM-af9026e6.cjs.dev.js → STM-5a4c9921.cjs.dev.js} +2 -2
- package/dist/{Schedule-58648908.cjs.prod.js → Schedule-0444792d.cjs.prod.js} +1 -1
- package/dist/{Schedule-76089454.cjs.dev.js → Schedule-b6c7b49a.cjs.dev.js} +1 -1
- package/dist/{ScheduleDecision-fbd6bb79.cjs.prod.js → ScheduleDecision-369f2d2b.cjs.prod.js} +1 -1
- package/dist/{ScheduleDecision-9555a6dc.cjs.dev.js → ScheduleDecision-ba8d0e87.cjs.dev.js} +1 -1
- package/dist/{ScheduleInterval-3ca6dbb0.cjs.dev.js → ScheduleInterval-51f42533.cjs.dev.js} +1 -1
- package/dist/{ScheduleInterval-15c7da05.cjs.prod.js → ScheduleInterval-78037484.cjs.prod.js} +1 -1
- package/dist/{ScheduleIntervals-36ff45c1.cjs.dev.js → ScheduleIntervals-b0bfcf3b.cjs.dev.js} +1 -1
- package/dist/{ScheduleIntervals-a5bbdb0d.cjs.prod.js → ScheduleIntervals-db13140c.cjs.prod.js} +1 -1
- package/dist/{Scope-e3e714b4.cjs.prod.js → Scope-311c7eb9.cjs.prod.js} +1 -1
- package/dist/{Scope-820b74b2.cjs.dev.js → Scope-6ba9ec6d.cjs.dev.js} +1 -1
- package/dist/{ScopedCache-f9b2f52e.cjs.dev.js → ScopedCache-3f58b125.cjs.dev.js} +5 -5
- package/dist/{ScopedCache-467ccc2b.cjs.prod.js → ScopedCache-8f99505c.cjs.prod.js} +5 -5
- package/dist/{ScopedRef-b45fd0e8.cjs.prod.js → ScopedRef-7946d287.cjs.prod.js} +1 -1
- package/dist/{ScopedRef-735385de.cjs.dev.js → ScopedRef-b92e1633.cjs.dev.js} +1 -1
- package/dist/{Sink-dffe83ea.cjs.dev.js → Sink-9f13da17.cjs.dev.js} +1 -1
- package/dist/{Sink-cb1bba84.cjs.prod.js → Sink-9f82fc3b.cjs.prod.js} +1 -1
- package/dist/{Stream-c348a386.cjs.dev.js → Stream-14325ecb.cjs.dev.js} +2 -2
- package/dist/{Stream-39e8de11.cjs.prod.js → Stream-cf262c16.cjs.prod.js} +2 -2
- package/dist/{SubscriptionRef-62745b92.cjs.prod.js → SubscriptionRef-aa7bdc5f.cjs.prod.js} +5 -5
- package/dist/{SubscriptionRef-53e8686c.cjs.dev.js → SubscriptionRef-d3c1aa07.cjs.dev.js} +5 -5
- package/dist/{Supervisor-0ea7382b.cjs.prod.js → Supervisor-21087253.cjs.prod.js} +2 -2
- package/dist/{Supervisor-cf21fcaa.cjs.dev.js → Supervisor-40dd7ce5.cjs.dev.js} +2 -2
- package/dist/{SynchronizedRef-9e9689e9.cjs.dev.js → SynchronizedRef-3181eb0a.cjs.dev.js} +1 -1
- package/dist/{SynchronizedRef-2cc5af97.cjs.prod.js → SynchronizedRef-c6e0884b.cjs.prod.js} +1 -1
- package/dist/{TArray-6057170a.cjs.prod.js → TArray-6767b4bd.cjs.prod.js} +1 -1
- package/dist/{TArray-0b280c93.cjs.dev.js → TArray-a0a4c6e6.cjs.dev.js} +1 -1
- package/dist/{TDeferred-73b5dfc2.cjs.prod.js → TDeferred-a9839479.cjs.prod.js} +3 -3
- package/dist/{TDeferred-786b2b13.cjs.dev.js → TDeferred-ac2c4025.cjs.dev.js} +3 -3
- package/dist/{THub-810db270.cjs.prod.js → THub-25b77864.cjs.prod.js} +5 -5
- package/dist/{THub-bcd35bc0.cjs.dev.js → THub-38053ae1.cjs.dev.js} +5 -5
- package/dist/{TMap-7206da08.cjs.prod.js → TMap-91505efa.cjs.prod.js} +1 -1
- package/dist/{TMap-06e0747b.cjs.dev.js → TMap-de8ac080.cjs.dev.js} +1 -1
- package/dist/{TPriorityQueue-71490af5.cjs.prod.js → TPriorityQueue-00b65d1a.cjs.prod.js} +2 -2
- package/dist/{TPriorityQueue-0844551b.cjs.dev.js → TPriorityQueue-96ff0e15.cjs.dev.js} +2 -2
- package/dist/{TQueue-67ccf55b.cjs.prod.js → TQueue-5e242ca2.cjs.prod.js} +1 -1
- package/dist/{TQueue-5621ef6e.cjs.dev.js → TQueue-707762bf.cjs.dev.js} +1 -1
- package/dist/{TRandom-c974e739.cjs.dev.js → TRandom-5eb21d23.cjs.dev.js} +5 -5
- package/dist/{TRandom-557dc8e1.cjs.prod.js → TRandom-ec9c7bf7.cjs.prod.js} +5 -5
- package/dist/{TReentrantLock-5f7cba2d.cjs.dev.js → TReentrantLock-1b77d76f.cjs.dev.js} +3 -3
- package/dist/{TReentrantLock-e6ee830e.cjs.prod.js → TReentrantLock-c5a8401e.cjs.prod.js} +3 -3
- package/dist/{TRef-f7b2bc6f.cjs.prod.js → TRef-b87580d7.cjs.prod.js} +1 -1
- package/dist/{TRef-38eac0f0.cjs.dev.js → TRef-cf2e8ad7.cjs.dev.js} +1 -1
- package/dist/{TSemaphore-28d87428.cjs.prod.js → TSemaphore-29503416.cjs.prod.js} +4 -4
- package/dist/{TSemaphore-3cf15f77.cjs.dev.js → TSemaphore-50edec08.cjs.dev.js} +4 -4
- package/dist/{TSet-677ac73c.cjs.prod.js → TSet-3c2568e9.cjs.prod.js} +2 -2
- package/dist/{TSet-1dca2ef3.cjs.dev.js → TSet-bb4775ca.cjs.dev.js} +2 -2
- package/dist/{Take-bfdbd28d.cjs.dev.js → Take-684c9901.cjs.dev.js} +1 -1
- package/dist/{Take-e40627bd.cjs.prod.js → Take-b4c91438.cjs.prod.js} +1 -1
- package/dist/{TestAnnotations-14444032.cjs.prod.js → TestAnnotations-5db95828.cjs.prod.js} +2 -2
- package/dist/{TestAnnotations-ee0f8c79.cjs.dev.js → TestAnnotations-733b39ef.cjs.dev.js} +2 -2
- package/dist/{TestClock-30ba14e8.cjs.prod.js → TestClock-89a36b89.cjs.prod.js} +8 -8
- package/dist/{TestClock-d782f3ee.cjs.dev.js → TestClock-e2773846.cjs.dev.js} +8 -8
- package/dist/{TestContext-eebb1aad.cjs.dev.js → TestContext-3328163e.cjs.dev.js} +4 -4
- package/dist/{TestContext-f76f750e.cjs.prod.js → TestContext-917bf305.cjs.prod.js} +4 -4
- package/dist/{TestLive-dc458127.cjs.dev.js → TestLive-465ad3ef.cjs.dev.js} +1 -1
- package/dist/{TestLive-e5d614fe.cjs.prod.js → TestLive-f3232ac4.cjs.prod.js} +1 -1
- package/dist/{TestServices-b3af20a3.cjs.prod.js → TestServices-605f726e.cjs.prod.js} +6 -6
- package/dist/{TestServices-7a60d735.cjs.dev.js → TestServices-921e5c42.cjs.dev.js} +6 -6
- package/dist/{Tracer-3cd1e3bc.cjs.prod.js → Tracer-d06d0b61.cjs.prod.js} +1 -1
- package/dist/{Tracer-435e56fd.cjs.dev.js → Tracer-da182c8c.cjs.dev.js} +1 -1
- package/dist/{cache-66637407.cjs.dev.js → cache-6cdc31f7.cjs.dev.js} +3 -3
- package/dist/{cache-c88afdc0.cjs.prod.js → cache-ab7bbfbd.cjs.prod.js} +3 -3
- package/dist/{circular-d08ca815.cjs.dev.js → circular-4cb0b79d.cjs.dev.js} +5 -5
- package/dist/{circular-7eed8a92.cjs.prod.js → circular-5b3558d9.cjs.prod.js} +5 -5
- package/dist/{circular-5c436934.cjs.dev.js → circular-78011d6b.cjs.dev.js} +3 -3
- package/dist/{circular-c8f8e360.cjs.prod.js → circular-81b4c556.cjs.prod.js} +3 -3
- package/dist/{core-20a91d69.cjs.prod.js → core-4ced6e17.cjs.prod.js} +4 -4
- package/dist/{core-6e50c01f.cjs.dev.js → core-d9eea905.cjs.dev.js} +4 -4
- package/dist/{core-effect-780f9db7.cjs.dev.js → core-effect-a9b8ee08.cjs.dev.js} +4 -4
- package/dist/{core-effect-023f4abe.cjs.prod.js → core-effect-bf806dd9.cjs.prod.js} +4 -4
- package/dist/{dataSource-7ec08fa5.cjs.prod.js → dataSource-abccc876.cjs.prod.js} +2 -2
- package/dist/{dataSource-e56e2a99.cjs.dev.js → dataSource-d5f79f4e.cjs.dev.js} +2 -2
- package/dist/declarations/src/Duration.d.ts +5 -0
- package/dist/declarations/src/Duration.d.ts.map +1 -1
- package/dist/{defaultServices-452aebad.cjs.prod.js → defaultServices-4112c0c9.cjs.prod.js} +1 -1
- package/dist/{defaultServices-e9a9b935.cjs.dev.js → defaultServices-60c753dc.cjs.dev.js} +1 -1
- package/dist/effect.cjs.dev.js +93 -93
- package/dist/effect.cjs.prod.js +93 -93
- package/dist/effect.esm.js +283 -197
- package/dist/{fiber-2975db3a.cjs.prod.js → fiber-90ffaf8c.cjs.prod.js} +1 -1
- package/dist/{fiber-1132297b.cjs.dev.js → fiber-da1a207c.cjs.dev.js} +1 -1
- package/dist/{fiberRuntime-9d6d53be.cjs.prod.js → fiberRuntime-1c369a47.cjs.prod.js} +7 -7
- package/dist/{fiberRuntime-ac7fae54.cjs.dev.js → fiberRuntime-e9680313.cjs.dev.js} +7 -7
- package/dist/{groupBy-f0a83f90.cjs.prod.js → groupBy-0cc85afb.cjs.prod.js} +5 -5
- package/dist/{groupBy-e1d3c5e8.cjs.dev.js → groupBy-b204a881.cjs.dev.js} +5 -5
- package/dist/{hook-0bf192b2.cjs.prod.js → hook-6c7550dc.cjs.prod.js} +1 -1
- package/dist/{hook-9e86d119.cjs.dev.js → hook-822704ea.cjs.dev.js} +1 -1
- package/dist/{key-a79acfe7.cjs.prod.js → key-330b98b1.cjs.prod.js} +1 -1
- package/dist/{key-6ac569ca.cjs.dev.js → key-a474fc0d.cjs.dev.js} +1 -1
- package/dist/{keyType-c1e7cfc5.cjs.dev.js → keyType-1e916ae2.cjs.dev.js} +1 -1
- package/dist/{keyType-681c1c4a.cjs.prod.js → keyType-8460e792.cjs.prod.js} +1 -1
- package/dist/{layer-f0c8023d.cjs.dev.js → layer-ae8eefad.cjs.dev.js} +9 -9
- package/dist/{layer-db9c42be.cjs.prod.js → layer-ffacc2c5.cjs.prod.js} +9 -9
- package/dist/{pool-cd9f1284.cjs.dev.js → pool-3f16af61.cjs.dev.js} +4 -4
- package/dist/{pool-975b7d21.cjs.prod.js → pool-59a31f55.cjs.prod.js} +4 -4
- package/dist/{query-12e387cf.cjs.dev.js → query-193d0a89.cjs.dev.js} +3 -3
- package/dist/{query-eb8a7001.cjs.prod.js → query-fe4a82d6.cjs.prod.js} +3 -3
- package/dist/{queue-0dbc2b3f.cjs.dev.js → queue-04ae7ec7.cjs.dev.js} +1 -1
- package/dist/{queue-f70dda1a.cjs.prod.js → queue-b81aee38.cjs.prod.js} +1 -1
- package/dist/{registry-92c00ecd.cjs.prod.js → registry-29905dcc.cjs.prod.js} +2 -2
- package/dist/{registry-9e9ae2c7.cjs.dev.js → registry-c883cf52.cjs.dev.js} +2 -2
- package/dist/{runtime-f8d0f39b.cjs.dev.js → runtime-3ae98f19.cjs.dev.js} +3 -3
- package/dist/{runtime-0ada41f2.cjs.prod.js → runtime-8c3f1bd3.cjs.prod.js} +3 -3
- package/dist/{schedule-18b063cb.cjs.dev.js → schedule-479d8fcc.cjs.dev.js} +7 -7
- package/dist/{schedule-f918adf5.cjs.prod.js → schedule-7e30db2d.cjs.prod.js} +7 -7
- package/dist/{scopedRef-50091b28.cjs.dev.js → scopedRef-16d9d192.cjs.dev.js} +3 -3
- package/dist/{scopedRef-d6396f06.cjs.prod.js → scopedRef-40b5bb82.cjs.prod.js} +3 -3
- package/dist/{singleProducerAsyncInput-f3dd657f.cjs.dev.js → singleProducerAsyncInput-552122e6.cjs.dev.js} +1 -1
- package/dist/{singleProducerAsyncInput-bd600183.cjs.prod.js → singleProducerAsyncInput-c5ff73b7.cjs.prod.js} +1 -1
- package/dist/{sink-bb64c8a6.cjs.dev.js → sink-16a1a901.cjs.dev.js} +9 -9
- package/dist/{sink-6a1db2b0.cjs.prod.js → sink-c9ae7558.cjs.prod.js} +9 -9
- package/dist/{stm-2b8fa344.cjs.dev.js → stm-44f045e5.cjs.dev.js} +3 -3
- package/dist/{stm-e3401389.cjs.prod.js → stm-59af7e62.cjs.prod.js} +3 -3
- package/dist/{stream-7bc5bfac.cjs.dev.js → stream-84a13e23.cjs.dev.js} +13 -17
- package/dist/{stream-22ea5a61.cjs.prod.js → stream-8acbee57.cjs.prod.js} +13 -17
- package/dist/{tArray-a211cc29.cjs.prod.js → tArray-a690480d.cjs.prod.js} +3 -3
- package/dist/{tArray-36a6e713.cjs.dev.js → tArray-c0a3d1e2.cjs.dev.js} +3 -3
- package/dist/{tMap-fd504724.cjs.dev.js → tMap-1c1b10c4.cjs.dev.js} +5 -5
- package/dist/{tMap-9c22a2ff.cjs.prod.js → tMap-8dfc92f5.cjs.prod.js} +5 -5
- package/dist/{tQueue-4b66ca7b.cjs.prod.js → tQueue-48a29f8b.cjs.prod.js} +4 -4
- package/dist/{tQueue-565f8994.cjs.dev.js → tQueue-aaec000f.cjs.dev.js} +4 -4
- package/dist/{tRef-565db536.cjs.dev.js → tRef-1df89632.cjs.dev.js} +1 -1
- package/dist/{tRef-74dff65b.cjs.prod.js → tRef-cc473a9f.cjs.prod.js} +1 -1
- package/dist/{take-05ea3c27.cjs.prod.js → take-906e6ef4.cjs.prod.js} +1 -1
- package/dist/{take-f87477f8.cjs.dev.js → take-e1c6b82a.cjs.dev.js} +1 -1
- package/{dist/Context-149c432f.esm.js → internal/Context.esm.js} +9 -9
- package/internal/Data.esm.js +49 -0
- package/internal/Differ/ChunkPatch.esm.js +131 -0
- package/internal/Differ/ContextPatch.esm.js +158 -0
- package/internal/Differ/HashMapPatch.esm.js +133 -0
- package/internal/Differ/HashSetPatch.esm.js +107 -0
- package/internal/Differ/OrPatch.esm.js +196 -0
- package/internal/Differ.esm.js +130 -0
- package/internal/Effectable.esm.js +89 -0
- package/internal/Either.esm.js +95 -0
- package/internal/Encoding/Base64.esm.js +74 -0
- package/internal/Encoding/Base64Url.esm.js +24 -0
- package/internal/Encoding/Common.esm.js +21 -0
- package/internal/Encoding/Hex.esm.js +55 -0
- package/internal/HashMap/array.esm.js +51 -0
- package/internal/HashMap/bitwise.esm.js +34 -0
- package/internal/HashMap/config.esm.js +16 -0
- package/internal/HashMap/keySet.esm.js +8 -0
- package/internal/HashMap/node.esm.js +253 -0
- package/internal/HashMap.esm.js +366 -0
- package/internal/HashSet.esm.js +211 -0
- package/internal/Option.esm.js +75 -0
- package/{dist/ReadonlyArray-c8b1f51c.esm.js → internal/ReadonlyArray.esm.js} +1 -1
- package/internal/RedBlackTree/iterator.esm.js +204 -0
- package/internal/RedBlackTree/node.esm.js +43 -0
- package/{dist/RedBlackTree-611b3b4c.esm.js → internal/RedBlackTree.esm.js} +65 -655
- package/{dist/Stack-765c2298.esm.js → internal/Stack.esm.js} +1 -1
- package/internal/blockedRequests.esm.js +365 -0
- package/{dist/cache-d62912e6.esm.js → internal/cache.esm.js} +18 -18
- package/internal/cause.esm.js +1067 -0
- package/internal/channel/channelExecutor.esm.js +692 -0
- package/internal/channel/channelState.esm.js +78 -0
- package/{dist/childExecutorDecision-a7b466d2.esm.js → internal/channel/childExecutorDecision.esm.js} +3 -17
- package/internal/channel/continuation.esm.js +58 -0
- package/{dist/mergeDecision-d31cb28c.esm.js → internal/channel/mergeDecision.esm.js} +3 -12
- package/{dist/mergeState-1325df20.esm.js → internal/channel/mergeState.esm.js} +3 -17
- package/{dist/mergeStrategy-a88b5442.esm.js → internal/channel/mergeStrategy.esm.js} +3 -12
- package/{dist/singleProducerAsyncInput-5b2ede75.esm.js → internal/channel/singleProducerAsyncInput.esm.js} +8 -8
- package/internal/channel/subexecutor.esm.js +153 -0
- package/{dist/upstreamPullRequest-fed99e29.esm.js → internal/channel/upstreamPullRequest.esm.js} +3 -12
- package/{dist/upstreamPullStrategy-d5d1aa92.esm.js → internal/channel/upstreamPullStrategy.esm.js} +3 -12
- package/internal/channel.esm.js +648 -0
- package/internal/clock.esm.js +82 -0
- package/internal/completedRequestMap.esm.js +7 -0
- package/internal/concurrency.esm.js +47 -0
- package/{dist/config-b039b99f.esm.js → internal/config.esm.js} +12 -66
- package/{dist/configError-8b2e2999.esm.js → internal/configError.esm.js} +5 -34
- package/{dist/pathPatch-f393ab1b.esm.js → internal/configProvider/pathPatch.esm.js} +7 -7
- package/{dist/configProvider-c997961d.esm.js → internal/configProvider.esm.js} +16 -79
- package/{dist/configSecret-6e9eaf9d.esm.js → internal/configSecret.esm.js} +5 -5
- package/internal/console.esm.js +72 -0
- package/{dist/core-effect-57445976.esm.js → internal/core-effect.esm.js} +26 -53
- package/internal/core-stream.esm.js +293 -0
- package/internal/core.esm.js +1745 -0
- package/{dist/dataSource-1f41ea46.esm.js → internal/dataSource.esm.js} +9 -8
- package/internal/defaultServices/console.esm.js +96 -0
- package/internal/defaultServices.esm.js +84 -0
- package/internal/deferred.esm.js +37 -0
- package/{dist/circular-08fb0138.esm.js → internal/effect/circular.esm.js} +23 -20
- package/internal/executionStrategy.esm.js +61 -0
- package/{dist/fiber-8fb398f3.esm.js → internal/fiber.esm.js} +15 -121
- package/internal/fiberId.esm.js +243 -0
- package/internal/fiberMessage.esm.js +54 -0
- package/{dist/patch-743d675c.esm.js → internal/fiberRefs/patch.esm.js} +5 -5
- package/{dist/fiberRefs-69cce1a0.esm.js → internal/fiberRefs.esm.js} +8 -8
- package/{dist/fiberRuntime-bfcf5f49.esm.js → internal/fiberRuntime.esm.js} +152 -1006
- package/internal/fiberScope.esm.js +58 -0
- package/internal/fiberStatus.esm.js +89 -0
- package/{dist/groupBy-d11b31b1.esm.js → internal/groupBy.esm.js} +16 -14
- package/{dist/Hub-121dbf51.esm.js → internal/hub.esm.js} +34 -196
- package/internal/keyedPool.esm.js +161 -0
- package/{dist/circular-e463e1e6.esm.js → internal/layer/circular.esm.js} +10 -8
- package/{dist/layer-35828af7.esm.js → internal/layer.esm.js} +21 -65
- package/internal/logSpan.esm.js +15 -0
- package/internal/logger-circular.esm.js +21 -0
- package/internal/logger.esm.js +213 -0
- package/{dist/boundaries-52029180.esm.js → internal/metric/boundaries.esm.js} +7 -7
- package/{dist/hook-fd61107b.esm.js → internal/metric/hook.esm.js} +10 -10
- package/{dist/key-340a2bae.esm.js → internal/metric/key.esm.js} +9 -9
- package/{dist/keyType-869d90f8.esm.js → internal/metric/keyType.esm.js} +6 -6
- package/{dist/label-0cc6c9a0.esm.js → internal/metric/label.esm.js} +5 -5
- package/{dist/pair-5bb3eef4.esm.js → internal/metric/pair.esm.js} +2 -2
- package/internal/metric/polling.esm.js +74 -0
- package/{dist/registry-c59aeb06.esm.js → internal/metric/registry.esm.js} +8 -8
- package/{dist/state-2c6abdb1.esm.js → internal/metric/state.esm.js} +5 -5
- package/internal/metric.esm.js +204 -0
- package/internal/opCodes/cause.esm.js +31 -0
- package/internal/opCodes/channel.esm.js +71 -0
- package/internal/opCodes/channelChildExecutorDecision.esm.js +16 -0
- package/internal/opCodes/channelMergeDecision.esm.js +11 -0
- package/internal/opCodes/channelMergeState.esm.js +16 -0
- package/internal/opCodes/channelMergeStrategy.esm.js +11 -0
- package/internal/opCodes/channelState.esm.js +21 -0
- package/internal/opCodes/channelUpstreamPullRequest.esm.js +11 -0
- package/internal/opCodes/channelUpstreamPullStrategy.esm.js +11 -0
- package/internal/opCodes/config.esm.js +56 -0
- package/internal/opCodes/configError.esm.js +31 -0
- package/internal/opCodes/continuation.esm.js +11 -0
- package/internal/opCodes/deferred.esm.js +11 -0
- package/internal/opCodes/effect.esm.js +71 -0
- package/internal/opCodes/layer.esm.js +46 -0
- package/internal/opCodes/streamHaltStrategy.esm.js +21 -0
- package/{dist/pool-7d5c25ef.esm.js → internal/pool.esm.js} +13 -13
- package/{dist/query-242f7fda.esm.js → internal/query.esm.js} +10 -7
- package/{dist/queue-f74db567.esm.js → internal/queue.esm.js} +10 -10
- package/internal/random.esm.js +58 -0
- package/internal/ref.esm.js +121 -0
- package/internal/reloadable.esm.js +62 -0
- package/internal/request.esm.js +81 -0
- package/internal/resource.esm.js +35 -0
- package/internal/ringBuffer.esm.js +56 -0
- package/{dist/runtime-bcdd4416.esm.js → internal/runtime.esm.js} +19 -17
- package/internal/runtimeFlags.esm.js +137 -0
- package/internal/runtimeFlagsPatch.esm.js +57 -0
- package/internal/schedule/decision.esm.js +45 -0
- package/internal/schedule/interval.esm.js +85 -0
- package/internal/schedule/intervals.esm.js +135 -0
- package/{dist/schedule-566ae18c.esm.js → internal/schedule.esm.js} +26 -25
- package/{dist/ScopedCache-8fa7e96d.esm.js → internal/scopedCache.esm.js} +27 -83
- package/{dist/scopedRef-0fdefef8.esm.js → internal/scopedRef.esm.js} +10 -10
- package/internal/singleShotGen.esm.js +30 -0
- package/internal/sink.esm.js +918 -0
- package/{dist/core-f6cae6d7.esm.js → internal/stm/core.esm.js} +46 -525
- package/internal/stm/opCodes/stm.esm.js +56 -0
- package/internal/stm/opCodes/stmState.esm.js +16 -0
- package/internal/stm/opCodes/strategy.esm.js +16 -0
- package/internal/stm/opCodes/tExit.esm.js +26 -0
- package/internal/stm/opCodes/tryCommit.esm.js +11 -0
- package/internal/stm/stm/entry.esm.js +47 -0
- package/internal/stm/stm/journal.esm.js +96 -0
- package/internal/stm/stm/stmState.esm.js +104 -0
- package/internal/stm/stm/tExit.esm.js +113 -0
- package/internal/stm/stm/tryCommit.esm.js +25 -0
- package/internal/stm/stm/txnId.esm.js +15 -0
- package/internal/stm/stm/versioned.esm.js +8 -0
- package/{dist/stm-6937f6f2.esm.js → internal/stm/stm.esm.js} +16 -14
- package/{dist/tArray-79024770.esm.js → internal/stm/tArray.esm.js} +8 -8
- package/internal/stm/tDeferred.esm.js +49 -0
- package/{dist/THub-573c2fb3.esm.js → internal/stm/tHub.esm.js} +28 -200
- package/{dist/tMap-907e37f4.esm.js → internal/stm/tMap.esm.js} +13 -13
- package/internal/stm/tPriorityQueue.esm.js +156 -0
- package/{dist/tQueue-74395d76.esm.js → internal/stm/tQueue.esm.js} +10 -24
- package/internal/stm/tRandom.esm.js +89 -0
- package/internal/stm/tReentrantLock.esm.js +216 -0
- package/{dist/tRef-fc8ff438.esm.js → internal/stm/tRef.esm.js} +6 -4
- package/internal/stm/tSemaphore.esm.js +73 -0
- package/internal/stm/tSet.esm.js +113 -0
- package/internal/stream/debounceState.esm.js +39 -0
- package/internal/stream/emit.esm.js +51 -0
- package/internal/stream/haltStrategy.esm.js +74 -0
- package/internal/stream/handoff.esm.js +79 -0
- package/internal/stream/handoffSignal.esm.js +40 -0
- package/internal/stream/pull.esm.js +10 -0
- package/internal/stream/sinkEndReason.esm.js +27 -0
- package/internal/stream/zipAllState.esm.js +65 -0
- package/internal/stream/zipChunksState.esm.js +41 -0
- package/{dist/stream-e44fba40.esm.js → internal/stream.esm.js} +399 -770
- package/internal/string-utils.esm.js +66 -0
- package/internal/subscriptionRef.esm.js +65 -0
- package/internal/supervisor/patch.esm.js +156 -0
- package/internal/supervisor.esm.js +204 -0
- package/{dist/synchronizedRef-1ceb6bd3.esm.js → internal/synchronizedRef.esm.js} +4 -4
- package/{dist/take-0d5e0eab.esm.js → internal/take.esm.js} +8 -8
- package/internal/testing/suspendedWarningData.esm.js +66 -0
- package/internal/testing/warningData.esm.js +75 -0
- package/{dist/timeout-4180303d.esm.js → internal/timeout.esm.js} +1 -1
- package/internal/tracer.esm.js +61 -0
- package/package.json +700 -554
- package/dist/Bigint-bf034c1f.esm.js +0 -370
- package/dist/Boolean-bf38e241.esm.js +0 -248
- package/dist/Brand-f068009f.esm.js +0 -215
- package/dist/Cache-27cd0ab7.esm.js +0 -120
- package/dist/Cause-5946c7a3.esm.js +0 -730
- package/dist/Channel-4bba5096.esm.js +0 -1109
- package/dist/ChannelChildExecutorDecision-674b3a48.esm.js +0 -125
- package/dist/ChannelMergeDecision-e5f34de0.esm.js +0 -70
- package/dist/ChannelMergeState-ae694a7c.esm.js +0 -114
- package/dist/ChannelMergeStrategy-9ef51c54.esm.js +0 -95
- package/dist/ChannelSingleProducerAsyncInput-1d15a3ec.esm.js +0 -52
- package/dist/ChannelUpstreamPullRequest-9b3a6733.esm.js +0 -95
- package/dist/ChannelUpstreamPullStrategy-85e1042b.esm.js +0 -94
- package/dist/Chunk-4c1f4599.esm.js +0 -1167
- package/dist/Clock-f8b987d7.esm.js +0 -88
- package/dist/Config-8d8f5a9f.esm.js +0 -358
- package/dist/ConfigError-41421a53.esm.js +0 -206
- package/dist/ConfigProvider-977168f2.esm.js +0 -220
- package/dist/ConfigProviderPathPatch-881ec2b5.esm.js +0 -79
- package/dist/ConfigSecret-9d3bf471.esm.js +0 -74
- package/dist/Console-9be5cd81.esm.js +0 -247
- package/dist/Context-c41aa832.esm.js +0 -312
- package/dist/Data-dee529b9.esm.js +0 -224
- package/dist/DefaultServices-b70d7e44.esm.js +0 -30
- package/dist/Deferred-9010d2ac.esm.js +0 -230
- package/dist/Differ-a249bf4d.esm.js +0 -975
- package/dist/Duration-98bca14c.esm.js +0 -467
- package/dist/Effect-ee05a487.esm.js +0 -3417
- package/dist/Effectable-a292d920.esm.js +0 -158
- package/dist/Effectable-d9b23ee3.esm.js +0 -89
- package/dist/Either-408d23a8.esm.js +0 -163
- package/dist/Either-aa46c018.esm.js +0 -473
- package/dist/Encoding-d95012ad.esm.js +0 -295
- package/dist/Equal-2a99fde3.esm.js +0 -65
- package/dist/Equivalence-cf2752b1.esm.js +0 -218
- package/dist/Error-083b7b69.esm.js +0 -53
- package/dist/ExecutionStrategy-e3775e86.esm.js +0 -168
- package/dist/Exit-666b4f01.esm.js +0 -371
- package/dist/Fiber-ebef9c60.esm.js +0 -473
- package/dist/FiberId-17e50f05.esm.js +0 -422
- package/dist/FiberRef-ddf157fd.esm.js +0 -338
- package/dist/FiberRefs-f705c1b5.esm.js +0 -122
- package/dist/FiberRefsPatch-04e0adc7.esm.js +0 -84
- package/dist/FiberStatus-7a24d5ef.esm.js +0 -187
- package/dist/Function-12511160.esm.js +0 -516
- package/dist/GlobalValue-b5edf230.esm.js +0 -25
- package/dist/GroupBy-4c667347.esm.js +0 -72
- package/dist/HKT-1990744d.esm.js +0 -5
- package/dist/Hash-7910f34f.esm.js +0 -179
- package/dist/HashMap-6c230bde.esm.js +0 -327
- package/dist/HashSet-69824ba8.esm.js +0 -907
- package/dist/HashSet-ae2856c1.esm.js +0 -256
- package/dist/Inspectable-b0c51e90.esm.js +0 -45
- package/dist/KeyedPool-08ee3618.esm.js +0 -273
- package/dist/Layer-8586a429.esm.js +0 -623
- package/dist/List-6e58a1e9.esm.js +0 -865
- package/dist/LogLevel-5a4fa506.esm.js +0 -222
- package/dist/LogSpan-f36e9619.esm.js +0 -42
- package/dist/Logger-aafaa76b.esm.js +0 -246
- package/dist/Metric-fef02dd6.esm.js +0 -442
- package/dist/MetricBoundaries-c8610876.esm.js +0 -61
- package/dist/MetricHook-6859801b.esm.js +0 -80
- package/dist/MetricKey-d1b96e85.esm.js +0 -118
- package/dist/MetricKeyType-4ce20904.esm.js +0 -168
- package/dist/MetricLabel-123185d1.esm.js +0 -48
- package/dist/MetricPair-840a98b7.esm.js +0 -45
- package/dist/MetricPolling-538e65c8.esm.js +0 -167
- package/dist/MetricRegistry-1e32438c.esm.js +0 -34
- package/dist/MetricState-ccc2e0db.esm.js +0 -172
- package/dist/MutableHashMap-02b39969.esm.js +0 -142
- package/dist/MutableHashSet-db4f96e8.esm.js +0 -101
- package/dist/MutableList-76401868.esm.js +0 -281
- package/dist/MutableQueue-446ac662.esm.js +0 -202
- package/dist/MutableRef-2734b082.esm.js +0 -176
- package/dist/NonEmptyIterable-e78d759e.esm.js +0 -33
- package/dist/Number-4b836a09.esm.js +0 -394
- package/dist/Option-df40d2b9.esm.js +0 -1135
- package/dist/Order-a875fe30.esm.js +0 -293
- package/dist/Ordering-079176ff.esm.js +0 -97
- package/dist/Pipeable-10760a1d.esm.js +0 -49
- package/dist/Pool-f1667f78.esm.js +0 -114
- package/dist/Predicate-6b61b95b.esm.js +0 -677
- package/dist/Queue-d99be5de.esm.js +0 -362
- package/dist/Random-5ed16d23.esm.js +0 -94
- package/dist/ReadonlyArray-0a71b226.esm.js +0 -1584
- package/dist/ReadonlyRecord-c9f03980.esm.js +0 -544
- package/dist/Ref-5eefaff1.esm.js +0 -248
- package/dist/Reloadable-e2eba7eb.esm.js +0 -159
- package/dist/Request-8b0e9130.esm.js +0 -175
- package/dist/RequestBlock-88afac19.esm.js +0 -114
- package/dist/RequestResolver-f17a25be.esm.js +0 -213
- package/dist/Resource-525ecb8a.esm.js +0 -111
- package/dist/Runtime-7b6c0a8b.esm.js +0 -175
- package/dist/RuntimeFlags-60048f70.esm.js +0 -344
- package/dist/RuntimeFlagsPatch-51f77dce.esm.js +0 -365
- package/dist/STM-1ef98d11.esm.js +0 -1321
- package/dist/Schedule-8502145c.esm.js +0 -1059
- package/dist/ScheduleDecision-e0b221dc.esm.js +0 -99
- package/dist/ScheduleInterval-cc7fc624.esm.js +0 -229
- package/dist/ScheduleIntervals-c4dc0500.esm.js +0 -252
- package/dist/Scheduler-844c1a90.esm.js +0 -343
- package/dist/Scope-0253ac82.esm.js +0 -131
- package/dist/ScopedRef-d92cda3b.esm.js +0 -80
- package/dist/Sink-322b0a96.esm.js +0 -1107
- package/dist/SortedMap-e429b26f.esm.js +0 -190
- package/dist/SortedSet-ffc2cefd.esm.js +0 -288
- package/dist/Stream-a54c82e5.esm.js +0 -3175
- package/dist/StreamEmit-bd696ab0.esm.js +0 -5
- package/dist/StreamHaltStrategy-592df221.esm.js +0 -201
- package/dist/String-5d27ad4c.esm.js +0 -648
- package/dist/Struct-b95eb81c.esm.js +0 -134
- package/dist/SubscriptionRef-93d8d20b.esm.js +0 -245
- package/dist/Supervisor-802f0ad0.esm.js +0 -160
- package/dist/Symbol-81368584.esm.js +0 -36
- package/dist/SynchronizedRef-5b418159.esm.js +0 -187
- package/dist/TArray-e0699120.esm.js +0 -412
- package/dist/TDeferred-96a9e821.esm.js +0 -120
- package/dist/TMap-0b08af84.esm.js +0 -419
- package/dist/TPriorityQueue-a5eb73d4.esm.js +0 -360
- package/dist/TQueue-2c224826.esm.js +0 -324
- package/dist/TRandom-dbfd1b25.esm.js +0 -192
- package/dist/TReentrantLock-83290260.esm.js +0 -435
- package/dist/TRef-bb02383a.esm.js +0 -135
- package/dist/TSemaphore-9a746009.esm.js +0 -183
- package/dist/TSet-91c5d646.esm.js +0 -412
- package/dist/Take-880079f7.esm.js +0 -214
- package/dist/TestAnnotation-f4477615.esm.js +0 -124
- package/dist/TestAnnotationMap-11d08509.esm.js +0 -114
- package/dist/TestAnnotations-39f7e011.esm.js +0 -91
- package/dist/TestClock-ab72e391.esm.js +0 -565
- package/dist/TestConfig-0d2c885c.esm.js +0 -33
- package/dist/TestContext-61178585.esm.js +0 -36
- package/dist/TestLive-61a5e471.esm.js +0 -55
- package/dist/TestServices-310ebe14.esm.js +0 -306
- package/dist/TestSized-745ac7e5.esm.js +0 -58
- package/dist/Tracer-da65ce12.esm.js +0 -75
- package/dist/Tuple-eefd2c03.esm.js +0 -187
- package/dist/Types-be3804ad.esm.js +0 -5
- package/dist/Unify-118c2d56.esm.js +0 -45
- package/dist/Utils-80c21479.esm.js +0 -362
- package/dist/core-64ab7ff5.esm.js +0 -3225
- package/dist/defaultServices-b9ca1236.esm.js +0 -359
- package/dist/sink-637a9670.esm.js +0 -2877
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
import { die as die$1, RuntimeException } from '../Cause/dist/effect-Cause.esm.js';
|
|
2
|
+
import { appendAll, empty, append, toReadonlyArray, unsafeFromArray, drop as drop$1, isEmpty, flatten, map as map$3, dropWhile as dropWhile$1, filter, of, unsafeGet as unsafeGet$1, splitAt, isNonEmpty, last as last$1, reduce } from '../Chunk/dist/effect-Chunk.esm.js';
|
|
3
|
+
import { currentTimeMillis } from '../Clock/dist/effect-Clock.esm.js';
|
|
4
|
+
import { millis } from '../Duration/dist/effect-Duration.esm.js';
|
|
5
|
+
import { takeWhile, map as map$1, zip as zip$1, forEach as forEach$1, context as context$1, contextWith as contextWith$1, filter as filter$1, succeed as succeed$2, dieMessage as dieMessage$1, acquireRelease, never as never$1, gen, suspend as suspend$2, isEffect, failCause as failCause$2, dropUntil as dropUntil$1, dropWhile as dropWhile$2, flatMap as flatMap$2 } from '../Effect/dist/effect-Effect.esm.js';
|
|
6
|
+
import { match, merge, left, right } from '../Either/dist/effect-Either.esm.js';
|
|
7
|
+
import { match as match$2 } from '../Exit/dist/effect-Exit.esm.js';
|
|
8
|
+
import { dual, pipe, constTrue, identity } from '../Function/dist/effect-Function.esm.js';
|
|
9
|
+
import { empty as empty$1, has, unsafeGet, set } from '../HashMap/dist/effect-HashMap.esm.js';
|
|
10
|
+
import { empty as empty$2, has as has$1, add } from '../HashSet/dist/effect-HashSet.esm.js';
|
|
11
|
+
import { bounded } from '../Hub/dist/effect-Hub.esm.js';
|
|
12
|
+
import { some as some$1, none, match as match$1, isNone, orElse as orElse$2 } from '../Option/dist/effect-Option.esm.js';
|
|
13
|
+
import { pipeArguments } from '../Pipeable/dist/effect-Pipeable.esm.js';
|
|
14
|
+
import { shutdown, offerAll } from '../Queue/dist/effect-Queue.esm.js';
|
|
15
|
+
import { span } from '../ReadonlyArray/dist/effect-ReadonlyArray.esm.js';
|
|
16
|
+
import { make, set as set$1, get } from '../Ref/dist/effect-Ref.esm.js';
|
|
17
|
+
import { zipRight as zipRight$1, as as as$1, bufferChunk, foldChannel, doneCollect, map as map$2, pipeToOrFail, drain as drain$1, identityChannel, ensuring as ensuring$1, unwrap as unwrap$1, catchAll, unwrapScoped as unwrapScoped$1, mapEffect as mapEffect$1, mapError as mapError$1, mapOut, orElse as orElse$1, fromHubScoped, toHub, mergeWith, writeChunk } from './channel.esm.js';
|
|
18
|
+
import { Done, Await } from './channel/mergeDecision.esm.js';
|
|
19
|
+
import { suspend as suspend$1, readWithCause, failCause as failCause$1, succeed as succeed$1, readWith, write, fail as fail$1, flatMap as flatMap$1, fromEffect as fromEffect$1, pipeTo, collectElements, succeedNow, ensuringWith as ensuringWith$1, failSync as failSync$1, failCauseSync as failCauseSync$1, unit, provideContext as provideContext$1, sync as sync$1 } from './core-stream.esm.js';
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
const SinkTypeId = /*#__PURE__*/Symbol.for("effect/Sink");
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
const sinkVariance = {
|
|
26
|
+
_R: _ => _,
|
|
27
|
+
_E: _ => _,
|
|
28
|
+
_In: _ => _,
|
|
29
|
+
_L: _ => _,
|
|
30
|
+
_Z: _ => _
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
class SinkImpl {
|
|
35
|
+
[SinkTypeId] = sinkVariance;
|
|
36
|
+
constructor(channel) {
|
|
37
|
+
this.channel = channel;
|
|
38
|
+
}
|
|
39
|
+
pipe() {
|
|
40
|
+
return pipeArguments(this, arguments);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
const isSink = u => typeof u === "object" && u != null && SinkTypeId in u;
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
const suspend = evaluate => new SinkImpl(suspend$1(() => toChannel(evaluate())));
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
const as = /*#__PURE__*/dual(2, (self, z) => pipe(self, map(() => z)));
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
const collectAll = () => new SinkImpl(collectAllLoop(empty()));
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
const collectAllLoop = acc => readWithCause({
|
|
58
|
+
onInput: chunk => collectAllLoop(pipe(acc, appendAll(chunk))),
|
|
59
|
+
onFailure: failCause$1,
|
|
60
|
+
onDone: () => succeed$1(acc)
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
const collectAllN = n => suspend(() => fromChannel(collectAllNLoop(n, empty())));
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
const collectAllNLoop = (n, acc) => readWithCause({
|
|
68
|
+
onInput: chunk => {
|
|
69
|
+
const [collected, leftovers] = splitAt(chunk, n);
|
|
70
|
+
if (collected.length < n) {
|
|
71
|
+
return collectAllNLoop(n - collected.length, appendAll(acc, collected));
|
|
72
|
+
}
|
|
73
|
+
if (isEmpty(leftovers)) {
|
|
74
|
+
return succeed$1(appendAll(acc, collected));
|
|
75
|
+
}
|
|
76
|
+
return flatMap$1(write(leftovers), () => succeed$1(appendAll(acc, collected)));
|
|
77
|
+
},
|
|
78
|
+
onFailure: failCause$1,
|
|
79
|
+
onDone: () => succeed$1(acc)
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
/** @internal */
|
|
83
|
+
const collectAllFrom = self => collectAllWhileWith(self, {
|
|
84
|
+
initial: empty(),
|
|
85
|
+
while: constTrue,
|
|
86
|
+
body: (chunk, z) => pipe(chunk, append(z))
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
const collectAllToMap = (key, merge) => {
|
|
91
|
+
return pipe(foldLeftChunks(empty$1(), (map, chunk) => pipe(chunk, reduce(map, (map, input) => {
|
|
92
|
+
const k = key(input);
|
|
93
|
+
const v = pipe(map, has(k)) ? merge(pipe(map, unsafeGet(k)), input) : input;
|
|
94
|
+
return pipe(map, set(k, v));
|
|
95
|
+
}))));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
const collectAllToMapN = (n, key, merge) => {
|
|
100
|
+
return foldWeighted({
|
|
101
|
+
initial: empty$1(),
|
|
102
|
+
maxCost: n,
|
|
103
|
+
cost: (acc, input) => pipe(acc, has(key(input))) ? 0 : 1,
|
|
104
|
+
body: (acc, input) => {
|
|
105
|
+
const k = key(input);
|
|
106
|
+
const v = pipe(acc, has(k)) ? merge(pipe(acc, unsafeGet(k)), input) : input;
|
|
107
|
+
return pipe(acc, set(k, v));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** @internal */
|
|
113
|
+
const collectAllToSet = () => foldLeftChunks(empty$2(), (acc, chunk) => pipe(chunk, reduce(acc, (acc, input) => pipe(acc, add(input)))));
|
|
114
|
+
|
|
115
|
+
/** @internal */
|
|
116
|
+
const collectAllToSetN = n => foldWeighted({
|
|
117
|
+
initial: empty$2(),
|
|
118
|
+
maxCost: n,
|
|
119
|
+
cost: (acc, input) => has$1(acc, input) ? 0 : 1,
|
|
120
|
+
body: (acc, input) => add(acc, input)
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/** @internal */
|
|
124
|
+
const collectAllUntil = p => {
|
|
125
|
+
return pipe(fold([empty(), true], tuple => tuple[1], ([chunk, _], input) => [pipe(chunk, append(input)), !p(input)]), map(tuple => tuple[0]));
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** @internal */
|
|
129
|
+
const collectAllUntilEffect = p => {
|
|
130
|
+
return pipe(foldEffect([empty(), true], tuple => tuple[1], ([chunk, _], input) => pipe(p(input), map$1(bool => [pipe(chunk, append(input)), !bool]))), map(tuple => tuple[0]));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
const collectAllWhile = predicate => fromChannel(collectAllWhileReader(predicate, empty()));
|
|
135
|
+
|
|
136
|
+
/** @internal */
|
|
137
|
+
const collectAllWhileReader = (predicate, done) => readWith({
|
|
138
|
+
onInput: input => {
|
|
139
|
+
const [collected, leftovers] = pipe(toReadonlyArray(input), span(predicate));
|
|
140
|
+
if (leftovers.length === 0) {
|
|
141
|
+
return collectAllWhileReader(predicate, pipe(done, appendAll(unsafeFromArray(collected))));
|
|
142
|
+
}
|
|
143
|
+
return pipe(write(unsafeFromArray(leftovers)), zipRight$1(succeed$1(pipe(done, appendAll(unsafeFromArray(collected))))));
|
|
144
|
+
},
|
|
145
|
+
onFailure: fail$1,
|
|
146
|
+
onDone: () => succeed$1(done)
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
/** @internal */
|
|
150
|
+
const collectAllWhileEffect = predicate => fromChannel(collectAllWhileEffectReader(predicate, empty()));
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
const collectAllWhileEffectReader = (predicate, done) => readWith({
|
|
154
|
+
onInput: input => pipe(fromEffect$1(pipe(input, takeWhile(predicate), map$1(unsafeFromArray))), flatMap$1(collected => {
|
|
155
|
+
const leftovers = pipe(input, drop$1(collected.length));
|
|
156
|
+
if (isEmpty(leftovers)) {
|
|
157
|
+
return collectAllWhileEffectReader(predicate, pipe(done, appendAll(collected)));
|
|
158
|
+
}
|
|
159
|
+
return pipe(write(leftovers), zipRight$1(succeed$1(pipe(done, appendAll(collected)))));
|
|
160
|
+
})),
|
|
161
|
+
onFailure: fail$1,
|
|
162
|
+
onDone: () => succeed$1(done)
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
/** @internal */
|
|
166
|
+
const collectAllWhileWith = /*#__PURE__*/dual(2, (self, options) => {
|
|
167
|
+
const refs = pipe(make(empty()), zip$1(make(false)));
|
|
168
|
+
const newChannel = pipe(fromEffect$1(refs), flatMap$1(([leftoversRef, upstreamDoneRef]) => {
|
|
169
|
+
const upstreamMarker = readWith({
|
|
170
|
+
onInput: input => pipe(write(input), flatMap$1(() => upstreamMarker)),
|
|
171
|
+
onFailure: fail$1,
|
|
172
|
+
onDone: done => pipe(fromEffect$1(set$1(upstreamDoneRef, true)), as$1(done))
|
|
173
|
+
});
|
|
174
|
+
return pipe(upstreamMarker, pipeTo(bufferChunk(leftoversRef)), pipeTo(collectAllWhileWithLoop(self, leftoversRef, upstreamDoneRef, options.initial, options.while, options.body)));
|
|
175
|
+
}));
|
|
176
|
+
return new SinkImpl(newChannel);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
/** @internal */
|
|
180
|
+
const collectAllWhileWithLoop = (self, leftoversRef, upstreamDoneRef, currentResult, p, f) => {
|
|
181
|
+
return pipe(toChannel(self), doneCollect, foldChannel({
|
|
182
|
+
onFailure: fail$1,
|
|
183
|
+
onSuccess: ([leftovers, doneValue]) => p(doneValue) ? pipe(fromEffect$1(set$1(leftoversRef, flatten(leftovers))), flatMap$1(() => pipe(fromEffect$1(get(upstreamDoneRef)), flatMap$1(upstreamDone => {
|
|
184
|
+
const accumulatedResult = f(currentResult, doneValue);
|
|
185
|
+
return upstreamDone ? pipe(write(flatten(leftovers)), as$1(accumulatedResult)) : collectAllWhileWithLoop(self, leftoversRef, upstreamDoneRef, accumulatedResult, p, f);
|
|
186
|
+
})))) : pipe(write(flatten(leftovers)), as$1(currentResult))
|
|
187
|
+
}));
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/** @internal */
|
|
191
|
+
const collectLeftover = self => new SinkImpl(pipe(collectElements(toChannel(self)), map$2(([chunks, z]) => [z, flatten(chunks)])));
|
|
192
|
+
|
|
193
|
+
/** @internal */
|
|
194
|
+
const mapInput = /*#__PURE__*/dual(2, (self, f) => pipe(self, mapInputChunks(map$3(f))));
|
|
195
|
+
|
|
196
|
+
/** @internal */
|
|
197
|
+
const mapInputEffect = /*#__PURE__*/dual(2, (self, f) => mapInputChunksEffect(self, chunk => map$1(forEach$1(chunk, v => f(v)), unsafeFromArray)));
|
|
198
|
+
|
|
199
|
+
/** @internal */
|
|
200
|
+
const mapInputChunks = /*#__PURE__*/dual(2, (self, f) => {
|
|
201
|
+
const loop = readWith({
|
|
202
|
+
onInput: chunk => pipe(write(f(chunk)), flatMap$1(() => loop)),
|
|
203
|
+
onFailure: fail$1,
|
|
204
|
+
onDone: succeed$1
|
|
205
|
+
});
|
|
206
|
+
return new SinkImpl(pipe(loop, pipeTo(toChannel(self))));
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
/** @internal */
|
|
210
|
+
const mapInputChunksEffect = /*#__PURE__*/dual(2, (self, f) => {
|
|
211
|
+
const loop = readWith({
|
|
212
|
+
onInput: chunk => pipe(fromEffect$1(f(chunk)), flatMap$1(write), flatMap$1(() => loop)),
|
|
213
|
+
onFailure: fail$1,
|
|
214
|
+
onDone: succeed$1
|
|
215
|
+
});
|
|
216
|
+
return new SinkImpl(pipe(loop, pipeToOrFail(toChannel(self))));
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
/** @internal */
|
|
220
|
+
const die = defect => failCause(die$1(defect));
|
|
221
|
+
|
|
222
|
+
/** @internal */
|
|
223
|
+
const dieMessage = message => failCause(die$1(RuntimeException(message)));
|
|
224
|
+
|
|
225
|
+
/** @internal */
|
|
226
|
+
const dieSync = evaluate => failCauseSync(() => die$1(evaluate()));
|
|
227
|
+
|
|
228
|
+
/** @internal */
|
|
229
|
+
const dimap = /*#__PURE__*/dual(2, (self, options) => map(mapInput(self, options.onInput), options.onDone));
|
|
230
|
+
|
|
231
|
+
/** @internal */
|
|
232
|
+
const dimapEffect = /*#__PURE__*/dual(2, (self, options) => mapEffect(mapInputEffect(self, options.onInput), options.onDone));
|
|
233
|
+
|
|
234
|
+
/** @internal */
|
|
235
|
+
const dimapChunks = /*#__PURE__*/dual(2, (self, options) => map(mapInputChunks(self, options.onInput), options.onDone));
|
|
236
|
+
|
|
237
|
+
/** @internal */
|
|
238
|
+
const dimapChunksEffect = /*#__PURE__*/dual(2, (self, options) => mapEffect(mapInputChunksEffect(self, options.onInput), options.onDone));
|
|
239
|
+
|
|
240
|
+
/** @internal */
|
|
241
|
+
const drain = /*#__PURE__*/new SinkImpl( /*#__PURE__*/drain$1( /*#__PURE__*/identityChannel()));
|
|
242
|
+
|
|
243
|
+
/** @internal */
|
|
244
|
+
const drop = n => suspend(() => new SinkImpl(dropLoop(n)));
|
|
245
|
+
|
|
246
|
+
/** @internal */
|
|
247
|
+
const dropLoop = n => readWith({
|
|
248
|
+
onInput: input => {
|
|
249
|
+
const dropped = pipe(input, drop$1(n));
|
|
250
|
+
const leftover = Math.max(n - input.length, 0);
|
|
251
|
+
const more = isEmpty(input) || leftover > 0;
|
|
252
|
+
if (more) {
|
|
253
|
+
return dropLoop(leftover);
|
|
254
|
+
}
|
|
255
|
+
return pipe(write(dropped), zipRight$1(identityChannel()));
|
|
256
|
+
},
|
|
257
|
+
onFailure: fail$1,
|
|
258
|
+
onDone: () => unit
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
/** @internal */
|
|
262
|
+
const dropUntil = predicate => new SinkImpl(pipe(toChannel(dropWhile(input => !predicate(input))), pipeToOrFail(toChannel(drop(1)))));
|
|
263
|
+
|
|
264
|
+
/** @internal */
|
|
265
|
+
const dropUntilEffect = predicate => suspend(() => new SinkImpl(dropUntilEffectReader(predicate)));
|
|
266
|
+
|
|
267
|
+
/** @internal */
|
|
268
|
+
const dropUntilEffectReader = predicate => readWith({
|
|
269
|
+
onInput: input => pipe(input, dropUntil$1(predicate), map$1(leftover => {
|
|
270
|
+
const more = leftover.length === 0;
|
|
271
|
+
return more ? dropUntilEffectReader(predicate) : pipe(write(unsafeFromArray(leftover)), zipRight$1(identityChannel()));
|
|
272
|
+
}), unwrap$1),
|
|
273
|
+
onFailure: fail$1,
|
|
274
|
+
onDone: () => unit
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
/** @internal */
|
|
278
|
+
const dropWhile = predicate => new SinkImpl(dropWhileReader(predicate));
|
|
279
|
+
|
|
280
|
+
/** @internal */
|
|
281
|
+
const dropWhileReader = predicate => readWith({
|
|
282
|
+
onInput: input => {
|
|
283
|
+
const out = pipe(input, dropWhile$1(predicate));
|
|
284
|
+
if (isEmpty(out)) {
|
|
285
|
+
return dropWhileReader(predicate);
|
|
286
|
+
}
|
|
287
|
+
return pipe(write(out), zipRight$1(identityChannel()));
|
|
288
|
+
},
|
|
289
|
+
onFailure: fail$1,
|
|
290
|
+
onDone: succeedNow
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
/** @internal */
|
|
294
|
+
const dropWhileEffect = predicate => suspend(() => new SinkImpl(dropWhileEffectReader(predicate)));
|
|
295
|
+
|
|
296
|
+
/** @internal */
|
|
297
|
+
const dropWhileEffectReader = predicate => readWith({
|
|
298
|
+
onInput: input => pipe(input, dropWhile$2(predicate), map$1(leftover => {
|
|
299
|
+
const more = leftover.length === 0;
|
|
300
|
+
return more ? dropWhileEffectReader(predicate) : pipe(write(unsafeFromArray(leftover)), zipRight$1(identityChannel()));
|
|
301
|
+
}), unwrap$1),
|
|
302
|
+
onFailure: fail$1,
|
|
303
|
+
onDone: () => unit
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
/** @internal */
|
|
307
|
+
const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => new SinkImpl(pipe(self, toChannel, ensuring$1(finalizer))));
|
|
308
|
+
|
|
309
|
+
/** @internal */
|
|
310
|
+
const ensuringWith = /*#__PURE__*/dual(2, (self, finalizer) => new SinkImpl(pipe(self, toChannel, ensuringWith$1(finalizer))));
|
|
311
|
+
|
|
312
|
+
/** @internal */
|
|
313
|
+
const context = () => fromEffect(context$1());
|
|
314
|
+
|
|
315
|
+
/** @internal */
|
|
316
|
+
const contextWith = f => pipe(context(), map(f));
|
|
317
|
+
|
|
318
|
+
/** @internal */
|
|
319
|
+
const contextWithEffect = f => pipe(context(), mapEffect(f));
|
|
320
|
+
|
|
321
|
+
/** @internal */
|
|
322
|
+
const contextWithSink = f => new SinkImpl(unwrap$1(pipe(contextWith$1(context => toChannel(f(context))))));
|
|
323
|
+
|
|
324
|
+
/** @internal */
|
|
325
|
+
const every = predicate => fold(true, identity, (acc, input) => acc && predicate(input));
|
|
326
|
+
|
|
327
|
+
/** @internal */
|
|
328
|
+
const fail = e => new SinkImpl(fail$1(e));
|
|
329
|
+
|
|
330
|
+
/** @internal */
|
|
331
|
+
const failSync = evaluate => new SinkImpl(failSync$1(evaluate));
|
|
332
|
+
|
|
333
|
+
/** @internal */
|
|
334
|
+
const failCause = cause => new SinkImpl(failCause$1(cause));
|
|
335
|
+
|
|
336
|
+
/** @internal */
|
|
337
|
+
const failCauseSync = evaluate => new SinkImpl(failCauseSync$1(evaluate));
|
|
338
|
+
|
|
339
|
+
/** @internal */
|
|
340
|
+
const filterInput = f => {
|
|
341
|
+
return self => pipe(self, mapInputChunks(filter(f)));
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
/** @internal */
|
|
345
|
+
const filterInputEffect = /*#__PURE__*/dual(2, (self, f) => mapInputChunksEffect(self, chunk => map$1(filter$1(chunk, f), unsafeFromArray)));
|
|
346
|
+
|
|
347
|
+
/** @internal */
|
|
348
|
+
const findEffect = /*#__PURE__*/dual(2, (self, f) => {
|
|
349
|
+
const newChannel = pipe(fromEffect$1(pipe(make(empty()), zip$1(make(false)))), flatMap$1(([leftoversRef, upstreamDoneRef]) => {
|
|
350
|
+
const upstreamMarker = readWith({
|
|
351
|
+
onInput: input => pipe(write(input), flatMap$1(() => upstreamMarker)),
|
|
352
|
+
onFailure: fail$1,
|
|
353
|
+
onDone: done => pipe(fromEffect$1(set$1(upstreamDoneRef, true)), as$1(done))
|
|
354
|
+
});
|
|
355
|
+
const loop = foldChannel(collectElements(toChannel(self)), {
|
|
356
|
+
onFailure: fail$1,
|
|
357
|
+
onSuccess: ([leftovers, doneValue]) => pipe(fromEffect$1(f(doneValue)), flatMap$1(satisfied => pipe(fromEffect$1(set$1(leftoversRef, flatten(leftovers))), zipRight$1(pipe(fromEffect$1(get(upstreamDoneRef)), flatMap$1(upstreamDone => {
|
|
358
|
+
if (satisfied) {
|
|
359
|
+
return pipe(write(flatten(leftovers)), as$1(some$1(doneValue)));
|
|
360
|
+
}
|
|
361
|
+
if (upstreamDone) {
|
|
362
|
+
return pipe(write(flatten(leftovers)), as$1(none()));
|
|
363
|
+
}
|
|
364
|
+
return loop;
|
|
365
|
+
}))))))
|
|
366
|
+
});
|
|
367
|
+
return pipe(upstreamMarker, pipeTo(bufferChunk(leftoversRef)), pipeTo(loop));
|
|
368
|
+
}));
|
|
369
|
+
return new SinkImpl(newChannel);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
/** @internal */
|
|
373
|
+
const fold = (s, contFn, f) => suspend(() => new SinkImpl(foldReader(s, contFn, f)));
|
|
374
|
+
|
|
375
|
+
/** @internal */
|
|
376
|
+
const foldReader = (s, contFn, f) => {
|
|
377
|
+
if (!contFn(s)) {
|
|
378
|
+
return succeedNow(s);
|
|
379
|
+
}
|
|
380
|
+
return readWith({
|
|
381
|
+
onInput: input => {
|
|
382
|
+
const [nextS, leftovers] = foldChunkSplit(s, input, contFn, f, 0, input.length);
|
|
383
|
+
if (isNonEmpty(leftovers)) {
|
|
384
|
+
return pipe(write(leftovers), as$1(nextS));
|
|
385
|
+
}
|
|
386
|
+
return foldReader(nextS, contFn, f);
|
|
387
|
+
},
|
|
388
|
+
onFailure: fail$1,
|
|
389
|
+
onDone: () => succeedNow(s)
|
|
390
|
+
});
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/** @internal */
|
|
394
|
+
const foldChunkSplit = (s, chunk, contFn, f, index, length) => {
|
|
395
|
+
if (index === length) {
|
|
396
|
+
return [s, empty()];
|
|
397
|
+
}
|
|
398
|
+
const s1 = f(s, pipe(chunk, unsafeGet$1(index)));
|
|
399
|
+
if (contFn(s1)) {
|
|
400
|
+
return foldChunkSplit(s1, chunk, contFn, f, index + 1, length);
|
|
401
|
+
}
|
|
402
|
+
return [s1, pipe(chunk, drop$1(index + 1))];
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/** @internal */
|
|
406
|
+
const foldSink = /*#__PURE__*/dual(2, (self, options) => {
|
|
407
|
+
const newChannel = pipe(toChannel(self), collectElements, foldChannel({
|
|
408
|
+
onFailure: error => toChannel(options.onFailure(error)),
|
|
409
|
+
onSuccess: ([leftovers, z]) => suspend$1(() => {
|
|
410
|
+
const leftoversRef = {
|
|
411
|
+
ref: pipe(leftovers, filter(isNonEmpty))
|
|
412
|
+
};
|
|
413
|
+
const refReader = pipe(sync$1(() => {
|
|
414
|
+
const ref = leftoversRef.ref;
|
|
415
|
+
leftoversRef.ref = empty();
|
|
416
|
+
return ref;
|
|
417
|
+
}),
|
|
418
|
+
// This cast is safe because of the L1 >: L <: In1 bound. It follows that
|
|
419
|
+
// L <: In1 and therefore Chunk[L] can be safely cast to Chunk[In1].
|
|
420
|
+
flatMap$1(chunk => writeChunk(chunk)));
|
|
421
|
+
const passthrough = identityChannel();
|
|
422
|
+
const continuationSink = pipe(refReader, zipRight$1(passthrough), pipeTo(toChannel(options.onSuccess(z))));
|
|
423
|
+
return flatMap$1(collectElements(continuationSink), ([newLeftovers, z1]) => pipe(succeed$1(leftoversRef.ref), flatMap$1(writeChunk), zipRight$1(writeChunk(newLeftovers)), as$1(z1)));
|
|
424
|
+
})
|
|
425
|
+
}));
|
|
426
|
+
return new SinkImpl(newChannel);
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
/** @internal */
|
|
430
|
+
const foldChunks = (s, contFn, f) => suspend(() => new SinkImpl(foldChunksReader(s, contFn, f)));
|
|
431
|
+
|
|
432
|
+
/** @internal */
|
|
433
|
+
const foldChunksReader = (s, contFn, f) => {
|
|
434
|
+
if (!contFn(s)) {
|
|
435
|
+
return succeedNow(s);
|
|
436
|
+
}
|
|
437
|
+
return readWith({
|
|
438
|
+
onInput: input => foldChunksReader(f(s, input), contFn, f),
|
|
439
|
+
onFailure: fail$1,
|
|
440
|
+
onDone: () => succeedNow(s)
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
/** @internal */
|
|
445
|
+
const foldChunksEffect = (s, contFn, f) => suspend(() => new SinkImpl(foldChunksEffectReader(s, contFn, f)));
|
|
446
|
+
|
|
447
|
+
/** @internal */
|
|
448
|
+
const foldChunksEffectReader = (s, contFn, f) => {
|
|
449
|
+
if (!contFn(s)) {
|
|
450
|
+
return succeedNow(s);
|
|
451
|
+
}
|
|
452
|
+
return readWith({
|
|
453
|
+
onInput: input => pipe(fromEffect$1(f(s, input)), flatMap$1(s => foldChunksEffectReader(s, contFn, f))),
|
|
454
|
+
onFailure: fail$1,
|
|
455
|
+
onDone: () => succeedNow(s)
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
/** @internal */
|
|
460
|
+
const foldEffect = (s, contFn, f) => suspend(() => new SinkImpl(foldEffectReader(s, contFn, f)));
|
|
461
|
+
|
|
462
|
+
/** @internal */
|
|
463
|
+
const foldEffectReader = (s, contFn, f) => {
|
|
464
|
+
if (!contFn(s)) {
|
|
465
|
+
return succeedNow(s);
|
|
466
|
+
}
|
|
467
|
+
return readWith({
|
|
468
|
+
onInput: input => pipe(fromEffect$1(foldChunkSplitEffect(s, input, contFn, f)), flatMap$1(([nextS, leftovers]) => pipe(leftovers, match$1({
|
|
469
|
+
onNone: () => foldEffectReader(nextS, contFn, f),
|
|
470
|
+
onSome: leftover => pipe(write(leftover), as$1(nextS))
|
|
471
|
+
})))),
|
|
472
|
+
onFailure: fail$1,
|
|
473
|
+
onDone: () => succeedNow(s)
|
|
474
|
+
});
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
/** @internal */
|
|
478
|
+
const foldChunkSplitEffect = (s, chunk, contFn, f) => foldChunkSplitEffectInternal(s, chunk, 0, chunk.length, contFn, f);
|
|
479
|
+
|
|
480
|
+
/** @internal */
|
|
481
|
+
const foldChunkSplitEffectInternal = (s, chunk, index, length, contFn, f) => {
|
|
482
|
+
if (index === length) {
|
|
483
|
+
return succeed$2([s, none()]);
|
|
484
|
+
}
|
|
485
|
+
return pipe(f(s, pipe(chunk, unsafeGet$1(index))), flatMap$2(s1 => contFn(s1) ? foldChunkSplitEffectInternal(s1, chunk, index + 1, length, contFn, f) : succeed$2([s1, some$1(pipe(chunk, drop$1(index + 1)))])));
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
/** @internal */
|
|
489
|
+
const foldLeft = (s, f) => ignoreLeftover(fold(s, constTrue, f));
|
|
490
|
+
|
|
491
|
+
/** @internal */
|
|
492
|
+
const foldLeftChunks = (s, f) => foldChunks(s, constTrue, f);
|
|
493
|
+
|
|
494
|
+
/** @internal */
|
|
495
|
+
const foldLeftChunksEffect = (s, f) => ignoreLeftover(foldChunksEffect(s, constTrue, f));
|
|
496
|
+
|
|
497
|
+
/** @internal */
|
|
498
|
+
const foldLeftEffect = (s, f) => foldEffect(s, constTrue, f);
|
|
499
|
+
|
|
500
|
+
/** @internal */
|
|
501
|
+
const foldUntil = (s, max, f) => pipe(fold([s, 0], tuple => tuple[1] < max, ([output, count], input) => [f(output, input), count + 1]), map(tuple => tuple[0]));
|
|
502
|
+
|
|
503
|
+
/** @internal */
|
|
504
|
+
const foldUntilEffect = (s, max, f) => pipe(foldEffect([s, 0], tuple => tuple[1] < max, ([output, count], input) => pipe(f(output, input), map$1(s => [s, count + 1]))), map(tuple => tuple[0]));
|
|
505
|
+
|
|
506
|
+
/** @internal */
|
|
507
|
+
const foldWeighted = options => foldWeightedDecompose({
|
|
508
|
+
...options,
|
|
509
|
+
decompose: of
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
/** @internal */
|
|
513
|
+
const foldWeightedDecompose = options => suspend(() => new SinkImpl(foldWeightedDecomposeLoop(options.initial, 0, false, options.maxCost, options.cost, options.decompose, options.body)));
|
|
514
|
+
|
|
515
|
+
/** @internal */
|
|
516
|
+
const foldWeightedDecomposeLoop = (s, cost, dirty, max, costFn, decompose, f) => readWith({
|
|
517
|
+
onInput: input => {
|
|
518
|
+
const [nextS, nextCost, nextDirty, leftovers] = foldWeightedDecomposeFold(input, 0, s, cost, dirty, max, costFn, decompose, f);
|
|
519
|
+
if (isNonEmpty(leftovers)) {
|
|
520
|
+
return pipe(write(leftovers), zipRight$1(succeedNow(nextS)));
|
|
521
|
+
}
|
|
522
|
+
if (cost > max) {
|
|
523
|
+
return succeedNow(nextS);
|
|
524
|
+
}
|
|
525
|
+
return foldWeightedDecomposeLoop(nextS, nextCost, nextDirty, max, costFn, decompose, f);
|
|
526
|
+
},
|
|
527
|
+
onFailure: fail$1,
|
|
528
|
+
onDone: () => succeedNow(s)
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
/** @internal */
|
|
532
|
+
const foldWeightedDecomposeFold = (input, index, s, cost, dirty, max, costFn, decompose, f) => {
|
|
533
|
+
if (index === input.length) {
|
|
534
|
+
return [s, cost, dirty, empty()];
|
|
535
|
+
}
|
|
536
|
+
const elem = pipe(input, unsafeGet$1(index));
|
|
537
|
+
const total = cost + costFn(s, elem);
|
|
538
|
+
if (total <= max) {
|
|
539
|
+
return foldWeightedDecomposeFold(input, index + 1, f(s, elem), total, true, max, costFn, decompose, f);
|
|
540
|
+
}
|
|
541
|
+
const decomposed = decompose(elem);
|
|
542
|
+
if (decomposed.length <= 1 && !dirty) {
|
|
543
|
+
// If `elem` cannot be decomposed, we need to cross the `max` threshold. To
|
|
544
|
+
// minimize "injury", we only allow this when we haven't added anything else
|
|
545
|
+
// to the aggregate (dirty = false).
|
|
546
|
+
return [f(s, elem), total, true, pipe(input, drop$1(index + 1))];
|
|
547
|
+
}
|
|
548
|
+
if (decomposed.length <= 1 && dirty) {
|
|
549
|
+
// If the state is dirty and `elem` cannot be decomposed, we stop folding
|
|
550
|
+
// and include `elem` in the leftovers.
|
|
551
|
+
return [s, cost, dirty, pipe(input, drop$1(index))];
|
|
552
|
+
}
|
|
553
|
+
// `elem` got decomposed, so we will recurse with the decomposed elements pushed
|
|
554
|
+
// into the chunk we're processing and see if we can aggregate further.
|
|
555
|
+
const next = pipe(decomposed, appendAll(pipe(input, drop$1(index + 1))));
|
|
556
|
+
return foldWeightedDecomposeFold(next, 0, s, cost, dirty, max, costFn, decompose, f);
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
/** @internal */
|
|
560
|
+
const foldWeightedDecomposeEffect = options => suspend(() => new SinkImpl(foldWeightedDecomposeEffectLoop(options.initial, options.maxCost, options.cost, options.decompose, options.body, 0, false)));
|
|
561
|
+
|
|
562
|
+
/** @internal */
|
|
563
|
+
const foldWeightedEffect = options => foldWeightedDecomposeEffect({
|
|
564
|
+
...options,
|
|
565
|
+
decompose: input => succeed$2(of(input))
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
/** @internal */
|
|
569
|
+
const foldWeightedDecomposeEffectLoop = (s, max, costFn, decompose, f, cost, dirty) => readWith({
|
|
570
|
+
onInput: input => pipe(fromEffect$1(foldWeightedDecomposeEffectFold(s, max, costFn, decompose, f, input, dirty, cost, 0)), flatMap$1(([nextS, nextCost, nextDirty, leftovers]) => {
|
|
571
|
+
if (isNonEmpty(leftovers)) {
|
|
572
|
+
return pipe(write(leftovers), zipRight$1(succeedNow(nextS)));
|
|
573
|
+
}
|
|
574
|
+
if (cost > max) {
|
|
575
|
+
return succeedNow(nextS);
|
|
576
|
+
}
|
|
577
|
+
return foldWeightedDecomposeEffectLoop(nextS, max, costFn, decompose, f, nextCost, nextDirty);
|
|
578
|
+
})),
|
|
579
|
+
onFailure: fail$1,
|
|
580
|
+
onDone: () => succeedNow(s)
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
/** @internal */
|
|
584
|
+
const foldWeightedDecomposeEffectFold = (s, max, costFn, decompose, f, input, dirty, cost, index) => {
|
|
585
|
+
if (index === input.length) {
|
|
586
|
+
return succeed$2([s, cost, dirty, empty()]);
|
|
587
|
+
}
|
|
588
|
+
const elem = pipe(input, unsafeGet$1(index));
|
|
589
|
+
return pipe(costFn(s, elem), map$1(newCost => cost + newCost), flatMap$2(total => {
|
|
590
|
+
if (total <= max) {
|
|
591
|
+
return pipe(f(s, elem), flatMap$2(s => foldWeightedDecomposeEffectFold(s, max, costFn, decompose, f, input, true, total, index + 1)));
|
|
592
|
+
}
|
|
593
|
+
return pipe(decompose(elem), flatMap$2(decomposed => {
|
|
594
|
+
if (decomposed.length <= 1 && !dirty) {
|
|
595
|
+
// If `elem` cannot be decomposed, we need to cross the `max` threshold. To
|
|
596
|
+
// minimize "injury", we only allow this when we haven't added anything else
|
|
597
|
+
// to the aggregate (dirty = false).
|
|
598
|
+
return pipe(f(s, elem), map$1(s => [s, total, true, pipe(input, drop$1(index + 1))]));
|
|
599
|
+
}
|
|
600
|
+
if (decomposed.length <= 1 && dirty) {
|
|
601
|
+
// If the state is dirty and `elem` cannot be decomposed, we stop folding
|
|
602
|
+
// and include `elem` in th leftovers.
|
|
603
|
+
return succeed$2([s, cost, dirty, pipe(input, drop$1(index))]);
|
|
604
|
+
}
|
|
605
|
+
// `elem` got decomposed, so we will recurse with the decomposed elements pushed
|
|
606
|
+
// into the chunk we're processing and see if we can aggregate further.
|
|
607
|
+
const next = pipe(decomposed, appendAll(pipe(input, drop$1(index + 1))));
|
|
608
|
+
return foldWeightedDecomposeEffectFold(s, max, costFn, decompose, f, next, dirty, cost, 0);
|
|
609
|
+
}));
|
|
610
|
+
}));
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
/** @internal */
|
|
614
|
+
const flatMap = /*#__PURE__*/dual(2, (self, f) => foldSink(self, {
|
|
615
|
+
onFailure: fail,
|
|
616
|
+
onSuccess: f
|
|
617
|
+
}));
|
|
618
|
+
|
|
619
|
+
/** @internal */
|
|
620
|
+
const forEach = f => {
|
|
621
|
+
const process = readWithCause({
|
|
622
|
+
onInput: input => pipe(fromEffect$1(forEach$1(input, v => f(v), {
|
|
623
|
+
discard: true
|
|
624
|
+
})), flatMap$1(() => process)),
|
|
625
|
+
onFailure: failCause$1,
|
|
626
|
+
onDone: () => unit
|
|
627
|
+
});
|
|
628
|
+
return new SinkImpl(process);
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
/** @internal */
|
|
632
|
+
const forEachChunk = f => {
|
|
633
|
+
const process = readWithCause({
|
|
634
|
+
onInput: input => pipe(fromEffect$1(f(input)), flatMap$1(() => process)),
|
|
635
|
+
onFailure: failCause$1,
|
|
636
|
+
onDone: () => unit
|
|
637
|
+
});
|
|
638
|
+
return new SinkImpl(process);
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
/** @internal */
|
|
642
|
+
const forEachWhile = f => {
|
|
643
|
+
const process = readWithCause({
|
|
644
|
+
onInput: input => forEachWhileReader(f, input, 0, input.length, process),
|
|
645
|
+
onFailure: failCause$1,
|
|
646
|
+
onDone: () => unit
|
|
647
|
+
});
|
|
648
|
+
return new SinkImpl(process);
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
/** @internal */
|
|
652
|
+
const forEachWhileReader = (f, input, index, length, cont) => {
|
|
653
|
+
if (index === length) {
|
|
654
|
+
return cont;
|
|
655
|
+
}
|
|
656
|
+
return pipe(fromEffect$1(f(pipe(input, unsafeGet$1(index)))), flatMap$1(bool => bool ? forEachWhileReader(f, input, index + 1, length, cont) : write(pipe(input, drop$1(index)))), catchAll(error => pipe(write(pipe(input, drop$1(index))), zipRight$1(fail$1(error)))));
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
/** @internal */
|
|
660
|
+
const forEachChunkWhile = f => {
|
|
661
|
+
const reader = readWith({
|
|
662
|
+
onInput: input => pipe(fromEffect$1(f(input)), flatMap$1(cont => cont ? reader : unit)),
|
|
663
|
+
onFailure: fail$1,
|
|
664
|
+
onDone: () => unit
|
|
665
|
+
});
|
|
666
|
+
return new SinkImpl(reader);
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/** @internal */
|
|
670
|
+
const fromChannel = channel => new SinkImpl(channel);
|
|
671
|
+
|
|
672
|
+
/** @internal */
|
|
673
|
+
const fromEffect = effect => new SinkImpl(fromEffect$1(effect));
|
|
674
|
+
|
|
675
|
+
/** @internal */
|
|
676
|
+
const fromHub = (hub, options) => fromQueue(hub, options);
|
|
677
|
+
|
|
678
|
+
/** @internal */
|
|
679
|
+
const fromPush = push => new SinkImpl(unwrapScoped$1(pipe(push, map$1(fromPushPull))));
|
|
680
|
+
const fromPushPull = push => readWith({
|
|
681
|
+
onInput: input => foldChannel(fromEffect$1(push(some$1(input))), {
|
|
682
|
+
onFailure: ([either, leftovers]) => match(either, {
|
|
683
|
+
onLeft: error => pipe(write(leftovers), zipRight$1(fail$1(error))),
|
|
684
|
+
onRight: z => pipe(write(leftovers), zipRight$1(succeedNow(z)))
|
|
685
|
+
}),
|
|
686
|
+
onSuccess: () => fromPushPull(push)
|
|
687
|
+
}),
|
|
688
|
+
onFailure: fail$1,
|
|
689
|
+
onDone: () => foldChannel(fromEffect$1(push(none())), {
|
|
690
|
+
onFailure: ([either, leftovers]) => match(either, {
|
|
691
|
+
onLeft: error => pipe(write(leftovers), zipRight$1(fail$1(error))),
|
|
692
|
+
onRight: z => pipe(write(leftovers), zipRight$1(succeedNow(z)))
|
|
693
|
+
}),
|
|
694
|
+
onSuccess: () => fromEffect$1(dieMessage$1("BUG: Sink.fromPush - please report an issue at https://github.com/Effect-TS/stream/issues"))
|
|
695
|
+
})
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
/** @internal */
|
|
699
|
+
const fromQueue = (queue, options) => options?.shutdown ? unwrapScoped(map$1(acquireRelease(succeed$2(queue), shutdown), fromQueue)) : forEachChunk(input => pipe(offerAll(queue, input)));
|
|
700
|
+
|
|
701
|
+
/** @internal */
|
|
702
|
+
const head = () => fold(none(), isNone, (option, input) => match$1(option, {
|
|
703
|
+
onNone: () => some$1(input),
|
|
704
|
+
onSome: () => option
|
|
705
|
+
}));
|
|
706
|
+
|
|
707
|
+
/** @internal */
|
|
708
|
+
const ignoreLeftover = self => new SinkImpl(drain$1(toChannel(self)));
|
|
709
|
+
|
|
710
|
+
/** @internal */
|
|
711
|
+
const last = () => foldLeftChunks(none(), (s, input) => orElse$2(last$1(input), () => s));
|
|
712
|
+
|
|
713
|
+
/** @internal */
|
|
714
|
+
const leftover = chunk => new SinkImpl(suspend$1(() => write(chunk)));
|
|
715
|
+
|
|
716
|
+
/** @internal */
|
|
717
|
+
const map = /*#__PURE__*/dual(2, (self, f) => {
|
|
718
|
+
return new SinkImpl(pipe(toChannel(self), map$2(f)));
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
/** @internal */
|
|
722
|
+
const mapEffect = /*#__PURE__*/dual(2, (self, f) => new SinkImpl(pipe(toChannel(self), mapEffect$1(f))));
|
|
723
|
+
|
|
724
|
+
/** @internal */
|
|
725
|
+
const mapError = /*#__PURE__*/dual(2, (self, f) => new SinkImpl(pipe(toChannel(self), mapError$1(f))));
|
|
726
|
+
|
|
727
|
+
/** @internal */
|
|
728
|
+
const mapLeftover = /*#__PURE__*/dual(2, (self, f) => new SinkImpl(pipe(toChannel(self), mapOut(map$3(f)))));
|
|
729
|
+
|
|
730
|
+
/** @internal */
|
|
731
|
+
const never = /*#__PURE__*/fromEffect(never$1);
|
|
732
|
+
|
|
733
|
+
/** @internal */
|
|
734
|
+
const orElse = /*#__PURE__*/dual(2, (self, that) => new SinkImpl(pipe(toChannel(self), orElse$1(() => toChannel(that())))));
|
|
735
|
+
|
|
736
|
+
/** @internal */
|
|
737
|
+
const provideContext = /*#__PURE__*/dual(2, (self, context) => new SinkImpl(pipe(toChannel(self), provideContext$1(context))));
|
|
738
|
+
|
|
739
|
+
/** @internal */
|
|
740
|
+
const race = /*#__PURE__*/dual(2, (self, that) => pipe(self, raceBoth(that), map(merge)));
|
|
741
|
+
|
|
742
|
+
/** @internal */
|
|
743
|
+
const raceBoth = /*#__PURE__*/dual(args => isSink(args[1]), (self, that, options) => raceWith(self, {
|
|
744
|
+
other: that,
|
|
745
|
+
onSelfDone: selfDone => Done(map$1(selfDone, left)),
|
|
746
|
+
onOtherDone: thatDone => Done(map$1(thatDone, right)),
|
|
747
|
+
capacity: options?.capacity ?? 16
|
|
748
|
+
}));
|
|
749
|
+
|
|
750
|
+
/** @internal */
|
|
751
|
+
const raceWith = /*#__PURE__*/dual(2, (self, options) => {
|
|
752
|
+
const scoped = gen(function* ($) {
|
|
753
|
+
const hub = yield* $(bounded(options?.capacity ?? 16));
|
|
754
|
+
const channel1 = yield* $(fromHubScoped(hub));
|
|
755
|
+
const channel2 = yield* $(fromHubScoped(hub));
|
|
756
|
+
const reader = toHub(hub);
|
|
757
|
+
const writer = pipe(channel1, pipeTo(toChannel(self)), mergeWith({
|
|
758
|
+
other: pipe(channel2, pipeTo(toChannel(options.other))),
|
|
759
|
+
onSelfDone: options.onSelfDone,
|
|
760
|
+
onOtherDone: options.onOtherDone
|
|
761
|
+
}));
|
|
762
|
+
const racedChannel = mergeWith(reader, {
|
|
763
|
+
other: writer,
|
|
764
|
+
onSelfDone: _ => Await(exit => suspend$2(() => exit)),
|
|
765
|
+
onOtherDone: done => Done(suspend$2(() => done))
|
|
766
|
+
});
|
|
767
|
+
return new SinkImpl(racedChannel);
|
|
768
|
+
});
|
|
769
|
+
return unwrapScoped(scoped);
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
/** @internal */
|
|
773
|
+
const refineOrDie = /*#__PURE__*/dual(2, (self, pf) => pipe(self, refineOrDieWith(pf, identity)));
|
|
774
|
+
|
|
775
|
+
/** @internal */
|
|
776
|
+
const refineOrDieWith = /*#__PURE__*/dual(3, (self, pf, f) => {
|
|
777
|
+
const newChannel = pipe(self, toChannel, catchAll(error => match$1(pf(error), {
|
|
778
|
+
onNone: () => failCauseSync$1(() => die$1(f(error))),
|
|
779
|
+
onSome: fail$1
|
|
780
|
+
})));
|
|
781
|
+
return new SinkImpl(newChannel);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
/** @internal */
|
|
785
|
+
const some = predicate => fold(false, bool => !bool, (acc, input) => acc || predicate(input));
|
|
786
|
+
|
|
787
|
+
/** @internal */
|
|
788
|
+
const splitWhere = /*#__PURE__*/dual(2, (self, f) => {
|
|
789
|
+
const newChannel = pipe(fromEffect$1(make(empty())), flatMap$1(ref => pipe(splitWhereSplitter(false, ref, f), pipeToOrFail(toChannel(self)), collectElements, flatMap$1(([leftovers, z]) => pipe(fromEffect$1(get(ref)), flatMap$1(leftover => pipe(write(pipe(leftover, appendAll(flatten(leftovers)))), zipRight$1(succeed$1(z)))))))));
|
|
790
|
+
return new SinkImpl(newChannel);
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
/** @internal */
|
|
794
|
+
const splitWhereSplitter = (written, leftovers, f) => readWithCause({
|
|
795
|
+
onInput: input => {
|
|
796
|
+
if (isEmpty(input)) {
|
|
797
|
+
return splitWhereSplitter(written, leftovers, f);
|
|
798
|
+
}
|
|
799
|
+
if (written) {
|
|
800
|
+
const index = indexWhere(input, f);
|
|
801
|
+
if (index === -1) {
|
|
802
|
+
return zipRight$1(write(input), splitWhereSplitter(true, leftovers, f));
|
|
803
|
+
}
|
|
804
|
+
const [left, right] = splitAt(input, index);
|
|
805
|
+
return zipRight$1(write(left), fromEffect$1(set$1(leftovers, right)));
|
|
806
|
+
}
|
|
807
|
+
const index = indexWhere(input, f, 1);
|
|
808
|
+
if (index === -1) {
|
|
809
|
+
return zipRight$1(write(input), splitWhereSplitter(true, leftovers, f));
|
|
810
|
+
}
|
|
811
|
+
const [left, right] = pipe(input, splitAt(Math.max(index, 1)));
|
|
812
|
+
return zipRight$1(write(left), fromEffect$1(set$1(leftovers, right)));
|
|
813
|
+
},
|
|
814
|
+
onFailure: failCause$1,
|
|
815
|
+
onDone: succeed$1
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
/** @internal */
|
|
819
|
+
const indexWhere = (self, predicate, from = 0) => {
|
|
820
|
+
const iterator = self[Symbol.iterator]();
|
|
821
|
+
let index = 0;
|
|
822
|
+
let result = -1;
|
|
823
|
+
let next;
|
|
824
|
+
while (result < 0 && (next = iterator.next()) && !next.done) {
|
|
825
|
+
const a = next.value;
|
|
826
|
+
if (index >= from && predicate(a)) {
|
|
827
|
+
result = index;
|
|
828
|
+
}
|
|
829
|
+
index = index + 1;
|
|
830
|
+
}
|
|
831
|
+
return result;
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
/** @internal */
|
|
835
|
+
const succeed = z => new SinkImpl(succeed$1(z));
|
|
836
|
+
|
|
837
|
+
/** @internal */
|
|
838
|
+
const sum = /*#__PURE__*/foldLeftChunks(0, (acc, chunk) => acc + reduce(chunk, 0, (s, a) => s + a));
|
|
839
|
+
|
|
840
|
+
/** @internal */
|
|
841
|
+
const summarized = /*#__PURE__*/dual(3, (self, summary, f) => {
|
|
842
|
+
const newChannel = pipe(fromEffect$1(summary), flatMap$1(start => pipe(self, toChannel, flatMap$1(done => pipe(fromEffect$1(summary), map$2(end => [done, f(start, end)]))))));
|
|
843
|
+
return new SinkImpl(newChannel);
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
/** @internal */
|
|
847
|
+
const sync = evaluate => new SinkImpl(sync$1(evaluate));
|
|
848
|
+
|
|
849
|
+
/** @internal */
|
|
850
|
+
const take = n => pipe(foldChunks(empty(), chunk => chunk.length < n, (acc, chunk) => pipe(acc, appendAll(chunk))), flatMap(acc => {
|
|
851
|
+
const [taken, leftover] = pipe(acc, splitAt(n));
|
|
852
|
+
return new SinkImpl(pipe(write(leftover), zipRight$1(succeedNow(taken))));
|
|
853
|
+
}));
|
|
854
|
+
|
|
855
|
+
/** @internal */
|
|
856
|
+
const toChannel = self => isEffect(self) ? toChannel(fromEffect(self)) : self.channel;
|
|
857
|
+
|
|
858
|
+
/** @internal */
|
|
859
|
+
const unwrap = effect => new SinkImpl(unwrap$1(pipe(effect, map$1(sink => toChannel(sink)))));
|
|
860
|
+
|
|
861
|
+
/** @internal */
|
|
862
|
+
const unwrapScoped = effect => {
|
|
863
|
+
return new SinkImpl(unwrapScoped$1(pipe(effect, map$1(sink => toChannel(sink)))));
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
/** @internal */
|
|
867
|
+
const withDuration = self => pipe(self, summarized(currentTimeMillis, (start, end) => millis(end - start)));
|
|
868
|
+
|
|
869
|
+
/** @internal */
|
|
870
|
+
const zip = /*#__PURE__*/dual(args => isSink(args[1]), (self, that, options) => zipWith(self, that, (z, z2) => [z, z2], options));
|
|
871
|
+
|
|
872
|
+
/** @internal */
|
|
873
|
+
const zipLeft = /*#__PURE__*/dual(args => isSink(args[1]), (self, that, options) => zipWith(self, that, (z, _) => z, options));
|
|
874
|
+
|
|
875
|
+
/** @internal */
|
|
876
|
+
const zipRight = /*#__PURE__*/dual(args => isSink(args[1]), (self, that, options) => zipWith(self, that, (_, z2) => z2, options));
|
|
877
|
+
|
|
878
|
+
/** @internal */
|
|
879
|
+
const zipWith = /*#__PURE__*/dual(args => isSink(args[1]), (self, that, f, options) => options?.concurrent ? raceWith(self, {
|
|
880
|
+
other: that,
|
|
881
|
+
onSelfDone: match$2({
|
|
882
|
+
onFailure: cause => Done(failCause$2(cause)),
|
|
883
|
+
onSuccess: leftZ => Await(match$2({
|
|
884
|
+
onFailure: failCause$2,
|
|
885
|
+
onSuccess: rightZ => succeed$2(f(leftZ, rightZ))
|
|
886
|
+
}))
|
|
887
|
+
}),
|
|
888
|
+
onOtherDone: match$2({
|
|
889
|
+
onFailure: cause => Done(failCause$2(cause)),
|
|
890
|
+
onSuccess: rightZ => Await(match$2({
|
|
891
|
+
onFailure: failCause$2,
|
|
892
|
+
onSuccess: leftZ => succeed$2(f(leftZ, rightZ))
|
|
893
|
+
}))
|
|
894
|
+
})
|
|
895
|
+
}) : flatMap(self, z => map(that, z2 => f(z, z2))));
|
|
896
|
+
|
|
897
|
+
// Circular with Channel
|
|
898
|
+
|
|
899
|
+
/** @internal */
|
|
900
|
+
const channelToSink = self => new SinkImpl(self);
|
|
901
|
+
|
|
902
|
+
// Constants
|
|
903
|
+
|
|
904
|
+
/** @internal */
|
|
905
|
+
const count = /*#__PURE__*/foldLeftChunks(0, (acc, chunk) => acc + chunk.length);
|
|
906
|
+
|
|
907
|
+
/** @internal */
|
|
908
|
+
const mkString = /*#__PURE__*/suspend(() => {
|
|
909
|
+
const strings = [];
|
|
910
|
+
return pipe(foldLeftChunks(void 0, (_, elems) => map$3(elems, elem => {
|
|
911
|
+
strings.push(String(elem));
|
|
912
|
+
})), map(() => strings.join("")));
|
|
913
|
+
});
|
|
914
|
+
|
|
915
|
+
/** @internal */
|
|
916
|
+
const timed = /*#__PURE__*/pipe( /*#__PURE__*/withDuration(drain), /*#__PURE__*/map(tuple => tuple[1]));
|
|
917
|
+
|
|
918
|
+
export { SinkImpl, SinkTypeId, as, channelToSink, collectAll, collectAllFrom, collectAllN, collectAllToMap, collectAllToMapN, collectAllToSet, collectAllToSetN, collectAllUntil, collectAllUntilEffect, collectAllWhile, collectAllWhileEffect, collectAllWhileWith, collectLeftover, context, contextWith, contextWithEffect, contextWithSink, count, die, dieMessage, dieSync, dimap, dimapChunks, dimapChunksEffect, dimapEffect, drain, drop, dropUntil, dropUntilEffect, dropWhile, dropWhileEffect, ensuring, ensuringWith, every, fail, failCause, failCauseSync, failSync, filterInput, filterInputEffect, findEffect, flatMap, fold, foldChunks, foldChunksEffect, foldEffect, foldLeft, foldLeftChunks, foldLeftChunksEffect, foldLeftEffect, foldSink, foldUntil, foldUntilEffect, foldWeighted, foldWeightedDecompose, foldWeightedDecomposeEffect, foldWeightedEffect, forEach, forEachChunk, forEachChunkWhile, forEachWhile, fromChannel, fromEffect, fromHub, fromPush, fromQueue, head, ignoreLeftover, isSink, last, leftover, map, mapEffect, mapError, mapInput, mapInputChunks, mapInputChunksEffect, mapInputEffect, mapLeftover, mkString, never, orElse, provideContext, race, raceBoth, raceWith, refineOrDie, refineOrDieWith, some, splitWhere, succeed, sum, summarized, suspend, sync, take, timed, toChannel, unwrap, unwrapScoped, withDuration, zip, zipLeft, zipRight, zipWith };
|