-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require Functor over Bifunctor where possible #125
base: main
Are you sure you want to change the base?
Conversation
Rebased onto 5.15: https://gist.github.com/expipiplus1/bdc5750447d979583702ce5d44592572 |
Thank you for the patient review, @RyanGlScott! Still to fix is the instance context generation, as it still wants to generate For example this, although data Baz f g a b where
Baz1 :: f a b -> Baz f g a b
Baz2 :: g Int b -> Baz f g a b
deriveBifunctor ''Baz An alternative would be to not change this context generation heuristic and simply use the old behavior of requiring a For now I've fallen back to requiring |
Fixes ekmett#124 Note that this does add a Functor requirement where none was required before
Another alternative would be to allow configuring this behavior via |
… application fields
Ugh, I completely forgot about instance context generation. I'll be the first person to admit that the way This is all to say: I'm not terribly bothered by the fact that What does bother me a bit is the fact that these two instances: data Scooby1 f a b = Scooby1 (f Int a)
data Scooby2 a b = Scooby2 (Either Int a) Will interact quite differently with To summarize, I'd prefer using |
Fixes #124
Note that this does add a Functor requirement where none was required
before