Skip to content

Commit

Permalink
fix altW function signature in all Either modules
Browse files Browse the repository at this point in the history
  • Loading branch information
wmaurer authored and gcanti committed Apr 20, 2021
1 parent cc9c548 commit 9e88b32
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/modules/Either.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Less strict version of [`alt`](#alt).
**Signature**
```ts
export declare const altW: <E2, B>(that: Lazy<Either<E2, B>>) => <E1, A>(fa: Either<E1, A>) => Either<E2 | E1, B | A>
export declare const altW: <E2, B>(that: Lazy<Either<E2, B>>) => <E1, A>(fa: Either<E1, A>) => Either<E2, B | A>
```
Added in v2.9.0
Expand Down
4 changes: 1 addition & 3 deletions docs/modules/IOEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ Less strict version of [`alt`](#alt).
**Signature**
```ts
export declare const altW: <E2, B>(
that: Lazy<IOEither<E2, B>>
) => <E1, A>(fa: IOEither<E1, A>) => IOEither<E2 | E1, B | A>
export declare const altW: <E2, B>(that: Lazy<IOEither<E2, B>>) => <E1, A>(fa: IOEither<E1, A>) => IOEither<E2, B | A>
```
Added in v2.9.0
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReaderEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Less strict version of [`alt`](#alt).
```ts
export declare const altW: <R2, E2, B>(
that: () => ReaderEither<R2, E2, B>
) => <R1, E1, A>(fa: ReaderEither<R1, E1, A>) => ReaderEither<R1 & R2, E2 | E1, B | A>
) => <R1, E1, A>(fa: ReaderEither<R1, E1, A>) => ReaderEither<R1 & R2, E2, B | A>
```
Added in v2.9.0
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Less strict version of [`alt`](#alt).
```ts
export declare const altW: <R2, E2, B>(
that: () => ReaderTaskEither<R2, E2, B>
) => <R1, E1, A>(fa: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, B | A>
) => <R1, E1, A>(fa: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2, B | A>
```
Added in v2.9.0
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/StateReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Less strict version of [`alt`](#alt).
```ts
export declare const altW: <S, R2, E2, B>(
that: () => StateReaderTaskEither<S, R2, E2, B>
) => <R1, E1, A>(fa: StateReaderTaskEither<S, R1, E1, A>) => StateReaderTaskEither<S, R1 & R2, E2 | E1, B | A>
) => <R1, E1, A>(fa: StateReaderTaskEither<S, R1, E1, A>) => StateReaderTaskEither<S, R1 & R2, E2, B | A>
```
Added in v2.9.0
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/TaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Less strict version of [`alt`](#alt).
```ts
export declare const altW: <E2, B>(
that: Lazy<TaskEither<E2, B>>
) => <E1, A>(fa: TaskEither<E1, A>) => TaskEither<E2 | E1, B | A>
) => <E1, A>(fa: TaskEither<E1, A>) => TaskEither<E2, B | A>
```
Added in v2.9.0
Expand Down
6 changes: 3 additions & 3 deletions src/Either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ export const flatten: <E, A>(mma: Either<E, Either<E, A>>) => Either<E, A> =
* @category Alt
* @since 2.9.0
*/
export const altW: <E2, B>(that: Lazy<Either<E2, B>>) => <E1, A>(fa: Either<E1, A>) => Either<E1 | E2, A | B> = (
that
) => (fa) => (isLeft(fa) ? that() : fa)
export const altW: <E2, B>(that: Lazy<Either<E2, B>>) => <E1, A>(fa: Either<E1, A>) => Either<E2, A | B> = (that) => (
fa
) => (isLeft(fa) ? that() : fa)

/**
* Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to
Expand Down
2 changes: 1 addition & 1 deletion src/IOEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export const alt: <E, A>(that: Lazy<IOEither<E, A>>) => (fa: IOEither<E, A>) =>
*/
export const altW: <E2, B>(
that: Lazy<IOEither<E2, B>>
) => <E1, A>(fa: IOEither<E1, A>) => IOEither<E1 | E2, A | B> = alt as any
) => <E1, A>(fa: IOEither<E1, A>) => IOEither<E2, A | B> = alt as any

/**
* @category MonadThrow
Expand Down
2 changes: 1 addition & 1 deletion src/ReaderEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export const alt: <R, E, A>(that: () => ReaderEither<R, E, A>) => (fa: ReaderEit
*/
export const altW: <R2, E2, B>(
that: () => ReaderEither<R2, E2, B>
) => <R1, E1, A>(fa: ReaderEither<R1, E1, A>) => ReaderEither<R1 & R2, E1 | E2, A | B> = alt as any
) => <R1, E1, A>(fa: ReaderEither<R1, E1, A>) => ReaderEither<R1 & R2, E2, A | B> = alt as any

/**
* @category MonadThrow
Expand Down
2 changes: 1 addition & 1 deletion src/ReaderTaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ export const alt: <R, E, A>(
*/
export const altW: <R2, E2, B>(
that: () => ReaderTaskEither<R2, E2, B>
) => <R1, E1, A>(fa: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E1 | E2, A | B> = alt as any
) => <R1, E1, A>(fa: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2, A | B> = alt as any

/**
* @category MonadThrow
Expand Down
2 changes: 1 addition & 1 deletion src/StateReaderTaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export const flatten: <S, R, E, A>(
*/
export const altW = <S, R2, E2, B>(that: () => StateReaderTaskEither<S, R2, E2, B>) => <R1, E1, A>(
fa: StateReaderTaskEither<S, R1, E1, A>
): StateReaderTaskEither<S, R1 & R2, E1 | E2, A | B> => (r) =>
): StateReaderTaskEither<S, R1 & R2, E2, A | B> => (r) =>
pipe(
fa(r),
RTE.altW(() => that()(r))
Expand Down
2 changes: 1 addition & 1 deletion src/TaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export const alt: <E, A>(that: Lazy<TaskEither<E, A>>) => (fa: TaskEither<E, A>)
*/
export const altW: <E2, B>(
that: Lazy<TaskEither<E2, B>>
) => <E1, A>(fa: TaskEither<E1, A>) => TaskEither<E1 | E2, A | B> = alt as any
) => <E1, A>(fa: TaskEither<E1, A>) => TaskEither<E2, A | B> = alt as any

/**
* @category Pointed
Expand Down

0 comments on commit 9e88b32

Please sign in to comment.