Skip to content

Instantly share code, notes, and snippets.

@kailuowang
Created December 5, 2015 22:34
Show Gist options
  • Save kailuowang/179a8bb0ca22621af96d to your computer and use it in GitHub Desktop.
Save kailuowang/179a8bb0ca22621af96d to your computer and use it in GitHub Desktop.
object overloaded extends Overload {
implicit def futureT[T] =
Case((t: Future[T]) => t.map(Right(_))
implicit def futureOptT[T, U](implicit ev: U <:< Option[T]) =
Case((t: Future[U]) => t.map(Right(_.get)).getOrElse(Left(NotFoundException))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment