effect 3.17.9 → 3.17.10

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.
Files changed (49) hide show
  1. package/dist/cjs/Arbitrary.js +5 -2
  2. package/dist/cjs/Arbitrary.js.map +1 -1
  3. package/dist/cjs/Either.js.map +1 -1
  4. package/dist/cjs/JSONSchema.js +307 -364
  5. package/dist/cjs/JSONSchema.js.map +1 -1
  6. package/dist/cjs/ParseResult.js +1 -1
  7. package/dist/cjs/ParseResult.js.map +1 -1
  8. package/dist/cjs/Schema.js +17 -14
  9. package/dist/cjs/Schema.js.map +1 -1
  10. package/dist/cjs/SchemaAST.js +27 -25
  11. package/dist/cjs/SchemaAST.js.map +1 -1
  12. package/dist/cjs/internal/core-effect.js +6 -6
  13. package/dist/cjs/internal/core-effect.js.map +1 -1
  14. package/dist/cjs/internal/version.js +1 -1
  15. package/dist/cjs/internal/version.js.map +1 -1
  16. package/dist/dts/Effect.d.ts +4 -4
  17. package/dist/dts/Either.d.ts +96 -96
  18. package/dist/dts/Either.d.ts.map +1 -1
  19. package/dist/dts/JSONSchema.d.ts.map +1 -1
  20. package/dist/dts/STM.d.ts +2 -2
  21. package/dist/dts/Schema.d.ts.map +1 -1
  22. package/dist/dts/SchemaAST.d.ts +2 -0
  23. package/dist/dts/SchemaAST.d.ts.map +1 -1
  24. package/dist/esm/Arbitrary.js +5 -2
  25. package/dist/esm/Arbitrary.js.map +1 -1
  26. package/dist/esm/Either.js.map +1 -1
  27. package/dist/esm/JSONSchema.js +307 -364
  28. package/dist/esm/JSONSchema.js.map +1 -1
  29. package/dist/esm/ParseResult.js +1 -1
  30. package/dist/esm/ParseResult.js.map +1 -1
  31. package/dist/esm/Schema.js +17 -14
  32. package/dist/esm/Schema.js.map +1 -1
  33. package/dist/esm/SchemaAST.js +27 -25
  34. package/dist/esm/SchemaAST.js.map +1 -1
  35. package/dist/esm/internal/core-effect.js +6 -6
  36. package/dist/esm/internal/core-effect.js.map +1 -1
  37. package/dist/esm/internal/version.js +1 -1
  38. package/dist/esm/internal/version.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/Arbitrary.ts +4 -2
  41. package/src/Effect.ts +4 -4
  42. package/src/Either.ts +132 -132
  43. package/src/JSONSchema.ts +373 -332
  44. package/src/ParseResult.ts +1 -1
  45. package/src/STM.ts +2 -2
  46. package/src/Schema.ts +19 -12
  47. package/src/SchemaAST.ts +24 -31
  48. package/src/internal/core-effect.ts +6 -6
  49. package/src/internal/version.ts +1 -1
@@ -15,7 +15,7 @@ import * as Gen from "./Utils.js";
15
15
  * @category models
16
16
  * @since 2.0.0
17
17
  */
18
- export type Either<R, L = never> = Left<L, R> | Right<L, R>;
18
+ export type Either<A, E = never> = Left<E, A> | Right<E, A>;
19
19
  /**
20
20
  * @category symbols
21
21
  * @since 2.0.0
@@ -30,13 +30,13 @@ export type TypeId = typeof TypeId;
30
30
  * @category models
31
31
  * @since 2.0.0
32
32
  */
33
- export interface Left<out L, out R> extends Pipeable, Inspectable {
33
+ export interface Left<out E, out A> extends Pipeable, Inspectable {
34
34
  readonly _tag: "Left";
35
35
  readonly _op: "Left";
36
- readonly left: L;
36
+ readonly left: E;
37
37
  readonly [TypeId]: {
38
- readonly _R: Covariant<R>;
39
- readonly _L: Covariant<L>;
38
+ readonly _R: Covariant<A>;
39
+ readonly _L: Covariant<E>;
40
40
  };
41
41
  [Unify.typeSymbol]?: unknown;
42
42
  [Unify.unifySymbol]?: EitherUnify<this>;
@@ -46,13 +46,13 @@ export interface Left<out L, out R> extends Pipeable, Inspectable {
46
46
  * @category models
47
47
  * @since 2.0.0
48
48
  */
49
- export interface Right<out L, out R> extends Pipeable, Inspectable {
49
+ export interface Right<out E, out A> extends Pipeable, Inspectable {
50
50
  readonly _tag: "Right";
51
51
  readonly _op: "Right";
52
- readonly right: R;
52
+ readonly right: A;
53
53
  readonly [TypeId]: {
54
- readonly _R: Covariant<R>;
55
- readonly _L: Covariant<L>;
54
+ readonly _R: Covariant<A>;
55
+ readonly _L: Covariant<E>;
56
56
  };
57
57
  [Unify.typeSymbol]?: unknown;
58
58
  [Unify.unifySymbol]?: EitherUnify<this>;
@@ -102,7 +102,7 @@ export declare namespace Either {
102
102
  * @category constructors
103
103
  * @since 2.0.0
104
104
  */
105
- export declare const right: <R>(right: R) => Either<R>;
105
+ export declare const right: <A>(a: A) => Either<A>;
106
106
  declare const void_: Either<void>;
107
107
  export {
108
108
  /**
@@ -117,7 +117,7 @@ void_ as void };
117
117
  * @category constructors
118
118
  * @since 2.0.0
119
119
  */
120
- export declare const left: <L>(left: L) => Either<never, L>;
120
+ export declare const left: <E>(e: E) => Either<never, E>;
121
121
  /**
122
122
  * Takes a lazy default and a nullable value, if the value is not nully (`null` or `undefined`), turn it into a `Right`, if the value is nully use
123
123
  * the provided default as a `Left`.
@@ -151,7 +151,7 @@ export declare const fromNullable: {
151
151
  * @category constructors
152
152
  * @since 2.0.0
153
153
  */
154
- <R, L>(onNullable: (right: R) => L): (self: R) => Either<NonNullable<R>, L>;
154
+ <A, E>(onNullable: (right: A) => E): (self: A) => Either<NonNullable<A>, E>;
155
155
  /**
156
156
  * Takes a lazy default and a nullable value, if the value is not nully (`null` or `undefined`), turn it into a `Right`, if the value is nully use
157
157
  * the provided default as a `Left`.
@@ -168,7 +168,7 @@ export declare const fromNullable: {
168
168
  * @category constructors
169
169
  * @since 2.0.0
170
170
  */
171
- <R, L>(self: R, onNullable: (right: R) => L): Either<NonNullable<R>, L>;
171
+ <A, E>(self: A, onNullable: (right: A) => E): Either<NonNullable<A>, E>;
172
172
  };
173
173
  /**
174
174
  * @example
@@ -197,7 +197,7 @@ export declare const fromOption: {
197
197
  * @category constructors
198
198
  * @since 2.0.0
199
199
  */
200
- <L>(onNone: () => L): <R>(self: Option<R>) => Either<R, L>;
200
+ <E>(onNone: () => E): <A>(self: Option<A>) => Either<A, E>;
201
201
  /**
202
202
  * @example
203
203
  * ```ts
@@ -211,14 +211,14 @@ export declare const fromOption: {
211
211
  * @category constructors
212
212
  * @since 2.0.0
213
213
  */
214
- <R, L>(self: Option<R>, onNone: () => L): Either<R, L>;
214
+ <A, E>(self: Option<A>, onNone: () => E): Either<A, E>;
215
215
  };
216
216
  declare const try_: {
217
- <R, L>(options: {
218
- readonly try: LazyArg<R>;
219
- readonly catch: (error: unknown) => L;
220
- }): Either<R, L>;
221
- <R>(evaluate: LazyArg<R>): Either<R, unknown>;
217
+ <A, E>(options: {
218
+ readonly try: LazyArg<A>;
219
+ readonly catch: (error: unknown) => E;
220
+ }): Either<A, E>;
221
+ <A>(evaluate: LazyArg<A>): Either<A, unknown>;
222
222
  };
223
223
  export {
224
224
  /**
@@ -261,7 +261,7 @@ export declare const isEither: (input: unknown) => input is Either<unknown, unkn
261
261
  * @category guards
262
262
  * @since 2.0.0
263
263
  */
264
- export declare const isLeft: <R, L>(self: Either<R, L>) => self is Left<L, R>;
264
+ export declare const isLeft: <A, E>(self: Either<A, E>) => self is Left<E, A>;
265
265
  /**
266
266
  * Determine if a `Either` is a `Right`.
267
267
  *
@@ -277,7 +277,7 @@ export declare const isLeft: <R, L>(self: Either<R, L>) => self is Left<L, R>;
277
277
  * @category guards
278
278
  * @since 2.0.0
279
279
  */
280
- export declare const isRight: <R, L>(self: Either<R, L>) => self is Right<L, R>;
280
+ export declare const isRight: <A, E>(self: Either<A, E>) => self is Right<E, A>;
281
281
  /**
282
282
  * Converts a `Either` to an `Option` discarding the `Left`.
283
283
  *
@@ -293,7 +293,7 @@ export declare const isRight: <R, L>(self: Either<R, L>) => self is Right<L, R>;
293
293
  * @category getters
294
294
  * @since 2.0.0
295
295
  */
296
- export declare const getRight: <R, L>(self: Either<R, L>) => Option<R>;
296
+ export declare const getRight: <A, E>(self: Either<A, E>) => Option<A>;
297
297
  /**
298
298
  * Converts a `Either` to an `Option` discarding the value.
299
299
  *
@@ -309,15 +309,15 @@ export declare const getRight: <R, L>(self: Either<R, L>) => Option<R>;
309
309
  * @category getters
310
310
  * @since 2.0.0
311
311
  */
312
- export declare const getLeft: <R, L>(self: Either<R, L>) => Option<L>;
312
+ export declare const getLeft: <A, E>(self: Either<A, E>) => Option<E>;
313
313
  /**
314
314
  * @category equivalence
315
315
  * @since 2.0.0
316
316
  */
317
- export declare const getEquivalence: <R, L>({ left, right }: {
318
- right: Equivalence.Equivalence<R>;
319
- left: Equivalence.Equivalence<L>;
320
- }) => Equivalence.Equivalence<Either<R, L>>;
317
+ export declare const getEquivalence: <A, E>({ left, right }: {
318
+ right: Equivalence.Equivalence<A>;
319
+ left: Equivalence.Equivalence<E>;
320
+ }) => Equivalence.Equivalence<Either<A, E>>;
321
321
  /**
322
322
  * @category mapping
323
323
  * @since 2.0.0
@@ -327,18 +327,18 @@ export declare const mapBoth: {
327
327
  * @category mapping
328
328
  * @since 2.0.0
329
329
  */
330
- <L, L2, R, R2>(options: {
331
- readonly onLeft: (left: L) => L2;
332
- readonly onRight: (right: R) => R2;
333
- }): (self: Either<R, L>) => Either<R2, L2>;
330
+ <E, E2, A, A2>(options: {
331
+ readonly onLeft: (left: E) => E2;
332
+ readonly onRight: (right: A) => A2;
333
+ }): (self: Either<A, E>) => Either<A2, E2>;
334
334
  /**
335
335
  * @category mapping
336
336
  * @since 2.0.0
337
337
  */
338
- <L, R, L2, R2>(self: Either<R, L>, options: {
339
- readonly onLeft: (left: L) => L2;
340
- readonly onRight: (right: R) => R2;
341
- }): Either<R2, L2>;
338
+ <A, E, E2, A2>(self: Either<A, E>, options: {
339
+ readonly onLeft: (left: E) => E2;
340
+ readonly onRight: (right: A) => A2;
341
+ }): Either<A2, E2>;
342
342
  };
343
343
  /**
344
344
  * Maps the `Left` side of an `Either` value to a new `Either` value.
@@ -353,14 +353,14 @@ export declare const mapLeft: {
353
353
  * @category mapping
354
354
  * @since 2.0.0
355
355
  */
356
- <L, L2>(f: (left: L) => L2): <R>(self: Either<R, L>) => Either<R, L2>;
356
+ <E, E2>(f: (left: E) => E2): <A>(self: Either<A, E>) => Either<A, E2>;
357
357
  /**
358
358
  * Maps the `Left` side of an `Either` value to a new `Either` value.
359
359
  *
360
360
  * @category mapping
361
361
  * @since 2.0.0
362
362
  */
363
- <R, L, L2>(self: Either<R, L>, f: (left: L) => L2): Either<R, L2>;
363
+ <A, E, E2>(self: Either<A, E>, f: (left: E) => E2): Either<A, E2>;
364
364
  };
365
365
  /**
366
366
  * Maps the `Right` side of an `Either` value to a new `Either` value.
@@ -375,14 +375,14 @@ export declare const map: {
375
375
  * @category mapping
376
376
  * @since 2.0.0
377
377
  */
378
- <R, R2>(f: (right: R) => R2): <L>(self: Either<R, L>) => Either<R2, L>;
378
+ <A, A2>(f: (right: A) => A2): <E>(self: Either<A, E>) => Either<A2, E>;
379
379
  /**
380
380
  * Maps the `Right` side of an `Either` value to a new `Either` value.
381
381
  *
382
382
  * @category mapping
383
383
  * @since 2.0.0
384
384
  */
385
- <R, L, R2>(self: Either<R, L>, f: (right: R) => R2): Either<R2, L>;
385
+ <A, E, A2>(self: Either<A, E>, f: (right: A) => A2): Either<A2, E>;
386
386
  };
387
387
  /**
388
388
  * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the `onLeft function,
@@ -431,10 +431,10 @@ export declare const match: {
431
431
  * @category pattern matching
432
432
  * @since 2.0.0
433
433
  */
434
- <L, B, R, C = B>(options: {
435
- readonly onLeft: (left: L) => B;
436
- readonly onRight: (right: R) => C;
437
- }): (self: Either<R, L>) => B | C;
434
+ <E, B, A, C = B>(options: {
435
+ readonly onLeft: (left: E) => B;
436
+ readonly onRight: (right: A) => C;
437
+ }): (self: Either<A, E>) => B | C;
438
438
  /**
439
439
  * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the `onLeft function,
440
440
  * if the value is a `Right` the inner value is applied to the `onRight` function.
@@ -458,9 +458,9 @@ export declare const match: {
458
458
  * @category pattern matching
459
459
  * @since 2.0.0
460
460
  */
461
- <R, L, B, C = B>(self: Either<R, L>, options: {
462
- readonly onLeft: (left: L) => B;
463
- readonly onRight: (right: R) => C;
461
+ <A, E, B, C = B>(self: Either<A, E>, options: {
462
+ readonly onLeft: (left: E) => B;
463
+ readonly onRight: (right: A) => C;
464
464
  }): B | C;
465
465
  };
466
466
  /**
@@ -655,7 +655,7 @@ export declare const filterOrLeft: {
655
655
  * @since 2.0.0
656
656
  * @category filtering & conditionals
657
657
  */
658
- <R, B extends R, L2>(refinement: Refinement<NoInfer<R>, B>, orLeftWith: (right: NoInfer<R>) => L2): <L>(self: Either<R, L>) => Either<B, L2 | L>;
658
+ <A, B extends A, E2>(refinement: Refinement<NoInfer<A>, B>, orLeftWith: (right: NoInfer<A>) => E2): <E>(self: Either<A, E>) => Either<B, E2 | E>;
659
659
  /**
660
660
  * Filter the right value with the provided function.
661
661
  * If the predicate fails, set the left value with the result of the provided function.
@@ -686,7 +686,7 @@ export declare const filterOrLeft: {
686
686
  * @since 2.0.0
687
687
  * @category filtering & conditionals
688
688
  */
689
- <R, L2>(predicate: Predicate<NoInfer<R>>, orLeftWith: (right: NoInfer<R>) => L2): <L>(self: Either<R, L>) => Either<R, L2 | L>;
689
+ <A, E2>(predicate: Predicate<NoInfer<A>>, orLeftWith: (right: NoInfer<A>) => E2): <E>(self: Either<A, E>) => Either<A, E2 | E>;
690
690
  /**
691
691
  * Filter the right value with the provided function.
692
692
  * If the predicate fails, set the left value with the result of the provided function.
@@ -717,7 +717,7 @@ export declare const filterOrLeft: {
717
717
  * @since 2.0.0
718
718
  * @category filtering & conditionals
719
719
  */
720
- <R, L, B extends R, L2>(self: Either<R, L>, refinement: Refinement<R, B>, orLeftWith: (right: R) => L2): Either<B, L | L2>;
720
+ <A, E, B extends A, E2>(self: Either<A, E>, refinement: Refinement<A, B>, orLeftWith: (right: A) => E2): Either<B, E | E2>;
721
721
  /**
722
722
  * Filter the right value with the provided function.
723
723
  * If the predicate fails, set the left value with the result of the provided function.
@@ -748,13 +748,13 @@ export declare const filterOrLeft: {
748
748
  * @since 2.0.0
749
749
  * @category filtering & conditionals
750
750
  */
751
- <R, L, E2>(self: Either<R, L>, predicate: Predicate<R>, orLeftWith: (right: R) => E2): Either<R, L | E2>;
751
+ <A, E, E2>(self: Either<A, E>, predicate: Predicate<A>, orLeftWith: (right: A) => E2): Either<A, E | E2>;
752
752
  };
753
753
  /**
754
754
  * @category getters
755
755
  * @since 2.0.0
756
756
  */
757
- export declare const merge: <R, L>(self: Either<R, L>) => L | R;
757
+ export declare const merge: <A, E>(self: Either<A, E>) => E | A;
758
758
  /**
759
759
  * Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
760
760
  *
@@ -786,7 +786,7 @@ export declare const getOrElse: {
786
786
  * @category getters
787
787
  * @since 2.0.0
788
788
  */
789
- <L, R2>(onLeft: (left: L) => R2): <R>(self: Either<R, L>) => R2 | R;
789
+ <E, A2>(onLeft: (left: E) => A2): <A>(self: Either<A, E>) => A2 | A;
790
790
  /**
791
791
  * Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
792
792
  *
@@ -802,7 +802,7 @@ export declare const getOrElse: {
802
802
  * @category getters
803
803
  * @since 2.0.0
804
804
  */
805
- <R, L, R2>(self: Either<R, L>, onLeft: (left: L) => R2): R | R2;
805
+ <A, E, A2>(self: Either<A, E>, onLeft: (left: E) => A2): A | A2;
806
806
  };
807
807
  /**
808
808
  * @example
@@ -817,7 +817,7 @@ export declare const getOrElse: {
817
817
  * @category getters
818
818
  * @since 2.0.0
819
819
  */
820
- export declare const getOrNull: <R, L>(self: Either<R, L>) => R | null;
820
+ export declare const getOrNull: <A, E>(self: Either<A, E>) => A | null;
821
821
  /**
822
822
  * @example
823
823
  * ```ts
@@ -831,7 +831,7 @@ export declare const getOrNull: <R, L>(self: Either<R, L>) => R | null;
831
831
  * @category getters
832
832
  * @since 2.0.0
833
833
  */
834
- export declare const getOrUndefined: <R, L>(self: Either<R, L>) => R | undefined;
834
+ export declare const getOrUndefined: <A, E>(self: Either<A, E>) => A | undefined;
835
835
  /**
836
836
  * Extracts the value of an `Either` or throws if the `Either` is `Left`.
837
837
  *
@@ -873,7 +873,7 @@ export declare const getOrThrowWith: {
873
873
  * @category getters
874
874
  * @since 2.0.0
875
875
  */
876
- <L>(onLeft: (left: L) => unknown): <A>(self: Either<A, L>) => A;
876
+ <E>(onLeft: (left: E) => unknown): <A>(self: Either<A, E>) => A;
877
877
  /**
878
878
  * Extracts the value of an `Either` or throws if the `Either` is `Left`.
879
879
  *
@@ -894,7 +894,7 @@ export declare const getOrThrowWith: {
894
894
  * @category getters
895
895
  * @since 2.0.0
896
896
  */
897
- <R, L>(self: Either<R, L>, onLeft: (left: L) => unknown): R;
897
+ <A, E>(self: Either<A, E>, onLeft: (left: E) => unknown): A;
898
898
  };
899
899
  /**
900
900
  * Extracts the value of an `Either` or throws if the `Either` is `Left`.
@@ -915,7 +915,7 @@ export declare const getOrThrowWith: {
915
915
  * @category getters
916
916
  * @since 2.0.0
917
917
  */
918
- export declare const getOrThrow: <R, L>(self: Either<R, L>) => R;
918
+ export declare const getOrThrow: <A, E>(self: Either<A, E>) => A;
919
919
  /**
920
920
  * Returns `self` if it is a `Right` or `that` otherwise.
921
921
  *
@@ -929,14 +929,14 @@ export declare const orElse: {
929
929
  * @category error handling
930
930
  * @since 2.0.0
931
931
  */
932
- <L, R2, L2>(that: (left: L) => Either<R2, L2>): <R>(self: Either<R, L>) => Either<R | R2, L2>;
932
+ <E, A2, E2>(that: (left: E) => Either<A2, E2>): <A>(self: Either<A, E>) => Either<A | A2, E2>;
933
933
  /**
934
934
  * Returns `self` if it is a `Right` or `that` otherwise.
935
935
  *
936
936
  * @category error handling
937
937
  * @since 2.0.0
938
938
  */
939
- <R, L, R2, L2>(self: Either<R, L>, that: (left: L) => Either<R2, L2>): Either<R | R2, L2>;
939
+ <A, E, A2, E2>(self: Either<A, E>, that: (left: E) => Either<A2, E2>): Either<A | A2, E2>;
940
940
  };
941
941
  /**
942
942
  * @category sequencing
@@ -947,12 +947,12 @@ export declare const flatMap: {
947
947
  * @category sequencing
948
948
  * @since 2.0.0
949
949
  */
950
- <R, R2, L2>(f: (right: R) => Either<R2, L2>): <L>(self: Either<R, L>) => Either<R2, L | L2>;
950
+ <A, A2, E2>(f: (right: A) => Either<A2, E2>): <E>(self: Either<A, E>) => Either<A2, E | E2>;
951
951
  /**
952
952
  * @category sequencing
953
953
  * @since 2.0.0
954
954
  */
955
- <R, L, R2, L2>(self: Either<R, L>, f: (right: R) => Either<R2, L2>): Either<R2, L | L2>;
955
+ <A, E, A2, E2>(self: Either<A, E>, f: (right: A) => Either<A2, E2>): Either<A2, E | E2>;
956
956
  };
957
957
  /**
958
958
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
@@ -967,56 +967,56 @@ export declare const andThen: {
967
967
  * @category sequencing
968
968
  * @since 2.0.0
969
969
  */
970
- <R, R2, L2>(f: (right: R) => Either<R2, L2>): <L>(self: Either<R, L>) => Either<R2, L | L2>;
970
+ <A, A2, E2>(f: (right: A) => Either<A2, E2>): <E>(self: Either<A, E>) => Either<A2, E | E2>;
971
971
  /**
972
972
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
973
973
  *
974
974
  * @category sequencing
975
975
  * @since 2.0.0
976
976
  */
977
- <R2, L2>(f: Either<R2, L2>): <L, R1>(self: Either<R1, L>) => Either<R2, L | L2>;
977
+ <A2, E2>(f: Either<A2, E2>): <E, A>(self: Either<A, E>) => Either<A2, E | E2>;
978
978
  /**
979
979
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
980
980
  *
981
981
  * @category sequencing
982
982
  * @since 2.0.0
983
983
  */
984
- <R, R2>(f: (right: R) => R2): <L>(self: Either<R, L>) => Either<R2, L>;
984
+ <A, A2>(f: (right: A) => A2): <E>(self: Either<A, E>) => Either<A2, E>;
985
985
  /**
986
986
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
987
987
  *
988
988
  * @category sequencing
989
989
  * @since 2.0.0
990
990
  */
991
- <R2>(right: NotFunction<R2>): <R1, L>(self: Either<R1, L>) => Either<R2, L>;
991
+ <A2>(right: NotFunction<A2>): <A, E>(self: Either<A, E>) => Either<A2, E>;
992
992
  /**
993
993
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
994
994
  *
995
995
  * @category sequencing
996
996
  * @since 2.0.0
997
997
  */
998
- <R, L, R2, L2>(self: Either<R, L>, f: (right: R) => Either<R2, L2>): Either<R2, L | L2>;
998
+ <A, E, A2, E2>(self: Either<A, E>, f: (right: A) => Either<A2, E2>): Either<A2, E | E2>;
999
999
  /**
1000
1000
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
1001
1001
  *
1002
1002
  * @category sequencing
1003
1003
  * @since 2.0.0
1004
1004
  */
