Skip to content

Commit 78f964b

Browse files
authored
Support for GHC 9.12.1 (#191)
* Relax upper bounds of dependencies to allow base-4.21.0.0 and ghc-9.12.1 * Qualified usage of liftA2 and foldl' to get rid of unused-import warnings * Use Data.List.uncons to silence x-partial warnings
1 parent 176869a commit 78f964b

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/Weeder/Main.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ mainWithConfig hieExt hieDirectories requireHsFiles weederConfig = handleWeederE
240240
getHieFiles :: String -> [FilePath] -> Bool -> IO [HieFile]
241241
getHieFiles hieExt hieDirectories requireHsFiles = do
242242
let hiePat = "**/*." <> hieExtNoSep
243-
hieExtNoSep = if isExtSeparator (head hieExt) then tail hieExt else hieExt
243+
hieExtNoSep = case uncons hieExt of
244+
Just (c0, hieExtNoSep')
245+
| isExtSeparator c0 -> hieExtNoSep'
246+
_ -> hieExt
244247

245248
hieFilePaths :: [FilePath] <-
246249
concat <$>

src/Weeder/Run.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ runWeeder weederConfig@Config{ rootPatterns, typeClassRoots, rootInstances, root
8181
else analyseEvidenceUses rf
8282

8383
analysis1 =
84-
foldl' mappend mempty analyses
84+
Data.Foldable.foldl' mappend mempty analyses
8585

8686
-- Evaluating 'analysis1' first allows us to begin analysis
8787
-- while hieFiles is still being read (since rf depends on all hie files)
@@ -129,7 +129,7 @@ runWeeder weederConfig@Config{ rootPatterns, typeClassRoots, rootInstances, root
129129
starts <- Map.lookup d ( declarationSites analysis )
130130
let locs = (,) packageName <$> Set.toList starts
131131
guard $ not $ null starts
132-
return [ Map.singleton moduleFilePath ( liftA2 (,) locs (pure d) ) ]
132+
return [ Map.singleton moduleFilePath ( Control.Applicative.liftA2 (,) locs (pure d) ) ]
133133
)
134134
dead
135135

weeder.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ library
2424
build-depends:
2525
, algebraic-graphs ^>= 0.7
2626
, async ^>= 2.2.0
27-
, base ^>= 4.17.0.0 || ^>= 4.18.0.0 || ^>= 4.19.0.0 || ^>= 4.20.0.0
27+
, base ^>= 4.17.0.0 || ^>= 4.18.0.0 || ^>= 4.19.0.0 || ^>= 4.20.0.0 || ^>= 4.21.0.0
2828
, bytestring ^>= 0.10.9.0 || ^>= 0.11.0.0 || ^>= 0.12.0.2
2929
, containers ^>= 0.6.2.1 || ^>= 0.7
3030
, directory ^>= 1.3.3.2
3131
, filepath ^>= 1.4.2.1 || ^>= 1.5
3232
, generic-lens ^>= 2.2.0.0
33-
, ghc ^>= 9.4 || ^>= 9.6 || ^>= 9.8 || ^>= 9.10
33+
, ghc ^>= 9.4 || ^>= 9.6 || ^>= 9.8 || ^>= 9.10 || ^>=9.12
3434
, Glob ^>= 0.9 || ^>= 0.10
3535
, lens ^>= 5.1 || ^>= 5.2 || ^>= 5.3
3636
, mtl ^>= 2.2.2 || ^>= 2.3

0 commit comments

Comments
 (0)