@@ -1582,22 +1582,22 @@ submapBitmapIndexed comp !b1 !ary1 !b2 !ary2 = subsetBitmaps && go 0 0 (b1Orb2 .
1582
1582
--
1583
1583
-- >>> union (fromList [(1,'a'),(2,'b')]) (fromList [(2,'c'),(3,'d')])
1584
1584
-- fromList [(1,'a'),(2,'b'),(3,'d')]
1585
- union :: ( Eq k , Hashable k ) => HashMap k v -> HashMap k v -> HashMap k v
1585
+ union :: Eq k => HashMap k v -> HashMap k v -> HashMap k v
1586
1586
union = unionWith const
1587
1587
{-# INLINABLE union #-}
1588
1588
1589
1589
-- | \(O(n+m)\) The union of two maps. If a key occurs in both maps,
1590
1590
-- the provided function (first argument) will be used to compute the
1591
1591
-- result.
1592
- unionWith :: ( Eq k , Hashable k ) => (v -> v -> v ) -> HashMap k v -> HashMap k v
1592
+ unionWith :: Eq k => (v -> v -> v ) -> HashMap k v -> HashMap k v
1593
1593
-> HashMap k v
1594
1594
unionWith f = unionWithKey (const f)
1595
1595
{-# INLINE unionWith #-}
1596
1596
1597
1597
-- | \(O(n+m)\) The union of two maps. If a key occurs in both maps,
1598
1598
-- the provided function (first argument) will be used to compute the
1599
1599
-- result.
1600
- unionWithKey :: ( Eq k , Hashable k ) => (k -> v -> v -> v ) -> HashMap k v -> HashMap k v
1600
+ unionWithKey :: Eq k => (k -> v -> v -> v ) -> HashMap k v -> HashMap k v
1601
1601
-> HashMap k v
1602
1602
unionWithKey f = go 0
1603
1603
where
@@ -1718,7 +1718,7 @@ unionArrayBy f !b1 !b2 !ary1 !ary2 = A.run $ do
1718
1718
-- TODO: Figure out the time complexity of 'unions'.
1719
1719
1720
1720
-- | Construct a set containing all elements from a list of sets.
1721
- unions :: ( Eq k , Hashable k ) => [HashMap k v ] -> HashMap k v
1721
+ unions :: Eq k => [HashMap k v ] -> HashMap k v
1722
1722
unions = List. foldl' union empty
1723
1723
{-# INLINE unions #-}
1724
1724
@@ -1833,21 +1833,21 @@ differenceWith f a b = foldlWithKey' go empty a
1833
1833
1834
1834
-- | \(O(n \log m)\) Intersection of two maps. Return elements of the first
1835
1835
-- map for keys existing in the second.
1836
- intersection :: ( Eq k , Hashable k ) => HashMap k v -> HashMap k w -> HashMap k v
1836
+ intersection :: Eq k => HashMap k v -> HashMap k w -> HashMap k v
1837
1837
intersection = Exts. inline intersectionWith const
1838
1838
{-# INLINABLE intersection #-}
1839
1839
1840
1840
-- | \(O(n \log m)\) Intersection of two maps. If a key occurs in both maps
1841
1841
-- the provided function is used to combine the values from the two
1842
1842
-- maps.
1843
- intersectionWith :: ( Eq k , Hashable k ) => (v1 -> v2 -> v3 ) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
1843
+ intersectionWith :: Eq k => (v1 -> v2 -> v3 ) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
1844
1844
intersectionWith f = Exts. inline intersectionWithKey $ const f
1845
1845
{-# INLINABLE intersectionWith #-}
1846
1846
1847
1847
-- | \(O(n \log m)\) Intersection of two maps. If a key occurs in both maps
1848
1848
-- the provided function is used to combine the values from the two
1849
1849
-- maps.
1850
- intersectionWithKey :: ( Eq k , Hashable k ) => (k -> v1 -> v2 -> v3 ) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
1850
+ intersectionWithKey :: Eq k => (k -> v1 -> v2 -> v3 ) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
1851
1851
intersectionWithKey f = intersectionWithKey# $ \ k v1 v2 -> (# f k v1 v2 # )
1852
1852
{-# INLINABLE intersectionWithKey #-}
1853
1853
0 commit comments