There's a comment at the top of Data.Monoid.DecidablyEmpty which reads: -- TODO upstream somwhere else?
That "somewhere else" already exists: Data.Monoid.Null from monoid-subclasses.
I had a look at the instances it provides, and it is missing the following ones:
instance MonoidNull a => MonoidNull (Identity a)
instance MonoidNull a => MonoidNull (WrappedMonoid a)
instance (Ord a, Bounded a) => MonoidNull (Max a)
instance (Ord a, Bounded a) => MonoidNull (Min a)
instance MonoidNull (Proxy a)
instance MonoidNull a => MonoidNull (Const a b)
instance MonoidNull a => MonoidNull (Down a)
instance MonoidNull p => MonoidNull (Par 1 p)
instance MonoidNull (U1 p)
instance MonoidNull (f p) => MonoidNull (Rec1 f p)
instance MonoidNull (f p) => MonoidNull (M1 i c f p)
instance MonoidNull c => MonoidNull (K1 i c p)
instance (MonoidNull (f p), MonoidNull (g p)) => MonoidNull ((f :*: g) p)
instance (MonoidNull (f p), MonoidNull (g p)) => MonoidNull ((f :.: g) p)
instance (...) => MonoidNull (a, b, c, d, e)
-- Should go to dependent-map
instance GCompare k => MonoidNull (DMap k v)
This would solve #42 but is too much work to hold up GHC 9.2 support. Tasks, as I see them:
None of this seems particularly controversial. We might want monoid-subclasses anyway because of #37. It's quite a light package, so depending on it from dependent-map shouldn't be a problem either.
There's a comment at the top of
Data.Monoid.DecidablyEmptywhich reads:-- TODO upstream somwhere else?That "somewhere else" already exists:
Data.Monoid.Nullfrommonoid-subclasses.I had a look at the instances it provides, and it is missing the following ones:
This would solve #42 but is too much work to hold up GHC 9.2 support. Tasks, as I see them:
monoid-subclassesand releasedependent-mapand releaseData.Monoid.DecidablyEmpty.DecidablyEmptywith type alias, setisEmpty = Data.Monoid.Null.null, deprecate both, and releaseData.Monoid.DecidablyEmpty.None of this seems particularly controversial. We might want
monoid-subclassesanyway because of #37. It's quite a light package, so depending on it fromdependent-mapshouldn't be a problem either.