Commit 0aba7b9f authored by Ian Lynagh's avatar Ian Lynagh

Tweak layout to work with alternative layout rule

parent 13bfa342
......@@ -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.
......
......@@ -756,7 +756,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)
......@@ -1067,7 +1067,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
......
......@@ -521,7 +521,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'
......
......@@ -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 ->
......
......@@ -791,7 +791,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"
......
......@@ -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"
......
......@@ -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
......
......@@ -261,9 +261,9 @@ preprocessModule searchLoc buildLoc forSDist modu verbosity builtinSuffixes hand
(psrcLoc, psrcRelFile)
(buildLoc, srcStem <.> "hs") verbosity
where dirName = takeDirectory
tailNotNull [] = []
tailNotNull x = tail x
where dirName = takeDirectory
tailNotNull [] = []
tailNotNull x = tail x
-- ------------------------------------------------------------
-- * known preprocessors
......
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