scalaz-plugin
scalaz-plugin copied to clipboard
Make mixins component a little bit smarter
Consider this case:
implicit def contravariant1[F[_]: Contravariant, G[_]: Functor]: Contravariant[[x] F[G[x]]]
implicit def contravariant2[F[_]: Functor, G[_]: Contravariant]: Contravariant[[x] F[G[x]]]
implicit def divisible1[F[_]: Divisible, G[_]: Applicative]: Divisible[[x] F[G[x]]]
implicit def divisible2[F[_]: Applicative, G[_]: Divisible]: Divisible[[x] F[G[x]]]
(not sure about the divisible instances, but the point stands)
Meh, determining that both of these instances will be the same at runtime seems... complicated, to me. Maybe we need a free theorem checker to figure out that Functor + Contravariant = Phantom ;)
For now, @unmixin on the first of each pair of instances should be fine IMO.