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/Array.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type { NoInfer, TupleOf } from "./Types.ts";
|
|
|
16
16
|
* Use to access native JavaScript array constructor methods such as `isArray`
|
|
17
17
|
* or `from` from the Effect module namespace.
|
|
18
18
|
*
|
|
19
|
-
* **Example** (
|
|
19
|
+
* **Example** (Accessing the Array constructor)
|
|
20
20
|
*
|
|
21
21
|
* ```ts
|
|
22
22
|
* import { Array } from "effect"
|
|
@@ -418,7 +418,7 @@ export declare const ensure: <A>(self: ReadonlyArray<A> | A) => Array<A>;
|
|
|
418
418
|
* Key order follows `Object.entries` semantics. Empty records produce an empty
|
|
419
419
|
* array.
|
|
420
420
|
*
|
|
421
|
-
* **Example** (
|
|
421
|
+
* **Example** (Converting a record to entries)
|
|
422
422
|
*
|
|
423
423
|
* ```ts
|
|
424
424
|
* import { Array } from "effect"
|
|
@@ -441,7 +441,7 @@ export declare const fromRecord: <K extends string, A>(self: Readonly<Record<K,
|
|
|
441
441
|
*
|
|
442
442
|
* Use to convert a single `Option` into an array for downstream array operations.
|
|
443
443
|
*
|
|
444
|
-
* **Example** (Option to array)
|
|
444
|
+
* **Example** (Converting an Option to an array)
|
|
445
445
|
*
|
|
446
446
|
* ```ts
|
|
447
447
|
* import { Array, Option } from "effect"
|
|
@@ -572,7 +572,7 @@ export declare const match: {
|
|
|
572
572
|
*
|
|
573
573
|
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
574
574
|
*
|
|
575
|
-
* **Example** (
|
|
575
|
+
* **Example** (Destructuring head and tail)
|
|
576
576
|
*
|
|
577
577
|
* ```ts
|
|
578
578
|
* import { Array } from "effect"
|
|
@@ -605,7 +605,7 @@ export declare const matchLeft: {
|
|
|
605
605
|
*
|
|
606
606
|
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
607
607
|
*
|
|
608
|
-
* **Example** (
|
|
608
|
+
* **Example** (Destructuring head and tail)
|
|
609
609
|
*
|
|
610
610
|
* ```ts
|
|
611
611
|
* import { Array } from "effect"
|
|
@@ -641,7 +641,7 @@ export declare const matchLeft: {
|
|
|
641
641
|
*
|
|
642
642
|
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
643
643
|
*
|
|
644
|
-
* **Example** (
|
|
644
|
+
* **Example** (Destructuring head and tail)
|
|
645
645
|
*
|
|
646
646
|
* ```ts
|
|
647
647
|
* import { Array } from "effect"
|
|
@@ -678,7 +678,7 @@ export declare const matchLeft: {
|
|
|
678
678
|
*
|
|
679
679
|
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
680
680
|
*
|
|
681
|
-
* **Example** (
|
|
681
|
+
* **Example** (Destructuring init and last)
|
|
682
682
|
*
|
|
683
683
|
* ```ts
|
|
684
684
|
* import { Array } from "effect"
|
|
@@ -711,7 +711,7 @@ export declare const matchRight: {
|
|
|
711
711
|
*
|
|
712
712
|
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
713
713
|
*
|
|
714
|
-
* **Example** (
|
|
714
|
+
* **Example** (Destructuring init and last)
|
|
715
715
|
*
|
|
716
716
|
* ```ts
|
|
717
717
|
* import { Array } from "effect"
|
|
@@ -747,7 +747,7 @@ export declare const matchRight: {
|
|
|
747
747
|
*
|
|
748
748
|
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
749
749
|
*
|
|
750
|
-
* **Example** (
|
|
750
|
+
* **Example** (Destructuring init and last)
|
|
751
751
|
*
|
|
752
752
|
* ```ts
|
|
753
753
|
* import { Array } from "effect"
|
|
@@ -1295,7 +1295,7 @@ export declare const scan: {
|
|
|
1295
1295
|
* The output length is `input.length + 1` because it ends with the initial
|
|
1296
1296
|
* value. The result is always a `NonEmptyArray`.
|
|
1297
1297
|
*
|
|
1298
|
-
* **Example** (
|
|
1298
|
+
* **Example** (Scanning running totals in reverse)
|
|
1299
1299
|
*
|
|
1300
1300
|
* ```ts
|
|
1301
1301
|
* import { Array } from "effect"
|
|
@@ -1324,7 +1324,7 @@ export declare const scanRight: {
|
|
|
1324
1324
|
* The output length is `input.length + 1` because it ends with the initial
|
|
1325
1325
|
* value. The result is always a `NonEmptyArray`.
|
|
1326
1326
|
*
|
|
1327
|
-
* **Example** (
|
|
1327
|
+
* **Example** (Scanning running totals in reverse)
|
|
1328
1328
|
*
|
|
1329
1329
|
* ```ts
|
|
1330
1330
|
* import { Array } from "effect"
|
|
@@ -1353,7 +1353,7 @@ export declare const scanRight: {
|
|
|
1353
1353
|
* The output length is `input.length + 1` because it ends with the initial
|
|
1354
1354
|
* value. The result is always a `NonEmptyArray`.
|
|
1355
1355
|
*
|
|
1356
|
-
* **Example** (
|
|
1356
|
+
* **Example** (Scanning running totals in reverse)
|
|
1357
1357
|
*
|
|
1358
1358
|
* ```ts
|
|
1359
1359
|
* import { Array } from "effect"
|
|
@@ -1575,7 +1575,7 @@ export declare const length: <A>(self: ReadonlyArray<A>) => number;
|
|
|
1575
1575
|
*
|
|
1576
1576
|
* The index is floored to an integer. This never throws.
|
|
1577
1577
|
*
|
|
1578
|
-
* **Example** (
|
|
1578
|
+
* **Example** (Accessing indexes safely)
|
|
1579
1579
|
*
|
|
1580
1580
|
* ```ts
|
|
1581
1581
|
* import { Array } from "effect"
|
|
@@ -1605,7 +1605,7 @@ export declare const get: {
|
|
|
1605
1605
|
*
|
|
1606
1606
|
* The index is floored to an integer. This never throws.
|
|
1607
1607
|
*
|
|
1608
|
-
* **Example** (
|
|
1608
|
+
* **Example** (Accessing indexes safely)
|
|
1609
1609
|
*
|
|
1610
1610
|
* ```ts
|
|
1611
1611
|
* import { Array } from "effect"
|
|
@@ -1635,7 +1635,7 @@ export declare const get: {
|
|
|
1635
1635
|
*
|
|
1636
1636
|
* The index is floored to an integer. This never throws.
|
|
1637
1637
|
*
|
|
1638
|
-
* **Example** (
|
|
1638
|
+
* **Example** (Accessing indexes safely)
|
|
1639
1639
|
*
|
|
1640
1640
|
* ```ts
|
|
1641
1641
|
* import { Array } from "effect"
|
|
@@ -1666,7 +1666,7 @@ export declare const get: {
|
|
|
1666
1666
|
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1667
1667
|
* `get` for safe access.
|
|
1668
1668
|
*
|
|
1669
|
-
* **Example** (
|
|
1669
|
+
* **Example** (Accessing indexes unsafely)
|
|
1670
1670
|
*
|
|
1671
1671
|
* ```ts
|
|
1672
1672
|
* import { Array } from "effect"
|
|
@@ -1694,7 +1694,7 @@ export declare const getUnsafe: {
|
|
|
1694
1694
|
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1695
1695
|
* `get` for safe access.
|
|
1696
1696
|
*
|
|
1697
|
-
* **Example** (
|
|
1697
|
+
* **Example** (Accessing indexes unsafely)
|
|
1698
1698
|
*
|
|
1699
1699
|
* ```ts
|
|
1700
1700
|
* import { Array } from "effect"
|
|
@@ -1722,7 +1722,7 @@ export declare const getUnsafe: {
|
|
|
1722
1722
|
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1723
1723
|
* `get` for safe access.
|
|
1724
1724
|
*
|
|
1725
|
-
* **Example** (
|
|
1725
|
+
* **Example** (Accessing indexes unsafely)
|
|
1726
1726
|
*
|
|
1727
1727
|
* ```ts
|
|
1728
1728
|
* import { Array } from "effect"
|
|
@@ -4183,7 +4183,7 @@ export declare const sortWith: {
|
|
|
4183
4183
|
* This is data-last only and returns a function. The return type preserves
|
|
4184
4184
|
* `NonEmptyArray`.
|
|
4185
4185
|
*
|
|
4186
|
-
* **Example** (
|
|
4186
|
+
* **Example** (Sorting by multiple keys)
|
|
4187
4187
|
*
|
|
4188
4188
|
* ```ts
|
|
4189
4189
|
* import { Array, Order, pipe } from "effect"
|
|
@@ -4998,7 +4998,7 @@ export declare const rotate: {
|
|
|
4998
4998
|
* Use when checking membership with caller-provided equality instead of
|
|
4999
4999
|
* `Equal.equivalence()`.
|
|
5000
5000
|
*
|
|
5001
|
-
* **Example** (
|
|
5001
|
+
* **Example** (Checking with custom equality)
|
|
5002
5002
|
*
|
|
5003
5003
|
* ```ts
|
|
5004
5004
|
* import { Array, pipe } from "effect"
|
|
@@ -5825,7 +5825,7 @@ export declare const chunksOf: {
|
|
|
5825
5825
|
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
5826
5826
|
* Each window is a tuple of exactly `n` elements.
|
|
5827
5827
|
*
|
|
5828
|
-
* **Example** (
|
|
5828
|
+
* **Example** (Creating sliding windows)
|
|
5829
5829
|
*
|
|
5830
5830
|
* ```ts
|
|
5831
5831
|
* import { Array } from "effect"
|
|
@@ -5852,7 +5852,7 @@ export declare const window: {
|
|
|
5852
5852
|
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
5853
5853
|
* Each window is a tuple of exactly `n` elements.
|
|
5854
5854
|
*
|
|
5855
|
-
* **Example** (
|
|
5855
|
+
* **Example** (Creating sliding windows)
|
|
5856
5856
|
*
|
|
5857
5857
|
* ```ts
|
|
5858
5858
|
* import { Array } from "effect"
|
|
@@ -5879,7 +5879,7 @@ export declare const window: {
|
|
|
5879
5879
|
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
5880
5880
|
* Each window is a tuple of exactly `n` elements.
|
|
5881
5881
|
*
|
|
5882
|
-
* **Example** (
|
|
5882
|
+
* **Example** (Creating sliding windows)
|
|
5883
5883
|
*
|
|
5884
5884
|
* ```ts
|
|
5885
5885
|
* import { Array } from "effect"
|
|
@@ -6128,7 +6128,7 @@ export declare const groupBy: {
|
|
|
6128
6128
|
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6129
6129
|
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6130
6130
|
*
|
|
6131
|
-
* **Example** (
|
|
6131
|
+
* **Example** (Computing unions with custom equality)
|
|
6132
6132
|
*
|
|
6133
6133
|
* ```ts
|
|
6134
6134
|
* import { Array } from "effect"
|
|
@@ -6153,7 +6153,7 @@ export declare const unionWith: {
|
|
|
6153
6153
|
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6154
6154
|
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6155
6155
|
*
|
|
6156
|
-
* **Example** (
|
|
6156
|
+
* **Example** (Computing unions with custom equality)
|
|
6157
6157
|
*
|
|
6158
6158
|
* ```ts
|
|
6159
6159
|
* import { Array } from "effect"
|
|
@@ -6178,7 +6178,7 @@ export declare const unionWith: {
|
|
|
6178
6178
|
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6179
6179
|
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6180
6180
|
*
|
|
6181
|
-
* **Example** (
|
|
6181
|
+
* **Example** (Computing unions with custom equality)
|
|
6182
6182
|
*
|
|
6183
6183
|
* ```ts
|
|
6184
6184
|
* import { Array } from "effect"
|
|
@@ -6203,7 +6203,7 @@ export declare const unionWith: {
|
|
|
6203
6203
|
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6204
6204
|
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6205
6205
|
*
|
|
6206
|
-
* **Example** (
|
|
6206
|
+
* **Example** (Computing unions with custom equality)
|
|
6207
6207
|
*
|
|
6208
6208
|
* ```ts
|
|
6209
6209
|
* import { Array } from "effect"
|
|
@@ -6228,7 +6228,7 @@ export declare const unionWith: {
|
|
|
6228
6228
|
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6229
6229
|
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6230
6230
|
*
|
|
6231
|
-
* **Example** (
|
|
6231
|
+
* **Example** (Computing unions with custom equality)
|
|
6232
6232
|
*
|
|
6233
6233
|
* ```ts
|
|
6234
6234
|
* import { Array } from "effect"
|
|
@@ -6249,7 +6249,7 @@ export declare const unionWith: {
|
|
|
6249
6249
|
* Computes the union of two arrays, removing duplicates using
|
|
6250
6250
|
* `Equal.equivalence()`.
|
|
6251
6251
|
*
|
|
6252
|
-
* **Example** (
|
|
6252
|
+
* **Example** (Computing array unions)
|
|
6253
6253
|
*
|
|
6254
6254
|
* ```ts
|
|
6255
6255
|
* import { Array } from "effect"
|
|
@@ -6269,7 +6269,7 @@ export declare const union: {
|
|
|
6269
6269
|
* Computes the union of two arrays, removing duplicates using
|
|
6270
6270
|
* `Equal.equivalence()`.
|
|
6271
6271
|
*
|
|
6272
|
-
* **Example** (
|
|
6272
|
+
* **Example** (Computing array unions)
|
|
6273
6273
|
*
|
|
6274
6274
|
* ```ts
|
|
6275
6275
|
* import { Array } from "effect"
|
|
@@ -6289,7 +6289,7 @@ export declare const union: {
|
|
|
6289
6289
|
* Computes the union of two arrays, removing duplicates using
|
|
6290
6290
|
* `Equal.equivalence()`.
|
|
6291
6291
|
*
|
|
6292
|
-
* **Example** (
|
|
6292
|
+
* **Example** (Computing array unions)
|
|
6293
6293
|
*
|
|
6294
6294
|
* ```ts
|
|
6295
6295
|
* import { Array } from "effect"
|
|
@@ -6309,7 +6309,7 @@ export declare const union: {
|
|
|
6309
6309
|
* Computes the union of two arrays, removing duplicates using
|
|
6310
6310
|
* `Equal.equivalence()`.
|
|
6311
6311
|
*
|
|
6312
|
-
* **Example** (
|
|
6312
|
+
* **Example** (Computing array unions)
|
|
6313
6313
|
*
|
|
6314
6314
|
* ```ts
|
|
6315
6315
|
* import { Array } from "effect"
|
|
@@ -6329,7 +6329,7 @@ export declare const union: {
|
|
|
6329
6329
|
* Computes the union of two arrays, removing duplicates using
|
|
6330
6330
|
* `Equal.equivalence()`.
|
|
6331
6331
|
*
|
|
6332
|
-
* **Example** (
|
|
6332
|
+
* **Example** (Computing array unions)
|
|
6333
6333
|
*
|
|
6334
6334
|
* ```ts
|
|
6335
6335
|
* import { Array } from "effect"
|
|
@@ -6355,7 +6355,7 @@ export declare const union: {
|
|
|
6355
6355
|
* Use when you need to keep only values present in both arrays and equality
|
|
6356
6356
|
* must be defined by a custom comparator, such as matching objects by id.
|
|
6357
6357
|
*
|
|
6358
|
-
* **Example** (
|
|
6358
|
+
* **Example** (Computing intersections with custom equality)
|
|
6359
6359
|
*
|
|
6360
6360
|
* ```ts
|
|
6361
6361
|
* import { Array } from "effect"
|
|
@@ -6386,7 +6386,7 @@ export declare const intersectionWith: <A>(isEquivalent: (self: A, that: A) => b
|
|
|
6386
6386
|
* Use when Effect equality is the right membership test and you want to keep
|
|
6387
6387
|
* values present in both inputs while preserving the first input's order.
|
|
6388
6388
|
*
|
|
6389
|
-
* **Example** (
|
|
6389
|
+
* **Example** (Computing array intersections)
|
|
6390
6390
|
*
|
|
6391
6391
|
* ```ts
|
|
6392
6392
|
* import { Array } from "effect"
|
|
@@ -6411,7 +6411,7 @@ export declare const intersection: {
|
|
|
6411
6411
|
* Use when Effect equality is the right membership test and you want to keep
|
|
6412
6412
|
* values present in both inputs while preserving the first input's order.
|
|
6413
6413
|
*
|
|
6414
|
-
* **Example** (
|
|
6414
|
+
* **Example** (Computing array intersections)
|
|
6415
6415
|
*
|
|
6416
6416
|
* ```ts
|
|
6417
6417
|
* import { Array } from "effect"
|
|
@@ -6436,7 +6436,7 @@ export declare const intersection: {
|
|
|
6436
6436
|
* Use when Effect equality is the right membership test and you want to keep
|
|
6437
6437
|
* values present in both inputs while preserving the first input's order.
|
|
6438
6438
|
*
|
|
6439
|
-
* **Example** (
|
|
6439
|
+
* **Example** (Computing array intersections)
|
|
6440
6440
|
*
|
|
6441
6441
|
* ```ts
|
|
6442
6442
|
* import { Array } from "effect"
|
|
@@ -6462,7 +6462,7 @@ export declare const intersection: {
|
|
|
6462
6462
|
* Use when you need to keep only values from the first array and equality must
|
|
6463
6463
|
* be defined by a custom comparator, such as matching objects by id.
|
|
6464
6464
|
*
|
|
6465
|
-
* **Example** (
|
|
6465
|
+
* **Example** (Computing differences with custom equality)
|
|
6466
6466
|
*
|
|
6467
6467
|
* ```ts
|
|
6468
6468
|
* import { Array } from "effect"
|
|
@@ -6491,7 +6491,7 @@ export declare const differenceWith: <A>(isEquivalent: (self: A, that: A) => boo
|
|
|
6491
6491
|
* Use when you need to keep values from the first array that are absent from
|
|
6492
6492
|
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
6493
6493
|
*
|
|
6494
|
-
* **Example** (
|
|
6494
|
+
* **Example** (Computing array differences)
|
|
6495
6495
|
*
|
|
6496
6496
|
* ```ts
|
|
6497
6497
|
* import { Array } from "effect"
|
|
@@ -6516,7 +6516,7 @@ export declare const difference: {
|
|
|
6516
6516
|
* Use when you need to keep values from the first array that are absent from
|
|
6517
6517
|
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
6518
6518
|
*
|
|
6519
|
-
* **Example** (
|
|
6519
|
+
* **Example** (Computing array differences)
|
|
6520
6520
|
*
|
|
6521
6521
|
* ```ts
|
|
6522
6522
|
* import { Array } from "effect"
|
|
@@ -6541,7 +6541,7 @@ export declare const difference: {
|
|
|
6541
6541
|
* Use when you need to keep values from the first array that are absent from
|
|
6542
6542
|
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
6543
6543
|
*
|
|
6544
|
-
* **Example** (
|
|
6544
|
+
* **Example** (Computing array differences)
|
|
6545
6545
|
*
|
|
6546
6546
|
* ```ts
|
|
6547
6547
|
* import { Array } from "effect"
|
|
@@ -6788,7 +6788,7 @@ export declare const map: {
|
|
|
6788
6788
|
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6789
6789
|
* both the input and mapped arrays are non-empty.
|
|
6790
6790
|
*
|
|
6791
|
-
* **Example** (
|
|
6791
|
+
* **Example** (Flat mapping an array)
|
|
6792
6792
|
*
|
|
6793
6793
|
* ```ts
|
|
6794
6794
|
* import { Array } from "effect"
|
|
@@ -6816,7 +6816,7 @@ export declare const flatMap: {
|
|
|
6816
6816
|
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6817
6817
|
* both the input and mapped arrays are non-empty.
|
|
6818
6818
|
*
|
|
6819
|
-
* **Example** (
|
|
6819
|
+
* **Example** (Flat mapping an array)
|
|
6820
6820
|
*
|
|
6821
6821
|
* ```ts
|
|
6822
6822
|
* import { Array } from "effect"
|
|
@@ -6844,7 +6844,7 @@ export declare const flatMap: {
|
|
|
6844
6844
|
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6845
6845
|
* both the input and mapped arrays are non-empty.
|
|
6846
6846
|
*
|
|
6847
|
-
* **Example** (
|
|
6847
|
+
* **Example** (Flat mapping an array)
|
|
6848
6848
|
*
|
|
6849
6849
|
* ```ts
|
|
6850
6850
|
* import { Array } from "effect"
|
|
@@ -6872,7 +6872,7 @@ export declare const flatMap: {
|
|
|
6872
6872
|
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6873
6873
|
* both the input and mapped arrays are non-empty.
|
|
6874
6874
|
*
|
|
6875
|
-
* **Example** (
|
|
6875
|
+
* **Example** (Flat mapping an array)
|
|
6876
6876
|
*
|
|
6877
6877
|
* ```ts
|
|
6878
6878
|
* import { Array } from "effect"
|
|
@@ -6995,7 +6995,7 @@ export declare const getSuccesses: <T extends Iterable<Result.Result<any, any>>>
|
|
|
6995
6995
|
*
|
|
6996
6996
|
* The filter receives `(element, index)`. Failures are discarded.
|
|
6997
6997
|
*
|
|
6998
|
-
* **Example** (
|
|
6998
|
+
* **Example** (Filtering and transforming)
|
|
6999
6999
|
*
|
|
7000
7000
|
* ```ts
|
|
7001
7001
|
* import { Array, Result } from "effect"
|
|
@@ -7023,7 +7023,7 @@ export declare const filterMap: {
|
|
|
7023
7023
|
*
|
|
7024
7024
|
* The filter receives `(element, index)`. Failures are discarded.
|
|
7025
7025
|
*
|
|
7026
|
-
* **Example** (
|
|
7026
|
+
* **Example** (Filtering and transforming)
|
|
7027
7027
|
*
|
|
7028
7028
|
* ```ts
|
|
7029
7029
|
* import { Array, Result } from "effect"
|
|
@@ -7051,7 +7051,7 @@ export declare const filterMap: {
|
|
|
7051
7051
|
*
|
|
7052
7052
|
* The filter receives `(element, index)`. Failures are discarded.
|
|
7053
7053
|
*
|
|
7054
|
-
* **Example** (
|
|
7054
|
+
* **Example** (Filtering and transforming)
|
|
7055
7055
|
*
|
|
7056
7056
|
* ```ts
|
|
7057
7057
|
* import { Array, Result } from "effect"
|
|
@@ -7428,7 +7428,7 @@ export declare const reduce: {
|
|
|
7428
7428
|
*
|
|
7429
7429
|
* The function receives `(accumulator, element, index)`.
|
|
7430
7430
|
*
|
|
7431
|
-
* **Example** (
|
|
7431
|
+
* **Example** (Folding from right to left)
|
|
7432
7432
|
*
|
|
7433
7433
|
* ```ts
|
|
7434
7434
|
* import { Array } from "effect"
|
|
@@ -7454,7 +7454,7 @@ export declare const reduceRight: {
|
|
|
7454
7454
|
*
|
|
7455
7455
|
* The function receives `(accumulator, element, index)`.
|
|
7456
7456
|
*
|
|
7457
|
-
* **Example** (
|
|
7457
|
+
* **Example** (Folding from right to left)
|
|
7458
7458
|
*
|
|
7459
7459
|
* ```ts
|
|
7460
7460
|
* import { Array } from "effect"
|
|
@@ -7480,7 +7480,7 @@ export declare const reduceRight: {
|
|
|
7480
7480
|
*
|
|
7481
7481
|
* The function receives `(accumulator, element, index)`.
|
|
7482
7482
|
*
|
|
7483
|
-
* **Example** (
|
|
7483
|
+
* **Example** (Folding from right to left)
|
|
7484
7484
|
*
|
|
7485
7485
|
* ```ts
|
|
7486
7486
|
* import { Array } from "effect"
|
|
@@ -7500,7 +7500,7 @@ export declare const reduceRight: {
|
|
|
7500
7500
|
* Lifts a predicate into an array: returns `[value]` if the predicate holds,
|
|
7501
7501
|
* `[]` otherwise.
|
|
7502
7502
|
*
|
|
7503
|
-
* **Example** (
|
|
7503
|
+
* **Example** (Wrapping values conditionally)
|
|
7504
7504
|
*
|
|
7505
7505
|
* ```ts
|
|
7506
7506
|
* import { Array } from "effect"
|
|
@@ -7522,7 +7522,7 @@ export declare const liftPredicate: {
|
|
|
7522
7522
|
* Lifts a predicate into an array: returns `[value]` if the predicate holds,
|
|
7523
7523
|
* `[]` otherwise.
|
|
7524
7524
|
*
|
|
7525
|
-
* **Example** (
|
|
7525
|
+
* **Example** (Wrapping values conditionally)
|
|
7526
7526
|
*
|
|
7527
7527
|
* ```ts
|
|
7528
7528
|
* import { Array } from "effect"
|
|
@@ -7577,7 +7577,7 @@ export declare const liftOption: <A extends Array<unknown>, B>(f: (...a: A) => O
|
|
|
7577
7577
|
*
|
|
7578
7578
|
* Use to treat a nullable single value as zero or one array element.
|
|
7579
7579
|
*
|
|
7580
|
-
* **Example** (
|
|
7580
|
+
* **Example** (Converting nullable values to an array)
|
|
7581
7581
|
*
|
|
7582
7582
|
* ```ts
|
|
7583
7583
|
* import { Array } from "effect"
|
|
@@ -7627,7 +7627,7 @@ export declare const liftNullishOr: <A extends Array<unknown>, B>(f: (...a: A) =
|
|
|
7627
7627
|
* Use when you need to map and filter in one step, where the mapper can return
|
|
7628
7628
|
* `null` or `undefined` to skip elements.
|
|
7629
7629
|
*
|
|
7630
|
-
* **Example** (
|
|
7630
|
+
* **Example** (Flat mapping with nullable values)
|
|
7631
7631
|
*
|
|
7632
7632
|
* ```ts
|
|
7633
7633
|
* import { Array } from "effect"
|
|
@@ -7652,7 +7652,7 @@ export declare const flatMapNullishOr: {
|
|
|
7652
7652
|
* Use when you need to map and filter in one step, where the mapper can return
|
|
7653
7653
|
* `null` or `undefined` to skip elements.
|
|
7654
7654
|
*
|
|
7655
|
-
* **Example** (
|
|
7655
|
+
* **Example** (Flat mapping with nullable values)
|
|
7656
7656
|
*
|
|
7657
7657
|
* ```ts
|
|
7658
7658
|
* import { Array } from "effect"
|
|
@@ -7677,7 +7677,7 @@ export declare const flatMapNullishOr: {
|
|
|
7677
7677
|
* Use when you need to map and filter in one step, where the mapper can return
|
|
7678
7678
|
* `null` or `undefined` to skip elements.
|
|
7679
7679
|
*
|
|
7680
|
-
* **Example** (
|
|
7680
|
+
* **Example** (Flat mapping with nullable values)
|
|
7681
7681
|
*
|
|
7682
7682
|
* ```ts
|
|
7683
7683
|
* import { Array } from "effect"
|
|
@@ -7920,7 +7920,7 @@ export declare const some: {
|
|
|
7920
7920
|
*
|
|
7921
7921
|
* For index `i`, the function receives `self.slice(i)`.
|
|
7922
7922
|
*
|
|
7923
|
-
* **Example** (
|
|
7923
|
+
* **Example** (Computing suffix lengths)
|
|
7924
7924
|
*
|
|
7925
7925
|
* ```ts
|
|
7926
7926
|
* import { Array } from "effect"
|
|
@@ -7947,7 +7947,7 @@ export declare const extend: {
|
|
|
7947
7947
|
*
|
|
7948
7948
|
* For index `i`, the function receives `self.slice(i)`.
|
|
7949
7949
|
*
|
|
7950
|
-
* **Example** (
|
|
7950
|
+
* **Example** (Computing suffix lengths)
|
|
7951
7951
|
*
|
|
7952
7952
|
* ```ts
|
|
7953
7953
|
* import { Array } from "effect"
|
|
@@ -7974,7 +7974,7 @@ export declare const extend: {
|
|
|
7974
7974
|
*
|
|
7975
7975
|
* For index `i`, the function receives `self.slice(i)`.
|
|
7976
7976
|
*
|
|
7977
|
-
* **Example** (
|
|
7977
|
+
* **Example** (Computing suffix lengths)
|
|
7978
7978
|
*
|
|
7979
7979
|
* ```ts
|
|
7980
7980
|
* import { Array } from "effect"
|
|
@@ -8711,7 +8711,7 @@ export declare const cartesianWith: {
|
|
|
8711
8711
|
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
8712
8712
|
* from `that`, so the result length is `self.length * that.length`.
|
|
8713
8713
|
*
|
|
8714
|
-
* **Example** (
|
|
8714
|
+
* **Example** (Generating all pairs from two arrays)
|
|
8715
8715
|
*
|
|
8716
8716
|
* ```ts
|
|
8717
8717
|
* import { Array } from "effect"
|
|
@@ -8738,7 +8738,7 @@ export declare const cartesian: {
|
|
|
8738
8738
|
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
8739
8739
|
* from `that`, so the result length is `self.length * that.length`.
|
|
8740
8740
|
*
|
|
8741
|
-
* **Example** (
|
|
8741
|
+
* **Example** (Generating all pairs from two arrays)
|
|
8742
8742
|
*
|
|
8743
8743
|
* ```ts
|
|
8744
8744
|
* import { Array } from "effect"
|
|
@@ -8765,7 +8765,7 @@ export declare const cartesian: {
|
|
|
8765
8765
|
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
8766
8766
|
* from `that`, so the result length is `self.length * that.length`.
|
|
8767
8767
|
*
|
|
8768
|
-
* **Example** (
|
|
8768
|
+
* **Example** (Generating all pairs from two arrays)
|
|
8769
8769
|
*
|
|
8770
8770
|
* ```ts
|
|
8771
8771
|
* import { Array } from "effect"
|
|
@@ -8795,7 +8795,7 @@ export declare const cartesian: {
|
|
|
8795
8795
|
* like nested loops. Use `filter` and `map` in the pipeline to add conditions
|
|
8796
8796
|
* and transformations.
|
|
8797
8797
|
*
|
|
8798
|
-
* **Example** (
|
|
8798
|
+
* **Example** (Building array comprehensions with do notation)
|
|
8799
8799
|
*
|
|
8800
8800
|
* ```ts
|
|
8801
8801
|
* import { Array, pipe } from "effect"
|