Let us say we have the code (<: Monad[F] doesn't work as expected):
class External[F[_] <: Monad[F] : Concurrent](implicit proxy: Proxy[F]) { ... }
class Proxy[F[_] <: Monad[F]](implicit storage: Storage, async: Async[F]) {
def get(key: String): F[Option[Entry]] = {
async.blocking(storage.get(key))
}
}
Run Code Online (Sandbox Code Playgroud)
I would like F[_] to be a Monad, so that proxy.get() have those traits and enables for example (inside External class):
proxy.get(key).flatMap(...)
Run Code Online (Sandbox Code Playgroud)
So far so good, but when trying to instantiate with cats.effect.IO it doesn't work …