diff --git a/Data/HashMap/Internal/Strict.hs b/Data/HashMap/Internal/Strict.hs index fbfa94c0..9ca93603 100644 --- a/Data/HashMap/Internal/Strict.hs +++ b/Data/HashMap/Internal/Strict.hs @@ -620,7 +620,7 @@ traverseWithKey f = go -- encountered, the combining function is applied to the values of these keys. -- If it returns 'Nothing', the element is discarded (proper set difference). If -- it returns (@'Just' y@), the element is updated with a new value @y@. -differenceWith :: Hashable k => (v -> w -> Maybe v) -> HashMap k v -> HashMap k w -> HashMap k v +differenceWith :: Eq k => (v -> w -> Maybe v) -> HashMap k v -> HashMap k w -> HashMap k v differenceWith f = HM.differenceWithKey $ \_k vA vB -> case f vA vB of Nothing -> Nothing diff --git a/Data/HashSet/Internal.hs b/Data/HashSet/Internal.hs index aa0e2fbf..ccaf971b 100644 --- a/Data/HashSet/Internal.hs +++ b/Data/HashSet/Internal.hs @@ -391,7 +391,7 @@ map f = fromList . List.map f . toList -- -- >>> HashSet.difference (HashSet.fromList [1,2,3]) (HashSet.fromList [2,3,4]) -- fromList [1] -difference :: Hashable a => HashSet a -> HashSet a -> HashSet a +difference :: Eq a => HashSet a -> HashSet a -> HashSet a difference (HashSet a) (HashSet b) = HashSet (H.difference a b) {-# INLINABLE difference #-}