Commit c8d18b89 authored by ijones's avatar ijones
Browse files

toward -Wall cleanliness

parent c978dd07
...@@ -59,9 +59,7 @@ module Distribution.Package ( ...@@ -59,9 +59,7 @@ module Distribution.Package (
) where ) where
import Control.Monad(foldM, liftM) import Control.Monad(foldM, liftM)
import Control.Exception(bracket)
import Data.Char import Data.Char
import Data.List(isPrefixOf)
import Data.Maybe(fromMaybe) import Data.Maybe(fromMaybe)
import Text.PrettyPrint.HughesPJ import Text.PrettyPrint.HughesPJ
...@@ -71,8 +69,6 @@ import Distribution.Version(Version(..), VersionRange(..), ...@@ -71,8 +69,6 @@ import Distribution.Version(Version(..), VersionRange(..),
import Distribution.Misc(License(..), Dependency(..), Extension(..)) import Distribution.Misc(License(..), Dependency(..), Extension(..))
import Distribution.Setup(CompilerFlavor(..)) import Distribution.Setup(CompilerFlavor(..))
import System.IO(openFile, IOMode(..), hGetContents, hClose, hPutStrLn)
import Compat.H98 import Compat.H98
import Compat.ReadP import Compat.ReadP
......
...@@ -61,7 +61,7 @@ import Distribution.Misc(Dependency(..), extensionsToGHCFlag, ...@@ -61,7 +61,7 @@ import Distribution.Misc(Dependency(..), extensionsToGHCFlag,
extensionsToNHCFlag, extensionsToHugsFlag) extensionsToNHCFlag, extensionsToHugsFlag)
import Distribution.Setup(ConfigFlags,CompilerFlavor(..), Compiler(..)) import Distribution.Setup(ConfigFlags,CompilerFlavor(..), Compiler(..))
import Distribution.Package(PackageDescription(..), PackageIdentifier(..), import Distribution.Package(PackageDescription(..), PackageIdentifier(..),
BuildInfo(..), Executable(..) BuildInfo(..), Executable(..), emptyPackageDescription
) )
import Distribution.Simple.Utils (die, setupMessage, findBinary, import Distribution.Simple.Utils (die, setupMessage, findBinary,
splitFilePath, joinFilenameDir, joinExt) splitFilePath, joinFilenameDir, joinExt)
......
...@@ -77,7 +77,7 @@ import Distribution.Package (PackageDescription(..), showPackageId, ...@@ -77,7 +77,7 @@ import Distribution.Package (PackageDescription(..), showPackageId,
BuildInfo(..), hasLibs) BuildInfo(..), hasLibs)
import Control.Monad(when, unless, liftM, mapM) import Control.Monad(when, unless, liftM, mapM)
import Data.List(inits, nub, intersperse, findIndices, partition) import Data.List(nub, intersperse, findIndices)
import Data.Maybe(Maybe, listToMaybe, isNothing, fromJust, catMaybes) import Data.Maybe(Maybe, listToMaybe, isNothing, fromJust, catMaybes)
import System.IO (hPutStr, stderr, hFlush, stdout import System.IO (hPutStr, stderr, hFlush, stdout
#ifdef __GLASGOW_HASKELL__ #ifdef __GLASGOW_HASKELL__
...@@ -106,8 +106,8 @@ import HUnit ((~:), (~=?), Test(..), assertEqual) ...@@ -106,8 +106,8 @@ import HUnit ((~:), (~=?), Test(..), assertEqual)
splitFilePath :: FilePath -> (String, String, String) splitFilePath :: FilePath -> (String, String, String)
splitFilePath p = splitFilePath p =
case pre of case pre of
[] -> (reverse real_dir, reverse suf, []) [] -> (reverse real_dir, reverse suf, [])
(_:pre) -> (reverse real_dir, reverse pre, reverse suf) (_:pre') -> (reverse real_dir, reverse pre', reverse suf)
where where
#ifdef mingw32_TARGET_OS #ifdef mingw32_TARGET_OS
(path,drive) = break (== ':') (reverse p) (path,drive) = break (== ':') (reverse p)
...@@ -120,9 +120,9 @@ splitFilePath p = ...@@ -120,9 +120,9 @@ splitFilePath p =
_ -> break (== '.') file _ -> break (== '.') file
real_dir = case dir of real_dir = case dir of
[] -> "."++drive [] -> "."++drive
[_] -> pathSeparatorStr++drive [_] -> pathSeparatorStr++drive
(_:dir) -> dir++drive (_:dir') -> dir'++drive
-- | Join extension to file path -- | Join extension to file path
joinExt :: FilePath -> String -> String joinExt :: FilePath -> String -> String
...@@ -154,8 +154,8 @@ pathInits p = ...@@ -154,8 +154,8 @@ pathInits p =
(root,path) = ("",p) (root,path) = ("",p)
#endif #endif
(root',path') = case path of (root',path') = case path of
(c:path) | isPathSeparator c -> (root++pathSeparatorStr,path) (c:path'') | isPathSeparator c -> (root++pathSeparatorStr,path'')
_ -> (root,path) _ -> (root,path)
dropEmptyPath ("":paths) = paths dropEmptyPath ("":paths) = paths
dropEmptyPath paths = paths dropEmptyPath paths = paths
...@@ -169,8 +169,8 @@ pathInits p = ...@@ -169,8 +169,8 @@ pathInits p =
_ -> "" : map (joinFilenameDir pre) (inits suf) _ -> "" : map (joinFilenameDir pre) (inits suf)
where where
(pre,suf) = case break isPathSeparator cs of (pre,suf) = case break isPathSeparator cs of
(pre,"") -> (pre, "") (pre',"") -> (pre', "")
(pre,_:suf) -> (pre,suf) (pre',_:suf') -> (pre',suf')
isPathSeparator :: Char -> Bool isPathSeparator :: Char -> Bool
isPathSeparator ch = isPathSeparator ch =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment