Skip to content

Commit a025b12

Browse files
mikearnaldiIMax153
andcommittedFeb 21, 2024
Swap Either type params (#2102)
Co-authored-by: Maxwell Brown <maxwellbrown1990@gmail.com>
1 parent 7d9c3bf commit a025b12

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+510
-476
lines changed
 

‎.changeset/olive-pants-sparkle.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@effect/platform-node-shared": minor
3+
"@effect/typeclass": minor
4+
"effect": minor
5+
"@effect/schema": minor
6+
"@effect/cli": minor
7+
---
8+
9+
Swap type params of Either from `Either<E, A>` to `Either<R, L = never>`.
10+
11+
Along the same line of the other changes this allows to shorten the most common types such as:
12+
13+
```ts
14+
import { Either } from "effect";
15+
16+
const right: Either.Either<string> = Either.right("ok");
17+
```

‎packages/cli/src/Options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ export const orElse: {
419419
* @category combinators
420420
*/
421421
export const orElseEither: {
422-
<A>(that: Options<A>): <B>(self: Options<B>) => Options<Either<B, A>>
423-
<A, B>(self: Options<A>, that: Options<B>): Options<Either<B, A>>
422+
<A>(that: Options<A>): <B>(self: Options<B>) => Options<Either<A, B>>
423+
<A, B>(self: Options<A>, that: Options<B>): Options<Either<A, B>>
424424
} = InternalOptions.orElseEither
425425

426426
/**

0 commit comments

Comments
 (0)
Please sign in to comment.