Commit 3004316d authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add and export a showProfDetailLevel utlity

To be used in cabal-install. Also use it in one place in Cabal.
parent 7d01c2e6
......@@ -60,6 +60,7 @@ module Distribution.Simple.Compiler (
ProfDetailLevel(..),
knownProfDetailLevels,
flagToProfDetailLevel,
showProfDetailLevel,
) where
import Distribution.Compiler
......@@ -337,3 +338,12 @@ knownProfDetailLevels =
, ("all-functions", ["all"], ProfDetailAllFunctions)
]
showProfDetailLevel :: ProfDetailLevel -> String
showProfDetailLevel dl = case dl of
ProfDetailNone -> "none"
ProfDetailDefault -> "default"
ProfDetailExportedFunctions -> "exported-functions"
ProfDetailToplevelFunctions -> "toplevel-functions"
ProfDetailAllFunctions -> "all-functions"
ProfDetailOther other -> other
......@@ -83,7 +83,7 @@ import Distribution.Simple.Compiler
( CompilerFlavor(..), defaultCompilerFlavor, PackageDB(..)
, DebugInfoLevel(..), flagToDebugInfoLevel
, OptimisationLevel(..), flagToOptimisationLevel
, ProfDetailLevel(..), flagToProfDetailLevel
, ProfDetailLevel(..), flagToProfDetailLevel, showProfDetailLevel
, absolutePackageDBPath )
import Distribution.Simple.Utils
( wrapText, wrapLine, lowercase, intercalate )
......@@ -671,16 +671,8 @@ showPackageDbList = map showPackageDb
showPackageDb (Just (SpecificPackageDB db)) = db
showProfDetailLevelFlag :: Flag ProfDetailLevel -> [String]
showProfDetailLevelFlag dl =
case dl of
NoFlag -> []
Flag ProfDetailNone -> ["none"]
Flag ProfDetailDefault -> ["default"]
Flag ProfDetailExportedFunctions -> ["exported-functions"]
Flag ProfDetailToplevelFunctions -> ["toplevel-functions"]
Flag ProfDetailAllFunctions -> ["all-functions"]
Flag (ProfDetailOther other) -> [other]
showProfDetailLevelFlag NoFlag = []
showProfDetailLevelFlag (Flag dl) = [showProfDetailLevel dl]
parseDependency :: Parse.ReadP r (PackageName, ComponentId)
parseDependency = do
......
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