Commit a09185a4 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Drop redundant brackets.

parent 1136a62c
......@@ -105,7 +105,7 @@ ghcSplit = "inplace/lib/bin/ghc-split"
-- TODO: simplify, add programInplaceLibPath
-- | The relative path to the program executable
programPath :: Context -> Maybe FilePath
programPath context @ (Context {..})
programPath context @ Context {..}
| package == ghc = Just . inplaceProgram $ "ghc-stage" ++ show (fromEnum stage + 1)
| package `elem` [ghcTags, haddock, mkUserGuidePart] = case stage of
Stage2 -> Just . inplaceProgram $ pkgNameString package
......@@ -135,5 +135,5 @@ rtsContext = vanillaContext Stage1 rts
-- * @doc/@ is produced by haddock
-- * @package-data.mk@ contains output of ghc-cabal applied to pkgCabal
contextDirectory :: Context -> FilePath
contextDirectory (Context {..}) = stageString stage
contextDirectory Context {..} = stageString stage
......@@ -13,7 +13,7 @@ newtype ModuleFilesKey = ModuleFilesKey ([FilePath], [String])
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
moduleFiles :: Context -> Action [FilePath]
moduleFiles context @ (Context {..}) = do
moduleFiles context @ Context {..} = do
let path = contextPath context
srcDirs <- fmap sort . pkgDataList $ SrcDirs path
modules <- fmap sort . pkgDataList $ Modules path
......@@ -21,7 +21,7 @@ moduleFiles context @ (Context {..}) = do
fmap catMaybes $ findModuleFiles dirs modules
haskellModuleFiles :: Context -> Action ([FilePath], [String])
haskellModuleFiles context @ (Context {..}) = do
haskellModuleFiles context @ Context {..} = do
let path = contextPath context
autogen = path -/- "build/autogen"
dropPkgPath = drop $ length (pkgPath package) + 1
......
......@@ -9,7 +9,7 @@ import Settings
import Target
compilePackage :: [(Resource, Int)] -> Context -> Rules ()
compilePackage rs context @ (Context {..}) = do
compilePackage rs context @ Context {..} = do
let buildPath = contextPath context -/- "build"
buildPath <//> "*" <.> hisuf way %> \hi ->
......
......@@ -17,7 +17,7 @@ import Target
-- Build package-data.mk by using GhcCabal to process pkgCabal file
buildPackageData :: Context -> Rules ()
buildPackageData context @ (Context {..}) = do
buildPackageData context @ Context {..} = do
let cabalFile = pkgCabalFile package
configure = pkgPath package -/- "configure"
dataFile = pkgDataFile context
......@@ -138,7 +138,7 @@ buildPackageData context @ (Context {..}) = do
-- is replaced by libraries_deepseq_dist-install_VERSION = 1.4.0.0
-- Reason: Shake's built-in makefile parser doesn't recognise slashes
postProcessPackageData :: Context -> FilePath -> Action ()
postProcessPackageData context @ (Context {..}) file = fixFile file fixPackageData
postProcessPackageData context @ Context {..} file = fixFile file fixPackageData
where
fixPackageData = unlines . map processLine . filter (not . null) . filter ('$' `notElem`) . lines
processLine line = fixKey fixedPrefix ++ suffix
......
......@@ -12,7 +12,7 @@ import Target
-- TODO: simplify handling of AutoApply.cmm
buildPackageDependencies :: [(Resource, Int)] -> Context -> Rules ()
buildPackageDependencies rs context @ (Context {..}) =
buildPackageDependencies rs context @ Context {..} =
let path = contextPath context
buildPath = path -/- "build"
dropBuild = (pkgPath package ++) . drop (length buildPath)
......
......@@ -16,7 +16,7 @@ haddockHtmlLib = "inplace/lib/html/haddock-util.js"
-- All of them go into the 'doc' subdirectory. Pedantically tracking all built
-- files in the Shake databases seems fragile and unnecesarry.
buildPackageDocumentation :: Context -> Rules ()
buildPackageDocumentation context @ (Context {..}) =
buildPackageDocumentation context @ Context {..} =
let cabalFile = pkgCabalFile package
haddockFile = pkgHaddockFile context
in when (stage == Stage1) $ do
......
......@@ -16,7 +16,7 @@ import Settings
import Target
buildPackageLibrary :: Context -> Rules ()
buildPackageLibrary context @ (Context {..}) = do
buildPackageLibrary context @ Context {..} = do
let buildPath = contextPath context -/- "build"
libPrefix = buildPath -/- "libHS" ++ pkgNameString package
......@@ -60,7 +60,7 @@ buildPackageLibrary context @ (Context {..}) = do
(dropWhileEnd isPunctuation synopsis)
buildPackageGhciLibrary :: Context -> Rules ()
buildPackageGhciLibrary context @ (Context {..}) = priority 2 $ do
buildPackageGhciLibrary context @ Context {..} = priority 2 $ do
let buildPath = contextPath context -/- "build"
libPrefix = buildPath -/- "HS" ++ pkgNameString package
......
......@@ -31,7 +31,7 @@ wrappers = [ (vanillaContext Stage0 ghc , ghcWrapper )
, (vanillaContext Stage0 ghcPkg, ghcPkgWrapper)]
buildProgram :: [(Resource, Int)] -> Context -> Rules ()
buildProgram rs context @ (Context {..}) = do
buildProgram rs context @ Context {..} = do
let match file = case programPath context of
Nothing -> False
Just program -> program == file
......
......@@ -12,7 +12,7 @@ import Target
-- Build package-data.mk by using GhcCabal to process pkgCabal file
registerPackage :: [(Resource, Int)] -> Context -> Rules ()
registerPackage rs context @ (Context {..}) = do
registerPackage rs context @ Context {..} = do
let oldPath = pkgPath package -/- contextDirectory context -- TODO: remove, #113
pkgConf = packageDbDirectory stage -/- pkgNameString package
......
......@@ -13,7 +13,7 @@ import Settings.User
-- Path to the target directory from GHC source root
contextPath :: Context -> FilePath
contextPath context @ (Context {..}) =
contextPath context @ Context {..} =
buildRootPath -/- contextDirectory context -/- pkgPath package
pkgDataFile :: Context -> FilePath
......@@ -22,19 +22,19 @@ pkgDataFile context = contextPath context -/- "package-data.mk"
-- Relative path to a package haddock file, e.g.:
-- "libraries/array/dist-install/doc/html/array/array.haddock"
pkgHaddockFile :: Context -> FilePath
pkgHaddockFile context @ (Context {..}) =
pkgHaddockFile context @ Context {..} =
contextPath context -/- "doc/html" -/- name -/- name <.> "haddock"
where name = pkgNameString package
-- Relative path to a package library file, e.g.:
-- "libraries/array/stage2/build/libHSarray-0.5.1.0.a"
pkgLibraryFile :: Context -> Action FilePath
pkgLibraryFile context @ (Context {..}) = do
pkgLibraryFile context @ Context {..} = do
extension <- libsuf way
pkgFile context "build/libHS" extension
pkgLibraryFile0 :: Context -> Action FilePath
pkgLibraryFile0 context @ (Context {..}) = do
pkgLibraryFile0 context @ Context {..} = do
extension <- libsuf way
pkgFile context "build/libHS" ("-0" ++ extension)
......@@ -64,6 +64,6 @@ packageDbDirectory Stage0 = buildRootPath -/- "stage0/bootstrapping.conf"
packageDbDirectory _ = "inplace/lib/package.conf.d"
pkgConfFile :: Context -> Action FilePath
pkgConfFile context @ (Context {..}) = do
pkgConfFile context @ Context {..} = do
componentId <- pkgData . ComponentId $ contextPath context
return $ packageDbDirectory stage -/- componentId <.> "conf"
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