You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 4, 2020. It is now read-only.
Both Map k and StrMap should be instances of Alt and Plus, with union and empty as the corresponding methods.
Also, something odd I've noticed: While Map k a has a Semigroup instance as long as Ord k, StrMap a seems to require a Semigroup a instance... which means if I have a type Foo with no Semigroup instance, I have a Monoid instance for Map String Foo but not StrMap Foo, which is... odd, to say the least.
The text was updated successfully, but these errors were encountered:
The Semigroup and Monoid instances for StrMap definitely look inconsistent with the ones for Map. Maybe they are the ones induced by the Applicative instance, but we should try to be consistent.
There's no Applicative instance either; not that this is a problem since Alt and Plus only require Functor. (There couldn't be an Applicative instance either, since there's no way to write pure :: v -> Map k v. I might be able to imagine an Apply instance given by zipping two maps together by the keys they have in common, but I'd have to think about it to make sure it's law-abiding.)
Both
Map k
andStrMap
should be instances ofAlt
andPlus
, withunion
andempty
as the corresponding methods.Also, something odd I've noticed: While
Map k a
has aSemigroup
instance as long asOrd k
,StrMap a
seems to require aSemigroup a
instance... which means if I have a typeFoo
with noSemigroup
instance, I have aMonoid
instance forMap String Foo
but notStrMap Foo
, which is... odd, to say the least.The text was updated successfully, but these errors were encountered: