Skip to content

Commit

Permalink
Tweak layout to work with alternative layout rule
Browse files Browse the repository at this point in the history
  • Loading branch information
igfoo committed Nov 29, 2009
1 parent 88b08b3 commit d92867b
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Distribution/Compat/ReadP.hs
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Distribution/PackageDescription/Check.hs
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Distribution/ParseUtils.hs
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions Distribution/Simple/Command.hs
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion Distribution/Simple/GHC.hs
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Distribution/Simple/LHC.hs
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Distribution/Simple/PackageIndex.hs
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Distribution/Simple/PreProcess.hs
Expand Up @@ -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
Expand Down

0 comments on commit d92867b

Please sign in to comment.