1005
- <R, L, R2, L2>(self: Either<R, L>, f: Either<R2, L2>): Either<R2, L | L2>;
1005
+ <A, E, A2, E2>(self: Either<A, E>, f: Either<A2, E2>): Either<A2, E | E2>;
1006
1006
  /**
1007
1007
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
1008
1008
  *
1009
1009
  * @category sequencing
1010
1010
  * @since 2.0.0
1011
1011
  */
1012
- <R, L, R2>(self: Either<R, L>, f: (right: R) => R2): Either<R2, L>;
1012
+ <A, E, A2>(self: Either<A, E>, f: (right: A) => A2): Either<A2, E>;
1013
1013
  /**
1014
1014
  * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
1015
1015
  *
1016
1016
  * @category sequencing
1017
1017
  * @since 2.0.0
1018
1018
  */
1019
- <R, L, R2>(self: Either<R, L>, f: NotFunction<R2>): Either<R2, L>;
1019
+ <A, E, A2>(self: Either<A, E>, f: NotFunction<A2>): Either<A2, E>;
1020
1020
  };
1021
1021
  /**
1022
1022
  * @category zipping
@@ -1027,12 +1027,12 @@ export declare const zipWith: {
1027
1027
  * @category zipping
1028
1028
  * @since 2.0.0
1029
1029
  */
