-
Notifications
You must be signed in to change notification settings - Fork 14
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
Implement a new typeclass hierarchy #59
base: master
Are you sure you want to change the base?
Implement a new typeclass hierarchy #59
Conversation
This is good to review but not good to merge (tests do not compile, |
5e74922
to
560680f
Compare
560680f
to
a025611
Compare
The things that are easy to respond to immediately:
|
In fact, I'll do some separation and then get back to you. |
a025611
to
31be14b
Compare
I split this up a bit, merged some to |
No problem at all. What do you think we should do wrt operators? If you want to keep the old names on the non-
I think we want something that has a consistent visual language, and has some kind of "wings" we can drop off either side (analogues to (-?) :: SemiproductProfunctor p => p a b -> p () () -> p a b
(?-) :: SemiproductProfunctor p => p () () -> p a b -> p a b The Hoogle says nobody's really using operator names like Do you have any thoughts here? |
Oh sorry, I misread. I'm happy with the old operators going to new classes. I would like to keep any completely deleted symbols around as deprecated though (e.g. |
OK, I can fix that. How do you feel about them being moved out of the typeclass, or would you rather keep them as methods? |
31be14b
to
2a22126
Compare
This is nice, thanks!
Yes, keep them as methods for now. We can note that they are deprecated now, actually deprecate them later, and remove them even later. It's best to do this in stages. A couple of minor requests:
|
I suggest you rework the final commit as you wish and I'll have a look at it when you've got something you're happy with. |
And where it makes sense please split things into smaller commits. For example adding the instance for |
2a22126
to
f124392
Compare
f124392
to
42681d9
Compare
My take on the hierarchy hashed out at the end of the comment thread on #54. Given that breaking changes are necessary, this is fairly aggressive about breaking them to bring more consistency to the library. I am happy to walk things back if necessary.
Defines:
Profunctor => SemiproductProfunctor => ProductProfunctor
This operates on tuples, and gives the operations from the
Applicative(Apply) and Divisible(Divise) typeclasses.
Profunctor => SemisumProfunctor => SumProfunctor
This operates on Eithers, and gives the operations from the
Decidable (Decide/Conclude) typeclasses.
Breaking changes:
purePP
->pureP
for consistency with everything else.empty
->unitP
for consistency withvoidP
.(***!)
moved toSemiproductProfunctor
(+++!)
moved toSemisumProfunctor
Other changes:
Forget r
(***$)
only needs aProfunctor
constraint, some instances could use less strict classes, etc.)Open questions:
return
has hung around inMonad
). Should we do this?semigroupoids
? The 5.3.6 release added the contravariant hirerarchy, and theSemi
-classes are less useful if we still useApplicative
/Divisible
/Decidable
instances for this stuff.Remaining work:
makeAdaptorAndInstance
family of functions to createSemi...
instances. If this is the main source of instances downstream, breaking changes may not be so great (apart from intermediate libraries like opaleye).Closes #54