-
Notifications
You must be signed in to change notification settings - Fork 6
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
Abelian could merely require Semigroup #7
Comments
I think that if this change is made, the |
What about deprecating in favour of https://hackage.haskell.org/package/monoid-subclasses-1.0.1/docs/Data-Semigroup-Cancellative.html#t:Commutative ? |
I'd rather not do that either: To me, there's two possibilities that would be better than the status quo for |
It's not quite true that you get an For a more fine-grained algebraic hierarchy, I suggest you look into |
I missed this at first too, but that's a plain commutative semigroup class that just happens to be in a module called
I assume you meant "wouldn't"? So to be clear, I absolutely think that there is value distinguishing a "small, light, useful" hierarchy from the "zomg every algebra ever" hierarchy. But I was thinking class Semigroup m => Abelian m or class Semigroup m => Additive m
type Abelian m = (Group m, Additive m) is sort of a finer-grained hierarchy "for free", since their a no net increase in classes or dependencies. Still, what I can do is keep |
@Taneb to make this a bit more concrete, we today use https://github.com/reflex-frp/patch/blob/develop/src/Data/Semigroup/Additive.hs . This module certainly doesn't belong in |
|
@emilypi that is still with the |
@cgibbard should be able to confirm, but I think our We do stuff with communitive groups, and with mere communitive semigroups. We simply want to be able to share the "communitive" part between both parts so we aren't stuck writing instances two separate methodless type classes. |
The other problem is that
I can't find any code in
|
Yeah we might want to end up depending on Trying to both deduplicate and respect people's wishes not to be "pushed" into far finer-grained hierarchies. |
Also I didn't know we had that sort of unlawfulness, I won't advocate foisting that on others! |
Some kind of tiny I suspect that most of the time the patchy things can be written against an
|
@endgame I am not sure whether we "use" commutativity at all. I think we just wanted to avoid having separate |
@Taneb are you comfortable doing e.g. import Data.Semigroup.<NameTBD> -- from other tiny package with just that
class (Group a, <NameTBD> a) => Abelian
instance (Group a, <NameTBD> a) => Abelian ? I would like to know to decide whether it is worth factoring out that module from |
Yeah, it's just to indicate commutativity of a semigroup. |
We absolutely rely on commutativity: you don't want the view selector in your frontend to rely on the order in which the watches are done! (Also, the optimisation we do to aggregate the view selectors wouldn't work without commutativity: rather than appending all the individual selectors, and having to re-append them constantly whenever any leaf changes, we compute local deltas and apply them to the aggregate, which implicitly commutes everything past everything else.) |
I think I would be |
Great, thank you! |
@cgibbard @Ericson2314
|
@Taneb I have made https://github.com/obsidiansystems/commutative-semigroups by forking this repo and giving you attribution. It doesn't have any |
I figure the root problem is the lawless instance in |
Right now it requires
Group
.Thanks to @endgame for fixing most of the incompatabilities between this package's
Group
and reflex-frp's patch library's in #3. I think this is the one that remains.The text was updated successfully, but these errors were encountered: