effect 4.0.0-beta.83 → 4.0.0-beta.84
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/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 +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/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 +265 -120
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +285 -116
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +13 -9
- 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 +23 -10
- package/dist/internal/effect.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/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/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- 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/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/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 +1 -1
- 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/Reducer.ts +1 -1
- package/src/Result.ts +20 -20
- package/src/Runtime.ts +1 -1
- package/src/Schema.ts +314 -131
- package/src/SchemaAST.ts +20 -11
- 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 +29 -10
- package/src/internal/schema/cause.ts +26 -0
- package/src/internal/schema/schema.ts +36 -10
- 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/cli/Prompt.ts +1 -1
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/rpc/Rpc.ts +1 -1
- package/src/unstable/rpc/RpcGroup.ts +3 -4
- 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/Equivalence.js
CHANGED
|
@@ -43,7 +43,7 @@ import * as Reducer from "./Reducer.js";
|
|
|
43
43
|
* console.log(caseInsensitive(str, str)) // true (fast path)
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
|
-
* **Example** (
|
|
46
|
+
* **Example** (Comparing numbers with tolerance)
|
|
47
47
|
*
|
|
48
48
|
* ```ts
|
|
49
49
|
* import { Equivalence } from "effect"
|
|
@@ -79,7 +79,7 @@ const isStrictEquivalent = (x, y) => x === y;
|
|
|
79
79
|
*
|
|
80
80
|
* `NaN !== NaN`, so `NaN` values are never considered equivalent.
|
|
81
81
|
*
|
|
82
|
-
* **Example** (
|
|
82
|
+
* **Example** (Comparing primitive types)
|
|
83
83
|
*
|
|
84
84
|
* ```ts
|
|
85
85
|
* import { Equivalence } from "effect"
|
|
@@ -91,7 +91,7 @@ const isStrictEquivalent = (x, y) => x === y;
|
|
|
91
91
|
* console.log(strictEq(NaN, NaN)) // false (NaN !== NaN)
|
|
92
92
|
* ```
|
|
93
93
|
*
|
|
94
|
-
* **Example** (
|
|
94
|
+
* **Example** (Comparing objects by reference)
|
|
95
95
|
*
|
|
96
96
|
* ```ts
|
|
97
97
|
* import { Equivalence } from "effect"
|
|
@@ -289,7 +289,7 @@ export const combine = /*#__PURE__*/dual(2, (self, that) => make((x, y) => self(
|
|
|
289
289
|
* console.log(point3DEq(point1, point3)) // false (different z)
|
|
290
290
|
* ```
|
|
291
291
|
*
|
|
292
|
-
* **Example** (
|
|
292
|
+
* **Example** (Handling empty collections)
|
|
293
293
|
*
|
|
294
294
|
* ```ts
|
|
295
295
|
* import { Equivalence } from "effect"
|
|
@@ -328,7 +328,7 @@ export const combineAll = collection => make((x, y) => {
|
|
|
328
328
|
* - Useful for comparing by one property or normalizing values before
|
|
329
329
|
* comparison, such as case-insensitive strings
|
|
330
330
|
*
|
|
331
|
-
* **Example** (
|
|
331
|
+
* **Example** (Deriving equivalence from an object property)
|
|
332
332
|
*
|
|
333
333
|
* ```ts
|
|
334
334
|
* import { Equivalence } from "effect"
|
|
@@ -389,7 +389,7 @@ export const mapInput = /*#__PURE__*/dual(2, (self, f) => make((x, y) => self(f(
|
|
|
389
389
|
* respective equivalences, and it also satisfies reflexive, symmetric, and
|
|
390
390
|
* transitive properties.
|
|
391
391
|
*
|
|
392
|
-
* **Example** (
|
|
392
|
+
* **Example** (Comparing homogeneous tuples)
|
|
393
393
|
*
|
|
394
394
|
* ```ts
|
|
395
395
|
* import { Equivalence } from "effect"
|
|
@@ -408,7 +408,7 @@ export const mapInput = /*#__PURE__*/dual(2, (self, f) => make((x, y) => self(f(
|
|
|
408
408
|
* console.log(stringTupleEq(tuple1, tuple3)) // false (different third element)
|
|
409
409
|
* ```
|
|
410
410
|
*
|
|
411
|
-
* **Example** (
|
|
411
|
+
* **Example** (Comparing tuples with custom equivalences)
|
|
412
412
|
*
|
|
413
413
|
* ```ts
|
|
414
414
|
* import { Equivalence } from "effect"
|
|
@@ -473,7 +473,7 @@ export {
|
|
|
473
473
|
* - Empty arrays are considered equivalent
|
|
474
474
|
* - The result is also an equivalence that satisfies reflexive, symmetric, and transitive properties
|
|
475
475
|
*
|
|
476
|
-
* **Example** (
|
|
476
|
+
* **Example** (Comparing number arrays)
|
|
477
477
|
*
|
|
478
478
|
* ```ts
|
|
479
479
|
* import { Equivalence } from "effect"
|
|
@@ -523,7 +523,7 @@ Array_ as Array };
|
|
|
523
523
|
* are equivalent according to their equivalences, and it also satisfies
|
|
524
524
|
* reflexive, symmetric, and transitive properties.
|
|
525
525
|
*
|
|
526
|
-
* **Example** (
|
|
526
|
+
* **Example** (Comparing structs with different equivalences per field)
|
|
527
527
|
*
|
|
528
528
|
* ```ts
|
|
529
529
|
* import { Equivalence } from "effect"
|
|
@@ -553,7 +553,7 @@ Array_ as Array };
|
|
|
553
553
|
* console.log(personEq(person1, person3)) // false (different age)
|
|
554
554
|
* ```
|
|
555
555
|
*
|
|
556
|
-
* **Example** (
|
|
556
|
+
* **Example** (Comparing specific fields)
|
|
557
557
|
*
|
|
558
558
|
* ```ts
|
|
559
559
|
* import { Equivalence } from "effect"
|
|
@@ -601,7 +601,7 @@ export function Struct(fields) {
|
|
|
601
601
|
* - Empty objects are considered equivalent
|
|
602
602
|
* - The result is also an equivalence that satisfies reflexive, symmetric, and transitive properties
|
|
603
603
|
*
|
|
604
|
-
* **Example** (
|
|
604
|
+
* **Example** (Defining records with string values)
|
|
605
605
|
*
|
|
606
606
|
* ```ts
|
|
607
607
|
* import { Equivalence } from "effect"
|
|
@@ -618,7 +618,7 @@ export function Struct(fields) {
|
|
|
618
618
|
* console.log(stringRecordEq(record1, record4)) // false (different keys)
|
|
619
619
|
* ```
|
|
620
620
|
*
|
|
621
|
-
* **Example** (
|
|
621
|
+
* **Example** (Defining records with number values)
|
|
622
622
|
*
|
|
623
623
|
* ```ts
|
|
624
624
|
* import { Equivalence } from "effect"
|
|
@@ -719,7 +719,7 @@ export function makeReducer() {
|
|
|
719
719
|
* console.log(Equivalence.Date(invalidDate1, d1)) // false
|
|
720
720
|
* ```
|
|
721
721
|
*
|
|
722
|
-
* **Example** (
|
|
722
|
+
* **Example** (Comparing reference and value equality)
|
|
723
723
|
*
|
|
724
724
|
* ```ts
|
|
725
725
|
* import { Equivalence } from "effect"
|
package/dist/Exit.d.ts
CHANGED
|
@@ -342,7 +342,7 @@ export {
|
|
|
342
342
|
* Equivalent to `Exit.succeed(undefined)` but shared as a single instance,
|
|
343
343
|
* avoiding allocation for a common case.
|
|
344
344
|
*
|
|
345
|
-
* **Example** (
|
|
345
|
+
* **Example** (Referencing the void Exit)
|
|
346
346
|
*
|
|
347
347
|
* ```ts
|
|
348
348
|
* import { Exit } from "effect"
|
|
@@ -366,7 +366,7 @@ void_ as void };
|
|
|
366
366
|
* Use as a type guard to narrow `Exit<A, E>` to `Success<A, E>` and access the
|
|
367
367
|
* `value` property.
|
|
368
368
|
*
|
|
369
|
-
* **Example** (Narrowing to
|
|
369
|
+
* **Example** (Narrowing to success)
|
|
370
370
|
*
|
|
371
371
|
* ```ts
|
|
372
372
|
* import { Exit } from "effect"
|
|
@@ -393,7 +393,7 @@ export declare const isSuccess: <A, E>(self: Exit<A, E>) => self is Success<A, E
|
|
|
393
393
|
* Use as a type guard to narrow `Exit<A, E>` to `Failure<A, E>` and access the
|
|
394
394
|
* `cause` property.
|
|
395
395
|
*
|
|
396
|
-
* **Example** (Narrowing to
|
|
396
|
+
* **Example** (Narrowing to failure)
|
|
397
397
|
*
|
|
398
398
|
* ```ts
|
|
399
399
|
* import { Exit } from "effect"
|
package/dist/Exit.js
CHANGED
|
@@ -193,7 +193,7 @@ export {
|
|
|
193
193
|
* Equivalent to `Exit.succeed(undefined)` but shared as a single instance,
|
|
194
194
|
* avoiding allocation for a common case.
|
|
195
195
|
*
|
|
196
|
-
* **Example** (
|
|
196
|
+
* **Example** (Referencing the void Exit)
|
|
197
197
|
*
|
|
198
198
|
* ```ts
|
|
199
199
|
* import { Exit } from "effect"
|
|
@@ -217,7 +217,7 @@ void_ as void };
|
|
|
217
217
|
* Use as a type guard to narrow `Exit<A, E>` to `Success<A, E>` and access the
|
|
218
218
|
* `value` property.
|
|
219
219
|
*
|
|
220
|
-
* **Example** (Narrowing to
|
|
220
|
+
* **Example** (Narrowing to success)
|
|
221
221
|
*
|
|
222
222
|
* ```ts
|
|
223
223
|
* import { Exit } from "effect"
|
|
@@ -244,7 +244,7 @@ export const isSuccess = effect.exitIsSuccess;
|
|
|
244
244
|
* Use as a type guard to narrow `Exit<A, E>` to `Failure<A, E>` and access the
|
|
245
245
|
* `cause` property.
|
|
246
246
|
*
|
|
247
|
-
* **Example** (Narrowing to
|
|
247
|
+
* **Example** (Narrowing to failure)
|
|
248
248
|
*
|
|
249
249
|
* ```ts
|
|
250
250
|
* import { Exit } from "effect"
|
package/dist/Formatter.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* This is a pure callable type and carries no runtime implementation. It is contravariant in `Value` and covariant in `Format`.
|
|
11
11
|
*
|
|
12
|
-
* **Example** (
|
|
12
|
+
* **Example** (Defining a custom formatter)
|
|
13
13
|
*
|
|
14
14
|
* ```ts
|
|
15
15
|
* import type { Formatter } from "effect"
|
|
@@ -58,7 +58,7 @@ export interface Formatter<in Value, out Format = string> {
|
|
|
58
58
|
* `"\t"`). Defaults to `0` (compact).
|
|
59
59
|
* - `ignoreToString` — skip calling `toString()`. Defaults to `false`.
|
|
60
60
|
*
|
|
61
|
-
* **Example** (
|
|
61
|
+
* **Example** (Formatting compact output)
|
|
62
62
|
*
|
|
63
63
|
* ```ts
|
|
64
64
|
* import { Formatter } from "effect"
|
|
@@ -82,7 +82,7 @@ export interface Formatter<in Value, out Format = string> {
|
|
|
82
82
|
* // }
|
|
83
83
|
* ```
|
|
84
84
|
*
|
|
85
|
-
* **Example** (
|
|
85
|
+
* **Example** (Handling circular references)
|
|
86
86
|
*
|
|
87
87
|
* ```ts
|
|
88
88
|
* import { Formatter } from "effect"
|
|
@@ -120,7 +120,7 @@ export declare function format(input: unknown, options?: {
|
|
|
120
120
|
* `Symbol`, `undefined`, and functions, follow standard `JSON.stringify`
|
|
121
121
|
* behavior. The `space` parameter controls indentation and defaults to `0`.
|
|
122
122
|
*
|
|
123
|
-
* **Example** (
|
|
123
|
+
* **Example** (Formatting compact JSON)
|
|
124
124
|
*
|
|
125
125
|
* ```ts
|
|
126
126
|
* import { Formatter } from "effect"
|
|
@@ -129,7 +129,7 @@ export declare function format(input: unknown, options?: {
|
|
|
129
129
|
* // {"name":"Alice","age":30}
|
|
130
130
|
* ```
|
|
131
131
|
*
|
|
132
|
-
* **Example** (
|
|
132
|
+
* **Example** (Handling circular references)
|
|
133
133
|
*
|
|
134
134
|
* ```ts
|
|
135
135
|
* import { Formatter } from "effect"
|
package/dist/Formatter.js
CHANGED
|
@@ -41,7 +41,7 @@ import { getRedacted, redact, symbolRedactable } from "./Redactable.js";
|
|
|
41
41
|
* `"\t"`). Defaults to `0` (compact).
|
|
42
42
|
* - `ignoreToString` — skip calling `toString()`. Defaults to `false`.
|
|
43
43
|
*
|
|
44
|
-
* **Example** (
|
|
44
|
+
* **Example** (Formatting compact output)
|
|
45
45
|
*
|
|
46
46
|
* ```ts
|
|
47
47
|
* import { Formatter } from "effect"
|
|
@@ -65,7 +65,7 @@ import { getRedacted, redact, symbolRedactable } from "./Redactable.js";
|
|
|
65
65
|
* // }
|
|
66
66
|
* ```
|
|
67
67
|
*
|
|
68
|
-
* **Example** (
|
|
68
|
+
* **Example** (Handling circular references)
|
|
69
69
|
*
|
|
70
70
|
* ```ts
|
|
71
71
|
* import { Formatter } from "effect"
|
|
@@ -189,7 +189,7 @@ function safeToString(input) {
|
|
|
189
189
|
* `Symbol`, `undefined`, and functions, follow standard `JSON.stringify`
|
|
190
190
|
* behavior. The `space` parameter controls indentation and defaults to `0`.
|
|
191
191
|
*
|
|
192
|
-
* **Example** (
|
|
192
|
+
* **Example** (Formatting compact JSON)
|
|
193
193
|
*
|
|
194
194
|
* ```ts
|
|
195
195
|
* import { Formatter } from "effect"
|
|
@@ -198,7 +198,7 @@ function safeToString(input) {
|
|
|
198
198
|
* // {"name":"Alice","age":30}
|
|
199
199
|
* ```
|
|
200
200
|
*
|
|
201
|
-
* **Example** (
|
|
201
|
+
* **Example** (Handling circular references)
|
|
202
202
|
*
|
|
203
203
|
* ```ts
|
|
204
204
|
* import { Formatter } from "effect"
|
package/dist/Function.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface FunctionTypeLambda extends TypeLambda {
|
|
|
48
48
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
49
49
|
* predicate when optional arguments make arity ambiguous.
|
|
50
50
|
*
|
|
51
|
-
* **Example** (
|
|
51
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
52
52
|
*
|
|
53
53
|
* ```ts
|
|
54
54
|
* import { Function, pipe } from "effect"
|
|
@@ -62,7 +62,7 @@ export interface FunctionTypeLambda extends TypeLambda {
|
|
|
62
62
|
* console.log(pipe(2, sum(3))) // 5
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
|
-
* **Example** (
|
|
65
|
+
* **Example** (Defining overloads with call signatures)
|
|
66
66
|
*
|
|
67
67
|
* ```ts
|
|
68
68
|
* import { Function, pipe } from "effect"
|
|
@@ -76,7 +76,7 @@ export interface FunctionTypeLambda extends TypeLambda {
|
|
|
76
76
|
* console.log(pipe(2, sum(3))) // 5
|
|
77
77
|
* ```
|
|
78
78
|
*
|
|
79
|
-
* **Example** (
|
|
79
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
80
80
|
*
|
|
81
81
|
* ```ts
|
|
82
82
|
* import { Function, pipe } from "effect"
|
|
@@ -112,7 +112,7 @@ export declare const dual: {
|
|
|
112
112
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
113
113
|
* predicate when optional arguments make arity ambiguous.
|
|
114
114
|
*
|
|
115
|
-
* **Example** (
|
|
115
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
116
116
|
*
|
|
117
117
|
* ```ts
|
|
118
118
|
* import { Function, pipe } from "effect"
|
|
@@ -126,7 +126,7 @@ export declare const dual: {
|
|
|
126
126
|
* console.log(pipe(2, sum(3))) // 5
|
|
127
127
|
* ```
|
|
128
128
|
*
|
|
129
|
-
* **Example** (
|
|
129
|
+
* **Example** (Defining overloads with call signatures)
|
|
130
130
|
*
|
|
131
131
|
* ```ts
|
|
132
132
|
* import { Function, pipe } from "effect"
|
|
@@ -140,7 +140,7 @@ export declare const dual: {
|
|
|
140
140
|
* console.log(pipe(2, sum(3))) // 5
|
|
141
141
|
* ```
|
|
142
142
|
*
|
|
143
|
-
* **Example** (
|
|
143
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
144
144
|
*
|
|
145
145
|
* ```ts
|
|
146
146
|
* import { Function, pipe } from "effect"
|
|
@@ -176,7 +176,7 @@ export declare const dual: {
|
|
|
176
176
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
177
177
|
* predicate when optional arguments make arity ambiguous.
|
|
178
178
|
*
|
|
179
|
-
* **Example** (
|
|
179
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
180
180
|
*
|
|
181
181
|
* ```ts
|
|
182
182
|
* import { Function, pipe } from "effect"
|
|
@@ -190,7 +190,7 @@ export declare const dual: {
|
|
|
190
190
|
* console.log(pipe(2, sum(3))) // 5
|
|
191
191
|
* ```
|
|
192
192
|
*
|
|
193
|
-
* **Example** (
|
|
193
|
+
* **Example** (Defining overloads with call signatures)
|
|
194
194
|
*
|
|
195
195
|
* ```ts
|
|
196
196
|
* import { Function, pipe } from "effect"
|
|
@@ -204,7 +204,7 @@ export declare const dual: {
|
|
|
204
204
|
* console.log(pipe(2, sum(3))) // 5
|
|
205
205
|
* ```
|
|
206
206
|
*
|
|
207
|
-
* **Example** (
|
|
207
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
208
208
|
*
|
|
209
209
|
* ```ts
|
|
210
210
|
* import { Function, pipe } from "effect"
|
|
@@ -688,7 +688,7 @@ export declare const untupled: <A extends ReadonlyArray<unknown>, B>(f: (a: A) =
|
|
|
688
688
|
* Each function passed after the initial value must accept a single argument,
|
|
689
689
|
* because `pipe` calls each step with only the previous result.
|
|
690
690
|
*
|
|
691
|
-
* **Example** (
|
|
691
|
+
* **Example** (Piping values through functions)
|
|
692
692
|
*
|
|
693
693
|
* In this example, `1` is passed to the first function, and each result becomes
|
|
694
694
|
* the input for the next function.
|
package/dist/Function.js
CHANGED
|
@@ -14,7 +14,7 @@ import { pipeArguments } from "./Pipeable.js";
|
|
|
14
14
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
15
15
|
* predicate when optional arguments make arity ambiguous.
|
|
16
16
|
*
|
|
17
|
-
* **Example** (
|
|
17
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
18
18
|
*
|
|
19
19
|
* ```ts
|
|
20
20
|
* import { Function, pipe } from "effect"
|
|
@@ -28,7 +28,7 @@ import { pipeArguments } from "./Pipeable.js";
|
|
|
28
28
|
* console.log(pipe(2, sum(3))) // 5
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
-
* **Example** (
|
|
31
|
+
* **Example** (Defining overloads with call signatures)
|
|
32
32
|
*
|
|
33
33
|
* ```ts
|
|
34
34
|
* import { Function, pipe } from "effect"
|
|
@@ -42,7 +42,7 @@ import { pipeArguments } from "./Pipeable.js";
|
|
|
42
42
|
* console.log(pipe(2, sum(3))) // 5
|
|
43
43
|
* ```
|
|
44
44
|
*
|
|
45
|
-
* **Example** (
|
|
45
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
48
|
* import { Function, pipe } from "effect"
|
package/dist/HashMap.d.ts
CHANGED
|
@@ -1821,7 +1821,7 @@ export declare const map: {
|
|
|
1821
1821
|
*
|
|
1822
1822
|
* The hash and equality behavior of both maps have to be the same.
|
|
1823
1823
|
*
|
|
1824
|
-
* **Example** (
|
|
1824
|
+
* **Example** (Flat mapping values)
|
|
1825
1825
|
*
|
|
1826
1826
|
* ```ts
|
|
1827
1827
|
* import { HashMap } from "effect"
|
|
@@ -1848,7 +1848,7 @@ export declare const flatMap: {
|
|
|
1848
1848
|
*
|
|
1849
1849
|
* The hash and equality behavior of both maps have to be the same.
|
|
1850
1850
|
*
|
|
1851
|
-
* **Example** (
|
|
1851
|
+
* **Example** (Flat mapping values)
|
|
1852
1852
|
*
|
|
1853
1853
|
* ```ts
|
|
1854
1854
|
* import { HashMap } from "effect"
|
|
@@ -1875,7 +1875,7 @@ export declare const flatMap: {
|
|
|
1875
1875
|
*
|
|
1876
1876
|
* The hash and equality behavior of both maps have to be the same.
|
|
1877
1877
|
*
|
|
1878
|
-
* **Example** (
|
|
1878
|
+
* **Example** (Flat mapping values)
|
|
1879
1879
|
*
|
|
1880
1880
|
* ```ts
|
|
1881
1881
|
* import { HashMap } from "effect"
|
package/dist/HashMap.js
CHANGED
package/dist/Iterable.d.ts
CHANGED
|
@@ -2868,7 +2868,7 @@ export declare const map: {
|
|
|
2868
2868
|
/**
|
|
2869
2869
|
* Applies a function to each element in an Iterable and returns a new Iterable containing the concatenated mapped elements.
|
|
2870
2870
|
*
|
|
2871
|
-
* **Example** (
|
|
2871
|
+
* **Example** (Flat mapping iterables)
|
|
2872
2872
|
*
|
|
2873
2873
|
* ```ts
|
|
2874
2874
|
* import { Iterable } from "effect"
|
|
@@ -2907,7 +2907,7 @@ export declare const flatMap: {
|
|
|
2907
2907
|
/**
|
|
2908
2908
|
* Applies a function to each element in an Iterable and returns a new Iterable containing the concatenated mapped elements.
|
|
2909
2909
|
*
|
|
2910
|
-
* **Example** (
|
|
2910
|
+
* **Example** (Flat mapping iterables)
|
|
2911
2911
|
*
|
|
2912
2912
|
* ```ts
|
|
2913
2913
|
* import { Iterable } from "effect"
|
|
@@ -2946,7 +2946,7 @@ export declare const flatMap: {
|
|
|
2946
2946
|
/**
|
|
2947
2947
|
* Applies a function to each element in an Iterable and returns a new Iterable containing the concatenated mapped elements.
|
|
2948
2948
|
*
|
|
2949
|
-
* **Example** (
|
|
2949
|
+
* **Example** (Flat mapping iterables)
|
|
2950
2950
|
*
|
|
2951
2951
|
* ```ts
|
|
2952
2952
|
* import { Iterable } from "effect"
|
|
@@ -3579,7 +3579,7 @@ export declare const filter: {
|
|
|
3579
3579
|
* Use when working with APIs or functions that return nullable values,
|
|
3580
3580
|
* providing a clean way to filter out null or undefined while transforming.
|
|
3581
3581
|
*
|
|
3582
|
-
* **Example** (
|
|
3582
|
+
* **Example** (Flat mapping nullable results)
|
|
3583
3583
|
*
|
|
3584
3584
|
* ```ts
|
|
3585
3585
|
* import { Iterable } from "effect"
|
|
@@ -3625,7 +3625,7 @@ export declare const flatMapNullishOr: {
|
|
|
3625
3625
|
* Use when working with APIs or functions that return nullable values,
|
|
3626
3626
|
* providing a clean way to filter out null or undefined while transforming.
|
|
3627
3627
|
*
|
|
3628
|
-
* **Example** (
|
|
3628
|
+
* **Example** (Flat mapping nullable results)
|
|
3629
3629
|
*
|
|
3630
3630
|
* ```ts
|
|
3631
3631
|
* import { Iterable } from "effect"
|
|
@@ -3671,7 +3671,7 @@ export declare const flatMapNullishOr: {
|
|
|
3671
3671
|
* Use when working with APIs or functions that return nullable values,
|
|
3672
3672
|
* providing a clean way to filter out null or undefined while transforming.
|
|
3673
3673
|
*
|
|
3674
|
-
* **Example** (
|
|
3674
|
+
* **Example** (Flat mapping nullable results)
|
|
3675
3675
|
*
|
|
3676
3676
|
* ```ts
|
|
3677
3677
|
* import { Iterable } from "effect"
|
package/dist/Iterable.js
CHANGED
|
@@ -1425,7 +1425,7 @@ export const map = /*#__PURE__*/dual(2, (self, f) => ({
|
|
|
1425
1425
|
/**
|
|
1426
1426
|
* Applies a function to each element in an Iterable and returns a new Iterable containing the concatenated mapped elements.
|
|
1427
1427
|
*
|
|
1428
|
-
* **Example** (
|
|
1428
|
+
* **Example** (Flat mapping iterables)
|
|
1429
1429
|
*
|
|
1430
1430
|
* ```ts
|
|
1431
1431
|
* import { Iterable } from "effect"
|
|
@@ -1875,7 +1875,7 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => ({
|
|
|
1875
1875
|
* Use when working with APIs or functions that return nullable values,
|
|
1876
1876
|
* providing a clean way to filter out null or undefined while transforming.
|
|
1877
1877
|
*
|
|
1878
|
-
* **Example** (
|
|
1878
|
+
* **Example** (Flat mapping nullable results)
|
|
1879
1879
|
*
|
|
1880
1880
|
* ```ts
|
|
1881
1881
|
* import { Iterable } from "effect"
|
package/dist/JsonPatch.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type * as Schema from "./Schema.ts";
|
|
|
16
16
|
* discriminated by the `op` field, and the optional `description` field can be
|
|
17
17
|
* used for documentation.
|
|
18
18
|
*
|
|
19
|
-
* **Example** (
|
|
19
|
+
* **Example** (Defining all operation types)
|
|
20
20
|
*
|
|
21
21
|
* ```ts
|
|
22
22
|
* import { JsonPatch } from "effect"
|
|
@@ -96,7 +96,7 @@ export type JsonPatchOperation = {
|
|
|
96
96
|
* operations observe the document state produced by earlier operations. An empty
|
|
97
97
|
* array represents a no-op patch and returns the original document.
|
|
98
98
|
*
|
|
99
|
-
* **Example** (
|
|
99
|
+
* **Example** (Defining a multi-operation patch)
|
|
100
100
|
*
|
|
101
101
|
* ```ts
|
|
102
102
|
* import { JsonPatch } from "effect"
|
package/dist/Layer.d.ts
CHANGED
|
@@ -3680,7 +3680,7 @@ export declare const span: (name: string, options?: SpanOptions) => Layer<Tracer
|
|
|
3680
3680
|
* that are built with this layer. This API does not create, end, or close the
|
|
3681
3681
|
* span; the caller remains responsible for the span's lifetime.
|
|
3682
3682
|
*
|
|
3683
|
-
* **Example** (
|
|
3683
|
+
* **Example** (Referencing an existing parent span)
|
|
3684
3684
|
*
|
|
3685
3685
|
* ```ts
|
|
3686
3686
|
* import { Console, Context, Effect, Layer, Tracer } from "effect"
|
package/dist/Layer.js
CHANGED
|
@@ -1743,7 +1743,7 @@ export const span = (name, options) => {
|
|
|
1743
1743
|
* that are built with this layer. This API does not create, end, or close the
|
|
1744
1744
|
* span; the caller remains responsible for the span's lifetime.
|
|
1745
1745
|
*
|
|
1746
|
-
* **Example** (
|
|
1746
|
+
* **Example** (Referencing an existing parent span)
|
|
1747
1747
|
*
|
|
1748
1748
|
* ```ts
|
|
1749
1749
|
* import { Console, Context, Effect, Layer, Tracer } from "effect"
|
package/dist/Logger.d.ts
CHANGED
|
@@ -347,7 +347,7 @@ export declare const make: <Message, Output>(log: (options: Options<Message>) =>
|
|
|
347
347
|
/**
|
|
348
348
|
* The default logging implementation used by the Effect runtime.
|
|
349
349
|
*
|
|
350
|
-
* **Example** (
|
|
350
|
+
* **Example** (Referencing the default logger)
|
|
351
351
|
*
|
|
352
352
|
* ```ts
|
|
353
353
|
* import { Effect, Logger } from "effect"
|
package/dist/Logger.js
CHANGED
|
@@ -357,7 +357,7 @@ export const make = effect.loggerMake;
|
|
|
357
357
|
/**
|
|
358
358
|
* The default logging implementation used by the Effect runtime.
|
|
359
359
|
*
|
|
360
|
-
* **Example** (
|
|
360
|
+
* **Example** (Referencing the default logger)
|
|
361
361
|
*
|
|
362
362
|
* ```ts
|
|
363
363
|
* import { Effect, Logger } from "effect"
|
package/dist/Match.d.ts
CHANGED
|
@@ -568,7 +568,7 @@ export declare const typeTags: {
|
|
|
568
568
|
* **Important:** This function must be the first step in the matcher pipeline.
|
|
569
569
|
* If used later, TypeScript will not enforce type consistency correctly.
|
|
570
570
|
*
|
|
571
|
-
* **Example** (Validating
|
|
571
|
+
* **Example** (Validating return type consistency)
|
|
572
572
|
*
|
|
573
573
|
* ```ts
|
|
574
574
|
* import { Match } from "effect"
|
|
@@ -604,7 +604,7 @@ export declare const withReturnType: <Ret>() => <I, F, R, A, Pr, _>(self: Matche
|
|
|
604
604
|
* pattern matches, the associated function is executed and the matched input is
|
|
605
605
|
* removed from the remaining cases tracked by the matcher.
|
|
606
606
|
*
|
|
607
|
-
* **Example** (Matching with
|
|
607
|
+
* **Example** (Matching with values and predicates)
|
|
608
608
|
*
|
|
609
609
|
* ```ts
|
|
610
610
|
* import { Match } from "effect"
|
|
@@ -912,7 +912,7 @@ export declare const discriminatorsExhaustive: <D extends string>(field: D) => <
|
|
|
912
912
|
* `"_tag"` as their discriminator field. Use {@link discriminator} for a
|
|
913
913
|
* different discriminator field.
|
|
914
914
|
*
|
|
915
|
-
* **Example** (Matching a
|
|
915
|
+
* **Example** (Matching a discriminated union by tag)
|
|
916
916
|
*
|
|
917
917
|
* ```ts
|
|
918
918
|
* import { Match } from "effect"
|
|
@@ -1068,7 +1068,7 @@ export declare const tagsExhaustive: <R, Ret, P extends {
|
|
|
1068
1068
|
* Any excluded value bypasses the provided function and continues matching
|
|
1069
1069
|
* through later cases.
|
|
1070
1070
|
*
|
|
1071
|
-
* **Example** (Ignoring a
|
|
1071
|
+
* **Example** (Ignoring a specific value)
|
|
1072
1072
|
*
|
|
1073
1073
|
* ```ts
|
|
1074
1074
|
* import { Match } from "effect"
|
|
@@ -1706,7 +1706,7 @@ export declare const instanceOfUnsafe: <A extends abstract new (...args: any) =>
|
|
|
1706
1706
|
* `default` clause in a `switch` statement or the final `else` in an `if-else`
|
|
1707
1707
|
* chain.
|
|
1708
1708
|
*
|
|
1709
|
-
* **Example** (Providing a
|
|
1709
|
+
* **Example** (Providing a default value when no patterns match)
|
|
1710
1710
|
*
|
|
1711
1711
|
* ```ts
|
|
1712
1712
|
* import { Match } from "effect"
|
|
@@ -1793,7 +1793,7 @@ export declare const orElseAbsurd: <I, R, RA, A, Pr, Ret>(self: Matcher<I, R, RA
|
|
|
1793
1793
|
* unmatched case should be explicitly handled rather than returning a default
|
|
1794
1794
|
* value or throwing an error.
|
|
1795
1795
|
*
|
|
1796
|
-
* **Example** (Extracting a
|
|
1796
|
+
* **Example** (Extracting a user role with `Match.result`)
|
|
1797
1797
|
*
|
|
1798
1798
|
* ```ts
|
|
1799
1799
|
* import { Match } from "effect"
|
|
@@ -1836,7 +1836,7 @@ export declare const result: <I, F, R, A, Pr, Ret>(self: Matcher<I, F, R, A, Pr,
|
|
|
1836
1836
|
* handled explicitly rather than throwing an error or returning a default
|
|
1837
1837
|
* value.
|
|
1838
1838
|
*
|
|
1839
|
-
* **Example** (Extracting a
|
|
1839
|
+
* **Example** (Extracting a user role with `Match.option`)
|
|
1840
1840
|
*
|
|
1841
1841
|
* ```ts
|
|
1842
1842
|
* import { Match } from "effect"
|
|
@@ -1877,7 +1877,7 @@ export declare const option: <I, F, R, A, Pr, Ret>(self: Matcher<I, F, R, A, Pr,
|
|
|
1877
1877
|
* If any case is still unmatched, the matcher does not type-check as
|
|
1878
1878
|
* exhaustive.
|
|
1879
1879
|
*
|
|
1880
|
-
* **Example** (Ensuring
|
|
1880
|
+
* **Example** (Ensuring all cases are covered)
|
|
1881
1881
|
*
|
|
1882
1882
|
* ```ts
|
|
1883
1883
|
* import { Match } from "effect"
|
package/dist/Match.js
CHANGED
|
@@ -192,7 +192,7 @@ export const typeTags = internal.typeTags;
|
|
|
192
192
|
* **Important:** This function must be the first step in the matcher pipeline.
|
|
193
193
|
* If used later, TypeScript will not enforce type consistency correctly.
|
|
194
194
|
*
|
|
195
|
-
* **Example** (Validating
|
|
195
|
+
* **Example** (Validating return type consistency)
|
|
196
196
|
*
|
|
197
197
|
* ```ts
|
|
198
198
|
* import { Match } from "effect"
|
|
@@ -228,7 +228,7 @@ export const withReturnType = internal.withReturnType;
|
|
|
228
228
|
* pattern matches, the associated function is executed and the matched input is
|
|
229
229
|
* removed from the remaining cases tracked by the matcher.
|
|
230
230
|
*
|
|
231
|
-
* **Example** (Matching with
|
|
231
|
+
* **Example** (Matching with values and predicates)
|
|
232
232
|
*
|
|
233
233
|
* ```ts
|
|
234
234
|
* import { Match } from "effect"
|
|
@@ -528,7 +528,7 @@ export const discriminatorsExhaustive = internal.discriminatorsExhaustive;
|
|
|
528
528
|
* `"_tag"` as their discriminator field. Use {@link discriminator} for a
|
|
529
529
|
* different discriminator field.
|
|
530
530
|
*
|
|
531
|
-
* **Example** (Matching a
|
|
531
|
+
* **Example** (Matching a discriminated union by tag)
|
|
532
532
|
*
|
|
533
533
|
* ```ts
|
|
534
534
|
* import { Match } from "effect"
|
|
@@ -676,7 +676,7 @@ export const tagsExhaustive = internal.tagsExhaustive;
|
|
|
676
676
|
* Any excluded value bypasses the provided function and continues matching
|
|
677
677
|
* through later cases.
|
|
678
678
|
*
|
|
679
|
-
* **Example** (Ignoring a
|
|
679
|
+
* **Example** (Ignoring a specific value)
|
|
680
680
|
*
|
|
681
681
|
* ```ts
|
|
682
682
|
* import { Match } from "effect"
|
|
@@ -1312,7 +1312,7 @@ export const instanceOfUnsafe = internal.instanceOf;
|
|
|
1312
1312
|
* `default` clause in a `switch` statement or the final `else` in an `if-else`
|
|
1313
1313
|
* chain.
|
|
1314
1314
|
*
|
|
1315
|
-
* **Example** (Providing a
|
|
1315
|
+
* **Example** (Providing a default value when no patterns match)
|
|
1316
1316
|
*
|
|
1317
1317
|
* ```ts
|
|
1318
1318
|
* import { Match } from "effect"
|
|
@@ -1400,7 +1400,7 @@ export const orElseAbsurd = internal.orElseAbsurd;
|
|
|
1400
1400
|
* unmatched case should be explicitly handled rather than returning a default
|
|
1401
1401
|
* value or throwing an error.
|
|
1402
1402
|
*
|
|
1403
|
-
* **Example** (Extracting a
|
|
1403
|
+
* **Example** (Extracting a user role with `Match.result`)
|
|
1404
1404
|
*
|
|
1405
1405
|
* ```ts
|
|
1406
1406
|
* import { Match } from "effect"
|
|
@@ -1443,7 +1443,7 @@ export const result = internal.result;
|
|
|
1443
1443
|
* handled explicitly rather than throwing an error or returning a default
|
|
1444
1444
|
* value.
|
|
1445
1445
|
*
|
|
1446
|
-
* **Example** (Extracting a
|
|
1446
|
+
* **Example** (Extracting a user role with `Match.option`)
|
|
1447
1447
|
*
|
|
1448
1448
|
* ```ts
|
|
1449
1449
|
* import { Match } from "effect"
|
|
@@ -1484,7 +1484,7 @@ export const option = internal.option;
|
|
|
1484
1484
|
* If any case is still unmatched, the matcher does not type-check as
|
|
1485
1485
|
* exhaustive.
|
|
1486
1486
|
*
|
|
1487
|
-
* **Example** (Ensuring
|
|
1487
|
+
* **Example** (Ensuring all cases are covered)
|
|
1488
1488
|
*
|
|
1489
1489
|
* ```ts
|
|
1490
1490
|
* import { Match } from "effect"
|