effect 4.0.0-beta.83 → 4.0.0-beta.85
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 +64 -64
- package/dist/Array.js +26 -26
- package/dist/Cache.d.ts +1 -1
- package/dist/Cache.js +1 -1
- package/dist/Cause.d.ts +68 -68
- package/dist/Cause.js +47 -47
- package/dist/Channel.d.ts +5 -5
- package/dist/Channel.js +3 -3
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -9
- package/dist/Combiner.js +8 -8
- package/dist/Config.d.ts +15 -94
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +22 -70
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +58 -74
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +66 -41
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +1 -1
- package/dist/Console.js +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +4 -3
- package/dist/Context.js.map +1 -1
- package/dist/Data.d.ts +15 -15
- package/dist/Data.js +3 -3
- package/dist/DateTime.d.ts +6 -6
- package/dist/DateTime.js +2 -2
- package/dist/Duration.d.ts +3 -3
- package/dist/Duration.js +3 -3
- package/dist/Effect.d.ts +84 -45
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +72 -33
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +7 -7
- package/dist/Equal.js +5 -5
- package/dist/Equivalence.d.ts +17 -17
- package/dist/Equivalence.js +13 -13
- package/dist/Exit.d.ts +3 -3
- package/dist/Exit.js +3 -3
- package/dist/Formatter.d.ts +5 -5
- package/dist/Formatter.js +4 -4
- package/dist/Function.d.ts +10 -10
- package/dist/Function.js +3 -3
- package/dist/HashMap.d.ts +3 -3
- package/dist/HashMap.js +1 -1
- package/dist/Iterable.d.ts +6 -6
- package/dist/Iterable.js +2 -2
- package/dist/JsonPatch.d.ts +2 -2
- package/dist/Layer.d.ts +1 -1
- package/dist/Layer.js +5 -4
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -3
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +1 -1
- package/dist/Logger.js +1 -1
- package/dist/Match.d.ts +8 -8
- package/dist/Match.js +8 -8
- package/dist/Metric.d.ts +3 -3
- package/dist/Metric.js +3 -3
- package/dist/Optic.d.ts +30 -30
- package/dist/Optic.js +12 -12
- package/dist/Option.d.ts +7 -7
- package/dist/Option.js +7 -7
- package/dist/Order.d.ts +23 -23
- package/dist/Order.js +20 -20
- package/dist/Pool.d.ts +1 -1
- package/dist/Pool.js +1 -1
- package/dist/Predicate.d.ts +88 -88
- package/dist/Predicate.js +47 -47
- package/dist/PubSub.d.ts +3 -3
- package/dist/PubSub.js +3 -3
- package/dist/Random.d.ts +31 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +32 -0
- package/dist/Random.js.map +1 -1
- package/dist/Reducer.d.ts +1 -1
- package/dist/Reducer.js +1 -1
- package/dist/Result.d.ts +18 -18
- package/dist/Result.js +8 -8
- package/dist/Runtime.d.ts +1 -1
- package/dist/Runtime.js +1 -1
- package/dist/Schema.d.ts +313 -126
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +316 -127
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +9 -8
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +203 -140
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +48 -48
- package/dist/SchemaGetter.js +44 -44
- package/dist/SchemaIssue.d.ts +3 -3
- package/dist/SchemaIssue.js +3 -3
- package/dist/SchemaParser.d.ts +122 -22
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +186 -50
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +1 -1
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +96 -2
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +20 -20
- package/dist/SchemaTransformation.js +18 -18
- package/dist/Stream.d.ts +3 -3
- package/dist/Stream.js +2 -2
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +1 -1
- package/dist/String.js +1 -1
- package/dist/Struct.d.ts +1 -1
- package/dist/Struct.js +1 -1
- package/dist/Types.d.ts +13 -13
- package/dist/internal/effect.js +33 -20
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +17 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/cause.d.ts +2 -0
- package/dist/internal/schema/cause.d.ts.map +1 -0
- package/dist/internal/schema/cause.js +24 -0
- package/dist/internal/schema/cause.js.map +1 -0
- package/dist/internal/schema/schema.d.ts +8 -4
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -8
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/stackTraceLimit.d.ts +2 -0
- package/dist/internal/stackTraceLimit.d.ts.map +1 -0
- package/dist/internal/stackTraceLimit.js +40 -0
- package/dist/internal/stackTraceLimit.js.map +1 -0
- package/dist/internal/tracer.d.ts.map +1 -1
- package/dist/internal/tracer.js +4 -3
- package/dist/internal/tracer.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.js +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/Chat.d.ts +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +4 -5
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +4 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/persistence/PersistedQueue.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -4
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +4 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +15 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -0
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +65 -65
- package/src/Cache.ts +1 -1
- package/src/Cause.ts +68 -68
- package/src/Channel.ts +5 -5
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -9
- package/src/Config.ts +40 -108
- package/src/ConfigProvider.ts +139 -100
- package/src/Console.ts +1 -1
- package/src/Context.ts +4 -5
- package/src/Data.ts +15 -15
- package/src/DateTime.ts +6 -6
- package/src/Duration.ts +3 -3
- package/src/Effect.ts +89 -45
- package/src/Equal.ts +7 -7
- package/src/Equivalence.ts +17 -17
- package/src/Exit.ts +3 -3
- package/src/Formatter.ts +5 -5
- package/src/Function.ts +10 -10
- package/src/HashMap.ts +3 -3
- package/src/Iterable.ts +6 -6
- package/src/JsonPatch.ts +2 -2
- package/src/Layer.ts +5 -5
- package/src/LayerMap.ts +4 -3
- package/src/Logger.ts +1 -1
- package/src/Match.ts +8 -8
- package/src/Metric.ts +3 -3
- package/src/Optic.ts +30 -30
- package/src/Option.ts +7 -7
- package/src/Order.ts +23 -23
- package/src/Pool.ts +1 -1
- package/src/Predicate.ts +88 -88
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +42 -0
- package/src/Reducer.ts +1 -1
- package/src/Result.ts +20 -20
- package/src/Runtime.ts +1 -1
- package/src/Schema.ts +389 -153
- package/src/SchemaAST.ts +237 -148
- package/src/SchemaGetter.ts +48 -48
- package/src/SchemaIssue.ts +3 -3
- package/src/SchemaParser.ts +197 -58
- package/src/SchemaRepresentation.ts +73 -3
- package/src/SchemaTransformation.ts +20 -20
- package/src/Stream.ts +4 -4
- package/src/String.ts +1 -1
- package/src/Struct.ts +1 -1
- package/src/Types.ts +13 -13
- package/src/internal/effect.ts +40 -21
- package/src/internal/schema/arbitrary.ts +23 -2
- package/src/internal/schema/cause.ts +26 -0
- package/src/internal/schema/schema.ts +36 -10
- package/src/internal/stackTraceLimit.ts +63 -0
- package/src/internal/tracer.ts +4 -3
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/Tool.ts +4 -3
- package/src/unstable/cli/Prompt.ts +1 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -3
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +1 -1
- package/src/unstable/rpc/RpcGroup.ts +3 -4
- package/src/unstable/rpc/RpcMiddleware.ts +4 -3
- package/src/unstable/sql/SqlResolver.ts +15 -2
- package/src/unstable/workflow/Activity.ts +2 -0
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/dist/Option.d.ts
CHANGED
|
@@ -1049,7 +1049,7 @@ export declare const firstSomeOf: <T, C extends Iterable<Option<T>> = Iterable<O
|
|
|
1049
1049
|
* - `null` or `undefined` → `None`
|
|
1050
1050
|
* - Any other value → `Some` (typed as `NonNullable<A>`)
|
|
1051
1051
|
*
|
|
1052
|
-
* **Example** (
|
|
1052
|
+
* **Example** (Converting nullable values to an Option)
|
|
1053
1053
|
*
|
|
1054
1054
|
* ```ts
|
|
1055
1055
|
* import { Option } from "effect"
|
|
@@ -1086,7 +1086,7 @@ export declare const fromNullishOr: <A>(a: A) => Option<NonNullable<A>>;
|
|
|
1086
1086
|
* - `undefined` → `None`
|
|
1087
1087
|
* - Any other value (including `null`) → `Some`
|
|
1088
1088
|
*
|
|
1089
|
-
* **Example** (
|
|
1089
|
+
* **Example** (Converting possibly undefined values to an Option)
|
|
1090
1090
|
*
|
|
1091
1091
|
* ```ts
|
|
1092
1092
|
* import { Option } from "effect"
|
|
@@ -1122,7 +1122,7 @@ export declare const fromUndefinedOr: <A>(a: A) => Option<Exclude<A, undefined>>
|
|
|
1122
1122
|
* - `null` → `None`
|
|
1123
1123
|
* - Any other value (including `undefined`) → `Some`
|
|
1124
1124
|
*
|
|
1125
|
-
* **Example** (
|
|
1125
|
+
* **Example** (Converting possibly null values to an Option)
|
|
1126
1126
|
*
|
|
1127
1127
|
* ```ts
|
|
1128
1128
|
* import { Option } from "effect"
|
|
@@ -1625,7 +1625,7 @@ export {
|
|
|
1625
1625
|
*
|
|
1626
1626
|
* Use to return a "success with no meaningful value" from an `Option`-returning function
|
|
1627
1627
|
*
|
|
1628
|
-
* **Example** (
|
|
1628
|
+
* **Example** (Referencing Option.void)
|
|
1629
1629
|
*
|
|
1630
1630
|
* ```ts
|
|
1631
1631
|
* import { Option } from "effect"
|
|
@@ -3769,7 +3769,7 @@ export declare const liftPredicate: {
|
|
|
3769
3769
|
* - `Some` where `isEquivalent(value, a)` is `true` → `true`
|
|
3770
3770
|
* - `Some` where not equivalent, or `None` → `false`
|
|
3771
3771
|
*
|
|
3772
|
-
* **Example** (
|
|
3772
|
+
* **Example** (Checking with custom equivalence)
|
|
3773
3773
|
*
|
|
3774
3774
|
* ```ts
|
|
3775
3775
|
* import { Equivalence, Option } from "effect"
|
|
@@ -4346,7 +4346,7 @@ export declare const bind: {
|
|
|
4346
4346
|
* Use when you need to start an `Option` do notation pipeline before adding
|
|
4347
4347
|
* bindings.
|
|
4348
4348
|
*
|
|
4349
|
-
* **Example** (
|
|
4349
|
+
* **Example** (Building Option pipelines with do notation)
|
|
4350
4350
|
*
|
|
4351
4351
|
* ```ts
|
|
4352
4352
|
* import { Option, pipe } from "effect"
|
|
@@ -4385,7 +4385,7 @@ export declare const Do: Option<{}>;
|
|
|
4385
4385
|
* - The return value is wrapped in `Some`
|
|
4386
4386
|
* - No `Effect` runtime is needed
|
|
4387
4387
|
*
|
|
4388
|
-
* **Example** (
|
|
4388
|
+
* **Example** (Sequencing Option computations with generator syntax)
|
|
4389
4389
|
*
|
|
4390
4390
|
* ```ts
|
|
4391
4391
|
* import { Option } from "effect"
|
package/dist/Option.js
CHANGED
|
@@ -538,7 +538,7 @@ export const firstSomeOf = collection => {
|
|
|
538
538
|
* - `null` or `undefined` → `None`
|
|
539
539
|
* - Any other value → `Some` (typed as `NonNullable<A>`)
|
|
540
540
|
*
|
|
541
|
-
* **Example** (
|
|
541
|
+
* **Example** (Converting nullable values to an Option)
|
|
542
542
|
*
|
|
543
543
|
* ```ts
|
|
544
544
|
* import { Option } from "effect"
|
|
@@ -575,7 +575,7 @@ export const fromNullishOr = a => a == null ? none() : some(a);
|
|
|
575
575
|
* - `undefined` → `None`
|
|
576
576
|
* - Any other value (including `null`) → `Some`
|
|
577
577
|
*
|
|
578
|
-
* **Example** (
|
|
578
|
+
* **Example** (Converting possibly undefined values to an Option)
|
|
579
579
|
*
|
|
580
580
|
* ```ts
|
|
581
581
|
* import { Option } from "effect"
|
|
@@ -611,7 +611,7 @@ export const fromUndefinedOr = a => a === undefined ? none() : some(a);
|
|
|
611
611
|
* - `null` → `None`
|
|
612
612
|
* - Any other value (including `undefined`) → `Some`
|
|
613
613
|
*
|
|
614
|
-
* **Example** (
|
|
614
|
+
* **Example** (Converting possibly null values to an Option)
|
|
615
615
|
*
|
|
616
616
|
* ```ts
|
|
617
617
|
* import { Option } from "effect"
|
|
@@ -938,7 +938,7 @@ export {
|
|
|
938
938
|
*
|
|
939
939
|
* Use to return a "success with no meaningful value" from an `Option`-returning function
|
|
940
940
|
*
|
|
941
|
-
* **Example** (
|
|
941
|
+
* **Example** (Referencing Option.void)
|
|
942
942
|
*
|
|
943
943
|
* ```ts
|
|
944
944
|
* import { Option } from "effect"
|
|
@@ -1787,7 +1787,7 @@ export const liftPredicate = /*#__PURE__*/dual(2, (b, predicate) => predicate(b)
|
|
|
1787
1787
|
* - `Some` where `isEquivalent(value, a)` is `true` → `true`
|
|
1788
1788
|
* - `Some` where not equivalent, or `None` → `false`
|
|
1789
1789
|
*
|
|
1790
|
-
* **Example** (
|
|
1790
|
+
* **Example** (Checking with custom equivalence)
|
|
1791
1791
|
*
|
|
1792
1792
|
* ```ts
|
|
1793
1793
|
* import { Equivalence, Option } from "effect"
|
|
@@ -1993,7 +1993,7 @@ export const bind = /*#__PURE__*/doNotation.bind(map, flatMap);
|
|
|
1993
1993
|
* Use when you need to start an `Option` do notation pipeline before adding
|
|
1994
1994
|
* bindings.
|
|
1995
1995
|
*
|
|
1996
|
-
* **Example** (
|
|
1996
|
+
* **Example** (Building Option pipelines with do notation)
|
|
1997
1997
|
*
|
|
1998
1998
|
* ```ts
|
|
1999
1999
|
* import { Option, pipe } from "effect"
|
|
@@ -2032,7 +2032,7 @@ export const Do = /*#__PURE__*/some({});
|
|
|
2032
2032
|
* - The return value is wrapped in `Some`
|
|
2033
2033
|
* - No `Effect` runtime is needed
|
|
2034
2034
|
*
|
|
2035
|
-
* **Example** (
|
|
2035
|
+
* **Example** (Sequencing Option computations with generator syntax)
|
|
2036
2036
|
*
|
|
2037
2037
|
* ```ts
|
|
2038
2038
|
* import { Option } from "effect"
|
package/dist/Order.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import * as Reducer from "./Reducer.ts";
|
|
|
15
15
|
* is greater than the second. It must satisfy total ordering laws: totality,
|
|
16
16
|
* antisymmetry, and transitivity.
|
|
17
17
|
*
|
|
18
|
-
* **Example** (
|
|
18
|
+
* **Example** (Defining a custom Order)
|
|
19
19
|
*
|
|
20
20
|
* ```ts
|
|
21
21
|
* import { Order } from "effect"
|
|
@@ -105,7 +105,7 @@ export declare function make<A>(compare: (self: A, that: A) => -1 | 0 | 1): Orde
|
|
|
105
105
|
* Uses lexicographic dictionary ordering. The empty string is less than any
|
|
106
106
|
* non-empty string, and comparisons are case-sensitive.
|
|
107
107
|
*
|
|
108
|
-
* **Example** (
|
|
108
|
+
* **Example** (Ordering strings)
|
|
109
109
|
*
|
|
110
110
|
* ```ts
|
|
111
111
|
* import { Order } from "effect"
|
|
@@ -134,7 +134,7 @@ export declare const String: Order<string>;
|
|
|
134
134
|
* each other, and any `NaN` is considered less than any non-`NaN` number. All
|
|
135
135
|
* other values use standard numeric comparison.
|
|
136
136
|
*
|
|
137
|
-
* **Example** (
|
|
137
|
+
* **Example** (Ordering numbers)
|
|
138
138
|
*
|
|
139
139
|
* ```ts
|
|
140
140
|
* import { Order } from "effect"
|
|
@@ -164,7 +164,7 @@ export declare const Number: Order<number>;
|
|
|
164
164
|
*
|
|
165
165
|
* `false` is less than `true`, and equal values return `0`.
|
|
166
166
|
*
|
|
167
|
-
* **Example** (
|
|
167
|
+
* **Example** (Ordering booleans)
|
|
168
168
|
*
|
|
169
169
|
* ```ts
|
|
170
170
|
* import { Order } from "effect"
|
|
@@ -191,7 +191,7 @@ export declare const Boolean: Order<boolean>;
|
|
|
191
191
|
* Uses standard numeric comparison for bigint values and handles arbitrarily
|
|
192
192
|
* large integers.
|
|
193
193
|
*
|
|
194
|
-
* **Example** (
|
|
194
|
+
* **Example** (Ordering BigInts)
|
|
195
195
|
*
|
|
196
196
|
* ```ts
|
|
197
197
|
* import { Order } from "effect"
|
|
@@ -220,7 +220,7 @@ export declare const BigInt: Order<bigint>;
|
|
|
220
220
|
* original order returns `-1`, the flipped order returns `1`, and vice versa.
|
|
221
221
|
* Equal comparisons remain `0`.
|
|
222
222
|
*
|
|
223
|
-
* **Example** (Reversing Order)
|
|
223
|
+
* **Example** (Reversing an Order)
|
|
224
224
|
*
|
|
225
225
|
* ```ts
|
|
226
226
|
* import { Order } from "effect"
|
|
@@ -251,7 +251,7 @@ export declare function flip<A>(O: Order<A>): Order<A>;
|
|
|
251
251
|
* returned; otherwise, the second order is applied. The result is the first
|
|
252
252
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
253
253
|
*
|
|
254
|
-
* **Example** (Combining Orders)
|
|
254
|
+
* **Example** (Combining two Orders)
|
|
255
255
|
*
|
|
256
256
|
* ```ts
|
|
257
257
|
* import { Order } from "effect"
|
|
@@ -294,7 +294,7 @@ export declare const combine: {
|
|
|
294
294
|
* returned; otherwise, the second order is applied. The result is the first
|
|
295
295
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
296
296
|
*
|
|
297
|
-
* **Example** (Combining Orders)
|
|
297
|
+
* **Example** (Combining two Orders)
|
|
298
298
|
*
|
|
299
299
|
* ```ts
|
|
300
300
|
* import { Order } from "effect"
|
|
@@ -337,7 +337,7 @@ export declare const combine: {
|
|
|
337
337
|
* returned; otherwise, the second order is applied. The result is the first
|
|
338
338
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
339
339
|
*
|
|
340
|
-
* **Example** (Combining Orders)
|
|
340
|
+
* **Example** (Combining two Orders)
|
|
341
341
|
*
|
|
342
342
|
* ```ts
|
|
343
343
|
* import { Order } from "effect"
|
|
@@ -379,7 +379,7 @@ export declare const combine: {
|
|
|
379
379
|
* Always returns `0` regardless of input values, making it useful as a neutral
|
|
380
380
|
* element in order composition.
|
|
381
381
|
*
|
|
382
|
-
* **Example** (
|
|
382
|
+
* **Example** (Ordering with an always-equal Order)
|
|
383
383
|
*
|
|
384
384
|
* ```ts
|
|
385
385
|
* import { Order } from "effect"
|
|
@@ -409,7 +409,7 @@ export declare function alwaysEqual<A>(): Order<A>;
|
|
|
409
409
|
* Applies orders in iteration order and short-circuits on the first non-zero
|
|
410
410
|
* result. It returns `0` only if all orders return `0`.
|
|
411
411
|
*
|
|
412
|
-
* **Example** (Combining
|
|
412
|
+
* **Example** (Combining multiple Orders)
|
|
413
413
|
*
|
|
414
414
|
* ```ts
|
|
415
415
|
* import { Order } from "effect"
|
|
@@ -550,7 +550,7 @@ export declare const mapInput: {
|
|
|
550
550
|
* Earlier dates are less than later dates. Invalid dates are compared through
|
|
551
551
|
* their `getTime()` result.
|
|
552
552
|
*
|
|
553
|
-
* **Example** (
|
|
553
|
+
* **Example** (Ordering Dates)
|
|
554
554
|
*
|
|
555
555
|
* ```ts
|
|
556
556
|
* import { Order } from "effect"
|
|
@@ -581,7 +581,7 @@ export declare const Date: Order<Date>;
|
|
|
581
581
|
* the first non-zero comparison result. Tuples must have the same length as the
|
|
582
582
|
* order collection, and the result is `0` only if all elements are equal.
|
|
583
583
|
*
|
|
584
|
-
* **Example** (
|
|
584
|
+
* **Example** (Ordering tuples)
|
|
585
585
|
*
|
|
586
586
|
* ```ts
|
|
587
587
|
* import { Order } from "effect"
|
|
@@ -619,7 +619,7 @@ export {
|
|
|
619
619
|
* are less than longer arrays. The result is `0` only if arrays have the same
|
|
620
620
|
* length and all elements are equal.
|
|
621
621
|
*
|
|
622
|
-
* **Example** (
|
|
622
|
+
* **Example** (Ordering array elements)
|
|
623
623
|
*
|
|
624
624
|
* ```ts
|
|
625
625
|
* import { Order } from "effect"
|
|
@@ -650,7 +650,7 @@ Array_ as Array };
|
|
|
650
650
|
* stops at the first non-zero comparison result. Field order matters: earlier
|
|
651
651
|
* fields take precedence. The result is `0` only if all fields are equal.
|
|
652
652
|
*
|
|
653
|
-
* **Example** (
|
|
653
|
+
* **Example** (Ordering structs)
|
|
654
654
|
*
|
|
655
655
|
* ```ts
|
|
656
656
|
* import { Order } from "effect"
|
|
@@ -691,7 +691,7 @@ export declare function Struct<const R extends {
|
|
|
691
691
|
* Returns `true` if the order returns `-1`, meaning the first value is less
|
|
692
692
|
* than the second. Equal or greater values return `false`.
|
|
693
693
|
*
|
|
694
|
-
* **Example** (
|
|
694
|
+
* **Example** (Checking less-than comparisons)
|
|
695
695
|
*
|
|
696
696
|
* ```ts
|
|
697
697
|
* import { Order } from "effect"
|
|
@@ -724,7 +724,7 @@ export declare const isLessThan: <A>(O: Order<A>) => {
|
|
|
724
724
|
* Returns `true` if the order returns `1`, meaning the first value is greater
|
|
725
725
|
* than the second. Equal or lesser values return `false`.
|
|
726
726
|
*
|
|
727
|
-
* **Example** (
|
|
727
|
+
* **Example** (Checking greater-than comparisons)
|
|
728
728
|
*
|
|
729
729
|
* ```ts
|
|
730
730
|
* import { Order } from "effect"
|
|
@@ -757,7 +757,7 @@ export declare const isGreaterThan: <A>(O: Order<A>) => {
|
|
|
757
757
|
* Returns `true` if the order returns `-1` or `0`, and returns `false` only if
|
|
758
758
|
* the order returns `1`.
|
|
759
759
|
*
|
|
760
|
-
* **Example** (
|
|
760
|
+
* **Example** (Checking less-than-or-equal comparisons)
|
|
761
761
|
*
|
|
762
762
|
* ```ts
|
|
763
763
|
* import { Order } from "effect"
|
|
@@ -791,7 +791,7 @@ export declare const isLessThanOrEqualTo: <A>(O: Order<A>) => {
|
|
|
791
791
|
* Returns `true` if the order returns `1` or `0`, and returns `false` only if
|
|
792
792
|
* the order returns `-1`.
|
|
793
793
|
*
|
|
794
|
-
* **Example** (
|
|
794
|
+
* **Example** (Checking greater-than-or-equal comparisons)
|
|
795
795
|
*
|
|
796
796
|
* ```ts
|
|
797
797
|
* import { Order } from "effect"
|
|
@@ -825,7 +825,7 @@ export declare const isGreaterThanOrEqualTo: <A>(O: Order<A>) => {
|
|
|
825
825
|
* Returns the value that compares as less than or equal to the other value. If
|
|
826
826
|
* values are equal, the first argument is returned.
|
|
827
827
|
*
|
|
828
|
-
* **Example** (
|
|
828
|
+
* **Example** (Selecting the minimum value)
|
|
829
829
|
*
|
|
830
830
|
* ```ts
|
|
831
831
|
* import { Order } from "effect"
|
|
@@ -859,7 +859,7 @@ export declare const min: <A>(O: Order<A>) => {
|
|
|
859
859
|
* Returns the value that compares as greater than or equal to the other value.
|
|
860
860
|
* If values are equal, the first argument is returned.
|
|
861
861
|
*
|
|
862
|
-
* **Example** (
|
|
862
|
+
* **Example** (Selecting the maximum value)
|
|
863
863
|
*
|
|
864
864
|
* ```ts
|
|
865
865
|
* import { Order } from "effect"
|
|
@@ -895,7 +895,7 @@ export declare const max: <A>(O: Order<A>) => {
|
|
|
895
895
|
* maximum. The minimum must be less than or equal to the maximum according to
|
|
896
896
|
* the order.
|
|
897
897
|
*
|
|
898
|
-
* **Example** (Clamping
|
|
898
|
+
* **Example** (Clamping values)
|
|
899
899
|
*
|
|
900
900
|
* ```ts
|
|
901
901
|
* import { Order } from "effect"
|
|
@@ -938,7 +938,7 @@ export declare const clamp: <A>(O: Order<A>) => {
|
|
|
938
938
|
* than or equal to maximum. Values outside the range return `false`. Both
|
|
939
939
|
* bounds are inclusive.
|
|
940
940
|
*
|
|
941
|
-
* **Example** (Checking
|
|
941
|
+
* **Example** (Checking ranges)
|
|
942
942
|
*
|
|
943
943
|
* ```ts
|
|
944
944
|
* import { Order } from "effect"
|
package/dist/Order.js
CHANGED
|
@@ -62,7 +62,7 @@ export function make(compare) {
|
|
|
62
62
|
* Uses lexicographic dictionary ordering. The empty string is less than any
|
|
63
63
|
* non-empty string, and comparisons are case-sensitive.
|
|
64
64
|
*
|
|
65
|
-
* **Example** (
|
|
65
|
+
* **Example** (Ordering strings)
|
|
66
66
|
*
|
|
67
67
|
* ```ts
|
|
68
68
|
* import { Order } from "effect"
|
|
@@ -91,7 +91,7 @@ export const String = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);
|
|
|
91
91
|
* each other, and any `NaN` is considered less than any non-`NaN` number. All
|
|
92
92
|
* other values use standard numeric comparison.
|
|
93
93
|
*
|
|
94
|
-
* **Example** (
|
|
94
|
+
* **Example** (Ordering numbers)
|
|
95
95
|
*
|
|
96
96
|
* ```ts
|
|
97
97
|
* import { Order } from "effect"
|
|
@@ -126,7 +126,7 @@ export const Number = /*#__PURE__*/make((self, that) => {
|
|
|
126
126
|
*
|
|
127
127
|
* `false` is less than `true`, and equal values return `0`.
|
|
128
128
|
*
|
|
129
|
-
* **Example** (
|
|
129
|
+
* **Example** (Ordering booleans)
|
|
130
130
|
*
|
|
131
131
|
* ```ts
|
|
132
132
|
* import { Order } from "effect"
|
|
@@ -153,7 +153,7 @@ export const Boolean = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);
|
|
|
153
153
|
* Uses standard numeric comparison for bigint values and handles arbitrarily
|
|
154
154
|
* large integers.
|
|
155
155
|
*
|
|
156
|
-
* **Example** (
|
|
156
|
+
* **Example** (Ordering BigInts)
|
|
157
157
|
*
|
|
158
158
|
* ```ts
|
|
159
159
|
* import { Order } from "effect"
|
|
@@ -182,7 +182,7 @@ export const BigInt = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);
|
|
|
182
182
|
* original order returns `-1`, the flipped order returns `1`, and vice versa.
|
|
183
183
|
* Equal comparisons remain `0`.
|
|
184
184
|
*
|
|
185
|
-
* **Example** (Reversing Order)
|
|
185
|
+
* **Example** (Reversing an Order)
|
|
186
186
|
*
|
|
187
187
|
* ```ts
|
|
188
188
|
* import { Order } from "effect"
|
|
@@ -215,7 +215,7 @@ export function flip(O) {
|
|
|
215
215
|
* returned; otherwise, the second order is applied. The result is the first
|
|
216
216
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
217
217
|
*
|
|
218
|
-
* **Example** (Combining Orders)
|
|
218
|
+
* **Example** (Combining two Orders)
|
|
219
219
|
*
|
|
220
220
|
* ```ts
|
|
221
221
|
* import { Order } from "effect"
|
|
@@ -262,7 +262,7 @@ export const combine = /*#__PURE__*/dual(2, (self, that) => make((a1, a2) => {
|
|
|
262
262
|
* Always returns `0` regardless of input values, making it useful as a neutral
|
|
263
263
|
* element in order composition.
|
|
264
264
|
*
|
|
265
|
-
* **Example** (
|
|
265
|
+
* **Example** (Ordering with an always-equal Order)
|
|
266
266
|
*
|
|
267
267
|
* ```ts
|
|
268
268
|
* import { Order } from "effect"
|
|
@@ -294,7 +294,7 @@ export function alwaysEqual() {
|
|
|
294
294
|
* Applies orders in iteration order and short-circuits on the first non-zero
|
|
295
295
|
* result. It returns `0` only if all orders return `0`.
|
|
296
296
|
*
|
|
297
|
-
* **Example** (Combining
|
|
297
|
+
* **Example** (Combining multiple Orders)
|
|
298
298
|
*
|
|
299
299
|
* ```ts
|
|
300
300
|
* import { Order } from "effect"
|
|
@@ -379,7 +379,7 @@ export const mapInput = /*#__PURE__*/dual(2, (self, f) => make((b1, b2) => self(
|
|
|
379
379
|
* Earlier dates are less than later dates. Invalid dates are compared through
|
|
380
380
|
* their `getTime()` result.
|
|
381
381
|
*
|
|
382
|
-
* **Example** (
|
|
382
|
+
* **Example** (Ordering Dates)
|
|
383
383
|
*
|
|
384
384
|
* ```ts
|
|
385
385
|
* import { Order } from "effect"
|
|
@@ -410,7 +410,7 @@ export const Date = /*#__PURE__*/mapInput(Number, date => date.getTime());
|
|
|
410
410
|
* the first non-zero comparison result. Tuples must have the same length as the
|
|
411
411
|
* order collection, and the result is `0` only if all elements are equal.
|
|
412
412
|
*
|
|
413
|
-
* **Example** (
|
|
413
|
+
* **Example** (Ordering tuples)
|
|
414
414
|
*
|
|
415
415
|
* ```ts
|
|
416
416
|
* import { Order } from "effect"
|
|
@@ -470,7 +470,7 @@ export {
|
|
|
470
470
|
* are less than longer arrays. The result is `0` only if arrays have the same
|
|
471
471
|
* length and all elements are equal.
|
|
472
472
|
*
|
|
473
|
-
* **Example** (
|
|
473
|
+
* **Example** (Ordering array elements)
|
|
474
474
|
*
|
|
475
475
|
* ```ts
|
|
476
476
|
* import { Order } from "effect"
|
|
@@ -501,7 +501,7 @@ Array_ as Array };
|
|
|
501
501
|
* stops at the first non-zero comparison result. Field order matters: earlier
|
|
502
502
|
* fields take precedence. The result is `0` only if all fields are equal.
|
|
503
503
|
*
|
|
504
|
-
* **Example** (
|
|
504
|
+
* **Example** (Ordering structs)
|
|
505
505
|
*
|
|
506
506
|
* ```ts
|
|
507
507
|
* import { Order } from "effect"
|
|
@@ -549,7 +549,7 @@ export function Struct(fields) {
|
|
|
549
549
|
* Returns `true` if the order returns `-1`, meaning the first value is less
|
|
550
550
|
* than the second. Equal or greater values return `false`.
|
|
551
551
|
*
|
|
552
|
-
* **Example** (
|
|
552
|
+
* **Example** (Checking less-than comparisons)
|
|
553
553
|
*
|
|
554
554
|
* ```ts
|
|
555
555
|
* import { Order } from "effect"
|
|
@@ -579,7 +579,7 @@ export const isLessThan = O => dual(2, (self, that) => O(self, that) === -1);
|
|
|
579
579
|
* Returns `true` if the order returns `1`, meaning the first value is greater
|
|
580
580
|
* than the second. Equal or lesser values return `false`.
|
|
581
581
|
*
|
|
582
|
-
* **Example** (
|
|
582
|
+
* **Example** (Checking greater-than comparisons)
|
|
583
583
|
*
|
|
584
584
|
* ```ts
|
|
585
585
|
* import { Order } from "effect"
|
|
@@ -609,7 +609,7 @@ export const isGreaterThan = O => dual(2, (self, that) => O(self, that) === 1);
|
|
|
609
609
|
* Returns `true` if the order returns `-1` or `0`, and returns `false` only if
|
|
610
610
|
* the order returns `1`.
|
|
611
611
|
*
|
|
612
|
-
* **Example** (
|
|
612
|
+
* **Example** (Checking less-than-or-equal comparisons)
|
|
613
613
|
*
|
|
614
614
|
* ```ts
|
|
615
615
|
* import { Order } from "effect"
|
|
@@ -640,7 +640,7 @@ export const isLessThanOrEqualTo = O => dual(2, (self, that) => O(self, that) !=
|
|
|
640
640
|
* Returns `true` if the order returns `1` or `0`, and returns `false` only if
|
|
641
641
|
* the order returns `-1`.
|
|
642
642
|
*
|
|
643
|
-
* **Example** (
|
|
643
|
+
* **Example** (Checking greater-than-or-equal comparisons)
|
|
644
644
|
*
|
|
645
645
|
* ```ts
|
|
646
646
|
* import { Order } from "effect"
|
|
@@ -671,7 +671,7 @@ export const isGreaterThanOrEqualTo = O => dual(2, (self, that) => O(self, that)
|
|
|
671
671
|
* Returns the value that compares as less than or equal to the other value. If
|
|
672
672
|
* values are equal, the first argument is returned.
|
|
673
673
|
*
|
|
674
|
-
* **Example** (
|
|
674
|
+
* **Example** (Selecting the minimum value)
|
|
675
675
|
*
|
|
676
676
|
* ```ts
|
|
677
677
|
* import { Order } from "effect"
|
|
@@ -702,7 +702,7 @@ export const min = O => dual(2, (self, that) => self === that || O(self, that) <
|
|
|
702
702
|
* Returns the value that compares as greater than or equal to the other value.
|
|
703
703
|
* If values are equal, the first argument is returned.
|
|
704
704
|
*
|
|
705
|
-
* **Example** (
|
|
705
|
+
* **Example** (Selecting the maximum value)
|
|
706
706
|
*
|
|
707
707
|
* ```ts
|
|
708
708
|
* import { Order } from "effect"
|
|
@@ -735,7 +735,7 @@ export const max = O => dual(2, (self, that) => self === that || O(self, that) >
|
|
|
735
735
|
* maximum. The minimum must be less than or equal to the maximum according to
|
|
736
736
|
* the order.
|
|
737
737
|
*
|
|
738
|
-
* **Example** (Clamping
|
|
738
|
+
* **Example** (Clamping values)
|
|
739
739
|
*
|
|
740
740
|
* ```ts
|
|
741
741
|
* import { Order } from "effect"
|
|
@@ -769,7 +769,7 @@ export const clamp = O => dual(2, (self, options) => min(O)(options.maximum, max
|
|
|
769
769
|
* than or equal to maximum. Values outside the range return `false`. Both
|
|
770
770
|
* bounds are inclusive.
|
|
771
771
|
*
|
|
772
|
-
* **Example** (Checking
|
|
772
|
+
* **Example** (Checking ranges)
|
|
773
773
|
*
|
|
774
774
|
* ```ts
|
|
775
775
|
* import { Order } from "effect"
|
package/dist/Pool.d.ts
CHANGED
|
@@ -218,7 +218,7 @@ export declare const make: <A, E, R>(options: {
|
|
|
218
218
|
* from item creation, while `"usage"` measures from pool usage. The default is
|
|
219
219
|
* `"usage"`.
|
|
220
220
|
*
|
|
221
|
-
* **Example** (
|
|
221
|
+
* **Example** (Creating a connection pool)
|
|
222
222
|
*
|
|
223
223
|
* ```ts
|
|
224
224
|
* import { Duration, Effect, Pool } from "effect"
|
package/dist/Pool.js
CHANGED
|
@@ -86,7 +86,7 @@ export const make = options => makeWithStrategy({
|
|
|
86
86
|
* from item creation, while `"usage"` measures from pool usage. The default is
|
|
87
87
|
* `"usage"`.
|
|
88
88
|
*
|
|
89
|
-
* **Example** (
|
|
89
|
+
* **Example** (Creating a connection pool)
|
|
90
90
|
*
|
|
91
91
|
* ```ts
|
|
92
92
|
* import { Duration, Effect, Pool } from "effect"
|