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
(Intersection a) <> (Intersection b) =Intersection$ intersection a b
stimes = stimesIdempotent
but they were never exported from Data.Set.
We should export them, but there is an opportunity for improvement today. base-4.18 got Foldable1, so we could change intersections to be (Ord a, Foldable1 f) => f (Set a) -> Set a.
And whatever we do for Set we should also do for IntSet.
The text was updated successfully, but these errors were encountered:
Ah, there's something to be considered about IntSet. Unlike Set, we can have a monoid because mempty is well defined here (fromList [minBound..maxBound]). But this set cannot be constructed in practice because it is too large. So I think we should not have the instance, though technically it could be defined correctly.
If we end up implementing #999 it will be practical to construct this set and we can revise this decision.
Unlike Set
But this set cannot be constructed in practice because it is too large.
I mean, isn't this the same issue with the Set monoid for intersections?
One could have instance (Finite a, Ord a) => Monoid (Set a) and the same "small enough" concern applies.
#756 added these two definitions
containers/containers/src/Data/Set/Internal.hs
Lines 897 to 911 in 028e187
but they were never exported from
Data.Set
.We should export them, but there is an opportunity for improvement today.
base-4.18
gotFoldable1
, so we could changeintersections
to be(Ord a, Foldable1 f) => f (Set a) -> Set a
.And whatever we do for Set we should also do for IntSet.
The text was updated successfully, but these errors were encountered: