Skip to content

Commit

Permalink
Use Kleisli arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid authored and gcanti committed Apr 21, 2022
1 parent e818afb commit 98c6786
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/IOEither.ts
Expand Up @@ -269,7 +269,7 @@ export const orElseFirstW: <E1, E2, B>(
* @since 2.11.8
*/
export const orElseFirstIOK: <E, B>(onLeft: (e: E) => IO<B>) => <A>(ma: IOEither<E, A>) => IOEither<E, A> = (onLeft) =>
orElseFirst(flow(onLeft, rightIO))
orElseFirst(fromIOK(onLeft))

/**
* @category combinators
Expand Down
4 changes: 2 additions & 2 deletions src/TaskEither.ts
Expand Up @@ -362,15 +362,15 @@ export const orElseFirstW: <E1, E2, B>(
*/
export const orElseFirstIOK: <E, B>(onLeft: (e: E) => IO<B>) => <A>(ma: TaskEither<E, A>) => TaskEither<E, A> = (
onLeft
) => orElseFirst(flow(onLeft, rightIO))
) => orElseFirst(fromIOK(onLeft))

/**
* @category combinators
* @since 2.11.8
*/
export const orElseFirstTaskK: <E, B>(onLeft: (e: E) => Task<B>) => <A>(ma: TaskEither<E, A>) => TaskEither<E, A> = (
onLeft
) => orElseFirst(flow(onLeft, rightTask))
) => orElseFirst(fromTaskK(onLeft))

/**
* @category combinators
Expand Down

0 comments on commit 98c6786

Please sign in to comment.