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/Predicate.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { TupleOf, TupleOfAtLeast } from "./Types.ts";
|
|
|
14
14
|
* A predicate returns `true` or `false` and never throws by itself. It does not
|
|
15
15
|
* narrow types unless you use `Refinement`.
|
|
16
16
|
*
|
|
17
|
-
* **Example** (
|
|
17
|
+
* **Example** (Defining a predicate)
|
|
18
18
|
*
|
|
19
19
|
* ```ts
|
|
20
20
|
* import { Predicate } from "effect"
|
|
@@ -76,7 +76,7 @@ export interface PredicateTypeLambda extends TypeLambda {
|
|
|
76
76
|
* A refinement returns a type predicate (`a is B`). Use it with `if` or
|
|
77
77
|
* `filter` to narrow types.
|
|
78
78
|
*
|
|
79
|
-
* **Example** (
|
|
79
|
+
* **Example** (Narrowing unknown values)
|
|
80
80
|
*
|
|
81
81
|
* ```ts
|
|
82
82
|
* import { Predicate } from "effect"
|
|
@@ -111,7 +111,7 @@ export interface Refinement<in A, out B extends A> {
|
|
|
111
111
|
* These utilities are type-only, create no runtime values, and the namespace is
|
|
112
112
|
* erased at runtime.
|
|
113
113
|
*
|
|
114
|
-
* **Example** (
|
|
114
|
+
* **Example** (Extracting predicate input)
|
|
115
115
|
*
|
|
116
116
|
* ```ts
|
|
117
117
|
* import { Predicate } from "effect"
|
|
@@ -138,7 +138,7 @@ export declare namespace Predicate {
|
|
|
138
138
|
* This is type-only and creates no runtime value. It resolves to `never` if
|
|
139
139
|
* the type does not match `Predicate`.
|
|
140
140
|
*
|
|
141
|
-
* **Example** (
|
|
141
|
+
* **Example** (Inferring the input type)
|
|
142
142
|
*
|
|
143
143
|
* ```ts
|
|
144
144
|
* import { Predicate } from "effect"
|
|
@@ -164,7 +164,7 @@ export declare namespace Predicate {
|
|
|
164
164
|
*
|
|
165
165
|
* This is type-only and creates no runtime value.
|
|
166
166
|
*
|
|
167
|
-
* **Example** (
|
|
167
|
+
* **Example** (Using generic constraints)
|
|
168
168
|
*
|
|
169
169
|
* ```ts
|
|
170
170
|
* import { Predicate } from "effect"
|
|
@@ -191,7 +191,7 @@ export declare namespace Predicate {
|
|
|
191
191
|
* These utilities are type-only, create no runtime values, and the namespace is
|
|
192
192
|
* erased at runtime.
|
|
193
193
|
*
|
|
194
|
-
* **Example** (
|
|
194
|
+
* **Example** (Extracting refinement types)
|
|
195
195
|
*
|
|
196
196
|
* ```ts
|
|
197
197
|
* import { Predicate } from "effect"
|
|
@@ -218,7 +218,7 @@ export declare namespace Refinement {
|
|
|
218
218
|
* This is type-only and creates no runtime value. It resolves to `never` if
|
|
219
219
|
* the type does not match `Refinement`.
|
|
220
220
|
*
|
|
221
|
-
* **Example** (
|
|
221
|
+
* **Example** (Inferring the input type)
|
|
222
222
|
*
|
|
223
223
|
* ```ts
|
|
224
224
|
* import { Predicate } from "effect"
|
|
@@ -245,7 +245,7 @@ export declare namespace Refinement {
|
|
|
245
245
|
* This is type-only and creates no runtime value. It resolves to `never` if
|
|
246
246
|
* the type does not match `Refinement`.
|
|
247
247
|
*
|
|
248
|
-
* **Example** (
|
|
248
|
+
* **Example** (Inferring the output type)
|
|
249
249
|
*
|
|
250
250
|
* ```ts
|
|
251
251
|
* import { Predicate } from "effect"
|
|
@@ -270,7 +270,7 @@ export declare namespace Refinement {
|
|
|
270
270
|
*
|
|
271
271
|
* This is type-only and creates no runtime value.
|
|
272
272
|
*
|
|
273
|
-
* **Example** (
|
|
273
|
+
* **Example** (Using generic constraints)
|
|
274
274
|
*
|
|
275
275
|
* ```ts
|
|
276
276
|
* import { Predicate } from "effect"
|
|
@@ -298,7 +298,7 @@ export declare namespace Refinement {
|
|
|
298
298
|
* Returns a new predicate that applies `f` before `self`. There is no
|
|
299
299
|
* additional short-circuiting beyond what `self` does.
|
|
300
300
|
*
|
|
301
|
-
* **Example** (
|
|
301
|
+
* **Example** (Checking string length)
|
|
302
302
|
*
|
|
303
303
|
* ```ts
|
|
304
304
|
* import { Predicate } from "effect"
|
|
@@ -330,7 +330,7 @@ export declare const mapInput: {
|
|
|
330
330
|
* Returns a new predicate that applies `f` before `self`. There is no
|
|
331
331
|
* additional short-circuiting beyond what `self` does.
|
|
332
332
|
*
|
|
333
|
-
* **Example** (
|
|
333
|
+
* **Example** (Checking string length)
|
|
334
334
|
*
|
|
335
335
|
* ```ts
|
|
336
336
|
* import { Predicate } from "effect"
|
|
@@ -362,7 +362,7 @@ export declare const mapInput: {
|
|
|
362
362
|
* Returns a new predicate that applies `f` before `self`. There is no
|
|
363
363
|
* additional short-circuiting beyond what `self` does.
|
|
364
364
|
*
|
|
365
|
-
* **Example** (
|
|
365
|
+
* **Example** (Checking string length)
|
|
366
366
|
*
|
|
367
367
|
* ```ts
|
|
368
368
|
* import { Predicate } from "effect"
|
|
@@ -395,7 +395,7 @@ export declare const mapInput: {
|
|
|
395
395
|
* This only checks length, not element types, and returns a refinement on the
|
|
396
396
|
* array type.
|
|
397
397
|
*
|
|
398
|
-
* **Example** (
|
|
398
|
+
* **Example** (Checking exact length)
|
|
399
399
|
*
|
|
400
400
|
* ```ts
|
|
401
401
|
* import { Predicate } from "effect"
|
|
@@ -424,7 +424,7 @@ export declare const isTupleOf: {
|
|
|
424
424
|
* This only checks length, not element types, and returns a refinement on the
|
|
425
425
|
* array type.
|
|
426
426
|
*
|
|
427
|
-
* **Example** (
|
|
427
|
+
* **Example** (Checking exact length)
|
|
428
428
|
*
|
|
429
429
|
* ```ts
|
|
430
430
|
* import { Predicate } from "effect"
|
|
@@ -453,7 +453,7 @@ export declare const isTupleOf: {
|
|
|
453
453
|
* This only checks length, not element types, and returns a refinement on the
|
|
454
454
|
* array type.
|
|
455
455
|
*
|
|
456
|
-
* **Example** (
|
|
456
|
+
* **Example** (Checking exact length)
|
|
457
457
|
*
|
|
458
458
|
* ```ts
|
|
459
459
|
* import { Predicate } from "effect"
|
|
@@ -483,7 +483,7 @@ export declare const isTupleOf: {
|
|
|
483
483
|
* This only checks length, not element types, and returns a refinement on the
|
|
484
484
|
* array type.
|
|
485
485
|
*
|
|
486
|
-
* **Example** (
|
|
486
|
+
* **Example** (Checking minimum length)
|
|
487
487
|
*
|
|
488
488
|
* ```ts
|
|
489
489
|
* import { Predicate } from "effect"
|
|
@@ -512,7 +512,7 @@ export declare const isTupleOfAtLeast: {
|
|
|
512
512
|
* This only checks length, not element types, and returns a refinement on the
|
|
513
513
|
* array type.
|
|
514
514
|
*
|
|
515
|
-
* **Example** (
|
|
515
|
+
* **Example** (Checking minimum length)
|
|
516
516
|
*
|
|
517
517
|
* ```ts
|
|
518
518
|
* import { Predicate } from "effect"
|
|
@@ -541,7 +541,7 @@ export declare const isTupleOfAtLeast: {
|
|
|
541
541
|
* This only checks length, not element types, and returns a refinement on the
|
|
542
542
|
* array type.
|
|
543
543
|
*
|
|
544
|
-
* **Example** (
|
|
544
|
+
* **Example** (Checking minimum length)
|
|
545
545
|
*
|
|
546
546
|
* ```ts
|
|
547
547
|
* import { Predicate } from "effect"
|
|
@@ -571,7 +571,7 @@ export declare const isTupleOfAtLeast: {
|
|
|
571
571
|
* This uses `!!input` and treats `0`, `""`, `false`, `null`, and `undefined`
|
|
572
572
|
* as false.
|
|
573
573
|
*
|
|
574
|
-
* **Example** (
|
|
574
|
+
* **Example** (Filtering truthy values)
|
|
575
575
|
*
|
|
576
576
|
* ```ts
|
|
577
577
|
* import { Predicate } from "effect"
|
|
@@ -599,7 +599,7 @@ export declare function isTruthy(input: unknown): boolean;
|
|
|
599
599
|
*
|
|
600
600
|
* Uses `instanceof Set`.
|
|
601
601
|
*
|
|
602
|
-
* **Example** (
|
|
602
|
+
* **Example** (Guarding a Set)
|
|
603
603
|
*
|
|
604
604
|
* ```ts
|
|
605
605
|
* import { Predicate } from "effect"
|
|
@@ -628,7 +628,7 @@ export declare function isSet(input: unknown): input is Set<unknown>;
|
|
|
628
628
|
*
|
|
629
629
|
* Uses `instanceof Map`.
|
|
630
630
|
*
|
|
631
|
-
* **Example** (
|
|
631
|
+
* **Example** (Guarding a Map)
|
|
632
632
|
*
|
|
633
633
|
* ```ts
|
|
634
634
|
* import { Predicate } from "effect"
|
|
@@ -658,7 +658,7 @@ export declare function isMap(input: unknown): input is Map<unknown, unknown>;
|
|
|
658
658
|
*
|
|
659
659
|
* Uses `typeof input === "string"`.
|
|
660
660
|
*
|
|
661
|
-
* **Example** (
|
|
661
|
+
* **Example** (Guarding strings)
|
|
662
662
|
*
|
|
663
663
|
* ```ts
|
|
664
664
|
* import { Predicate } from "effect"
|
|
@@ -689,7 +689,7 @@ export declare function isString(input: unknown): input is string;
|
|
|
689
689
|
*
|
|
690
690
|
* Uses `typeof input === "number"` and does not exclude `NaN` or `Infinity`.
|
|
691
691
|
*
|
|
692
|
-
* **Example** (
|
|
692
|
+
* **Example** (Guarding numbers)
|
|
693
693
|
*
|
|
694
694
|
* ```ts
|
|
695
695
|
* import { Predicate } from "effect"
|
|
@@ -719,7 +719,7 @@ export declare function isNumber(input: unknown): input is number;
|
|
|
719
719
|
*
|
|
720
720
|
* Uses `typeof input === "boolean"`.
|
|
721
721
|
*
|
|
722
|
-
* **Example** (
|
|
722
|
+
* **Example** (Guarding booleans)
|
|
723
723
|
*
|
|
724
724
|
* ```ts
|
|
725
725
|
* import { Predicate } from "effect"
|
|
@@ -749,7 +749,7 @@ export declare function isBoolean(input: unknown): input is boolean;
|
|
|
749
749
|
*
|
|
750
750
|
* Uses `typeof input === "bigint"`.
|
|
751
751
|
*
|
|
752
|
-
* **Example** (
|
|
752
|
+
* **Example** (Guarding bigints)
|
|
753
753
|
*
|
|
754
754
|
* ```ts
|
|
755
755
|
* import { Predicate } from "effect"
|
|
@@ -778,7 +778,7 @@ export declare function isBigInt(input: unknown): input is bigint;
|
|
|
778
778
|
*
|
|
779
779
|
* Uses `typeof input === "symbol"`.
|
|
780
780
|
*
|
|
781
|
-
* **Example** (
|
|
781
|
+
* **Example** (Guarding symbols)
|
|
782
782
|
*
|
|
783
783
|
* ```ts
|
|
784
784
|
* import { Predicate } from "effect"
|
|
@@ -807,7 +807,7 @@ export declare function isSymbol(input: unknown): input is symbol;
|
|
|
807
807
|
*
|
|
808
808
|
* Uses `isString`, `isNumber`, and `isSymbol`.
|
|
809
809
|
*
|
|
810
|
-
* **Example** (
|
|
810
|
+
* **Example** (Guarding property keys)
|
|
811
811
|
*
|
|
812
812
|
* ```ts
|
|
813
813
|
* import { Predicate } from "effect"
|
|
@@ -839,7 +839,7 @@ export declare function isPropertyKey(u: unknown): u is PropertyKey;
|
|
|
839
839
|
*
|
|
840
840
|
* Uses `typeof input === "function"`.
|
|
841
841
|
*
|
|
842
|
-
* **Example** (
|
|
842
|
+
* **Example** (Guarding functions)
|
|
843
843
|
*
|
|
844
844
|
* ```ts
|
|
845
845
|
* import { Predicate } from "effect"
|
|
@@ -868,7 +868,7 @@ export declare function isFunction(input: unknown): input is Function;
|
|
|
868
868
|
*
|
|
869
869
|
* Uses `input === undefined`.
|
|
870
870
|
*
|
|
871
|
-
* **Example** (
|
|
871
|
+
* **Example** (Guarding undefined values)
|
|
872
872
|
*
|
|
873
873
|
* ```ts
|
|
874
874
|
* import { Predicate } from "effect"
|
|
@@ -896,7 +896,7 @@ export declare function isUndefined(input: unknown): input is undefined;
|
|
|
896
896
|
*
|
|
897
897
|
* Returns a refinement that excludes `undefined`.
|
|
898
898
|
*
|
|
899
|
-
* **Example** (
|
|
899
|
+
* **Example** (Filtering undefined values)
|
|
900
900
|
*
|
|
901
901
|
* ```ts
|
|
902
902
|
* import { Predicate } from "effect"
|
|
@@ -924,7 +924,7 @@ export declare function isNotUndefined<A>(input: A): input is Exclude<A, undefin
|
|
|
924
924
|
*
|
|
925
925
|
* Uses `input === null`.
|
|
926
926
|
*
|
|
927
|
-
* **Example** (
|
|
927
|
+
* **Example** (Guarding null values)
|
|
928
928
|
*
|
|
929
929
|
* ```ts
|
|
930
930
|
* import { Predicate } from "effect"
|
|
@@ -952,7 +952,7 @@ export declare function isNull(input: unknown): input is null;
|
|
|
952
952
|
*
|
|
953
953
|
* Returns a refinement that excludes `null`.
|
|
954
954
|
*
|
|
955
|
-
* **Example** (
|
|
955
|
+
* **Example** (Filtering null values)
|
|
956
956
|
*
|
|
957
957
|
* ```ts
|
|
958
958
|
* import { Predicate } from "effect"
|
|
@@ -980,7 +980,7 @@ export declare function isNotNull<A>(input: A): input is Exclude<A, null>;
|
|
|
980
980
|
*
|
|
981
981
|
* Uses `input === null || input === undefined`.
|
|
982
982
|
*
|
|
983
|
-
* **Example** (
|
|
983
|
+
* **Example** (Guarding nullish values)
|
|
984
984
|
*
|
|
985
985
|
* ```ts
|
|
986
986
|
* import { Predicate } from "effect"
|
|
@@ -1010,7 +1010,7 @@ export declare function isNullish<A>(input: A): input is A & (null | undefined);
|
|
|
1010
1010
|
*
|
|
1011
1011
|
* Uses `input != null`.
|
|
1012
1012
|
*
|
|
1013
|
-
* **Example** (
|
|
1013
|
+
* **Example** (Filtering non-nullish values)
|
|
1014
1014
|
*
|
|
1015
1015
|
* ```ts
|
|
1016
1016
|
* import { Predicate } from "effect"
|
|
@@ -1035,7 +1035,7 @@ export declare function isNotNullish<A>(input: A): input is NonNullable<A>;
|
|
|
1035
1035
|
*
|
|
1036
1036
|
* Use when you need a `Predicate` that never accepts, e.g. in default branches.
|
|
1037
1037
|
*
|
|
1038
|
-
* **Example** (
|
|
1038
|
+
* **Example** (Matching no values)
|
|
1039
1039
|
*
|
|
1040
1040
|
* ```ts
|
|
1041
1041
|
* import { Predicate } from "effect"
|
|
@@ -1055,7 +1055,7 @@ export declare function isNever(_: unknown): _ is never;
|
|
|
1055
1055
|
*
|
|
1056
1056
|
* Use when you need a `Predicate` that always accepts, e.g. as a placeholder.
|
|
1057
1057
|
*
|
|
1058
|
-
* **Example** (
|
|
1058
|
+
* **Example** (Matching every value)
|
|
1059
1059
|
*
|
|
1060
1060
|
* ```ts
|
|
1061
1061
|
* import { Predicate } from "effect"
|
|
@@ -1080,7 +1080,7 @@ export declare function isUnknown(_: unknown): _ is unknown;
|
|
|
1080
1080
|
*
|
|
1081
1081
|
* Uses `typeof input === "object" && input !== null` and includes arrays.
|
|
1082
1082
|
*
|
|
1083
|
-
* **Example** (
|
|
1083
|
+
* **Example** (Checking objects or arrays)
|
|
1084
1084
|
*
|
|
1085
1085
|
* ```ts
|
|
1086
1086
|
* import { Predicate } from "effect"
|
|
@@ -1110,7 +1110,7 @@ export declare function isObjectOrArray(input: unknown): input is {
|
|
|
1110
1110
|
* also accepts object instances such as `Date`, `Map`, class instances, and
|
|
1111
1111
|
* typed arrays. It excludes `null` and arrays.
|
|
1112
1112
|
*
|
|
1113
|
-
* **Example** (
|
|
1113
|
+
* **Example** (Guarding objects)
|
|
1114
1114
|
*
|
|
1115
1115
|
* ```ts
|
|
1116
1116
|
* import { Predicate } from "effect"
|
|
@@ -1142,7 +1142,7 @@ export declare function isObject(input: unknown): input is {
|
|
|
1142
1142
|
* runtime. This delegates to `isObject`, so class instances and built-in object
|
|
1143
1143
|
* instances are accepted.
|
|
1144
1144
|
*
|
|
1145
|
-
* **Example** (
|
|
1145
|
+
* **Example** (Checking readonly objects)
|
|
1146
1146
|
*
|
|
1147
1147
|
* ```ts
|
|
1148
1148
|
* import { Predicate } from "effect"
|
|
@@ -1171,7 +1171,7 @@ export declare function isReadonlyObject(input: unknown): input is {
|
|
|
1171
1171
|
*
|
|
1172
1172
|
* Returns `true` for arrays and functions, and `false` for `null`.
|
|
1173
1173
|
*
|
|
1174
|
-
* **Example** (
|
|
1174
|
+
* **Example** (Checking object keywords)
|
|
1175
1175
|
*
|
|
1176
1176
|
* ```ts
|
|
1177
1177
|
* import { Predicate } from "effect"
|
|
@@ -1199,7 +1199,7 @@ export declare function isObjectKeyword(input: unknown): input is object;
|
|
|
1199
1199
|
* Uses the `in` operator and `isObjectKeyword`. This does not check property
|
|
1200
1200
|
* value types.
|
|
1201
1201
|
*
|
|
1202
|
-
* **Example** (
|
|
1202
|
+
* **Example** (Guarding object properties)
|
|
1203
1203
|
*
|
|
1204
1204
|
* ```ts
|
|
1205
1205
|
* import { Predicate } from "effect"
|
|
@@ -1231,7 +1231,7 @@ export declare const hasProperty: {
|
|
|
1231
1231
|
* Uses the `in` operator and `isObjectKeyword`. This does not check property
|
|
1232
1232
|
* value types.
|
|
1233
1233
|
*
|
|
1234
|
-
* **Example** (
|
|
1234
|
+
* **Example** (Guarding object properties)
|
|
1235
1235
|
*
|
|
1236
1236
|
* ```ts
|
|
1237
1237
|
* import { Predicate } from "effect"
|
|
@@ -1265,7 +1265,7 @@ export declare const hasProperty: {
|
|
|
1265
1265
|
* Uses the `in` operator and `isObjectKeyword`. This does not check property
|
|
1266
1266
|
* value types.
|
|
1267
1267
|
*
|
|
1268
|
-
* **Example** (
|
|
1268
|
+
* **Example** (Guarding object properties)
|
|
1269
1269
|
*
|
|
1270
1270
|
* ```ts
|
|
1271
1271
|
* import { Predicate } from "effect"
|
|
@@ -1299,7 +1299,7 @@ export declare const hasProperty: {
|
|
|
1299
1299
|
*
|
|
1300
1300
|
* Uses `hasProperty` and strict equality on `_tag`.
|
|
1301
1301
|
*
|
|
1302
|
-
* **Example** (
|
|
1302
|
+
* **Example** (Guarding tagged values)
|
|
1303
1303
|
*
|
|
1304
1304
|
* ```ts
|
|
1305
1305
|
* import { Predicate } from "effect"
|
|
@@ -1326,7 +1326,7 @@ export declare const isTagged: {
|
|
|
1326
1326
|
*
|
|
1327
1327
|
* Uses `hasProperty` and strict equality on `_tag`.
|
|
1328
1328
|
*
|
|
1329
|
-
* **Example** (
|
|
1329
|
+
* **Example** (Guarding tagged values)
|
|
1330
1330
|
*
|
|
1331
1331
|
* ```ts
|
|
1332
1332
|
* import { Predicate } from "effect"
|
|
@@ -1355,7 +1355,7 @@ export declare const isTagged: {
|
|
|
1355
1355
|
*
|
|
1356
1356
|
* Uses `hasProperty` and strict equality on `_tag`.
|
|
1357
1357
|
*
|
|
1358
|
-
* **Example** (
|
|
1358
|
+
* **Example** (Guarding tagged values)
|
|
1359
1359
|
*
|
|
1360
1360
|
* ```ts
|
|
1361
1361
|
* import { Predicate } from "effect"
|
|
@@ -1384,7 +1384,7 @@ export declare const isTagged: {
|
|
|
1384
1384
|
*
|
|
1385
1385
|
* Uses `instanceof Error`.
|
|
1386
1386
|
*
|
|
1387
|
-
* **Example** (
|
|
1387
|
+
* **Example** (Guarding errors)
|
|
1388
1388
|
*
|
|
1389
1389
|
* ```ts
|
|
1390
1390
|
* import { Predicate } from "effect"
|
|
@@ -1410,7 +1410,7 @@ export declare function isError(input: unknown): input is Error;
|
|
|
1410
1410
|
*
|
|
1411
1411
|
* Uses `instanceof Uint8Array`.
|
|
1412
1412
|
*
|
|
1413
|
-
* **Example** (
|
|
1413
|
+
* **Example** (Guarding Uint8Array values)
|
|
1414
1414
|
*
|
|
1415
1415
|
* ```ts
|
|
1416
1416
|
* import { Predicate } from "effect"
|
|
@@ -1437,7 +1437,7 @@ export declare function isUint8Array(input: unknown): input is Uint8Array;
|
|
|
1437
1437
|
*
|
|
1438
1438
|
* Uses `instanceof Date`.
|
|
1439
1439
|
*
|
|
1440
|
-
* **Example** (
|
|
1440
|
+
* **Example** (Guarding Date values)
|
|
1441
1441
|
*
|
|
1442
1442
|
* ```ts
|
|
1443
1443
|
* import { Predicate } from "effect"
|
|
@@ -1463,7 +1463,7 @@ export declare function isDate(input: unknown): input is Date;
|
|
|
1463
1463
|
*
|
|
1464
1464
|
* Accepts strings as iterable and uses `hasProperty` for `Symbol.iterator`.
|
|
1465
1465
|
*
|
|
1466
|
-
* **Example** (
|
|
1466
|
+
* **Example** (Guarding iterables)
|
|
1467
1467
|
*
|
|
1468
1468
|
* ```ts
|
|
1469
1469
|
* import { Predicate } from "effect"
|
|
@@ -1490,7 +1490,7 @@ export declare function isIterable(input: unknown): input is Iterable<unknown>;
|
|
|
1490
1490
|
*
|
|
1491
1491
|
* Performs a structural check for `then` and `catch` functions.
|
|
1492
1492
|
*
|
|
1493
|
-
* **Example** (
|
|
1493
|
+
* **Example** (Guarding promises)
|
|
1494
1494
|
*
|
|
1495
1495
|
* ```ts
|
|
1496
1496
|
* import { Predicate } from "effect"
|
|
@@ -1517,7 +1517,7 @@ export declare function isPromise(input: unknown): input is Promise<unknown>;
|
|
|
1517
1517
|
*
|
|
1518
1518
|
* Performs a structural check for a callable `then`.
|
|
1519
1519
|
*
|
|
1520
|
-
* **Example** (
|
|
1520
|
+
* **Example** (Guarding promise-like values)
|
|
1521
1521
|
*
|
|
1522
1522
|
* ```ts
|
|
1523
1523
|
* import { Predicate } from "effect"
|
|
@@ -1543,7 +1543,7 @@ export declare function isPromiseLike(input: unknown): input is PromiseLike<unkn
|
|
|
1543
1543
|
*
|
|
1544
1544
|
* Uses `instanceof RegExp`.
|
|
1545
1545
|
*
|
|
1546
|
-
* **Example** (
|
|
1546
|
+
* **Example** (Guarding RegExp values)
|
|
1547
1547
|
*
|
|
1548
1548
|
* ```ts
|
|
1549
1549
|
* import { Predicate } from "effect"
|
|
@@ -1571,7 +1571,7 @@ export declare function isRegExp(input: unknown): input is RegExp;
|
|
|
1571
1571
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1572
1572
|
* short-circuits on the first `false`.
|
|
1573
1573
|
*
|
|
1574
|
-
* **Example** (
|
|
1574
|
+
* **Example** (Composing refinements)
|
|
1575
1575
|
*
|
|
1576
1576
|
* ```ts
|
|
1577
1577
|
* import { Predicate } from "effect"
|
|
@@ -1603,7 +1603,7 @@ export declare const compose: {
|
|
|
1603
1603
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1604
1604
|
* short-circuits on the first `false`.
|
|
1605
1605
|
*
|
|
1606
|
-
* **Example** (
|
|
1606
|
+
* **Example** (Composing refinements)
|
|
1607
1607
|
*
|
|
1608
1608
|
* ```ts
|
|
1609
1609
|
* import { Predicate } from "effect"
|
|
@@ -1635,7 +1635,7 @@ export declare const compose: {
|
|
|
1635
1635
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1636
1636
|
* short-circuits on the first `false`.
|
|
1637
1637
|
*
|
|
1638
|
-
* **Example** (
|
|
1638
|
+
* **Example** (Composing refinements)
|
|
1639
1639
|
*
|
|
1640
1640
|
* ```ts
|
|
1641
1641
|
* import { Predicate } from "effect"
|
|
@@ -1667,7 +1667,7 @@ export declare const compose: {
|
|
|
1667
1667
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1668
1668
|
* short-circuits on the first `false`.
|
|
1669
1669
|
*
|
|
1670
|
-
* **Example** (
|
|
1670
|
+
* **Example** (Composing refinements)
|
|
1671
1671
|
*
|
|
1672
1672
|
* ```ts
|
|
1673
1673
|
* import { Predicate } from "effect"
|
|
@@ -1699,7 +1699,7 @@ export declare const compose: {
|
|
|
1699
1699
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1700
1700
|
* short-circuits on the first `false`.
|
|
1701
1701
|
*
|
|
1702
|
-
* **Example** (
|
|
1702
|
+
* **Example** (Composing refinements)
|
|
1703
1703
|
*
|
|
1704
1704
|
* ```ts
|
|
1705
1705
|
* import { Predicate } from "effect"
|
|
@@ -1732,7 +1732,7 @@ export declare const compose: {
|
|
|
1732
1732
|
* Returns a refinement if any element predicate is a refinement. Evaluation
|
|
1733
1733
|
* stops at the first failing element.
|
|
1734
1734
|
*
|
|
1735
|
-
* **Example** (
|
|
1735
|
+
* **Example** (Checking tuples)
|
|
1736
1736
|
*
|
|
1737
1737
|
* ```ts
|
|
1738
1738
|
* import { Predicate } from "effect"
|
|
@@ -1767,7 +1767,7 @@ export declare function Tuple<const T extends ReadonlyArray<Predicate.Any>>(elem
|
|
|
1767
1767
|
* Returns a refinement if any field predicate is a refinement. Only the
|
|
1768
1768
|
* specified keys are checked, and extra keys are ignored.
|
|
1769
1769
|
*
|
|
1770
|
-
* **Example** (
|
|
1770
|
+
* **Example** (Checking structs)
|
|
1771
1771
|
*
|
|
1772
1772
|
* ```ts
|
|
1773
1773
|
* import { Predicate } from "effect"
|
|
@@ -1803,7 +1803,7 @@ export declare function Struct<R extends Record<string, Predicate.Any>>(fields:
|
|
|
1803
1803
|
*
|
|
1804
1804
|
* Returns a new predicate that flips the boolean result.
|
|
1805
1805
|
*
|
|
1806
|
-
* **Example** (
|
|
1806
|
+
* **Example** (Negating a predicate)
|
|
1807
1807
|
*
|
|
1808
1808
|
* ```ts
|
|
1809
1809
|
* import { Predicate } from "effect"
|
|
@@ -1833,7 +1833,7 @@ export declare function not<A>(self: Predicate<A>): Predicate<A>;
|
|
|
1833
1833
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
1834
1834
|
* type is a union.
|
|
1835
1835
|
*
|
|
1836
|
-
* **Example** (
|
|
1836
|
+
* **Example** (Checking either condition)
|
|
1837
1837
|
*
|
|
1838
1838
|
* ```ts
|
|
1839
1839
|
* import { Predicate } from "effect"
|
|
@@ -1862,7 +1862,7 @@ export declare const or: {
|
|
|
1862
1862
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
1863
1863
|
* type is a union.
|
|
1864
1864
|
*
|
|
1865
|
-
* **Example** (
|
|
1865
|
+
* **Example** (Checking either condition)
|
|
1866
1866
|
*
|
|
1867
1867
|
* ```ts
|
|
1868
1868
|
* import { Predicate } from "effect"
|
|
@@ -1891,7 +1891,7 @@ export declare const or: {
|
|
|
1891
1891
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
1892
1892
|
* type is a union.
|
|
1893
1893
|
*
|
|
1894
|
-
* **Example** (
|
|
1894
|
+
* **Example** (Checking either condition)
|
|
1895
1895
|
*
|
|
1896
1896
|
* ```ts
|
|
1897
1897
|
* import { Predicate } from "effect"
|
|
@@ -1920,7 +1920,7 @@ export declare const or: {
|
|
|
1920
1920
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
1921
1921
|
* type is a union.
|
|
1922
1922
|
*
|
|
1923
|
-
* **Example** (
|
|
1923
|
+
* **Example** (Checking either condition)
|
|
1924
1924
|
*
|
|
1925
1925
|
* ```ts
|
|
1926
1926
|
* import { Predicate } from "effect"
|
|
@@ -1949,7 +1949,7 @@ export declare const or: {
|
|
|
1949
1949
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
1950
1950
|
* type is a union.
|
|
1951
1951
|
*
|
|
1952
|
-
* **Example** (
|
|
1952
|
+
* **Example** (Checking either condition)
|
|
1953
1953
|
*
|
|
1954
1954
|
* ```ts
|
|
1955
1955
|
* import { Predicate } from "effect"
|
|
@@ -1980,7 +1980,7 @@ export declare const or: {
|
|
|
1980
1980
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
1981
1981
|
* type is an intersection.
|
|
1982
1982
|
*
|
|
1983
|
-
* **Example** (
|
|
1983
|
+
* **Example** (Checking both conditions)
|
|
1984
1984
|
*
|
|
1985
1985
|
* ```ts
|
|
1986
1986
|
* import { Predicate } from "effect"
|
|
@@ -2018,7 +2018,7 @@ export declare const and: {
|
|
|
2018
2018
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2019
2019
|
* type is an intersection.
|
|
2020
2020
|
*
|
|
2021
|
-
* **Example** (
|
|
2021
|
+
* **Example** (Checking both conditions)
|
|
2022
2022
|
*
|
|
2023
2023
|
* ```ts
|
|
2024
2024
|
* import { Predicate } from "effect"
|
|
@@ -2056,7 +2056,7 @@ export declare const and: {
|
|
|
2056
2056
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2057
2057
|
* type is an intersection.
|
|
2058
2058
|
*
|
|
2059
|
-
* **Example** (
|
|
2059
|
+
* **Example** (Checking both conditions)
|
|
2060
2060
|
*
|
|
2061
2061
|
* ```ts
|
|
2062
2062
|
* import { Predicate } from "effect"
|
|
@@ -2094,7 +2094,7 @@ export declare const and: {
|
|
|
2094
2094
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2095
2095
|
* type is an intersection.
|
|
2096
2096
|
*
|
|
2097
|
-
* **Example** (
|
|
2097
|
+
* **Example** (Checking both conditions)
|
|
2098
2098
|
*
|
|
2099
2099
|
* ```ts
|
|
2100
2100
|
* import { Predicate } from "effect"
|
|
@@ -2132,7 +2132,7 @@ export declare const and: {
|
|
|
2132
2132
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2133
2133
|
* type is an intersection.
|
|
2134
2134
|
*
|
|
2135
|
-
* **Example** (
|
|
2135
|
+
* **Example** (Checking both conditions)
|
|
2136
2136
|
*
|
|
2137
2137
|
* ```ts
|
|
2138
2138
|
* import { Predicate } from "effect"
|
|
@@ -2168,7 +2168,7 @@ export declare const and: {
|
|
|
2168
2168
|
*
|
|
2169
2169
|
* Returns `true` when results differ.
|
|
2170
2170
|
*
|
|
2171
|
-
* **Example** (
|
|
2171
|
+
* **Example** (Checking exclusive-or conditions)
|
|
2172
2172
|
*
|
|
2173
2173
|
* ```ts
|
|
2174
2174
|
* import { Predicate } from "effect"
|
|
@@ -2197,7 +2197,7 @@ export declare const xor: {
|
|
|
2197
2197
|
*
|
|
2198
2198
|
* Returns `true` when results differ.
|
|
2199
2199
|
*
|
|
2200
|
-
* **Example** (
|
|
2200
|
+
* **Example** (Checking exclusive-or conditions)
|
|
2201
2201
|
*
|
|
2202
2202
|
* ```ts
|
|
2203
2203
|
* import { Predicate } from "effect"
|
|
@@ -2226,7 +2226,7 @@ export declare const xor: {
|
|
|
2226
2226
|
*
|
|
2227
2227
|
* Returns `true` when results differ.
|
|
2228
2228
|
*
|
|
2229
|
-
* **Example** (
|
|
2229
|
+
* **Example** (Checking exclusive-or conditions)
|
|
2230
2230
|
*
|
|
2231
2231
|
* ```ts
|
|
2232
2232
|
* import { Predicate } from "effect"
|
|
@@ -2256,7 +2256,7 @@ export declare const xor: {
|
|
|
2256
2256
|
*
|
|
2257
2257
|
* Returns `true` when both results are equal.
|
|
2258
2258
|
*
|
|
2259
|
-
* **Example** (
|
|
2259
|
+
* **Example** (Defining equivalence)
|
|
2260
2260
|
*
|
|
2261
2261
|
* ```ts
|
|
2262
2262
|
* import { Predicate } from "effect"
|
|
@@ -2283,7 +2283,7 @@ export declare const eqv: {
|
|
|
2283
2283
|
*
|
|
2284
2284
|
* Returns `true` when both results are equal.
|
|
2285
2285
|
*
|
|
2286
|
-
* **Example** (
|
|
2286
|
+
* **Example** (Defining equivalence)
|
|
2287
2287
|
*
|
|
2288
2288
|
* ```ts
|
|
2289
2289
|
* import { Predicate } from "effect"
|
|
@@ -2310,7 +2310,7 @@ export declare const eqv: {
|
|
|
2310
2310
|
*
|
|
2311
2311
|
* Returns `true` when both results are equal.
|
|
2312
2312
|
*
|
|
2313
|
-
* **Example** (
|
|
2313
|
+
* **Example** (Defining equivalence)
|
|
2314
2314
|
*
|
|
2315
2315
|
* ```ts
|
|
2316
2316
|
* import { Predicate } from "effect"
|
|
@@ -2340,7 +2340,7 @@ export declare const eqv: {
|
|
|
2340
2340
|
* Models constraints like "if A then B" and returns `true` when the antecedent
|
|
2341
2341
|
* is `false`.
|
|
2342
2342
|
*
|
|
2343
|
-
* **Example** (
|
|
2343
|
+
* **Example** (Checking implication)
|
|
2344
2344
|
*
|
|
2345
2345
|
* ```ts
|
|
2346
2346
|
* import { Predicate } from "effect"
|
|
@@ -2371,7 +2371,7 @@ export declare const implies: {
|
|
|
2371
2371
|
* Models constraints like "if A then B" and returns `true` when the antecedent
|
|
2372
2372
|
* is `false`.
|
|
2373
2373
|
*
|
|
2374
|
-
* **Example** (
|
|
2374
|
+
* **Example** (Checking implication)
|
|
2375
2375
|
*
|
|
2376
2376
|
* ```ts
|
|
2377
2377
|
* import { Predicate } from "effect"
|
|
@@ -2402,7 +2402,7 @@ export declare const implies: {
|
|
|
2402
2402
|
* Models constraints like "if A then B" and returns `true` when the antecedent
|
|
2403
2403
|
* is `false`.
|
|
2404
2404
|
*
|
|
2405
|
-
* **Example** (
|
|
2405
|
+
* **Example** (Checking implication)
|
|
2406
2406
|
*
|
|
2407
2407
|
* ```ts
|
|
2408
2408
|
* import { Predicate } from "effect"
|
|
@@ -2432,7 +2432,7 @@ export declare const implies: {
|
|
|
2432
2432
|
*
|
|
2433
2433
|
* Returns the negation of `or`.
|
|
2434
2434
|
*
|
|
2435
|
-
* **Example** (NOR)
|
|
2435
|
+
* **Example** (Checking NOR conditions)
|
|
2436
2436
|
*
|
|
2437
2437
|
* ```ts
|
|
2438
2438
|
* import { Predicate } from "effect"
|
|
@@ -2459,7 +2459,7 @@ export declare const nor: {
|
|
|
2459
2459
|
*
|
|
2460
2460
|
* Returns the negation of `or`.
|
|
2461
2461
|
*
|
|
2462
|
-
* **Example** (NOR)
|
|
2462
|
+
* **Example** (Checking NOR conditions)
|
|
2463
2463
|
*
|
|
2464
2464
|
* ```ts
|
|
2465
2465
|
* import { Predicate } from "effect"
|
|
@@ -2486,7 +2486,7 @@ export declare const nor: {
|
|
|
2486
2486
|
*
|
|
2487
2487
|
* Returns the negation of `or`.
|
|
2488
2488
|
*
|
|
2489
|
-
* **Example** (NOR)
|
|
2489
|
+
* **Example** (Checking NOR conditions)
|
|
2490
2490
|
*
|
|
2491
2491
|
* ```ts
|
|
2492
2492
|
* import { Predicate } from "effect"
|
|
@@ -2514,7 +2514,7 @@ export declare const nor: {
|
|
|
2514
2514
|
*
|
|
2515
2515
|
* Returns the negation of `and`.
|
|
2516
2516
|
*
|
|
2517
|
-
* **Example** (NAND)
|
|
2517
|
+
* **Example** (Checking NAND conditions)
|
|
2518
2518
|
*
|
|
2519
2519
|
* ```ts
|
|
2520
2520
|
* import { Predicate } from "effect"
|
|
@@ -2541,7 +2541,7 @@ export declare const nand: {
|
|
|
2541
2541
|
*
|
|
2542
2542
|
* Returns the negation of `and`.
|
|
2543
2543
|
*
|
|
2544
|
-
* **Example** (NAND)
|
|
2544
|
+
* **Example** (Checking NAND conditions)
|
|
2545
2545
|
*
|
|
2546
2546
|
* ```ts
|
|
2547
2547
|
* import { Predicate } from "effect"
|
|
@@ -2568,7 +2568,7 @@ export declare const nand: {
|
|
|
2568
2568
|
*
|
|
2569
2569
|
* Returns the negation of `and`.
|
|
2570
2570
|
*
|
|
2571
|
-
* **Example** (NAND)
|
|
2571
|
+
* **Example** (Checking NAND conditions)
|
|
2572
2572
|
*
|
|
2573
2573
|
* ```ts
|
|
2574
2574
|
* import { Predicate } from "effect"
|
|
@@ -2597,7 +2597,7 @@ export declare const nand: {
|
|
|
2597
2597
|
* Evaluation short-circuits on the first `false`. The collection is iterated
|
|
2598
2598
|
* each time the predicate is called.
|
|
2599
2599
|
*
|
|
2600
|
-
* **Example** (
|
|
2600
|
+
* **Example** (Checking all predicates)
|
|
2601
2601
|
*
|
|
2602
2602
|
* ```ts
|
|
2603
2603
|
* import { Predicate } from "effect"
|
|
@@ -2625,7 +2625,7 @@ export declare function every<A>(collection: Iterable<Predicate<A>>): Predicate<
|
|
|
2625
2625
|
* Evaluation short-circuits on the first `true`. The collection is iterated
|
|
2626
2626
|
* each time the predicate is called.
|
|
2627
2627
|
*
|
|
2628
|
-
* **Example** (
|
|
2628
|
+
* **Example** (Checking any predicate)
|
|
2629
2629
|
*
|
|
2630
2630
|
* ```ts
|
|
2631
2631
|
* import { Predicate } from "effect"
|