1030
- <R2, L2, R, B>(that: Either<R2, L2>, f: (right: R, right2: R2) => B): <L>(self: Either<R, L>) => Either<B, L2 | L>;
1030
+ <A2, E2, A, B>(that: Either<A2, E2>, f: (right: A, right2: A2) => B): <E>(self: Either<A, E>) => Either<B, E2 | E>;
1031
1031
  /**
1032
1032
  * @category zipping
1033
1033
  * @since 2.0.0
1034
1034
  */
1035
- <R, L, R2, L2, B>(self: Either<R, L>, that: Either<R2, L2>, f: (right: R, right2: R2) => B): Either<B, L | L2>;
1035
+ <A, E, A2, E2, B>(self: Either<A, E>, that: Either<A2, E2>, f: (right: A, right2: A2) => B): Either<B, E | E2>;
1036
1036
  };
1037
1037
  /**
1038
1038
  * @category combining
@@ -1043,12 +1043,12 @@ export declare const ap: {
1043
1043
  * @category combining
1044
1044
  * @since 2.0.0
1045
1045
  */
1046
- <R, L2>(that: Either<R, L2>): <R2, L>(self: Either<(right: R) => R2, L>) => Either<R2, L | L2>;
1046
+ <A, E2>(that: Either<A, E2>): <A2, E>(self: Either<(right: A) => A2, E>) => Either<A2, E | E2>;
1047
1047
  /**
1048
1048
  * @category combining
1049
1049
  * @since 2.0.0
1050
1050
  */
