diff --git a/Distribution/Compat/ReadP.hs b/Distribution/Compat/ReadP.hs index b05eadedc7e..0c3d989afa3 100644 --- a/Distribution/Compat/ReadP.hs +++ b/Distribution/Compat/ReadP.hs @@ -248,7 +248,8 @@ munch1 :: (Char -> Bool) -> ReadP r String -- ^ Parses the first one or more characters satisfying the predicate. munch1 p = do c <- get - if p c then do s <- munch p; return (c:s) else pfail + if p c then do s <- munch p; return (c:s) + else pfail choice :: [ReadP r a] -> ReadP r a -- ^ Combines all parsers in the specified list. diff --git a/Distribution/PackageDescription/Check.hs b/Distribution/PackageDescription/Check.hs index df3b401554c..e77aa7125c6 100644 --- a/Distribution/PackageDescription/Check.hs +++ b/Distribution/PackageDescription/Check.hs @@ -758,7 +758,7 @@ checkCabalVersion pkg = requiresAtLeast = case cabalVersionIntervals of (LowerBound ver' _,_):_ -> (ver' >=) _ -> const False - where cabalVersionIntervals = asVersionIntervals (descCabalVersion pkg) + where cabalVersionIntervals = asVersionIntervals (descCabalVersion pkg) dataFilesUsingGlobSyntax = filter usesGlobSyntax (dataFiles pkg) extraSrcFilesUsingGlobSyntax = filter usesGlobSyntax (extraSrcFiles pkg) @@ -1069,7 +1069,7 @@ checkTarPath path Left err -> Just err Right [] -> Nothing Right (_:_) -> Just noSplit - where + where -- drop the '/' between the name and prefix: remainder = init first : rest diff --git a/Distribution/ParseUtils.hs b/Distribution/ParseUtils.hs index 234fc296e2e..16827380c9d 100644 --- a/Distribution/ParseUtils.hs +++ b/Distribution/ParseUtils.hs @@ -515,7 +515,7 @@ mkField d (Node (n,_,l) ts) = case span (\c -> isAlphaNum c || c == '-') l of (fieldValue rest' followingLines) rest' -> do ts' <- mapM (mkField (d+1)) ts return (Section n (map toLower name) rest' ts') - where fieldValue firstLine followingLines = + where fieldValue firstLine followingLines = let firstLine' = trimLeading firstLine followingLines' = map (\(_,_,s) -> stripDot s) followingLines allLines | null firstLine' = followingLines' diff --git a/Distribution/Simple/Command.hs b/Distribution/Simple/Command.hs index d8d1b0cdb2b..3806b9abe9d 100644 --- a/Distribution/Simple/Command.hs +++ b/Distribution/Simple/Command.hs @@ -382,7 +382,7 @@ commonFlags :: ShowOrParseArgs -> [GetOpt.OptDescr CommonFlag] commonFlags showOrParseArgs = case showOrParseArgs of ShowArgs -> [help] ParseArgs -> [help, list] - where + where help = GetOpt.Option helpShortFlags ["help"] (GetOpt.NoArg HelpFlag) "Show this help text" helpShortFlags = case showOrParseArgs of @@ -475,9 +475,9 @@ commandsRun globalCommand commands args = [Command _ _ action] -> CommandReadyToGo (flags, action cmdArgs) _ -> CommandReadyToGo (flags, badCommand name) [] -> CommandReadyToGo (flags, noCommand) - where flags = mkflags (commandDefaultFlags globalCommand) + where flags = mkflags (commandDefaultFlags globalCommand) - where + where lookupCommand cname = [ cmd | cmd@(Command cname' _ _) <- commands' , cname'==cname ] noCommand = CommandErrors ["no command given (try --help)\n"] @@ -521,7 +521,7 @@ commandsRun globalCommand commands args = _ -> CommandHelp globalHelp _ -> badCommand name - where globalHelp = commandHelp globalCommand' + where globalHelp = commandHelp globalCommand' helpCommandUI = (makeCommand "help" "Help about commands" Nothing () (const [])) { commandUsage = \pname -> diff --git a/Distribution/Simple/GHC.hs b/Distribution/Simple/GHC.hs index c84ef4d20c3..0d1e031193a 100644 --- a/Distribution/Simple/GHC.hs +++ b/Distribution/Simple/GHC.hs @@ -805,7 +805,7 @@ ghcPackageDbOptions dbstack = case dbstack of | otherwise -> "-no-user-package-conf" : concatMap specific dbs _ -> ierror - where + where specific (SpecificPackageDB db) = [ "-package-conf", db ] specific _ = [] ierror = error "internal error: unexpected package db stack" diff --git a/Distribution/Simple/LHC.hs b/Distribution/Simple/LHC.hs index c8cdef82c78..b2fc19e1102 100644 --- a/Distribution/Simple/LHC.hs +++ b/Distribution/Simple/LHC.hs @@ -654,7 +654,7 @@ ghcPackageDbOptions dbstack = case dbstack of (GlobalPackageDB:dbs) -> "-no-user-package-conf" : concatMap specific dbs _ -> ierror - where + where specific (SpecificPackageDB db) = [ "-package-conf", db ] specific _ = ierror ierror = error "internal error: unexpected package db stack" diff --git a/Distribution/Simple/PackageIndex.hs b/Distribution/Simple/PackageIndex.hs index bfd45abae4e..ee9038ef8de 100644 --- a/Distribution/Simple/PackageIndex.hs +++ b/Distribution/Simple/PackageIndex.hs @@ -445,7 +445,7 @@ dependencyClosure :: PackageIndex dependencyClosure index pkgids0 = case closure mempty [] pkgids0 of (completed, []) -> Left completed (completed, _) -> Right (brokenPackages completed) - where + where closure completed failed [] = (completed, failed) closure completed failed (pkgid:pkgids) = case lookupInstalledPackageId index pkgid of Nothing -> closure completed (pkgid:failed) pkgids diff --git a/Distribution/Simple/PreProcess.hs b/Distribution/Simple/PreProcess.hs index 6fe078aeb9d..336f9135e7d 100644 --- a/Distribution/Simple/PreProcess.hs +++ b/Distribution/Simple/PreProcess.hs @@ -257,9 +257,9 @@ preprocessFile searchLoc buildLoc forSDist baseFile verbosity builtinSuffixes ha (psrcLoc, psrcRelFile) (buildLoc, srcStem <.> "hs") verbosity - where dirName = takeDirectory - tailNotNull [] = [] - tailNotNull x = tail x + where dirName = takeDirectory + tailNotNull [] = [] + tailNotNull x = tail x -- ------------------------------------------------------------ -- * known preprocessors