From 5750673e0e8bab213eacce430eeb83dc651bc7f8 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 11 Sep 2013 14:09:18 +0900 Subject: [PATCH] Filtering problematic packages. --- Language/Haskell/GhcMod/CabalApi.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Language/Haskell/GhcMod/CabalApi.hs b/Language/Haskell/GhcMod/CabalApi.hs index 7a7bcac..d545bec 100644 --- a/Language/Haskell/GhcMod/CabalApi.hs +++ b/Language/Haskell/GhcMod/CabalApi.hs @@ -51,13 +51,21 @@ cookInfo ghcOptions cradle cabal = (gopts,idirs,depPkgs) buildInfos = cabalAllBuildInfo cabal gopts = getGHCOptions ghcOptions $ head buildInfos idirs = includeDirectories cdir wdir $ cabalAllSourceDirs buildInfos - depPkgs = removeMe cfile $ cabalAllDependPackages buildInfos + depPkgs = removeThem problematicPackages $ removeMe cfile $ cabalAllDependPackages buildInfos removeMe :: FilePath -> [String] -> [String] removeMe cabalfile = filter (/= me) where me = dropExtension $ takeFileName cabalfile +removeThem :: [String] -> [String] -> [String] +removeThem badpkgs = filter (`notElem` badpkgs) + +problematicPackages :: [String] +problematicPackages = [ + "base-compat" -- providing "Prelude" + ] + includeDirectories :: String -> String -> [FilePath] -> [String] includeDirectories cdir wdir [] = uniqueAndSort [cdir,wdir] includeDirectories cdir wdir dirs = uniqueAndSort (map (cdir ) dirs ++ [cdir,wdir])