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
MonadError is invariant in E, which is problematic in turn because it means that catsSyntaxMonadErrorRethrow will not infer on Either[E, A] where E <: Throwable, which is vastly far and away the most common case. For example, if you have an expression that produces F[Either[RuntimeException, A]], you might reasonably expect that rethrow would be available syntax on such a value (at least, I did). It won't work though, and it's quite difficult to tease out why this is the case.
We can either make MonadError contravariant in E (which I believe would cause a cascade of problematic changes, so I don't recommend it), or we can loosen the constraints on catsSyntaxMonadErrorRethrow. Something like:
MonadError
is invariant inE
, which is problematic in turn because it means thatcatsSyntaxMonadErrorRethrow
will not infer onEither[E, A]
whereE <: Throwable
, which is vastly far and away the most common case. For example, if you have an expression that producesF[Either[RuntimeException, A]]
, you might reasonably expect thatrethrow
would be available syntax on such a value (at least, I did). It won't work though, and it's quite difficult to tease out why this is the case.We can either make
MonadError
contravariant inE
(which I believe would cause a cascade of problematic changes, so I don't recommend it), or we can loosen the constraints oncatsSyntaxMonadErrorRethrow
. Something like:Or the latter, which is likely to infer slightly better:
The text was updated successfully, but these errors were encountered: