You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Future-related type classes you get a misleading error: could not find implicit value for parameter instance.... It's as if it cannot find an instance of the given type class for Future in scope when it actually cannot just find an ExecutionContext. Example, with a REPL session, for Functor:
scala>importscala.concurrent.Futureimportscala.concurrent.Future
scala>importcats.Functorimportcats.Functor
scala>importcats.std.future._importcats.std.future._
scala>Functor[Future].map(Future.successful(42))(_ +1)
<console>:16:error: could not find implicit value for parameter instance: cats.Functor[scala.concurrent.Future]
Functor[Future].map(Future.successful(42))(_ +1)
^
but after importing the default ExecutionContext it works:
When using
Future
-related type classes you get a misleading error: could not find implicit value for parameter instance.... It's as if it cannot find an instance of the given type class forFuture
in scope when it actually cannot just find anExecutionContext
. Example, with a REPL session, forFunctor
:but after importing the default
ExecutionContext
it works:The text was updated successfully, but these errors were encountered: