Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AlexBaitov/2e3bac7d43a1581fce7313fd6ea2a2e1 to your computer and use it in GitHub Desktop.

Select an option

Save AlexBaitov/2e3bac7d43a1581fce7313fd6ea2a2e1 to your computer and use it in GitHub Desktop.
// 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