From 911a6ca157a1851f0cc3d2dafe2ff1177e71e686 Mon Sep 17 00:00:00 2001 From: Mann mit Hut Date: Sun, 2 Feb 2025 16:49:29 +0100 Subject: [PATCH 1/3] Relax upper bounds of dependencies to allow base-4.21.0.0 and ghc-9.12.1 --- weeder.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weeder.cabal b/weeder.cabal index 3dadc13..038f139 100644 --- a/weeder.cabal +++ b/weeder.cabal @@ -24,13 +24,13 @@ library build-depends: , algebraic-graphs ^>= 0.7 , async ^>= 2.2.0 - , base ^>= 4.17.0.0 || ^>= 4.18.0.0 || ^>= 4.19.0.0 || ^>= 4.20.0.0 + , base ^>= 4.17.0.0 || ^>= 4.18.0.0 || ^>= 4.19.0.0 || ^>= 4.20.0.0 || ^>= 4.21.0.0 , bytestring ^>= 0.10.9.0 || ^>= 0.11.0.0 || ^>= 0.12.0.2 , containers ^>= 0.6.2.1 || ^>= 0.7 , directory ^>= 1.3.3.2 , filepath ^>= 1.4.2.1 || ^>= 1.5 , generic-lens ^>= 2.2.0.0 - , ghc ^>= 9.4 || ^>= 9.6 || ^>= 9.8 || ^>= 9.10 + , ghc ^>= 9.4 || ^>= 9.6 || ^>= 9.8 || ^>= 9.10 || ^>=9.12 , Glob ^>= 0.9 || ^>= 0.10 , lens ^>= 5.1 || ^>= 5.2 || ^>= 5.3 , mtl ^>= 2.2.2 || ^>= 2.3 From acc8f474a39d4a63bfeae9f1bef0947d385e26bf Mon Sep 17 00:00:00 2001 From: Mann mit Hut Date: Sun, 2 Feb 2025 16:57:27 +0100 Subject: [PATCH 2/3] Qualified usage of liftA2 and foldl' to get rid of unused-import warnings --- src/Weeder/Run.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Weeder/Run.hs b/src/Weeder/Run.hs index 58bfcae..9ce4f36 100644 --- a/src/Weeder/Run.hs +++ b/src/Weeder/Run.hs @@ -81,7 +81,7 @@ runWeeder weederConfig@Config{ rootPatterns, typeClassRoots, rootInstances, root else analyseEvidenceUses rf analysis1 = - foldl' mappend mempty analyses + Data.Foldable.foldl' mappend mempty analyses -- Evaluating 'analysis1' first allows us to begin analysis -- while hieFiles is still being read (since rf depends on all hie files) @@ -129,7 +129,7 @@ runWeeder weederConfig@Config{ rootPatterns, typeClassRoots, rootInstances, root starts <- Map.lookup d ( declarationSites analysis ) let locs = (,) packageName <$> Set.toList starts guard $ not $ null starts - return [ Map.singleton moduleFilePath ( liftA2 (,) locs (pure d) ) ] + return [ Map.singleton moduleFilePath ( Control.Applicative.liftA2 (,) locs (pure d) ) ] ) dead From 5fce32fcdbac3b27ddfe56a931974c874b0512f8 Mon Sep 17 00:00:00 2001 From: Mann mit Hut Date: Sun, 2 Feb 2025 17:59:05 +0100 Subject: [PATCH 3/3] Use Data.List.uncons to silence x-partial warnings --- src/Weeder/Main.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Weeder/Main.hs b/src/Weeder/Main.hs index 0620128..f8e1873 100644 --- a/src/Weeder/Main.hs +++ b/src/Weeder/Main.hs @@ -240,7 +240,10 @@ mainWithConfig hieExt hieDirectories requireHsFiles weederConfig = handleWeederE getHieFiles :: String -> [FilePath] -> Bool -> IO [HieFile] getHieFiles hieExt hieDirectories requireHsFiles = do let hiePat = "**/*." <> hieExtNoSep - hieExtNoSep = if isExtSeparator (head hieExt) then tail hieExt else hieExt + hieExtNoSep = case uncons hieExt of + Just (c0, hieExtNoSep') + | isExtSeparator c0 -> hieExtNoSep' + _ -> hieExt hieFilePaths :: [FilePath] <- concat <$>