effect 4.0.0-beta.2 → 4.0.0-beta.21
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/dist/Array.d.ts +127 -299
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +102 -62
- package/dist/Array.js.map +1 -1
- package/dist/Cache.d.ts +2 -2
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +6 -5
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts +116 -30
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +82 -37
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +54 -247
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +36 -67
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +165 -9
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +62 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +534 -365
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +132 -79
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +23 -161
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +6 -51
- package/dist/DateTime.js.map +1 -1
- package/dist/Duration.d.ts +12 -12
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +12 -12
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +829 -692
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +263 -251
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +194 -0
- package/dist/Encoding.d.ts.map +1 -0
- package/dist/Encoding.js +352 -0
- package/dist/Encoding.js.map +1 -0
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +124 -48
- package/dist/Equal.js.map +1 -1
- package/dist/ErrorReporter.d.ts +376 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +246 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/Fiber.d.ts +2 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +5 -5
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +30 -34
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +15 -13
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +229 -51
- package/dist/Formatter.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +5 -8
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +15 -14
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +4 -4
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +40 -39
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +94 -22
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +109 -0
- package/dist/Latch.d.ts.map +1 -0
- package/dist/Latch.js +72 -0
- package/dist/Latch.js.map +1 -0
- package/dist/Layer.d.ts +9 -9
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +4 -4
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LogLevel.d.ts +32 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +29 -95
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +1 -1
- package/dist/ManagedRuntime.js +1 -1
- package/dist/Metric.d.ts +2 -2
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +22 -15
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +14 -7
- package/dist/Option.js.map +1 -1
- package/dist/Pipeable.d.ts +17 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +19 -1
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +10 -9
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +2 -2
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +6 -4
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +7 -5
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts +3 -2
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -2
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +1 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +0 -1
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +35 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +46 -12
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +2 -2
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +1 -1
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Record.d.ts +24 -120
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +21 -41
- package/dist/Record.js.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/References.d.ts +3 -3
- package/dist/References.d.ts.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +2 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +6 -26
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +0 -20
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Result.d.ts +12 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +12 -0
- package/dist/Result.js.map +1 -1
- package/dist/Schedule.d.ts +47 -20
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +94 -34
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +266 -50
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +426 -74
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +7 -6
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +2 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +12 -14
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaParser.d.ts +5 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +10 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +44 -43
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +43 -24
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +107 -3
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +159 -4
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +211 -0
- package/dist/Semaphore.d.ts.map +1 -0
- package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
- package/dist/Semaphore.js.map +1 -0
- package/dist/ServiceMap.d.ts +39 -30
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +3 -3
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Sink.d.ts +13 -13
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +53 -6
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts +235 -423
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +124 -77
- package/dist/Stream.js.map +1 -1
- package/dist/Struct.d.ts +16 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +22 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +2 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Trie.d.ts +18 -17
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +5 -5
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +37 -37
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +3 -3
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +328 -0
- package/dist/TxDeferred.d.ts.map +1 -0
- package/dist/TxDeferred.js +196 -0
- package/dist/TxDeferred.js.map +1 -0
- package/dist/TxHashMap.d.ts +84 -83
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +24 -24
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +35 -35
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +14 -14
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +609 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -0
- package/dist/TxPriorityQueue.js +415 -0
- package/dist/TxPriorityQueue.js.map +1 -0
- package/dist/TxPubSub.d.ts +585 -0
- package/dist/TxPubSub.d.ts.map +1 -0
- package/dist/TxPubSub.js +521 -0
- package/dist/TxPubSub.js.map +1 -0
- package/dist/TxQueue.d.ts +32 -32
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +26 -26
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +523 -0
- package/dist/TxReentrantLock.d.ts.map +1 -0
- package/dist/TxReentrantLock.js +504 -0
- package/dist/TxReentrantLock.js.map +1 -0
- package/dist/TxRef.d.ts +34 -34
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +21 -14
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +8 -8
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +7 -7
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +508 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -0
- package/dist/TxSubscriptionRef.js +293 -0
- package/dist/TxSubscriptionRef.js.map +1 -0
- package/dist/Types.d.ts +84 -6
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +591 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +591 -20
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +11 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +3 -11
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +263 -99
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +5 -4
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +3 -2
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/request.js +2 -2
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -0
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/trie.js +5 -4
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts +7 -6
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +6 -4
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +8 -8
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +128 -48
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +11 -12
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +3 -3
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +4 -3
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +4 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +86 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +163 -87
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +49 -12
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +35 -7
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +25 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +22 -6
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +20 -20
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts +26 -26
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +1 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +19 -3
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +14 -9
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +1 -1
- package/dist/unstable/ai/index.js +1 -1
- package/dist/unstable/cli/CliError.d.ts +5 -5
- package/dist/unstable/cli/CliOutput.js +59 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +276 -19
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +234 -36
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
- package/dist/unstable/cli/GlobalFlag.js +118 -0
- package/dist/unstable/cli/GlobalFlag.js.map +1 -0
- package/dist/unstable/cli/HelpDoc.d.ts +70 -2
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/index.d.ts +4 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +4 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +17 -8
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +32 -23
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +7 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts +33 -0
- package/dist/unstable/cli/internal/help.d.ts.map +1 -0
- package/dist/unstable/cli/internal/help.js +107 -0
- package/dist/unstable/cli/internal/help.js.map +1 -0
- package/dist/unstable/cli/internal/parser.js +29 -36
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +7 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +4 -4
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +2 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +4 -3
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +9 -7
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +21 -21
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +20 -20
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -4
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +2 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +1 -1
- package/dist/unstable/encoding/Sse.d.ts +4 -4
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -1
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
- package/dist/unstable/http/Cookies.d.ts +3 -3
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +2 -2
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +27 -10
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +17 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +28 -1
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +37 -13
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +4 -4
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +27 -11
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +15 -3
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -8
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +42 -56
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +8 -17
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +20 -33
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +37 -44
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +2 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +3 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +3 -3
- package/dist/unstable/http/UrlParams.d.ts +14 -6
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +1 -1
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +23 -12
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +7 -2
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +3 -3
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +31 -44
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +15 -24
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +11 -0
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +29 -9
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +32 -21
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +6 -6
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +12 -11
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -2
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -128
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +21 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +10 -10
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +16 -13
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +8 -8
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +3 -3
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +24 -7
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +39 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
- package/dist/unstable/reactivity/Hydration.js +76 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -0
- package/dist/unstable/reactivity/index.d.ts +4 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +4 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +4 -4
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -26
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +6 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +3 -3
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +14 -0
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +34 -9
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +0 -7
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +15 -15
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +3 -3
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +3 -3
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +4 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +6 -5
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +14 -14
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +9 -3
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +3 -3
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +16 -5
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +17 -7
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.js +0 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +2 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +3 -3
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +2 -2
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +3 -3
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +1 -1
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +12 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +137 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -2
- package/src/Array.ts +190 -342
- package/src/Cache.ts +9 -8
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +554 -138
- package/src/Chunk.ts +81 -268
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +183 -21
- package/src/Data.ts +538 -374
- package/src/DateTime.ts +24 -164
- package/src/Duration.ts +15 -15
- package/src/Effect.ts +991 -800
- package/src/Encoding.ts +879 -0
- package/src/Equal.ts +278 -111
- package/src/ErrorReporter.ts +459 -0
- package/src/Fiber.ts +9 -2
- package/src/FileSystem.ts +7 -8
- package/src/Filter.ts +48 -58
- package/src/Formatter.ts +253 -51
- package/src/Graph.ts +24 -11
- package/src/HashMap.ts +15 -14
- package/src/Iterable.ts +105 -50
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +112 -0
- package/src/Layer.ts +11 -15
- package/src/LayerMap.ts +5 -5
- package/src/LogLevel.ts +37 -0
- package/src/Logger.ts +33 -100
- package/src/ManagedRuntime.ts +1 -1
- package/src/Metric.ts +4 -4
- package/src/Optic.ts +948 -19
- package/src/Option.ts +30 -20
- package/src/Pipeable.ts +32 -1
- package/src/PlatformError.ts +5 -5
- package/src/Pool.ts +13 -11
- package/src/PubSub.ts +10 -9
- package/src/Pull.ts +1 -1
- package/src/Queue.ts +0 -1
- package/src/Random.ts +51 -14
- package/src/RcMap.ts +5 -5
- package/src/RcRef.ts +1 -1
- package/src/Record.ts +43 -152
- package/src/Reducer.ts +166 -7
- package/src/References.ts +4 -4
- package/src/Request.ts +3 -2
- package/src/RequestResolver.ts +9 -29
- package/src/Result.ts +13 -0
- package/src/Schedule.ts +318 -160
- package/src/Schema.ts +661 -116
- package/src/SchemaAST.ts +7 -6
- package/src/SchemaGetter.ts +12 -14
- package/src/SchemaParser.ts +11 -0
- package/src/SchemaRepresentation.ts +43 -24
- package/src/SchemaTransformation.ts +189 -4
- package/src/ScopedCache.ts +3 -3
- package/src/Semaphore.ts +356 -0
- package/src/ServiceMap.ts +47 -38
- package/src/Sink.ts +78 -26
- package/src/Stream.ts +566 -601
- package/src/Struct.ts +26 -0
- package/src/SubscriptionRef.ts +3 -2
- package/src/SynchronizedRef.ts +3 -2
- package/src/Trie.ts +18 -17
- package/src/TxChunk.ts +72 -53
- package/src/TxDeferred.ts +394 -0
- package/src/TxHashMap.ts +332 -285
- package/src/TxHashSet.ts +111 -116
- package/src/TxPriorityQueue.ts +767 -0
- package/src/TxPubSub.ts +789 -0
- package/src/TxQueue.ts +241 -251
- package/src/TxReentrantLock.ts +753 -0
- package/src/TxRef.ts +50 -38
- package/src/TxSemaphore.ts +29 -32
- package/src/TxSubscriptionRef.ts +639 -0
- package/src/Types.ts +78 -2
- package/src/index.ts +600 -21
- package/src/internal/core.ts +12 -5
- package/src/internal/dateTime.ts +9 -30
- package/src/internal/effect.ts +744 -265
- package/src/internal/hashMap.ts +9 -7
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +4 -3
- package/src/internal/request.ts +2 -2
- package/src/internal/schema/annotations.ts +2 -0
- package/src/internal/schema/schema.ts +1 -0
- package/src/internal/trie.ts +16 -9
- package/src/testing/TestClock.ts +13 -11
- package/src/testing/TestSchema.ts +10 -10
- package/src/unstable/ai/AiError.ts +97 -44
- package/src/unstable/ai/Chat.ts +12 -11
- package/src/unstable/ai/LanguageModel.ts +129 -25
- package/src/unstable/ai/McpSchema.ts +59 -13
- package/src/unstable/ai/McpServer.ts +48 -9
- package/src/unstable/ai/Model.ts +40 -9
- package/src/unstable/ai/Prompt.ts +37 -37
- package/src/unstable/ai/Response.ts +25 -25
- package/src/unstable/ai/Tool.ts +19 -13
- package/src/unstable/ai/index.ts +1 -1
- package/src/unstable/cli/CliOutput.ts +75 -6
- package/src/unstable/cli/Command.ts +501 -60
- package/src/unstable/cli/GlobalFlag.ts +243 -0
- package/src/unstable/cli/HelpDoc.ts +80 -2
- package/src/unstable/cli/index.ts +5 -0
- package/src/unstable/cli/internal/command.ts +50 -34
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +7 -2
- package/src/unstable/cli/internal/help.ts +146 -0
- package/src/unstable/cli/internal/parser.ts +33 -54
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -4
- package/src/unstable/cluster/Entity.ts +11 -10
- package/src/unstable/cluster/EntityResource.ts +4 -4
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/MessageStorage.ts +3 -5
- package/src/unstable/cluster/Runners.ts +6 -5
- package/src/unstable/cluster/Sharding.ts +12 -10
- package/src/unstable/cluster/ShardingConfig.ts +30 -31
- package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +9 -8
- package/src/unstable/cluster/internal/entityReaper.ts +2 -1
- package/src/unstable/cluster/internal/resourceRef.ts +2 -1
- package/src/unstable/encoding/Sse.ts +3 -5
- package/src/unstable/eventlog/EventLog.ts +2 -1
- package/src/unstable/http/Cookies.ts +3 -3
- package/src/unstable/http/Headers.ts +28 -13
- package/src/unstable/http/HttpBody.ts +42 -1
- package/src/unstable/http/HttpClient.ts +58 -23
- package/src/unstable/http/HttpClientRequest.ts +38 -13
- package/src/unstable/http/HttpEffect.ts +46 -68
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +9 -24
- package/src/unstable/http/HttpServerError.ts +42 -45
- package/src/unstable/http/HttpServerRequest.ts +1 -1
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +4 -2
- package/src/unstable/http/Multipart.ts +2 -2
- package/src/unstable/http/UrlParams.ts +20 -5
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +5 -5
- package/src/unstable/httpapi/HttpApiBuilder.ts +77 -21
- package/src/unstable/httpapi/HttpApiClient.ts +14 -6
- package/src/unstable/httpapi/HttpApiEndpoint.ts +67 -83
- package/src/unstable/httpapi/HttpApiError.ts +30 -9
- package/src/unstable/httpapi/HttpApiGroup.ts +6 -6
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -4
- package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
- package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
- package/src/unstable/httpapi/OpenApi.ts +41 -23
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +3 -3
- package/src/unstable/observability/OtlpLogger.ts +13 -9
- package/src/unstable/observability/OtlpMetrics.ts +4 -4
- package/src/unstable/observability/OtlpTracer.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +6 -6
- package/src/unstable/persistence/Persistable.ts +2 -2
- package/src/unstable/persistence/PersistedCache.ts +20 -9
- package/src/unstable/persistence/PersistedQueue.ts +25 -24
- package/src/unstable/persistence/Persistence.ts +3 -3
- package/src/unstable/persistence/RateLimiter.ts +4 -4
- package/src/unstable/process/ChildProcess.ts +6 -208
- package/src/unstable/process/ChildProcessSpawner.ts +75 -14
- package/src/unstable/reactivity/Atom.ts +27 -25
- package/src/unstable/reactivity/AtomHttpApi.ts +21 -20
- package/src/unstable/reactivity/AtomRegistry.ts +31 -7
- package/src/unstable/reactivity/AtomRpc.ts +3 -3
- package/src/unstable/reactivity/Hydration.ts +112 -0
- package/src/unstable/reactivity/index.ts +5 -0
- package/src/unstable/rpc/Rpc.ts +6 -6
- package/src/unstable/rpc/RpcClient.ts +12 -54
- package/src/unstable/rpc/RpcGroup.ts +4 -4
- package/src/unstable/rpc/RpcMiddleware.ts +3 -3
- package/src/unstable/rpc/RpcSchema.ts +17 -0
- package/src/unstable/rpc/RpcSerialization.ts +44 -9
- package/src/unstable/rpc/RpcServer.ts +21 -30
- package/src/unstable/rpc/Utils.ts +2 -1
- package/src/unstable/schema/VariantSchema.ts +6 -6
- package/src/unstable/socket/Socket.ts +16 -17
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/sql/SqlError.ts +11 -9
- package/src/unstable/sql/SqlModel.ts +5 -5
- package/src/unstable/sql/SqlSchema.ts +41 -25
- package/src/unstable/sql/Statement.ts +0 -1
- package/src/unstable/workers/Worker.ts +2 -1
- package/src/unstable/workflow/DurableClock.ts +8 -8
- package/src/unstable/workflow/DurableDeferred.ts +2 -2
- package/src/unstable/workflow/Workflow.ts +6 -2
- package/src/unstable/workflow/WorkflowEngine.ts +185 -2
- package/dist/PartitionedSemaphore.d.ts +0 -52
- package/dist/PartitionedSemaphore.d.ts.map +0 -1
- package/dist/PartitionedSemaphore.js.map +0 -1
- package/dist/encoding/Base64.d.ts +0 -67
- package/dist/encoding/Base64.d.ts.map +0 -1
- package/dist/encoding/Base64.js +0 -146
- package/dist/encoding/Base64.js.map +0 -1
- package/dist/encoding/Base64Url.d.ts +0 -60
- package/dist/encoding/Base64Url.d.ts.map +0 -1
- package/dist/encoding/Base64Url.js +0 -89
- package/dist/encoding/Base64Url.js.map +0 -1
- package/dist/encoding/EncodingError.d.ts +0 -31
- package/dist/encoding/EncodingError.d.ts.map +0 -1
- package/dist/encoding/EncodingError.js +0 -22
- package/dist/encoding/EncodingError.js.map +0 -1
- package/dist/encoding/Hex.d.ts +0 -61
- package/dist/encoding/Hex.d.ts.map +0 -1
- package/dist/encoding/Hex.js +0 -115
- package/dist/encoding/Hex.js.map +0 -1
- package/dist/encoding/index.d.ts +0 -26
- package/dist/encoding/index.d.ts.map +0 -1
- package/dist/encoding/index.js +0 -27
- package/dist/encoding/index.js.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
- package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.js +0 -44
- package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
- package/src/PartitionedSemaphore.ts +0 -182
- package/src/encoding/Base64.ts +0 -366
- package/src/encoding/Base64Url.ts +0 -104
- package/src/encoding/EncodingError.ts +0 -35
- package/src/encoding/Hex.ts +0 -390
- package/src/encoding/index.ts +0 -31
- package/src/unstable/cli/internal/builtInFlags.ts +0 -78
package/src/Channel.ts
CHANGED
|
@@ -63,14 +63,15 @@ import * as Chunk from "./Chunk.ts"
|
|
|
63
63
|
import * as Effect from "./Effect.ts"
|
|
64
64
|
import * as Exit from "./Exit.ts"
|
|
65
65
|
import * as Fiber from "./Fiber.ts"
|
|
66
|
-
import * as Filter from "./Filter.ts"
|
|
66
|
+
import type * as Filter from "./Filter.ts"
|
|
67
67
|
import type { LazyArg } from "./Function.ts"
|
|
68
68
|
import { constant, constTrue, constVoid, dual, identity as identity_ } from "./Function.ts"
|
|
69
69
|
import { ClockRef, endSpan } from "./internal/effect.ts"
|
|
70
70
|
import { addSpanStackTrace } from "./internal/tracer.ts"
|
|
71
71
|
import * as Iterable from "./Iterable.ts"
|
|
72
|
+
import * as Latch from "./Latch.ts"
|
|
72
73
|
import * as Layer from "./Layer.ts"
|
|
73
|
-
import type {
|
|
74
|
+
import type { Severity } from "./LogLevel.ts"
|
|
74
75
|
import * as Option from "./Option.ts"
|
|
75
76
|
import type { Pipeable } from "./Pipeable.ts"
|
|
76
77
|
import { pipeArguments } from "./Pipeable.ts"
|
|
@@ -83,6 +84,7 @@ import { TracerTimingEnabled } from "./References.ts"
|
|
|
83
84
|
import * as Result from "./Result.ts"
|
|
84
85
|
import * as Schedule from "./Schedule.ts"
|
|
85
86
|
import * as Scope from "./Scope.ts"
|
|
87
|
+
import * as Semaphore from "./Semaphore.ts"
|
|
86
88
|
import * as ServiceMap from "./ServiceMap.ts"
|
|
87
89
|
import * as String from "./String.ts"
|
|
88
90
|
import * as Take from "./Take.ts"
|
|
@@ -2084,7 +2086,7 @@ const mapEffectConcurrent = <
|
|
|
2084
2086
|
const trackFiber = Fiber.runIn(forkedScope)
|
|
2085
2087
|
|
|
2086
2088
|
if (options.unordered) {
|
|
2087
|
-
const semaphore =
|
|
2089
|
+
const semaphore = Semaphore.makeUnsafe(concurrencyN)
|
|
2088
2090
|
const release = constant(semaphore.release(1))
|
|
2089
2091
|
const handle = Effect.matchCauseEffect({
|
|
2090
2092
|
onFailure: (cause: Cause.Cause<EX>) => Effect.flatMap(Queue.failCause(queue, cause), release),
|
|
@@ -3562,9 +3564,9 @@ export const filter: {
|
|
|
3562
3564
|
* @since 2.0.0
|
|
3563
3565
|
* @category Filtering
|
|
3564
3566
|
*/
|
|
3565
|
-
<OutElem
|
|
3567
|
+
<OutElem>(predicate: Predicate.Predicate<OutElem>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3566
3568
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3567
|
-
) => Channel<
|
|
3569
|
+
) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3568
3570
|
/**
|
|
3569
3571
|
* Filters the output elements of a channel using a predicate function.
|
|
3570
3572
|
* Elements that don't match the predicate are discarded.
|
|
@@ -3623,24 +3625,59 @@ export const filter: {
|
|
|
3623
3625
|
* @since 2.0.0
|
|
3624
3626
|
* @category Filtering
|
|
3625
3627
|
*/
|
|
3626
|
-
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3628
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3629
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3630
|
+
predicate: Predicate.Predicate<OutElem>
|
|
3631
|
+
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3632
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3633
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3634
|
+
predicate: Predicate.Predicate<OutElem>
|
|
3635
|
+
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3636
|
+
fromTransform((upstream, scope) =>
|
|
3637
|
+
Effect.map(
|
|
3638
|
+
toTransform(self)(upstream, scope),
|
|
3639
|
+
(pull) =>
|
|
3640
|
+
Effect.flatMap(pull, function loop(elem): Pull.Pull<OutElem, OutErr, OutDone> {
|
|
3641
|
+
return predicate(elem)
|
|
3642
|
+
? Effect.succeed(elem)
|
|
3643
|
+
: Effect.flatMap(pull, loop)
|
|
3644
|
+
})
|
|
3645
|
+
)
|
|
3646
|
+
))
|
|
3647
|
+
|
|
3648
|
+
/**
|
|
3649
|
+
* @since 4.0.0
|
|
3650
|
+
* @category Filtering
|
|
3651
|
+
*/
|
|
3652
|
+
export const filterMap: {
|
|
3653
|
+
/**
|
|
3654
|
+
* @since 4.0.0
|
|
3655
|
+
* @category Filtering
|
|
3656
|
+
*/
|
|
3657
|
+
<OutElem, B, X>(filter: Filter.Filter<OutElem, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3658
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3659
|
+
) => Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3660
|
+
/**
|
|
3661
|
+
* @since 4.0.0
|
|
3662
|
+
* @category Filtering
|
|
3663
|
+
*/
|
|
3664
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
3627
3665
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3628
|
-
filter: Filter.
|
|
3629
|
-
): Channel<
|
|
3630
|
-
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env,
|
|
3666
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
3667
|
+
): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3668
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
3631
3669
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3632
|
-
filter: Filter.
|
|
3633
|
-
): Channel<
|
|
3670
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
3671
|
+
): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3634
3672
|
fromTransform((upstream, scope) =>
|
|
3635
3673
|
Effect.map(
|
|
3636
3674
|
toTransform(self)(upstream, scope),
|
|
3637
3675
|
(pull) =>
|
|
3638
|
-
Effect.flatMap(pull, function loop(elem): Pull.Pull<
|
|
3676
|
+
Effect.flatMap(pull, function loop(elem): Pull.Pull<B, OutErr, OutDone> {
|
|
3639
3677
|
const result = filter(elem)
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
return Effect.flatMap(pull, loop)
|
|
3678
|
+
return Result.isFailure(result)
|
|
3679
|
+
? Effect.flatMap(pull, loop)
|
|
3680
|
+
: Effect.succeed(result.success)
|
|
3644
3681
|
})
|
|
3645
3682
|
)
|
|
3646
3683
|
))
|
|
@@ -3650,6 +3687,46 @@ export const filter: {
|
|
|
3650
3687
|
* @category Filtering
|
|
3651
3688
|
*/
|
|
3652
3689
|
export const filterEffect: {
|
|
3690
|
+
/**
|
|
3691
|
+
* @since 4.0.0
|
|
3692
|
+
* @category Filtering
|
|
3693
|
+
*/
|
|
3694
|
+
<OutElem, E, R>(predicate: (a: OutElem) => Effect.Effect<boolean, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3695
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3696
|
+
) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
3697
|
+
/**
|
|
3698
|
+
* @since 4.0.0
|
|
3699
|
+
* @category Filtering
|
|
3700
|
+
*/
|
|
3701
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
|
|
3702
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3703
|
+
predicate: (a: OutElem) => Effect.Effect<boolean, E, R>
|
|
3704
|
+
): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
3705
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
|
|
3706
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3707
|
+
predicate: (a: OutElem) => Effect.Effect<boolean, E, R>
|
|
3708
|
+
): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R> =>
|
|
3709
|
+
fromTransform((upstream, scope) =>
|
|
3710
|
+
Effect.map(
|
|
3711
|
+
toTransform(self)(upstream, scope),
|
|
3712
|
+
(pull) =>
|
|
3713
|
+
Effect.flatMap(pull, function loop(elem): Pull.Pull<OutElem, OutErr | E, OutDone, R> {
|
|
3714
|
+
return Effect.flatMap(
|
|
3715
|
+
predicate(elem),
|
|
3716
|
+
(passes) =>
|
|
3717
|
+
passes
|
|
3718
|
+
? Effect.succeed(elem)
|
|
3719
|
+
: Effect.flatMap(pull, loop)
|
|
3720
|
+
)
|
|
3721
|
+
})
|
|
3722
|
+
)
|
|
3723
|
+
))
|
|
3724
|
+
|
|
3725
|
+
/**
|
|
3726
|
+
* @since 4.0.0
|
|
3727
|
+
* @category Filtering
|
|
3728
|
+
*/
|
|
3729
|
+
export const filterMapEffect: {
|
|
3653
3730
|
/**
|
|
3654
3731
|
* @since 4.0.0
|
|
3655
3732
|
* @category Filtering
|
|
@@ -3794,9 +3871,9 @@ export const filterArray: {
|
|
|
3794
3871
|
* @since 4.0.0
|
|
3795
3872
|
* @category Filtering
|
|
3796
3873
|
*/
|
|
3797
|
-
<OutElem
|
|
3874
|
+
<OutElem>(predicate: Predicate.Predicate<Types.NoInfer<OutElem>>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3798
3875
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3799
|
-
) => Channel<Arr.NonEmptyReadonlyArray<
|
|
3876
|
+
) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3800
3877
|
/**
|
|
3801
3878
|
* Filters arrays of elements emitted by a channel, applying the filter
|
|
3802
3879
|
* to each element within the arrays and only emitting non-empty filtered arrays.
|
|
@@ -3871,19 +3948,24 @@ export const filterArray: {
|
|
|
3871
3948
|
* @since 4.0.0
|
|
3872
3949
|
* @category Filtering
|
|
3873
3950
|
*/
|
|
3874
|
-
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3951
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3875
3952
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3876
|
-
|
|
3877
|
-
): Channel<Arr.NonEmptyReadonlyArray<
|
|
3878
|
-
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3953
|
+
predicate: Predicate.Predicate<Types.NoInfer<OutElem>>
|
|
3954
|
+
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3955
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3879
3956
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3880
|
-
|
|
3881
|
-
): Channel<Arr.NonEmptyReadonlyArray<
|
|
3957
|
+
predicate: Predicate.Predicate<Types.NoInfer<OutElem>>
|
|
3958
|
+
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3882
3959
|
transformPull(self, (pull) =>
|
|
3883
3960
|
Effect.succeed(Effect.flatMap(
|
|
3884
3961
|
pull,
|
|
3885
|
-
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<
|
|
3886
|
-
const
|
|
3962
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone> {
|
|
3963
|
+
const passes: Array<OutElem> = []
|
|
3964
|
+
for (let i = 0; i < arr.length; i++) {
|
|
3965
|
+
if (predicate(arr[i] as Types.NoInfer<OutElem>)) {
|
|
3966
|
+
passes.push(arr[i])
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3887
3969
|
return Arr.isReadonlyArrayNonEmpty(passes)
|
|
3888
3970
|
? Effect.succeed(passes)
|
|
3889
3971
|
: Effect.flatMap(pull, loop)
|
|
@@ -3894,23 +3976,57 @@ export const filterArray: {
|
|
|
3894
3976
|
* @since 4.0.0
|
|
3895
3977
|
* @category Filtering
|
|
3896
3978
|
*/
|
|
3897
|
-
export const
|
|
3979
|
+
export const filterMapArray: {
|
|
3898
3980
|
/**
|
|
3899
3981
|
* @since 4.0.0
|
|
3900
3982
|
* @category Filtering
|
|
3901
3983
|
*/
|
|
3902
|
-
<OutElem,
|
|
3903
|
-
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
3904
|
-
): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3984
|
+
<OutElem, B, X>(filter: Filter.Filter<Types.NoInfer<OutElem>, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3905
3985
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3906
|
-
) => Channel<Arr.NonEmptyReadonlyArray<
|
|
3986
|
+
) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3907
3987
|
/**
|
|
3908
3988
|
* @since 4.0.0
|
|
3909
3989
|
* @category Filtering
|
|
3910
3990
|
*/
|
|
3911
|
-
<OutElem,
|
|
3991
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
3992
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3993
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
3994
|
+
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3995
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
3996
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3997
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
3998
|
+
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3999
|
+
transformPull(self, (pull) =>
|
|
4000
|
+
Effect.succeed(Effect.flatMap(
|
|
4001
|
+
pull,
|
|
4002
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone> {
|
|
4003
|
+
const passes: Array<B> = []
|
|
4004
|
+
for (let i = 0; i < arr.length; i++) {
|
|
4005
|
+
const result = filter(arr[i])
|
|
4006
|
+
if (Result.isSuccess(result)) {
|
|
4007
|
+
passes.push(result.success)
|
|
4008
|
+
}
|
|
4009
|
+
}
|
|
4010
|
+
return Arr.isReadonlyArrayNonEmpty(passes)
|
|
4011
|
+
? Effect.succeed(passes)
|
|
4012
|
+
: Effect.flatMap(pull, loop)
|
|
4013
|
+
}
|
|
4014
|
+
))))
|
|
4015
|
+
|
|
4016
|
+
/**
|
|
4017
|
+
* @since 4.0.0
|
|
4018
|
+
* @category Filtering
|
|
4019
|
+
*/
|
|
4020
|
+
export const filterArrayEffect: {
|
|
4021
|
+
/**
|
|
4022
|
+
* @since 4.0.0
|
|
4023
|
+
* @category Filtering
|
|
4024
|
+
*/
|
|
4025
|
+
<OutElem, E, R>(
|
|
4026
|
+
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
4027
|
+
): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3912
4028
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3913
|
-
) => Channel<Arr.NonEmptyReadonlyArray<
|
|
4029
|
+
) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
3914
4030
|
/**
|
|
3915
4031
|
* @since 4.0.0
|
|
3916
4032
|
* @category Filtering
|
|
@@ -3919,6 +4035,32 @@ export const filterArrayEffect: {
|
|
|
3919
4035
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3920
4036
|
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
3921
4037
|
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
4038
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
|
|
4039
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4040
|
+
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
4041
|
+
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R> =>
|
|
4042
|
+
transformPull(self, (pull) => {
|
|
4043
|
+
const f = Effect.flatMap(pull, (arr) => Effect.filter(arr, predicate))
|
|
4044
|
+
return Effect.succeed(Effect.flatMap(
|
|
4045
|
+
f,
|
|
4046
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, R> {
|
|
4047
|
+
return Arr.isReadonlyArrayNonEmpty(arr) ? Effect.succeed(arr) : Effect.flatMap(f, loop)
|
|
4048
|
+
}
|
|
4049
|
+
))
|
|
4050
|
+
}))
|
|
4051
|
+
|
|
4052
|
+
/**
|
|
4053
|
+
* @since 4.0.0
|
|
4054
|
+
* @category Filtering
|
|
4055
|
+
*/
|
|
4056
|
+
export const filterMapArrayEffect: {
|
|
4057
|
+
/**
|
|
4058
|
+
* @since 4.0.0
|
|
4059
|
+
* @category Filtering
|
|
4060
|
+
*/
|
|
4061
|
+
<OutElem, B, X, EX, RX>(filter: Filter.FilterEffect<Types.NoInfer<OutElem>, B, X, EX, RX>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
4062
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
4063
|
+
) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
|
|
3922
4064
|
/**
|
|
3923
4065
|
* @since 4.0.0
|
|
3924
4066
|
* @category Filtering
|
|
@@ -3927,32 +4069,23 @@ export const filterArrayEffect: {
|
|
|
3927
4069
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3928
4070
|
filter: Filter.FilterEffect<OutElem, B, X, EX, RX>
|
|
3929
4071
|
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
|
|
3930
|
-
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
4072
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X, EX, RX>(
|
|
3931
4073
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3932
|
-
filter:
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
})
|
|
3948
|
-
}
|
|
3949
|
-
// FilterEffect: (a) => Effect<pass|fail>
|
|
3950
|
-
return filterEffect(self, (arr) =>
|
|
3951
|
-
Effect.map(
|
|
3952
|
-
Effect.filter(arr, filter as any),
|
|
3953
|
-
(passes) => Arr.isReadonlyArrayNonEmpty(passes) ? Result.succeed(passes) : Result.fail(undefined)
|
|
3954
|
-
))
|
|
3955
|
-
})
|
|
4074
|
+
filter: Filter.FilterEffect<OutElem, B, X, EX, RX>
|
|
4075
|
+
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX> =>
|
|
4076
|
+
transformPull(self, (pull) =>
|
|
4077
|
+
Effect.succeed(Effect.flatMap(
|
|
4078
|
+
pull,
|
|
4079
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, RX> {
|
|
4080
|
+
return Effect.flatMap(
|
|
4081
|
+
Effect.filterMapEffect(arr, filter as any),
|
|
4082
|
+
(passes) =>
|
|
4083
|
+
Arr.isReadonlyArrayNonEmpty(passes)
|
|
4084
|
+
? Effect.succeed(passes as Arr.NonEmptyReadonlyArray<B>)
|
|
4085
|
+
: Effect.flatMap(pull, loop)
|
|
4086
|
+
)
|
|
4087
|
+
}
|
|
4088
|
+
))))
|
|
3956
4089
|
|
|
3957
4090
|
/**
|
|
3958
4091
|
* Statefully maps over a channel with an accumulator, where each element can produce multiple output values.
|
|
@@ -4755,7 +4888,6 @@ export const catchCauseIf: {
|
|
|
4755
4888
|
*/
|
|
4756
4889
|
<
|
|
4757
4890
|
OutErr,
|
|
4758
|
-
Result extends Filter.ResultOrBool<Cause.Cause<any>>,
|
|
4759
4891
|
OutElem1,
|
|
4760
4892
|
OutErr1,
|
|
4761
4893
|
OutDone1,
|
|
@@ -4764,11 +4896,8 @@ export const catchCauseIf: {
|
|
|
4764
4896
|
InDone1,
|
|
4765
4897
|
Env1
|
|
4766
4898
|
>(
|
|
4767
|
-
|
|
4768
|
-
f: (
|
|
4769
|
-
failure: Filter.Pass<Cause.Cause<OutErr>, Result>,
|
|
4770
|
-
cause: Cause.Cause<OutErr>
|
|
4771
|
-
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4899
|
+
predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
|
|
4900
|
+
f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4772
4901
|
): <
|
|
4773
4902
|
OutElem,
|
|
4774
4903
|
OutDone,
|
|
@@ -4778,7 +4907,7 @@ export const catchCauseIf: {
|
|
|
4778
4907
|
Env
|
|
4779
4908
|
>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
|
|
4780
4909
|
OutElem | OutElem1,
|
|
4781
|
-
|
|
4910
|
+
OutErr | OutErr1,
|
|
4782
4911
|
OutDone | OutDone1,
|
|
4783
4912
|
InElem & InElem1,
|
|
4784
4913
|
InErr & InErr1,
|
|
@@ -4800,7 +4929,6 @@ export const catchCauseIf: {
|
|
|
4800
4929
|
InErr,
|
|
4801
4930
|
InDone,
|
|
4802
4931
|
Env,
|
|
4803
|
-
Result extends Filter.ResultOrBool<Cause.Cause<any>>,
|
|
4804
4932
|
OutElem1,
|
|
4805
4933
|
OutErr1,
|
|
4806
4934
|
OutDone1,
|
|
@@ -4810,14 +4938,137 @@ export const catchCauseIf: {
|
|
|
4810
4938
|
Env1
|
|
4811
4939
|
>(
|
|
4812
4940
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4813
|
-
|
|
4941
|
+
predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
|
|
4942
|
+
f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4943
|
+
): Channel<
|
|
4944
|
+
OutElem | OutElem1,
|
|
4945
|
+
OutErr | OutErr1,
|
|
4946
|
+
OutDone | OutDone1,
|
|
4947
|
+
InElem & InElem1,
|
|
4948
|
+
InErr & InErr1,
|
|
4949
|
+
InDone & InDone1,
|
|
4950
|
+
Env | Env1
|
|
4951
|
+
>
|
|
4952
|
+
} = dual(3, <
|
|
4953
|
+
OutElem,
|
|
4954
|
+
OutErr,
|
|
4955
|
+
OutDone,
|
|
4956
|
+
InElem,
|
|
4957
|
+
InErr,
|
|
4958
|
+
InDone,
|
|
4959
|
+
Env,
|
|
4960
|
+
OutElem1,
|
|
4961
|
+
OutErr1,
|
|
4962
|
+
OutDone1,
|
|
4963
|
+
InElem1,
|
|
4964
|
+
InErr1,
|
|
4965
|
+
InDone1,
|
|
4966
|
+
Env1
|
|
4967
|
+
>(
|
|
4968
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4969
|
+
predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
|
|
4970
|
+
f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4971
|
+
): Channel<
|
|
4972
|
+
OutElem | OutElem1,
|
|
4973
|
+
OutErr | OutErr1,
|
|
4974
|
+
OutDone | OutDone1,
|
|
4975
|
+
InElem & InElem1,
|
|
4976
|
+
InErr & InErr1,
|
|
4977
|
+
InDone & InDone1,
|
|
4978
|
+
Env | Env1
|
|
4979
|
+
> =>
|
|
4980
|
+
catchCause(
|
|
4981
|
+
self,
|
|
4982
|
+
(
|
|
4983
|
+
cause
|
|
4984
|
+
): Channel<
|
|
4985
|
+
OutElem1,
|
|
4986
|
+
OutErr | OutErr1,
|
|
4987
|
+
OutDone1,
|
|
4988
|
+
InElem1,
|
|
4989
|
+
InErr1,
|
|
4990
|
+
InDone1,
|
|
4991
|
+
Env1
|
|
4992
|
+
> => {
|
|
4993
|
+
return predicate(cause)
|
|
4994
|
+
? f(cause)
|
|
4995
|
+
: failCause(cause as any)
|
|
4996
|
+
}
|
|
4997
|
+
))
|
|
4998
|
+
|
|
4999
|
+
/**
|
|
5000
|
+
* @since 4.0.0
|
|
5001
|
+
* @category Error handling
|
|
5002
|
+
*/
|
|
5003
|
+
export const catchCauseFilter: {
|
|
5004
|
+
/**
|
|
5005
|
+
* @since 4.0.0
|
|
5006
|
+
* @category Error handling
|
|
5007
|
+
*/
|
|
5008
|
+
<
|
|
5009
|
+
OutErr,
|
|
5010
|
+
EB,
|
|
5011
|
+
X extends Cause.Cause<any>,
|
|
5012
|
+
OutElem1,
|
|
5013
|
+
OutErr1,
|
|
5014
|
+
OutDone1,
|
|
5015
|
+
InElem1,
|
|
5016
|
+
InErr1,
|
|
5017
|
+
InDone1,
|
|
5018
|
+
Env1
|
|
5019
|
+
>(
|
|
5020
|
+
filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
|
|
5021
|
+
f: (
|
|
5022
|
+
failure: EB,
|
|
5023
|
+
cause: Cause.Cause<OutErr>
|
|
5024
|
+
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
5025
|
+
): <
|
|
5026
|
+
OutElem,
|
|
5027
|
+
OutDone,
|
|
5028
|
+
InElem,
|
|
5029
|
+
InErr,
|
|
5030
|
+
InDone,
|
|
5031
|
+
Env
|
|
5032
|
+
>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
|
|
5033
|
+
OutElem | OutElem1,
|
|
5034
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
5035
|
+
OutDone | OutDone1,
|
|
5036
|
+
InElem & InElem1,
|
|
5037
|
+
InErr & InErr1,
|
|
5038
|
+
InDone & InDone1,
|
|
5039
|
+
Env | Env1
|
|
5040
|
+
>
|
|
5041
|
+
/**
|
|
5042
|
+
* @since 4.0.0
|
|
5043
|
+
* @category Error handling
|
|
5044
|
+
*/
|
|
5045
|
+
<
|
|
5046
|
+
OutElem,
|
|
5047
|
+
OutErr,
|
|
5048
|
+
OutDone,
|
|
5049
|
+
InElem,
|
|
5050
|
+
InErr,
|
|
5051
|
+
InDone,
|
|
5052
|
+
Env,
|
|
5053
|
+
EB,
|
|
5054
|
+
X extends Cause.Cause<any>,
|
|
5055
|
+
OutElem1,
|
|
5056
|
+
OutErr1,
|
|
5057
|
+
OutDone1,
|
|
5058
|
+
InElem1,
|
|
5059
|
+
InErr1,
|
|
5060
|
+
InDone1,
|
|
5061
|
+
Env1
|
|
5062
|
+
>(
|
|
5063
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5064
|
+
filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
|
|
4814
5065
|
f: (
|
|
4815
|
-
failure:
|
|
5066
|
+
failure: EB,
|
|
4816
5067
|
cause: Cause.Cause<OutErr>
|
|
4817
5068
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4818
5069
|
): Channel<
|
|
4819
5070
|
OutElem | OutElem1,
|
|
4820
|
-
Cause.Cause.Error<
|
|
5071
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
4821
5072
|
OutDone | OutDone1,
|
|
4822
5073
|
InElem & InElem1,
|
|
4823
5074
|
InErr & InErr1,
|
|
@@ -4832,7 +5083,8 @@ export const catchCauseIf: {
|
|
|
4832
5083
|
InErr,
|
|
4833
5084
|
InDone,
|
|
4834
5085
|
Env,
|
|
4835
|
-
|
|
5086
|
+
EB,
|
|
5087
|
+
X extends Cause.Cause<any>,
|
|
4836
5088
|
OutElem1,
|
|
4837
5089
|
OutErr1,
|
|
4838
5090
|
OutDone1,
|
|
@@ -4842,14 +5094,14 @@ export const catchCauseIf: {
|
|
|
4842
5094
|
Env1
|
|
4843
5095
|
>(
|
|
4844
5096
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4845
|
-
filter: Filter.
|
|
5097
|
+
filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
|
|
4846
5098
|
f: (
|
|
4847
|
-
failure:
|
|
5099
|
+
failure: EB,
|
|
4848
5100
|
cause: Cause.Cause<OutErr>
|
|
4849
5101
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4850
5102
|
): Channel<
|
|
4851
5103
|
OutElem | OutElem1,
|
|
4852
|
-
Cause.Cause.Error<
|
|
5104
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
4853
5105
|
OutDone | OutDone1,
|
|
4854
5106
|
InElem & InElem1,
|
|
4855
5107
|
InErr & InErr1,
|
|
@@ -4862,18 +5114,17 @@ export const catchCauseIf: {
|
|
|
4862
5114
|
cause
|
|
4863
5115
|
): Channel<
|
|
4864
5116
|
OutElem1,
|
|
4865
|
-
Cause.Cause.Error<
|
|
5117
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
4866
5118
|
OutDone1,
|
|
4867
5119
|
InElem1,
|
|
4868
5120
|
InErr1,
|
|
4869
5121
|
InDone1,
|
|
4870
5122
|
Env1
|
|
4871
5123
|
> => {
|
|
4872
|
-
const
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
return failCause(eb.failure)
|
|
5124
|
+
const result = filter(cause)
|
|
5125
|
+
return Result.isFailure(result)
|
|
5126
|
+
? failCause(result.failure)
|
|
5127
|
+
: f(result.success, cause)
|
|
4877
5128
|
}
|
|
4878
5129
|
))
|
|
4879
5130
|
|
|
@@ -4949,7 +5200,7 @@ const catch_: {
|
|
|
4949
5200
|
InErr & InErr1,
|
|
4950
5201
|
InDone & InDone1,
|
|
4951
5202
|
Env | Env1
|
|
4952
|
-
> =>
|
|
5203
|
+
> => catchCauseFilter(self, Cause.findError, (e) => f(e)))
|
|
4953
5204
|
|
|
4954
5205
|
export {
|
|
4955
5206
|
/**
|
|
@@ -5099,7 +5350,6 @@ export const catchIf: {
|
|
|
5099
5350
|
*/
|
|
5100
5351
|
<
|
|
5101
5352
|
OutErr,
|
|
5102
|
-
Result extends Filter.ResultOrBool,
|
|
5103
5353
|
OutElem1,
|
|
5104
5354
|
OutErr1,
|
|
5105
5355
|
OutDone1,
|
|
@@ -5108,18 +5358,18 @@ export const catchIf: {
|
|
|
5108
5358
|
InDone1,
|
|
5109
5359
|
Env1,
|
|
5110
5360
|
OutElem2 = never,
|
|
5111
|
-
OutErr2 =
|
|
5361
|
+
OutErr2 = OutErr,
|
|
5112
5362
|
OutDone2 = never,
|
|
5113
5363
|
InElem2 = unknown,
|
|
5114
5364
|
InErr2 = unknown,
|
|
5115
5365
|
InDone2 = unknown,
|
|
5116
5366
|
Env2 = never
|
|
5117
5367
|
>(
|
|
5118
|
-
|
|
5119
|
-
f: (failure:
|
|
5368
|
+
predicate: Predicate.Predicate<OutErr>,
|
|
5369
|
+
f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5120
5370
|
orElse?:
|
|
5121
5371
|
| ((
|
|
5122
|
-
failure:
|
|
5372
|
+
failure: OutErr
|
|
5123
5373
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5124
5374
|
| undefined
|
|
5125
5375
|
): <
|
|
@@ -5195,7 +5445,6 @@ export const catchIf: {
|
|
|
5195
5445
|
InErr,
|
|
5196
5446
|
InDone,
|
|
5197
5447
|
Env,
|
|
5198
|
-
Result extends Filter.ResultOrBool,
|
|
5199
5448
|
OutElem1,
|
|
5200
5449
|
OutErr1,
|
|
5201
5450
|
OutDone1,
|
|
@@ -5204,7 +5453,7 @@ export const catchIf: {
|
|
|
5204
5453
|
InDone1,
|
|
5205
5454
|
Env1,
|
|
5206
5455
|
OutElem2 = never,
|
|
5207
|
-
OutErr2 =
|
|
5456
|
+
OutErr2 = OutErr,
|
|
5208
5457
|
OutDone2 = never,
|
|
5209
5458
|
InElem2 = unknown,
|
|
5210
5459
|
InErr2 = unknown,
|
|
@@ -5212,11 +5461,11 @@ export const catchIf: {
|
|
|
5212
5461
|
Env2 = never
|
|
5213
5462
|
>(
|
|
5214
5463
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5215
|
-
|
|
5216
|
-
f: (failure:
|
|
5464
|
+
predicate: Predicate.Predicate<OutErr>,
|
|
5465
|
+
f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5217
5466
|
orElse?:
|
|
5218
5467
|
| ((
|
|
5219
|
-
failure:
|
|
5468
|
+
failure: OutErr
|
|
5220
5469
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5221
5470
|
| undefined
|
|
5222
5471
|
): Channel<
|
|
@@ -5236,7 +5485,6 @@ export const catchIf: {
|
|
|
5236
5485
|
InErr,
|
|
5237
5486
|
InDone,
|
|
5238
5487
|
Env,
|
|
5239
|
-
Result extends Filter.ResultOrBool,
|
|
5240
5488
|
OutElem1,
|
|
5241
5489
|
OutErr1,
|
|
5242
5490
|
OutDone1,
|
|
@@ -5245,7 +5493,7 @@ export const catchIf: {
|
|
|
5245
5493
|
InDone1,
|
|
5246
5494
|
Env1,
|
|
5247
5495
|
OutElem2 = never,
|
|
5248
|
-
OutErr2 =
|
|
5496
|
+
OutErr2 = OutErr,
|
|
5249
5497
|
OutDone2 = never,
|
|
5250
5498
|
InElem2 = unknown,
|
|
5251
5499
|
InErr2 = unknown,
|
|
@@ -5253,11 +5501,11 @@ export const catchIf: {
|
|
|
5253
5501
|
Env2 = never
|
|
5254
5502
|
>(
|
|
5255
5503
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5256
|
-
|
|
5257
|
-
f: (failure:
|
|
5504
|
+
predicate: Predicate.Predicate<OutErr>,
|
|
5505
|
+
f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5258
5506
|
orElse?:
|
|
5259
5507
|
| ((
|
|
5260
|
-
failure:
|
|
5508
|
+
failure: OutErr
|
|
5261
5509
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5262
5510
|
| undefined
|
|
5263
5511
|
): Channel<
|
|
@@ -5280,12 +5528,170 @@ export const catchIf: {
|
|
|
5280
5528
|
InDone1 & InDone2,
|
|
5281
5529
|
Env1 | Env2
|
|
5282
5530
|
> => {
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
? f(eb.success as any)
|
|
5531
|
+
return predicate(err)
|
|
5532
|
+
? f(err)
|
|
5286
5533
|
: orElse
|
|
5287
|
-
? orElse(
|
|
5288
|
-
: fail(
|
|
5534
|
+
? orElse(err)
|
|
5535
|
+
: fail(err as any) as any
|
|
5536
|
+
}
|
|
5537
|
+
))
|
|
5538
|
+
|
|
5539
|
+
/**
|
|
5540
|
+
* @since 4.0.0
|
|
5541
|
+
* @category Error handling
|
|
5542
|
+
*/
|
|
5543
|
+
export const catchFilter: {
|
|
5544
|
+
/**
|
|
5545
|
+
* @since 4.0.0
|
|
5546
|
+
* @category Error handling
|
|
5547
|
+
*/
|
|
5548
|
+
<
|
|
5549
|
+
OutErr,
|
|
5550
|
+
EB,
|
|
5551
|
+
X,
|
|
5552
|
+
OutElem1,
|
|
5553
|
+
OutErr1,
|
|
5554
|
+
OutDone1,
|
|
5555
|
+
InElem1,
|
|
5556
|
+
InErr1,
|
|
5557
|
+
InDone1,
|
|
5558
|
+
Env1,
|
|
5559
|
+
OutElem2 = never,
|
|
5560
|
+
OutErr2 = X,
|
|
5561
|
+
OutDone2 = never,
|
|
5562
|
+
InElem2 = unknown,
|
|
5563
|
+
InErr2 = unknown,
|
|
5564
|
+
InDone2 = unknown,
|
|
5565
|
+
Env2 = never
|
|
5566
|
+
>(
|
|
5567
|
+
filter: Filter.Filter<OutErr, EB, X>,
|
|
5568
|
+
f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5569
|
+
orElse?:
|
|
5570
|
+
| ((
|
|
5571
|
+
failure: X
|
|
5572
|
+
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5573
|
+
| undefined
|
|
5574
|
+
): <
|
|
5575
|
+
OutElem,
|
|
5576
|
+
OutDone,
|
|
5577
|
+
InElem,
|
|
5578
|
+
InErr,
|
|
5579
|
+
InDone,
|
|
5580
|
+
Env
|
|
5581
|
+
>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
|
|
5582
|
+
OutElem | OutElem1 | OutElem2,
|
|
5583
|
+
OutErr1 | OutErr2,
|
|
5584
|
+
OutDone | OutDone1 | OutDone2,
|
|
5585
|
+
InElem & InElem1 & InElem2,
|
|
5586
|
+
InErr & InErr1 & InErr2,
|
|
5587
|
+
InDone & InDone1 & InDone2,
|
|
5588
|
+
Env | Env1 | Env2
|
|
5589
|
+
>
|
|
5590
|
+
/**
|
|
5591
|
+
* @since 4.0.0
|
|
5592
|
+
* @category Error handling
|
|
5593
|
+
*/
|
|
5594
|
+
<
|
|
5595
|
+
OutElem,
|
|
5596
|
+
OutErr,
|
|
5597
|
+
OutDone,
|
|
5598
|
+
InElem,
|
|
5599
|
+
InErr,
|
|
5600
|
+
InDone,
|
|
5601
|
+
Env,
|
|
5602
|
+
EB,
|
|
5603
|
+
X,
|
|
5604
|
+
OutElem1,
|
|
5605
|
+
OutErr1,
|
|
5606
|
+
OutDone1,
|
|
5607
|
+
InElem1,
|
|
5608
|
+
InErr1,
|
|
5609
|
+
InDone1,
|
|
5610
|
+
Env1,
|
|
5611
|
+
OutElem2 = never,
|
|
5612
|
+
OutErr2 = X,
|
|
5613
|
+
OutDone2 = never,
|
|
5614
|
+
InElem2 = unknown,
|
|
5615
|
+
InErr2 = unknown,
|
|
5616
|
+
InDone2 = unknown,
|
|
5617
|
+
Env2 = never
|
|
5618
|
+
>(
|
|
5619
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5620
|
+
filter: Filter.Filter<OutErr, EB, X>,
|
|
5621
|
+
f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5622
|
+
orElse?:
|
|
5623
|
+
| ((
|
|
5624
|
+
failure: X
|
|
5625
|
+
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5626
|
+
| undefined
|
|
5627
|
+
): Channel<
|
|
5628
|
+
OutElem | OutElem1 | OutElem2,
|
|
5629
|
+
OutErr1 | OutErr2,
|
|
5630
|
+
OutDone | OutDone1 | OutDone2,
|
|
5631
|
+
InElem & InElem1 & InElem2,
|
|
5632
|
+
InErr & InErr1 & InErr2,
|
|
5633
|
+
InDone & InDone1 & InDone2,
|
|
5634
|
+
Env | Env1 | Env2
|
|
5635
|
+
>
|
|
5636
|
+
} = dual((args) => isChannel(args[0]), <
|
|
5637
|
+
OutElem,
|
|
5638
|
+
OutErr,
|
|
5639
|
+
OutDone,
|
|
5640
|
+
InElem,
|
|
5641
|
+
InErr,
|
|
5642
|
+
InDone,
|
|
5643
|
+
Env,
|
|
5644
|
+
EB,
|
|
5645
|
+
X,
|
|
5646
|
+
OutElem1,
|
|
5647
|
+
OutErr1,
|
|
5648
|
+
OutDone1,
|
|
5649
|
+
InElem1,
|
|
5650
|
+
InErr1,
|
|
5651
|
+
InDone1,
|
|
5652
|
+
Env1,
|
|
5653
|
+
OutElem2 = never,
|
|
5654
|
+
OutErr2 = X,
|
|
5655
|
+
OutDone2 = never,
|
|
5656
|
+
InElem2 = unknown,
|
|
5657
|
+
InErr2 = unknown,
|
|
5658
|
+
InDone2 = unknown,
|
|
5659
|
+
Env2 = never
|
|
5660
|
+
>(
|
|
5661
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5662
|
+
filter: Filter.Filter<OutErr, EB, X>,
|
|
5663
|
+
f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5664
|
+
orElse?:
|
|
5665
|
+
| ((
|
|
5666
|
+
failure: X
|
|
5667
|
+
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5668
|
+
| undefined
|
|
5669
|
+
): Channel<
|
|
5670
|
+
OutElem | OutElem1 | OutElem2,
|
|
5671
|
+
OutErr1 | OutErr2,
|
|
5672
|
+
OutDone | OutDone1 | OutDone2,
|
|
5673
|
+
InElem & InElem1 & InElem2,
|
|
5674
|
+
InErr & InErr1 & InErr2,
|
|
5675
|
+
InDone & InDone1 & InDone2,
|
|
5676
|
+
Env | Env1 | Env2
|
|
5677
|
+
> =>
|
|
5678
|
+
catch_(
|
|
5679
|
+
self,
|
|
5680
|
+
(err): Channel<
|
|
5681
|
+
OutElem1 | OutElem2,
|
|
5682
|
+
OutErr1 | OutErr2,
|
|
5683
|
+
OutDone1 | OutDone2,
|
|
5684
|
+
InElem1 & InElem2,
|
|
5685
|
+
InErr1 & InErr2,
|
|
5686
|
+
InDone1 & InDone2,
|
|
5687
|
+
Env1 | Env2
|
|
5688
|
+
> => {
|
|
5689
|
+
const result = filter(err)
|
|
5690
|
+
return Result.isFailure(result)
|
|
5691
|
+
? orElse
|
|
5692
|
+
? orElse(result.failure)
|
|
5693
|
+
: fail(result.failure as any) as any
|
|
5694
|
+
: f(result.success)
|
|
5289
5695
|
}
|
|
5290
5696
|
))
|
|
5291
5697
|
|
|
@@ -5526,11 +5932,13 @@ export const catchReason: {
|
|
|
5526
5932
|
errorTag: K,
|
|
5527
5933
|
reasonTag: RK,
|
|
5528
5934
|
f: (
|
|
5529
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
5935
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
5936
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5530
5937
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5531
5938
|
orElse?:
|
|
5532
5939
|
| ((
|
|
5533
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
5940
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
5941
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5534
5942
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5535
5943
|
| undefined
|
|
5536
5944
|
): <
|
|
@@ -5613,11 +6021,13 @@ export const catchReason: {
|
|
|
5613
6021
|
errorTag: K,
|
|
5614
6022
|
reasonTag: RK,
|
|
5615
6023
|
f: (
|
|
5616
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6024
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6025
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5617
6026
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5618
6027
|
orElse?:
|
|
5619
6028
|
| ((
|
|
5620
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6029
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6030
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5621
6031
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5622
6032
|
| undefined
|
|
5623
6033
|
): Channel<
|
|
@@ -5658,11 +6068,13 @@ export const catchReason: {
|
|
|
5658
6068
|
errorTag: K,
|
|
5659
6069
|
reasonTag: RK,
|
|
5660
6070
|
f: (
|
|
5661
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6071
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6072
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5662
6073
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5663
6074
|
orElse?:
|
|
5664
6075
|
| ((
|
|
5665
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6076
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6077
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5666
6078
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5667
6079
|
| undefined
|
|
5668
6080
|
): Channel<
|
|
@@ -5688,9 +6100,9 @@ export const catchReason: {
|
|
|
5688
6100
|
if (isTagged(error, errorTag) && hasProperty(error, "reason")) {
|
|
5689
6101
|
const reason = error.reason as Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5690
6102
|
if (isTagged(reason, reasonTag)) {
|
|
5691
|
-
return f(reason as any)
|
|
6103
|
+
return f(reason as any, error as any)
|
|
5692
6104
|
}
|
|
5693
|
-
return orElse ? orElse(reason) as any : fail(error) as any
|
|
6105
|
+
return orElse ? orElse(reason, error as any) as any : fail(error) as any
|
|
5694
6106
|
}
|
|
5695
6107
|
return fail(error) as any
|
|
5696
6108
|
}
|
|
@@ -5714,7 +6126,8 @@ export const catchReasons: {
|
|
|
5714
6126
|
OutErr,
|
|
5715
6127
|
Cases extends {
|
|
5716
6128
|
[RK in Types.ReasonTags<Types.ExtractTag<Types.NoInfer<OutErr>, K>>]+?: (
|
|
5717
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6129
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6130
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5718
6131
|
) => Channel<any, any, any, any, any, any, any>
|
|
5719
6132
|
},
|
|
5720
6133
|
OutElem2 = Types.unassigned,
|
|
@@ -5729,7 +6142,8 @@ export const catchReasons: {
|
|
|
5729
6142
|
cases: Cases,
|
|
5730
6143
|
orElse?:
|
|
5731
6144
|
| ((
|
|
5732
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string
|
|
6145
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>,
|
|
6146
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
|
|
5733
6147
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5734
6148
|
| undefined
|
|
5735
6149
|
): <OutElem, OutDone, InElem, InErr, InDone, Env>(
|
|
@@ -5795,7 +6209,8 @@ export const catchReasons: {
|
|
|
5795
6209
|
K extends Types.Tags<OutErr>,
|
|
5796
6210
|
Cases extends {
|
|
5797
6211
|
[RK in Types.ReasonTags<Types.ExtractTag<OutErr, K>>]+?: (
|
|
5798
|
-
reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK
|
|
6212
|
+
reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK>,
|
|
6213
|
+
error: Types.NarrowReason<Types.ExtractTag<OutErr, K>, RK>
|
|
5799
6214
|
) => Channel<any, any, any, any, any, any, any>
|
|
5800
6215
|
},
|
|
5801
6216
|
OutElem2 = Types.unassigned,
|
|
@@ -5811,7 +6226,8 @@ export const catchReasons: {
|
|
|
5811
6226
|
cases: Cases,
|
|
5812
6227
|
orElse?:
|
|
5813
6228
|
| ((
|
|
5814
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string
|
|
6229
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>,
|
|
6230
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
|
|
5815
6231
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5816
6232
|
| undefined
|
|
5817
6233
|
): Channel<
|
|
@@ -5860,7 +6276,7 @@ export const catchReasons: {
|
|
|
5860
6276
|
>
|
|
5861
6277
|
} = dual((args) => isChannel(args[0]), (self, errorTag, cases, orElse) => {
|
|
5862
6278
|
let keys: Set<string>
|
|
5863
|
-
return catch_(self, (error
|
|
6279
|
+
return catch_(self, (error) => {
|
|
5864
6280
|
if (
|
|
5865
6281
|
isTagged(error, errorTag) &&
|
|
5866
6282
|
hasProperty(error, "reason") &&
|
|
@@ -5870,9 +6286,9 @@ export const catchReasons: {
|
|
|
5870
6286
|
const reason = error.reason as { readonly _tag: string }
|
|
5871
6287
|
keys ??= new Set(Object.keys(cases))
|
|
5872
6288
|
if (keys.has(reason._tag)) {
|
|
5873
|
-
return (cases as any)[reason._tag](reason as any)
|
|
6289
|
+
return (cases as any)[reason._tag](reason as any, error)
|
|
5874
6290
|
}
|
|
5875
|
-
return orElse ? orElse(reason) as any : fail(error) as any
|
|
6291
|
+
return orElse ? orElse(reason, error) as any : fail(error) as any
|
|
5876
6292
|
}
|
|
5877
6293
|
return fail(error) as any
|
|
5878
6294
|
})
|
|
@@ -6022,11 +6438,11 @@ export const unwrapReason: {
|
|
|
6022
6438
|
InDone,
|
|
6023
6439
|
Env
|
|
6024
6440
|
> =>
|
|
6025
|
-
|
|
6441
|
+
catchFilter(
|
|
6026
6442
|
self,
|
|
6027
|
-
(error
|
|
6443
|
+
(error) =>
|
|
6028
6444
|
isTagged(error, errorTag) && hasProperty(error, "reason") ? Result.succeed(error.reason) : Result.fail(error),
|
|
6029
|
-
fail
|
|
6445
|
+
fail
|
|
6030
6446
|
) as any)
|
|
6031
6447
|
|
|
6032
6448
|
/**
|
|
@@ -6112,14 +6528,14 @@ export const orDie = <
|
|
|
6112
6528
|
*/
|
|
6113
6529
|
export const ignore: <
|
|
6114
6530
|
Arg extends Channel<any, any, any, any, any, any, any> | {
|
|
6115
|
-
readonly log?: boolean |
|
|
6531
|
+
readonly log?: boolean | Severity | undefined
|
|
6116
6532
|
} | undefined = {
|
|
6117
|
-
readonly log?: boolean |
|
|
6533
|
+
readonly log?: boolean | Severity | undefined
|
|
6118
6534
|
}
|
|
6119
6535
|
>(
|
|
6120
6536
|
selfOrOptions: Arg,
|
|
6121
6537
|
options?: {
|
|
6122
|
-
readonly log?: boolean |
|
|
6538
|
+
readonly log?: boolean | Severity | undefined
|
|
6123
6539
|
} | undefined
|
|
6124
6540
|
) => [Arg] extends
|
|
6125
6541
|
[Channel<infer OutElem, infer _OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env>]
|
|
@@ -6131,7 +6547,7 @@ export const ignore: <
|
|
|
6131
6547
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
6132
6548
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
6133
6549
|
options?: {
|
|
6134
|
-
readonly log?: boolean |
|
|
6550
|
+
readonly log?: boolean | Severity | undefined
|
|
6135
6551
|
} | undefined
|
|
6136
6552
|
): Channel<OutElem, never, OutDone | void, InElem, InErr, InDone, Env> => {
|
|
6137
6553
|
if (!options?.log) {
|
|
@@ -6167,14 +6583,14 @@ const ignoreCause_ = <
|
|
|
6167
6583
|
*/
|
|
6168
6584
|
export const ignoreCause: <
|
|
6169
6585
|
Arg extends Channel<any, any, any, any, any, any, any> | {
|
|
6170
|
-
readonly log?: boolean |
|
|
6586
|
+
readonly log?: boolean | Severity | undefined
|
|
6171
6587
|
} | undefined = {
|
|
6172
|
-
readonly log?: boolean |
|
|
6588
|
+
readonly log?: boolean | Severity | undefined
|
|
6173
6589
|
}
|
|
6174
6590
|
>(
|
|
6175
6591
|
selfOrOptions: Arg,
|
|
6176
6592
|
options?: {
|
|
6177
|
-
readonly log?: boolean |
|
|
6593
|
+
readonly log?: boolean | Severity | undefined
|
|
6178
6594
|
} | undefined
|
|
6179
6595
|
) => [Arg] extends
|
|
6180
6596
|
[Channel<infer OutElem, infer _OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env>]
|
|
@@ -6185,7 +6601,7 @@ export const ignoreCause: <
|
|
|
6185
6601
|
(args) => isChannel(args[0]),
|
|
6186
6602
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
6187
6603
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
6188
|
-
options?: { readonly log?: boolean |
|
|
6604
|
+
options?: { readonly log?: boolean | Severity | undefined } | undefined
|
|
6189
6605
|
): Channel<OutElem, never, OutDone | void, InElem, InErr, InDone, Env> => {
|
|
6190
6606
|
if (!options?.log) return ignoreCause_(self)
|
|
6191
6607
|
const logEffect = Effect.logWithLevel(options.log === true ? undefined : options.log)
|
|
@@ -6631,8 +7047,8 @@ export const mergeAll: {
|
|
|
6631
7047
|
const concurrencyN = concurrency === "unbounded"
|
|
6632
7048
|
? Number.MAX_SAFE_INTEGER
|
|
6633
7049
|
: Math.max(1, concurrency)
|
|
6634
|
-
const semaphore = switch_ ? undefined :
|
|
6635
|
-
const doneLatch = yield*
|
|
7050
|
+
const semaphore = switch_ ? undefined : Semaphore.makeUnsafe(concurrencyN)
|
|
7051
|
+
const doneLatch = yield* Latch.make(true)
|
|
6636
7052
|
const fibers = new Set<Fiber.Fiber<any, any>>()
|
|
6637
7053
|
|
|
6638
7054
|
const queue = yield* Queue.bounded</**
|
|
@@ -8208,7 +8624,7 @@ export const provideService: {
|
|
|
8208
8624
|
* @since 4.0.0
|
|
8209
8625
|
* @category Services
|
|
8210
8626
|
*/
|
|
8211
|
-
<I, S>(key: ServiceMap.
|
|
8627
|
+
<I, S>(key: ServiceMap.Key<I, S>, service: NoInfer<S>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8212
8628
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
8213
8629
|
) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>
|
|
8214
8630
|
/**
|
|
@@ -8217,12 +8633,12 @@ export const provideService: {
|
|
|
8217
8633
|
*/
|
|
8218
8634
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8219
8635
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8220
|
-
key: ServiceMap.
|
|
8636
|
+
key: ServiceMap.Key<I, S>,
|
|
8221
8637
|
service: NoInfer<S>
|
|
8222
8638
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>
|
|
8223
8639
|
} = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8224
8640
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8225
|
-
key: ServiceMap.
|
|
8641
|
+
key: ServiceMap.Key<I, S>,
|
|
8226
8642
|
service: NoInfer<S>
|
|
8227
8643
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>> =>
|
|
8228
8644
|
fromTransform((upstream, scope) =>
|
|
@@ -8241,7 +8657,7 @@ export const provideServiceEffect: {
|
|
|
8241
8657
|
* @since 4.0.0
|
|
8242
8658
|
* @category Services
|
|
8243
8659
|
*/
|
|
8244
|
-
<I, S, ES, RS>(key: ServiceMap.
|
|
8660
|
+
<I, S, ES, RS>(key: ServiceMap.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8245
8661
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
8246
8662
|
) => Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>
|
|
8247
8663
|
/**
|
|
@@ -8250,12 +8666,12 @@ export const provideServiceEffect: {
|
|
|
8250
8666
|
*/
|
|
8251
8667
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(
|
|
8252
8668
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8253
|
-
key: ServiceMap.
|
|
8669
|
+
key: ServiceMap.Key<I, S>,
|
|
8254
8670
|
service: Effect.Effect<NoInfer<S>, ES, RS>
|
|
8255
8671
|
): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>
|
|
8256
8672
|
} = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(
|
|
8257
8673
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8258
|
-
key: ServiceMap.
|
|
8674
|
+
key: ServiceMap.Key<I, S>,
|
|
8259
8675
|
service: Effect.Effect<NoInfer<S>, ES, RS>
|
|
8260
8676
|
): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS> =>
|
|
8261
8677
|
fromTransform((upstream, scope) =>
|
|
@@ -8353,7 +8769,7 @@ export const updateService: {
|
|
|
8353
8769
|
* @since 2.0.0
|
|
8354
8770
|
* @category Services
|
|
8355
8771
|
*/
|
|
8356
|
-
<I, S>(key: ServiceMap.
|
|
8772
|
+
<I, S>(key: ServiceMap.Key<I, S>, f: (service: NoInfer<S>) => S): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8357
8773
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
8358
8774
|
) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>
|
|
8359
8775
|
/**
|
|
@@ -8362,12 +8778,12 @@ export const updateService: {
|
|
|
8362
8778
|
*/
|
|
8363
8779
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8364
8780
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
8365
|
-
service: ServiceMap.
|
|
8781
|
+
service: ServiceMap.Key<I, S>,
|
|
8366
8782
|
f: (service: NoInfer<S>) => S
|
|
8367
8783
|
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>
|
|
8368
8784
|
} = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8369
8785
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
8370
|
-
service: ServiceMap.
|
|
8786
|
+
service: ServiceMap.Key<I, S>,
|
|
8371
8787
|
f: (service: NoInfer<S>) => S
|
|
8372
8788
|
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I> =>
|
|
8373
8789
|
updateServices(self, (services) =>
|
|
@@ -9085,7 +9501,7 @@ export const toPull: <OutElem, OutErr, OutDone, Env>(
|
|
|
9085
9501
|
function*<OutElem, OutErr, OutDone, Env>(
|
|
9086
9502
|
self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>
|
|
9087
9503
|
) {
|
|
9088
|
-
const semaphore =
|
|
9504
|
+
const semaphore = Semaphore.makeUnsafe(1)
|
|
9089
9505
|
const context = yield* Effect.services<Env | Scope.Scope>()
|
|
9090
9506
|
const scope = ServiceMap.get(context, Scope.Scope)
|
|
9091
9507
|
const pull = yield* toTransform(self)(Cause.done(), scope)
|