effect 4.0.0-beta.74 → 4.0.0-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +729 -611
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +273 -213
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +37 -30
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +19 -16
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +34 -40
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +16 -16
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +8 -8
- package/dist/Boolean.js +4 -4
- package/dist/Brand.d.ts +13 -11
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +10 -8
- package/dist/Brand.js.map +1 -1
- package/dist/Cause.d.ts +21 -23
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +21 -23
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +219 -9
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +83 -3
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -11
- package/dist/ChannelSchema.js +5 -5
- package/dist/Chunk.d.ts +69 -16
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +43 -8
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +3 -3
- package/dist/Clock.js +3 -3
- package/dist/Combiner.d.ts +9 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +9 -13
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +49 -56
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +40 -43
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +34 -44
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +24 -32
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.js +2 -2
- package/dist/Context.d.ts +60 -72
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +28 -32
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +2 -2
- package/dist/Cron.js +2 -2
- package/dist/Crypto.d.ts +4 -4
- package/dist/Crypto.js +4 -4
- package/dist/Data.d.ts +21 -15
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +7 -7
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +35 -16
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +35 -8
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +24 -15
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +8 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +44 -31
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +22 -11
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +516 -416
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +234 -174
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +5 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +5 -0
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +26 -39
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +10 -17
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +71 -99
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +53 -73
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +1 -1
- package/dist/ErrorReporter.js +1 -1
- package/dist/Exit.d.ts +79 -96
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +57 -64
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +8 -6
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +8 -6
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +25 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +15 -0
- 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 +15 -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 +10 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/Filter.d.ts +4 -4
- package/dist/Filter.js +4 -4
- package/dist/Formatter.d.ts +14 -19
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +14 -19
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +15 -16
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +9 -10
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +2 -2
- package/dist/Graph.js +2 -2
- package/dist/HKT.d.ts +2 -2
- package/dist/Hash.d.ts +2 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +2 -1
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +15 -0
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +5 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +9 -9
- package/dist/HashRing.js +3 -3
- package/dist/Iterable.d.ts +24 -12
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +16 -6
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +2 -3
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +2 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +2 -6
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +2 -6
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +17 -13
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +17 -13
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +4 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +4 -3
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +92 -114
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +38 -46
- package/dist/Layer.js.map +1 -1
- package/dist/Logger.d.ts +11 -14
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +11 -14
- package/dist/Logger.js.map +1 -1
- package/dist/Match.d.ts +2 -2
- package/dist/Match.js +2 -2
- package/dist/Metric.d.ts +89 -109
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +51 -61
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +21 -12
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +7 -4
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableList.d.ts +15 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +15 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +56 -42
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +28 -22
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +10 -7
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +10 -7
- package/dist/Newtype.js.map +1 -1
- package/dist/Number.d.ts +23 -11
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +9 -5
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +16 -16
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +10 -9
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +196 -168
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +96 -79
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +118 -179
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +92 -144
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +14 -14
- package/dist/PartitionedSemaphore.js +6 -6
- package/dist/Path.d.ts +2 -2
- package/dist/Path.js +2 -2
- package/dist/Pipeable.d.ts +2 -2
- package/dist/Pipeable.js +2 -2
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +4 -4
- package/dist/Pool.d.ts +7 -11
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +3 -5
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +274 -263
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +128 -123
- package/dist/Predicate.js.map +1 -1
- package/dist/PubSub.d.ts +24 -14
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +16 -6
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +4 -4
- package/dist/Pull.js +4 -4
- package/dist/Queue.d.ts +46 -7
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +46 -7
- package/dist/Queue.js.map +1 -1
- package/dist/RcRef.d.ts +0 -4
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Redactable.d.ts +2 -2
- package/dist/Redactable.js +2 -2
- package/dist/Redacted.d.ts +3 -3
- package/dist/Redacted.js +3 -3
- package/dist/Reducer.d.ts +2 -3
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -3
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +17 -16
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +15 -14
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +4 -4
- package/dist/References.js +4 -4
- package/dist/Request.d.ts +18 -18
- package/dist/Request.js +6 -6
- package/dist/Resource.d.ts +2 -2
- package/dist/Resource.js +2 -2
- package/dist/Result.d.ts +77 -33
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +42 -19
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +11 -8
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +11 -8
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +107 -45
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +41 -29
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +6 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +6 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +443 -371
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +518 -427
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +42 -21
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +80 -59
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +126 -106
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +121 -101
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +37 -39
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -17
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +72 -153
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +72 -145
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +30 -21
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +26 -22
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +169 -145
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +183 -159
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.js +2 -2
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +15 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +15 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedRef.d.ts +14 -18
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -8
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +9 -9
- package/dist/Semaphore.js +3 -3
- package/dist/Sink.d.ts +13 -13
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +9 -9
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +4 -5
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +4 -5
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +321 -44
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +137 -22
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +6 -9
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +2 -3
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +15 -13
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +11 -9
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +24 -19
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +12 -7
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +88 -63
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +32 -23
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Tracer.d.ts +4 -4
- package/dist/Tracer.js +4 -4
- package/dist/Trie.d.ts +15 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +5 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +25 -19
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +17 -13
- package/dist/Tuple.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +6 -3
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +2 -1
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +16 -16
- package/dist/TxRef.js +8 -8
- package/dist/TxSubscriptionRef.d.ts +43 -27
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +19 -13
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +12 -38
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +0 -2
- package/dist/UndefinedOr.d.ts +15 -14
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +11 -10
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +2 -2
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +9 -9
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/equivalence.js +9 -9
- package/dist/internal/schema/equivalence.js.map +1 -1
- package/dist/internal/schema/representation.js +14 -14
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.js +11 -11
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +10 -10
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +9 -9
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +4 -2
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +4 -2
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +17 -20
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +36 -39
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +4 -5
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +4 -5
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +4 -4
- package/dist/unstable/ai/EmbeddingModel.js +4 -4
- package/dist/unstable/ai/IdGenerator.d.ts +2 -3
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +2 -3
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +3 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +5 -4
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +14 -12
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +19 -17
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +11 -4
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +8 -5
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +20 -18
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +45 -43
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +2 -2
- package/dist/unstable/ai/Prompt.js +3 -3
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +3 -2
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +3 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +21 -6
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +7 -2
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +7 -6
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +8 -7
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +2 -2
- package/dist/unstable/ai/Toolkit.js +2 -2
- package/dist/unstable/cli/Command.d.ts +37 -16
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +15 -8
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +1 -1
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +7 -6
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +7 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +6 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +7 -2
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +3 -3
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +13 -10
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +3 -2
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +3 -2
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -2
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +5 -0
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +5 -0
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +3 -3
- package/dist/unstable/cluster/ClusterSchema.js +3 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +15 -15
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +10 -0
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +10 -0
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +2 -2
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +2 -2
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -2
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +12 -12
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -2
- package/dist/unstable/cluster/RunnerServer.js +2 -2
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.js +3 -3
- package/dist/unstable/cluster/ShardId.js +3 -3
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +3 -3
- package/dist/unstable/cluster/Sharding.js +3 -3
- package/dist/unstable/cluster/ShardingConfig.d.ts +4 -4
- package/dist/unstable/cluster/ShardingConfig.js +4 -4
- package/dist/unstable/cluster/Snowflake.d.ts +1 -1
- package/dist/unstable/cluster/Snowflake.js +3 -3
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +2 -2
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -2
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +5 -5
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +5 -0
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +5 -0
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +2 -2
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +2 -2
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +2 -1
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +2 -1
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +10 -0
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +10 -0
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +3 -3
- package/dist/unstable/eventlog/EventLog.js +3 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +5 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogSessionAuth.js +4 -4
- package/dist/unstable/http/Cookies.js +4 -4
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +2 -3
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +2 -3
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/Headers.js +2 -2
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.js +2 -2
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +2 -2
- package/dist/unstable/http/HttpClient.js +2 -2
- package/dist/unstable/http/HttpClientRequest.d.ts +30 -3
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +10 -1
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +1 -1
- package/dist/unstable/http/HttpRouter.js +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +25 -20
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +13 -8
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.js +3 -3
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +30 -0
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +16 -6
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +3 -2
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -2
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +10 -8
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +15 -15
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +9 -9
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +11 -11
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +5 -0
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +5 -0
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +4 -2
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +4 -2
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +3 -3
- package/dist/unstable/reactivity/Atom.js +3 -3
- package/dist/unstable/rpc/RpcSchema.d.ts +2 -2
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
- package/dist/unstable/rpc/RpcSerialization.js +2 -2
- package/dist/unstable/schema/Model.js +5 -5
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +2 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +4 -4
- package/dist/unstable/sql/SqlSchema.js +4 -4
- package/dist/unstable/workers/Transferable.d.ts +2 -2
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +5 -5
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +1 -2
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +1 -2
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +35 -15
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +94 -72
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +10 -2
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -8
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -4
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +9 -11
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +7 -7
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +729 -611
- package/src/BigDecimal.ts +37 -30
- package/src/BigInt.ts +34 -40
- package/src/Boolean.ts +8 -8
- package/src/Brand.ts +16 -14
- package/src/Cause.ts +21 -23
- package/src/Channel.ts +249 -9
- package/src/ChannelSchema.ts +11 -11
- package/src/Chunk.ts +69 -16
- package/src/Clock.ts +3 -3
- package/src/Combiner.ts +9 -13
- package/src/Config.ts +60 -67
- package/src/ConfigProvider.ts +34 -44
- package/src/Console.ts +2 -2
- package/src/Context.ts +60 -72
- package/src/Cron.ts +2 -2
- package/src/Crypto.ts +4 -4
- package/src/Data.ts +21 -15
- package/src/DateTime.ts +35 -16
- package/src/Deferred.ts +24 -15
- package/src/Duration.ts +44 -31
- package/src/Effect.ts +516 -416
- package/src/Encoding.ts +5 -0
- package/src/Equal.ts +26 -39
- package/src/Equivalence.ts +71 -99
- package/src/ErrorReporter.ts +1 -1
- package/src/Exit.ts +79 -96
- package/src/Fiber.ts +8 -6
- package/src/FiberHandle.ts +25 -0
- package/src/FiberMap.ts +35 -0
- package/src/FiberSet.ts +20 -0
- package/src/Filter.ts +4 -4
- package/src/Formatter.ts +14 -19
- package/src/Function.ts +15 -16
- package/src/Graph.ts +2 -2
- package/src/HKT.ts +2 -2
- package/src/Hash.ts +2 -1
- package/src/HashMap.ts +15 -0
- package/src/HashRing.ts +9 -9
- package/src/Iterable.ts +24 -12
- package/src/JsonPatch.ts +2 -3
- package/src/JsonPointer.ts +2 -6
- package/src/JsonSchema.ts +17 -13
- package/src/Latch.ts +4 -3
- package/src/Layer.ts +92 -114
- package/src/Logger.ts +15 -18
- package/src/Match.ts +2 -2
- package/src/Metric.ts +109 -137
- package/src/MutableHashMap.ts +35 -20
- package/src/MutableList.ts +15 -0
- package/src/MutableRef.ts +56 -42
- package/src/Newtype.ts +10 -7
- package/src/Number.ts +23 -11
- package/src/Optic.ts +25 -22
- package/src/Option.ts +196 -168
- package/src/Order.ts +118 -179
- package/src/PartitionedSemaphore.ts +14 -14
- package/src/Path.ts +2 -2
- package/src/Pipeable.ts +2 -2
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +7 -11
- package/src/Predicate.ts +274 -263
- package/src/PubSub.ts +24 -14
- package/src/Pull.ts +4 -4
- package/src/Queue.ts +46 -7
- package/src/RcRef.ts +0 -4
- package/src/Redactable.ts +2 -2
- package/src/Redacted.ts +3 -3
- package/src/Reducer.ts +2 -3
- package/src/Ref.ts +43 -40
- package/src/References.ts +4 -4
- package/src/Request.ts +18 -18
- package/src/Resource.ts +2 -2
- package/src/Result.ts +87 -33
- package/src/Runtime.ts +11 -8
- package/src/Schedule.ts +112 -45
- package/src/Scheduler.ts +6 -4
- package/src/Schema.ts +843 -649
- package/src/SchemaAST.ts +148 -117
- package/src/SchemaGetter.ts +142 -121
- package/src/SchemaIssue.ts +39 -41
- package/src/SchemaParser.ts +173 -229
- package/src/SchemaRepresentation.ts +38 -28
- package/src/SchemaTransformation.ts +233 -207
- package/src/SchemaUtils.ts +2 -2
- package/src/Scope.ts +15 -0
- package/src/ScopedCache.ts +1 -1
- package/src/ScopedRef.ts +14 -18
- package/src/Semaphore.ts +9 -9
- package/src/Sink.ts +13 -13
- package/src/Stdio.ts +4 -5
- package/src/Stream.ts +354 -57
- package/src/String.ts +6 -9
- package/src/Struct.ts +15 -13
- package/src/SubscriptionRef.ts +24 -19
- package/src/SynchronizedRef.ts +88 -63
- package/src/Tracer.ts +4 -4
- package/src/Trie.ts +15 -0
- package/src/Tuple.ts +25 -19
- package/src/TxReentrantLock.ts +6 -3
- package/src/TxRef.ts +16 -16
- package/src/TxSubscriptionRef.ts +43 -27
- package/src/Types.ts +12 -39
- package/src/UndefinedOr.ts +15 -14
- package/src/Unify.ts +2 -2
- package/src/internal/schema/annotations.ts +4 -4
- package/src/internal/schema/arbitrary.ts +16 -16
- package/src/internal/schema/equivalence.ts +11 -11
- package/src/internal/schema/representation.ts +23 -23
- package/src/internal/schema/schema.ts +17 -17
- package/src/testing/TestSchema.ts +20 -20
- package/src/unstable/ai/AiError.ts +4 -2
- package/src/unstable/ai/AnthropicStructuredOutput.ts +59 -56
- package/src/unstable/ai/Chat.ts +4 -5
- package/src/unstable/ai/EmbeddingModel.ts +4 -4
- package/src/unstable/ai/IdGenerator.ts +2 -3
- package/src/unstable/ai/LanguageModel.ts +5 -4
- package/src/unstable/ai/McpSchema.ts +19 -17
- package/src/unstable/ai/McpServer.ts +14 -7
- package/src/unstable/ai/OpenAiStructuredOutput.ts +72 -61
- package/src/unstable/ai/Prompt.ts +5 -5
- package/src/unstable/ai/ResponseIdTracker.ts +3 -2
- package/src/unstable/ai/Telemetry.ts +21 -6
- package/src/unstable/ai/Tool.ts +11 -10
- package/src/unstable/ai/Toolkit.ts +2 -2
- package/src/unstable/cli/Command.ts +37 -16
- package/src/unstable/cli/Completions.ts +1 -1
- package/src/unstable/cli/Flag.ts +7 -6
- package/src/unstable/cli/GlobalFlag.ts +7 -1
- package/src/unstable/cli/Param.ts +23 -18
- package/src/unstable/cli/Primitive.ts +3 -2
- package/src/unstable/cluster/ClusterCron.ts +1 -2
- package/src/unstable/cluster/ClusterMetrics.ts +5 -0
- package/src/unstable/cluster/ClusterSchema.ts +3 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +15 -15
- package/src/unstable/cluster/EntityResource.ts +10 -0
- package/src/unstable/cluster/Envelope.ts +3 -3
- package/src/unstable/cluster/Reply.ts +14 -12
- package/src/unstable/cluster/RunnerHealth.ts +2 -1
- package/src/unstable/cluster/RunnerServer.ts +2 -2
- package/src/unstable/cluster/Runners.ts +3 -3
- package/src/unstable/cluster/ShardId.ts +3 -3
- package/src/unstable/cluster/Sharding.ts +3 -3
- package/src/unstable/cluster/ShardingConfig.ts +4 -4
- package/src/unstable/cluster/Snowflake.ts +3 -3
- package/src/unstable/cluster/internal/entityManager.ts +2 -2
- package/src/unstable/encoding/Msgpack.ts +6 -6
- package/src/unstable/encoding/Ndjson.ts +5 -0
- package/src/unstable/encoding/Sse.ts +2 -2
- package/src/unstable/eventlog/EventGroup.ts +2 -1
- package/src/unstable/eventlog/EventJournal.ts +10 -0
- package/src/unstable/eventlog/EventLog.ts +3 -3
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -3
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +5 -7
- package/src/unstable/eventlog/EventLogSessionAuth.ts +4 -4
- package/src/unstable/http/Cookies.ts +4 -4
- package/src/unstable/http/Etag.ts +2 -3
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpBody.ts +2 -2
- package/src/unstable/http/HttpClient.ts +2 -2
- package/src/unstable/http/HttpClientRequest.ts +30 -3
- package/src/unstable/http/HttpRouter.ts +1 -1
- package/src/unstable/http/HttpServerResponse.ts +25 -20
- package/src/unstable/http/Multipart.ts +3 -3
- package/src/unstable/http/UrlParams.ts +36 -6
- package/src/unstable/httpapi/HttpApi.ts +5 -4
- package/src/unstable/httpapi/HttpApiBuilder.ts +14 -13
- package/src/unstable/httpapi/HttpApiClient.ts +16 -16
- package/src/unstable/httpapi/HttpApiMiddleware.ts +3 -3
- package/src/unstable/httpapi/HttpApiSchema.ts +15 -15
- package/src/unstable/httpapi/OpenApi.ts +18 -18
- package/src/unstable/observability/OtlpResource.ts +5 -0
- package/src/unstable/observability/PrometheusMetrics.ts +4 -2
- package/src/unstable/reactivity/Atom.ts +3 -3
- package/src/unstable/rpc/RpcSchema.ts +2 -2
- package/src/unstable/rpc/RpcSerialization.ts +2 -2
- package/src/unstable/schema/Model.ts +5 -5
- package/src/unstable/schema/VariantSchema.ts +2 -2
- package/src/unstable/sql/SqlSchema.ts +4 -4
- package/src/unstable/workers/Transferable.ts +6 -6
- package/src/unstable/workflow/DurableDeferred.ts +7 -7
- package/src/unstable/workflow/DurableQueue.ts +1 -2
- package/src/unstable/workflow/Workflow.ts +159 -114
- package/src/unstable/workflow/WorkflowEngine.ts +16 -8
- package/src/unstable/workflow/WorkflowProxy.ts +9 -11
- package/src/unstable/workflow/WorkflowProxyServer.ts +7 -7
package/src/Option.ts
CHANGED
|
@@ -276,7 +276,8 @@ export interface OptionUnifyIgnore {}
|
|
|
276
276
|
*
|
|
277
277
|
* **When to use**
|
|
278
278
|
*
|
|
279
|
-
* Use
|
|
279
|
+
* Use when defining higher-kinded abstractions that must accept optional-value
|
|
280
|
+
* types as one of their type-lambda inputs.
|
|
280
281
|
*
|
|
281
282
|
* @category type lambdas
|
|
282
283
|
* @since 2.0.0
|
|
@@ -323,7 +324,7 @@ export const none = <A = never>(): Option<A> => option.none
|
|
|
323
324
|
*
|
|
324
325
|
* **When to use**
|
|
325
326
|
*
|
|
326
|
-
* Use to wrap a known
|
|
327
|
+
* Use to wrap a known present value as `Option`
|
|
327
328
|
* - Returning a successful result from a partial function
|
|
328
329
|
*
|
|
329
330
|
* **Details**
|
|
@@ -392,7 +393,7 @@ export const isOption: (input: unknown) => input is Option<unknown> = option.isO
|
|
|
392
393
|
*
|
|
393
394
|
* **When to use**
|
|
394
395
|
*
|
|
395
|
-
* Use when
|
|
396
|
+
* Use when you need to branch on an absent `Option` before accessing `.value`.
|
|
396
397
|
*
|
|
397
398
|
* **Details**
|
|
398
399
|
*
|
|
@@ -422,7 +423,7 @@ export const isNone: <A>(self: Option<A>) => self is None<A> = option.isNone
|
|
|
422
423
|
*
|
|
423
424
|
* **When to use**
|
|
424
425
|
*
|
|
425
|
-
* Use when
|
|
426
|
+
* Use when you need to branch on a present `Option` before accessing `.value`.
|
|
426
427
|
*
|
|
427
428
|
* **Details**
|
|
428
429
|
*
|
|
@@ -452,8 +453,8 @@ export const isSome: <A>(self: Option<A>) => self is Some<A> = option.isSome
|
|
|
452
453
|
*
|
|
453
454
|
* **When to use**
|
|
454
455
|
*
|
|
455
|
-
* Use when
|
|
456
|
-
*
|
|
456
|
+
* Use when you need to handle both `Some` and `None` in one expression and
|
|
457
|
+
* transform an `Option` into a plain value.
|
|
457
458
|
*
|
|
458
459
|
* **Details**
|
|
459
460
|
*
|
|
@@ -486,8 +487,8 @@ export const match: {
|
|
|
486
487
|
*
|
|
487
488
|
* **When to use**
|
|
488
489
|
*
|
|
489
|
-
* Use when
|
|
490
|
-
*
|
|
490
|
+
* Use when you need to handle both `Some` and `None` in one expression and
|
|
491
|
+
* transform an `Option` into a plain value.
|
|
491
492
|
*
|
|
492
493
|
* **Details**
|
|
493
494
|
*
|
|
@@ -525,8 +526,8 @@ export const match: {
|
|
|
525
526
|
*
|
|
526
527
|
* **When to use**
|
|
527
528
|
*
|
|
528
|
-
* Use when
|
|
529
|
-
*
|
|
529
|
+
* Use when you need to handle both `Some` and `None` in one expression and
|
|
530
|
+
* transform an `Option` into a plain value.
|
|
530
531
|
*
|
|
531
532
|
* **Details**
|
|
532
533
|
*
|
|
@@ -573,8 +574,8 @@ export const match: {
|
|
|
573
574
|
*
|
|
574
575
|
* **When to use**
|
|
575
576
|
*
|
|
576
|
-
* Use when
|
|
577
|
-
*
|
|
577
|
+
* Use when you need to turn an `Option`-returning parser into a type-narrowing
|
|
578
|
+
* predicate, such as for `Array.prototype.filter`.
|
|
578
579
|
*
|
|
579
580
|
* **Details**
|
|
580
581
|
*
|
|
@@ -616,8 +617,8 @@ export const toRefinement = <A, B extends A>(f: (a: A) => Option<B>): (a: A) =>
|
|
|
616
617
|
*
|
|
617
618
|
* **When to use**
|
|
618
619
|
*
|
|
619
|
-
* Use when safely
|
|
620
|
-
*
|
|
620
|
+
* Use when you need to safely extract the head of a collection, including
|
|
621
|
+
* generators or lazy iterables.
|
|
621
622
|
*
|
|
622
623
|
* **Details**
|
|
623
624
|
*
|
|
@@ -653,7 +654,8 @@ export const fromIterable = <A>(collection: Iterable<A>): Option<A> => {
|
|
|
653
654
|
*
|
|
654
655
|
* **When to use**
|
|
655
656
|
*
|
|
656
|
-
* Use when
|
|
657
|
+
* Use when you need to discard a `Result` failure and keep only the success
|
|
658
|
+
* value as an `Option`.
|
|
657
659
|
*
|
|
658
660
|
* **Details**
|
|
659
661
|
*
|
|
@@ -684,7 +686,8 @@ export const getSuccess: <A, E>(self: Result<A, E>) => Option<A> = result.getSuc
|
|
|
684
686
|
*
|
|
685
687
|
* **When to use**
|
|
686
688
|
*
|
|
687
|
-
* Use to
|
|
689
|
+
* Use when you need to discard a `Result` success and keep only the failure
|
|
690
|
+
* value as an `Option`.
|
|
688
691
|
*
|
|
689
692
|
* **Details**
|
|
690
693
|
*
|
|
@@ -822,8 +825,8 @@ export const getOrElse: {
|
|
|
822
825
|
*
|
|
823
826
|
* **When to use**
|
|
824
827
|
*
|
|
825
|
-
* Use when
|
|
826
|
-
*
|
|
828
|
+
* Use when you need a lazy fallback `Option`, such as when building priority
|
|
829
|
+
* chains of optional values.
|
|
827
830
|
*
|
|
828
831
|
* **Details**
|
|
829
832
|
*
|
|
@@ -855,8 +858,8 @@ export const orElse: {
|
|
|
855
858
|
*
|
|
856
859
|
* **When to use**
|
|
857
860
|
*
|
|
858
|
-
* Use when
|
|
859
|
-
*
|
|
861
|
+
* Use when you need a lazy fallback `Option`, such as when building priority
|
|
862
|
+
* chains of optional values.
|
|
860
863
|
*
|
|
861
864
|
* **Details**
|
|
862
865
|
*
|
|
@@ -888,8 +891,8 @@ export const orElse: {
|
|
|
888
891
|
*
|
|
889
892
|
* **When to use**
|
|
890
893
|
*
|
|
891
|
-
* Use when
|
|
892
|
-
*
|
|
894
|
+
* Use when you need a lazy fallback `Option`, such as when building priority
|
|
895
|
+
* chains of optional values.
|
|
893
896
|
*
|
|
894
897
|
* **Details**
|
|
895
898
|
*
|
|
@@ -1024,8 +1027,8 @@ export const orElseSome: {
|
|
|
1024
1027
|
*
|
|
1025
1028
|
* **When to use**
|
|
1026
1029
|
*
|
|
1027
|
-
* Use when
|
|
1028
|
-
* `Option`.
|
|
1030
|
+
* Use when you need to know whether a present value came from the primary or
|
|
1031
|
+
* fallback `Option`.
|
|
1029
1032
|
*
|
|
1030
1033
|
* **Details**
|
|
1031
1034
|
*
|
|
@@ -1056,8 +1059,8 @@ export const orElseResult: {
|
|
|
1056
1059
|
*
|
|
1057
1060
|
* **When to use**
|
|
1058
1061
|
*
|
|
1059
|
-
* Use when
|
|
1060
|
-
* `Option`.
|
|
1062
|
+
* Use when you need to know whether a present value came from the primary or
|
|
1063
|
+
* fallback `Option`.
|
|
1061
1064
|
*
|
|
1062
1065
|
* **Details**
|
|
1063
1066
|
*
|
|
@@ -1088,8 +1091,8 @@ export const orElseResult: {
|
|
|
1088
1091
|
*
|
|
1089
1092
|
* **When to use**
|
|
1090
1093
|
*
|
|
1091
|
-
* Use when
|
|
1092
|
-
* `Option`.
|
|
1094
|
+
* Use when you need to know whether a present value came from the primary or
|
|
1095
|
+
* fallback `Option`.
|
|
1093
1096
|
*
|
|
1094
1097
|
* **Details**
|
|
1095
1098
|
*
|
|
@@ -1127,7 +1130,7 @@ export const orElseResult: {
|
|
|
1127
1130
|
*
|
|
1128
1131
|
* **When to use**
|
|
1129
1132
|
*
|
|
1130
|
-
* Use when
|
|
1133
|
+
* Use when you need the first available `Some` value from a priority list.
|
|
1131
1134
|
*
|
|
1132
1135
|
* **Details**
|
|
1133
1136
|
*
|
|
@@ -1169,8 +1172,8 @@ export const firstSomeOf = <T, C extends Iterable<Option<T>> = Iterable<Option<T
|
|
|
1169
1172
|
*
|
|
1170
1173
|
* **When to use**
|
|
1171
1174
|
*
|
|
1172
|
-
* Use when
|
|
1173
|
-
*
|
|
1175
|
+
* Use when you need JavaScript nullish values to become absence at an API
|
|
1176
|
+
* boundary while all other values, including falsy ones, remain present.
|
|
1174
1177
|
*
|
|
1175
1178
|
* **Details**
|
|
1176
1179
|
*
|
|
@@ -1209,7 +1212,8 @@ export const fromNullishOr = <A>(
|
|
|
1209
1212
|
*
|
|
1210
1213
|
* **When to use**
|
|
1211
1214
|
*
|
|
1212
|
-
* Use when
|
|
1215
|
+
* Use when you want to treat only `undefined` as absent while preserving `null`
|
|
1216
|
+
* as a meaningful value.
|
|
1213
1217
|
*
|
|
1214
1218
|
* **Details**
|
|
1215
1219
|
*
|
|
@@ -1247,7 +1251,8 @@ export const fromUndefinedOr = <A>(
|
|
|
1247
1251
|
*
|
|
1248
1252
|
* **When to use**
|
|
1249
1253
|
*
|
|
1250
|
-
* Use when
|
|
1254
|
+
* Use when you want to treat only `null` as absent while preserving
|
|
1255
|
+
* `undefined` as a meaningful value.
|
|
1251
1256
|
*
|
|
1252
1257
|
* **Details**
|
|
1253
1258
|
*
|
|
@@ -1327,7 +1332,7 @@ export const liftNullishOr = <A extends ReadonlyArray<unknown>, B>(
|
|
|
1327
1332
|
*
|
|
1328
1333
|
* **When to use**
|
|
1329
1334
|
*
|
|
1330
|
-
* Use when
|
|
1335
|
+
* Use when you need to pass absent `Option` values to APIs that expect `null`.
|
|
1331
1336
|
*
|
|
1332
1337
|
* **Details**
|
|
1333
1338
|
*
|
|
@@ -1359,7 +1364,8 @@ export const getOrNull: <A>(self: Option<A>) => A | null = getOrElse(constNull)
|
|
|
1359
1364
|
*
|
|
1360
1365
|
* **When to use**
|
|
1361
1366
|
*
|
|
1362
|
-
* Use when
|
|
1367
|
+
* Use when you need to pass absent `Option` values to APIs that expect
|
|
1368
|
+
* `undefined`.
|
|
1363
1369
|
*
|
|
1364
1370
|
* **Details**
|
|
1365
1371
|
*
|
|
@@ -1433,8 +1439,8 @@ export const liftThrowable = <A extends ReadonlyArray<unknown>, B>(
|
|
|
1433
1439
|
*
|
|
1434
1440
|
* **When to use**
|
|
1435
1441
|
*
|
|
1436
|
-
* Use when fail-fast unwrapping
|
|
1437
|
-
*
|
|
1442
|
+
* Use when you need fail-fast unwrapping of an `Option` for unexpected absence
|
|
1443
|
+
* and want to provide a descriptive debugging error.
|
|
1438
1444
|
*
|
|
1439
1445
|
* **Details**
|
|
1440
1446
|
*
|
|
@@ -1465,8 +1471,8 @@ export const getOrThrowWith: {
|
|
|
1465
1471
|
*
|
|
1466
1472
|
* **When to use**
|
|
1467
1473
|
*
|
|
1468
|
-
* Use when fail-fast unwrapping
|
|
1469
|
-
*
|
|
1474
|
+
* Use when you need fail-fast unwrapping of an `Option` for unexpected absence
|
|
1475
|
+
* and want to provide a descriptive debugging error.
|
|
1470
1476
|
*
|
|
1471
1477
|
* **Details**
|
|
1472
1478
|
*
|
|
@@ -1497,8 +1503,8 @@ export const getOrThrowWith: {
|
|
|
1497
1503
|
*
|
|
1498
1504
|
* **When to use**
|
|
1499
1505
|
*
|
|
1500
|
-
* Use when fail-fast unwrapping
|
|
1501
|
-
*
|
|
1506
|
+
* Use when you need fail-fast unwrapping of an `Option` for unexpected absence
|
|
1507
|
+
* and want to provide a descriptive debugging error.
|
|
1502
1508
|
*
|
|
1503
1509
|
* **Details**
|
|
1504
1510
|
*
|
|
@@ -1536,7 +1542,8 @@ export const getOrThrowWith: {
|
|
|
1536
1542
|
*
|
|
1537
1543
|
* **When to use**
|
|
1538
1544
|
*
|
|
1539
|
-
* Use when quick fail-fast unwrapping
|
|
1545
|
+
* Use when you need quick fail-fast unwrapping of an `Option` and a generic
|
|
1546
|
+
* error is acceptable.
|
|
1540
1547
|
*
|
|
1541
1548
|
* **Details**
|
|
1542
1549
|
*
|
|
@@ -1569,8 +1576,8 @@ export const getOrThrow: <A>(self: Option<A>) => A = getOrThrowWith(() => new Er
|
|
|
1569
1576
|
*
|
|
1570
1577
|
* **When to use**
|
|
1571
1578
|
*
|
|
1572
|
-
* Use to apply a pure transformation to an
|
|
1573
|
-
* chaining transformations in a pipeline.
|
|
1579
|
+
* Use to apply a pure transformation to an `Option`'s present value, especially
|
|
1580
|
+
* when chaining transformations in a pipeline.
|
|
1574
1581
|
*
|
|
1575
1582
|
* **Details**
|
|
1576
1583
|
*
|
|
@@ -1602,8 +1609,8 @@ export const map: {
|
|
|
1602
1609
|
*
|
|
1603
1610
|
* **When to use**
|
|
1604
1611
|
*
|
|
1605
|
-
* Use to apply a pure transformation to an
|
|
1606
|
-
* chaining transformations in a pipeline.
|
|
1612
|
+
* Use to apply a pure transformation to an `Option`'s present value, especially
|
|
1613
|
+
* when chaining transformations in a pipeline.
|
|
1607
1614
|
*
|
|
1608
1615
|
* **Details**
|
|
1609
1616
|
*
|
|
@@ -1635,8 +1642,8 @@ export const map: {
|
|
|
1635
1642
|
*
|
|
1636
1643
|
* **When to use**
|
|
1637
1644
|
*
|
|
1638
|
-
* Use to apply a pure transformation to an
|
|
1639
|
-
* chaining transformations in a pipeline.
|
|
1645
|
+
* Use to apply a pure transformation to an `Option`'s present value, especially
|
|
1646
|
+
* when chaining transformations in a pipeline.
|
|
1640
1647
|
*
|
|
1641
1648
|
* **Details**
|
|
1642
1649
|
*
|
|
@@ -1672,12 +1679,8 @@ export const map: {
|
|
|
1672
1679
|
*
|
|
1673
1680
|
* **When to use**
|
|
1674
1681
|
*
|
|
1675
|
-
* Use when
|
|
1676
|
-
*
|
|
1677
|
-
* **Details**
|
|
1678
|
-
*
|
|
1679
|
-
* - `Some` → `Some(b)`
|
|
1680
|
-
* - `None` → `None`
|
|
1682
|
+
* Use when you need to replace a present `Option` value while preserving
|
|
1683
|
+
* whether it was `Some` or `None`.
|
|
1681
1684
|
*
|
|
1682
1685
|
* **Example** (Replacing a value)
|
|
1683
1686
|
*
|
|
@@ -1703,12 +1706,8 @@ export const as: {
|
|
|
1703
1706
|
*
|
|
1704
1707
|
* **When to use**
|
|
1705
1708
|
*
|
|
1706
|
-
* Use when
|
|
1707
|
-
*
|
|
1708
|
-
* **Details**
|
|
1709
|
-
*
|
|
1710
|
-
* - `Some` → `Some(b)`
|
|
1711
|
-
* - `None` → `None`
|
|
1709
|
+
* Use when you need to replace a present `Option` value while preserving
|
|
1710
|
+
* whether it was `Some` or `None`.
|
|
1712
1711
|
*
|
|
1713
1712
|
* **Example** (Replacing a value)
|
|
1714
1713
|
*
|
|
@@ -1734,12 +1733,8 @@ export const as: {
|
|
|
1734
1733
|
*
|
|
1735
1734
|
* **When to use**
|
|
1736
1735
|
*
|
|
1737
|
-
* Use when
|
|
1738
|
-
*
|
|
1739
|
-
* **Details**
|
|
1740
|
-
*
|
|
1741
|
-
* - `Some` → `Some(b)`
|
|
1742
|
-
* - `None` → `None`
|
|
1736
|
+
* Use when you need to replace a present `Option` value while preserving
|
|
1737
|
+
* whether it was `Some` or `None`.
|
|
1743
1738
|
*
|
|
1744
1739
|
* **Example** (Replacing a value)
|
|
1745
1740
|
*
|
|
@@ -1768,12 +1763,8 @@ export const as: {
|
|
|
1768
1763
|
*
|
|
1769
1764
|
* **When to use**
|
|
1770
1765
|
*
|
|
1771
|
-
* Use when
|
|
1772
|
-
*
|
|
1773
|
-
* **Details**
|
|
1774
|
-
*
|
|
1775
|
-
* - `Some` → `Some(undefined)`
|
|
1776
|
-
* - `None` → `None`
|
|
1766
|
+
* Use when you need to discard a present `Option` value while preserving
|
|
1767
|
+
* whether it was `Some` or `None`.
|
|
1777
1768
|
*
|
|
1778
1769
|
* **Example** (Voiding the value)
|
|
1779
1770
|
*
|
|
@@ -1826,8 +1817,8 @@ export {
|
|
|
1826
1817
|
*
|
|
1827
1818
|
* **When to use**
|
|
1828
1819
|
*
|
|
1829
|
-
* Use when
|
|
1830
|
-
* `None`.
|
|
1820
|
+
* Use when you need to chain dependent `Option` computations where each step
|
|
1821
|
+
* may return `None`.
|
|
1831
1822
|
*
|
|
1832
1823
|
* **Details**
|
|
1833
1824
|
*
|
|
@@ -1872,8 +1863,8 @@ export const flatMap: {
|
|
|
1872
1863
|
*
|
|
1873
1864
|
* **When to use**
|
|
1874
1865
|
*
|
|
1875
|
-
* Use when
|
|
1876
|
-
* `None`.
|
|
1866
|
+
* Use when you need to chain dependent `Option` computations where each step
|
|
1867
|
+
* may return `None`.
|
|
1877
1868
|
*
|
|
1878
1869
|
* **Details**
|
|
1879
1870
|
*
|
|
@@ -1918,8 +1909,8 @@ export const flatMap: {
|
|
|
1918
1909
|
*
|
|
1919
1910
|
* **When to use**
|
|
1920
1911
|
*
|
|
1921
|
-
* Use when
|
|
1922
|
-
* `None`.
|
|
1912
|
+
* Use when you need to chain dependent `Option` computations where each step
|
|
1913
|
+
* may return `None`.
|
|
1923
1914
|
*
|
|
1924
1915
|
* **Details**
|
|
1925
1916
|
*
|
|
@@ -1969,8 +1960,8 @@ export const flatMap: {
|
|
|
1969
1960
|
*
|
|
1970
1961
|
* **When to use**
|
|
1971
1962
|
*
|
|
1972
|
-
* Use when
|
|
1973
|
-
*
|
|
1963
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
1964
|
+
* `Option`, a plain value, or a function.
|
|
1974
1965
|
*
|
|
1975
1966
|
* **Details**
|
|
1976
1967
|
*
|
|
@@ -2010,8 +2001,8 @@ export const andThen: {
|
|
|
2010
2001
|
*
|
|
2011
2002
|
* **When to use**
|
|
2012
2003
|
*
|
|
2013
|
-
* Use when
|
|
2014
|
-
*
|
|
2004
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2005
|
+
* `Option`, a plain value, or a function.
|
|
2015
2006
|
*
|
|
2016
2007
|
* **Details**
|
|
2017
2008
|
*
|
|
@@ -2051,8 +2042,8 @@ export const andThen: {
|
|
|
2051
2042
|
*
|
|
2052
2043
|
* **When to use**
|
|
2053
2044
|
*
|
|
2054
|
-
* Use when
|
|
2055
|
-
*
|
|
2045
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2046
|
+
* `Option`, a plain value, or a function.
|
|
2056
2047
|
*
|
|
2057
2048
|
* **Details**
|
|
2058
2049
|
*
|
|
@@ -2092,8 +2083,8 @@ export const andThen: {
|
|
|
2092
2083
|
*
|
|
2093
2084
|
* **When to use**
|
|
2094
2085
|
*
|
|
2095
|
-
* Use when
|
|
2096
|
-
*
|
|
2086
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2087
|
+
* `Option`, a plain value, or a function.
|
|
2097
2088
|
*
|
|
2098
2089
|
* **Details**
|
|
2099
2090
|
*
|
|
@@ -2133,8 +2124,8 @@ export const andThen: {
|
|
|
2133
2124
|
*
|
|
2134
2125
|
* **When to use**
|
|
2135
2126
|
*
|
|
2136
|
-
* Use when
|
|
2137
|
-
*
|
|
2127
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2128
|
+
* `Option`, a plain value, or a function.
|
|
2138
2129
|
*
|
|
2139
2130
|
* **Details**
|
|
2140
2131
|
*
|
|
@@ -2174,8 +2165,8 @@ export const andThen: {
|
|
|
2174
2165
|
*
|
|
2175
2166
|
* **When to use**
|
|
2176
2167
|
*
|
|
2177
|
-
* Use when
|
|
2178
|
-
*
|
|
2168
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2169
|
+
* `Option`, a plain value, or a function.
|
|
2179
2170
|
*
|
|
2180
2171
|
* **Details**
|
|
2181
2172
|
*
|
|
@@ -2215,8 +2206,8 @@ export const andThen: {
|
|
|
2215
2206
|
*
|
|
2216
2207
|
* **When to use**
|
|
2217
2208
|
*
|
|
2218
|
-
* Use when
|
|
2219
|
-
*
|
|
2209
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2210
|
+
* `Option`, a plain value, or a function.
|
|
2220
2211
|
*
|
|
2221
2212
|
* **Details**
|
|
2222
2213
|
*
|
|
@@ -2256,8 +2247,8 @@ export const andThen: {
|
|
|
2256
2247
|
*
|
|
2257
2248
|
* **When to use**
|
|
2258
2249
|
*
|
|
2259
|
-
* Use when
|
|
2260
|
-
*
|
|
2250
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2251
|
+
* `Option`, a plain value, or a function.
|
|
2261
2252
|
*
|
|
2262
2253
|
* **Details**
|
|
2263
2254
|
*
|
|
@@ -2297,8 +2288,8 @@ export const andThen: {
|
|
|
2297
2288
|
*
|
|
2298
2289
|
* **When to use**
|
|
2299
2290
|
*
|
|
2300
|
-
* Use when
|
|
2301
|
-
*
|
|
2291
|
+
* Use when you need to chain an `Option` with a next step that may be another
|
|
2292
|
+
* `Option`, a plain value, or a function.
|
|
2302
2293
|
*
|
|
2303
2294
|
* **Details**
|
|
2304
2295
|
*
|
|
@@ -2347,8 +2338,8 @@ export const andThen: {
|
|
|
2347
2338
|
*
|
|
2348
2339
|
* **When to use**
|
|
2349
2340
|
*
|
|
2350
|
-
* Use when
|
|
2351
|
-
*
|
|
2341
|
+
* Use when you need to chain optional computations that use `null` or
|
|
2342
|
+
* `undefined` instead of `Option`, such as nested property access.
|
|
2352
2343
|
*
|
|
2353
2344
|
* **Details**
|
|
2354
2345
|
*
|
|
@@ -2389,8 +2380,8 @@ export const flatMapNullishOr: {
|
|
|
2389
2380
|
*
|
|
2390
2381
|
* **When to use**
|
|
2391
2382
|
*
|
|
2392
|
-
* Use when
|
|
2393
|
-
*
|
|
2383
|
+
* Use when you need to chain optional computations that use `null` or
|
|
2384
|
+
* `undefined` instead of `Option`, such as nested property access.
|
|
2394
2385
|
*
|
|
2395
2386
|
* **Details**
|
|
2396
2387
|
*
|
|
@@ -2431,8 +2422,8 @@ export const flatMapNullishOr: {
|
|
|
2431
2422
|
*
|
|
2432
2423
|
* **When to use**
|
|
2433
2424
|
*
|
|
2434
|
-
* Use when
|
|
2435
|
-
*
|
|
2425
|
+
* Use when you need to chain optional computations that use `null` or
|
|
2426
|
+
* `undefined` instead of `Option`, such as nested property access.
|
|
2436
2427
|
*
|
|
2437
2428
|
* **Details**
|
|
2438
2429
|
*
|
|
@@ -2478,7 +2469,7 @@ export const flatMapNullishOr: {
|
|
|
2478
2469
|
*
|
|
2479
2470
|
* **When to use**
|
|
2480
2471
|
*
|
|
2481
|
-
* Use when
|
|
2472
|
+
* Use when you need to remove one layer of nested `Option`.
|
|
2482
2473
|
*
|
|
2483
2474
|
* **Details**
|
|
2484
2475
|
*
|
|
@@ -2510,7 +2501,8 @@ export const flatten: <A>(self: Option<Option<A>>) => Option<A> = flatMap(identi
|
|
|
2510
2501
|
*
|
|
2511
2502
|
* **When to use**
|
|
2512
2503
|
*
|
|
2513
|
-
* Use
|
|
2504
|
+
* Use when you need two `Option` values to both be `Some`, then keep only the
|
|
2505
|
+
* second value.
|
|
2514
2506
|
*
|
|
2515
2507
|
* **Details**
|
|
2516
2508
|
*
|
|
@@ -2541,7 +2533,8 @@ export const zipRight: {
|
|
|
2541
2533
|
*
|
|
2542
2534
|
* **When to use**
|
|
2543
2535
|
*
|
|
2544
|
-
* Use
|
|
2536
|
+
* Use when you need two `Option` values to both be `Some`, then keep only the
|
|
2537
|
+
* second value.
|
|
2545
2538
|
*
|
|
2546
2539
|
* **Details**
|
|
2547
2540
|
*
|
|
@@ -2572,7 +2565,8 @@ export const zipRight: {
|
|
|
2572
2565
|
*
|
|
2573
2566
|
* **When to use**
|
|
2574
2567
|
*
|
|
2575
|
-
* Use
|
|
2568
|
+
* Use when you need two `Option` values to both be `Some`, then keep only the
|
|
2569
|
+
* second value.
|
|
2576
2570
|
*
|
|
2577
2571
|
* **Details**
|
|
2578
2572
|
*
|
|
@@ -2605,7 +2599,8 @@ export const zipRight: {
|
|
|
2605
2599
|
*
|
|
2606
2600
|
* **When to use**
|
|
2607
2601
|
*
|
|
2608
|
-
* Use
|
|
2602
|
+
* Use when you need two `Option` values to both be `Some`, then keep only the
|
|
2603
|
+
* first value.
|
|
2609
2604
|
*
|
|
2610
2605
|
* **Details**
|
|
2611
2606
|
*
|
|
@@ -2636,7 +2631,8 @@ export const zipLeft: {
|
|
|
2636
2631
|
*
|
|
2637
2632
|
* **When to use**
|
|
2638
2633
|
*
|
|
2639
|
-
* Use
|
|
2634
|
+
* Use when you need two `Option` values to both be `Some`, then keep only the
|
|
2635
|
+
* first value.
|
|
2640
2636
|
*
|
|
2641
2637
|
* **Details**
|
|
2642
2638
|
*
|
|
@@ -2667,7 +2663,8 @@ export const zipLeft: {
|
|
|
2667
2663
|
*
|
|
2668
2664
|
* **When to use**
|
|
2669
2665
|
*
|
|
2670
|
-
* Use
|
|
2666
|
+
* Use when you need two `Option` values to both be `Some`, then keep only the
|
|
2667
|
+
* first value.
|
|
2671
2668
|
*
|
|
2672
2669
|
* **Details**
|
|
2673
2670
|
*
|
|
@@ -2701,7 +2698,8 @@ export const zipLeft: {
|
|
|
2701
2698
|
*
|
|
2702
2699
|
* **When to use**
|
|
2703
2700
|
*
|
|
2704
|
-
* Use
|
|
2701
|
+
* Use when you need to compose two functions that each return an `Option`, so
|
|
2702
|
+
* `None` short-circuits without calling the next function.
|
|
2705
2703
|
*
|
|
2706
2704
|
* **Details**
|
|
2707
2705
|
*
|
|
@@ -2740,7 +2738,8 @@ export const composeK: {
|
|
|
2740
2738
|
*
|
|
2741
2739
|
* **When to use**
|
|
2742
2740
|
*
|
|
2743
|
-
* Use
|
|
2741
|
+
* Use when you need to compose two functions that each return an `Option`, so
|
|
2742
|
+
* `None` short-circuits without calling the next function.
|
|
2744
2743
|
*
|
|
2745
2744
|
* **Details**
|
|
2746
2745
|
*
|
|
@@ -2779,7 +2778,8 @@ export const composeK: {
|
|
|
2779
2778
|
*
|
|
2780
2779
|
* **When to use**
|
|
2781
2780
|
*
|
|
2782
|
-
* Use
|
|
2781
|
+
* Use when you need to compose two functions that each return an `Option`, so
|
|
2782
|
+
* `None` short-circuits without calling the next function.
|
|
2783
2783
|
*
|
|
2784
2784
|
* **Details**
|
|
2785
2785
|
*
|
|
@@ -2821,8 +2821,8 @@ export const composeK: {
|
|
|
2821
2821
|
*
|
|
2822
2822
|
* **When to use**
|
|
2823
2823
|
*
|
|
2824
|
-
* Use to validate
|
|
2825
|
-
*
|
|
2824
|
+
* Use to validate an `Option`'s present value without transforming it, such as
|
|
2825
|
+
* adding a side-condition check in a pipeline.
|
|
2826
2826
|
*
|
|
2827
2827
|
* **Details**
|
|
2828
2828
|
*
|
|
@@ -2858,8 +2858,8 @@ export const tap: {
|
|
|
2858
2858
|
*
|
|
2859
2859
|
* **When to use**
|
|
2860
2860
|
*
|
|
2861
|
-
* Use to validate
|
|
2862
|
-
*
|
|
2861
|
+
* Use to validate an `Option`'s present value without transforming it, such as
|
|
2862
|
+
* adding a side-condition check in a pipeline.
|
|
2863
2863
|
*
|
|
2864
2864
|
* **Details**
|
|
2865
2865
|
*
|
|
@@ -2895,8 +2895,8 @@ export const tap: {
|
|
|
2895
2895
|
*
|
|
2896
2896
|
* **When to use**
|
|
2897
2897
|
*
|
|
2898
|
-
* Use to validate
|
|
2899
|
-
*
|
|
2898
|
+
* Use to validate an `Option`'s present value without transforming it, such as
|
|
2899
|
+
* adding a side-condition check in a pipeline.
|
|
2900
2900
|
*
|
|
2901
2901
|
* **Details**
|
|
2902
2902
|
*
|
|
@@ -2933,7 +2933,8 @@ export const tap: {
|
|
|
2933
2933
|
*
|
|
2934
2934
|
* **When to use**
|
|
2935
2935
|
*
|
|
2936
|
-
* Use when
|
|
2936
|
+
* Use when you need to require two `Option` values to both be `Some` and keep
|
|
2937
|
+
* both values as a tuple.
|
|
2937
2938
|
*
|
|
2938
2939
|
* **Details**
|
|
2939
2940
|
*
|
|
@@ -2967,7 +2968,8 @@ export const product = <A, B>(self: Option<A>, that: Option<B>): Option<[A, B]>
|
|
|
2967
2968
|
*
|
|
2968
2969
|
* **When to use**
|
|
2969
2970
|
*
|
|
2970
|
-
* Use when
|
|
2971
|
+
* Use when you need several `Option` values of the same type to all be `Some`
|
|
2972
|
+
* and return them as a non-empty tuple.
|
|
2971
2973
|
*
|
|
2972
2974
|
* **Details**
|
|
2973
2975
|
*
|
|
@@ -3018,8 +3020,8 @@ export const productMany = <A>(
|
|
|
3018
3020
|
*
|
|
3019
3021
|
* **When to use**
|
|
3020
3022
|
*
|
|
3021
|
-
* Use when
|
|
3022
|
-
*
|
|
3023
|
+
* Use when you need to combine multiple `Option` values into one while
|
|
3024
|
+
* preserving the input shape, with any `None` making the result `None`.
|
|
3023
3025
|
*
|
|
3024
3026
|
* **Details**
|
|
3025
3027
|
*
|
|
@@ -3094,7 +3096,8 @@ export const all: <const I extends Iterable<Option<any>> | Record<string, Option
|
|
|
3094
3096
|
*
|
|
3095
3097
|
* **When to use**
|
|
3096
3098
|
*
|
|
3097
|
-
* Use when
|
|
3099
|
+
* Use when you need to combine two present `Option` values into a computed
|
|
3100
|
+
* result.
|
|
3098
3101
|
*
|
|
3099
3102
|
* **Details**
|
|
3100
3103
|
*
|
|
@@ -3129,7 +3132,8 @@ export const zipWith: {
|
|
|
3129
3132
|
*
|
|
3130
3133
|
* **When to use**
|
|
3131
3134
|
*
|
|
3132
|
-
* Use when
|
|
3135
|
+
* Use when you need to combine two present `Option` values into a computed
|
|
3136
|
+
* result.
|
|
3133
3137
|
*
|
|
3134
3138
|
* **Details**
|
|
3135
3139
|
*
|
|
@@ -3164,7 +3168,8 @@ export const zipWith: {
|
|
|
3164
3168
|
*
|
|
3165
3169
|
* **When to use**
|
|
3166
3170
|
*
|
|
3167
|
-
* Use when
|
|
3171
|
+
* Use when you need to combine two present `Option` values into a computed
|
|
3172
|
+
* result.
|
|
3168
3173
|
*
|
|
3169
3174
|
* **Details**
|
|
3170
3175
|
*
|
|
@@ -3205,7 +3210,8 @@ export const zipWith: {
|
|
|
3205
3210
|
*
|
|
3206
3211
|
* **When to use**
|
|
3207
3212
|
*
|
|
3208
|
-
* Use when
|
|
3213
|
+
* Use when you need to aggregate values from a collection where some may be
|
|
3214
|
+
* absent.
|
|
3209
3215
|
*
|
|
3210
3216
|
* **Details**
|
|
3211
3217
|
*
|
|
@@ -3233,7 +3239,8 @@ export const reduceCompact: {
|
|
|
3233
3239
|
*
|
|
3234
3240
|
* **When to use**
|
|
3235
3241
|
*
|
|
3236
|
-
* Use when
|
|
3242
|
+
* Use when you need to aggregate values from a collection where some may be
|
|
3243
|
+
* absent.
|
|
3237
3244
|
*
|
|
3238
3245
|
* **Details**
|
|
3239
3246
|
*
|
|
@@ -3261,7 +3268,8 @@ export const reduceCompact: {
|
|
|
3261
3268
|
*
|
|
3262
3269
|
* **When to use**
|
|
3263
3270
|
*
|
|
3264
|
-
* Use when
|
|
3271
|
+
* Use when you need to aggregate values from a collection where some may be
|
|
3272
|
+
* absent.
|
|
3265
3273
|
*
|
|
3266
3274
|
* **Details**
|
|
3267
3275
|
*
|
|
@@ -3302,8 +3310,8 @@ export const reduceCompact: {
|
|
|
3302
3310
|
*
|
|
3303
3311
|
* **When to use**
|
|
3304
3312
|
*
|
|
3305
|
-
* Use when
|
|
3306
|
-
*
|
|
3313
|
+
* Use when you need to pass an `Option` to array-based APIs or spread optional
|
|
3314
|
+
* values into collections.
|
|
3307
3315
|
*
|
|
3308
3316
|
* **Details**
|
|
3309
3317
|
*
|
|
@@ -3334,7 +3342,8 @@ export const toArray = <A>(self: Option<A>): Array<A> => isNone(self) ? [] : [se
|
|
|
3334
3342
|
*
|
|
3335
3343
|
* **When to use**
|
|
3336
3344
|
*
|
|
3337
|
-
* Use when
|
|
3345
|
+
* Use when you need to split an optional value into "left" and "right"
|
|
3346
|
+
* channels using a `Result`-returning function.
|
|
3338
3347
|
*
|
|
3339
3348
|
* **Details**
|
|
3340
3349
|
*
|
|
@@ -3373,7 +3382,8 @@ export const partitionMap: {
|
|
|
3373
3382
|
*
|
|
3374
3383
|
* **When to use**
|
|
3375
3384
|
*
|
|
3376
|
-
* Use when
|
|
3385
|
+
* Use when you need to split an optional value into "left" and "right"
|
|
3386
|
+
* channels using a `Result`-returning function.
|
|
3377
3387
|
*
|
|
3378
3388
|
* **Details**
|
|
3379
3389
|
*
|
|
@@ -3412,7 +3422,8 @@ export const partitionMap: {
|
|
|
3412
3422
|
*
|
|
3413
3423
|
* **When to use**
|
|
3414
3424
|
*
|
|
3415
|
-
* Use when
|
|
3425
|
+
* Use when you need to split an optional value into "left" and "right"
|
|
3426
|
+
* channels using a `Result`-returning function.
|
|
3416
3427
|
*
|
|
3417
3428
|
* **Details**
|
|
3418
3429
|
*
|
|
@@ -3462,7 +3473,8 @@ export const partitionMap: {
|
|
|
3462
3473
|
*
|
|
3463
3474
|
* **When to use**
|
|
3464
3475
|
*
|
|
3465
|
-
* Use to transform
|
|
3476
|
+
* Use to transform an `Option`'s present value and discard it when the `Filter`
|
|
3477
|
+
* fails.
|
|
3466
3478
|
*
|
|
3467
3479
|
* **Details**
|
|
3468
3480
|
*
|
|
@@ -3492,7 +3504,8 @@ export const filterMap: {
|
|
|
3492
3504
|
*
|
|
3493
3505
|
* **When to use**
|
|
3494
3506
|
*
|
|
3495
|
-
* Use to transform
|
|
3507
|
+
* Use to transform an `Option`'s present value and discard it when the `Filter`
|
|
3508
|
+
* fails.
|
|
3496
3509
|
*
|
|
3497
3510
|
* **Details**
|
|
3498
3511
|
*
|
|
@@ -3522,7 +3535,8 @@ export const filterMap: {
|
|
|
3522
3535
|
*
|
|
3523
3536
|
* **When to use**
|
|
3524
3537
|
*
|
|
3525
|
-
* Use to transform
|
|
3538
|
+
* Use to transform an `Option`'s present value and discard it when the `Filter`
|
|
3539
|
+
* fails.
|
|
3526
3540
|
*
|
|
3527
3541
|
* **Details**
|
|
3528
3542
|
*
|
|
@@ -3561,8 +3575,8 @@ export const filterMap: {
|
|
|
3561
3575
|
*
|
|
3562
3576
|
* **When to use**
|
|
3563
3577
|
*
|
|
3564
|
-
* Use when
|
|
3565
|
-
*
|
|
3578
|
+
* Use when you need to discard an `Option`'s present value when it does not
|
|
3579
|
+
* meet a condition, while narrowing the type via a refinement predicate.
|
|
3566
3580
|
*
|
|
3567
3581
|
* **Details**
|
|
3568
3582
|
*
|
|
@@ -3602,8 +3616,8 @@ export const filter: {
|
|
|
3602
3616
|
*
|
|
3603
3617
|
* **When to use**
|
|
3604
3618
|
*
|
|
3605
|
-
* Use when
|
|
3606
|
-
*
|
|
3619
|
+
* Use when you need to discard an `Option`'s present value when it does not
|
|
3620
|
+
* meet a condition, while narrowing the type via a refinement predicate.
|
|
3607
3621
|
*
|
|
3608
3622
|
* **Details**
|
|
3609
3623
|
*
|
|
@@ -3643,8 +3657,8 @@ export const filter: {
|
|
|
3643
3657
|
*
|
|
3644
3658
|
* **When to use**
|
|
3645
3659
|
*
|
|
3646
|
-
* Use when
|
|
3647
|
-
*
|
|
3660
|
+
* Use when you need to discard an `Option`'s present value when it does not
|
|
3661
|
+
* meet a condition, while narrowing the type via a refinement predicate.
|
|
3648
3662
|
*
|
|
3649
3663
|
* **Details**
|
|
3650
3664
|
*
|
|
@@ -3684,8 +3698,8 @@ export const filter: {
|
|
|
3684
3698
|
*
|
|
3685
3699
|
* **When to use**
|
|
3686
3700
|
*
|
|
3687
|
-
* Use when
|
|
3688
|
-
*
|
|
3701
|
+
* Use when you need to discard an `Option`'s present value when it does not
|
|
3702
|
+
* meet a condition, while narrowing the type via a refinement predicate.
|
|
3689
3703
|
*
|
|
3690
3704
|
* **Details**
|
|
3691
3705
|
*
|
|
@@ -3725,8 +3739,8 @@ export const filter: {
|
|
|
3725
3739
|
*
|
|
3726
3740
|
* **When to use**
|
|
3727
3741
|
*
|
|
3728
|
-
* Use when
|
|
3729
|
-
*
|
|
3742
|
+
* Use when you need to discard an `Option`'s present value when it does not
|
|
3743
|
+
* meet a condition, while narrowing the type via a refinement predicate.
|
|
3730
3744
|
*
|
|
3731
3745
|
* **Details**
|
|
3732
3746
|
*
|
|
@@ -3771,7 +3785,8 @@ export const filter: {
|
|
|
3771
3785
|
*
|
|
3772
3786
|
* **When to use**
|
|
3773
3787
|
*
|
|
3774
|
-
* Use to
|
|
3788
|
+
* Use when you need equality to treat two `None` values as equal and compare
|
|
3789
|
+
* two `Some` values with a supplied equality rule.
|
|
3775
3790
|
*
|
|
3776
3791
|
* **Details**
|
|
3777
3792
|
*
|
|
@@ -3807,7 +3822,9 @@ export const makeEquivalence = <A>(isEquivalent: Equivalence.Equivalence<A>): Eq
|
|
|
3807
3822
|
*
|
|
3808
3823
|
* **When to use**
|
|
3809
3824
|
*
|
|
3810
|
-
* Use to sort
|
|
3825
|
+
* Use when you need to sort `Some` and `None` values, with `None` ordered
|
|
3826
|
+
* before present values and present values compared by a supplied ordering
|
|
3827
|
+
* rule.
|
|
3811
3828
|
*
|
|
3812
3829
|
* **Details**
|
|
3813
3830
|
*
|
|
@@ -3843,7 +3860,8 @@ export const makeOrder = <A>(O: Order<A>): Order<Option<A>> =>
|
|
|
3843
3860
|
*
|
|
3844
3861
|
* **When to use**
|
|
3845
3862
|
*
|
|
3846
|
-
* Use when
|
|
3863
|
+
* Use when you need to reuse an existing binary function with two `Option`
|
|
3864
|
+
* values.
|
|
3847
3865
|
*
|
|
3848
3866
|
* **Details**
|
|
3849
3867
|
*
|
|
@@ -4030,7 +4048,8 @@ export const liftPredicate: { // Note: I intentionally avoid using the NoInfer p
|
|
|
4030
4048
|
*
|
|
4031
4049
|
* **When to use**
|
|
4032
4050
|
*
|
|
4033
|
-
* Use when
|
|
4051
|
+
* Use when you need to test whether an `Option` contains a value using a
|
|
4052
|
+
* custom equality check.
|
|
4034
4053
|
*
|
|
4035
4054
|
* **Details**
|
|
4036
4055
|
*
|
|
@@ -4070,7 +4089,8 @@ export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
|
|
|
4070
4089
|
*
|
|
4071
4090
|
* **When to use**
|
|
4072
4091
|
*
|
|
4073
|
-
* Use when quick membership test
|
|
4092
|
+
* Use when you need a quick membership test for an `Option` value using
|
|
4093
|
+
* standard equality.
|
|
4074
4094
|
*
|
|
4075
4095
|
* **Details**
|
|
4076
4096
|
*
|
|
@@ -4105,7 +4125,8 @@ export const contains: {
|
|
|
4105
4125
|
*
|
|
4106
4126
|
* **When to use**
|
|
4107
4127
|
*
|
|
4108
|
-
* Use when quick membership test
|
|
4128
|
+
* Use when you need a quick membership test for an `Option` value using
|
|
4129
|
+
* standard equality.
|
|
4109
4130
|
*
|
|
4110
4131
|
* **Details**
|
|
4111
4132
|
*
|
|
@@ -4140,7 +4161,8 @@ export const contains: {
|
|
|
4140
4161
|
*
|
|
4141
4162
|
* **When to use**
|
|
4142
4163
|
*
|
|
4143
|
-
* Use when quick membership test
|
|
4164
|
+
* Use when you need a quick membership test for an `Option` value using
|
|
4165
|
+
* standard equality.
|
|
4144
4166
|
*
|
|
4145
4167
|
* **Details**
|
|
4146
4168
|
*
|
|
@@ -4377,7 +4399,8 @@ export const exists: {
|
|
|
4377
4399
|
*
|
|
4378
4400
|
* **When to use**
|
|
4379
4401
|
*
|
|
4380
|
-
* Use when
|
|
4402
|
+
* Use when you need to start an `Option` do notation chain by naming the first
|
|
4403
|
+
* value.
|
|
4381
4404
|
*
|
|
4382
4405
|
* **Example** (Starting do notation)
|
|
4383
4406
|
*
|
|
@@ -4412,7 +4435,8 @@ export const bindTo: {
|
|
|
4412
4435
|
*
|
|
4413
4436
|
* **When to use**
|
|
4414
4437
|
*
|
|
4415
|
-
* Use when
|
|
4438
|
+
* Use when you need to start an `Option` do notation chain by naming the first
|
|
4439
|
+
* value.
|
|
4416
4440
|
*
|
|
4417
4441
|
* **Example** (Starting do notation)
|
|
4418
4442
|
*
|
|
@@ -4447,7 +4471,8 @@ export const bindTo: {
|
|
|
4447
4471
|
*
|
|
4448
4472
|
* **When to use**
|
|
4449
4473
|
*
|
|
4450
|
-
* Use when
|
|
4474
|
+
* Use when you need to start an `Option` do notation chain by naming the first
|
|
4475
|
+
* value.
|
|
4451
4476
|
*
|
|
4452
4477
|
* **Example** (Starting do notation)
|
|
4453
4478
|
*
|
|
@@ -4492,7 +4517,8 @@ export {
|
|
|
4492
4517
|
*
|
|
4493
4518
|
* **When to use**
|
|
4494
4519
|
*
|
|
4495
|
-
* Use when
|
|
4520
|
+
* Use when you need to bind a derived non-`Option` value in an `Option` do
|
|
4521
|
+
* notation pipeline.
|
|
4496
4522
|
*
|
|
4497
4523
|
* **Example** (Adding a computed value)
|
|
4498
4524
|
*
|
|
@@ -4525,7 +4551,7 @@ export {
|
|
|
4525
4551
|
*
|
|
4526
4552
|
* **When to use**
|
|
4527
4553
|
*
|
|
4528
|
-
* Use when
|
|
4554
|
+
* Use when you need to sequence `Option` computations in do notation.
|
|
4529
4555
|
*
|
|
4530
4556
|
* **Example** (Binding Option values)
|
|
4531
4557
|
*
|
|
@@ -4557,7 +4583,7 @@ export const bind: {
|
|
|
4557
4583
|
*
|
|
4558
4584
|
* **When to use**
|
|
4559
4585
|
*
|
|
4560
|
-
* Use when
|
|
4586
|
+
* Use when you need to sequence `Option` computations in do notation.
|
|
4561
4587
|
*
|
|
4562
4588
|
* **Example** (Binding Option values)
|
|
4563
4589
|
*
|
|
@@ -4589,7 +4615,7 @@ export const bind: {
|
|
|
4589
4615
|
*
|
|
4590
4616
|
* **When to use**
|
|
4591
4617
|
*
|
|
4592
|
-
* Use when
|
|
4618
|
+
* Use when you need to sequence `Option` computations in do notation.
|
|
4593
4619
|
*
|
|
4594
4620
|
* **Example** (Binding Option values)
|
|
4595
4621
|
*
|
|
@@ -4627,7 +4653,8 @@ export const bind: {
|
|
|
4627
4653
|
*
|
|
4628
4654
|
* **When to use**
|
|
4629
4655
|
*
|
|
4630
|
-
* Use when
|
|
4656
|
+
* Use when you need to start an `Option` do notation pipeline before adding
|
|
4657
|
+
* bindings.
|
|
4631
4658
|
*
|
|
4632
4659
|
* **Example** (Do notation pipeline)
|
|
4633
4660
|
*
|
|
@@ -4660,8 +4687,8 @@ export const Do: Option<{}> = some({})
|
|
|
4660
4687
|
*
|
|
4661
4688
|
* **When to use**
|
|
4662
4689
|
*
|
|
4663
|
-
* Use when
|
|
4664
|
-
* -
|
|
4690
|
+
* Use when you need generator syntax for a sequence of `Option` steps that
|
|
4691
|
+
* should short-circuit on `None`.
|
|
4665
4692
|
*
|
|
4666
4693
|
* **Details**
|
|
4667
4694
|
*
|
|
@@ -4713,8 +4740,8 @@ export const gen: Gen.Gen<OptionTypeLambda> = (...args) => {
|
|
|
4713
4740
|
*
|
|
4714
4741
|
* **When to use**
|
|
4715
4742
|
*
|
|
4716
|
-
* Use to build
|
|
4717
|
-
*
|
|
4743
|
+
* Use to build an `Option` reducer that falls back to the first available value
|
|
4744
|
+
* when either side may be absent.
|
|
4718
4745
|
*
|
|
4719
4746
|
* **Details**
|
|
4720
4747
|
*
|
|
@@ -4753,7 +4780,8 @@ export function makeReducer<A>(combiner: Combiner.Combiner<A>): Reducer.Reducer<
|
|
|
4753
4780
|
*
|
|
4754
4781
|
* **When to use**
|
|
4755
4782
|
*
|
|
4756
|
-
* Use when
|
|
4783
|
+
* Use when you need an `Option` combiner that returns `None` unless both
|
|
4784
|
+
* operands are `Some`.
|
|
4757
4785
|
*
|
|
4758
4786
|
* **Details**
|
|
4759
4787
|
*
|
|
@@ -4792,8 +4820,8 @@ export function makeCombinerFailFast<A>(combiner: Combiner.Combiner<A>): Combine
|
|
|
4792
4820
|
*
|
|
4793
4821
|
* **When to use**
|
|
4794
4822
|
*
|
|
4795
|
-
* Use
|
|
4796
|
-
*
|
|
4823
|
+
* Use when you need to reduce `Option` values with fail-fast semantics, where
|
|
4824
|
+
* any `None` aborts the entire result instead of being skipped.
|
|
4797
4825
|
*
|
|
4798
4826
|
* **Details**
|
|
4799
4827
|
*
|