1051
- <R, R2, L, L2>(self: Either<(right: R) => R2, L>, that: Either<R, L2>): Either<R2, L | L2>;
1051
+ <A, A2, E, E2>(self: Either<(right: A) => A2, E>, that: Either<A, E2>): Either<A2, E | E2>;
1052
1052
  };
1053
1053
  /**
1054
1054
  * Takes a structure of `Either`s and returns an `Either` of values with the same structure.
@@ -1071,10 +1071,10 @@ export declare const ap: {
1071
1071
  * @since 2.0.0
1072
1072
  */
1073
1073
  export declare const all: <const I extends Iterable<Either<any, any>> | Record<string, Either<any, any>>>(input: I) => [I] extends [ReadonlyArray<Either<any, any>>] ? Either<{
1074
- -readonly [K in keyof I]: [I[K]] extends [Either<infer R, any>] ? R : never;
1075
- }, I[number] extends never ? never : [I[number]] extends [Either<any, infer L>] ? L : never> : [I] extends [Iterable<Either<infer R, infer L>>] ? Either<Array<R>, L> : Either<{
1076
- -readonly [K in keyof I]: [I[K]] extends [Either<infer R, any>] ? R : never;
1077
- }, I[keyof I] extends never ? never : [I[keyof I]] extends [Either<any, infer L>] ? L : never>;
1074
+ -readonly [K in keyof I]: [I[K]] extends [Either<infer A, any>] ? A : never;
1075
+ }, I[number] extends never ? never : [I[number]] extends [Either<any, infer E>] ? E : never> : [I] extends [Iterable<Either<infer A, infer E>>] ? Either<Array<A>, E> : Either<{
1076
+ -readonly [K in keyof I]: [I[K]] extends [Either<infer A, any>] ? A : never;
1077
+ }, I[keyof I] extends never ? never : [I[keyof I]] extends [Either<any, infer E>] ? E : never>;
1078
1078
  /**
1079
1079
  * Returns an `Either` that swaps the error/success cases. This allows you to
1080
1080
  * use all methods on the error channel, possibly before flipping back.
@@ -1082,7 +1082,7 @@ export declare const all: <const I extends Iterable<Either<any, any>> | Record<s
1082
1082
  * @since 2.0.0
1083
1083
  * @category mapping
1084
1084
  */
