From 187f718de04f766cec550c0972483313fbd90600 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 27 Mar 2014 16:35:41 +0900 Subject: [PATCH] hlint hack. --- Language/Haskell/GhcMod/Cradle.hs | 4 ++-- Language/Haskell/GhcMod/Debug.hs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Language/Haskell/GhcMod/Cradle.hs b/Language/Haskell/GhcMod/Cradle.hs index e230c29..2dcd756 100644 --- a/Language/Haskell/GhcMod/Cradle.hs +++ b/Language/Haskell/GhcMod/Cradle.hs @@ -158,7 +158,7 @@ getPackageDbPackages cdir = (getPkgDb >>= listDbPackages) `E.catch` handler listDbPackages :: FilePath -> IO [Package] listDbPackages pkgdir = do files <- filter (".conf" `isSuffixOf`) <$> getDirectoryContents pkgdir - mapM extractPackage $ map (pkgdir ) files + mapM (extractPackage . (pkgdir )) files extractPackage :: FilePath -> IO Package extractPackage pconf = do @@ -173,7 +173,7 @@ extractPackage pconf = do parseId = parse idKey extractId = extract idKeyLength parse key = head . filter (key `isPrefixOf`) - extract keylen = fst . break isSpace . dropWhile isSpace . drop keylen + extract keylen = takeWhile (not . isSpace) . dropWhile isSpace . drop keylen nameKey :: String nameKey = "name:" diff --git a/Language/Haskell/GhcMod/Debug.hs b/Language/Haskell/GhcMod/Debug.hs index 45c4ced..4e84c64 100644 --- a/Language/Haskell/GhcMod/Debug.hs +++ b/Language/Haskell/GhcMod/Debug.hs @@ -39,7 +39,7 @@ debug opt cradle fileName = do , "Cabal file: " ++ cabalFile , "GHC options: " ++ unwords gopts , "Include directories: " ++ unwords incDir - , "Dependent packages: " ++ (intercalate ", " $ map fst pkgs) + , "Dependent packages: " ++ intercalate ", " (map fst pkgs) ] where currentDir = cradleCurrentDir cradle @@ -68,8 +68,7 @@ root :: Options -> Cradle -> FilePath -- ^ A target file. -> Ghc String -root _ cradle _ = do - return $ rootDir ++ "\n" +root _ cradle _ = return $ rootDir ++ "\n" where currentDir = cradleCurrentDir cradle mCabalDir = cradleCabalDir cradle