summaryrefslogtreecommitdiff
path: root/ghc/InteractiveUI.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-08-01 19:07:03 +0100
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-08-05 03:13:40 -0700
commit4accf60184dba550ef0cbdf70fa8e708a4007370 (patch)
tree7972ea1dd9cf571140aab3c0e69120768a064a47 /ghc/InteractiveUI.hs
parent00b8f8c5b378fc679639ebe81238cf42d92aa607 (diff)
downloadhaskell-4accf60184dba550ef0cbdf70fa8e708a4007370.tar.gz
Refactor PackageFlags so that ExposePackage is a single constructor.
You can parametrize over the different selection by using a different PackageArg. This helps reduce code duplication. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'ghc/InteractiveUI.hs')
-rw-r--r--ghc/InteractiveUI.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 1b6256b8cb..f42d47a51d 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -2334,13 +2334,14 @@ showPackages = do
liftIO $ putStrLn $ showSDoc dflags $ vcat $
text ("active package flags:"++if null pkg_flags then " none" else "")
: map showFlag pkg_flags
- where showFlag (ExposePackage p) = text $ " -package " ++ p
+ where showFlag (ExposePackage a) = text $ showArg a
showFlag (HidePackage p) = text $ " -hide-package " ++ p
showFlag (IgnorePackage p) = text $ " -ignore-package " ++ p
- showFlag (ExposePackageId p) = text $ " -package-id " ++ p
- showFlag (ExposePackageKey p) = text $ " -package-key " ++ p
showFlag (TrustPackage p) = text $ " -trust " ++ p
showFlag (DistrustPackage p) = text $ " -distrust " ++ p
+ showArg (PackageArg p) = " -package " ++ p
+ showArg (PackageIdArg p) = " -package-id " ++ p
+ showArg (PackageKeyArg p) = " -package-key " ++ p
showPaths :: GHCi ()
showPaths = do