1085
- export declare const flip: <R, L>(self: Either<R, L>) => Either<L, R>;
1085
+ export declare const flip: <A, E>(self: Either<A, E>) => Either<E, A>;
1086
1086
  /**
1087
1087
  * @category generators
1088
1088
  * @since 2.0.0
@@ -1183,9 +1183,9 @@ export declare const bind: {
1183
1183
  * @category do notation
1184
1184
  * @since 2.0.0
1185
1185
  */
1186
- <N extends string, A extends object, B, L2>(name: Exclude<N, keyof A>, f: (a: NoInfer<A>) => Either<B, L2>): <L1>(self: Either<A, L1>) => Either<{
1186
+ <N extends string, A extends object, B, E2>(name: Exclude<N, keyof A>, f: (a: NoInfer<A>) => Either<B, E2>): <E>(self: Either<A, E>) => Either<{
1187
1187
  [K in N | keyof A]: K extends keyof A ? A[K] : B;
1188
- }, L1 | L2>;
1188
+ }, E | E2>;
1189
1189
  /**
1190
1190
  * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
1191
1191
  *
@@ -1217,9 +1217,9 @@ export declare const bind: {
1217
1217
  * @category do notation
1218
1218
  * @since 2.0.0
1219
1219
  */
1220
- <A extends object, L1, N extends string, B, L2>(self: Either<A, L1>, name: Exclude<N, keyof A>, f: (a: NoInfer<A>) => Either<B, L2>): Either<{
1220
+ <A extends object, E, N extends string, B, E2>(self: Either<A, E>, name: Exclude<N, keyof A>, f: (a: NoInfer<A>) => Either<B, E2>): Either<{
1221
1221
  [K in N | keyof A]: K extends keyof A ? A[K] : B;
1222
- }, L1 | L2>;
1222
+ }, E | E2>;
1223
1223
  };
1224
1224
  /**
1225
1225
  * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
@@ -1284,9 +1284,9 @@ export declare const bindTo: {
1284
1284
  * @category do notation
1285
1285
  * @since 2.0.0
1286
1286
  */
1287
- <N extends string>(name: N): <R, L>(self: Either<R, L>) => Either<{
1288
- [K in N]: R;
1289
- }, L>;
1287
+ <N extends string>(name: N): <A, E>(self: Either<A, E>) => Either<{
1288
+ [K in N]: A;
1289
+ }, E>;
1290
1290
  /**
1291
1291
  * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
1292
1292
  *
@@ -1318,17 +1318,17 @@ export declare const bindTo: {
1318
1318
  * @category do notation
1319
1319
  * @since 2.0.0
1320
1320
  */
1321
- <R, L, N extends string>(self: Either<R, L>, name: N): Either<{
1322
- [K in N]: R;
1323
- }, L>;
1321
+ <A, E, N extends string>(self: Either<A, E>, name: N): Either<{
1322
+ [K in N]: A;
1323
+ }, E>;
1324
1324
  };
1325
1325
  declare const let_: {
1326
- <N extends string, R extends object, B>(name: Exclude<N, keyof R>, f: (r: NoInfer<R>) => B): <L>(self: Either<R, L>) => Either<{
1327
- [K in N | keyof R]: K extends keyof R ? R[K] : B;
1328
- }, L>;
1329
- <R extends object, L, N extends string, B>(self: Either<R, L>, name: Exclude<N, keyof R>, f: (r: NoInfer<R>) => B): Either<{
1330
- [K in N | keyof R]: K extends keyof R ? R[K] : B;
1331
- }, L>;
1326
+ <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (r: NoInfer<A>) => B): <E>(self: Either<A, E>) => Either<{
1327
+ [K in N | keyof A]: K extends keyof A ? A[K] : B;
1328
+ }, E>;
1329
+ <A extends object, E, N extends string, B>(self: Either<A, E>, name: Exclude<N, keyof A>, f: (r: NoInfer<A>) => B): Either<{
1330
+ [K in N | keyof A]: K extends keyof A ? A[K] : B;
1331
+ }, E>;
1332
1332
  };
1333
1333
  export {
1334
1334
  /**