Last active
April 4, 2022 08:22
-
-
Save AlexBaitov/2e3bac7d43a1581fce7313fd6ea2a2e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/scala/bug/issues/5589 | |
| implicit class FilterableRight[E, T](x: Either.RightProjection[E, T]) { | |
| def withFilter(p: T => Boolean): Either.RightProjection[E, T] = x | |
| } | |
| implicit class FilterableEither[E, T](x: Either[E, T]) { | |
| def withFilter(p: T => Boolean): Either[E, T] = x | |
| } | |
| implicit class FilterableEitherT[F[_], A, B](x: EitherT[F,A,B]) { | |
| def withFilter(p: B => Boolean): EitherT[F, A, B] = x | |
| def filter(p: B => Boolean): EitherT[F, A, B] = x | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment