@@ -546,7 +546,7 @@ computeDiffParseHaskell ComputeParams { .. } = do
546546 -- Find .cabal file
547547 dotCabal <- (liftIO . findPackageDesc $ pkgPath) >>= either throwError return
548548 -- Parse .cabal file, extract exported modules
549- exports <- condLibrary <$> (liftIO $ readPackageDescription normal dotCabal) >>= \ case
549+ exports <- condLibrary <$> (liftIO $ readGenericPackageDescription normal dotCabal) >>= \ case
550550 Nothing -> throwError $ pkgPath ++ " is not a library"
551551 Just node -> return $ exposedModules . condTreeData $ node
552552 -- Build module name / module source file list
@@ -569,7 +569,7 @@ computeDiffParseHaskell ComputeParams { .. } = do
569569 return $ comparePackageModules mListA mListB
570570
571571-- 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 ) )
573573parseModule modPath = runExceptT $ do
574574 (liftIO $ doesFileExist modPath) >>= flip unless
575575 (throwError $ " Can't open source file '" ++ modPath ++ " '" )
@@ -590,7 +590,7 @@ parseModule modPath = runExceptT $ do
590590 Right (E. ParseOk parsedModule) ->
591591 return parsedModule
592592
593- type PackageModuleList = [(String , Maybe Module )]
593+ type PackageModuleList = [(String , Maybe ( Module SrcSpanInfo ) )]
594594
595595-- Compare two packages made up of readily parsed Haskell modules
596596comparePackageModules :: PackageModuleList -> PackageModuleList -> Diff
@@ -633,8 +633,8 @@ comparePackageModules verA verB = do
633633 expUnmodified = intersectBy (==) (moduleExports modA)
634634 (moduleExports modB)
635635 -- 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 _ = []
638638 findModule mlist mname = maybe Nothing snd $ find ((== mname) . fst ) mlist
639639 in resAdded ++ resRemoved ++ resKept
640640
0 commit comments