-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Removing MonoidK and SemigroupK #1932
Comments
Link to discussion over newtypes: #1800 |
Blocked by #1800 |
When we do remove these, maybe we could add a type class, that offers alternative |
I don't think that makes sense myself, and actually I think after consideration that Parallel doesn't really either. Especially given that we're considering ZipList to be a "parallel" List monad; what we need is a type class for canonical higher-kinded isomorphisms. Newtyping is the best way to do this sort of thing because type class instances should be composable, and bundling instances together in super-instances prevents composition of those smaller instances. |
So this typeclass would provide In #1928, we have a practical example of deriving a |
There is something interesting when you can make a Now, generally, I agree, you do just want the monoid. I don't know that I have ever wanted a I'm generally very +1 on only adding abstractions that pay their own way. We should have clear functions we want to write with these things that apply to several cases. That said, I'm also hesitant to remove things once added (which I guess I am saying I am generally conservative when it comes to changes). |
This depends on newtypes; without newtypes, we can't really do this.
As far as I can see, no evidence has been presented that MonoidK and SemigroupK are useful abstractions. So far, all they exist to do is disambiguate instances of monoid and semigroup, which is the job of newtypes, and they do a worse job because they don't compose with ordinary monoids and semigroups; there is no implicit product of a Monoid with a MonoidK.
Edit: They also don't disambiguate instances well. There's two valid MonoidK's for Option, for example.
The text was updated successfully, but these errors were encountered: