Skip to content

Commit

Permalink
relax Bifunctor2C to Bifunctor2 in TaskEither.getTaskValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Feb 27, 2020
1 parent 80baf40 commit 52ce154
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ high state of flux, you're at risk of it changing without notice.
- relax `Bifunctor2C` to `Bifunctor2` in `getIOValidation` (@gcanti)
- `ReaderEither`
- relax `Bifunctor3C` to `Bifunctor3` in `getReaderValidation` (@gcanti)
- `ReaderTaskEither`
- relax `Bifunctor3C` to `Bifunctor3` in `getReaderTaskValidation` (@gcanti)
- `TaskEither`
- relax `Bifunctor2C` to `Bifunctor2` in `getTaskValidation` (@gcanti)

# 2.5.1

Expand Down
10 changes: 3 additions & 7 deletions src/ReaderTaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 2.0.0
*/
import { Alt3, Alt3C } from './Alt'
import { Bifunctor3, Bifunctor3C } from './Bifunctor'
import { Bifunctor3 } from './Bifunctor'
import { Either } from './Either'
import { IO } from './IO'
import { IOEither } from './IOEither'
Expand Down Expand Up @@ -248,16 +248,12 @@ export function bracket<R, E, A, B>(
*/
export function getReaderTaskValidation<E>(
S: Semigroup<E>
): Monad3C<URI, E> & Bifunctor3C<URI, E> & Alt3C<URI, E> & MonadTask3C<URI, E> & MonadThrow3C<URI, E> {
): Monad3C<URI, E> & Bifunctor3<URI> & Alt3C<URI, E> & MonadTask3C<URI, E> & MonadThrow3C<URI, E> {
const T = getValidationM(S, readerTask)
return {
URI,
_E: undefined as any,
fromIO: readerTaskEither.fromIO,
fromTask: readerTaskEither.fromTask,
throwError: readerTaskEither.throwError,
bimap: (ma, f, g) => e => TE.taskEither.bimap(ma(e), f, g),
mapLeft: (ma, f) => e => TE.taskEither.mapLeft(ma(e), f),
...readerTaskEither,
...T
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/TaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @since 2.0.0
*/
import { Alt2, Alt2C } from './Alt'
import { Bifunctor2, Bifunctor2C } from './Bifunctor'
import { Bifunctor2 } from './Bifunctor'
import * as E from './Either'
import { getEitherM } from './EitherT'
import { Filterable2C, getFilterableComposition } from './Filterable'
Expand Down Expand Up @@ -239,16 +239,12 @@ export function taskify<L, R>(f: Function): () => TaskEither<L, R> {
*/
export function getTaskValidation<E>(
S: Semigroup<E>
): Monad2C<URI, E> & Bifunctor2C<URI, E> & Alt2C<URI, E> & MonadTask2C<URI, E> & MonadThrow2C<URI, E> {
): Monad2C<URI, E> & Bifunctor2<URI> & Alt2C<URI, E> & MonadTask2C<URI, E> & MonadThrow2C<URI, E> {
const T = getValidationM(S, task)
return {
URI,
_E: undefined as any,
throwError: taskEither.throwError,
bimap: taskEither.bimap,
mapLeft: taskEither.mapLeft,
fromIO: taskEither.fromIO,
fromTask: taskEither.fromTask,
...taskEither,
...T
}
}
Expand Down

0 comments on commit 52ce154

Please sign in to comment.