ekmett / profunctors

Haskell 98 Profunctors
http://hackage.haskell.org/package/profunctors
Other
70 stars 43 forks source link

Ensure that Cayley and Tannen have instance parity #83

Closed RyanGlScott closed 4 years ago

RyanGlScott commented 4 years ago

Cayley:

https://github.com/ekmett/profunctors/blob/854e957b353da3a23c9150a865ec2083cc8cf462/src/Data/Profunctor/Cayley.hs#L27

is very similar to Tannen from the bifunctors library. As far as I can tell, the main differences between them are that Cayley lifts a Functor/Monad/Comonad into a ProfunctorFunctor/ProfunctorMonad/ProfunctorComonad, while Tannen lifts a Functor into a BifunctorFunctor/BifunctorMonad/BifunctorComonad. Aside from that, each type has a number of "pass-through" instances.

Curiously, Cayley and Tannen do not define the same pass-through instances, despite their similarities. I went through the code recently and tallied up the number of discrepancies:

instances that Cayley has but Tannen does not

instances that Tannen has but Cayley does not


Anything else I'm forgetting?

We should add these instances to the respective types for parity with each other.

ekmett commented 3 years ago

I've done a second generation of this pass in preparation for v6. Now that they are essentially identical, due to adopting the Functor superclass for profunctor, I'm considering removing Cayley outright, or just making it a type synonym.

RyanGlScott commented 3 years ago

Either of those sound fine to me. If you're going to break things, you might as well break them consistently :)