effect 4.0.0 → 4.0.2
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/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/Array.d.ts +339 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +143 -3
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +88 -0
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +44 -0
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +68 -0
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +36 -0
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +34 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +18 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +9 -0
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +6 -0
- package/dist/Brand.js.map +1 -1
- package/dist/ByteSize.d.ts +86 -0
- package/dist/ByteSize.d.ts.map +1 -1
- package/dist/ByteSize.js +51 -0
- package/dist/ByteSize.js.map +1 -1
- package/dist/Cache.d.ts +38 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +47 -23
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +82 -0
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +61 -1
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +327 -4
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +168 -8
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +6 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +192 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +78 -0
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +7 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +5 -0
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +10 -0
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -0
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +52 -12
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +55 -5
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +28 -0
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -0
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +22 -0
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -0
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +50 -0
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +21 -0
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +16 -0
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +26 -1
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +5 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +3 -0
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +13 -0
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +5 -0
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +171 -0
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +89 -0
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +51 -0
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +22 -0
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +1 -0
- package/dist/Duration.d.ts +90 -0
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +53 -0
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +677 -22
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +251 -10
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +4 -0
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -0
- package/dist/Effectable.js.map +1 -1
- package/dist/Equal.d.ts +8 -0
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +9 -1
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +21 -0
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +16 -0
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +36 -0
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +11 -0
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +49 -8
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +40 -0
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +27 -0
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +20 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +11 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +21 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +21 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +35 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +19 -0
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +20 -0
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +14 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +15 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +8 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +55 -0
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +28 -0
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +3 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +39 -1
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +30 -0
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +20 -0
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +247 -12
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +149 -28
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +5 -0
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +14 -0
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +12 -0
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +91 -0
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +39 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +17 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +22 -5
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +49 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -0
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +7 -0
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -0
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +127 -0
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +51 -0
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -0
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +3 -0
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -0
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +5 -0
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +11 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +14 -0
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +10 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +100 -0
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +45 -1
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +7 -0
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -0
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +5 -0
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +3 -0
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +20 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +9 -0
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +25 -0
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +30 -4
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +9 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +51 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +39 -0
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +59 -0
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +31 -0
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +32 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +16 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +16 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +10 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +20 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +18 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +31 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +17 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +9 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -0
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +4 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +61 -0
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +31 -0
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +41 -0
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +20 -0
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +134 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +61 -0
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +29 -0
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +24 -0
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +7 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +3 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +24 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +47 -21
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +6 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +7 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +5 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +8 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +7 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +28 -5
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +42 -42
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +84 -0
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +48 -0
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +5 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +4 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +67 -5
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +60 -8
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +20 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +60 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +58 -8
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +13 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +9 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +23 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +24 -1
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +6 -0
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +3 -0
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +100 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +43 -0
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -0
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +4 -0
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +8 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +4 -0
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +3 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +20 -0
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +16 -0
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +21 -0
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +19 -0
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +3 -0
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +4 -0
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +32 -0
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +12 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +42 -0
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +27 -6
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +6 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +6 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +91 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +41 -0
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +9 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +7 -0
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +57 -0
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +32 -0
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +7 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +5 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +496 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +280 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +107 -0
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +81 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +69 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +63 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +33 -0
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +18 -0
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +25 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +26 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +147 -0
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +99 -0
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +53 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +46 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +19 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +34 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +50 -19
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -0
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -0
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +26 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +10 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +125 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +75 -1
- package/dist/Sink.js.map +1 -1
- package/dist/StandardSchema.d.ts +1 -0
- package/dist/StandardSchema.d.ts.map +1 -1
- package/dist/StandardSchema.js +1 -0
- package/dist/Stdio.d.ts +7 -0
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +5 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +603 -6
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +316 -57
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +87 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +61 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +46 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +19 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +65 -0
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +25 -0
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +2 -0
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +2 -0
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +63 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +24 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +3 -0
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +1 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +8 -0
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +4 -0
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +23 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +12 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +68 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +28 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +38 -0
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +18 -0
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +52 -0
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +23 -0
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +15 -0
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +8 -0
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +83 -0
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +52 -7
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +51 -0
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +29 -4
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +22 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +25 -0
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +19 -0
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +51 -0
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +30 -0
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +24 -0
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +32 -18
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +14 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +7 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +25 -0
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +29 -13
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +25 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +12 -0
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +36 -0
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +1 -0
- package/dist/UndefinedOr.d.ts +15 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +9 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +15 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +1 -0
- package/dist/Utils.js.map +1 -1
- package/dist/Version.d.ts +26 -0
- package/dist/Version.d.ts.map +1 -0
- package/dist/Version.js +36 -0
- package/dist/Version.js.map +1 -0
- package/dist/ai/Chat.js +1 -1
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/DecisionModel.d.ts +22 -0
- package/dist/ai/DecisionModel.d.ts.map +1 -1
- package/dist/ai/DecisionModel.js +22 -4
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts +8 -0
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +27 -15
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +508 -508
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpSchema.js +1 -1
- package/dist/ai/McpSchema.js.map +1 -1
- package/dist/ai/McpServer.d.ts +32 -11
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +224 -172
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js +22 -12
- package/dist/ai/Response.js.map +1 -1
- package/dist/ai/Telemetry.d.ts +49 -41
- package/dist/ai/Telemetry.d.ts.map +1 -1
- package/dist/ai/Telemetry.js +6 -8
- package/dist/ai/Telemetry.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js +1 -0
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js +1 -0
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js +1 -0
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js +1 -0
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +79 -46
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2024_11_05.js +3 -1
- package/dist/ai/internal/mcpSchema/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpStatefulRuntime.js +1 -0
- package/dist/ai/internal/mcpStatefulRuntime.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +11 -2
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/cluster/K8sHttpClient.js +5 -2
- package/dist/cluster/K8sHttpClient.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +14 -7
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +21 -12
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +30 -44
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +63 -62
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/cluster/internal/interruptors.js +8 -0
- package/dist/cluster/internal/interruptors.js.map +1 -1
- package/dist/cluster/internal/resourceMap.js +39 -14
- package/dist/cluster/internal/resourceMap.js.map +1 -1
- package/dist/cluster/internal/resourceRef.js +168 -87
- package/dist/cluster/internal/resourceRef.js.map +1 -1
- package/dist/encoding/Base64.d.ts +4 -0
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +4 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +4 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +4 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/EncodingError.d.ts +4 -0
- package/dist/encoding/EncodingError.d.ts.map +1 -1
- package/dist/encoding/EncodingError.js +4 -0
- package/dist/encoding/EncodingError.js.map +1 -1
- package/dist/encoding/Hex.d.ts +5 -0
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +5 -0
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/Toml.js +2 -2
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/encoding/Yaml.d.ts.map +1 -1
- package/dist/encoding/Yaml.js +6 -4
- package/dist/encoding/Yaml.js.map +1 -1
- package/dist/encoding/index.d.ts +4 -0
- package/dist/encoding/index.d.ts.map +1 -1
- package/dist/encoding/index.js +4 -0
- package/dist/encoding/index.js.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +8 -4
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts +27 -10
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.js +49 -7
- package/dist/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/http/Headers.d.ts +3 -1
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +4 -2
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +9 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +40 -21
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientResponse.js +3 -1
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpEffect.d.ts +3 -0
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +5 -2
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +17 -0
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +58 -40
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpServer.d.ts +1 -1
- package/dist/http/HttpServer.d.ts.map +1 -1
- package/dist/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/http/HttpStaticServer.js +14 -0
- package/dist/http/HttpStaticServer.js.map +1 -1
- package/dist/http/HttpTraceContext.d.ts +1 -1
- package/dist/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/http/HttpTraceContext.js +4 -4
- package/dist/http/HttpTraceContext.js.map +1 -1
- package/dist/http/internal/tracing.d.ts +2 -0
- package/dist/http/internal/tracing.d.ts.map +1 -0
- package/dist/http/internal/tracing.js +37 -0
- package/dist/http/internal/tracing.js.map +1 -0
- package/dist/http-api/HttpApiBuilder.js +2 -1
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +12 -3
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiError.d.ts +4 -2
- package/dist/http-api/HttpApiError.d.ts.map +1 -1
- package/dist/http-api/HttpApiError.js +7 -3
- package/dist/http-api/HttpApiError.js.map +1 -1
- package/dist/http-api/HttpApiSecurity.d.ts +8 -8
- package/dist/http-api/HttpApiSecurity.js +8 -8
- package/dist/index.d.ts +155 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/array.js +3 -3
- package/dist/internal/arbitrary/array.js.map +1 -1
- package/dist/internal/arbitrary/model.js +26 -11
- package/dist/internal/arbitrary/model.js.map +1 -1
- package/dist/internal/arbitrary/runner.js +8 -8
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/arbitrary/schema.js +4 -5
- package/dist/internal/arbitrary/schema.js.map +1 -1
- package/dist/internal/core.js +43 -2
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +1 -1
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +104 -120
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/rcRef.js +59 -23
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/schedule.js +7 -5
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +11 -8
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/standardSchema.js +2 -2
- package/dist/internal/schema/standardSchema.js.map +1 -1
- package/dist/internal/version.d.ts +2 -0
- package/dist/internal/version.d.ts.map +1 -0
- package/dist/internal/version.js +3 -0
- package/dist/internal/version.js.map +1 -0
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +5 -6
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +23 -27
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts +5 -3
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +21 -94
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpResource.d.ts +4 -3
- package/dist/observability/OtlpResource.d.ts.map +1 -1
- package/dist/observability/OtlpResource.js +20 -23
- package/dist/observability/OtlpResource.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +1 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +32 -36
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +32 -1
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +1 -1
- package/dist/reactivity/Atom.d.ts +5 -5
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +9 -5
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.d.ts +8 -0
- package/dist/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +21 -3
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +58 -34
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +20 -23
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/rpc/Utils.d.ts +2 -3
- package/dist/rpc/Utils.d.ts.map +1 -1
- package/dist/rpc/Utils.js +3 -4
- package/dist/rpc/Utils.js.map +1 -1
- package/dist/rpc/internal/tracing.d.ts +2 -0
- package/dist/rpc/internal/tracing.d.ts.map +1 -0
- package/dist/rpc/internal/tracing.js +18 -0
- package/dist/rpc/internal/tracing.js.map +1 -0
- package/dist/schema/SchemaCompiler/runtime.js +9 -1
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/sql/SqlClient.js +4 -4
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +21 -1
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +55 -7
- package/dist/sql/Statement.js.map +1 -1
- package/dist/testing/TestClock.d.ts +8 -0
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +7 -0
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +7 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +6 -0
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts +2 -0
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +1 -0
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +3 -3
- package/src/Array.ts +351 -3
- package/src/BigDecimal.ts +88 -0
- package/src/BigInt.ts +68 -0
- package/src/Boolean.ts +34 -0
- package/src/Brand.ts +10 -0
- package/src/ByteSize.ts +87 -0
- package/src/Cache.ts +72 -24
- package/src/Cause.ts +83 -1
- package/src/Channel.ts +368 -18
- package/src/ChannelSchema.ts +13 -0
- package/src/Chunk.ts +193 -0
- package/src/Clock.ts +7 -0
- package/src/Combiner.ts +10 -0
- package/src/Config.ts +82 -8
- package/src/ConfigProvider.ts +28 -0
- package/src/Console.ts +26 -0
- package/src/Context.ts +50 -0
- package/src/Cron.ts +32 -1
- package/src/Crypto.ts +5 -0
- package/src/Data.ts +13 -0
- package/src/DateTime.ts +171 -0
- package/src/Deferred.ts +51 -0
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +90 -0
- package/src/Effect.ts +692 -27
- package/src/Effectable.ts +4 -0
- package/src/Equal.ts +12 -1
- package/src/Equivalence.ts +22 -0
- package/src/ErrorReporter.ts +36 -0
- package/src/ExecutionPlan.ts +58 -14
- package/src/Exit.ts +40 -0
- package/src/Fiber.ts +20 -0
- package/src/FiberHandle.ts +29 -4
- package/src/FiberMap.ts +38 -0
- package/src/FiberSet.ts +21 -0
- package/src/FileSystem.ts +16 -0
- package/src/Filter.ts +55 -0
- package/src/Formatter.ts +42 -1
- package/src/Function.ts +30 -0
- package/src/Graph.ts +317 -36
- package/src/HKT.ts +5 -0
- package/src/Hash.ts +15 -0
- package/src/HashMap.ts +91 -0
- package/src/HashRing.ts +32 -5
- package/src/HashSet.ts +53 -0
- package/src/Inspectable.ts +8 -0
- package/src/Iterable.ts +127 -0
- package/src/JsonPatch.ts +5 -0
- package/src/JsonPointer.ts +5 -0
- package/src/JsonSchema.ts +17 -0
- package/src/Latch.ts +14 -0
- package/src/Layer.ts +101 -1
- package/src/LayerMap.ts +7 -0
- package/src/LayerRef.ts +5 -0
- package/src/LogLevel.ts +20 -0
- package/src/Logger.ts +41 -5
- package/src/ManagedRuntime.ts +12 -1
- package/src/Match.ts +52 -0
- package/src/Metric.ts +69 -0
- package/src/MutableHashMap.ts +44 -0
- package/src/MutableHashSet.ts +17 -0
- package/src/MutableList.ts +21 -0
- package/src/MutableRef.ts +32 -0
- package/src/Newtype.ts +9 -0
- package/src/NonEmptyIterable.ts +4 -0
- package/src/Number.ts +61 -0
- package/src/Optic.ts +57 -0
- package/src/Option.ts +134 -0
- package/src/Order.ts +30 -0
- package/src/Ordering.ts +7 -0
- package/src/PartitionedSemaphore.ts +61 -22
- package/src/Path.ts +6 -0
- package/src/Pipeable.ts +7 -0
- package/src/PlatformError.ts +8 -0
- package/src/Pool.ts +48 -37
- package/src/Predicate.ts +85 -0
- package/src/PrimaryKey.ts +5 -0
- package/src/PubSub.ts +90 -9
- package/src/Pull.ts +20 -0
- package/src/Queue.ts +80 -10
- package/src/Random.ts +13 -0
- package/src/RcMap.ts +49 -2
- package/src/RcRef.ts +6 -0
- package/src/Record.ts +100 -0
- package/src/Redactable.ts +6 -0
- package/src/Redacted.ts +8 -0
- package/src/Reducer.ts +4 -0
- package/src/Ref.ts +42 -0
- package/src/References.ts +21 -0
- package/src/RegExp.ts +4 -0
- package/src/Request.ts +32 -0
- package/src/RequestResolver.ts +59 -10
- package/src/Resource.ts +7 -0
- package/src/Result.ts +93 -0
- package/src/Runtime.ts +10 -0
- package/src/Schedule.ts +61 -0
- package/src/Scheduler.ts +7 -0
- package/src/Schema.ts +499 -4
- package/src/SchemaAST.ts +115 -1
- package/src/SchemaGetter.ts +80 -4
- package/src/SchemaIssue.ts +34 -0
- package/src/SchemaParser.ts +26 -0
- package/src/SchemaRepresentation.ts +148 -0
- package/src/SchemaTransformation.ts +53 -0
- package/src/Scope.ts +19 -0
- package/src/ScopedCache.ts +82 -19
- package/src/ScopedRef.ts +9 -0
- package/src/Semaphore.ts +26 -0
- package/src/Sink.ts +126 -2
- package/src/StandardSchema.ts +1 -0
- package/src/Stdio.ts +7 -0
- package/src/Stream.ts +780 -103
- package/src/String.ts +87 -0
- package/src/Struct.ts +46 -0
- package/src/SubscriptionRef.ts +65 -0
- package/src/Symbol.ts +2 -0
- package/src/SynchronizedRef.ts +63 -0
- package/src/Take.ts +3 -0
- package/src/Terminal.ts +8 -0
- package/src/Tracer.ts +23 -0
- package/src/Trie.ts +68 -0
- package/src/Tuple.ts +38 -0
- package/src/TxChunk.ts +52 -0
- package/src/TxDeferred.ts +15 -0
- package/src/TxHashMap.ts +97 -6
- package/src/TxHashSet.ts +83 -3
- package/src/TxPriorityQueue.ts +34 -2
- package/src/TxPubSub.ts +26 -0
- package/src/TxQueue.ts +51 -0
- package/src/TxReentrantLock.ts +53 -36
- package/src/TxRef.ts +14 -0
- package/src/TxSemaphore.ts +47 -31
- package/src/TxSubscriptionRef.ts +25 -0
- package/src/Types.ts +36 -0
- package/src/UndefinedOr.ts +15 -0
- package/src/Unify.ts +15 -0
- package/src/Utils.ts +4 -0
- package/src/Version.ts +38 -0
- package/src/ai/Chat.ts +1 -1
- package/src/ai/DecisionModel.ts +42 -1
- package/src/ai/LanguageModel.ts +43 -21
- package/src/ai/McpSchema.ts +3 -3
- package/src/ai/McpServer.ts +119 -39
- package/src/ai/Response.ts +27 -12
- package/src/ai/Telemetry.ts +62 -58
- package/src/ai/internal/mcpProtocol/v2024_11_05.ts +1 -0
- package/src/ai/internal/mcpProtocol/v2025_03_26.ts +1 -0
- package/src/ai/internal/mcpProtocol/v2025_06_18.ts +1 -0
- package/src/ai/internal/mcpProtocol/v2025_11_25.ts +1 -0
- package/src/ai/internal/mcpRuntime.ts +84 -43
- package/src/ai/internal/mcpSchema/v2024_11_05.ts +4 -2
- package/src/ai/internal/mcpStatefulRuntime.ts +2 -0
- package/src/cluster/ClusterWorkflowEngine.ts +18 -4
- package/src/cluster/K8sHttpClient.ts +12 -2
- package/src/cluster/Sharding.ts +24 -24
- package/src/cluster/SqlMessageStorage.ts +26 -13
- package/src/cluster/SqlRunnerStorage.ts +85 -113
- package/src/cluster/internal/entityManager.ts +68 -80
- package/src/cluster/internal/interruptors.ts +13 -0
- package/src/cluster/internal/resourceMap.ts +55 -17
- package/src/cluster/internal/resourceRef.ts +189 -96
- package/src/encoding/Base64.ts +4 -0
- package/src/encoding/Base64Url.ts +4 -0
- package/src/encoding/EncodingError.ts +5 -0
- package/src/encoding/Hex.ts +5 -0
- package/src/encoding/Toml.ts +2 -2
- package/src/encoding/Yaml.ts +8 -4
- package/src/encoding/index.ts +4 -0
- package/src/eventlog/SqlEventJournal.ts +18 -4
- package/src/eventlog/SqlEventLogServerUnencrypted.ts +282 -235
- package/src/http/Headers.ts +8 -2
- package/src/http/HttpClient.ts +44 -27
- package/src/http/HttpClientResponse.ts +3 -1
- package/src/http/HttpEffect.ts +11 -2
- package/src/http/HttpMiddleware.ts +67 -46
- package/src/http/HttpServer.ts +1 -1
- package/src/http/HttpStaticServer.ts +16 -0
- package/src/http/HttpTraceContext.ts +8 -4
- package/src/http/internal/tracing.ts +52 -0
- package/src/http-api/HttpApiBuilder.ts +5 -1
- package/src/http-api/HttpApiClient.ts +13 -4
- package/src/http-api/HttpApiError.ts +8 -3
- package/src/http-api/HttpApiSecurity.ts +8 -8
- package/src/index.ts +156 -0
- package/src/internal/arbitrary/array.ts +3 -3
- package/src/internal/arbitrary/model.ts +37 -14
- package/src/internal/arbitrary/runner.ts +7 -7
- package/src/internal/arbitrary/schema.ts +4 -3
- package/src/internal/core.ts +56 -2
- package/src/internal/dateTime.ts +3 -1
- package/src/internal/effect.ts +156 -156
- package/src/internal/rcRef.ts +83 -33
- package/src/internal/schedule.ts +23 -17
- package/src/internal/schema/fromJsonSchemaDocument.ts +5 -3
- package/src/internal/schema/standardSchema.ts +2 -2
- package/src/internal/version.ts +2 -0
- package/src/observability/OtlpExporter.ts +9 -6
- package/src/observability/OtlpLogger.ts +20 -21
- package/src/observability/OtlpMetrics.ts +34 -93
- package/src/observability/OtlpResource.ts +18 -27
- package/src/observability/OtlpTracer.ts +34 -40
- package/src/observability/internal/otlpProtobuf.ts +60 -0
- package/src/reactivity/AsyncResult.ts +1 -1
- package/src/reactivity/Atom.ts +10 -6
- package/src/reactivity/AtomHttpApi.ts +2 -4
- package/src/reactivity/AtomRegistry.ts +7 -0
- package/src/rpc/RpcClient.ts +74 -46
- package/src/rpc/RpcServer.ts +28 -25
- package/src/rpc/Utils.ts +4 -10
- package/src/rpc/internal/tracing.ts +22 -0
- package/src/schema/SchemaCompiler/runtime.ts +4 -1
- package/src/sql/SqlClient.ts +4 -4
- package/src/sql/Statement.ts +59 -7
- package/src/testing/TestClock.ts +9 -0
- package/src/testing/TestConsole.ts +8 -0
- package/src/testing/index.ts +3 -0
- package/src/workflow/WorkflowEngine.ts +4 -0
package/src/Effect.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* creating effects, combining them, handling failures, managing resources, and
|
|
9
9
|
* running effect programs.
|
|
10
10
|
*
|
|
11
|
+
* @stability stable
|
|
11
12
|
* @since 2.0.0
|
|
12
13
|
*/
|
|
13
14
|
import type * as Arr from "./Array.ts"
|
|
@@ -76,6 +77,7 @@ import type * as Unify from "./Unify.ts"
|
|
|
76
77
|
/**
|
|
77
78
|
* Type-level identifier for `Effect` values.
|
|
78
79
|
*
|
|
80
|
+
* @stability stable
|
|
79
81
|
* @category type IDs
|
|
80
82
|
* @since 4.0.0
|
|
81
83
|
*/
|
|
@@ -84,6 +86,7 @@ export type TypeId = "~effect/Effect"
|
|
|
84
86
|
/**
|
|
85
87
|
* Runtime identifier used to recognize `Effect` values.
|
|
86
88
|
*
|
|
89
|
+
* @stability stable
|
|
87
90
|
* @category type IDs
|
|
88
91
|
* @since 4.0.0
|
|
89
92
|
*/
|
|
@@ -110,6 +113,7 @@ export const TypeId: TypeId = core.EffectTypeId
|
|
|
110
113
|
* To run an `Effect` value, you need a `Runtime`, which is a type that is
|
|
111
114
|
* capable of executing `Effect` values.
|
|
112
115
|
*
|
|
116
|
+
* @stability stable
|
|
113
117
|
* @category models
|
|
114
118
|
* @since 2.0.0
|
|
115
119
|
*/
|
|
@@ -124,6 +128,7 @@ export interface Effect<out A, out E = never, out R = never> extends Pipeable, I
|
|
|
124
128
|
/**
|
|
125
129
|
* Type-level unification support for `Effect` values.
|
|
126
130
|
*
|
|
131
|
+
* @stability stable
|
|
127
132
|
* @category models
|
|
128
133
|
* @since 2.0.0
|
|
129
134
|
*/
|
|
@@ -137,6 +142,7 @@ export interface EffectUnify<A extends { [Unify.typeSymbol]?: any }> {
|
|
|
137
142
|
/**
|
|
138
143
|
* Type lambda used to represent `Effect` in higher-kinded APIs.
|
|
139
144
|
*
|
|
145
|
+
* @stability stable
|
|
140
146
|
* @category utility types
|
|
141
147
|
* @since 2.0.0
|
|
142
148
|
*/
|
|
@@ -147,6 +153,7 @@ export interface EffectTypeLambda extends TypeLambda {
|
|
|
147
153
|
/**
|
|
148
154
|
* Variance interface for Effect, encoding the type parameters' variance.
|
|
149
155
|
*
|
|
156
|
+
* @stability stable
|
|
150
157
|
* @category models
|
|
151
158
|
* @since 2.0.0
|
|
152
159
|
*/
|
|
@@ -167,6 +174,7 @@ export interface Variance<A, E, R> {
|
|
|
167
174
|
* @see {@link Error} for extracting the failure type from the same `Effect`
|
|
168
175
|
* @see {@link Services} for extracting the required services from the same `Effect`
|
|
169
176
|
*
|
|
177
|
+
* @stability stable
|
|
170
178
|
* @category utility types
|
|
171
179
|
* @since 2.0.0
|
|
172
180
|
*/
|
|
@@ -188,6 +196,7 @@ export type Success<T> = T extends Effect<infer _A, infer _E, infer _R> ? _A
|
|
|
188
196
|
* @see {@link Success} for extracting the success value type instead
|
|
189
197
|
* @see {@link Services} for extracting the required services type instead
|
|
190
198
|
*
|
|
199
|
+
* @stability stable
|
|
191
200
|
* @category utility types
|
|
192
201
|
* @since 2.0.0
|
|
193
202
|
*/
|
|
@@ -205,6 +214,7 @@ export type Error<T> = T extends Effect<infer _A, infer _E, infer _R> ? _E
|
|
|
205
214
|
* @see {@link Success} for extracting the success value type instead
|
|
206
215
|
* @see {@link Error} for extracting the failure type instead
|
|
207
216
|
*
|
|
217
|
+
* @stability stable
|
|
208
218
|
* @category utility types
|
|
209
219
|
* @since 4.0.0
|
|
210
220
|
*/
|
|
@@ -223,6 +233,7 @@ export type Services<T> = T extends Effect<infer _A, infer _E, infer _R> ? _R
|
|
|
223
233
|
* Effect.isEffect("hello") // => false
|
|
224
234
|
* ```
|
|
225
235
|
*
|
|
236
|
+
* @stability stable
|
|
226
237
|
* @category guards
|
|
227
238
|
* @since 2.0.0
|
|
228
239
|
*/
|
|
@@ -238,6 +249,7 @@ export const isEffect: (u: unknown) => u is Effect<unknown, unknown, unknown> =
|
|
|
238
249
|
*
|
|
239
250
|
* @see {@link gen} for writing generator-based `Effect` programs that consume this iterator protocol
|
|
240
251
|
*
|
|
252
|
+
* @stability stable
|
|
241
253
|
* @category models
|
|
242
254
|
* @since 4.0.0
|
|
243
255
|
*/
|
|
@@ -255,6 +267,7 @@ export interface EffectIterator<T extends Effect<any, any, any>> {
|
|
|
255
267
|
* Namespace containing type utilities for the `Effect.all` function, which handles
|
|
256
268
|
* collecting multiple effects into various output structures.
|
|
257
269
|
*
|
|
270
|
+
* @stability stable
|
|
258
271
|
* @category collecting
|
|
259
272
|
* @since 2.0.0
|
|
260
273
|
*/
|
|
@@ -485,6 +498,7 @@ export declare namespace All {
|
|
|
485
498
|
* ```
|
|
486
499
|
*
|
|
487
500
|
* @see {@link forEach} for iterating over elements and applying an effect.
|
|
501
|
+
* @stability stable
|
|
488
502
|
* @category collecting
|
|
489
503
|
* @since 2.0.0
|
|
490
504
|
*/
|
|
@@ -526,6 +540,7 @@ export const all: <
|
|
|
526
540
|
* await Effect.runPromise(program) // => [[1, 3], ['0 is even', '2 is even']]
|
|
527
541
|
* ```
|
|
528
542
|
*
|
|
543
|
+
* @stability stable
|
|
529
544
|
* @category collecting
|
|
530
545
|
* @since 2.0.0
|
|
531
546
|
*/
|
|
@@ -554,6 +569,7 @@ export const partition: {
|
|
|
554
569
|
* await Effect.runPromise(program) // => [[1, 3], ['0 is even', '2 is even']]
|
|
555
570
|
* ```
|
|
556
571
|
*
|
|
572
|
+
* @stability stable
|
|
557
573
|
* @category collecting
|
|
558
574
|
* @since 2.0.0
|
|
559
575
|
*/
|
|
@@ -585,6 +601,7 @@ export const partition: {
|
|
|
585
601
|
* await Effect.runPromise(program) // => [[1, 3], ['0 is even', '2 is even']]
|
|
586
602
|
* ```
|
|
587
603
|
*
|
|
604
|
+
* @stability stable
|
|
588
605
|
* @category collecting
|
|
589
606
|
* @since 2.0.0
|
|
590
607
|
*/
|
|
@@ -629,6 +646,7 @@ export const partition: {
|
|
|
629
646
|
* output // => ["Adding 1 at index 0", "Adding 2 at index 1", "Adding 3 at index 2", 6]
|
|
630
647
|
* ```
|
|
631
648
|
*
|
|
649
|
+
* @stability stable
|
|
632
650
|
* @category collecting
|
|
633
651
|
* @since 2.0.0
|
|
634
652
|
*/
|
|
@@ -667,6 +685,7 @@ export const reduce: {
|
|
|
667
685
|
* output // => ["Adding 1 at index 0", "Adding 2 at index 1", "Adding 3 at index 2", 6]
|
|
668
686
|
* ```
|
|
669
687
|
*
|
|
688
|
+
* @stability stable
|
|
670
689
|
* @category collecting
|
|
671
690
|
* @since 2.0.0
|
|
672
691
|
*/
|
|
@@ -705,6 +724,7 @@ export const reduce: {
|
|
|
705
724
|
* output // => ["Adding 1 at index 0", "Adding 2 at index 1", "Adding 3 at index 2", 6]
|
|
706
725
|
* ```
|
|
707
726
|
*
|
|
727
|
+
* @stability stable
|
|
708
728
|
* @category collecting
|
|
709
729
|
* @since 2.0.0
|
|
710
730
|
*/
|
|
@@ -739,6 +759,7 @@ export const reduce: {
|
|
|
739
759
|
* await Effect.runPromiseExit(program) // => Exit.fail(["0 is even", "2 is even"])
|
|
740
760
|
* ```
|
|
741
761
|
*
|
|
762
|
+
* @stability stable
|
|
742
763
|
* @category collecting
|
|
743
764
|
* @since 2.0.0
|
|
744
765
|
*/
|
|
@@ -767,6 +788,7 @@ export const validate: {
|
|
|
767
788
|
* await Effect.runPromiseExit(program) // => Exit.fail(["0 is even", "2 is even"])
|
|
768
789
|
* ```
|
|
769
790
|
*
|
|
791
|
+
* @stability stable
|
|
770
792
|
* @category collecting
|
|
771
793
|
* @since 2.0.0
|
|
772
794
|
*/
|
|
@@ -801,6 +823,7 @@ export const validate: {
|
|
|
801
823
|
* await Effect.runPromiseExit(program) // => Exit.fail(["0 is even", "2 is even"])
|
|
802
824
|
* ```
|
|
803
825
|
*
|
|
826
|
+
* @stability stable
|
|
804
827
|
* @category collecting
|
|
805
828
|
* @since 2.0.0
|
|
806
829
|
*/
|
|
@@ -835,6 +858,7 @@ export const validate: {
|
|
|
835
858
|
* await Effect.runPromiseExit(program) // => Exit.fail(["0 is even", "2 is even"])
|
|
836
859
|
* ```
|
|
837
860
|
*
|
|
861
|
+
* @stability stable
|
|
838
862
|
* @category collecting
|
|
839
863
|
* @since 2.0.0
|
|
840
864
|
*/
|
|
@@ -870,6 +894,7 @@ export const validate: {
|
|
|
870
894
|
* await Effect.runPromiseExit(program) // => Exit.fail(["0 is even", "2 is even"])
|
|
871
895
|
* ```
|
|
872
896
|
*
|
|
897
|
+
* @stability stable
|
|
873
898
|
* @category collecting
|
|
874
899
|
* @since 2.0.0
|
|
875
900
|
*/
|
|
@@ -901,6 +926,7 @@ export const validate: {
|
|
|
901
926
|
* await Effect.runPromise(program) // => Option.some(3)
|
|
902
927
|
* ```
|
|
903
928
|
*
|
|
929
|
+
* @stability stable
|
|
904
930
|
* @category collecting
|
|
905
931
|
* @since 2.0.0
|
|
906
932
|
*/
|
|
@@ -923,6 +949,7 @@ export const findFirst: {
|
|
|
923
949
|
* await Effect.runPromise(program) // => Option.some(3)
|
|
924
950
|
* ```
|
|
925
951
|
*
|
|
952
|
+
* @stability stable
|
|
926
953
|
* @category collecting
|
|
927
954
|
* @since 2.0.0
|
|
928
955
|
*/
|
|
@@ -945,6 +972,7 @@ export const findFirst: {
|
|
|
945
972
|
* await Effect.runPromise(program) // => Option.some(3)
|
|
946
973
|
* ```
|
|
947
974
|
*
|
|
975
|
+
* @stability stable
|
|
948
976
|
* @category collecting
|
|
949
977
|
* @since 2.0.0
|
|
950
978
|
*/
|
|
@@ -969,6 +997,7 @@ export const findFirst: {
|
|
|
969
997
|
*
|
|
970
998
|
* @see {@link findFirst} for the simpler effectful predicate-based variant
|
|
971
999
|
*
|
|
1000
|
+
* @stability stable
|
|
972
1001
|
* @category collecting
|
|
973
1002
|
* @since 4.0.0
|
|
974
1003
|
*/
|
|
@@ -988,6 +1017,7 @@ export const findFirstFilter: {
|
|
|
988
1017
|
*
|
|
989
1018
|
* @see {@link findFirst} for the simpler effectful predicate-based variant
|
|
990
1019
|
*
|
|
1020
|
+
* @stability stable
|
|
991
1021
|
* @category collecting
|
|
992
1022
|
* @since 4.0.0
|
|
993
1023
|
*/
|
|
@@ -1009,6 +1039,7 @@ export const findFirstFilter: {
|
|
|
1009
1039
|
*
|
|
1010
1040
|
* @see {@link findFirst} for the simpler effectful predicate-based variant
|
|
1011
1041
|
*
|
|
1042
|
+
* @stability stable
|
|
1012
1043
|
* @category collecting
|
|
1013
1044
|
* @since 4.0.0
|
|
1014
1045
|
*/
|
|
@@ -1079,6 +1110,7 @@ export const findFirstFilter: {
|
|
|
1079
1110
|
* ```
|
|
1080
1111
|
*
|
|
1081
1112
|
* @see {@link all} for combining multiple effects into one.
|
|
1113
|
+
* @stability stable
|
|
1082
1114
|
* @category collecting
|
|
1083
1115
|
* @since 2.0.0
|
|
1084
1116
|
*/
|
|
@@ -1144,6 +1176,7 @@ export const forEach: {
|
|
|
1144
1176
|
* ```
|
|
1145
1177
|
*
|
|
1146
1178
|
* @see {@link all} for combining multiple effects into one.
|
|
1179
|
+
* @stability stable
|
|
1147
1180
|
* @category collecting
|
|
1148
1181
|
* @since 2.0.0
|
|
1149
1182
|
*/
|
|
@@ -1214,6 +1247,7 @@ export const forEach: {
|
|
|
1214
1247
|
* ```
|
|
1215
1248
|
*
|
|
1216
1249
|
* @see {@link all} for combining multiple effects into one.
|
|
1250
|
+
* @stability stable
|
|
1217
1251
|
* @category collecting
|
|
1218
1252
|
* @since 2.0.0
|
|
1219
1253
|
*/
|
|
@@ -1245,6 +1279,7 @@ export const forEach: {
|
|
|
1245
1279
|
* await Effect.runPromise(empty) // => Option.none()
|
|
1246
1280
|
* ```
|
|
1247
1281
|
*
|
|
1282
|
+
* @stability stable
|
|
1248
1283
|
* @category collecting
|
|
1249
1284
|
* @since 2.0.0
|
|
1250
1285
|
*/
|
|
@@ -1273,6 +1308,7 @@ export const head: <A, E, R>(
|
|
|
1273
1308
|
* output // => ["Current count: 1", "Current count: 2", "Current count: 3", "Current count: 4", "Current count: 5"]
|
|
1274
1309
|
* ```
|
|
1275
1310
|
*
|
|
1311
|
+
* @stability stable
|
|
1276
1312
|
* @category repetition
|
|
1277
1313
|
* @since 2.0.0
|
|
1278
1314
|
*/
|
|
@@ -1323,6 +1359,7 @@ export const whileLoop: <A, E, R>(options: {
|
|
|
1323
1359
|
* ```
|
|
1324
1360
|
*
|
|
1325
1361
|
* @see {@link tryPromise} for a version that can handle failures.
|
|
1362
|
+
* @stability stable
|
|
1326
1363
|
* @category constructors
|
|
1327
1364
|
* @since 2.0.0
|
|
1328
1365
|
*/
|
|
@@ -1397,6 +1434,7 @@ export const promise: <A>(
|
|
|
1397
1434
|
* ```
|
|
1398
1435
|
*
|
|
1399
1436
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
1437
|
+
* @stability stable
|
|
1400
1438
|
* @category constructors
|
|
1401
1439
|
* @since 2.0.0
|
|
1402
1440
|
*/
|
|
@@ -1468,6 +1506,7 @@ export const tryPromise: {
|
|
|
1468
1506
|
* ```
|
|
1469
1507
|
*
|
|
1470
1508
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
1509
|
+
* @stability stable
|
|
1471
1510
|
* @category constructors
|
|
1472
1511
|
* @since 2.0.0
|
|
1473
1512
|
*/
|
|
@@ -1539,6 +1578,7 @@ export const tryPromise: {
|
|
|
1539
1578
|
* ```
|
|
1540
1579
|
*
|
|
1541
1580
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
1581
|
+
* @stability stable
|
|
1542
1582
|
* @category constructors
|
|
1543
1583
|
* @since 2.0.0
|
|
1544
1584
|
*/
|
|
@@ -1569,6 +1609,7 @@ export const tryPromise: {
|
|
|
1569
1609
|
* ```
|
|
1570
1610
|
*
|
|
1571
1611
|
* @see {@link fail} to create an effect that represents a failure.
|
|
1612
|
+
* @stability stable
|
|
1572
1613
|
* @category constructors
|
|
1573
1614
|
* @since 2.0.0
|
|
1574
1615
|
*/
|
|
@@ -1587,6 +1628,7 @@ export const succeed: <A>(value: A) => Effect<A> = internal.succeed
|
|
|
1587
1628
|
* Effect.runSync(program) // => Option.none()
|
|
1588
1629
|
* ```
|
|
1589
1630
|
*
|
|
1631
|
+
* @stability stable
|
|
1590
1632
|
* @category constructors
|
|
1591
1633
|
* @since 2.0.0
|
|
1592
1634
|
*/
|
|
@@ -1605,6 +1647,7 @@ export const succeedNone: Effect<Option<never>> = internal.succeedNone
|
|
|
1605
1647
|
* Effect.runSync(program) // => Option.some(42)
|
|
1606
1648
|
* ```
|
|
1607
1649
|
*
|
|
1650
|
+
* @stability stable
|
|
1608
1651
|
* @category constructors
|
|
1609
1652
|
* @since 2.0.0
|
|
1610
1653
|
*/
|
|
@@ -1696,6 +1739,7 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
|
|
|
1696
1739
|
* Effect.runSync(withSuspend(6, 2)) // => 3
|
|
1697
1740
|
* ```
|
|
1698
1741
|
*
|
|
1742
|
+
* @stability stable
|
|
1699
1743
|
* @category constructors
|
|
1700
1744
|
* @since 2.0.0
|
|
1701
1745
|
*/
|
|
@@ -1739,6 +1783,7 @@ export const suspend: <A, E, R>(
|
|
|
1739
1783
|
* ```
|
|
1740
1784
|
*
|
|
1741
1785
|
* @see {@link try_ | try} for a version that can handle failures.
|
|
1786
|
+
* @stability stable
|
|
1742
1787
|
* @category constructors
|
|
1743
1788
|
* @since 2.0.0
|
|
1744
1789
|
*/
|
|
@@ -1749,6 +1794,7 @@ export {
|
|
|
1749
1794
|
/**
|
|
1750
1795
|
* Returns an effect that succeeds with `void`.
|
|
1751
1796
|
*
|
|
1797
|
+
* @stability stable
|
|
1752
1798
|
* @category constructors
|
|
1753
1799
|
* @since 2.0.0
|
|
1754
1800
|
*/
|
|
@@ -1760,6 +1806,7 @@ export {
|
|
|
1760
1806
|
/**
|
|
1761
1807
|
* Returns an effect that succeeds with `undefined`.
|
|
1762
1808
|
*
|
|
1809
|
+
* @stability stable
|
|
1763
1810
|
* @category constructors
|
|
1764
1811
|
* @since 4.0.0
|
|
1765
1812
|
*/
|
|
@@ -1799,6 +1846,7 @@ export {
|
|
|
1799
1846
|
* output // => ["callback completed"]
|
|
1800
1847
|
* ```
|
|
1801
1848
|
*
|
|
1849
|
+
* @stability stable
|
|
1802
1850
|
* @category constructors
|
|
1803
1851
|
* @since 4.0.0
|
|
1804
1852
|
*/
|
|
@@ -1823,6 +1871,7 @@ export const callback: <A, E = never, R = never>(
|
|
|
1823
1871
|
* await Effect.runPromise(program) // => Option.none()
|
|
1824
1872
|
* ```
|
|
1825
1873
|
*
|
|
1874
|
+
* @stability stable
|
|
1826
1875
|
* @category constructors
|
|
1827
1876
|
* @since 2.0.0
|
|
1828
1877
|
*/
|
|
@@ -1847,6 +1896,7 @@ export const never: Effect<never> = internal.never
|
|
|
1847
1896
|
* Effect.runSync(program) // => { x: 2, y: 3, sum: 5 }
|
|
1848
1897
|
* ```
|
|
1849
1898
|
*
|
|
1899
|
+
* @stability stable
|
|
1850
1900
|
* @category do notation
|
|
1851
1901
|
* @since 2.0.0
|
|
1852
1902
|
*/
|
|
@@ -1864,6 +1914,7 @@ export const Do: Effect<{}> = internal.Do
|
|
|
1864
1914
|
* @see {@link Do} for starting from an empty accumulated record
|
|
1865
1915
|
* @see {@link bind} for adding fields produced by effects
|
|
1866
1916
|
*
|
|
1917
|
+
* @stability stable
|
|
1867
1918
|
* @category do notation
|
|
1868
1919
|
* @since 2.0.0
|
|
1869
1920
|
*/
|
|
@@ -1880,6 +1931,7 @@ export const bindTo: {
|
|
|
1880
1931
|
* @see {@link Do} for starting from an empty accumulated record
|
|
1881
1932
|
* @see {@link bind} for adding fields produced by effects
|
|
1882
1933
|
*
|
|
1934
|
+
* @stability stable
|
|
1883
1935
|
* @category do notation
|
|
1884
1936
|
* @since 2.0.0
|
|
1885
1937
|
*/
|
|
@@ -1896,6 +1948,7 @@ export const bindTo: {
|
|
|
1896
1948
|
* @see {@link Do} for starting from an empty accumulated record
|
|
1897
1949
|
* @see {@link bind} for adding fields produced by effects
|
|
1898
1950
|
*
|
|
1951
|
+
* @stability stable
|
|
1899
1952
|
* @category do notation
|
|
1900
1953
|
* @since 2.0.0
|
|
1901
1954
|
*/
|
|
@@ -1936,6 +1989,7 @@ export {
|
|
|
1936
1989
|
* @see {@link Do} for starting from an empty accumulated record
|
|
1937
1990
|
* @see {@link gen} for sequencing without accumulating a record
|
|
1938
1991
|
*
|
|
1992
|
+
* @stability stable
|
|
1939
1993
|
* @category do notation
|
|
1940
1994
|
* @since 2.0.0
|
|
1941
1995
|
*/
|
|
@@ -1966,6 +2020,7 @@ export {
|
|
|
1966
2020
|
* @see {@link bindTo} for naming the success value of an existing effect
|
|
1967
2021
|
* @see {@link gen} for generator-based sequencing without accumulating a record
|
|
1968
2022
|
*
|
|
2023
|
+
* @stability stable
|
|
1969
2024
|
* @category do notation
|
|
1970
2025
|
* @since 2.0.0
|
|
1971
2026
|
*/
|
|
@@ -1994,6 +2049,7 @@ export const bind: {
|
|
|
1994
2049
|
* @see {@link bindTo} for naming the success value of an existing effect
|
|
1995
2050
|
* @see {@link gen} for generator-based sequencing without accumulating a record
|
|
1996
2051
|
*
|
|
2052
|
+
* @stability stable
|
|
1997
2053
|
* @category do notation
|
|
1998
2054
|
* @since 2.0.0
|
|
1999
2055
|
*/
|
|
@@ -2024,6 +2080,7 @@ export const bind: {
|
|
|
2024
2080
|
* @see {@link bindTo} for naming the success value of an existing effect
|
|
2025
2081
|
* @see {@link gen} for generator-based sequencing without accumulating a record
|
|
2026
2082
|
*
|
|
2083
|
+
* @stability stable
|
|
2027
2084
|
* @category do notation
|
|
2028
2085
|
* @since 2.0.0
|
|
2029
2086
|
*/
|
|
@@ -2079,6 +2136,7 @@ export const bind: {
|
|
|
2079
2136
|
* await Effect.runPromise(program) // => "Final amount to charge: 96"
|
|
2080
2137
|
* ```
|
|
2081
2138
|
*
|
|
2139
|
+
* @stability stable
|
|
2082
2140
|
* @category constructors
|
|
2083
2141
|
* @since 2.0.0
|
|
2084
2142
|
*/
|
|
@@ -2132,6 +2190,7 @@ export const gen: {
|
|
|
2132
2190
|
* await Effect.runPromise(program) // => "Final amount to charge: 96"
|
|
2133
2191
|
* ```
|
|
2134
2192
|
*
|
|
2193
|
+
* @stability stable
|
|
2135
2194
|
* @category constructors
|
|
2136
2195
|
* @since 2.0.0
|
|
2137
2196
|
*/
|
|
@@ -2193,6 +2252,7 @@ export const gen: {
|
|
|
2193
2252
|
* await Effect.runPromise(program) // => "Final amount to charge: 96"
|
|
2194
2253
|
* ```
|
|
2195
2254
|
*
|
|
2255
|
+
* @stability stable
|
|
2196
2256
|
* @category constructors
|
|
2197
2257
|
* @since 2.0.0
|
|
2198
2258
|
*/
|
|
@@ -2215,6 +2275,7 @@ export const gen: {
|
|
|
2215
2275
|
/**
|
|
2216
2276
|
* Type helpers for `Effect.gen` generator return signatures.
|
|
2217
2277
|
*
|
|
2278
|
+
* @stability stable
|
|
2218
2279
|
* @category constructors
|
|
2219
2280
|
* @since 2.0.0
|
|
2220
2281
|
*/
|
|
@@ -2256,6 +2317,7 @@ export declare namespace gen {
|
|
|
2256
2317
|
* ```
|
|
2257
2318
|
*
|
|
2258
2319
|
* @see {@link succeed} to create an effect that represents a successful value.
|
|
2320
|
+
* @stability stable
|
|
2259
2321
|
* @category constructors
|
|
2260
2322
|
* @since 2.0.0
|
|
2261
2323
|
*/
|
|
@@ -2284,6 +2346,7 @@ export const fail: <E>(error: E) => Effect<never, E> = internal.fail
|
|
|
2284
2346
|
* Effect.runSync(Effect.flip(program)).operation // => "sync"
|
|
2285
2347
|
* ```
|
|
2286
2348
|
*
|
|
2349
|
+
* @stability stable
|
|
2287
2350
|
* @category constructors
|
|
2288
2351
|
* @since 2.0.0
|
|
2289
2352
|
*/
|
|
@@ -2315,6 +2378,7 @@ export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.
|
|
|
2315
2378
|
* Effect.runSync(Effect.flip(program)) // => "Network error"
|
|
2316
2379
|
* ```
|
|
2317
2380
|
*
|
|
2381
|
+
* @stability stable
|
|
2318
2382
|
* @category constructors
|
|
2319
2383
|
* @since 2.0.0
|
|
2320
2384
|
*/
|
|
@@ -2343,6 +2407,7 @@ export const failCause: <E>(cause: Cause.Cause<E>) => Effect<never, E> = interna
|
|
|
2343
2407
|
* Effect.runSync(Effect.flip(program)) // => "Error computed at runtime"
|
|
2344
2408
|
* ```
|
|
2345
2409
|
*
|
|
2410
|
+
* @stability stable
|
|
2346
2411
|
* @category constructors
|
|
2347
2412
|
* @since 2.0.0
|
|
2348
2413
|
*/
|
|
@@ -2385,6 +2450,7 @@ export const failCauseSync: <E>(
|
|
|
2385
2450
|
* Effect.runSyncExit(program) // => Exit.die(defect)
|
|
2386
2451
|
* ```
|
|
2387
2452
|
*
|
|
2453
|
+
* @stability stable
|
|
2388
2454
|
* @category constructors
|
|
2389
2455
|
* @since 2.0.0
|
|
2390
2456
|
*/
|
|
@@ -2459,6 +2525,7 @@ export {
|
|
|
2459
2525
|
*
|
|
2460
2526
|
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
2461
2527
|
* throw errors.
|
|
2528
|
+
* @stability stable
|
|
2462
2529
|
* @category constructors
|
|
2463
2530
|
* @since 2.0.0
|
|
2464
2531
|
*/
|
|
@@ -2484,6 +2551,7 @@ export {
|
|
|
2484
2551
|
* output // => ["Before yield", "After yield"]
|
|
2485
2552
|
* ```
|
|
2486
2553
|
*
|
|
2554
|
+
* @stability stable
|
|
2487
2555
|
* @category constructors
|
|
2488
2556
|
* @since 2.0.0
|
|
2489
2557
|
*/
|
|
@@ -2508,6 +2576,7 @@ export const yieldNow: Effect<void> = internal.yieldNow
|
|
|
2508
2576
|
* output // => ["High priority task", "Continued after yield"]
|
|
2509
2577
|
* ```
|
|
2510
2578
|
*
|
|
2579
|
+
* @stability stable
|
|
2511
2580
|
* @category constructors
|
|
2512
2581
|
* @since 4.0.0
|
|
2513
2582
|
*/
|
|
@@ -2526,6 +2595,7 @@ export const yieldNowWith: (priority?: number) => Effect<void> = internal.yieldN
|
|
|
2526
2595
|
* Effect.runSync(program) // => "number"
|
|
2527
2596
|
* ```
|
|
2528
2597
|
*
|
|
2598
|
+
* @stability stable
|
|
2529
2599
|
* @category constructors
|
|
2530
2600
|
* @since 4.0.0
|
|
2531
2601
|
*/
|
|
@@ -2546,6 +2616,7 @@ export const withFiber: <A, E = never, R = never>(
|
|
|
2546
2616
|
* Effect.runSync(program) // => "number"
|
|
2547
2617
|
* ```
|
|
2548
2618
|
*
|
|
2619
|
+
* @stability stable
|
|
2549
2620
|
* @category constructors
|
|
2550
2621
|
* @since 4.0.0
|
|
2551
2622
|
*/
|
|
@@ -2577,6 +2648,7 @@ export const withFiberSucceed: <A, R = never>(
|
|
|
2577
2648
|
* output // => [42, "Something went wrong"]
|
|
2578
2649
|
* ```
|
|
2579
2650
|
*
|
|
2651
|
+
* @stability stable
|
|
2580
2652
|
* @category converting
|
|
2581
2653
|
* @since 4.0.0
|
|
2582
2654
|
*/
|
|
@@ -2616,6 +2688,7 @@ export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect<A, E> = i
|
|
|
2616
2688
|
* output // => [42, "NoSuchElementError", "missing"]
|
|
2617
2689
|
* ```
|
|
2618
2690
|
*
|
|
2691
|
+
* @stability stable
|
|
2619
2692
|
* @category converting
|
|
2620
2693
|
* @since 4.0.0
|
|
2621
2694
|
*/
|
|
@@ -2663,6 +2736,7 @@ export const fromOption: <
|
|
|
2663
2736
|
* Effect.runSync(program) // => Option.some(42)
|
|
2664
2737
|
* ```
|
|
2665
2738
|
*
|
|
2739
|
+
* @stability stable
|
|
2666
2740
|
* @category converting
|
|
2667
2741
|
* @since 3.13.0
|
|
2668
2742
|
*/
|
|
@@ -2692,6 +2766,7 @@ export const transposeOption: <A = never, E = never, R = never>(
|
|
|
2692
2766
|
* output // => ["missing", "hello"]
|
|
2693
2767
|
* ```
|
|
2694
2768
|
*
|
|
2769
|
+
* @stability stable
|
|
2695
2770
|
* @category converting
|
|
2696
2771
|
* @since 4.0.0
|
|
2697
2772
|
*/
|
|
@@ -2771,6 +2846,7 @@ export const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Cause.NoSuch
|
|
|
2771
2846
|
* ```
|
|
2772
2847
|
*
|
|
2773
2848
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2849
|
+
* @stability stable
|
|
2774
2850
|
* @category sequencing
|
|
2775
2851
|
* @since 2.0.0
|
|
2776
2852
|
*/
|
|
@@ -2849,6 +2925,7 @@ export const flatMap: {
|
|
|
2849
2925
|
* ```
|
|
2850
2926
|
*
|
|
2851
2927
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2928
|
+
* @stability stable
|
|
2852
2929
|
* @category sequencing
|
|
2853
2930
|
* @since 2.0.0
|
|
2854
2931
|
*/
|
|
@@ -2927,6 +3004,7 @@ export const flatMap: {
|
|
|
2927
3004
|
* ```
|
|
2928
3005
|
*
|
|
2929
3006
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
3007
|
+
* @stability stable
|
|
2930
3008
|
* @category sequencing
|
|
2931
3009
|
* @since 2.0.0
|
|
2932
3010
|
*/
|
|
@@ -2953,6 +3031,7 @@ export const flatMap: {
|
|
|
2953
3031
|
* output // => ["hello"]
|
|
2954
3032
|
* ```
|
|
2955
3033
|
*
|
|
3034
|
+
* @stability stable
|
|
2956
3035
|
* @category sequencing
|
|
2957
3036
|
* @since 2.0.0
|
|
2958
3037
|
*/
|
|
@@ -3037,6 +3116,7 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
|
|
|
3037
3116
|
* await Effect.runPromise(result2) // => 190
|
|
3038
3117
|
* ```
|
|
3039
3118
|
*
|
|
3119
|
+
* @stability stable
|
|
3040
3120
|
* @category sequencing
|
|
3041
3121
|
* @since 2.0.0
|
|
3042
3122
|
*/
|
|
@@ -3119,6 +3199,7 @@ export const andThen: {
|
|
|
3119
3199
|
* await Effect.runPromise(result2) // => 190
|
|
3120
3200
|
* ```
|
|
3121
3201
|
*
|
|
3202
|
+
* @stability stable
|
|
3122
3203
|
* @category sequencing
|
|
3123
3204
|
* @since 2.0.0
|
|
3124
3205
|
*/
|
|
@@ -3201,6 +3282,7 @@ export const andThen: {
|
|
|
3201
3282
|
* await Effect.runPromise(result2) // => 190
|
|
3202
3283
|
* ```
|
|
3203
3284
|
*
|
|
3285
|
+
* @stability stable
|
|
3204
3286
|
* @category sequencing
|
|
3205
3287
|
* @since 2.0.0
|
|
3206
3288
|
*/
|
|
@@ -3283,6 +3365,7 @@ export const andThen: {
|
|
|
3283
3365
|
* await Effect.runPromise(result2) // => 190
|
|
3284
3366
|
* ```
|
|
3285
3367
|
*
|
|
3368
|
+
* @stability stable
|
|
3286
3369
|
* @category sequencing
|
|
3287
3370
|
* @since 2.0.0
|
|
3288
3371
|
*/
|
|
@@ -3365,6 +3448,7 @@ export const andThen: {
|
|
|
3365
3448
|
* await Effect.runPromise(result2) // => 190
|
|
3366
3449
|
* ```
|
|
3367
3450
|
*
|
|
3451
|
+
* @stability stable
|
|
3368
3452
|
* @category sequencing
|
|
3369
3453
|
* @since 2.0.0
|
|
3370
3454
|
*/
|
|
@@ -3419,6 +3503,7 @@ export const andThen: {
|
|
|
3419
3503
|
* output // => ["Apply a discount to: 100", 95]
|
|
3420
3504
|
* ```
|
|
3421
3505
|
*
|
|
3506
|
+
* @stability stable
|
|
3422
3507
|
* @category sequencing
|
|
3423
3508
|
* @since 2.0.0
|
|
3424
3509
|
*/
|
|
@@ -3471,6 +3556,7 @@ export const tap: {
|
|
|
3471
3556
|
* output // => ["Apply a discount to: 100", 95]
|
|
3472
3557
|
* ```
|
|
3473
3558
|
*
|
|
3559
|
+
* @stability stable
|
|
3474
3560
|
* @category sequencing
|
|
3475
3561
|
* @since 2.0.0
|
|
3476
3562
|
*/
|
|
@@ -3523,6 +3609,7 @@ export const tap: {
|
|
|
3523
3609
|
* output // => ["Apply a discount to: 100", 95]
|
|
3524
3610
|
* ```
|
|
3525
3611
|
*
|
|
3612
|
+
* @stability stable
|
|
3526
3613
|
* @category sequencing
|
|
3527
3614
|
* @since 2.0.0
|
|
3528
3615
|
*/
|
|
@@ -3575,6 +3662,7 @@ export const tap: {
|
|
|
3575
3662
|
* output // => ["Apply a discount to: 100", 95]
|
|
3576
3663
|
* ```
|
|
3577
3664
|
*
|
|
3665
|
+
* @stability stable
|
|
3578
3666
|
* @category sequencing
|
|
3579
3667
|
* @since 2.0.0
|
|
3580
3668
|
*/
|
|
@@ -3627,6 +3715,7 @@ export const tap: {
|
|
|
3627
3715
|
* output // => ["Apply a discount to: 100", 95]
|
|
3628
3716
|
* ```
|
|
3629
3717
|
*
|
|
3718
|
+
* @stability stable
|
|
3630
3719
|
* @category sequencing
|
|
3631
3720
|
* @since 2.0.0
|
|
3632
3721
|
*/
|
|
@@ -3681,6 +3770,7 @@ export const tap: {
|
|
|
3681
3770
|
* @see {@link option} for a version that uses `Option` instead.
|
|
3682
3771
|
* @see {@link exit} for a version that encapsulates both recoverable errors and defects in an `Exit`.
|
|
3683
3772
|
*
|
|
3773
|
+
* @stability stable
|
|
3684
3774
|
* @category error handling
|
|
3685
3775
|
* @since 4.0.0
|
|
3686
3776
|
*/
|
|
@@ -3724,6 +3814,7 @@ export const result: <A, E, R>(self: Effect<A, E, R>) => Effect<Result.Result<A,
|
|
|
3724
3814
|
* @see {@link result} for a version that uses `Result` instead.
|
|
3725
3815
|
* @see {@link exit} for a version that encapsulates both recoverable errors and defects in an `Exit`.
|
|
3726
3816
|
*
|
|
3817
|
+
* @stability stable
|
|
3727
3818
|
* @category error handling
|
|
3728
3819
|
* @since 2.0.0
|
|
3729
3820
|
*/
|
|
@@ -3766,6 +3857,7 @@ export const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, never
|
|
|
3766
3857
|
* @see {@link option} for a version that uses `Option` instead.
|
|
3767
3858
|
* @see {@link result} for a version that uses `Result` instead.
|
|
3768
3859
|
*
|
|
3860
|
+
* @stability stable
|
|
3769
3861
|
* @category error handling
|
|
3770
3862
|
* @since 2.0.0
|
|
3771
3863
|
*/
|
|
@@ -3832,6 +3924,7 @@ export const exit: <A, E, R>(
|
|
|
3832
3924
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3833
3925
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3834
3926
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3927
|
+
* @stability stable
|
|
3835
3928
|
* @category mapping
|
|
3836
3929
|
* @since 2.0.0
|
|
3837
3930
|
*/
|
|
@@ -3895,6 +3988,7 @@ export const map: {
|
|
|
3895
3988
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3896
3989
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3897
3990
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3991
|
+
* @stability stable
|
|
3898
3992
|
* @category mapping
|
|
3899
3993
|
* @since 2.0.0
|
|
3900
3994
|
*/
|
|
@@ -3958,6 +4052,7 @@ export const map: {
|
|
|
3958
4052
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3959
4053
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3960
4054
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
4055
|
+
* @stability stable
|
|
3961
4056
|
* @category mapping
|
|
3962
4057
|
* @since 2.0.0
|
|
3963
4058
|
*/
|
|
@@ -3991,6 +4086,7 @@ export const map: {
|
|
|
3991
4086
|
* @see {@link map} for deriving the replacement value from the success value
|
|
3992
4087
|
* @see {@link asVoid} for replacing the success value with `void`
|
|
3993
4088
|
*
|
|
4089
|
+
* @stability stable
|
|
3994
4090
|
* @category mapping
|
|
3995
4091
|
* @since 2.0.0
|
|
3996
4092
|
*/
|
|
@@ -4022,6 +4118,7 @@ export const as: {
|
|
|
4022
4118
|
* @see {@link map} for deriving the replacement value from the success value
|
|
4023
4119
|
* @see {@link asVoid} for replacing the success value with `void`
|
|
4024
4120
|
*
|
|
4121
|
+
* @stability stable
|
|
4025
4122
|
* @category mapping
|
|
4026
4123
|
* @since 2.0.0
|
|
4027
4124
|
*/
|
|
@@ -4053,6 +4150,7 @@ export const as: {
|
|
|
4053
4150
|
* @see {@link map} for deriving the replacement value from the success value
|
|
4054
4151
|
* @see {@link asVoid} for replacing the success value with `void`
|
|
4055
4152
|
*
|
|
4153
|
+
* @stability stable
|
|
4056
4154
|
* @category mapping
|
|
4057
4155
|
* @since 2.0.0
|
|
4058
4156
|
*/
|
|
@@ -4072,6 +4170,7 @@ export const as: {
|
|
|
4072
4170
|
* Effect.runSync(program) // => Option.some(42)
|
|
4073
4171
|
* ```
|
|
4074
4172
|
*
|
|
4173
|
+
* @stability stable
|
|
4075
4174
|
* @category mapping
|
|
4076
4175
|
* @since 2.0.0
|
|
4077
4176
|
*/
|
|
@@ -4090,6 +4189,7 @@ export const asSome: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, E, R>
|
|
|
4090
4189
|
* Effect.runSync(program) // => undefined
|
|
4091
4190
|
* ```
|
|
4092
4191
|
*
|
|
4192
|
+
* @stability stable
|
|
4093
4193
|
* @category mapping
|
|
4094
4194
|
* @since 2.0.0
|
|
4095
4195
|
*/
|
|
@@ -4121,6 +4221,7 @@ export const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E, R> = in
|
|
|
4121
4221
|
* Effect.runSync(flipped) // => "Oh uh!"
|
|
4122
4222
|
* ```
|
|
4123
4223
|
*
|
|
4224
|
+
* @stability stable
|
|
4124
4225
|
* @category mapping
|
|
4125
4226
|
* @since 2.0.0
|
|
4126
4227
|
*/
|
|
@@ -4181,6 +4282,7 @@ export const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R> = interna
|
|
|
4181
4282
|
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
4182
4283
|
* @see {@link all} for collecting a larger structure of effects.
|
|
4183
4284
|
*
|
|
4285
|
+
* @stability stable
|
|
4184
4286
|
* @category zipping
|
|
4185
4287
|
* @since 2.0.0
|
|
4186
4288
|
*/
|
|
@@ -4240,6 +4342,7 @@ export const zip: {
|
|
|
4240
4342
|
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
4241
4343
|
* @see {@link all} for collecting a larger structure of effects.
|
|
4242
4344
|
*
|
|
4345
|
+
* @stability stable
|
|
4243
4346
|
* @category zipping
|
|
4244
4347
|
* @since 2.0.0
|
|
4245
4348
|
*/
|
|
@@ -4302,6 +4405,7 @@ export const zip: {
|
|
|
4302
4405
|
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
4303
4406
|
* @see {@link all} for collecting a larger structure of effects.
|
|
4304
4407
|
*
|
|
4408
|
+
* @stability stable
|
|
4305
4409
|
* @category zipping
|
|
4306
4410
|
* @since 2.0.0
|
|
4307
4411
|
*/
|
|
@@ -4346,6 +4450,7 @@ export const zip: {
|
|
|
4346
4450
|
* Effect.runSync(task3) // => 6
|
|
4347
4451
|
* ```
|
|
4348
4452
|
*
|
|
4453
|
+
* @stability stable
|
|
4349
4454
|
* @category zipping
|
|
4350
4455
|
* @since 2.0.0
|
|
4351
4456
|
*/
|
|
@@ -4384,6 +4489,7 @@ export const zipWith: {
|
|
|
4384
4489
|
* Effect.runSync(task3) // => 6
|
|
4385
4490
|
* ```
|
|
4386
4491
|
*
|
|
4492
|
+
* @stability stable
|
|
4387
4493
|
* @category zipping
|
|
4388
4494
|
* @since 2.0.0
|
|
4389
4495
|
*/
|
|
@@ -4426,6 +4532,7 @@ export const zipWith: {
|
|
|
4426
4532
|
* Effect.runSync(task3) // => 6
|
|
4427
4533
|
* ```
|
|
4428
4534
|
*
|
|
4535
|
+
* @stability stable
|
|
4429
4536
|
* @category zipping
|
|
4430
4537
|
* @since 2.0.0
|
|
4431
4538
|
*/
|
|
@@ -4474,6 +4581,7 @@ export {
|
|
|
4474
4581
|
*
|
|
4475
4582
|
* @see {@link catchCause} for a version that can recover from both recoverable and unrecoverable errors.
|
|
4476
4583
|
*
|
|
4584
|
+
* @stability stable
|
|
4477
4585
|
* @category error handling
|
|
4478
4586
|
* @since 4.0.0
|
|
4479
4587
|
*/
|
|
@@ -4524,6 +4632,7 @@ export {
|
|
|
4524
4632
|
* @see {@link catchTags} for handling multiple tagged errors in one call
|
|
4525
4633
|
* @see {@link catchIf} for recovering from errors that match a predicate
|
|
4526
4634
|
*
|
|
4635
|
+
* @stability stable
|
|
4527
4636
|
* @category error handling
|
|
4528
4637
|
* @since 2.0.0
|
|
4529
4638
|
*/
|
|
@@ -4572,6 +4681,7 @@ export const catchTag: {
|
|
|
4572
4681
|
* @see {@link catchTags} for handling multiple tagged errors in one call
|
|
4573
4682
|
* @see {@link catchIf} for recovering from errors that match a predicate
|
|
4574
4683
|
*
|
|
4684
|
+
* @stability stable
|
|
4575
4685
|
* @category error handling
|
|
4576
4686
|
* @since 2.0.0
|
|
4577
4687
|
*/
|
|
@@ -4643,6 +4753,7 @@ export const catchTag: {
|
|
|
4643
4753
|
* @see {@link catchTags} for handling multiple tagged errors in one call
|
|
4644
4754
|
* @see {@link catchIf} for recovering from errors that match a predicate
|
|
4645
4755
|
*
|
|
4756
|
+
* @stability stable
|
|
4646
4757
|
* @category error handling
|
|
4647
4758
|
* @since 2.0.0
|
|
4648
4759
|
*/
|
|
@@ -4717,6 +4828,7 @@ export const catchTag: {
|
|
|
4717
4828
|
* Effect.runSync(handled) // => "Network error: 503"
|
|
4718
4829
|
* ```
|
|
4719
4830
|
*
|
|
4831
|
+
* @stability stable
|
|
4720
4832
|
* @category error handling
|
|
4721
4833
|
* @since 2.0.0
|
|
4722
4834
|
*/
|
|
@@ -4765,6 +4877,7 @@ export const catchTags: {
|
|
|
4765
4877
|
* Effect.runSync(handled) // => "Network error: 503"
|
|
4766
4878
|
* ```
|
|
4767
4879
|
*
|
|
4880
|
+
* @stability stable
|
|
4768
4881
|
* @category error handling
|
|
4769
4882
|
* @since 2.0.0
|
|
4770
4883
|
*/
|
|
@@ -4842,6 +4955,7 @@ export const catchTags: {
|
|
|
4842
4955
|
* Effect.runSync(handled) // => "Network error: 503"
|
|
4843
4956
|
* ```
|
|
4844
4957
|
*
|
|
4958
|
+
* @stability stable
|
|
4845
4959
|
* @category error handling
|
|
4846
4960
|
* @since 2.0.0
|
|
4847
4961
|
*/
|
|
@@ -4924,6 +5038,7 @@ export const catchTags: {
|
|
|
4924
5038
|
*
|
|
4925
5039
|
* @see {@link catchReasons} for handling several nested reason tags
|
|
4926
5040
|
*
|
|
5041
|
+
* @stability stable
|
|
4927
5042
|
* @category error handling
|
|
4928
5043
|
* @since 4.0.0
|
|
4929
5044
|
*/
|
|
@@ -4974,6 +5089,7 @@ export const catchReason: {
|
|
|
4974
5089
|
*
|
|
4975
5090
|
* @see {@link catchReasons} for handling several nested reason tags
|
|
4976
5091
|
*
|
|
5092
|
+
* @stability stable
|
|
4977
5093
|
* @category error handling
|
|
4978
5094
|
* @since 4.0.0
|
|
4979
5095
|
*/
|
|
@@ -5053,6 +5169,7 @@ export const catchReason: {
|
|
|
5053
5169
|
*
|
|
5054
5170
|
* @see {@link catchReasons} for handling several nested reason tags
|
|
5055
5171
|
*
|
|
5172
|
+
* @stability stable
|
|
5056
5173
|
* @category error handling
|
|
5057
5174
|
* @since 4.0.0
|
|
5058
5175
|
*/
|
|
@@ -5119,6 +5236,7 @@ export const catchReason: {
|
|
|
5119
5236
|
* Effect.runSync(handled) // => "Quota exceeded: 100"
|
|
5120
5237
|
* ```
|
|
5121
5238
|
*
|
|
5239
|
+
* @stability stable
|
|
5122
5240
|
* @category error handling
|
|
5123
5241
|
* @since 4.0.0
|
|
5124
5242
|
*/
|
|
@@ -5159,6 +5277,7 @@ export const catchReasons: {
|
|
|
5159
5277
|
* Effect.runSync(handled) // => "Quota exceeded: 100"
|
|
5160
5278
|
* ```
|
|
5161
5279
|
*
|
|
5280
|
+
* @stability stable
|
|
5162
5281
|
* @category error handling
|
|
5163
5282
|
* @since 4.0.0
|
|
5164
5283
|
*/
|
|
@@ -5239,6 +5358,7 @@ export const catchReasons: {
|
|
|
5239
5358
|
* Effect.runSync(handled) // => "Quota exceeded: 100"
|
|
5240
5359
|
* ```
|
|
5241
5360
|
*
|
|
5361
|
+
* @stability stable
|
|
5242
5362
|
* @category error handling
|
|
5243
5363
|
* @since 4.0.0
|
|
5244
5364
|
*/
|
|
@@ -5303,6 +5423,7 @@ export const catchReasons: {
|
|
|
5303
5423
|
* @see {@link catchReason} for handling one nested reason tag
|
|
5304
5424
|
* @see {@link catchReasons} for handling several nested reason tags
|
|
5305
5425
|
*
|
|
5426
|
+
* @stability stable
|
|
5306
5427
|
* @category error handling
|
|
5307
5428
|
* @since 4.0.0
|
|
5308
5429
|
*/
|
|
@@ -5341,6 +5462,7 @@ export type TagsWithReason<E> = {
|
|
|
5341
5462
|
* Effect.runSync(Effect.flip(unwrapped))._tag // => "RateLimitError"
|
|
5342
5463
|
* ```
|
|
5343
5464
|
*
|
|
5465
|
+
* @stability stable
|
|
5344
5466
|
* @category error handling
|
|
5345
5467
|
* @since 4.0.0
|
|
5346
5468
|
*/
|
|
@@ -5376,6 +5498,7 @@ export const unwrapReason: {
|
|
|
5376
5498
|
* Effect.runSync(Effect.flip(unwrapped))._tag // => "RateLimitError"
|
|
5377
5499
|
* ```
|
|
5378
5500
|
*
|
|
5501
|
+
* @stability stable
|
|
5379
5502
|
* @category error handling
|
|
5380
5503
|
* @since 4.0.0
|
|
5381
5504
|
*/
|
|
@@ -5414,6 +5537,7 @@ export const unwrapReason: {
|
|
|
5414
5537
|
* Effect.runSync(Effect.flip(unwrapped))._tag // => "RateLimitError"
|
|
5415
5538
|
* ```
|
|
5416
5539
|
*
|
|
5540
|
+
* @stability stable
|
|
5417
5541
|
* @category error handling
|
|
5418
5542
|
* @since 4.0.0
|
|
5419
5543
|
*/
|
|
@@ -5466,6 +5590,7 @@ export const unwrapReason: {
|
|
|
5466
5590
|
* output // => ["Caught defect", "Recovered from defect"]
|
|
5467
5591
|
* ```
|
|
5468
5592
|
*
|
|
5593
|
+
* @stability stable
|
|
5469
5594
|
* @category error handling
|
|
5470
5595
|
* @since 4.0.0
|
|
5471
5596
|
*/
|
|
@@ -5511,6 +5636,7 @@ export const catchCause: {
|
|
|
5511
5636
|
* output // => ["Caught defect", "Recovered from defect"]
|
|
5512
5637
|
* ```
|
|
5513
5638
|
*
|
|
5639
|
+
* @stability stable
|
|
5514
5640
|
* @category error handling
|
|
5515
5641
|
* @since 4.0.0
|
|
5516
5642
|
*/
|
|
@@ -5556,6 +5682,7 @@ export const catchCause: {
|
|
|
5556
5682
|
* output // => ["Caught defect", "Recovered from defect"]
|
|
5557
5683
|
* ```
|
|
5558
5684
|
*
|
|
5685
|
+
* @stability stable
|
|
5559
5686
|
* @category error handling
|
|
5560
5687
|
* @since 4.0.0
|
|
5561
5688
|
*/
|
|
@@ -5602,6 +5729,7 @@ export const catchCause: {
|
|
|
5602
5729
|
* output // => ["Caught defect: Unexpected error", "Recovered from defect"]
|
|
5603
5730
|
* ```
|
|
5604
5731
|
*
|
|
5732
|
+
* @stability stable
|
|
5605
5733
|
* @category error handling
|
|
5606
5734
|
* @since 4.0.0
|
|
5607
5735
|
*/
|
|
@@ -5646,6 +5774,7 @@ export const catchDefect: {
|
|
|
5646
5774
|
* output // => ["Caught defect: Unexpected error", "Recovered from defect"]
|
|
5647
5775
|
* ```
|
|
5648
5776
|
*
|
|
5777
|
+
* @stability stable
|
|
5649
5778
|
* @category error handling
|
|
5650
5779
|
* @since 4.0.0
|
|
5651
5780
|
*/
|
|
@@ -5690,6 +5819,7 @@ export const catchDefect: {
|
|
|
5690
5819
|
* output // => ["Caught defect: Unexpected error", "Recovered from defect"]
|
|
5691
5820
|
* ```
|
|
5692
5821
|
*
|
|
5822
|
+
* @stability stable
|
|
5693
5823
|
* @category error handling
|
|
5694
5824
|
* @since 4.0.0
|
|
5695
5825
|
*/
|
|
@@ -5737,6 +5867,7 @@ export const catchDefect: {
|
|
|
5737
5867
|
* Effect.runSync(Effect.all([recovered, recovered2])) // => ['missing:user-1', 'missing:user-1']
|
|
5738
5868
|
* ```
|
|
5739
5869
|
*
|
|
5870
|
+
* @stability stable
|
|
5740
5871
|
* @category error handling
|
|
5741
5872
|
* @since 2.0.0
|
|
5742
5873
|
*/
|
|
@@ -5782,6 +5913,7 @@ export const catchIf: {
|
|
|
5782
5913
|
* Effect.runSync(Effect.all([recovered, recovered2])) // => ['missing:user-1', 'missing:user-1']
|
|
5783
5914
|
* ```
|
|
5784
5915
|
*
|
|
5916
|
+
* @stability stable
|
|
5785
5917
|
* @category error handling
|
|
5786
5918
|
* @since 2.0.0
|
|
5787
5919
|
*/
|
|
@@ -5833,6 +5965,7 @@ export const catchIf: {
|
|
|
5833
5965
|
* Effect.runSync(Effect.all([recovered, recovered2])) // => ['missing:user-1', 'missing:user-1']
|
|
5834
5966
|
* ```
|
|
5835
5967
|
*
|
|
5968
|
+
* @stability stable
|
|
5836
5969
|
* @category error handling
|
|
5837
5970
|
* @since 2.0.0
|
|
5838
5971
|
*/
|
|
@@ -5884,6 +6017,7 @@ export const catchIf: {
|
|
|
5884
6017
|
* Effect.runSync(Effect.all([recovered, recovered2])) // => ['missing:user-1', 'missing:user-1']
|
|
5885
6018
|
* ```
|
|
5886
6019
|
*
|
|
6020
|
+
* @stability stable
|
|
5887
6021
|
* @category error handling
|
|
5888
6022
|
* @since 2.0.0
|
|
5889
6023
|
*/
|
|
@@ -5934,6 +6068,7 @@ export const catchIf: {
|
|
|
5934
6068
|
* Effect.runSync(Effect.all([recovered, recovered2])) // => ['missing:user-1', 'missing:user-1']
|
|
5935
6069
|
* ```
|
|
5936
6070
|
*
|
|
6071
|
+
* @stability stable
|
|
5937
6072
|
* @category error handling
|
|
5938
6073
|
* @since 2.0.0
|
|
5939
6074
|
*/
|
|
@@ -5966,6 +6101,7 @@ export const catchIf: {
|
|
|
5966
6101
|
* @see {@link catchTags} for recovering from several tagged errors
|
|
5967
6102
|
* @see {@link catchCauseFilter} for filtering full causes instead of typed errors
|
|
5968
6103
|
*
|
|
6104
|
+
* @stability stable
|
|
5969
6105
|
* @category error handling
|
|
5970
6106
|
* @since 4.0.0
|
|
5971
6107
|
*/
|
|
@@ -5991,6 +6127,7 @@ export const catchFilter: {
|
|
|
5991
6127
|
* @see {@link catchTags} for recovering from several tagged errors
|
|
5992
6128
|
* @see {@link catchCauseFilter} for filtering full causes instead of typed errors
|
|
5993
6129
|
*
|
|
6130
|
+
* @stability stable
|
|
5994
6131
|
* @category error handling
|
|
5995
6132
|
* @since 4.0.0
|
|
5996
6133
|
*/
|
|
@@ -6022,6 +6159,7 @@ export const catchFilter: {
|
|
|
6022
6159
|
* @see {@link catchTags} for recovering from several tagged errors
|
|
6023
6160
|
* @see {@link catchCauseFilter} for filtering full causes instead of typed errors
|
|
6024
6161
|
*
|
|
6162
|
+
* @stability stable
|
|
6025
6163
|
* @category error handling
|
|
6026
6164
|
* @since 4.0.0
|
|
6027
6165
|
*/
|
|
@@ -6064,6 +6202,7 @@ export const catchFilter: {
|
|
|
6064
6202
|
* @see {@link fromNullishOr} for converting nullish values into `NoSuchElementError`
|
|
6065
6203
|
* @see {@link option} for converting any failure into `Option.none`
|
|
6066
6204
|
*
|
|
6205
|
+
* @stability stable
|
|
6067
6206
|
* @category error handling
|
|
6068
6207
|
* @since 4.0.0
|
|
6069
6208
|
*/
|
|
@@ -6111,6 +6250,7 @@ export const catchNoSuchElement: <A, E, R>(
|
|
|
6111
6250
|
* @see {@link catchCauseFilter} for selecting full causes with a `Filter`
|
|
6112
6251
|
* @see {@link catchIf} for predicate-based recovery from typed errors
|
|
6113
6252
|
*
|
|
6253
|
+
* @stability stable
|
|
6114
6254
|
* @category error handling
|
|
6115
6255
|
* @since 4.0.0
|
|
6116
6256
|
*/
|
|
@@ -6155,6 +6295,7 @@ export const catchCauseIf: {
|
|
|
6155
6295
|
* @see {@link catchCauseFilter} for selecting full causes with a `Filter`
|
|
6156
6296
|
* @see {@link catchIf} for predicate-based recovery from typed errors
|
|
6157
6297
|
*
|
|
6298
|
+
* @stability stable
|
|
6158
6299
|
* @category error handling
|
|
6159
6300
|
* @since 4.0.0
|
|
6160
6301
|
*/
|
|
@@ -6202,6 +6343,7 @@ export const catchCauseIf: {
|
|
|
6202
6343
|
* @see {@link catchCauseFilter} for selecting full causes with a `Filter`
|
|
6203
6344
|
* @see {@link catchIf} for predicate-based recovery from typed errors
|
|
6204
6345
|
*
|
|
6346
|
+
* @stability stable
|
|
6205
6347
|
* @category error handling
|
|
6206
6348
|
* @since 4.0.0
|
|
6207
6349
|
*/
|
|
@@ -6231,6 +6373,7 @@ export const catchCauseIf: {
|
|
|
6231
6373
|
* @see {@link catchFilter} for filtering typed error values instead of full causes
|
|
6232
6374
|
* @see {@link catchCause} for recovering from every cause without filtering
|
|
6233
6375
|
*
|
|
6376
|
+
* @stability stable
|
|
6234
6377
|
* @category error handling
|
|
6235
6378
|
* @since 4.0.0
|
|
6236
6379
|
*/
|
|
@@ -6254,6 +6397,7 @@ export const catchCauseFilter: {
|
|
|
6254
6397
|
* @see {@link catchFilter} for filtering typed error values instead of full causes
|
|
6255
6398
|
* @see {@link catchCause} for recovering from every cause without filtering
|
|
6256
6399
|
*
|
|
6400
|
+
* @stability stable
|
|
6257
6401
|
* @category error handling
|
|
6258
6402
|
* @since 4.0.0
|
|
6259
6403
|
*/
|
|
@@ -6280,6 +6424,7 @@ export const catchCauseFilter: {
|
|
|
6280
6424
|
* @see {@link catchFilter} for filtering typed error values instead of full causes
|
|
6281
6425
|
* @see {@link catchCause} for recovering from every cause without filtering
|
|
6282
6426
|
*
|
|
6427
|
+
* @stability stable
|
|
6283
6428
|
* @category error handling
|
|
6284
6429
|
* @since 4.0.0
|
|
6285
6430
|
*/
|
|
@@ -6326,6 +6471,7 @@ export const catchCauseFilter: {
|
|
|
6326
6471
|
* @see {@link map} for a version that operates on the success channel.
|
|
6327
6472
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
6328
6473
|
*
|
|
6474
|
+
* @stability stable
|
|
6329
6475
|
* @category error handling
|
|
6330
6476
|
* @since 2.0.0
|
|
6331
6477
|
*/
|
|
@@ -6366,6 +6512,7 @@ export const mapError: {
|
|
|
6366
6512
|
* @see {@link map} for a version that operates on the success channel.
|
|
6367
6513
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
6368
6514
|
*
|
|
6515
|
+
* @stability stable
|
|
6369
6516
|
* @category error handling
|
|
6370
6517
|
* @since 2.0.0
|
|
6371
6518
|
*/
|
|
@@ -6406,6 +6553,7 @@ export const mapError: {
|
|
|
6406
6553
|
* @see {@link map} for a version that operates on the success channel.
|
|
6407
6554
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
6408
6555
|
*
|
|
6556
|
+
* @stability stable
|
|
6409
6557
|
* @category error handling
|
|
6410
6558
|
* @since 2.0.0
|
|
6411
6559
|
*/
|
|
@@ -6450,6 +6598,7 @@ export const mapError: {
|
|
|
6450
6598
|
* @see {@link map} for a version that operates on the success channel.
|
|
6451
6599
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
6452
6600
|
*
|
|
6601
|
+
* @stability stable
|
|
6453
6602
|
* @category mapping
|
|
6454
6603
|
* @since 2.0.0
|
|
6455
6604
|
*/
|
|
@@ -6492,6 +6641,7 @@ export const mapBoth: {
|
|
|
6492
6641
|
* @see {@link map} for a version that operates on the success channel.
|
|
6493
6642
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
6494
6643
|
*
|
|
6644
|
+
* @stability stable
|
|
6495
6645
|
* @category mapping
|
|
6496
6646
|
* @since 2.0.0
|
|
6497
6647
|
*/
|
|
@@ -6536,6 +6686,7 @@ export const mapBoth: {
|
|
|
6536
6686
|
* @see {@link map} for a version that operates on the success channel.
|
|
6537
6687
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
6538
6688
|
*
|
|
6689
|
+
* @stability stable
|
|
6539
6690
|
* @category mapping
|
|
6540
6691
|
* @since 2.0.0
|
|
6541
6692
|
*/
|
|
@@ -6573,6 +6724,7 @@ export const mapBoth: {
|
|
|
6573
6724
|
* Effect.runSyncExit(program) // => Exit.die(new DivideByZeroError())
|
|
6574
6725
|
* ```
|
|
6575
6726
|
*
|
|
6727
|
+
* @stability stable
|
|
6576
6728
|
* @category error handling
|
|
6577
6729
|
* @since 2.0.0
|
|
6578
6730
|
*/
|
|
@@ -6607,6 +6759,7 @@ export const orDie: <A, E, R>(self: Effect<A, E, R>) => Effect<A, never, R> = in
|
|
|
6607
6759
|
* output // => ["expected error: NetworkError", Exit.fail("NetworkError")]
|
|
6608
6760
|
* ```
|
|
6609
6761
|
*
|
|
6762
|
+
* @stability stable
|
|
6610
6763
|
* @category error handling
|
|
6611
6764
|
* @since 2.0.0
|
|
6612
6765
|
*/
|
|
@@ -6640,6 +6793,7 @@ export const tapError: {
|
|
|
6640
6793
|
* output // => ["expected error: NetworkError", Exit.fail("NetworkError")]
|
|
6641
6794
|
* ```
|
|
6642
6795
|
*
|
|
6796
|
+
* @stability stable
|
|
6643
6797
|
* @category error handling
|
|
6644
6798
|
* @since 2.0.0
|
|
6645
6799
|
*/
|
|
@@ -6673,6 +6827,7 @@ export const tapError: {
|
|
|
6673
6827
|
* output // => ["expected error: NetworkError", Exit.fail("NetworkError")]
|
|
6674
6828
|
* ```
|
|
6675
6829
|
*
|
|
6830
|
+
* @stability stable
|
|
6676
6831
|
* @category error handling
|
|
6677
6832
|
* @since 2.0.0
|
|
6678
6833
|
*/
|
|
@@ -6713,6 +6868,7 @@ export const tapError: {
|
|
|
6713
6868
|
* output // => ["expected error: 504", Exit.fail(new NetworkError({ statusCode: 504 }))]
|
|
6714
6869
|
* ```
|
|
6715
6870
|
*
|
|
6871
|
+
* @stability stable
|
|
6716
6872
|
* @category error handling
|
|
6717
6873
|
* @since 2.0.0
|
|
6718
6874
|
*/
|
|
@@ -6751,6 +6907,7 @@ export const tapErrorTag: {
|
|
|
6751
6907
|
* output // => ["expected error: 504", Exit.fail(new NetworkError({ statusCode: 504 }))]
|
|
6752
6908
|
* ```
|
|
6753
6909
|
*
|
|
6910
|
+
* @stability stable
|
|
6754
6911
|
* @category error handling
|
|
6755
6912
|
* @since 2.0.0
|
|
6756
6913
|
*/
|
|
@@ -6792,6 +6949,7 @@ export const tapErrorTag: {
|
|
|
6792
6949
|
* output // => ["expected error: 504", Exit.fail(new NetworkError({ statusCode: 504 }))]
|
|
6793
6950
|
* ```
|
|
6794
6951
|
*
|
|
6952
|
+
* @stability stable
|
|
6795
6953
|
* @category error handling
|
|
6796
6954
|
* @since 2.0.0
|
|
6797
6955
|
*/
|
|
@@ -6842,6 +7000,7 @@ export const tapErrorTag: {
|
|
|
6842
7000
|
* output // => ["Logging cause: Something went wrong", Exit.fail("Something went wrong")]
|
|
6843
7001
|
* ```
|
|
6844
7002
|
*
|
|
7003
|
+
* @stability stable
|
|
6845
7004
|
* @category error handling
|
|
6846
7005
|
* @since 4.0.0
|
|
6847
7006
|
*/
|
|
@@ -6878,6 +7037,7 @@ export const tapCause: {
|
|
|
6878
7037
|
* output // => ["Logging cause: Something went wrong", Exit.fail("Something went wrong")]
|
|
6879
7038
|
* ```
|
|
6880
7039
|
*
|
|
7040
|
+
* @stability stable
|
|
6881
7041
|
* @category error handling
|
|
6882
7042
|
* @since 4.0.0
|
|
6883
7043
|
*/
|
|
@@ -6914,6 +7074,7 @@ export const tapCause: {
|
|
|
6914
7074
|
* output // => ["Logging cause: Something went wrong", Exit.fail("Something went wrong")]
|
|
6915
7075
|
* ```
|
|
6916
7076
|
*
|
|
7077
|
+
* @stability stable
|
|
6917
7078
|
* @category error handling
|
|
6918
7079
|
* @since 4.0.0
|
|
6919
7080
|
*/
|
|
@@ -6948,6 +7109,7 @@ export const tapCause: {
|
|
|
6948
7109
|
* output // => ["Logging failure cause: Network timeout", Exit.fail("Network timeout")]
|
|
6949
7110
|
* ```
|
|
6950
7111
|
*
|
|
7112
|
+
* @stability stable
|
|
6951
7113
|
* @category error handling
|
|
6952
7114
|
* @since 4.0.0
|
|
6953
7115
|
*/
|
|
@@ -6980,6 +7142,7 @@ export const tapCauseIf: {
|
|
|
6980
7142
|
* output // => ["Logging failure cause: Network timeout", Exit.fail("Network timeout")]
|
|
6981
7143
|
* ```
|
|
6982
7144
|
*
|
|
7145
|
+
* @stability stable
|
|
6983
7146
|
* @category error handling
|
|
6984
7147
|
* @since 4.0.0
|
|
6985
7148
|
*/
|
|
@@ -7015,6 +7178,7 @@ export const tapCauseIf: {
|
|
|
7015
7178
|
* output // => ["Logging failure cause: Network timeout", Exit.fail("Network timeout")]
|
|
7016
7179
|
* ```
|
|
7017
7180
|
*
|
|
7181
|
+
* @stability stable
|
|
7018
7182
|
* @category error handling
|
|
7019
7183
|
* @since 4.0.0
|
|
7020
7184
|
*/
|
|
@@ -7044,6 +7208,7 @@ export const tapCauseIf: {
|
|
|
7044
7208
|
* @see {@link tapCause} for observing every failure cause
|
|
7045
7209
|
* @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
|
|
7046
7210
|
*
|
|
7211
|
+
* @stability stable
|
|
7047
7212
|
* @category error handling
|
|
7048
7213
|
* @since 4.0.0
|
|
7049
7214
|
*/
|
|
@@ -7067,6 +7232,7 @@ export const tapCauseFilter: {
|
|
|
7067
7232
|
* @see {@link tapCause} for observing every failure cause
|
|
7068
7233
|
* @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
|
|
7069
7234
|
*
|
|
7235
|
+
* @stability stable
|
|
7070
7236
|
* @category error handling
|
|
7071
7237
|
* @since 4.0.0
|
|
7072
7238
|
*/
|
|
@@ -7093,6 +7259,7 @@ export const tapCauseFilter: {
|
|
|
7093
7259
|
* @see {@link tapCause} for observing every failure cause
|
|
7094
7260
|
* @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
|
|
7095
7261
|
*
|
|
7262
|
+
* @stability stable
|
|
7096
7263
|
* @category error handling
|
|
7097
7264
|
* @since 4.0.0
|
|
7098
7265
|
*/
|
|
@@ -7134,6 +7301,7 @@ export const tapCauseFilter: {
|
|
|
7134
7301
|
* output // => ["defect: Something went wrong", Exit.die("Something went wrong")]
|
|
7135
7302
|
* ```
|
|
7136
7303
|
*
|
|
7304
|
+
* @stability stable
|
|
7137
7305
|
* @category error handling
|
|
7138
7306
|
* @since 2.0.0
|
|
7139
7307
|
*/
|
|
@@ -7169,6 +7337,7 @@ export const tapDefect: {
|
|
|
7169
7337
|
* output // => ["defect: Something went wrong", Exit.die("Something went wrong")]
|
|
7170
7338
|
* ```
|
|
7171
7339
|
*
|
|
7340
|
+
* @stability stable
|
|
7172
7341
|
* @category error handling
|
|
7173
7342
|
* @since 2.0.0
|
|
7174
7343
|
*/
|
|
@@ -7204,6 +7373,7 @@ export const tapDefect: {
|
|
|
7204
7373
|
* output // => ["defect: Something went wrong", Exit.die("Something went wrong")]
|
|
7205
7374
|
* ```
|
|
7206
7375
|
*
|
|
7376
|
+
* @stability stable
|
|
7207
7377
|
* @category error handling
|
|
7208
7378
|
* @since 2.0.0
|
|
7209
7379
|
*/
|
|
@@ -7240,6 +7410,7 @@ export const tapDefect: {
|
|
|
7240
7410
|
* output // => ["Attempt 1", "Attempt 2", "Attempt 3", "Ready"]
|
|
7241
7411
|
* ```
|
|
7242
7412
|
*
|
|
7413
|
+
* @stability stable
|
|
7243
7414
|
* @category repetition
|
|
7244
7415
|
* @since 2.0.0
|
|
7245
7416
|
*/
|
|
@@ -7252,6 +7423,7 @@ export const eventually: <A, E, R>(self: Effect<A, E, R>) => Effect<A, never, R>
|
|
|
7252
7423
|
/**
|
|
7253
7424
|
* Type helpers for retrying effects.
|
|
7254
7425
|
*
|
|
7426
|
+
* @stability stable
|
|
7255
7427
|
* @category error handling
|
|
7256
7428
|
* @since 2.0.0
|
|
7257
7429
|
*/
|
|
@@ -7347,6 +7519,7 @@ export declare namespace Retry {
|
|
|
7347
7519
|
*
|
|
7348
7520
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7349
7521
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7522
|
+
* @stability stable
|
|
7350
7523
|
* @category error handling
|
|
7351
7524
|
* @since 2.0.0
|
|
7352
7525
|
*/
|
|
@@ -7399,6 +7572,7 @@ export const retry: {
|
|
|
7399
7572
|
*
|
|
7400
7573
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7401
7574
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7575
|
+
* @stability stable
|
|
7402
7576
|
* @category error handling
|
|
7403
7577
|
* @since 2.0.0
|
|
7404
7578
|
*/
|
|
@@ -7451,6 +7625,7 @@ export const retry: {
|
|
|
7451
7625
|
*
|
|
7452
7626
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7453
7627
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7628
|
+
* @stability stable
|
|
7454
7629
|
* @category error handling
|
|
7455
7630
|
* @since 2.0.0
|
|
7456
7631
|
*/
|
|
@@ -7503,6 +7678,7 @@ export const retry: {
|
|
|
7503
7678
|
*
|
|
7504
7679
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7505
7680
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7681
|
+
* @stability stable
|
|
7506
7682
|
* @category error handling
|
|
7507
7683
|
* @since 2.0.0
|
|
7508
7684
|
*/
|
|
@@ -7559,6 +7735,7 @@ export const retry: {
|
|
|
7559
7735
|
*
|
|
7560
7736
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7561
7737
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7738
|
+
* @stability stable
|
|
7562
7739
|
* @category error handling
|
|
7563
7740
|
* @since 2.0.0
|
|
7564
7741
|
*/
|
|
@@ -7611,6 +7788,7 @@ export const retry: {
|
|
|
7611
7788
|
*
|
|
7612
7789
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7613
7790
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7791
|
+
* @stability stable
|
|
7614
7792
|
* @category error handling
|
|
7615
7793
|
* @since 2.0.0
|
|
7616
7794
|
*/
|
|
@@ -7663,6 +7841,7 @@ export const retry: {
|
|
|
7663
7841
|
*
|
|
7664
7842
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
7665
7843
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
7844
|
+
* @stability stable
|
|
7666
7845
|
* @category error handling
|
|
7667
7846
|
* @since 2.0.0
|
|
7668
7847
|
*/
|
|
@@ -7724,6 +7903,7 @@ export const retry: {
|
|
|
7724
7903
|
* ```
|
|
7725
7904
|
*
|
|
7726
7905
|
* @see {@link retry} for a version that does not run a fallback effect.
|
|
7906
|
+
* @stability stable
|
|
7727
7907
|
* @category error handling
|
|
7728
7908
|
* @since 2.0.0
|
|
7729
7909
|
*/
|
|
@@ -7778,6 +7958,7 @@ export const retryOrElse: {
|
|
|
7778
7958
|
* ```
|
|
7779
7959
|
*
|
|
7780
7960
|
* @see {@link retry} for a version that does not run a fallback effect.
|
|
7961
|
+
* @stability stable
|
|
7781
7962
|
* @category error handling
|
|
7782
7963
|
* @since 2.0.0
|
|
7783
7964
|
*/
|
|
@@ -7835,6 +8016,7 @@ export const retryOrElse: {
|
|
|
7835
8016
|
* ```
|
|
7836
8017
|
*
|
|
7837
8018
|
* @see {@link retry} for a version that does not run a fallback effect.
|
|
8019
|
+
* @stability stable
|
|
7838
8020
|
* @category error handling
|
|
7839
8021
|
* @since 2.0.0
|
|
7840
8022
|
*/
|
|
@@ -7870,6 +8052,7 @@ export const retryOrElse: {
|
|
|
7870
8052
|
* Effect.runSync(program) // => "Caught cause: Something went wrong"
|
|
7871
8053
|
* ```
|
|
7872
8054
|
*
|
|
8055
|
+
* @stability stable
|
|
7873
8056
|
* @category error handling
|
|
7874
8057
|
* @since 2.0.0
|
|
7875
8058
|
*/
|
|
@@ -7916,6 +8099,7 @@ export const sandbox: <A, E, R>(
|
|
|
7916
8099
|
* Effect.runSync(program) // => undefined
|
|
7917
8100
|
* ```
|
|
7918
8101
|
*
|
|
8102
|
+
* @stability stable
|
|
7919
8103
|
* @category error handling
|
|
7920
8104
|
* @since 2.0.0
|
|
7921
8105
|
*/
|
|
@@ -7960,6 +8144,7 @@ export const ignore: <
|
|
|
7960
8144
|
* Effect.runSync(program) // => undefined
|
|
7961
8145
|
* ```
|
|
7962
8146
|
*
|
|
8147
|
+
* @stability stable
|
|
7963
8148
|
* @category error handling
|
|
7964
8149
|
* @since 4.0.0
|
|
7965
8150
|
*/
|
|
@@ -8052,6 +8237,7 @@ export const ignoreCause: <
|
|
|
8052
8237
|
* events // => ["AttemptStart:0", "AttemptFailure:0", "AttemptStart:1", "AttemptSuccess:1"]
|
|
8053
8238
|
* ```
|
|
8054
8239
|
*
|
|
8240
|
+
* @stability unstable
|
|
8055
8241
|
* @category error handling
|
|
8056
8242
|
* @since 3.16.0
|
|
8057
8243
|
*/
|
|
@@ -8128,6 +8314,7 @@ export const withExecutionPlan: {
|
|
|
8128
8314
|
* events // => ["AttemptStart:0", "AttemptFailure:0", "AttemptStart:1", "AttemptSuccess:1"]
|
|
8129
8315
|
* ```
|
|
8130
8316
|
*
|
|
8317
|
+
* @stability unstable
|
|
8131
8318
|
* @category error handling
|
|
8132
8319
|
* @since 3.16.0
|
|
8133
8320
|
*/
|
|
@@ -8211,6 +8398,7 @@ export const withExecutionPlan: {
|
|
|
8211
8398
|
* events // => ["AttemptStart:0", "AttemptFailure:0", "AttemptStart:1", "AttemptSuccess:1"]
|
|
8212
8399
|
* ```
|
|
8213
8400
|
*
|
|
8401
|
+
* @stability unstable
|
|
8214
8402
|
* @category error handling
|
|
8215
8403
|
* @since 3.16.0
|
|
8216
8404
|
*/
|
|
@@ -8231,6 +8419,7 @@ export const withExecutionPlan: {
|
|
|
8231
8419
|
* If the `defectsOnly` option is set to `true`, only defects (unrecoverable
|
|
8232
8420
|
* errors) will be reported, while regular failures will be ignored.
|
|
8233
8421
|
*
|
|
8422
|
+
* @stability unstable
|
|
8234
8423
|
* @category error handling
|
|
8235
8424
|
* @since 4.0.0
|
|
8236
8425
|
*/
|
|
@@ -8280,6 +8469,7 @@ export const withErrorReporting: <
|
|
|
8280
8469
|
* Effect.runSyncExit(program) // => Exit.succeed(0)
|
|
8281
8470
|
* ```
|
|
8282
8471
|
*
|
|
8472
|
+
* @stability stable
|
|
8283
8473
|
* @category error handling
|
|
8284
8474
|
* @since 2.0.0
|
|
8285
8475
|
*/
|
|
@@ -8320,6 +8510,7 @@ export const orElseSucceed: {
|
|
|
8320
8510
|
* Effect.runSyncExit(program) // => Exit.succeed(0)
|
|
8321
8511
|
* ```
|
|
8322
8512
|
*
|
|
8513
|
+
* @stability stable
|
|
8323
8514
|
* @category error handling
|
|
8324
8515
|
* @since 2.0.0
|
|
8325
8516
|
*/
|
|
@@ -8360,6 +8551,7 @@ export const orElseSucceed: {
|
|
|
8360
8551
|
* Effect.runSyncExit(program) // => Exit.succeed(0)
|
|
8361
8552
|
* ```
|
|
8362
8553
|
*
|
|
8554
|
+
* @stability stable
|
|
8363
8555
|
* @category error handling
|
|
8364
8556
|
* @since 2.0.0
|
|
8365
8557
|
*/
|
|
@@ -8406,6 +8598,7 @@ export const orElseSucceed: {
|
|
|
8406
8598
|
* Effect.runSync(program) // => "secondary result"
|
|
8407
8599
|
* ```
|
|
8408
8600
|
*
|
|
8601
|
+
* @stability stable
|
|
8409
8602
|
* @category error handling
|
|
8410
8603
|
* @since 2.0.0
|
|
8411
8604
|
*/
|
|
@@ -8451,6 +8644,7 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
|
|
|
8451
8644
|
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
8452
8645
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
8453
8646
|
*
|
|
8647
|
+
* @stability stable
|
|
8454
8648
|
* @category delays & timeouts
|
|
8455
8649
|
* @since 2.0.0
|
|
8456
8650
|
*/
|
|
@@ -8493,6 +8687,7 @@ export const timeout: {
|
|
|
8493
8687
|
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
8494
8688
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
8495
8689
|
*
|
|
8690
|
+
* @stability stable
|
|
8496
8691
|
* @category delays & timeouts
|
|
8497
8692
|
* @since 2.0.0
|
|
8498
8693
|
*/
|
|
@@ -8535,6 +8730,7 @@ export const timeout: {
|
|
|
8535
8730
|
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
8536
8731
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
8537
8732
|
*
|
|
8733
|
+
* @stability stable
|
|
8538
8734
|
* @category delays & timeouts
|
|
8539
8735
|
* @since 2.0.0
|
|
8540
8736
|
*/
|
|
@@ -8568,6 +8764,7 @@ export const timeout: {
|
|
|
8568
8764
|
* @see {@link timeout} for a version that raises a `TimeoutError`.
|
|
8569
8765
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
8570
8766
|
*
|
|
8767
|
+
* @stability stable
|
|
8571
8768
|
* @category delays & timeouts
|
|
8572
8769
|
* @since 3.1.0
|
|
8573
8770
|
*/
|
|
@@ -8599,6 +8796,7 @@ export const timeoutOption: {
|
|
|
8599
8796
|
* @see {@link timeout} for a version that raises a `TimeoutError`.
|
|
8600
8797
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
8601
8798
|
*
|
|
8799
|
+
* @stability stable
|
|
8602
8800
|
* @category delays & timeouts
|
|
8603
8801
|
* @since 3.1.0
|
|
8604
8802
|
*/
|
|
@@ -8630,6 +8828,7 @@ export const timeoutOption: {
|
|
|
8630
8828
|
* @see {@link timeout} for a version that raises a `TimeoutError`.
|
|
8631
8829
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
8632
8830
|
*
|
|
8831
|
+
* @stability stable
|
|
8633
8832
|
* @category delays & timeouts
|
|
8634
8833
|
* @since 3.1.0
|
|
8635
8834
|
*/
|
|
@@ -8660,6 +8859,7 @@ export const timeoutOption: {
|
|
|
8660
8859
|
* @see {@link timeout} for failing with a `TimeoutError`.
|
|
8661
8860
|
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
8662
8861
|
*
|
|
8862
|
+
* @stability stable
|
|
8663
8863
|
* @category delays & timeouts
|
|
8664
8864
|
* @since 4.0.0
|
|
8665
8865
|
*/
|
|
@@ -8688,6 +8888,7 @@ export const timeoutOrElse: {
|
|
|
8688
8888
|
* @see {@link timeout} for failing with a `TimeoutError`.
|
|
8689
8889
|
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
8690
8890
|
*
|
|
8891
|
+
* @stability stable
|
|
8691
8892
|
* @category delays & timeouts
|
|
8692
8893
|
* @since 4.0.0
|
|
8693
8894
|
*/
|
|
@@ -8721,6 +8922,7 @@ export const timeoutOrElse: {
|
|
|
8721
8922
|
* @see {@link timeout} for failing with a `TimeoutError`.
|
|
8722
8923
|
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
8723
8924
|
*
|
|
8925
|
+
* @stability stable
|
|
8724
8926
|
* @category delays & timeouts
|
|
8725
8927
|
* @since 4.0.0
|
|
8726
8928
|
*/
|
|
@@ -8749,6 +8951,7 @@ export const timeoutOrElse: {
|
|
|
8749
8951
|
* output // => ["Delayed message"]
|
|
8750
8952
|
* ```
|
|
8751
8953
|
*
|
|
8954
|
+
* @stability stable
|
|
8752
8955
|
* @category delays & timeouts
|
|
8753
8956
|
* @since 2.0.0
|
|
8754
8957
|
*/
|
|
@@ -8769,6 +8972,7 @@ export const delay: {
|
|
|
8769
8972
|
* output // => ["Delayed message"]
|
|
8770
8973
|
* ```
|
|
8771
8974
|
*
|
|
8975
|
+
* @stability stable
|
|
8772
8976
|
* @category delays & timeouts
|
|
8773
8977
|
* @since 2.0.0
|
|
8774
8978
|
*/
|
|
@@ -8789,6 +8993,7 @@ export const delay: {
|
|
|
8789
8993
|
* output // => ["Delayed message"]
|
|
8790
8994
|
* ```
|
|
8791
8995
|
*
|
|
8996
|
+
* @stability stable
|
|
8792
8997
|
* @category delays & timeouts
|
|
8793
8998
|
* @since 2.0.0
|
|
8794
8999
|
*/
|
|
@@ -8815,6 +9020,7 @@ export const delay: {
|
|
|
8815
9020
|
* output // => ["Start", "End"]
|
|
8816
9021
|
* ```
|
|
8817
9022
|
*
|
|
9023
|
+
* @stability stable
|
|
8818
9024
|
* @category delays & timeouts
|
|
8819
9025
|
* @since 2.0.0
|
|
8820
9026
|
*/
|
|
@@ -8841,6 +9047,7 @@ export const sleep: (duration: Duration.Input) => Effect<void> = internal.sleep
|
|
|
8841
9047
|
* Effect.runSync(program) // => "ok"
|
|
8842
9048
|
* ```
|
|
8843
9049
|
*
|
|
9050
|
+
* @stability stable
|
|
8844
9051
|
* @category delays & timeouts
|
|
8845
9052
|
* @since 2.0.0
|
|
8846
9053
|
*/
|
|
@@ -8879,6 +9086,7 @@ export const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration: Durati
|
|
|
8879
9086
|
* ```
|
|
8880
9087
|
*
|
|
8881
9088
|
* @see {@link race} for a version that handles only two effects.
|
|
9089
|
+
* @stability stable
|
|
8882
9090
|
* @category racing
|
|
8883
9091
|
* @since 2.0.0
|
|
8884
9092
|
*/
|
|
@@ -8915,6 +9123,7 @@ export const raceAll: <Eff extends Effect<any, any, any>>(
|
|
|
8915
9123
|
* await Effect.runPromise(Effect.flip(raced)) // => "First failed"
|
|
8916
9124
|
* ```
|
|
8917
9125
|
*
|
|
9126
|
+
* @stability stable
|
|
8918
9127
|
* @category racing
|
|
8919
9128
|
* @since 4.0.0
|
|
8920
9129
|
*/
|
|
@@ -8955,6 +9164,7 @@ export const raceAllFirst: <Eff extends Effect<any, any, any>>(
|
|
|
8955
9164
|
* output // => ["winner: slow-success"]
|
|
8956
9165
|
* ```
|
|
8957
9166
|
*
|
|
9167
|
+
* @stability stable
|
|
8958
9168
|
* @category racing
|
|
8959
9169
|
* @since 2.0.0
|
|
8960
9170
|
*/
|
|
@@ -8985,6 +9195,7 @@ export const race: {
|
|
|
8985
9195
|
* output // => ["winner: slow-success"]
|
|
8986
9196
|
* ```
|
|
8987
9197
|
*
|
|
9198
|
+
* @stability stable
|
|
8988
9199
|
* @category racing
|
|
8989
9200
|
* @since 2.0.0
|
|
8990
9201
|
*/
|
|
@@ -9022,6 +9233,7 @@ export const race: {
|
|
|
9022
9233
|
* output // => ["winner: slow-success"]
|
|
9023
9234
|
* ```
|
|
9024
9235
|
*
|
|
9236
|
+
* @stability stable
|
|
9025
9237
|
* @category racing
|
|
9026
9238
|
* @since 2.0.0
|
|
9027
9239
|
*/
|
|
@@ -9070,6 +9282,7 @@ export const race: {
|
|
|
9070
9282
|
* output // => ["failed: fast-fail"]
|
|
9071
9283
|
* ```
|
|
9072
9284
|
*
|
|
9285
|
+
* @stability stable
|
|
9073
9286
|
* @category racing
|
|
9074
9287
|
* @since 2.0.0
|
|
9075
9288
|
*/
|
|
@@ -9108,6 +9321,7 @@ export const raceFirst: {
|
|
|
9108
9321
|
* output // => ["failed: fast-fail"]
|
|
9109
9322
|
* ```
|
|
9110
9323
|
*
|
|
9324
|
+
* @stability stable
|
|
9111
9325
|
* @category racing
|
|
9112
9326
|
* @since 2.0.0
|
|
9113
9327
|
*/
|
|
@@ -9153,6 +9367,7 @@ export const raceFirst: {
|
|
|
9153
9367
|
* output // => ["failed: fast-fail"]
|
|
9154
9368
|
* ```
|
|
9155
9369
|
*
|
|
9370
|
+
* @stability stable
|
|
9156
9371
|
* @category racing
|
|
9157
9372
|
* @since 2.0.0
|
|
9158
9373
|
*/
|
|
@@ -9192,6 +9407,7 @@ export const raceFirst: {
|
|
|
9192
9407
|
* output // => [[2, 4], [2, 3]]
|
|
9193
9408
|
* ```
|
|
9194
9409
|
*
|
|
9410
|
+
* @stability stable
|
|
9195
9411
|
* @category collecting
|
|
9196
9412
|
* @since 2.0.0
|
|
9197
9413
|
*/
|
|
@@ -9221,6 +9437,7 @@ export const filter: {
|
|
|
9221
9437
|
* output // => [[2, 4], [2, 3]]
|
|
9222
9438
|
* ```
|
|
9223
9439
|
*
|
|
9440
|
+
* @stability stable
|
|
9224
9441
|
* @category collecting
|
|
9225
9442
|
* @since 2.0.0
|
|
9226
9443
|
*/
|
|
@@ -9250,6 +9467,7 @@ export const filter: {
|
|
|
9250
9467
|
* output // => [[2, 4], [2, 3]]
|
|
9251
9468
|
* ```
|
|
9252
9469
|
*
|
|
9470
|
+
* @stability stable
|
|
9253
9471
|
* @category collecting
|
|
9254
9472
|
* @since 2.0.0
|
|
9255
9473
|
*/
|
|
@@ -9279,6 +9497,7 @@ export const filter: {
|
|
|
9279
9497
|
* output // => [[2, 4], [2, 3]]
|
|
9280
9498
|
* ```
|
|
9281
9499
|
*
|
|
9500
|
+
* @stability stable
|
|
9282
9501
|
* @category collecting
|
|
9283
9502
|
* @since 2.0.0
|
|
9284
9503
|
*/
|
|
@@ -9311,6 +9530,7 @@ export const filter: {
|
|
|
9311
9530
|
* output // => [[2, 4], [2, 3]]
|
|
9312
9531
|
* ```
|
|
9313
9532
|
*
|
|
9533
|
+
* @stability stable
|
|
9314
9534
|
* @category collecting
|
|
9315
9535
|
* @since 2.0.0
|
|
9316
9536
|
*/
|
|
@@ -9340,6 +9560,7 @@ export const filter: {
|
|
|
9340
9560
|
* output // => [[2, 4], [2, 3]]
|
|
9341
9561
|
* ```
|
|
9342
9562
|
*
|
|
9563
|
+
* @stability stable
|
|
9343
9564
|
* @category collecting
|
|
9344
9565
|
* @since 2.0.0
|
|
9345
9566
|
*/
|
|
@@ -9369,6 +9590,7 @@ export const filter: {
|
|
|
9369
9590
|
* output // => [[2, 4], [2, 3]]
|
|
9370
9591
|
* ```
|
|
9371
9592
|
*
|
|
9593
|
+
* @stability stable
|
|
9372
9594
|
* @category collecting
|
|
9373
9595
|
* @since 2.0.0
|
|
9374
9596
|
*/
|
|
@@ -9395,6 +9617,7 @@ export const filter: {
|
|
|
9395
9617
|
* @see {@link filter} for keeping original elements with a boolean predicate, refinement, or effectful predicate
|
|
9396
9618
|
* @see {@link filterMapEffect} for using an effectful `Filter`
|
|
9397
9619
|
*
|
|
9620
|
+
* @stability stable
|
|
9398
9621
|
* @category collecting
|
|
9399
9622
|
* @since 2.0.0
|
|
9400
9623
|
*/
|
|
@@ -9415,6 +9638,7 @@ export const filterMap: {
|
|
|
9415
9638
|
* @see {@link filter} for keeping original elements with a boolean predicate, refinement, or effectful predicate
|
|
9416
9639
|
* @see {@link filterMapEffect} for using an effectful `Filter`
|
|
9417
9640
|
*
|
|
9641
|
+
* @stability stable
|
|
9418
9642
|
* @category collecting
|
|
9419
9643
|
* @since 2.0.0
|
|
9420
9644
|
*/
|
|
@@ -9435,6 +9659,7 @@ export const filterMap: {
|
|
|
9435
9659
|
* @see {@link filter} for keeping original elements with a boolean predicate, refinement, or effectful predicate
|
|
9436
9660
|
* @see {@link filterMapEffect} for using an effectful `Filter`
|
|
9437
9661
|
*
|
|
9662
|
+
* @stability stable
|
|
9438
9663
|
* @category collecting
|
|
9439
9664
|
* @since 2.0.0
|
|
9440
9665
|
*/
|
|
@@ -9462,6 +9687,7 @@ export const filterMap: {
|
|
|
9462
9687
|
* @see {@link filterMap} for using a synchronous `Filter`
|
|
9463
9688
|
* @see {@link filter} for keeping original elements with a predicate
|
|
9464
9689
|
*
|
|
9690
|
+
* @stability stable
|
|
9465
9691
|
* @category collecting
|
|
9466
9692
|
* @since 4.0.0
|
|
9467
9693
|
*/
|
|
@@ -9487,6 +9713,7 @@ export const filterMapEffect: {
|
|
|
9487
9713
|
* @see {@link filterMap} for using a synchronous `Filter`
|
|
9488
9714
|
* @see {@link filter} for keeping original elements with a predicate
|
|
9489
9715
|
*
|
|
9716
|
+
* @stability stable
|
|
9490
9717
|
* @category collecting
|
|
9491
9718
|
* @since 4.0.0
|
|
9492
9719
|
*/
|
|
@@ -9515,6 +9742,7 @@ export const filterMapEffect: {
|
|
|
9515
9742
|
* @see {@link filterMap} for using a synchronous `Filter`
|
|
9516
9743
|
* @see {@link filter} for keeping original elements with a predicate
|
|
9517
9744
|
*
|
|
9745
|
+
* @stability stable
|
|
9518
9746
|
* @category collecting
|
|
9519
9747
|
* @since 4.0.0
|
|
9520
9748
|
*/
|
|
@@ -9558,6 +9786,7 @@ export const filterMapEffect: {
|
|
|
9558
9786
|
* Effect.runSync(filtered) // => "Number 5 is odd"
|
|
9559
9787
|
* ```
|
|
9560
9788
|
*
|
|
9789
|
+
* @stability stable
|
|
9561
9790
|
* @category filtering
|
|
9562
9791
|
* @since 2.0.0
|
|
9563
9792
|
*/
|
|
@@ -9595,6 +9824,7 @@ export const filterOrElse: {
|
|
|
9595
9824
|
* Effect.runSync(filtered) // => "Number 5 is odd"
|
|
9596
9825
|
* ```
|
|
9597
9826
|
*
|
|
9827
|
+
* @stability stable
|
|
9598
9828
|
* @category filtering
|
|
9599
9829
|
* @since 2.0.0
|
|
9600
9830
|
*/
|
|
@@ -9635,6 +9865,7 @@ export const filterOrElse: {
|
|
|
9635
9865
|
* Effect.runSync(filtered) // => "Number 5 is odd"
|
|
9636
9866
|
* ```
|
|
9637
9867
|
*
|
|
9868
|
+
* @stability stable
|
|
9638
9869
|
* @category filtering
|
|
9639
9870
|
* @since 2.0.0
|
|
9640
9871
|
*/
|
|
@@ -9675,6 +9906,7 @@ export const filterOrElse: {
|
|
|
9675
9906
|
* Effect.runSync(filtered) // => "Number 5 is odd"
|
|
9676
9907
|
* ```
|
|
9677
9908
|
*
|
|
9909
|
+
* @stability stable
|
|
9678
9910
|
* @category filtering
|
|
9679
9911
|
* @since 2.0.0
|
|
9680
9912
|
*/
|
|
@@ -9716,6 +9948,7 @@ export const filterOrElse: {
|
|
|
9716
9948
|
* Effect.runSync(filtered) // => "Number 5 is odd"
|
|
9717
9949
|
* ```
|
|
9718
9950
|
*
|
|
9951
|
+
* @stability stable
|
|
9719
9952
|
* @category filtering
|
|
9720
9953
|
* @since 2.0.0
|
|
9721
9954
|
*/
|
|
@@ -9743,6 +9976,7 @@ export const filterOrElse: {
|
|
|
9743
9976
|
* @see {@link filterOrElse} for using a predicate and fallback effect
|
|
9744
9977
|
* @see {@link filterMapOrFail} for failing the effect when the filter fails
|
|
9745
9978
|
*
|
|
9979
|
+
* @stability stable
|
|
9746
9980
|
* @category filtering
|
|
9747
9981
|
* @since 4.0.0
|
|
9748
9982
|
*/
|
|
@@ -9764,6 +9998,7 @@ export const filterMapOrElse: {
|
|
|
9764
9998
|
* @see {@link filterOrElse} for using a predicate and fallback effect
|
|
9765
9999
|
* @see {@link filterMapOrFail} for failing the effect when the filter fails
|
|
9766
10000
|
*
|
|
10001
|
+
* @stability stable
|
|
9767
10002
|
* @category filtering
|
|
9768
10003
|
* @since 4.0.0
|
|
9769
10004
|
*/
|
|
@@ -9788,6 +10023,7 @@ export const filterMapOrElse: {
|
|
|
9788
10023
|
* @see {@link filterOrElse} for using a predicate and fallback effect
|
|
9789
10024
|
* @see {@link filterMapOrFail} for failing the effect when the filter fails
|
|
9790
10025
|
*
|
|
10026
|
+
* @stability stable
|
|
9791
10027
|
* @category filtering
|
|
9792
10028
|
* @since 4.0.0
|
|
9793
10029
|
*/
|
|
@@ -9825,6 +10061,7 @@ export const filterMapOrElse: {
|
|
|
9825
10061
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
9826
10062
|
* ```
|
|
9827
10063
|
*
|
|
10064
|
+
* @stability stable
|
|
9828
10065
|
* @category filtering
|
|
9829
10066
|
* @since 2.0.0
|
|
9830
10067
|
*/
|
|
@@ -9856,6 +10093,7 @@ export const filterOrFail: {
|
|
|
9856
10093
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
9857
10094
|
* ```
|
|
9858
10095
|
*
|
|
10096
|
+
* @stability stable
|
|
9859
10097
|
* @category filtering
|
|
9860
10098
|
* @since 2.0.0
|
|
9861
10099
|
*/
|
|
@@ -9890,6 +10128,7 @@ export const filterOrFail: {
|
|
|
9890
10128
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
9891
10129
|
* ```
|
|
9892
10130
|
*
|
|
10131
|
+
* @stability stable
|
|
9893
10132
|
* @category filtering
|
|
9894
10133
|
* @since 2.0.0
|
|
9895
10134
|
*/
|
|
@@ -9924,6 +10163,7 @@ export const filterOrFail: {
|
|
|
9924
10163
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
9925
10164
|
* ```
|
|
9926
10165
|
*
|
|
10166
|
+
* @stability stable
|
|
9927
10167
|
* @category filtering
|
|
9928
10168
|
* @since 2.0.0
|
|
9929
10169
|
*/
|
|
@@ -9955,6 +10195,7 @@ export const filterOrFail: {
|
|
|
9955
10195
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
9956
10196
|
* ```
|
|
9957
10197
|
*
|
|
10198
|
+
* @stability stable
|
|
9958
10199
|
* @category filtering
|
|
9959
10200
|
* @since 2.0.0
|
|
9960
10201
|
*/
|
|
@@ -9986,6 +10227,7 @@ export const filterOrFail: {
|
|
|
9986
10227
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
9987
10228
|
* ```
|
|
9988
10229
|
*
|
|
10230
|
+
* @stability stable
|
|
9989
10231
|
* @category filtering
|
|
9990
10232
|
* @since 2.0.0
|
|
9991
10233
|
*/
|
|
@@ -10021,6 +10263,7 @@ export const filterOrFail: {
|
|
|
10021
10263
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
10022
10264
|
* ```
|
|
10023
10265
|
*
|
|
10266
|
+
* @stability stable
|
|
10024
10267
|
* @category filtering
|
|
10025
10268
|
* @since 2.0.0
|
|
10026
10269
|
*/
|
|
@@ -10056,6 +10299,7 @@ export const filterOrFail: {
|
|
|
10056
10299
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
10057
10300
|
* ```
|
|
10058
10301
|
*
|
|
10302
|
+
* @stability stable
|
|
10059
10303
|
* @category filtering
|
|
10060
10304
|
* @since 2.0.0
|
|
10061
10305
|
*/
|
|
@@ -10087,6 +10331,7 @@ export const filterOrFail: {
|
|
|
10087
10331
|
* Effect.runSync(Effect.flip(filtered)) // => "Expected even number, got 5"
|
|
10088
10332
|
* ```
|
|
10089
10333
|
*
|
|
10334
|
+
* @stability stable
|
|
10090
10335
|
* @category filtering
|
|
10091
10336
|
* @since 2.0.0
|
|
10092
10337
|
*/
|
|
@@ -10110,6 +10355,7 @@ export const filterOrFail: {
|
|
|
10110
10355
|
* @see {@link filterOrFail} for validating with a predicate instead of a `Filter`
|
|
10111
10356
|
* @see {@link filterMap} for filtering and mapping iterable elements
|
|
10112
10357
|
*
|
|
10358
|
+
* @stability stable
|
|
10113
10359
|
* @category filtering
|
|
10114
10360
|
* @since 4.0.0
|
|
10115
10361
|
*/
|
|
@@ -10131,6 +10377,7 @@ export const filterMapOrFail: {
|
|
|
10131
10377
|
* @see {@link filterOrFail} for validating with a predicate instead of a `Filter`
|
|
10132
10378
|
* @see {@link filterMap} for filtering and mapping iterable elements
|
|
10133
10379
|
*
|
|
10380
|
+
* @stability stable
|
|
10134
10381
|
* @category filtering
|
|
10135
10382
|
* @since 4.0.0
|
|
10136
10383
|
*/
|
|
@@ -10152,6 +10399,7 @@ export const filterMapOrFail: {
|
|
|
10152
10399
|
* @see {@link filterOrFail} for validating with a predicate instead of a `Filter`
|
|
10153
10400
|
* @see {@link filterMap} for filtering and mapping iterable elements
|
|
10154
10401
|
*
|
|
10402
|
+
* @stability stable
|
|
10155
10403
|
* @category filtering
|
|
10156
10404
|
* @since 4.0.0
|
|
10157
10405
|
*/
|
|
@@ -10173,6 +10421,7 @@ export const filterMapOrFail: {
|
|
|
10173
10421
|
* @see {@link filterOrFail} for validating with a predicate instead of a `Filter`
|
|
10174
10422
|
* @see {@link filterMap} for filtering and mapping iterable elements
|
|
10175
10423
|
*
|
|
10424
|
+
* @stability stable
|
|
10176
10425
|
* @category filtering
|
|
10177
10426
|
* @since 4.0.0
|
|
10178
10427
|
*/
|
|
@@ -10198,6 +10447,7 @@ export const filterMapOrFail: {
|
|
|
10198
10447
|
* @see {@link filterOrFail} for validating with a predicate instead of a `Filter`
|
|
10199
10448
|
* @see {@link filterMap} for filtering and mapping iterable elements
|
|
10200
10449
|
*
|
|
10450
|
+
* @stability stable
|
|
10201
10451
|
* @category filtering
|
|
10202
10452
|
* @since 4.0.0
|
|
10203
10453
|
*/
|
|
@@ -10241,6 +10491,7 @@ export const filterMapOrFail: {
|
|
|
10241
10491
|
* output // => ["Condition is true!", Option.some(undefined)]
|
|
10242
10492
|
* ```
|
|
10243
10493
|
*
|
|
10494
|
+
* @stability stable
|
|
10244
10495
|
* @category filtering
|
|
10245
10496
|
* @since 2.0.0
|
|
10246
10497
|
*/
|
|
@@ -10282,6 +10533,7 @@ export const when: {
|
|
|
10282
10533
|
* output // => ["Condition is true!", Option.some(undefined)]
|
|
10283
10534
|
* ```
|
|
10284
10535
|
*
|
|
10536
|
+
* @stability stable
|
|
10285
10537
|
* @category filtering
|
|
10286
10538
|
* @since 2.0.0
|
|
10287
10539
|
*/
|
|
@@ -10323,6 +10575,7 @@ export const when: {
|
|
|
10323
10575
|
* output // => ["Condition is true!", Option.some(undefined)]
|
|
10324
10576
|
* ```
|
|
10325
10577
|
*
|
|
10578
|
+
* @stability stable
|
|
10326
10579
|
* @category filtering
|
|
10327
10580
|
* @since 2.0.0
|
|
10328
10581
|
*/
|
|
@@ -10380,6 +10633,7 @@ export const when: {
|
|
|
10380
10633
|
* ```
|
|
10381
10634
|
*
|
|
10382
10635
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
10636
|
+
* @stability stable
|
|
10383
10637
|
* @category pattern matching
|
|
10384
10638
|
* @since 2.0.0
|
|
10385
10639
|
*/
|
|
@@ -10435,6 +10689,7 @@ export const match: {
|
|
|
10435
10689
|
* ```
|
|
10436
10690
|
*
|
|
10437
10691
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
10692
|
+
* @stability stable
|
|
10438
10693
|
* @category pattern matching
|
|
10439
10694
|
* @since 2.0.0
|
|
10440
10695
|
*/
|
|
@@ -10495,6 +10750,7 @@ export const match: {
|
|
|
10495
10750
|
* ```
|
|
10496
10751
|
*
|
|
10497
10752
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
10753
|
+
* @stability stable
|
|
10498
10754
|
* @category pattern matching
|
|
10499
10755
|
* @since 2.0.0
|
|
10500
10756
|
*/
|
|
@@ -10543,6 +10799,7 @@ export const match: {
|
|
|
10543
10799
|
*
|
|
10544
10800
|
* @see {@link match} for the non-eager version.
|
|
10545
10801
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
10802
|
+
* @stability stable
|
|
10546
10803
|
* @category pattern matching
|
|
10547
10804
|
* @since 4.0.0
|
|
10548
10805
|
*/
|
|
@@ -10583,6 +10840,7 @@ export const matchEager: {
|
|
|
10583
10840
|
*
|
|
10584
10841
|
* @see {@link match} for the non-eager version.
|
|
10585
10842
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
10843
|
+
* @stability stable
|
|
10586
10844
|
* @category pattern matching
|
|
10587
10845
|
* @since 4.0.0
|
|
10588
10846
|
*/
|
|
@@ -10628,6 +10886,7 @@ export const matchEager: {
|
|
|
10628
10886
|
*
|
|
10629
10887
|
* @see {@link match} for the non-eager version.
|
|
10630
10888
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
10889
|
+
* @stability stable
|
|
10631
10890
|
* @category pattern matching
|
|
10632
10891
|
* @since 4.0.0
|
|
10633
10892
|
*/
|
|
@@ -10671,6 +10930,7 @@ export const matchEager: {
|
|
|
10671
10930
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
10672
10931
|
* handlers.
|
|
10673
10932
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
10933
|
+
* @stability stable
|
|
10674
10934
|
* @category pattern matching
|
|
10675
10935
|
* @since 2.0.0
|
|
10676
10936
|
*/
|
|
@@ -10706,6 +10966,7 @@ export const matchCause: {
|
|
|
10706
10966
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
10707
10967
|
* handlers.
|
|
10708
10968
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
10969
|
+
* @stability stable
|
|
10709
10970
|
* @category pattern matching
|
|
10710
10971
|
* @since 2.0.0
|
|
10711
10972
|
*/
|
|
@@ -10746,6 +11007,7 @@ export const matchCause: {
|
|
|
10746
11007
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
10747
11008
|
* handlers.
|
|
10748
11009
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
11010
|
+
* @stability stable
|
|
10749
11011
|
* @category pattern matching
|
|
10750
11012
|
* @since 2.0.0
|
|
10751
11013
|
*/
|
|
@@ -10784,6 +11046,7 @@ export const matchCause: {
|
|
|
10784
11046
|
* Effect.runSync(handleResult) // => "Success: 42"
|
|
10785
11047
|
* ```
|
|
10786
11048
|
*
|
|
11049
|
+
* @stability stable
|
|
10787
11050
|
* @category pattern matching
|
|
10788
11051
|
* @since 4.0.0
|
|
10789
11052
|
*/
|
|
@@ -10814,6 +11077,7 @@ export const matchCauseEager: {
|
|
|
10814
11077
|
* Effect.runSync(handleResult) // => "Success: 42"
|
|
10815
11078
|
* ```
|
|
10816
11079
|
*
|
|
11080
|
+
* @stability stable
|
|
10817
11081
|
* @category pattern matching
|
|
10818
11082
|
* @since 4.0.0
|
|
10819
11083
|
*/
|
|
@@ -10849,6 +11113,7 @@ export const matchCauseEager: {
|
|
|
10849
11113
|
* Effect.runSync(handleResult) // => "Success: 42"
|
|
10850
11114
|
* ```
|
|
10851
11115
|
*
|
|
11116
|
+
* @stability stable
|
|
10852
11117
|
* @category pattern matching
|
|
10853
11118
|
* @since 4.0.0
|
|
10854
11119
|
*/
|
|
@@ -10878,6 +11143,7 @@ export const matchCauseEager: {
|
|
|
10878
11143
|
* @see {@link matchCauseEager} for eager cause matching with pure handlers
|
|
10879
11144
|
* @see {@link matchEffect} for effectful matching on typed failures instead of full causes
|
|
10880
11145
|
*
|
|
11146
|
+
* @stability stable
|
|
10881
11147
|
* @category pattern matching
|
|
10882
11148
|
* @since 4.0.0
|
|
10883
11149
|
*/
|
|
@@ -10899,6 +11165,7 @@ export const matchCauseEffectEager: {
|
|
|
10899
11165
|
* @see {@link matchCauseEager} for eager cause matching with pure handlers
|
|
10900
11166
|
* @see {@link matchEffect} for effectful matching on typed failures instead of full causes
|
|
10901
11167
|
*
|
|
11168
|
+
* @stability stable
|
|
10902
11169
|
* @category pattern matching
|
|
10903
11170
|
* @since 4.0.0
|
|
10904
11171
|
*/
|
|
@@ -10925,6 +11192,7 @@ export const matchCauseEffectEager: {
|
|
|
10925
11192
|
* @see {@link matchCauseEager} for eager cause matching with pure handlers
|
|
10926
11193
|
* @see {@link matchEffect} for effectful matching on typed failures instead of full causes
|
|
10927
11194
|
*
|
|
11195
|
+
* @stability stable
|
|
10928
11196
|
* @category pattern matching
|
|
10929
11197
|
* @since 4.0.0
|
|
10930
11198
|
*/
|
|
@@ -10992,6 +11260,7 @@ export const matchCauseEffectEager: {
|
|
|
10992
11260
|
* @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
|
|
10993
11261
|
* @see {@link matchEffect} if you don't need to handle the cause of the failure.
|
|
10994
11262
|
*
|
|
11263
|
+
* @stability stable
|
|
10995
11264
|
* @category pattern matching
|
|
10996
11265
|
* @since 2.0.0
|
|
10997
11266
|
*/
|
|
@@ -11051,6 +11320,7 @@ export const matchCauseEffect: {
|
|
|
11051
11320
|
* @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
|
|
11052
11321
|
* @see {@link matchEffect} if you don't need to handle the cause of the failure.
|
|
11053
11322
|
*
|
|
11323
|
+
* @stability stable
|
|
11054
11324
|
* @category pattern matching
|
|
11055
11325
|
* @since 2.0.0
|
|
11056
11326
|
*/
|
|
@@ -11115,6 +11385,7 @@ export const matchCauseEffect: {
|
|
|
11115
11385
|
* @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
|
|
11116
11386
|
* @see {@link matchEffect} if you don't need to handle the cause of the failure.
|
|
11117
11387
|
*
|
|
11388
|
+
* @stability stable
|
|
11118
11389
|
* @category pattern matching
|
|
11119
11390
|
* @since 2.0.0
|
|
11120
11391
|
*/
|
|
@@ -11174,6 +11445,7 @@ export const matchCauseEffect: {
|
|
|
11174
11445
|
*
|
|
11175
11446
|
* @see {@link match} if you don't need side effects and only want to handle the
|
|
11176
11447
|
* result or failure.
|
|
11448
|
+
* @stability stable
|
|
11177
11449
|
* @category pattern matching
|
|
11178
11450
|
* @since 2.0.0
|
|
11179
11451
|
*/
|
|
@@ -11225,6 +11497,7 @@ export const matchEffect: {
|
|
|
11225
11497
|
*
|
|
11226
11498
|
* @see {@link match} if you don't need side effects and only want to handle the
|
|
11227
11499
|
* result or failure.
|
|
11500
|
+
* @stability stable
|
|
11228
11501
|
* @category pattern matching
|
|
11229
11502
|
* @since 2.0.0
|
|
11230
11503
|
*/
|
|
@@ -11281,6 +11554,7 @@ export const matchEffect: {
|
|
|
11281
11554
|
*
|
|
11282
11555
|
* @see {@link match} if you don't need side effects and only want to handle the
|
|
11283
11556
|
* result or failure.
|
|
11557
|
+
* @stability stable
|
|
11284
11558
|
* @category pattern matching
|
|
11285
11559
|
* @since 2.0.0
|
|
11286
11560
|
*/
|
|
@@ -11319,6 +11593,7 @@ export const matchEffect: {
|
|
|
11319
11593
|
* output // => [true]
|
|
11320
11594
|
* ```
|
|
11321
11595
|
*
|
|
11596
|
+
* @stability stable
|
|
11322
11597
|
* @category predicates
|
|
11323
11598
|
* @since 2.0.0
|
|
11324
11599
|
*/
|
|
@@ -11349,6 +11624,7 @@ export const isFailure: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
|
|
|
11349
11624
|
* output // => ["ok: true", "failed: false"]
|
|
11350
11625
|
* ```
|
|
11351
11626
|
*
|
|
11627
|
+
* @stability stable
|
|
11352
11628
|
* @category predicates
|
|
11353
11629
|
* @since 2.0.0
|
|
11354
11630
|
*/
|
|
@@ -11406,6 +11682,7 @@ export const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
|
|
|
11406
11682
|
* @see {@link contextWith} for deriving an effect from the complete context
|
|
11407
11683
|
* @see {@link service} for reading one service from the context
|
|
11408
11684
|
*
|
|
11685
|
+
* @stability stable
|
|
11409
11686
|
* @category accessors
|
|
11410
11687
|
* @since 2.0.0
|
|
11411
11688
|
*/
|
|
@@ -11465,6 +11742,7 @@ export const context: <R = never>() => Effect<Context.Context<R>, never, R> = in
|
|
|
11465
11742
|
* @see {@link context} for reading the complete context as a value
|
|
11466
11743
|
* @see {@link service} for reading one service from the context
|
|
11467
11744
|
*
|
|
11745
|
+
* @stability stable
|
|
11468
11746
|
* @category accessors
|
|
11469
11747
|
* @since 2.0.0
|
|
11470
11748
|
*/
|
|
@@ -11502,6 +11780,7 @@ export const contextWith: <R, A, E, R2>(
|
|
|
11502
11780
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11503
11781
|
* ```
|
|
11504
11782
|
*
|
|
11783
|
+
* @stability stable
|
|
11505
11784
|
* @category providing services
|
|
11506
11785
|
* @since 2.0.0
|
|
11507
11786
|
*/
|
|
@@ -11536,6 +11815,7 @@ export const provide: {
|
|
|
11536
11815
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11537
11816
|
* ```
|
|
11538
11817
|
*
|
|
11818
|
+
* @stability stable
|
|
11539
11819
|
* @category providing services
|
|
11540
11820
|
* @since 2.0.0
|
|
11541
11821
|
*/
|
|
@@ -11581,6 +11861,7 @@ export const provide: {
|
|
|
11581
11861
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11582
11862
|
* ```
|
|
11583
11863
|
*
|
|
11864
|
+
* @stability stable
|
|
11584
11865
|
* @category providing services
|
|
11585
11866
|
* @since 2.0.0
|
|
11586
11867
|
*/
|
|
@@ -11622,6 +11903,7 @@ export const provide: {
|
|
|
11622
11903
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11623
11904
|
* ```
|
|
11624
11905
|
*
|
|
11906
|
+
* @stability stable
|
|
11625
11907
|
* @category providing services
|
|
11626
11908
|
* @since 2.0.0
|
|
11627
11909
|
*/
|
|
@@ -11656,6 +11938,7 @@ export const provide: {
|
|
|
11656
11938
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11657
11939
|
* ```
|
|
11658
11940
|
*
|
|
11941
|
+
* @stability stable
|
|
11659
11942
|
* @category providing services
|
|
11660
11943
|
* @since 2.0.0
|
|
11661
11944
|
*/
|
|
@@ -11700,6 +11983,7 @@ export const provide: {
|
|
|
11700
11983
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11701
11984
|
* ```
|
|
11702
11985
|
*
|
|
11986
|
+
* @stability stable
|
|
11703
11987
|
* @category providing services
|
|
11704
11988
|
* @since 2.0.0
|
|
11705
11989
|
*/
|
|
@@ -11740,6 +12024,7 @@ export const provide: {
|
|
|
11740
12024
|
* await Effect.runPromise(provided) // => "Result for: SELECT * FROM users"
|
|
11741
12025
|
* ```
|
|
11742
12026
|
*
|
|
12027
|
+
* @stability stable
|
|
11743
12028
|
* @category providing services
|
|
11744
12029
|
* @since 2.0.0
|
|
11745
12030
|
*/
|
|
@@ -11786,6 +12071,7 @@ export const provide: {
|
|
|
11786
12071
|
* output // => ["Querying database", "result"]
|
|
11787
12072
|
* ```
|
|
11788
12073
|
*
|
|
12074
|
+
* @stability stable
|
|
11789
12075
|
* @category providing services
|
|
11790
12076
|
* @since 4.0.0
|
|
11791
12077
|
*/
|
|
@@ -11830,6 +12116,7 @@ export const provideContext: {
|
|
|
11830
12116
|
* output // => ["Querying database", "result"]
|
|
11831
12117
|
* ```
|
|
11832
12118
|
*
|
|
12119
|
+
* @stability stable
|
|
11833
12120
|
* @category providing services
|
|
11834
12121
|
* @since 4.0.0
|
|
11835
12122
|
*/
|
|
@@ -11874,6 +12161,7 @@ export const provideContext: {
|
|
|
11874
12161
|
* output // => ["Querying database", "result"]
|
|
11875
12162
|
* ```
|
|
11876
12163
|
*
|
|
12164
|
+
* @stability stable
|
|
11877
12165
|
* @category providing services
|
|
11878
12166
|
* @since 4.0.0
|
|
11879
12167
|
*/
|
|
@@ -11918,6 +12206,7 @@ export const provideContext: {
|
|
|
11918
12206
|
* @see {@link provideContext} for partially satisfying an effect's context requirements.
|
|
11919
12207
|
* @see {@link updateContext} for deriving the required context from the current one.
|
|
11920
12208
|
*
|
|
12209
|
+
* @stability stable
|
|
11921
12210
|
* @category providing services
|
|
11922
12211
|
* @since 4.0.0
|
|
11923
12212
|
*/
|
|
@@ -11960,6 +12249,7 @@ export const setContext: {
|
|
|
11960
12249
|
* @see {@link provideContext} for partially satisfying an effect's context requirements.
|
|
11961
12250
|
* @see {@link updateContext} for deriving the required context from the current one.
|
|
11962
12251
|
*
|
|
12252
|
+
* @stability stable
|
|
11963
12253
|
* @category providing services
|
|
11964
12254
|
* @since 4.0.0
|
|
11965
12255
|
*/
|
|
@@ -12002,6 +12292,7 @@ export const setContext: {
|
|
|
12002
12292
|
* @see {@link provideContext} for partially satisfying an effect's context requirements.
|
|
12003
12293
|
* @see {@link updateContext} for deriving the required context from the current one.
|
|
12004
12294
|
*
|
|
12295
|
+
* @stability stable
|
|
12005
12296
|
* @category providing services
|
|
12006
12297
|
* @since 4.0.0
|
|
12007
12298
|
*/
|
|
@@ -12033,6 +12324,7 @@ export const setContext: {
|
|
|
12033
12324
|
* Effect.runSync(runnable) // => "Result for: SELECT * FROM users"
|
|
12034
12325
|
* ```
|
|
12035
12326
|
*
|
|
12327
|
+
* @stability stable
|
|
12036
12328
|
* @category accessors
|
|
12037
12329
|
* @since 4.0.0
|
|
12038
12330
|
*/
|
|
@@ -12079,6 +12371,7 @@ export const service: <I, S>(service: Context.Key<I, S>) => Effect<S, never, I>
|
|
|
12079
12371
|
* output // => ["Service not available"]
|
|
12080
12372
|
* ```
|
|
12081
12373
|
*
|
|
12374
|
+
* @stability stable
|
|
12082
12375
|
* @category accessors
|
|
12083
12376
|
* @since 2.0.0
|
|
12084
12377
|
*/
|
|
@@ -12123,6 +12416,7 @@ export const serviceOption: <I, S>(key: Context.Key<I, S>) => Effect<Option<S>>
|
|
|
12123
12416
|
* Effect.runSync(result) // => "Hello World!"
|
|
12124
12417
|
* ```
|
|
12125
12418
|
*
|
|
12419
|
+
* @stability stable
|
|
12126
12420
|
* @category providing services
|
|
12127
12421
|
* @since 4.0.0
|
|
12128
12422
|
*/
|
|
@@ -12166,6 +12460,7 @@ export const updateContext: {
|
|
|
12166
12460
|
* Effect.runSync(result) // => "Hello World!"
|
|
12167
12461
|
* ```
|
|
12168
12462
|
*
|
|
12463
|
+
* @stability stable
|
|
12169
12464
|
* @category providing services
|
|
12170
12465
|
* @since 4.0.0
|
|
12171
12466
|
*/
|
|
@@ -12209,6 +12504,7 @@ export const updateContext: {
|
|
|
12209
12504
|
* Effect.runSync(result) // => "Hello World!"
|
|
12210
12505
|
* ```
|
|
12211
12506
|
*
|
|
12507
|
+
* @stability stable
|
|
12212
12508
|
* @category providing services
|
|
12213
12509
|
* @since 4.0.0
|
|
12214
12510
|
*/
|
|
@@ -12250,6 +12546,7 @@ export const updateContext: {
|
|
|
12250
12546
|
* output // => ["Updated count: 1", 1]
|
|
12251
12547
|
* ```
|
|
12252
12548
|
*
|
|
12549
|
+
* @stability stable
|
|
12253
12550
|
* @category providing services
|
|
12254
12551
|
* @since 2.0.0
|
|
12255
12552
|
*/
|
|
@@ -12286,6 +12583,7 @@ export const updateService: {
|
|
|
12286
12583
|
* output // => ["Updated count: 1", 1]
|
|
12287
12584
|
* ```
|
|
12288
12585
|
*
|
|
12586
|
+
* @stability stable
|
|
12289
12587
|
* @category providing services
|
|
12290
12588
|
* @since 2.0.0
|
|
12291
12589
|
*/
|
|
@@ -12322,6 +12620,7 @@ export const updateService: {
|
|
|
12322
12620
|
* output // => ["Updated count: 1", 1]
|
|
12323
12621
|
* ```
|
|
12324
12622
|
*
|
|
12623
|
+
* @stability stable
|
|
12325
12624
|
* @category providing services
|
|
12326
12625
|
* @since 2.0.0
|
|
12327
12626
|
*/
|
|
@@ -12388,6 +12687,7 @@ export const updateService: {
|
|
|
12388
12687
|
*
|
|
12389
12688
|
* @see {@link updateService} for updating a service only within a wrapped effect
|
|
12390
12689
|
*
|
|
12690
|
+
* @stability stable
|
|
12391
12691
|
* @category providing services
|
|
12392
12692
|
* @since 4.0.0
|
|
12393
12693
|
*/
|
|
@@ -12443,6 +12743,7 @@ export const updateServiceScoped: <I, A>(
|
|
|
12443
12743
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
12444
12744
|
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
12445
12745
|
* @see {@link provideContext} for providing a complete context.
|
|
12746
|
+
* @stability stable
|
|
12446
12747
|
* @category providing services
|
|
12447
12748
|
* @since 2.0.0
|
|
12448
12749
|
*/
|
|
@@ -12491,6 +12792,7 @@ export const provideService: {
|
|
|
12491
12792
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
12492
12793
|
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
12493
12794
|
* @see {@link provideContext} for providing a complete context.
|
|
12795
|
+
* @stability stable
|
|
12494
12796
|
* @category providing services
|
|
12495
12797
|
* @since 2.0.0
|
|
12496
12798
|
*/
|
|
@@ -12539,6 +12841,7 @@ export const provideService: {
|
|
|
12539
12841
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
12540
12842
|
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
12541
12843
|
* @see {@link provideContext} for providing a complete context.
|
|
12844
|
+
* @stability stable
|
|
12542
12845
|
* @category providing services
|
|
12543
12846
|
* @since 2.0.0
|
|
12544
12847
|
*/
|
|
@@ -12587,6 +12890,7 @@ export const provideService: {
|
|
|
12587
12890
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
12588
12891
|
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
12589
12892
|
* @see {@link provideContext} for providing a complete context.
|
|
12893
|
+
* @stability stable
|
|
12590
12894
|
* @category providing services
|
|
12591
12895
|
* @since 2.0.0
|
|
12592
12896
|
*/
|
|
@@ -12636,6 +12940,7 @@ export const provideService: {
|
|
|
12636
12940
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
12637
12941
|
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
12638
12942
|
* @see {@link provideContext} for providing a complete context.
|
|
12943
|
+
* @stability stable
|
|
12639
12944
|
* @category providing services
|
|
12640
12945
|
* @since 2.0.0
|
|
12641
12946
|
*/
|
|
@@ -12684,6 +12989,7 @@ export const provideService: {
|
|
|
12684
12989
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
12685
12990
|
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
12686
12991
|
* @see {@link provideContext} for providing a complete context.
|
|
12992
|
+
* @stability stable
|
|
12687
12993
|
* @category providing services
|
|
12688
12994
|
* @since 2.0.0
|
|
12689
12995
|
*/
|
|
@@ -12742,6 +13048,7 @@ export const provideService: {
|
|
|
12742
13048
|
* output // => ["Establishing database connection...", "Database connected!", "Result for: SELECT * FROM users"]
|
|
12743
13049
|
* ```
|
|
12744
13050
|
*
|
|
13051
|
+
* @stability stable
|
|
12745
13052
|
* @category providing services
|
|
12746
13053
|
* @since 2.0.0
|
|
12747
13054
|
*/
|
|
@@ -12798,6 +13105,7 @@ export const provideServiceEffect: {
|
|
|
12798
13105
|
* output // => ["Establishing database connection...", "Database connected!", "Result for: SELECT * FROM users"]
|
|
12799
13106
|
* ```
|
|
12800
13107
|
*
|
|
13108
|
+
* @stability stable
|
|
12801
13109
|
* @category providing services
|
|
12802
13110
|
* @since 2.0.0
|
|
12803
13111
|
*/
|
|
@@ -12854,6 +13162,7 @@ export const provideServiceEffect: {
|
|
|
12854
13162
|
* output // => ["Establishing database connection...", "Database connected!", "Result for: SELECT * FROM users"]
|
|
12855
13163
|
* ```
|
|
12856
13164
|
*
|
|
13165
|
+
* @stability stable
|
|
12857
13166
|
* @category providing services
|
|
12858
13167
|
* @since 2.0.0
|
|
12859
13168
|
*/
|
|
@@ -12894,6 +13203,7 @@ export const provideServiceEffect: {
|
|
|
12894
13203
|
* output // => ["Got scope for resource management", "Acquiring resource", "Releasing resource", "resource"]
|
|
12895
13204
|
* ```
|
|
12896
13205
|
*
|
|
13206
|
+
* @stability stable
|
|
12897
13207
|
* @category resource management
|
|
12898
13208
|
* @since 2.0.0
|
|
12899
13209
|
*/
|
|
@@ -12934,6 +13244,7 @@ export const scope: Effect<Scope, never, Scope> = internal.scope
|
|
|
12934
13244
|
* output // => ["Acquiring resource", "Using resource", "Releasing resource"]
|
|
12935
13245
|
* ```
|
|
12936
13246
|
*
|
|
13247
|
+
* @stability stable
|
|
12937
13248
|
* @category resource management
|
|
12938
13249
|
* @since 2.0.0
|
|
12939
13250
|
*/
|
|
@@ -12978,6 +13289,7 @@ export const scoped: <A, E, R>(
|
|
|
12978
13289
|
* output // => ["Inside scoped context", "Acquiring resource", "Releasing resource", "Manual finalizer", "resource"]
|
|
12979
13290
|
* ```
|
|
12980
13291
|
*
|
|
13292
|
+
* @stability stable
|
|
12981
13293
|
* @category resource management
|
|
12982
13294
|
* @since 3.11.0
|
|
12983
13295
|
*/
|
|
@@ -13047,6 +13359,7 @@ export const scopedWith: <A, E, R>(
|
|
|
13047
13359
|
* @see {@link acquireDisposable} for resources that implement JavaScript disposal protocols
|
|
13048
13360
|
* @see {@link acquireUseRelease} for bracketing acquire, use, and release in one effect
|
|
13049
13361
|
*
|
|
13362
|
+
* @stability stable
|
|
13050
13363
|
* @category resource management
|
|
13051
13364
|
* @since 2.0.0
|
|
13052
13365
|
*/
|
|
@@ -13101,6 +13414,7 @@ export const acquireRelease: <A, E, R, R2>(
|
|
|
13101
13414
|
*
|
|
13102
13415
|
* @see {@link acquireRelease} for resources that need an explicit finalizer
|
|
13103
13416
|
*
|
|
13417
|
+
* @stability stable
|
|
13104
13418
|
* @category resource management
|
|
13105
13419
|
* @since 4.0.0
|
|
13106
13420
|
*/
|
|
@@ -13179,6 +13493,7 @@ export const acquireDisposable: <A extends AsyncDisposable | Disposable, E, R>(
|
|
|
13179
13493
|
*
|
|
13180
13494
|
* @see {@link acquireRelease} for scoped resources whose use happens later
|
|
13181
13495
|
*
|
|
13496
|
+
* @stability stable
|
|
13182
13497
|
* @category resource management
|
|
13183
13498
|
* @since 2.0.0
|
|
13184
13499
|
*/
|
|
@@ -13231,6 +13546,7 @@ export const acquireUseRelease: <Resource, E, R, A, E2, R2, E3, R3>(
|
|
|
13231
13546
|
* @see {@link acquireRelease} for resource acquisition with a release finalizer
|
|
13232
13547
|
* @see {@link ensuring} for attaching a finalizer to one effect
|
|
13233
13548
|
*
|
|
13549
|
+
* @stability stable
|
|
13234
13550
|
* @category resource management
|
|
13235
13551
|
* @since 2.0.0
|
|
13236
13552
|
*/
|
|
@@ -13273,6 +13589,7 @@ export const addFinalizer: <R>(
|
|
|
13273
13589
|
* output // => ["Task started", "Task completed", "Cleanup: This always runs!", 42]
|
|
13274
13590
|
* ```
|
|
13275
13591
|
*
|
|
13592
|
+
* @stability stable
|
|
13276
13593
|
* @category resource management
|
|
13277
13594
|
* @since 2.0.0
|
|
13278
13595
|
*/
|
|
@@ -13312,6 +13629,7 @@ export const ensuring: {
|
|
|
13312
13629
|
* output // => ["Task started", "Task completed", "Cleanup: This always runs!", 42]
|
|
13313
13630
|
* ```
|
|
13314
13631
|
*
|
|
13632
|
+
* @stability stable
|
|
13315
13633
|
* @category resource management
|
|
13316
13634
|
* @since 2.0.0
|
|
13317
13635
|
*/
|
|
@@ -13351,6 +13669,7 @@ export const ensuring: {
|
|
|
13351
13669
|
* output // => ["Task started", "Task completed", "Cleanup: This always runs!", 42]
|
|
13352
13670
|
* ```
|
|
13353
13671
|
*
|
|
13672
|
+
* @stability stable
|
|
13354
13673
|
* @category resource management
|
|
13355
13674
|
* @since 2.0.0
|
|
13356
13675
|
*/
|
|
@@ -13381,6 +13700,7 @@ export const ensuring: {
|
|
|
13381
13700
|
* output // => ["Cleanup on error: TaskError: Something went wrong", Exit.fail(error)]
|
|
13382
13701
|
* ```
|
|
13383
13702
|
*
|
|
13703
|
+
* @stability stable
|
|
13384
13704
|
* @category resource management
|
|
13385
13705
|
* @since 2.0.0
|
|
13386
13706
|
*/
|
|
@@ -13409,6 +13729,7 @@ export const onError: {
|
|
|
13409
13729
|
* output // => ["Cleanup on error: TaskError: Something went wrong", Exit.fail(error)]
|
|
13410
13730
|
* ```
|
|
13411
13731
|
*
|
|
13732
|
+
* @stability stable
|
|
13412
13733
|
* @category resource management
|
|
13413
13734
|
* @since 2.0.0
|
|
13414
13735
|
*/
|
|
@@ -13437,6 +13758,7 @@ export const onError: {
|
|
|
13437
13758
|
* output // => ["Cleanup on error: TaskError: Something went wrong", Exit.fail(error)]
|
|
13438
13759
|
* ```
|
|
13439
13760
|
*
|
|
13761
|
+
* @stability stable
|
|
13440
13762
|
* @category resource management
|
|
13441
13763
|
* @since 2.0.0
|
|
13442
13764
|
*/
|
|
@@ -13471,6 +13793,7 @@ export const onError: {
|
|
|
13471
13793
|
* output // => ["Cause: boom", Exit.fail("boom")]
|
|
13472
13794
|
* ```
|
|
13473
13795
|
*
|
|
13796
|
+
* @stability stable
|
|
13474
13797
|
* @category resource management
|
|
13475
13798
|
* @since 4.0.0
|
|
13476
13799
|
*/
|
|
@@ -13500,6 +13823,7 @@ export const onErrorIf: {
|
|
|
13500
13823
|
* output // => ["Cause: boom", Exit.fail("boom")]
|
|
13501
13824
|
* ```
|
|
13502
13825
|
*
|
|
13826
|
+
* @stability stable
|
|
13503
13827
|
* @category resource management
|
|
13504
13828
|
* @since 4.0.0
|
|
13505
13829
|
*/
|
|
@@ -13532,6 +13856,7 @@ export const onErrorIf: {
|
|
|
13532
13856
|
* output // => ["Cause: boom", Exit.fail("boom")]
|
|
13533
13857
|
* ```
|
|
13534
13858
|
*
|
|
13859
|
+
* @stability stable
|
|
13535
13860
|
* @category resource management
|
|
13536
13861
|
* @since 4.0.0
|
|
13537
13862
|
*/
|
|
@@ -13555,6 +13880,7 @@ export const onErrorIf: {
|
|
|
13555
13880
|
* @see {@link onErrorIf} for selecting failures with a boolean predicate
|
|
13556
13881
|
* @see {@link onExitFilter} for selecting from every exit instead of only failures
|
|
13557
13882
|
*
|
|
13883
|
+
* @stability stable
|
|
13558
13884
|
* @category resource management
|
|
13559
13885
|
* @since 4.0.0
|
|
13560
13886
|
*/
|
|
@@ -13572,6 +13898,7 @@ export const onErrorFilter: {
|
|
|
13572
13898
|
* @see {@link onErrorIf} for selecting failures with a boolean predicate
|
|
13573
13899
|
* @see {@link onExitFilter} for selecting from every exit instead of only failures
|
|
13574
13900
|
*
|
|
13901
|
+
* @stability stable
|
|
13575
13902
|
* @category resource management
|
|
13576
13903
|
* @since 4.0.0
|
|
13577
13904
|
*/
|
|
@@ -13592,6 +13919,7 @@ export const onErrorFilter: {
|
|
|
13592
13919
|
* @see {@link onErrorIf} for selecting failures with a boolean predicate
|
|
13593
13920
|
* @see {@link onExitFilter} for selecting from every exit instead of only failures
|
|
13594
13921
|
*
|
|
13922
|
+
* @stability stable
|
|
13595
13923
|
* @category resource management
|
|
13596
13924
|
* @since 4.0.0
|
|
13597
13925
|
*/
|
|
@@ -13620,6 +13948,7 @@ export const onErrorFilter: {
|
|
|
13620
13948
|
*
|
|
13621
13949
|
* @see {@link onExit} for ordinary exit-aware cleanup whose finalizer always returns an effect
|
|
13622
13950
|
*
|
|
13951
|
+
* @stability stable
|
|
13623
13952
|
* @category resource management
|
|
13624
13953
|
* @since 4.0.0
|
|
13625
13954
|
*/
|
|
@@ -13656,6 +13985,7 @@ export const onExitPrimitive: <A, E, R, XE = never, XR = never>(
|
|
|
13656
13985
|
* output // => ["Task succeeded with: 42", 42]
|
|
13657
13986
|
* ```
|
|
13658
13987
|
*
|
|
13988
|
+
* @stability stable
|
|
13659
13989
|
* @category resource management
|
|
13660
13990
|
* @since 2.0.0
|
|
13661
13991
|
*/
|
|
@@ -13687,6 +14017,7 @@ export const onExit: {
|
|
|
13687
14017
|
* output // => ["Task succeeded with: 42", 42]
|
|
13688
14018
|
* ```
|
|
13689
14019
|
*
|
|
14020
|
+
* @stability stable
|
|
13690
14021
|
* @category resource management
|
|
13691
14022
|
* @since 2.0.0
|
|
13692
14023
|
*/
|
|
@@ -13718,6 +14049,7 @@ export const onExit: {
|
|
|
13718
14049
|
* output // => ["Task succeeded with: 42", 42]
|
|
13719
14050
|
* ```
|
|
13720
14051
|
*
|
|
14052
|
+
* @stability stable
|
|
13721
14053
|
* @category resource management
|
|
13722
14054
|
* @since 2.0.0
|
|
13723
14055
|
*/
|
|
@@ -13747,6 +14079,7 @@ export const onExit: {
|
|
|
13747
14079
|
* output // => ["Succeeded with: 42", 42]
|
|
13748
14080
|
* ```
|
|
13749
14081
|
*
|
|
14082
|
+
* @stability stable
|
|
13750
14083
|
* @category resource management
|
|
13751
14084
|
* @since 4.0.0
|
|
13752
14085
|
*/
|
|
@@ -13774,6 +14107,7 @@ export const onExitIf: {
|
|
|
13774
14107
|
* output // => ["Succeeded with: 42", 42]
|
|
13775
14108
|
* ```
|
|
13776
14109
|
*
|
|
14110
|
+
* @stability stable
|
|
13777
14111
|
* @category resource management
|
|
13778
14112
|
* @since 4.0.0
|
|
13779
14113
|
*/
|
|
@@ -13804,6 +14138,7 @@ export const onExitIf: {
|
|
|
13804
14138
|
* output // => ["Succeeded with: 42", 42]
|
|
13805
14139
|
* ```
|
|
13806
14140
|
*
|
|
14141
|
+
* @stability stable
|
|
13807
14142
|
* @category resource management
|
|
13808
14143
|
* @since 4.0.0
|
|
13809
14144
|
*/
|
|
@@ -13832,6 +14167,7 @@ export const onExitIf: {
|
|
|
13832
14167
|
* @see {@link onExitIf} for selecting exits with a boolean predicate
|
|
13833
14168
|
* @see {@link onErrorFilter} for selecting only failure causes
|
|
13834
14169
|
*
|
|
14170
|
+
* @stability stable
|
|
13835
14171
|
* @category resource management
|
|
13836
14172
|
* @since 4.0.0
|
|
13837
14173
|
*/
|
|
@@ -13854,6 +14190,7 @@ export const onExitFilter: {
|
|
|
13854
14190
|
* @see {@link onExitIf} for selecting exits with a boolean predicate
|
|
13855
14191
|
* @see {@link onErrorFilter} for selecting only failure causes
|
|
13856
14192
|
*
|
|
14193
|
+
* @stability stable
|
|
13857
14194
|
* @category resource management
|
|
13858
14195
|
* @since 4.0.0
|
|
13859
14196
|
*/
|
|
@@ -13879,6 +14216,7 @@ export const onExitFilter: {
|
|
|
13879
14216
|
* @see {@link onExitIf} for selecting exits with a boolean predicate
|
|
13880
14217
|
* @see {@link onErrorFilter} for selecting only failure causes
|
|
13881
14218
|
*
|
|
14219
|
+
* @stability stable
|
|
13882
14220
|
* @category resource management
|
|
13883
14221
|
* @since 4.0.0
|
|
13884
14222
|
*/
|
|
@@ -13909,6 +14247,11 @@ export const onExitFilter: {
|
|
|
13909
14247
|
* evaluations of the same effect will return the cached result without
|
|
13910
14248
|
* re-executing the logic.
|
|
13911
14249
|
*
|
|
14250
|
+
* Concurrent callers share the pending computation, which is interrupted only
|
|
14251
|
+
* once every caller waiting on it has been interrupted. Interrupted
|
|
14252
|
+
* computations are never cached, so the next evaluation starts a fresh
|
|
14253
|
+
* computation.
|
|
14254
|
+
*
|
|
13912
14255
|
* **Example** (Memoizing an effect until invalidated)
|
|
13913
14256
|
*
|
|
13914
14257
|
* ```ts import.meta.vitest
|
|
@@ -13940,6 +14283,7 @@ export const onExitFilter: {
|
|
|
13940
14283
|
* time-to-live duration for the cached value.
|
|
13941
14284
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
13942
14285
|
* additional effect for manually invalidating the cached value.
|
|
14286
|
+
* @stability stable
|
|
13943
14287
|
* @category caching
|
|
13944
14288
|
* @since 2.0.0
|
|
13945
14289
|
*/
|
|
@@ -13970,11 +14314,12 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
|
|
|
13970
14314
|
* `Duration.Input`. The function runs once after each fresh computation,
|
|
13971
14315
|
* including failures, so successes and failures can have different TTLs. It
|
|
13972
14316
|
* does not run when the cache is created or when a cached result is reused.
|
|
13973
|
-
*
|
|
13974
|
-
* returned duration.
|
|
14317
|
+
* Interrupted computations are never cached and do not call the function.
|
|
13975
14318
|
*
|
|
13976
14319
|
* The TTL starts when the computation completes. Concurrent callers share the
|
|
13977
|
-
* pending computation
|
|
14320
|
+
* pending computation, which is interrupted only once every caller waiting on
|
|
14321
|
+
* it has been interrupted. The next evaluation then starts a fresh
|
|
14322
|
+
* computation. A zero TTL expires immediately, and an infinite TTL
|
|
13978
14323
|
* keeps the result indefinitely.
|
|
13979
14324
|
*
|
|
13980
14325
|
* **Example** (Memoizing an effect with TTL)
|
|
@@ -14025,6 +14370,7 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
|
|
|
14025
14370
|
* indefinitely.
|
|
14026
14371
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
14027
14372
|
* additional effect for manually invalidating the cached value.
|
|
14373
|
+
* @stability stable
|
|
14028
14374
|
* @category caching
|
|
14029
14375
|
* @since 2.0.0
|
|
14030
14376
|
*/
|
|
@@ -14054,11 +14400,12 @@ export const cachedWithTTL: {
|
|
|
14054
14400
|
* `Duration.Input`. The function runs once after each fresh computation,
|
|
14055
14401
|
* including failures, so successes and failures can have different TTLs. It
|
|
14056
14402
|
* does not run when the cache is created or when a cached result is reused.
|
|
14057
|
-
*
|
|
14058
|
-
* returned duration.
|
|
14403
|
+
* Interrupted computations are never cached and do not call the function.
|
|
14059
14404
|
*
|
|
14060
14405
|
* The TTL starts when the computation completes. Concurrent callers share the
|
|
14061
|
-
* pending computation
|
|
14406
|
+
* pending computation, which is interrupted only once every caller waiting on
|
|
14407
|
+
* it has been interrupted. The next evaluation then starts a fresh
|
|
14408
|
+
* computation. A zero TTL expires immediately, and an infinite TTL
|
|
14062
14409
|
* keeps the result indefinitely.
|
|
14063
14410
|
*
|
|
14064
14411
|
* **Example** (Memoizing an effect with TTL)
|
|
@@ -14109,6 +14456,7 @@ export const cachedWithTTL: {
|
|
|
14109
14456
|
* indefinitely.
|
|
14110
14457
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
14111
14458
|
* additional effect for manually invalidating the cached value.
|
|
14459
|
+
* @stability stable
|
|
14112
14460
|
* @category caching
|
|
14113
14461
|
* @since 2.0.0
|
|
14114
14462
|
*/
|
|
@@ -14138,11 +14486,12 @@ export const cachedWithTTL: {
|
|
|
14138
14486
|
* `Duration.Input`. The function runs once after each fresh computation,
|
|
14139
14487
|
* including failures, so successes and failures can have different TTLs. It
|
|
14140
14488
|
* does not run when the cache is created or when a cached result is reused.
|
|
14141
|
-
*
|
|
14142
|
-
* returned duration.
|
|
14489
|
+
* Interrupted computations are never cached and do not call the function.
|
|
14143
14490
|
*
|
|
14144
14491
|
* The TTL starts when the computation completes. Concurrent callers share the
|
|
14145
|
-
* pending computation
|
|
14492
|
+
* pending computation, which is interrupted only once every caller waiting on
|
|
14493
|
+
* it has been interrupted. The next evaluation then starts a fresh
|
|
14494
|
+
* computation. A zero TTL expires immediately, and an infinite TTL
|
|
14146
14495
|
* keeps the result indefinitely.
|
|
14147
14496
|
*
|
|
14148
14497
|
* **Example** (Memoizing an effect with TTL)
|
|
@@ -14193,6 +14542,7 @@ export const cachedWithTTL: {
|
|
|
14193
14542
|
* indefinitely.
|
|
14194
14543
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
14195
14544
|
* additional effect for manually invalidating the cached value.
|
|
14545
|
+
* @stability stable
|
|
14196
14546
|
* @category caching
|
|
14197
14547
|
* @since 2.0.0
|
|
14198
14548
|
*/
|
|
@@ -14222,11 +14572,12 @@ export const cachedWithTTL: {
|
|
|
14222
14572
|
* `Duration.Input`. The function runs once after each fresh computation,
|
|
14223
14573
|
* including failures, so successes and failures can have different TTLs. It
|
|
14224
14574
|
* does not run when the cache is created or when a cached result is reused.
|
|
14225
|
-
*
|
|
14226
|
-
* returned duration.
|
|
14575
|
+
* Interrupted computations are never cached and do not call the function.
|
|
14227
14576
|
*
|
|
14228
14577
|
* The TTL starts when the computation completes. Concurrent callers share the
|
|
14229
|
-
* pending computation
|
|
14578
|
+
* pending computation, which is interrupted only once every caller waiting on
|
|
14579
|
+
* it has been interrupted. The next evaluation then starts a fresh
|
|
14580
|
+
* computation. A zero TTL expires immediately, and an infinite TTL
|
|
14230
14581
|
* keeps the result indefinitely.
|
|
14231
14582
|
*
|
|
14232
14583
|
* **Example** (Memoizing an effect with TTL)
|
|
@@ -14277,6 +14628,7 @@ export const cachedWithTTL: {
|
|
|
14277
14628
|
* indefinitely.
|
|
14278
14629
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
14279
14630
|
* additional effect for manually invalidating the cached value.
|
|
14631
|
+
* @stability stable
|
|
14280
14632
|
* @category caching
|
|
14281
14633
|
* @since 2.0.0
|
|
14282
14634
|
*/
|
|
@@ -14306,11 +14658,12 @@ export const cachedWithTTL: {
|
|
|
14306
14658
|
* `Duration.Input`. The function runs once after each fresh computation,
|
|
14307
14659
|
* including failures, so successes and failures can have different TTLs. It
|
|
14308
14660
|
* does not run when the cache is created or when a cached result is reused.
|
|
14309
|
-
*
|
|
14310
|
-
* returned duration.
|
|
14661
|
+
* Interrupted computations are never cached and do not call the function.
|
|
14311
14662
|
*
|
|
14312
14663
|
* The TTL starts when the computation completes. Concurrent callers share the
|
|
14313
|
-
* pending computation
|
|
14664
|
+
* pending computation, which is interrupted only once every caller waiting on
|
|
14665
|
+
* it has been interrupted. The next evaluation then starts a fresh
|
|
14666
|
+
* computation. A zero TTL expires immediately, and an infinite TTL
|
|
14314
14667
|
* keeps the result indefinitely.
|
|
14315
14668
|
*
|
|
14316
14669
|
* **Example** (Memoizing an effect with TTL)
|
|
@@ -14361,6 +14714,7 @@ export const cachedWithTTL: {
|
|
|
14361
14714
|
* indefinitely.
|
|
14362
14715
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
14363
14716
|
* additional effect for manually invalidating the cached value.
|
|
14717
|
+
* @stability stable
|
|
14364
14718
|
* @category caching
|
|
14365
14719
|
* @since 2.0.0
|
|
14366
14720
|
*/
|
|
@@ -14371,8 +14725,8 @@ export const cachedWithTTL: {
|
|
|
14371
14725
|
} = internal.cachedWithTTL
|
|
14372
14726
|
|
|
14373
14727
|
/**
|
|
14374
|
-
* Creates a cached effect result for a
|
|
14375
|
-
* invalidation before expiration.
|
|
14728
|
+
* Creates a cached effect result for a fixed duration or a duration computed
|
|
14729
|
+
* from its `Exit` and allows manual invalidation before expiration.
|
|
14376
14730
|
*
|
|
14377
14731
|
* **When to use**
|
|
14378
14732
|
*
|
|
@@ -14425,13 +14779,14 @@ export const cachedWithTTL: {
|
|
|
14425
14779
|
* indefinitely.
|
|
14426
14780
|
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
14427
14781
|
* a specified duration but does not include an effect for manual invalidation.
|
|
14782
|
+
* @stability stable
|
|
14428
14783
|
* @category caching
|
|
14429
14784
|
* @since 2.0.0
|
|
14430
14785
|
*/
|
|
14431
14786
|
export const cachedInvalidateWithTTL: {
|
|
14432
14787
|
/**
|
|
14433
|
-
* Creates a cached effect result for a
|
|
14434
|
-
* invalidation before expiration.
|
|
14788
|
+
* Creates a cached effect result for a fixed duration or a duration computed
|
|
14789
|
+
* from its `Exit` and allows manual invalidation before expiration.
|
|
14435
14790
|
*
|
|
14436
14791
|
* **When to use**
|
|
14437
14792
|
*
|
|
@@ -14484,13 +14839,74 @@ export const cachedInvalidateWithTTL: {
|
|
|
14484
14839
|
* indefinitely.
|
|
14485
14840
|
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
14486
14841
|
* a specified duration but does not include an effect for manual invalidation.
|
|
14842
|
+
* @stability stable
|
|
14843
|
+
* @category caching
|
|
14844
|
+
* @since 2.0.0
|
|
14845
|
+
*/
|
|
14846
|
+
<A, E>(timeToLive: (exit: Exit.Exit<A, E>) => Duration.Input): <R>(self: Effect<A, E, R>) => Effect<[Effect<A, E, R>, Effect<void>]>
|
|
14847
|
+
/**
|
|
14848
|
+
* Creates a cached effect result for a fixed duration or a duration computed
|
|
14849
|
+
* from its `Exit` and allows manual invalidation before expiration.
|
|
14850
|
+
*
|
|
14851
|
+
* **When to use**
|
|
14852
|
+
*
|
|
14853
|
+
* Use when an effect result should be cached for a bounded time and callers
|
|
14854
|
+
* also need a manual invalidation effect to force recomputation before
|
|
14855
|
+
* expiration.
|
|
14856
|
+
*
|
|
14857
|
+
* **Details**
|
|
14858
|
+
*
|
|
14859
|
+
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
14860
|
+
* result of an effect for a specified period of time. However, it introduces an
|
|
14861
|
+
* additional feature: it provides an effect that allows you to manually
|
|
14862
|
+
* invalidate the cached result before it naturally expires.
|
|
14863
|
+
*
|
|
14864
|
+
* This gives you more control over the cache, allowing you to refresh the
|
|
14865
|
+
* result when needed, even if the original cache has not yet expired.
|
|
14866
|
+
*
|
|
14867
|
+
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
14868
|
+
* result will be recomputed, and the cache will be refreshed.
|
|
14869
|
+
*
|
|
14870
|
+
* **Example** (Memoizing with TTL and invalidation)
|
|
14871
|
+
*
|
|
14872
|
+
* ```ts import.meta.vitest
|
|
14873
|
+
* import { Effect } from "effect"
|
|
14874
|
+
* const output: Array<unknown> = []
|
|
14875
|
+
* const record = (value: unknown) => Effect.sync(() => { output.push(value) })
|
|
14876
|
+
*
|
|
14877
|
+
* let i = 1
|
|
14878
|
+
* const expensiveTask = Effect.sync(() => {
|
|
14879
|
+
* void output.push("expensive task...")
|
|
14880
|
+
* return `result ${i++}`
|
|
14881
|
+
* })
|
|
14882
|
+
*
|
|
14883
|
+
* const program = Effect.gen(function*() {
|
|
14884
|
+
* const [cached, invalidate] = yield* Effect.cachedInvalidateWithTTL(
|
|
14885
|
+
* expensiveTask,
|
|
14886
|
+
* "1 hour"
|
|
14887
|
+
* )
|
|
14888
|
+
* yield* cached.pipe(Effect.andThen(record))
|
|
14889
|
+
* yield* cached.pipe(Effect.andThen(record))
|
|
14890
|
+
* yield* invalidate
|
|
14891
|
+
* yield* cached.pipe(Effect.andThen(record))
|
|
14892
|
+
* })
|
|
14893
|
+
*
|
|
14894
|
+
* Effect.runSync(program)
|
|
14895
|
+
* output // => ["expensive task...", "result 1", "result 1", "expensive task...", "result 2"]
|
|
14896
|
+
* ```
|
|
14897
|
+
*
|
|
14898
|
+
* @see {@link cached} for a similar function that caches the result
|
|
14899
|
+
* indefinitely.
|
|
14900
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
14901
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
14902
|
+
* @stability stable
|
|
14487
14903
|
* @category caching
|
|
14488
14904
|
* @since 2.0.0
|
|
14489
14905
|
*/
|
|
14490
14906
|
(timeToLive: Duration.Input): <A, E, R>(self: Effect<A, E, R>) => Effect<[Effect<A, E, R>, Effect<void>]>
|
|
14491
14907
|
/**
|
|
14492
|
-
* Creates a cached effect result for a
|
|
14493
|
-
* invalidation before expiration.
|
|
14908
|
+
* Creates a cached effect result for a fixed duration or a duration computed
|
|
14909
|
+
* from its `Exit` and allows manual invalidation before expiration.
|
|
14494
14910
|
*
|
|
14495
14911
|
* **When to use**
|
|
14496
14912
|
*
|
|
@@ -14543,10 +14959,74 @@ export const cachedInvalidateWithTTL: {
|
|
|
14543
14959
|
* indefinitely.
|
|
14544
14960
|
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
14545
14961
|
* a specified duration but does not include an effect for manual invalidation.
|
|
14962
|
+
* @stability stable
|
|
14546
14963
|
* @category caching
|
|
14547
14964
|
* @since 2.0.0
|
|
14548
14965
|
*/
|
|
14549
|
-
<A, E, R>(self: Effect<A, E, R
|
|
14966
|
+
<A, E>(timeToLive: Duration.Input | ((exit: Exit.Exit<A, E>) => Duration.Input)): <R>(self: Effect<A, E, R>) => Effect<[Effect<A, E, R>, Effect<void>]>
|
|
14967
|
+
/**
|
|
14968
|
+
* Creates a cached effect result for a fixed duration or a duration computed
|
|
14969
|
+
* from its `Exit` and allows manual invalidation before expiration.
|
|
14970
|
+
*
|
|
14971
|
+
* **When to use**
|
|
14972
|
+
*
|
|
14973
|
+
* Use when an effect result should be cached for a bounded time and callers
|
|
14974
|
+
* also need a manual invalidation effect to force recomputation before
|
|
14975
|
+
* expiration.
|
|
14976
|
+
*
|
|
14977
|
+
* **Details**
|
|
14978
|
+
*
|
|
14979
|
+
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
14980
|
+
* result of an effect for a specified period of time. However, it introduces an
|
|
14981
|
+
* additional feature: it provides an effect that allows you to manually
|
|
14982
|
+
* invalidate the cached result before it naturally expires.
|
|
14983
|
+
*
|
|
14984
|
+
* This gives you more control over the cache, allowing you to refresh the
|
|
14985
|
+
* result when needed, even if the original cache has not yet expired.
|
|
14986
|
+
*
|
|
14987
|
+
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
14988
|
+
* result will be recomputed, and the cache will be refreshed.
|
|
14989
|
+
*
|
|
14990
|
+
* **Example** (Memoizing with TTL and invalidation)
|
|
14991
|
+
*
|
|
14992
|
+
* ```ts import.meta.vitest
|
|
14993
|
+
* import { Effect } from "effect"
|
|
14994
|
+
* const output: Array<unknown> = []
|
|
14995
|
+
* const record = (value: unknown) => Effect.sync(() => { output.push(value) })
|
|
14996
|
+
*
|
|
14997
|
+
* let i = 1
|
|
14998
|
+
* const expensiveTask = Effect.sync(() => {
|
|
14999
|
+
* void output.push("expensive task...")
|
|
15000
|
+
* return `result ${i++}`
|
|
15001
|
+
* })
|
|
15002
|
+
*
|
|
15003
|
+
* const program = Effect.gen(function*() {
|
|
15004
|
+
* const [cached, invalidate] = yield* Effect.cachedInvalidateWithTTL(
|
|
15005
|
+
* expensiveTask,
|
|
15006
|
+
* "1 hour"
|
|
15007
|
+
* )
|
|
15008
|
+
* yield* cached.pipe(Effect.andThen(record))
|
|
15009
|
+
* yield* cached.pipe(Effect.andThen(record))
|
|
15010
|
+
* yield* invalidate
|
|
15011
|
+
* yield* cached.pipe(Effect.andThen(record))
|
|
15012
|
+
* })
|
|
15013
|
+
*
|
|
15014
|
+
* Effect.runSync(program)
|
|
15015
|
+
* output // => ["expensive task...", "result 1", "result 1", "expensive task...", "result 2"]
|
|
15016
|
+
* ```
|
|
15017
|
+
*
|
|
15018
|
+
* @see {@link cached} for a similar function that caches the result
|
|
15019
|
+
* indefinitely.
|
|
15020
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
15021
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
15022
|
+
* @stability stable
|
|
15023
|
+
* @category caching
|
|
15024
|
+
* @since 2.0.0
|
|
15025
|
+
*/
|
|
15026
|
+
<A, E, R>(
|
|
15027
|
+
self: Effect<A, E, R>,
|
|
15028
|
+
timeToLive: Duration.Input | ((exit: Exit.Exit<A, E>) => Duration.Input)
|
|
15029
|
+
): Effect<[Effect<A, E, R>, Effect<void>]>
|
|
14550
15030
|
} = internal.cachedInvalidateWithTTL
|
|
14551
15031
|
|
|
14552
15032
|
// -----------------------------------------------------------------------------
|
|
@@ -14569,6 +15049,7 @@ export const cachedInvalidateWithTTL: {
|
|
|
14569
15049
|
* Effect.runSyncExit(program)._tag // => "Failure"
|
|
14570
15050
|
* ```
|
|
14571
15051
|
*
|
|
15052
|
+
* @stability stable
|
|
14572
15053
|
* @category interruption
|
|
14573
15054
|
* @since 2.0.0
|
|
14574
15055
|
*/
|
|
@@ -14588,6 +15069,7 @@ export const interrupt: Effect<never> = internal.interrupt
|
|
|
14588
15069
|
* await Effect.runPromise(program) // => Option.none()
|
|
14589
15070
|
* ```
|
|
14590
15071
|
*
|
|
15072
|
+
* @stability stable
|
|
14591
15073
|
* @category interruption
|
|
14592
15074
|
* @since 2.0.0
|
|
14593
15075
|
*/
|
|
@@ -14616,6 +15098,7 @@ export const interruptible: <A, E, R>(
|
|
|
14616
15098
|
* output // => ["Task was interrupted, cleaning up..."]
|
|
14617
15099
|
* ```
|
|
14618
15100
|
*
|
|
15101
|
+
* @stability stable
|
|
14619
15102
|
* @category interruption
|
|
14620
15103
|
* @since 2.0.0
|
|
14621
15104
|
*/
|
|
@@ -14641,6 +15124,7 @@ export const onInterrupt: {
|
|
|
14641
15124
|
* output // => ["Task was interrupted, cleaning up..."]
|
|
14642
15125
|
* ```
|
|
14643
15126
|
*
|
|
15127
|
+
* @stability stable
|
|
14644
15128
|
* @category interruption
|
|
14645
15129
|
* @since 2.0.0
|
|
14646
15130
|
*/
|
|
@@ -14666,6 +15150,7 @@ export const onInterrupt: {
|
|
|
14666
15150
|
* output // => ["Task was interrupted, cleaning up..."]
|
|
14667
15151
|
* ```
|
|
14668
15152
|
*
|
|
15153
|
+
* @stability stable
|
|
14669
15154
|
* @category interruption
|
|
14670
15155
|
* @since 2.0.0
|
|
14671
15156
|
*/
|
|
@@ -14695,6 +15180,7 @@ export const onInterrupt: {
|
|
|
14695
15180
|
* output // => ["Starting critical section...", "Critical section completed"]
|
|
14696
15181
|
* ```
|
|
14697
15182
|
*
|
|
15183
|
+
* @stability stable
|
|
14698
15184
|
* @category interruption
|
|
14699
15185
|
* @since 2.0.0
|
|
14700
15186
|
*/
|
|
@@ -14730,6 +15216,7 @@ export const uninterruptible: <A, E, R>(
|
|
|
14730
15216
|
* output // => ["Uninterruptible phase...", "Interruptible phase...", "Back to uninterruptible"]
|
|
14731
15217
|
* ```
|
|
14732
15218
|
*
|
|
15219
|
+
* @stability stable
|
|
14733
15220
|
* @category interruption
|
|
14734
15221
|
* @since 2.0.0
|
|
14735
15222
|
*/
|
|
@@ -14767,6 +15254,7 @@ export const uninterruptibleMask: <A, E, R>(
|
|
|
14767
15254
|
* output // => ["Interruptible phase...", "Uninterruptible phase...", "Back to interruptible"]
|
|
14768
15255
|
* ```
|
|
14769
15256
|
*
|
|
15257
|
+
* @stability stable
|
|
14770
15258
|
* @category interruption
|
|
14771
15259
|
* @since 2.0.0
|
|
14772
15260
|
*/
|
|
@@ -14797,6 +15285,7 @@ export const interruptibleMask: <A, E, R>(
|
|
|
14797
15285
|
*
|
|
14798
15286
|
* @see {@link scoped} for binding resource lifetime to a scope
|
|
14799
15287
|
*
|
|
15288
|
+
* @stability stable
|
|
14800
15289
|
* @category interruption
|
|
14801
15290
|
* @since 4.0.0
|
|
14802
15291
|
*/
|
|
@@ -14809,6 +15298,7 @@ export const abortSignal: Effect<AbortSignal, never, Scope> = internal.abortSign
|
|
|
14809
15298
|
/**
|
|
14810
15299
|
* Type helpers for repeating effects.
|
|
14811
15300
|
*
|
|
15301
|
+
* @stability stable
|
|
14812
15302
|
* @category repetition
|
|
14813
15303
|
* @since 2.0.0
|
|
14814
15304
|
*/
|
|
@@ -14873,6 +15363,7 @@ export declare namespace Repeat {
|
|
|
14873
15363
|
* await Effect.runPromise(program) // => Option.none()
|
|
14874
15364
|
* ```
|
|
14875
15365
|
*
|
|
15366
|
+
* @stability stable
|
|
14876
15367
|
* @category repetition
|
|
14877
15368
|
* @since 2.0.0
|
|
14878
15369
|
*/
|
|
@@ -14967,6 +15458,7 @@ export const forever: <
|
|
|
14967
15458
|
* @see {@link retry} for failure-based repetition
|
|
14968
15459
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14969
15460
|
*
|
|
15461
|
+
* @stability stable
|
|
14970
15462
|
* @category repetition
|
|
14971
15463
|
* @since 2.0.0
|
|
14972
15464
|
*/
|
|
@@ -15048,6 +15540,7 @@ export const repeat: {
|
|
|
15048
15540
|
* @see {@link retry} for failure-based repetition
|
|
15049
15541
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
15050
15542
|
*
|
|
15543
|
+
* @stability stable
|
|
15051
15544
|
* @category repetition
|
|
15052
15545
|
* @since 2.0.0
|
|
15053
15546
|
*/
|
|
@@ -15129,6 +15622,7 @@ export const repeat: {
|
|
|
15129
15622
|
* @see {@link retry} for failure-based repetition
|
|
15130
15623
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
15131
15624
|
*
|
|
15625
|
+
* @stability stable
|
|
15132
15626
|
* @category repetition
|
|
15133
15627
|
* @since 2.0.0
|
|
15134
15628
|
*/
|
|
@@ -15210,6 +15704,7 @@ export const repeat: {
|
|
|
15210
15704
|
* @see {@link retry} for failure-based repetition
|
|
15211
15705
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
15212
15706
|
*
|
|
15707
|
+
* @stability stable
|
|
15213
15708
|
* @category repetition
|
|
15214
15709
|
* @since 2.0.0
|
|
15215
15710
|
*/
|
|
@@ -15295,6 +15790,7 @@ export const repeat: {
|
|
|
15295
15790
|
* @see {@link retry} for failure-based repetition
|
|
15296
15791
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
15297
15792
|
*
|
|
15793
|
+
* @stability stable
|
|
15298
15794
|
* @category repetition
|
|
15299
15795
|
* @since 2.0.0
|
|
15300
15796
|
*/
|
|
@@ -15376,6 +15872,7 @@ export const repeat: {
|
|
|
15376
15872
|
* @see {@link retry} for failure-based repetition
|
|
15377
15873
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
15378
15874
|
*
|
|
15875
|
+
* @stability stable
|
|
15379
15876
|
* @category repetition
|
|
15380
15877
|
* @since 2.0.0
|
|
15381
15878
|
*/
|
|
@@ -15460,6 +15957,7 @@ export const repeat: {
|
|
|
15460
15957
|
* @see {@link retry} for failure-based repetition
|
|
15461
15958
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
15462
15959
|
*
|
|
15960
|
+
* @stability stable
|
|
15463
15961
|
* @category repetition
|
|
15464
15962
|
* @since 2.0.0
|
|
15465
15963
|
*/
|
|
@@ -15519,6 +16017,7 @@ export const repeat: {
|
|
|
15519
16017
|
* output // => ["Attempt 1 failed", "Final failure: Error 1, after 0 attempts", 0]
|
|
15520
16018
|
* ```
|
|
15521
16019
|
*
|
|
16020
|
+
* @stability stable
|
|
15522
16021
|
* @category repetition
|
|
15523
16022
|
* @since 2.0.0
|
|
15524
16023
|
*/
|
|
@@ -15571,6 +16070,7 @@ export const repeatOrElse: {
|
|
|
15571
16070
|
* output // => ["Attempt 1 failed", "Final failure: Error 1, after 0 attempts", 0]
|
|
15572
16071
|
* ```
|
|
15573
16072
|
*
|
|
16073
|
+
* @stability stable
|
|
15574
16074
|
* @category repetition
|
|
15575
16075
|
* @since 2.0.0
|
|
15576
16076
|
*/
|
|
@@ -15626,6 +16126,7 @@ export const repeatOrElse: {
|
|
|
15626
16126
|
* output // => ["Attempt 1 failed", "Final failure: Error 1, after 0 attempts", 0]
|
|
15627
16127
|
* ```
|
|
15628
16128
|
*
|
|
16129
|
+
* @stability stable
|
|
15629
16130
|
* @category repetition
|
|
15630
16131
|
* @since 2.0.0
|
|
15631
16132
|
*/
|
|
@@ -15651,6 +16152,7 @@ export const repeatOrElse: {
|
|
|
15651
16152
|
* @see {@link all} for running the returned effects and collecting results
|
|
15652
16153
|
* @see {@link replicateEffect} for repeating an effect and collecting results in one step with concurrency and discard options
|
|
15653
16154
|
*
|
|
16155
|
+
* @stability stable
|
|
15654
16156
|
* @category repetition
|
|
15655
16157
|
* @since 2.0.0
|
|
15656
16158
|
*/
|
|
@@ -15670,6 +16172,7 @@ export const replicate: {
|
|
|
15670
16172
|
* @see {@link all} for running the returned effects and collecting results
|
|
15671
16173
|
* @see {@link replicateEffect} for repeating an effect and collecting results in one step with concurrency and discard options
|
|
15672
16174
|
*
|
|
16175
|
+
* @stability stable
|
|
15673
16176
|
* @category repetition
|
|
15674
16177
|
* @since 2.0.0
|
|
15675
16178
|
*/
|
|
@@ -15689,6 +16192,7 @@ export const replicate: {
|
|
|
15689
16192
|
* @see {@link all} for running the returned effects and collecting results
|
|
15690
16193
|
* @see {@link replicateEffect} for repeating an effect and collecting results in one step with concurrency and discard options
|
|
15691
16194
|
*
|
|
16195
|
+
* @stability stable
|
|
15692
16196
|
* @category repetition
|
|
15693
16197
|
* @since 2.0.0
|
|
15694
16198
|
*/
|
|
@@ -15722,6 +16226,7 @@ export const replicate: {
|
|
|
15722
16226
|
* output // => [[1, 1, 1]]
|
|
15723
16227
|
* ```
|
|
15724
16228
|
*
|
|
16229
|
+
* @stability stable
|
|
15725
16230
|
* @category repetition
|
|
15726
16231
|
* @since 2.0.0
|
|
15727
16232
|
*/
|
|
@@ -15753,6 +16258,7 @@ export const replicateEffect: {
|
|
|
15753
16258
|
* output // => [[1, 1, 1]]
|
|
15754
16259
|
* ```
|
|
15755
16260
|
*
|
|
16261
|
+
* @stability stable
|
|
15756
16262
|
* @category repetition
|
|
15757
16263
|
* @since 2.0.0
|
|
15758
16264
|
*/
|
|
@@ -15787,6 +16293,7 @@ export const replicateEffect: {
|
|
|
15787
16293
|
* output // => [[1, 1, 1]]
|
|
15788
16294
|
* ```
|
|
15789
16295
|
*
|
|
16296
|
+
* @stability stable
|
|
15790
16297
|
* @category repetition
|
|
15791
16298
|
* @since 2.0.0
|
|
15792
16299
|
*/
|
|
@@ -15821,6 +16328,7 @@ export const replicateEffect: {
|
|
|
15821
16328
|
* output // => [[1, 1, 1]]
|
|
15822
16329
|
* ```
|
|
15823
16330
|
*
|
|
16331
|
+
* @stability stable
|
|
15824
16332
|
* @category repetition
|
|
15825
16333
|
* @since 2.0.0
|
|
15826
16334
|
*/
|
|
@@ -15856,6 +16364,7 @@ export const replicateEffect: {
|
|
|
15856
16364
|
* output // => [[1, 1, 1]]
|
|
15857
16365
|
* ```
|
|
15858
16366
|
*
|
|
16367
|
+
* @stability stable
|
|
15859
16368
|
* @category repetition
|
|
15860
16369
|
* @since 2.0.0
|
|
15861
16370
|
*/
|
|
@@ -15903,6 +16412,7 @@ export const replicateEffect: {
|
|
|
15903
16412
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
15904
16413
|
* to depend on the result of this effect.
|
|
15905
16414
|
*
|
|
16415
|
+
* @stability stable
|
|
15906
16416
|
* @category repetition
|
|
15907
16417
|
* @since 2.0.0
|
|
15908
16418
|
*/
|
|
@@ -15944,6 +16454,7 @@ export const schedule: {
|
|
|
15944
16454
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
15945
16455
|
* to depend on the result of this effect.
|
|
15946
16456
|
*
|
|
16457
|
+
* @stability stable
|
|
15947
16458
|
* @category repetition
|
|
15948
16459
|
* @since 2.0.0
|
|
15949
16460
|
*/
|
|
@@ -15985,6 +16496,7 @@ export const schedule: {
|
|
|
15985
16496
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
15986
16497
|
* to depend on the result of this effect.
|
|
15987
16498
|
*
|
|
16499
|
+
* @stability stable
|
|
15988
16500
|
* @category repetition
|
|
15989
16501
|
* @since 2.0.0
|
|
15990
16502
|
*/
|
|
@@ -16029,6 +16541,7 @@ export const schedule: {
|
|
|
16029
16541
|
* output // => ["Processing: 0", "Processing: 0", 2]
|
|
16030
16542
|
* ```
|
|
16031
16543
|
*
|
|
16544
|
+
* @stability stable
|
|
16032
16545
|
* @category repetition
|
|
16033
16546
|
* @since 2.0.0
|
|
16034
16547
|
*/
|
|
@@ -16068,6 +16581,7 @@ export const scheduleFrom: {
|
|
|
16068
16581
|
* output // => ["Processing: 0", "Processing: 0", 2]
|
|
16069
16582
|
* ```
|
|
16070
16583
|
*
|
|
16584
|
+
* @stability stable
|
|
16071
16585
|
* @category repetition
|
|
16072
16586
|
* @since 2.0.0
|
|
16073
16587
|
*/
|
|
@@ -16107,6 +16621,7 @@ export const scheduleFrom: {
|
|
|
16107
16621
|
* output // => ["Processing: 0", "Processing: 0", 2]
|
|
16108
16622
|
* ```
|
|
16109
16623
|
*
|
|
16624
|
+
* @stability stable
|
|
16110
16625
|
* @category repetition
|
|
16111
16626
|
* @since 2.0.0
|
|
16112
16627
|
*/
|
|
@@ -16137,6 +16652,7 @@ export const scheduleFrom: {
|
|
|
16137
16652
|
* Effect.runSync(program) // => "function"
|
|
16138
16653
|
* ```
|
|
16139
16654
|
*
|
|
16655
|
+
* @stability stable
|
|
16140
16656
|
* @category tracing
|
|
16141
16657
|
* @since 2.0.0
|
|
16142
16658
|
*/
|
|
@@ -16158,6 +16674,7 @@ export const tracer: Effect<Tracer> = internal.tracer
|
|
|
16158
16674
|
* Effect.runSync(program) // => "completed"
|
|
16159
16675
|
* ```
|
|
16160
16676
|
*
|
|
16677
|
+
* @stability stable
|
|
16161
16678
|
* @category tracing
|
|
16162
16679
|
* @since 2.0.0
|
|
16163
16680
|
*/
|
|
@@ -16178,6 +16695,7 @@ export const withTracer: {
|
|
|
16178
16695
|
* Effect.runSync(program) // => "completed"
|
|
16179
16696
|
* ```
|
|
16180
16697
|
*
|
|
16698
|
+
* @stability stable
|
|
16181
16699
|
* @category tracing
|
|
16182
16700
|
* @since 2.0.0
|
|
16183
16701
|
*/
|
|
@@ -16198,6 +16716,7 @@ export const withTracer: {
|
|
|
16198
16716
|
* Effect.runSync(program) // => "completed"
|
|
16199
16717
|
* ```
|
|
16200
16718
|
*
|
|
16719
|
+
* @stability stable
|
|
16201
16720
|
* @category tracing
|
|
16202
16721
|
* @since 2.0.0
|
|
16203
16722
|
*/
|
|
@@ -16225,6 +16744,7 @@ export const withTracer: {
|
|
|
16225
16744
|
* Effect.runSync(program) // => 42
|
|
16226
16745
|
* ```
|
|
16227
16746
|
*
|
|
16747
|
+
* @stability stable
|
|
16228
16748
|
* @category tracing
|
|
16229
16749
|
* @since 2.0.0
|
|
16230
16750
|
*/
|
|
@@ -16250,6 +16770,7 @@ export const withTracerEnabled: {
|
|
|
16250
16770
|
* Effect.runSync(program) // => 42
|
|
16251
16771
|
* ```
|
|
16252
16772
|
*
|
|
16773
|
+
* @stability stable
|
|
16253
16774
|
* @category tracing
|
|
16254
16775
|
* @since 2.0.0
|
|
16255
16776
|
*/
|
|
@@ -16275,6 +16796,7 @@ export const withTracerEnabled: {
|
|
|
16275
16796
|
* Effect.runSync(program) // => 42
|
|
16276
16797
|
* ```
|
|
16277
16798
|
*
|
|
16799
|
+
* @stability stable
|
|
16278
16800
|
* @category tracing
|
|
16279
16801
|
* @since 2.0.0
|
|
16280
16802
|
*/
|
|
@@ -16297,6 +16819,7 @@ export const withTracerEnabled: {
|
|
|
16297
16819
|
* Effect.runSync(program) // => 42
|
|
16298
16820
|
* ```
|
|
16299
16821
|
*
|
|
16822
|
+
* @stability stable
|
|
16300
16823
|
* @category tracing
|
|
16301
16824
|
* @since 2.0.0
|
|
16302
16825
|
*/
|
|
@@ -16317,6 +16840,7 @@ export const withTracerTiming: {
|
|
|
16317
16840
|
* Effect.runSync(program) // => 42
|
|
16318
16841
|
* ```
|
|
16319
16842
|
*
|
|
16843
|
+
* @stability stable
|
|
16320
16844
|
* @category tracing
|
|
16321
16845
|
* @since 2.0.0
|
|
16322
16846
|
*/
|
|
@@ -16337,6 +16861,7 @@ export const withTracerTiming: {
|
|
|
16337
16861
|
* Effect.runSync(program) // => 42
|
|
16338
16862
|
* ```
|
|
16339
16863
|
*
|
|
16864
|
+
* @stability stable
|
|
16340
16865
|
* @category tracing
|
|
16341
16866
|
* @since 2.0.0
|
|
16342
16867
|
*/
|
|
@@ -16366,6 +16891,7 @@ export const withTracerTiming: {
|
|
|
16366
16891
|
* Effect.runSync(Effect.all([annotated1, annotated2])) // => ['result', 'result']
|
|
16367
16892
|
* ```
|
|
16368
16893
|
*
|
|
16894
|
+
* @stability stable
|
|
16369
16895
|
* @category tracing
|
|
16370
16896
|
* @since 2.0.0
|
|
16371
16897
|
*/
|
|
@@ -16393,6 +16919,7 @@ export const annotateSpans: {
|
|
|
16393
16919
|
* Effect.runSync(Effect.all([annotated1, annotated2])) // => ['result', 'result']
|
|
16394
16920
|
* ```
|
|
16395
16921
|
*
|
|
16922
|
+
* @stability stable
|
|
16396
16923
|
* @category tracing
|
|
16397
16924
|
* @since 2.0.0
|
|
16398
16925
|
*/
|
|
@@ -16420,6 +16947,7 @@ export const annotateSpans: {
|
|
|
16420
16947
|
* Effect.runSync(Effect.all([annotated1, annotated2])) // => ['result', 'result']
|
|
16421
16948
|
* ```
|
|
16422
16949
|
*
|
|
16950
|
+
* @stability stable
|
|
16423
16951
|
* @category tracing
|
|
16424
16952
|
* @since 2.0.0
|
|
16425
16953
|
*/
|
|
@@ -16447,6 +16975,7 @@ export const annotateSpans: {
|
|
|
16447
16975
|
* Effect.runSync(Effect.all([annotated1, annotated2])) // => ['result', 'result']
|
|
16448
16976
|
* ```
|
|
16449
16977
|
*
|
|
16978
|
+
* @stability stable
|
|
16450
16979
|
* @category tracing
|
|
16451
16980
|
* @since 2.0.0
|
|
16452
16981
|
*/
|
|
@@ -16474,6 +17003,7 @@ export const annotateSpans: {
|
|
|
16474
17003
|
* Effect.runSync(Effect.all([annotated1, annotated2])) // => ['result', 'result']
|
|
16475
17004
|
* ```
|
|
16476
17005
|
*
|
|
17006
|
+
* @stability stable
|
|
16477
17007
|
* @category tracing
|
|
16478
17008
|
* @since 2.0.0
|
|
16479
17009
|
*/
|
|
@@ -16500,6 +17030,7 @@ export const annotateSpans: {
|
|
|
16500
17030
|
* Effect.runSync(traced) // => "success"
|
|
16501
17031
|
* ```
|
|
16502
17032
|
*
|
|
17033
|
+
* @stability stable
|
|
16503
17034
|
* @category tracing
|
|
16504
17035
|
* @since 2.0.0
|
|
16505
17036
|
*/
|
|
@@ -16524,6 +17055,7 @@ export const annotateCurrentSpan: {
|
|
|
16524
17055
|
* Effect.runSync(traced) // => "success"
|
|
16525
17056
|
* ```
|
|
16526
17057
|
*
|
|
17058
|
+
* @stability stable
|
|
16527
17059
|
* @category tracing
|
|
16528
17060
|
* @since 2.0.0
|
|
16529
17061
|
*/
|
|
@@ -16548,6 +17080,7 @@ export const annotateCurrentSpan: {
|
|
|
16548
17080
|
* Effect.runSync(traced) // => "success"
|
|
16549
17081
|
* ```
|
|
16550
17082
|
*
|
|
17083
|
+
* @stability stable
|
|
16551
17084
|
* @category tracing
|
|
16552
17085
|
* @since 2.0.0
|
|
16553
17086
|
*/
|
|
@@ -16576,6 +17109,7 @@ export const annotateCurrentSpan: {
|
|
|
16576
17109
|
* Effect.runSync(traced) // => "my-span"
|
|
16577
17110
|
* ```
|
|
16578
17111
|
*
|
|
17112
|
+
* @stability stable
|
|
16579
17113
|
* @category tracing
|
|
16580
17114
|
* @since 2.0.0
|
|
16581
17115
|
*/
|
|
@@ -16606,6 +17140,7 @@ export const currentSpan: Effect<Span, Cause.NoSuchElementError> = internal.curr
|
|
|
16606
17140
|
* Effect.runSync(traced) // => "Span"
|
|
16607
17141
|
* ```
|
|
16608
17142
|
*
|
|
17143
|
+
* @stability stable
|
|
16609
17144
|
* @category tracing
|
|
16610
17145
|
* @since 2.0.0
|
|
16611
17146
|
*/
|
|
@@ -16632,6 +17167,7 @@ export const currentParentSpan: Effect<AnySpan, Cause.NoSuchElementError> = inte
|
|
|
16632
17167
|
* Effect.runSync(program) // => { userId: '123', operation: 'data-processing' }
|
|
16633
17168
|
* ```
|
|
16634
17169
|
*
|
|
17170
|
+
* @stability stable
|
|
16635
17171
|
* @category tracing
|
|
16636
17172
|
* @since 2.0.0
|
|
16637
17173
|
*/
|
|
@@ -16659,6 +17195,7 @@ export const spanAnnotations: Effect<Readonly<Record<string, unknown>>> = intern
|
|
|
16659
17195
|
* Effect.runSync(program).length // => 0
|
|
16660
17196
|
* ```
|
|
16661
17197
|
*
|
|
17198
|
+
* @stability stable
|
|
16662
17199
|
* @category tracing
|
|
16663
17200
|
* @since 2.0.0
|
|
16664
17201
|
*/
|
|
@@ -16708,6 +17245,7 @@ export const spanLinks: Effect<ReadonlyArray<SpanLink>> = internal.spanLinks
|
|
|
16708
17245
|
* Effect.runSync(program).length // => 2
|
|
16709
17246
|
* ```
|
|
16710
17247
|
*
|
|
17248
|
+
* @stability stable
|
|
16711
17249
|
* @category tracing
|
|
16712
17250
|
* @since 2.0.0
|
|
16713
17251
|
*/
|
|
@@ -16756,6 +17294,7 @@ export const linkSpans: {
|
|
|
16756
17294
|
* Effect.runSync(program).length // => 2
|
|
16757
17295
|
* ```
|
|
16758
17296
|
*
|
|
17297
|
+
* @stability stable
|
|
16759
17298
|
* @category tracing
|
|
16760
17299
|
* @since 2.0.0
|
|
16761
17300
|
*/
|
|
@@ -16807,6 +17346,7 @@ export const linkSpans: {
|
|
|
16807
17346
|
* Effect.runSync(program).length // => 2
|
|
16808
17347
|
* ```
|
|
16809
17348
|
*
|
|
17349
|
+
* @stability stable
|
|
16810
17350
|
* @category tracing
|
|
16811
17351
|
* @since 2.0.0
|
|
16812
17352
|
*/
|
|
@@ -16839,6 +17379,7 @@ export const linkSpans: {
|
|
|
16839
17379
|
* Effect.runSync(program) // => "my-operation"
|
|
16840
17380
|
* ```
|
|
16841
17381
|
*
|
|
17382
|
+
* @stability stable
|
|
16842
17383
|
* @category tracing
|
|
16843
17384
|
* @since 2.0.0
|
|
16844
17385
|
*/
|
|
@@ -16869,6 +17410,7 @@ export const makeSpan: (name: string, options?: SpanOptionsNoTrace) => Effect<Sp
|
|
|
16869
17410
|
* Effect.runSync(program) // => "scoped-operation"
|
|
16870
17411
|
* ```
|
|
16871
17412
|
*
|
|
17413
|
+
* @stability stable
|
|
16872
17414
|
* @category tracing
|
|
16873
17415
|
* @since 2.0.0
|
|
16874
17416
|
*/
|
|
@@ -16898,6 +17440,7 @@ export const makeSpanScoped: (
|
|
|
16898
17440
|
* Effect.runSync(program) // => "user-operation: success"
|
|
16899
17441
|
* ```
|
|
16900
17442
|
*
|
|
17443
|
+
* @stability stable
|
|
16901
17444
|
* @category tracing
|
|
16902
17445
|
* @since 2.0.0
|
|
16903
17446
|
*/
|
|
@@ -16923,6 +17466,7 @@ export const useSpan: {
|
|
|
16923
17466
|
* Effect.runSync(program) // => "user-operation: success"
|
|
16924
17467
|
* ```
|
|
16925
17468
|
*
|
|
17469
|
+
* @stability stable
|
|
16926
17470
|
* @category tracing
|
|
16927
17471
|
* @since 2.0.0
|
|
16928
17472
|
*/
|
|
@@ -16948,6 +17492,7 @@ export const useSpan: {
|
|
|
16948
17492
|
* Effect.runSync(program) // => "user-operation: success"
|
|
16949
17493
|
* ```
|
|
16950
17494
|
*
|
|
17495
|
+
* @stability stable
|
|
16951
17496
|
* @category tracing
|
|
16952
17497
|
* @since 2.0.0
|
|
16953
17498
|
*/
|
|
@@ -16974,6 +17519,7 @@ export const useSpan: {
|
|
|
16974
17519
|
* Effect.runSync(traced) // => "result"
|
|
16975
17520
|
* ```
|
|
16976
17521
|
*
|
|
17522
|
+
* @stability stable
|
|
16977
17523
|
* @category tracing
|
|
16978
17524
|
* @since 2.0.0
|
|
16979
17525
|
*/
|
|
@@ -16994,6 +17540,7 @@ export const withSpan: {
|
|
|
16994
17540
|
* Effect.runSync(traced) // => "result"
|
|
16995
17541
|
* ```
|
|
16996
17542
|
*
|
|
17543
|
+
* @stability stable
|
|
16997
17544
|
* @category tracing
|
|
16998
17545
|
* @since 2.0.0
|
|
16999
17546
|
*/
|
|
@@ -17021,6 +17568,7 @@ export const withSpan: {
|
|
|
17021
17568
|
* Effect.runSync(traced) // => "result"
|
|
17022
17569
|
* ```
|
|
17023
17570
|
*
|
|
17571
|
+
* @stability stable
|
|
17024
17572
|
* @category tracing
|
|
17025
17573
|
* @since 2.0.0
|
|
17026
17574
|
*/
|
|
@@ -17049,6 +17597,7 @@ export const withSpan: {
|
|
|
17049
17597
|
* Effect.runSync(program) // => "completed"
|
|
17050
17598
|
* ```
|
|
17051
17599
|
*
|
|
17600
|
+
* @stability stable
|
|
17052
17601
|
* @category tracing
|
|
17053
17602
|
* @since 2.0.0
|
|
17054
17603
|
*/
|
|
@@ -17075,6 +17624,7 @@ export const withSpanScoped: {
|
|
|
17075
17624
|
* Effect.runSync(program) // => "completed"
|
|
17076
17625
|
* ```
|
|
17077
17626
|
*
|
|
17627
|
+
* @stability stable
|
|
17078
17628
|
* @category tracing
|
|
17079
17629
|
* @since 2.0.0
|
|
17080
17630
|
*/
|
|
@@ -17103,6 +17653,7 @@ export const withSpanScoped: {
|
|
|
17103
17653
|
* Effect.runSync(program) // => "completed"
|
|
17104
17654
|
* ```
|
|
17105
17655
|
*
|
|
17656
|
+
* @stability stable
|
|
17106
17657
|
* @category tracing
|
|
17107
17658
|
* @since 2.0.0
|
|
17108
17659
|
*/
|
|
@@ -17126,6 +17677,7 @@ export const withSpanScoped: {
|
|
|
17126
17677
|
* Effect.runSync(program) // => "completed"
|
|
17127
17678
|
* ```
|
|
17128
17679
|
*
|
|
17680
|
+
* @stability stable
|
|
17129
17681
|
* @category tracing
|
|
17130
17682
|
* @since 2.0.0
|
|
17131
17683
|
*/
|
|
@@ -17147,6 +17699,7 @@ export const withParentSpan: {
|
|
|
17147
17699
|
* Effect.runSync(program) // => "completed"
|
|
17148
17700
|
* ```
|
|
17149
17701
|
*
|
|
17702
|
+
* @stability stable
|
|
17150
17703
|
* @category tracing
|
|
17151
17704
|
* @since 2.0.0
|
|
17152
17705
|
*/
|
|
@@ -17168,6 +17721,7 @@ export const withParentSpan: {
|
|
|
17168
17721
|
* Effect.runSync(program) // => "completed"
|
|
17169
17722
|
* ```
|
|
17170
17723
|
*
|
|
17724
|
+
* @stability stable
|
|
17171
17725
|
* @category tracing
|
|
17172
17726
|
* @since 2.0.0
|
|
17173
17727
|
*/
|
|
@@ -17216,6 +17770,7 @@ export const withParentSpan: {
|
|
|
17216
17770
|
*
|
|
17217
17771
|
* @see {@link requestUnsafe} for the low-level entry point when you already have a `Context` and need to enqueue outside an `Effect`
|
|
17218
17772
|
*
|
|
17773
|
+
* @stability stable
|
|
17219
17774
|
* @category running
|
|
17220
17775
|
* @since 2.0.0
|
|
17221
17776
|
*/
|
|
@@ -17262,6 +17817,7 @@ export const request: {
|
|
|
17262
17817
|
*
|
|
17263
17818
|
* @see {@link requestUnsafe} for the low-level entry point when you already have a `Context` and need to enqueue outside an `Effect`
|
|
17264
17819
|
*
|
|
17820
|
+
* @stability stable
|
|
17265
17821
|
* @category running
|
|
17266
17822
|
* @since 2.0.0
|
|
17267
17823
|
*/
|
|
@@ -17308,6 +17864,7 @@ export const request: {
|
|
|
17308
17864
|
*
|
|
17309
17865
|
* @see {@link requestUnsafe} for the low-level entry point when you already have a `Context` and need to enqueue outside an `Effect`
|
|
17310
17866
|
*
|
|
17867
|
+
* @stability stable
|
|
17311
17868
|
* @category running
|
|
17312
17869
|
* @since 2.0.0
|
|
17313
17870
|
*/
|
|
@@ -17328,6 +17885,7 @@ export const request: {
|
|
|
17328
17885
|
*
|
|
17329
17886
|
* @see {@link request} for the `Effect`-returning API used for normal request execution
|
|
17330
17887
|
*
|
|
17888
|
+
* @stability stable
|
|
17331
17889
|
* @category unsafe
|
|
17332
17890
|
* @since 4.0.0
|
|
17333
17891
|
*/
|
|
@@ -17383,6 +17941,7 @@ export const requestUnsafe: <A extends Request.Any>(
|
|
|
17383
17941
|
* await Effect.runPromise(program) // => "result"
|
|
17384
17942
|
* ```
|
|
17385
17943
|
*
|
|
17944
|
+
* @stability stable
|
|
17386
17945
|
* @category forking
|
|
17387
17946
|
* @since 4.0.0
|
|
17388
17947
|
*/
|
|
@@ -17426,6 +17985,7 @@ export const forkChild: <
|
|
|
17426
17985
|
* await Effect.runPromise(program) // => "done"
|
|
17427
17986
|
* ```
|
|
17428
17987
|
*
|
|
17988
|
+
* @stability stable
|
|
17429
17989
|
* @category forking
|
|
17430
17990
|
* @since 2.0.0
|
|
17431
17991
|
*/
|
|
@@ -17453,6 +18013,7 @@ export const forkIn: {
|
|
|
17453
18013
|
* await Effect.runPromise(program) // => "done"
|
|
17454
18014
|
* ```
|
|
17455
18015
|
*
|
|
18016
|
+
* @stability stable
|
|
17456
18017
|
* @category forking
|
|
17457
18018
|
* @since 2.0.0
|
|
17458
18019
|
*/
|
|
@@ -17486,6 +18047,7 @@ export const forkIn: {
|
|
|
17486
18047
|
* await Effect.runPromise(program) // => "done"
|
|
17487
18048
|
* ```
|
|
17488
18049
|
*
|
|
18050
|
+
* @stability stable
|
|
17489
18051
|
* @category forking
|
|
17490
18052
|
* @since 2.0.0
|
|
17491
18053
|
*/
|
|
@@ -17521,6 +18083,7 @@ export const forkIn: {
|
|
|
17521
18083
|
* await Effect.runPromise(program) // => "scope completed"
|
|
17522
18084
|
* ```
|
|
17523
18085
|
*
|
|
18086
|
+
* @stability stable
|
|
17524
18087
|
* @category forking
|
|
17525
18088
|
* @since 2.0.0
|
|
17526
18089
|
*/
|
|
@@ -17561,6 +18124,7 @@ export const forkScoped: <
|
|
|
17561
18124
|
* await Effect.runPromise(program) // => "daemon result"
|
|
17562
18125
|
* ```
|
|
17563
18126
|
*
|
|
18127
|
+
* @stability stable
|
|
17564
18128
|
* @category forking
|
|
17565
18129
|
* @since 4.0.0
|
|
17566
18130
|
*/
|
|
@@ -17604,6 +18168,7 @@ export const forkDetach: <
|
|
|
17604
18168
|
* @see {@link forkIn} for forking into an explicit scope
|
|
17605
18169
|
* @see {@link forkScoped} for forking fibers tied to the current scope
|
|
17606
18170
|
*
|
|
18171
|
+
* @stability stable
|
|
17607
18172
|
* @category forking
|
|
17608
18173
|
* @since 2.0.0
|
|
17609
18174
|
*/
|
|
@@ -17627,6 +18192,7 @@ export const awaitAllChildren: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E,
|
|
|
17627
18192
|
* output // => ["number"]
|
|
17628
18193
|
* ```
|
|
17629
18194
|
*
|
|
18195
|
+
* @stability stable
|
|
17630
18196
|
* @category accessors
|
|
17631
18197
|
* @since 4.0.0
|
|
17632
18198
|
*/
|
|
@@ -17644,6 +18210,7 @@ export const fiber: Effect<Fiber<unknown, unknown>> = internal.fiber
|
|
|
17644
18210
|
* Effect.runSync(program) // => "number"
|
|
17645
18211
|
* ```
|
|
17646
18212
|
*
|
|
18213
|
+
* @stability stable
|
|
17647
18214
|
* @category accessors
|
|
17648
18215
|
* @since 2.0.0
|
|
17649
18216
|
*/
|
|
@@ -17673,6 +18240,7 @@ export const fiberId: Effect<number> = internal.fiberId
|
|
|
17673
18240
|
* @see {@link runPromise} for promise-based running with these options
|
|
17674
18241
|
* @see {@link runPromiseExit} for promise-based running that returns an `Exit`
|
|
17675
18242
|
*
|
|
18243
|
+
* @stability stable
|
|
17676
18244
|
* @category running
|
|
17677
18245
|
* @since 4.0.0
|
|
17678
18246
|
*/
|
|
@@ -17709,6 +18277,7 @@ export interface RunOptions {
|
|
|
17709
18277
|
* output // => ["running...", "done"]
|
|
17710
18278
|
* ```
|
|
17711
18279
|
*
|
|
18280
|
+
* @stability stable
|
|
17712
18281
|
* @category running
|
|
17713
18282
|
* @since 2.0.0
|
|
17714
18283
|
*/
|
|
@@ -17750,6 +18319,7 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
|
|
|
17750
18319
|
* output // => ["Hello from service!", "done"]
|
|
17751
18320
|
* ```
|
|
17752
18321
|
*
|
|
18322
|
+
* @stability stable
|
|
17753
18323
|
* @category running
|
|
17754
18324
|
* @since 4.0.0
|
|
17755
18325
|
*/
|
|
@@ -17802,6 +18372,7 @@ export const runForkWith: <R>(
|
|
|
17802
18372
|
* output // => ["Started", "Success"]
|
|
17803
18373
|
* ```
|
|
17804
18374
|
*
|
|
18375
|
+
* @stability stable
|
|
17805
18376
|
* @category running
|
|
17806
18377
|
* @since 4.0.0
|
|
17807
18378
|
*/
|
|
@@ -17849,6 +18420,7 @@ export const runCallbackWith: <R>(
|
|
|
17849
18420
|
* output // => ["working", "success: done"]
|
|
17850
18421
|
* ```
|
|
17851
18422
|
*
|
|
18423
|
+
* @stability stable
|
|
17852
18424
|
* @category running
|
|
17853
18425
|
* @since 2.0.0
|
|
17854
18426
|
*/
|
|
@@ -17891,6 +18463,7 @@ export const runCallback: <A, E>(
|
|
|
17891
18463
|
* ```
|
|
17892
18464
|
*
|
|
17893
18465
|
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
18466
|
+
* @stability stable
|
|
17894
18467
|
* @category running
|
|
17895
18468
|
* @since 2.0.0
|
|
17896
18469
|
*/
|
|
@@ -17930,6 +18503,7 @@ export const runPromise: <A, E>(
|
|
|
17930
18503
|
* await Effect.runPromiseWith(context)(program) // => "Connecting to https://api.example.com"
|
|
17931
18504
|
* ```
|
|
17932
18505
|
*
|
|
18506
|
+
* @stability stable
|
|
17933
18507
|
* @category running
|
|
17934
18508
|
* @since 4.0.0
|
|
17935
18509
|
*/
|
|
@@ -17966,6 +18540,7 @@ export const runPromiseWith: <R>(
|
|
|
17966
18540
|
*
|
|
17967
18541
|
* @see {@link runPromise} for a version that rejects on failure.
|
|
17968
18542
|
*
|
|
18543
|
+
* @stability stable
|
|
17969
18544
|
* @category running
|
|
17970
18545
|
* @since 2.0.0
|
|
17971
18546
|
*/
|
|
@@ -18010,6 +18585,7 @@ export const runPromiseExit: <A, E>(
|
|
|
18010
18585
|
* output // => ["Success: Result for: SELECT * FROM users"]
|
|
18011
18586
|
* ```
|
|
18012
18587
|
*
|
|
18588
|
+
* @stability stable
|
|
18013
18589
|
* @category running
|
|
18014
18590
|
* @since 4.0.0
|
|
18015
18591
|
*/
|
|
@@ -18071,6 +18647,7 @@ export const runPromiseExitWith: <R>(
|
|
|
18071
18647
|
*
|
|
18072
18648
|
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
18073
18649
|
* throwing an error.
|
|
18650
|
+
* @stability stable
|
|
18074
18651
|
* @category running
|
|
18075
18652
|
* @since 2.0.0
|
|
18076
18653
|
*/
|
|
@@ -18108,6 +18685,7 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
|
|
|
18108
18685
|
* result // => 5
|
|
18109
18686
|
* ```
|
|
18110
18687
|
*
|
|
18688
|
+
* @stability stable
|
|
18111
18689
|
* @category running
|
|
18112
18690
|
* @since 4.0.0
|
|
18113
18691
|
*/
|
|
@@ -18159,6 +18737,7 @@ export const runSyncWith: <R>(
|
|
|
18159
18737
|
*
|
|
18160
18738
|
* @see {@link runSync} for a version that throws on failure.
|
|
18161
18739
|
*
|
|
18740
|
+
* @stability stable
|
|
18162
18741
|
* @category running
|
|
18163
18742
|
* @since 2.0.0
|
|
18164
18743
|
*/
|
|
@@ -18204,6 +18783,7 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
|
|
|
18204
18783
|
* output // => ["[LOG] Computing result...", "Success: 42"]
|
|
18205
18784
|
* ```
|
|
18206
18785
|
*
|
|
18786
|
+
* @stability stable
|
|
18207
18787
|
* @category running
|
|
18208
18788
|
* @since 4.0.0
|
|
18209
18789
|
*/
|
|
@@ -18222,6 +18802,7 @@ export const runSyncExitWith: <R>(
|
|
|
18222
18802
|
*
|
|
18223
18803
|
* Use these to describe generator-based signatures and traced or untraced variants.
|
|
18224
18804
|
*
|
|
18805
|
+
* @stability stable
|
|
18225
18806
|
* @category constructors
|
|
18226
18807
|
* @since 3.11.0
|
|
18227
18808
|
*/
|
|
@@ -22396,6 +22977,7 @@ export declare namespace fn {
|
|
|
22396
22977
|
* Effect.runSync(program) // => "hello"
|
|
22397
22978
|
* ```
|
|
22398
22979
|
*
|
|
22980
|
+
* @stability stable
|
|
22399
22981
|
* @category constructors
|
|
22400
22982
|
* @since 3.12.0
|
|
22401
22983
|
*/
|
|
@@ -22520,6 +23102,7 @@ export const fnUntraced: fn.Untraced = internal.fnUntraced
|
|
|
22520
23102
|
* Effect.runSync(program) // => "hello"
|
|
22521
23103
|
* ```
|
|
22522
23104
|
*
|
|
23105
|
+
* @stability stable
|
|
22523
23106
|
* @category constructors
|
|
22524
23107
|
* @since 3.11.0
|
|
22525
23108
|
*/
|
|
@@ -22549,6 +23132,7 @@ export const fn: fn.Traced & {
|
|
|
22549
23132
|
* Effect.runSync(program) // => "Clock is available"
|
|
22550
23133
|
* ```
|
|
22551
23134
|
*
|
|
23135
|
+
* @stability stable
|
|
22552
23136
|
* @category accessors
|
|
22553
23137
|
* @since 2.0.0
|
|
22554
23138
|
*/
|
|
@@ -22590,6 +23174,7 @@ export const clockWith: <A, E, R>(
|
|
|
22590
23174
|
* output // => ["Warn: Cache miss"]
|
|
22591
23175
|
* ```
|
|
22592
23176
|
*
|
|
23177
|
+
* @stability stable
|
|
22593
23178
|
* @category logging
|
|
22594
23179
|
* @since 2.0.0
|
|
22595
23180
|
*/
|
|
@@ -22619,6 +23204,7 @@ export const logWithLevel: (level?: Severity) => (...message: ReadonlyArray<any>
|
|
|
22619
23204
|
* output // => ["Info: Result: 4", 4]
|
|
22620
23205
|
* ```
|
|
22621
23206
|
*
|
|
23207
|
+
* @stability stable
|
|
22622
23208
|
* @category logging
|
|
22623
23209
|
* @since 2.0.0
|
|
22624
23210
|
*/
|
|
@@ -22645,6 +23231,7 @@ export const log: (...message: ReadonlyArray<any>) => Effect<void> = internal.lo
|
|
|
22645
23231
|
* output // => ["Fatal: Critical system failure"]
|
|
22646
23232
|
* ```
|
|
22647
23233
|
*
|
|
23234
|
+
* @stability stable
|
|
22648
23235
|
* @category logging
|
|
22649
23236
|
* @since 2.0.0
|
|
22650
23237
|
*/
|
|
@@ -22670,6 +23257,7 @@ export const logFatal: (...message: ReadonlyArray<any>) => Effect<void> = intern
|
|
|
22670
23257
|
* output // => ["Warn: API rate limit approaching"]
|
|
22671
23258
|
* ```
|
|
22672
23259
|
*
|
|
23260
|
+
* @stability stable
|
|
22673
23261
|
* @category logging
|
|
22674
23262
|
* @since 2.0.0
|
|
22675
23263
|
*/
|
|
@@ -22695,6 +23283,7 @@ export const logWarning: (...message: ReadonlyArray<any>) => Effect<void> = inte
|
|
|
22695
23283
|
* output // => ["Error: Database connection failed"]
|
|
22696
23284
|
* ```
|
|
22697
23285
|
*
|
|
23286
|
+
* @stability stable
|
|
22698
23287
|
* @category logging
|
|
22699
23288
|
* @since 2.0.0
|
|
22700
23289
|
*/
|
|
@@ -22720,6 +23309,7 @@ export const logError: (...message: ReadonlyArray<any>) => Effect<void> = intern
|
|
|
22720
23309
|
* output // => ["Info: Application starting up"]
|
|
22721
23310
|
* ```
|
|
22722
23311
|
*
|
|
23312
|
+
* @stability stable
|
|
22723
23313
|
* @category logging
|
|
22724
23314
|
* @since 2.0.0
|
|
22725
23315
|
*/
|
|
@@ -22749,6 +23339,7 @@ export const logInfo: (...message: ReadonlyArray<any>) => Effect<void> = interna
|
|
|
22749
23339
|
* output // => ["Debug: Debug mode enabled"]
|
|
22750
23340
|
* ```
|
|
22751
23341
|
*
|
|
23342
|
+
* @stability stable
|
|
22752
23343
|
* @category logging
|
|
22753
23344
|
* @since 2.0.0
|
|
22754
23345
|
*/
|
|
@@ -22778,6 +23369,7 @@ export const logDebug: (...message: ReadonlyArray<any>) => Effect<void> = intern
|
|
|
22778
23369
|
* output // => ["Trace: Entering function processData"]
|
|
22779
23370
|
* ```
|
|
22780
23371
|
*
|
|
23372
|
+
* @stability stable
|
|
22781
23373
|
* @category logging
|
|
22782
23374
|
* @since 2.0.0
|
|
22783
23375
|
*/
|
|
@@ -22809,6 +23401,7 @@ export const logTrace: (...message: ReadonlyArray<any>) => Effect<void> = intern
|
|
|
22809
23401
|
* output // => ["[CUSTOM]: This will go to both default and custom logger"]
|
|
22810
23402
|
* ```
|
|
22811
23403
|
*
|
|
23404
|
+
* @stability stable
|
|
22812
23405
|
* @category logging
|
|
22813
23406
|
* @since 4.0.0
|
|
22814
23407
|
*/
|
|
@@ -22839,6 +23432,7 @@ export const withLogger: {
|
|
|
22839
23432
|
* output // => ["[CUSTOM]: This will go to both default and custom logger"]
|
|
22840
23433
|
* ```
|
|
22841
23434
|
*
|
|
23435
|
+
* @stability stable
|
|
22842
23436
|
* @category logging
|
|
22843
23437
|
* @since 4.0.0
|
|
22844
23438
|
*/
|
|
@@ -22869,6 +23463,7 @@ export const withLogger: {
|
|
|
22869
23463
|
* output // => ["[CUSTOM]: This will go to both default and custom logger"]
|
|
22870
23464
|
* ```
|
|
22871
23465
|
*
|
|
23466
|
+
* @stability stable
|
|
22872
23467
|
* @category logging
|
|
22873
23468
|
* @since 4.0.0
|
|
22874
23469
|
*/
|
|
@@ -22915,6 +23510,7 @@ export const withLogger: {
|
|
|
22915
23510
|
* output // => ["Starting operation", "Starting operation"]
|
|
22916
23511
|
* ```
|
|
22917
23512
|
*
|
|
23513
|
+
* @stability stable
|
|
22918
23514
|
* @category logging
|
|
22919
23515
|
* @since 2.0.0
|
|
22920
23516
|
*/
|
|
@@ -22951,6 +23547,7 @@ export const annotateLogs: {
|
|
|
22951
23547
|
* output // => ["Starting operation", "Starting operation"]
|
|
22952
23548
|
* ```
|
|
22953
23549
|
*
|
|
23550
|
+
* @stability stable
|
|
22954
23551
|
* @category logging
|
|
22955
23552
|
* @since 2.0.0
|
|
22956
23553
|
*/
|
|
@@ -22987,6 +23584,7 @@ export const annotateLogs: {
|
|
|
22987
23584
|
* output // => ["Starting operation", "Starting operation"]
|
|
22988
23585
|
* ```
|
|
22989
23586
|
*
|
|
23587
|
+
* @stability stable
|
|
22990
23588
|
* @category logging
|
|
22991
23589
|
* @since 2.0.0
|
|
22992
23590
|
*/
|
|
@@ -23023,6 +23621,7 @@ export const annotateLogs: {
|
|
|
23023
23621
|
* output // => ["Starting operation", "Starting operation"]
|
|
23024
23622
|
* ```
|
|
23025
23623
|
*
|
|
23624
|
+
* @stability stable
|
|
23026
23625
|
* @category logging
|
|
23027
23626
|
* @since 2.0.0
|
|
23028
23627
|
*/
|
|
@@ -23059,6 +23658,7 @@ export const annotateLogs: {
|
|
|
23059
23658
|
* output // => ["Starting operation", "Starting operation"]
|
|
23060
23659
|
* ```
|
|
23061
23660
|
*
|
|
23661
|
+
* @stability stable
|
|
23062
23662
|
* @category logging
|
|
23063
23663
|
* @since 2.0.0
|
|
23064
23664
|
*/
|
|
@@ -23116,6 +23716,7 @@ export const annotateLogs: {
|
|
|
23116
23716
|
*
|
|
23117
23717
|
* @see {@link annotateLogs} for annotating one effect
|
|
23118
23718
|
*
|
|
23719
|
+
* @stability stable
|
|
23119
23720
|
* @category logging
|
|
23120
23721
|
* @since 3.1.0
|
|
23121
23722
|
*/
|
|
@@ -23156,6 +23757,7 @@ export const annotateLogsScoped: {
|
|
|
23156
23757
|
*
|
|
23157
23758
|
* @see {@link annotateLogs} for annotating one effect
|
|
23158
23759
|
*
|
|
23760
|
+
* @stability stable
|
|
23159
23761
|
* @category logging
|
|
23160
23762
|
* @since 3.1.0
|
|
23161
23763
|
*/
|
|
@@ -23196,6 +23798,7 @@ export const annotateLogsScoped: {
|
|
|
23196
23798
|
*
|
|
23197
23799
|
* @see {@link annotateLogs} for annotating one effect
|
|
23198
23800
|
*
|
|
23801
|
+
* @stability stable
|
|
23199
23802
|
* @category logging
|
|
23200
23803
|
* @since 3.1.0
|
|
23201
23804
|
*/
|
|
@@ -23234,6 +23837,7 @@ export const annotateLogsScoped: {
|
|
|
23234
23837
|
* output // => ["Making HTTP request", "Connecting to database", "Executing query", "Processing results", "Sending response", "data"]
|
|
23235
23838
|
* ```
|
|
23236
23839
|
*
|
|
23840
|
+
* @stability stable
|
|
23237
23841
|
* @category logging
|
|
23238
23842
|
* @since 2.0.0
|
|
23239
23843
|
*/
|
|
@@ -23270,6 +23874,7 @@ export const withLogSpan: {
|
|
|
23270
23874
|
* output // => ["Making HTTP request", "Connecting to database", "Executing query", "Processing results", "Sending response", "data"]
|
|
23271
23875
|
* ```
|
|
23272
23876
|
*
|
|
23877
|
+
* @stability stable
|
|
23273
23878
|
* @category logging
|
|
23274
23879
|
* @since 2.0.0
|
|
23275
23880
|
*/
|
|
@@ -23306,6 +23911,7 @@ export const withLogSpan: {
|
|
|
23306
23911
|
* output // => ["Making HTTP request", "Connecting to database", "Executing query", "Processing results", "Sending response", "data"]
|
|
23307
23912
|
* ```
|
|
23308
23913
|
*
|
|
23914
|
+
* @stability stable
|
|
23309
23915
|
* @category logging
|
|
23310
23916
|
* @since 2.0.0
|
|
23311
23917
|
*/
|
|
@@ -23367,6 +23973,7 @@ export const withLogSpan: {
|
|
|
23367
23973
|
* Effect.runSync(Metric.value(exitTracker)).occurrences.get("success") // => 1
|
|
23368
23974
|
* ```
|
|
23369
23975
|
*
|
|
23976
|
+
* @stability stable
|
|
23370
23977
|
* @category metrics
|
|
23371
23978
|
* @since 4.0.0
|
|
23372
23979
|
*/
|
|
@@ -23418,6 +24025,7 @@ export const track: {
|
|
|
23418
24025
|
* Effect.runSync(Metric.value(exitTracker)).occurrences.get("success") // => 1
|
|
23419
24026
|
* ```
|
|
23420
24027
|
*
|
|
24028
|
+
* @stability stable
|
|
23421
24029
|
* @category metrics
|
|
23422
24030
|
* @since 4.0.0
|
|
23423
24031
|
*/
|
|
@@ -23469,6 +24077,7 @@ export const track: {
|
|
|
23469
24077
|
* Effect.runSync(Metric.value(exitTracker)).occurrences.get("success") // => 1
|
|
23470
24078
|
* ```
|
|
23471
24079
|
*
|
|
24080
|
+
* @stability stable
|
|
23472
24081
|
* @category metrics
|
|
23473
24082
|
* @since 4.0.0
|
|
23474
24083
|
*/
|
|
@@ -23520,6 +24129,7 @@ export const track: {
|
|
|
23520
24129
|
* Effect.runSync(Metric.value(exitTracker)).occurrences.get("success") // => 1
|
|
23521
24130
|
* ```
|
|
23522
24131
|
*
|
|
24132
|
+
* @stability stable
|
|
23523
24133
|
* @category metrics
|
|
23524
24134
|
* @since 4.0.0
|
|
23525
24135
|
*/
|
|
@@ -23575,6 +24185,7 @@ export const track: {
|
|
|
23575
24185
|
* Effect.runSync(Metric.value(exitTracker)).occurrences.get("success") // => 1
|
|
23576
24186
|
* ```
|
|
23577
24187
|
*
|
|
24188
|
+
* @stability stable
|
|
23578
24189
|
* @category metrics
|
|
23579
24190
|
* @since 4.0.0
|
|
23580
24191
|
*/
|
|
@@ -23637,6 +24248,7 @@ export const track: {
|
|
|
23637
24248
|
* Effect.runSync(Metric.value(requestSizeGauge)).value // => 12
|
|
23638
24249
|
* ```
|
|
23639
24250
|
*
|
|
24251
|
+
* @stability stable
|
|
23640
24252
|
* @category metrics
|
|
23641
24253
|
* @since 4.0.0
|
|
23642
24254
|
*/
|
|
@@ -23683,6 +24295,7 @@ export const trackSuccesses: {
|
|
|
23683
24295
|
* Effect.runSync(Metric.value(requestSizeGauge)).value // => 12
|
|
23684
24296
|
* ```
|
|
23685
24297
|
*
|
|
24298
|
+
* @stability stable
|
|
23686
24299
|
* @category metrics
|
|
23687
24300
|
* @since 4.0.0
|
|
23688
24301
|
*/
|
|
@@ -23729,6 +24342,7 @@ export const trackSuccesses: {
|
|
|
23729
24342
|
* Effect.runSync(Metric.value(requestSizeGauge)).value // => 12
|
|
23730
24343
|
* ```
|
|
23731
24344
|
*
|
|
24345
|
+
* @stability stable
|
|
23732
24346
|
* @category metrics
|
|
23733
24347
|
* @since 4.0.0
|
|
23734
24348
|
*/
|
|
@@ -23775,6 +24389,7 @@ export const trackSuccesses: {
|
|
|
23775
24389
|
* Effect.runSync(Metric.value(requestSizeGauge)).value // => 12
|
|
23776
24390
|
* ```
|
|
23777
24391
|
*
|
|
24392
|
+
* @stability stable
|
|
23778
24393
|
* @category metrics
|
|
23779
24394
|
* @since 4.0.0
|
|
23780
24395
|
*/
|
|
@@ -23825,6 +24440,7 @@ export const trackSuccesses: {
|
|
|
23825
24440
|
* Effect.runSync(Metric.value(requestSizeGauge)).value // => 12
|
|
23826
24441
|
* ```
|
|
23827
24442
|
*
|
|
24443
|
+
* @stability stable
|
|
23828
24444
|
* @category metrics
|
|
23829
24445
|
* @since 4.0.0
|
|
23830
24446
|
*/
|
|
@@ -23886,6 +24502,7 @@ export const trackSuccesses: {
|
|
|
23886
24502
|
* Effect.runSync(Metric.value(errorTypeFrequency)).occurrences.get("ConnectionFailedError") // => 1
|
|
23887
24503
|
* ```
|
|
23888
24504
|
*
|
|
24505
|
+
* @stability stable
|
|
23889
24506
|
* @category metrics
|
|
23890
24507
|
* @since 4.0.0
|
|
23891
24508
|
*/
|
|
@@ -23934,6 +24551,7 @@ export const trackErrors: {
|
|
|
23934
24551
|
* Effect.runSync(Metric.value(errorTypeFrequency)).occurrences.get("ConnectionFailedError") // => 1
|
|
23935
24552
|
* ```
|
|
23936
24553
|
*
|
|
24554
|
+
* @stability stable
|
|
23937
24555
|
* @category metrics
|
|
23938
24556
|
* @since 4.0.0
|
|
23939
24557
|
*/
|
|
@@ -23982,6 +24600,7 @@ export const trackErrors: {
|
|
|
23982
24600
|
* Effect.runSync(Metric.value(errorTypeFrequency)).occurrences.get("ConnectionFailedError") // => 1
|
|
23983
24601
|
* ```
|
|
23984
24602
|
*
|
|
24603
|
+
* @stability stable
|
|
23985
24604
|
* @category metrics
|
|
23986
24605
|
* @since 4.0.0
|
|
23987
24606
|
*/
|
|
@@ -24030,6 +24649,7 @@ export const trackErrors: {
|
|
|
24030
24649
|
* Effect.runSync(Metric.value(errorTypeFrequency)).occurrences.get("ConnectionFailedError") // => 1
|
|
24031
24650
|
* ```
|
|
24032
24651
|
*
|
|
24652
|
+
* @stability stable
|
|
24033
24653
|
* @category metrics
|
|
24034
24654
|
* @since 4.0.0
|
|
24035
24655
|
*/
|
|
@@ -24082,6 +24702,7 @@ export const trackErrors: {
|
|
|
24082
24702
|
* Effect.runSync(Metric.value(errorTypeFrequency)).occurrences.get("ConnectionFailedError") // => 1
|
|
24083
24703
|
* ```
|
|
24084
24704
|
*
|
|
24705
|
+
* @stability stable
|
|
24085
24706
|
* @category metrics
|
|
24086
24707
|
* @since 4.0.0
|
|
24087
24708
|
*/
|
|
@@ -24144,6 +24765,7 @@ export const trackErrors: {
|
|
|
24144
24765
|
* Effect.runSync(Metric.value(defectTypeFrequency)).occurrences.get("Error") // => 1
|
|
24145
24766
|
* ```
|
|
24146
24767
|
*
|
|
24768
|
+
* @stability stable
|
|
24147
24769
|
* @category metrics
|
|
24148
24770
|
* @since 4.0.0
|
|
24149
24771
|
*/
|
|
@@ -24193,6 +24815,7 @@ export const trackDefects: {
|
|
|
24193
24815
|
* Effect.runSync(Metric.value(defectTypeFrequency)).occurrences.get("Error") // => 1
|
|
24194
24816
|
* ```
|
|
24195
24817
|
*
|
|
24818
|
+
* @stability stable
|
|
24196
24819
|
* @category metrics
|
|
24197
24820
|
* @since 4.0.0
|
|
24198
24821
|
*/
|
|
@@ -24242,6 +24865,7 @@ export const trackDefects: {
|
|
|
24242
24865
|
* Effect.runSync(Metric.value(defectTypeFrequency)).occurrences.get("Error") // => 1
|
|
24243
24866
|
* ```
|
|
24244
24867
|
*
|
|
24868
|
+
* @stability stable
|
|
24245
24869
|
* @category metrics
|
|
24246
24870
|
* @since 4.0.0
|
|
24247
24871
|
*/
|
|
@@ -24291,6 +24915,7 @@ export const trackDefects: {
|
|
|
24291
24915
|
* Effect.runSync(Metric.value(defectTypeFrequency)).occurrences.get("Error") // => 1
|
|
24292
24916
|
* ```
|
|
24293
24917
|
*
|
|
24918
|
+
* @stability stable
|
|
24294
24919
|
* @category metrics
|
|
24295
24920
|
* @since 4.0.0
|
|
24296
24921
|
*/
|
|
@@ -24344,6 +24969,7 @@ export const trackDefects: {
|
|
|
24344
24969
|
* Effect.runSync(Metric.value(defectTypeFrequency)).occurrences.get("Error") // => 1
|
|
24345
24970
|
* ```
|
|
24346
24971
|
*
|
|
24972
|
+
* @stability stable
|
|
24347
24973
|
* @category metrics
|
|
24348
24974
|
* @since 4.0.0
|
|
24349
24975
|
*/
|
|
@@ -24398,6 +25024,7 @@ export const trackDefects: {
|
|
|
24398
25024
|
* Effect.runSync(Metric.value(durationGauge)).value // => 1
|
|
24399
25025
|
* ```
|
|
24400
25026
|
*
|
|
25027
|
+
* @stability stable
|
|
24401
25028
|
* @category metrics
|
|
24402
25029
|
* @since 4.0.0
|
|
24403
25030
|
*/
|
|
@@ -24443,6 +25070,7 @@ export const trackDuration: {
|
|
|
24443
25070
|
* Effect.runSync(Metric.value(durationGauge)).value // => 1
|
|
24444
25071
|
* ```
|
|
24445
25072
|
*
|
|
25073
|
+
* @stability stable
|
|
24446
25074
|
* @category metrics
|
|
24447
25075
|
* @since 4.0.0
|
|
24448
25076
|
*/
|
|
@@ -24491,6 +25119,7 @@ export const trackDuration: {
|
|
|
24491
25119
|
* Effect.runSync(Metric.value(durationGauge)).value // => 1
|
|
24492
25120
|
* ```
|
|
24493
25121
|
*
|
|
25122
|
+
* @stability stable
|
|
24494
25123
|
* @category metrics
|
|
24495
25124
|
* @since 4.0.0
|
|
24496
25125
|
*/
|
|
@@ -24536,6 +25165,7 @@ export const trackDuration: {
|
|
|
24536
25165
|
* Effect.runSync(Metric.value(durationGauge)).value // => 1
|
|
24537
25166
|
* ```
|
|
24538
25167
|
*
|
|
25168
|
+
* @stability stable
|
|
24539
25169
|
* @category metrics
|
|
24540
25170
|
* @since 4.0.0
|
|
24541
25171
|
*/
|
|
@@ -24585,6 +25215,7 @@ export const trackDuration: {
|
|
|
24585
25215
|
* Effect.runSync(Metric.value(durationGauge)).value // => 1
|
|
24586
25216
|
* ```
|
|
24587
25217
|
*
|
|
25218
|
+
* @stability stable
|
|
24588
25219
|
* @category metrics
|
|
24589
25220
|
* @since 4.0.0
|
|
24590
25221
|
*/
|
|
@@ -24641,6 +25272,7 @@ export const trackDuration: {
|
|
|
24641
25272
|
* Effect.runSync(runnable) // => "Transaction complete"
|
|
24642
25273
|
* ```
|
|
24643
25274
|
*
|
|
25275
|
+
* @stability stable
|
|
24644
25276
|
* @category transactions
|
|
24645
25277
|
* @since 4.0.0
|
|
24646
25278
|
*/
|
|
@@ -24702,6 +25334,7 @@ export class Transaction extends Context.Service<
|
|
|
24702
25334
|
* output // => ["Transaction sum: 30", "Final ref1: 10", "Final ref2: 20"]
|
|
24703
25335
|
* ```
|
|
24704
25336
|
*
|
|
25337
|
+
* @stability stable
|
|
24705
25338
|
* @category transactions
|
|
24706
25339
|
* @since 4.0.0
|
|
24707
25340
|
*/
|
|
@@ -24710,7 +25343,7 @@ export const tx = <A, E, R>(
|
|
|
24710
25343
|
): Effect<A, E, Exclude<R, Transaction>> =>
|
|
24711
25344
|
withFiber((fiber) => {
|
|
24712
25345
|
let state = Context.getOrUndefined(fiber.context, Transaction)
|
|
24713
|
-
if (state) {
|
|
25346
|
+
if (state && !completedTransactions.has(state)) {
|
|
24714
25347
|
return effect as Effect<A, E, Exclude<R, Transaction>>
|
|
24715
25348
|
}
|
|
24716
25349
|
// Create transaction state only at the outermost boundary
|
|
@@ -24723,8 +25356,11 @@ export const tx = <A, E, R>(
|
|
|
24723
25356
|
body: constant(
|
|
24724
25357
|
restore(effect).pipe(
|
|
24725
25358
|
provideService(Transaction, state),
|
|
24726
|
-
tapCause(() => {
|
|
25359
|
+
tapCause((cause) => {
|
|
24727
25360
|
if (!state.retry) return void_
|
|
25361
|
+
// txRetry interrupts the body; any other reason in the cause is a real failure.
|
|
25362
|
+
// Roll back now so the step below fails instead of waiting or rerunning.
|
|
25363
|
+
if (!internal.hasInterruptsOnly(cause)) return sync(() => clearTransaction(state))
|
|
24728
25364
|
return restore(awaitPendingTransaction(state))
|
|
24729
25365
|
}),
|
|
24730
25366
|
exit
|
|
@@ -24736,9 +25372,9 @@ export const tx = <A, E, R>(
|
|
|
24736
25372
|
}
|
|
24737
25373
|
if (Exit.isSuccess(exit)) {
|
|
24738
25374
|
commitTransaction(fiber, state)
|
|
24739
|
-
} else {
|
|
24740
|
-
clearTransaction(state)
|
|
24741
25375
|
}
|
|
25376
|
+
clearTransaction(state)
|
|
25377
|
+
completedTransactions.add(state)
|
|
24742
25378
|
result = exit
|
|
24743
25379
|
}
|
|
24744
25380
|
}),
|
|
@@ -24747,6 +25383,10 @@ export const tx = <A, E, R>(
|
|
|
24747
25383
|
)
|
|
24748
25384
|
})
|
|
24749
25385
|
|
|
25386
|
+
// Child fibers inherit the boundary's state, so mark it completed once the
|
|
25387
|
+
// boundary finishes and let later `tx` calls start a fresh boundary.
|
|
25388
|
+
const completedTransactions = new WeakSet<Transaction["Service"]>()
|
|
25389
|
+
|
|
24750
25390
|
const isTransactionConsistent = (state: Transaction["Service"]) => {
|
|
24751
25391
|
for (const [ref, { version }] of state.journal) {
|
|
24752
25392
|
if (ref.version !== version) {
|
|
@@ -24833,6 +25473,7 @@ function clearTransaction(state: Transaction["Service"]) {
|
|
|
24833
25473
|
* await Effect.runPromise(program) // => 1
|
|
24834
25474
|
* ```
|
|
24835
25475
|
*
|
|
25476
|
+
* @stability stable
|
|
24836
25477
|
* @category transactions
|
|
24837
25478
|
* @since 4.0.0
|
|
24838
25479
|
*/
|
|
@@ -24846,6 +25487,7 @@ export const txRetry: Effect<never, never, Transaction> = flatMap(
|
|
|
24846
25487
|
/**
|
|
24847
25488
|
* Type helpers for converting callback-based functions into `Effect` functions.
|
|
24848
25489
|
*
|
|
25490
|
+
* @stability stable
|
|
24849
25491
|
* @category converting
|
|
24850
25492
|
* @since 4.0.0
|
|
24851
25493
|
*/
|
|
@@ -25142,6 +25784,7 @@ type EffectifyArgs<F extends (...args: Array<any>) => any> = Parameters<F> exten
|
|
|
25142
25784
|
* error.message // => "Failed to process hello: unavailable"
|
|
25143
25785
|
* ```
|
|
25144
25786
|
*
|
|
25787
|
+
* @stability stable
|
|
25145
25788
|
* @category converting
|
|
25146
25789
|
* @since 4.0.0
|
|
25147
25790
|
*/
|
|
@@ -25195,6 +25838,7 @@ export const effectify: {
|
|
|
25195
25838
|
* error.message // => "Failed to process hello: unavailable"
|
|
25196
25839
|
* ```
|
|
25197
25840
|
*
|
|
25841
|
+
* @stability stable
|
|
25198
25842
|
* @category converting
|
|
25199
25843
|
* @since 4.0.0
|
|
25200
25844
|
*/
|
|
@@ -25248,6 +25892,7 @@ export const effectify: {
|
|
|
25248
25892
|
* error.message // => "Failed to process hello: unavailable"
|
|
25249
25893
|
* ```
|
|
25250
25894
|
*
|
|
25895
|
+
* @stability stable
|
|
25251
25896
|
* @category converting
|
|
25252
25897
|
* @since 4.0.0
|
|
25253
25898
|
*/
|
|
@@ -25304,6 +25949,7 @@ export const effectify: {
|
|
|
25304
25949
|
* error.message // => "Failed to process hello: unavailable"
|
|
25305
25950
|
* ```
|
|
25306
25951
|
*
|
|
25952
|
+
* @stability stable
|
|
25307
25953
|
* @category converting
|
|
25308
25954
|
* @since 4.0.0
|
|
25309
25955
|
*/
|
|
@@ -25319,7 +25965,7 @@ export const effectify: {
|
|
|
25319
25965
|
try {
|
|
25320
25966
|
fn(...args, (err: globalThis.Error | null, result: A) => {
|
|
25321
25967
|
if (err) {
|
|
25322
|
-
resume(
|
|
25968
|
+
resume(onError ? suspend(() => fail(onError(err, args))) : fail(err))
|
|
25323
25969
|
} else {
|
|
25324
25970
|
resume(succeed(result))
|
|
25325
25971
|
}
|
|
@@ -25359,6 +26005,7 @@ export const effectify: {
|
|
|
25359
26005
|
* // Type 'string' is not assignable to type 'number'
|
|
25360
26006
|
* ```
|
|
25361
26007
|
*
|
|
26008
|
+
* @stability stable
|
|
25362
26009
|
* @category utility types
|
|
25363
26010
|
* @since 4.0.0
|
|
25364
26011
|
*/
|
|
@@ -25392,6 +26039,7 @@ export const satisfiesSuccessType = <A>() => <A2 extends A, E, R>(effect: Effect
|
|
|
25392
26039
|
* // Type 'string' is not assignable to type 'ValidationError'
|
|
25393
26040
|
* ```
|
|
25394
26041
|
*
|
|
26042
|
+
* @stability stable
|
|
25395
26043
|
* @category utility types
|
|
25396
26044
|
* @since 4.0.0
|
|
25397
26045
|
*/
|
|
@@ -25422,6 +26070,7 @@ export const satisfiesErrorType = <E>() => <A, E2 extends E, R>(effect: Effect<A
|
|
|
25422
26070
|
* // const constrainedInvalid = satisfiesStringServices(invalidEffect)
|
|
25423
26071
|
* ```
|
|
25424
26072
|
*
|
|
26073
|
+
* @stability stable
|
|
25425
26074
|
* @category utility types
|
|
25426
26075
|
* @since 4.0.0
|
|
25427
26076
|
*/
|
|
@@ -25456,6 +26105,7 @@ export const satisfiesServicesType = <R>() => <A, E, R2 extends R>(effect: Effec
|
|
|
25456
26105
|
* await Effect.runPromise(Effect.all([mapped, mappedPending])) // => [10, 10]
|
|
25457
26106
|
* ```
|
|
25458
26107
|
*
|
|
26108
|
+
* @stability stable
|
|
25459
26109
|
* @category mapping
|
|
25460
26110
|
* @since 4.0.0
|
|
25461
26111
|
*/
|
|
@@ -25489,6 +26139,7 @@ export const mapEager: {
|
|
|
25489
26139
|
* await Effect.runPromise(Effect.all([mapped, mappedPending])) // => [10, 10]
|
|
25490
26140
|
* ```
|
|
25491
26141
|
*
|
|
26142
|
+
* @stability stable
|
|
25492
26143
|
* @category mapping
|
|
25493
26144
|
* @since 4.0.0
|
|
25494
26145
|
*/
|
|
@@ -25522,6 +26173,7 @@ export const mapEager: {
|
|
|
25522
26173
|
* await Effect.runPromise(Effect.all([mapped, mappedPending])) // => [10, 10]
|
|
25523
26174
|
* ```
|
|
25524
26175
|
*
|
|
26176
|
+
* @stability stable
|
|
25525
26177
|
* @category mapping
|
|
25526
26178
|
* @since 4.0.0
|
|
25527
26179
|
*/
|
|
@@ -25567,6 +26219,7 @@ export const mapEager: {
|
|
|
25567
26219
|
* output // => [['mapped: original error', 'mapped: error']]
|
|
25568
26220
|
* ```
|
|
25569
26221
|
*
|
|
26222
|
+
* @stability stable
|
|
25570
26223
|
* @category error handling
|
|
25571
26224
|
* @since 4.0.0
|
|
25572
26225
|
*/
|
|
@@ -25610,6 +26263,7 @@ export const mapErrorEager: {
|
|
|
25610
26263
|
* output // => [['mapped: original error', 'mapped: error']]
|
|
25611
26264
|
* ```
|
|
25612
26265
|
*
|
|
26266
|
+
* @stability stable
|
|
25613
26267
|
* @category error handling
|
|
25614
26268
|
* @since 4.0.0
|
|
25615
26269
|
*/
|
|
@@ -25653,6 +26307,7 @@ export const mapErrorEager: {
|
|
|
25653
26307
|
* output // => [['mapped: original error', 'mapped: error']]
|
|
25654
26308
|
* ```
|
|
25655
26309
|
*
|
|
26310
|
+
* @stability stable
|
|
25656
26311
|
* @category error handling
|
|
25657
26312
|
* @since 4.0.0
|
|
25658
26313
|
*/
|
|
@@ -25697,6 +26352,7 @@ export const mapErrorEager: {
|
|
|
25697
26352
|
* output // => [10, "Failed: error"]
|
|
25698
26353
|
* ```
|
|
25699
26354
|
*
|
|
26355
|
+
* @stability stable
|
|
25700
26356
|
* @category mapping
|
|
25701
26357
|
* @since 4.0.0
|
|
25702
26358
|
*/
|
|
@@ -25739,6 +26395,7 @@ export const mapBothEager: {
|
|
|
25739
26395
|
* output // => [10, "Failed: error"]
|
|
25740
26396
|
* ```
|
|
25741
26397
|
*
|
|
26398
|
+
* @stability stable
|
|
25742
26399
|
* @category mapping
|
|
25743
26400
|
* @since 4.0.0
|
|
25744
26401
|
*/
|
|
@@ -25783,6 +26440,7 @@ export const mapBothEager: {
|
|
|
25783
26440
|
* output // => [10, "Failed: error"]
|
|
25784
26441
|
* ```
|
|
25785
26442
|
*
|
|
26443
|
+
* @stability stable
|
|
25786
26444
|
* @category mapping
|
|
25787
26445
|
* @since 4.0.0
|
|
25788
26446
|
*/
|
|
@@ -25825,6 +26483,7 @@ export const mapBothEager: {
|
|
|
25825
26483
|
* await Effect.runPromise(Effect.all([flatMapped, flatMappedPending])) // => [10, 10]
|
|
25826
26484
|
* ```
|
|
25827
26485
|
*
|
|
26486
|
+
* @stability stable
|
|
25828
26487
|
* @category sequencing
|
|
25829
26488
|
* @since 4.0.0
|
|
25830
26489
|
*/
|
|
@@ -25862,6 +26521,7 @@ export const flatMapEager: {
|
|
|
25862
26521
|
* await Effect.runPromise(Effect.all([flatMapped, flatMappedPending])) // => [10, 10]
|
|
25863
26522
|
* ```
|
|
25864
26523
|
*
|
|
26524
|
+
* @stability stable
|
|
25865
26525
|
* @category sequencing
|
|
25866
26526
|
* @since 4.0.0
|
|
25867
26527
|
*/
|
|
@@ -25899,6 +26559,7 @@ export const flatMapEager: {
|
|
|
25899
26559
|
* await Effect.runPromise(Effect.all([flatMapped, flatMappedPending])) // => [10, 10]
|
|
25900
26560
|
* ```
|
|
25901
26561
|
*
|
|
26562
|
+
* @stability stable
|
|
25902
26563
|
* @category sequencing
|
|
25903
26564
|
* @since 4.0.0
|
|
25904
26565
|
*/
|
|
@@ -25954,6 +26615,7 @@ export const flatMapEager: {
|
|
|
25954
26615
|
* output // => [['recovered from: original error', 42, 'recovered from: error']]
|
|
25955
26616
|
* ```
|
|
25956
26617
|
*
|
|
26618
|
+
* @stability stable
|
|
25957
26619
|
* @category error handling
|
|
25958
26620
|
* @since 4.0.0
|
|
25959
26621
|
*/
|
|
@@ -26007,6 +26669,7 @@ export const catchEager: {
|
|
|
26007
26669
|
* output // => [['recovered from: original error', 42, 'recovered from: error']]
|
|
26008
26670
|
* ```
|
|
26009
26671
|
*
|
|
26672
|
+
* @stability stable
|
|
26010
26673
|
* @category error handling
|
|
26011
26674
|
* @since 4.0.0
|
|
26012
26675
|
*/
|
|
@@ -26060,6 +26723,7 @@ export const catchEager: {
|
|
|
26060
26723
|
* output // => [['recovered from: original error', 42, 'recovered from: error']]
|
|
26061
26724
|
* ```
|
|
26062
26725
|
*
|
|
26726
|
+
* @stability stable
|
|
26063
26727
|
* @category error handling
|
|
26064
26728
|
* @since 4.0.0
|
|
26065
26729
|
*/
|
|
@@ -26089,6 +26753,7 @@ export const catchEager: {
|
|
|
26089
26753
|
* Effect.runSync(effect) // => "computed eagerly"
|
|
26090
26754
|
* ```
|
|
26091
26755
|
*
|
|
26756
|
+
* @stability stable
|
|
26092
26757
|
* @category constructors
|
|
26093
26758
|
* @since 4.0.0
|
|
26094
26759
|
*/
|