@@ -546,7 +546,7 @@ computeDiffParseHaskell ComputeParams { .. } = do
546
546
-- Find .cabal file
547
547
dotCabal <- (liftIO . findPackageDesc $ pkgPath) >>= either throwError return
548
548
-- Parse .cabal file, extract exported modules
549
- exports <- condLibrary <$> (liftIO $ readPackageDescription normal dotCabal) >>= \ case
549
+ exports <- condLibrary <$> (liftIO $ readGenericPackageDescription normal dotCabal) >>= \ case
550
550
Nothing -> throwError $ pkgPath ++ " is not a library"
551
551
Just node -> return $ exposedModules . condTreeData $ node
552
552
-- Build module name / module source file list
@@ -569,7 +569,7 @@ computeDiffParseHaskell ComputeParams { .. } = do
569
569
return $ comparePackageModules mListA mListB
570
570
571
571
-- Parse a Haskell module interface using haskell-src-exts and cpphs
572
- parseModule :: FilePath -> IO (Either String Module )
572
+ parseModule :: FilePath -> IO (Either String ( Module SrcSpanInfo ) )
573
573
parseModule modPath = runExceptT $ do
574
574
(liftIO $ doesFileExist modPath) >>= flip unless
575
575
(throwError $ " Can't open source file '" ++ modPath ++ " '" )
@@ -590,7 +590,7 @@ parseModule modPath = runExceptT $ do
590
590
Right (E. ParseOk parsedModule) ->
591
591
return parsedModule
592
592
593
- type PackageModuleList = [(String , Maybe Module )]
593
+ type PackageModuleList = [(String , Maybe ( Module SrcSpanInfo ) )]
594
594
595
595
-- Compare two packages made up of readily parsed Haskell modules
596
596
comparePackageModules :: PackageModuleList -> PackageModuleList -> Diff
@@ -633,8 +633,8 @@ comparePackageModules verA verB = do
633
633
expUnmodified = intersectBy (==) (moduleExports modA)
634
634
(moduleExports modB)
635
635
-- TODO: If the module does not have an export spec, we assume it exports nothing
636
- moduleExports (Module _ _ _ _ (Just exportSpec) _ _) = exportSpec
637
- moduleExports _ = []
636
+ moduleExports (Module _ ( Just ( ModuleHead _ _ _ (Just ( ExportSpecList _ exportSpec)))) _ _ _ ) = exportSpec
637
+ moduleExports _ = []
638
638
findModule mlist mname = maybe Nothing snd $ find ((== mname) . fst ) mlist
639
639
in resAdded ++ resRemoved ++ resKept
640
640
0 commit comments