-
-
Save tomatophobia/a621b9dc607a32a6037898351e96c685 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
| def translate[F[_]: Monad](app: Http[F]): Http[F] = for { | |
| resp <- app | |
| tx <- Kleisli.liftF(Translator[F](resp.body)) | |
| } yield resp.copy(body = tx) | |
| def hello(theUri: Uri): HttpRoutes = HttpRoutes.of { | |
| case Request(POST, uri, name) if uri == theUri => | |
| Future.successful(Response(OK, s"Hello, $name!")) | |
| } | |
| val es = translate(hello(Uri("/hola"))) | |
| // <console>:37: error: could not find implicit value for evidence parameter of type cats.Monad[OptionFuture] | |
| // val es = translate(hello(Uri("/hola"))) | |
| // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment