From fa8364f6a09729ea1f7762e57e3ae1cdca136c60 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel <hvr@gnu.org> Date: Thu, 3 Mar 2016 23:27:10 +0100 Subject: [PATCH] Silence -Wredundant-constraints warnings In GHC 8.0 -Wall implies -Wredundant-constraints, so we have to address those warings in one way or another. --- cabal-install/Distribution/Client/ComponentDeps.hs | 2 +- cabal-install/Distribution/Client/FileMonitor.hs | 6 ++++-- cabal-install/Distribution/Client/RebuildMonad.hs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cabal-install/Distribution/Client/ComponentDeps.hs b/cabal-install/Distribution/Client/ComponentDeps.hs index 662c25482a..85451024c2 100644 --- a/cabal-install/Distribution/Client/ComponentDeps.hs +++ b/cabal-install/Distribution/Client/ComponentDeps.hs @@ -73,7 +73,7 @@ type ComponentDep a = (Component, a) newtype ComponentDeps a = ComponentDeps { unComponentDeps :: Map Component a } deriving (Show, Functor, Eq, Ord, Generic) -instance (Semigroup a, Monoid a) => Monoid (ComponentDeps a) where +instance Semigroup a => Monoid (ComponentDeps a) where mempty = ComponentDeps Map.empty mappend = (<>) diff --git a/cabal-install/Distribution/Client/FileMonitor.hs b/cabal-install/Distribution/Client/FileMonitor.hs index f30d7d4d14..affe9c70e5 100644 --- a/cabal-install/Distribution/Client/FileMonitor.hs +++ b/cabal-install/Distribution/Client/FileMonitor.hs @@ -451,11 +451,13 @@ probeFileSystem root (MonitorStateFileSet singlePaths globPaths) = <$> traverseWithKey (probeFileStatus root) singlePaths <*> traverse (probeGlobStatus root ".") globPaths -traverseWithKey :: (Applicative t, Eq k) - => (k -> a -> t b) -> Map k a -> t (Map k b) #if MIN_VERSION_containers(0,5,0) +traverseWithKey :: Applicative t + => (k -> a -> t b) -> Map k a -> t (Map k b) traverseWithKey = Map.traverseWithKey #else +traverseWithKey :: (Applicative t, Eq k) + => (k -> a -> t b) -> Map k a -> t (Map k b) traverseWithKey f = fmap Map.fromAscList . traverse (\(k, v) -> (,) k <$> f k v) . Map.toAscList diff --git a/cabal-install/Distribution/Client/RebuildMonad.hs b/cabal-install/Distribution/Client/RebuildMonad.hs index 6099795d04..cf0f44e864 100644 --- a/cabal-install/Distribution/Client/RebuildMonad.hs +++ b/cabal-install/Distribution/Client/RebuildMonad.hs @@ -74,7 +74,7 @@ runRebuild (Rebuild action) = evalStateT action [] -- -- Do not share 'FileMonitor's between different uses of 'rerunIfChanged'. -- -rerunIfChanged :: (Eq a, Binary a, Binary b) +rerunIfChanged :: (Binary a, Binary b) => Verbosity -> FilePath -> FileMonitor a b -- GitLab