scalaz-plugin icon indicating copy to clipboard operation
scalaz-plugin copied to clipboard

Make mixins component a little bit smarter

Open sir-wabbit opened this issue 7 years ago • 1 comments

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)

sir-wabbit avatar Sep 22 '18 21:09 sir-wabbit

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.

edmundnoble avatar Oct 04 '18 13:10 edmundnoble