weeder 2.7.0 → 2.8.0
raw patch · 3 files changed
+13/−39 lines, 3 filesdep ~basedep ~bytestringdep ~ghc
Dependency ranges changed: base, bytestring, ghc, optparse-applicative, text
Files
- CHANGELOG.md +5/−0
- src/Weeder.hs +2/−33
- weeder.cabal +6/−6
CHANGELOG.md view
@@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and is generated by [Changie](https://github.com/miniscruff/changie). +## 2.8.0 - 2024-01-31++### Added++ * Weeder now supports GHC 9.8. (#142) ## 2.7.0 - 2023-08-17 ### Added
src/Weeder.hs view
@@ -57,11 +57,6 @@ -- ghc import GHC.Data.FastString ( unpackFS )-import GHC.Types.Avail- ( AvailInfo( Avail, AvailTC )- , GreName( NormalGreName, FieldGreName )- )-import GHC.Types.FieldLabel ( FieldLabel( FieldLabel, flSelector ) ) import GHC.Iface.Ext.Types ( BindType( RegularBind ) , ContextInfo( Decl, ValBind, PatternBind, Use, TyDecl, ClassTyDecl, EvidenceVarBind, RecField )@@ -69,7 +64,7 @@ , EvVarSource ( EvInstBind, cls ) , HieAST( Node, nodeChildren, nodeSpan, sourcedNodeInfo ) , HieASTs( HieASTs )- , HieFile( HieFile, hie_asts, hie_exports, hie_module, hie_hs_file, hie_types )+ , HieFile( HieFile, hie_asts, hie_module, hie_hs_file, hie_types ) , HieType( HTyVarTy, HAppTy, HTyConApp, HForAllTy, HFunTy, HQualTy, HLitTy, HCastTy, HCoercionTy ) , HieArgs( HieArgs ) , HieTypeFix( Roll )@@ -275,7 +270,7 @@ analyseHieFile' :: ( MonadState Analysis m, MonadReader AnalysisInfo m ) => m () analyseHieFile' = do- HieFile{ hie_asts = HieASTs hieASTs, hie_exports, hie_module, hie_hs_file } <- asks currentHieFile+ HieFile{ hie_asts = HieASTs hieASTs, hie_module, hie_hs_file } <- asks currentHieFile #modulePaths %= Map.insert hie_module hie_hs_file g <- asks initialGraph@@ -283,9 +278,7 @@ for_ hieASTs topLevelAnalysis - for_ hie_exports ( analyseExport hie_module ) - lookupType :: HieFile -> TypeIndex -> HieTypeFix lookupType hf t = recoverFullType t $ hie_types hf @@ -329,30 +322,6 @@ hieArgsTypes :: [(Bool, HieTypeFix)] -> Set Name hieArgsTypes = foldMap (typeToNames . snd) . filter fst---analyseExport :: MonadState Analysis m => Module -> AvailInfo -> m ()-analyseExport m = \case- Avail (NormalGreName name) ->- traverse_ addExport $ nameToDeclaration name-- Avail (FieldGreName (FieldLabel{ flSelector })) ->- traverse_ addExport $ nameToDeclaration flSelector-- AvailTC name pieces -> do- for_ ( nameToDeclaration name ) addExport-- for_ pieces \case- NormalGreName name' ->- traverse_ addExport $ nameToDeclaration name'-- FieldGreName (FieldLabel{ flSelector }) ->- traverse_ addExport $ nameToDeclaration flSelector-- where-- addExport :: MonadState Analysis m => Declaration -> m ()- addExport d = #exports %= Map.insertWith (<>) m ( Set.singleton d ) -- | @addDependency x y@ adds the information that @x@ depends on @y@.
weeder.cabal view
@@ -5,7 +5,7 @@ author: Ollie Charles <ollie@ocharles.org.uk> maintainer: Ollie Charles <ollie@ocharles.org.uk> build-type: Simple-version: 2.7.0+version: 2.8.0 copyright: Neil Mitchell 2017-2020, Oliver Charles 2020-2023 synopsis: Detect dead code description: Find declarations.@@ -24,19 +24,19 @@ build-depends: , algebraic-graphs ^>= 0.7 , async ^>= 2.2.0- , base ^>= 4.17.0.0 || ^>= 4.18.0.0- , bytestring ^>= 0.10.9.0 || ^>= 0.11.0.0+ , base ^>= 4.17.0.0 || ^>= 4.18.0.0 || ^>= 4.19.0.0+ , bytestring ^>= 0.10.9.0 || ^>= 0.11.0.0 || ^>= 0.12.0.2 , containers ^>= 0.6.2.1 , directory ^>= 1.3.3.2 , filepath ^>= 1.4.2.1 , generic-lens ^>= 2.2.0.0- , ghc ^>= 9.4 || ^>= 9.6+ , ghc ^>= 9.4 || ^>= 9.6 || ^>= 9.8 , lens ^>= 5.1 || ^>= 5.2 , mtl ^>= 2.2.2 || ^>= 2.3- , optparse-applicative ^>= 0.14.3.0 || ^>= 0.15.1.0 || ^>= 0.16.0.0 || ^>= 0.17+ , optparse-applicative ^>= 0.14.3.0 || ^>= 0.15.1.0 || ^>= 0.16.0.0 || ^>= 0.17 || ^>= 0.18.1.0 , parallel ^>= 3.2.0.0 , regex-tdfa ^>= 1.2.0.0 || ^>= 1.3.1.0- , text ^>= 2.0.1+ , text ^>= 2.0.1 || ^>= 2.1 , toml-reader ^>= 0.2.0.0 , transformers ^>= 0.5.6.2 || ^>= 0.6 hs-source-dirs: src