-
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
Use Group from elsewhere #4
Comments
Proliferation of Group classes has been a bugbear of mine for a while: cmk/magmas#1 I might have time to knock up a PR if |
That would be great! There is also https://github.com/reflex-frp/patch/blob/develop/src/Data/Monoid/DecidablyEmpty.hs which....I guess can stay here for now. |
|
Here is the mapping from
Thoughts? |
I'm not opposed to adding instances for types in I don't know what |
@Taneb Lines 45 to 46 in 25f202b
|
One thing I just noticed: |
CC: @3noch @Ericson2314 @maralorn who have been doing recent work on PR Taneb/groups#3 just landed, which adds operations to Lines 58 to 59 in 7551cf1
instance (Ord k, Group q) => Group (MonoidalMap k q) where
negateG = fmap negateG The laws of
You'll get all these extra keys mapping to I had PR Taneb/groups#2 sitting in WIP state for a while, because I couldn't justify introducing new superclasses of So, what to do here? I see a few options:
-- | Class of Abelian semigroups with a partial inverse for the Semigroup '<>' operation. The inverse operation '</>' must
-- satisfy the following laws:
--
-- > maybe a (b <>) (a </> b) == a
-- > maybe a (<> b) (a </> b) == a
--
-- The '</>' operator is a synonym for both 'stripPrefix' and 'stripSuffix', which must be equivalent as '<>' is both
-- associative and commutative.
--
-- > (</>) = flip stripPrefix
-- > (</>) = flip stripSuffix
class (Commutative m, LeftReductive m, RightReductive m) => Reductive m where
(</>) :: m -> m -> Maybe m
-- | Subclass of 'Reductive' where '</>' is a complete inverse of the Semigroup '<>' operation. The class
-- instances must satisfy the following additional laws:
--
-- > (a <> b) </> a == Just b
-- > (a <> b) </> b == Just a
class (LeftCancellative m, RightCancellative m, Reductive m) => Cancellative m This is probably enough machinery to support the Since I can't find many explicit uses of I think I like 4 > 2 > 3 > 1, but I'd need to know that it's actually usable where |
@endgame We don't like the
We can hopefully banish it from the whole ecosystem thereafter. |
This is a breaking change here, but need not be a breaking change for Reflex. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4 as far as this library is concerned, though work is still needed on the Reflex side when supported the new patch version to fix this issue for real.
This is a breaking change here, but need not be a breaking change for Reflex. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4 as far as this library is concerned, though work is still needed on the Reflex side when supported the new patch version to fix this issue for real.
I just woke up and haven't thought about this a whole lot recently, but I suspect that maps will be hard to banish, because they're such a useful idea. I do still want to explore using monoid-subclasses (at the very least, would replace
Until I get more time to think about this, not having a home-grown |
Yeah exactly, we "purifies" patch, and then "purify" reflex by successively pushing the bad instance further down the dependency graph until they aren't needed at all.
I should write about this more somewhere, but I want to make a It's a big yak-shave to get here, including needing haskell/containers#616 to be the |
I've seen a few "total map" packages on hackage, but none of them satisfied me. Looking forward to seeing another take on the idea. Bonus points if you can generalise over monoids (probably |
Yeah the thing I am thinking of is more like class HasNonNull a where
type NonNull a
newtype TotalMap k v = TotalMap (Map k (NonNull v)) Which is a rather more severe, breaking |
Oh I just noticed this. Yeah I think it would be better to be cautious and make the superclass match. Also I deleted |
TODO group's abelian should have Semigroup superclass. The MonoidalMap instance was deleted because it is not lawful. But it might need to be added to reflex. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4.
TODO group's abelian should have Semigroup superclass. The MonoidalMap instance was deleted because it is not lawful. But it might need to be added to reflex. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4.
TODO group's abelian should have Semigroup superclass. The MonoidalMap instance was deleted because it is not lawful. But it might need to be added to reflex. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4.
TODO group's abelian should have Semigroup superclass. The MonoidalMap instance was deleted because it is not lawful. But it might need to be added to reflex. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4.
Keep `Additive`, however. See ChangeLog for more details. The version in the cabal file is bumped to remind whoever does the future release that this is breaking change. Closes #4.
We should find an existing library for this
The text was updated successfully, but these errors were encountered: