diff options
| author | Ben Lippmeier <benl@ouroborus.net> | 2010-12-08 06:28:14 +0000 |
|---|---|---|
| committer | Ben Lippmeier <benl@ouroborus.net> | 2010-12-08 06:28:14 +0000 |
| commit | eb2d8fe3f17b2c2bd30b3bf2d1451b367152f036 (patch) | |
| tree | 929c7c48e8aa4a03ce02ca6c99eeee56b5de2f58 /compiler | |
| parent | 69a804e3ff13197cd2962bea96a69bb81eb6bcf0 (diff) | |
| download | haskell-eb2d8fe3f17b2c2bd30b3bf2d1451b367152f036.tar.gz | |
Implement -dsuppress-type-signatures
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/coreSyn/PprCore.lhs | 5 | ||||
| -rw-r--r-- | compiler/main/StaticFlagParser.hs | 1 | ||||
| -rw-r--r-- | compiler/main/StaticFlags.hs | 15 |
3 files changed, 16 insertions, 5 deletions
diff --git a/compiler/coreSyn/PprCore.lhs b/compiler/coreSyn/PprCore.lhs index cc3883767f..104bf811b8 100644 --- a/compiler/coreSyn/PprCore.lhs +++ b/compiler/coreSyn/PprCore.lhs @@ -282,8 +282,9 @@ pprTypedLCBinder bind_site debug_on var pprTypedBinder :: Var -> SDoc -- Print binder with a type or kind signature (not paren'd) pprTypedBinder binder - | isTyCoVar binder = pprKindedTyVarBndr binder - | otherwise = hang (pprIdBndr binder) 2 (dcolon <+> pprType (idType binder)) + | isTyCoVar binder = pprKindedTyVarBndr binder + | opt_SuppressTypeSignatures = empty + | otherwise = hang (pprIdBndr binder) 2 (dcolon <+> pprType (idType binder)) pprKindedTyVarBndr :: TyVar -> SDoc -- Print a type variable binder with its kind (but not if *) diff --git a/compiler/main/StaticFlagParser.hs b/compiler/main/StaticFlagParser.hs index 8de4c5c4ce..431414a1d5 100644 --- a/compiler/main/StaticFlagParser.hs +++ b/compiler/main/StaticFlagParser.hs @@ -128,6 +128,7 @@ static_flags = [ , Flag "dsuppress-module-prefixes" (PassFlag addOpt) , Flag "dsuppress-type-applications" (PassFlag addOpt) , Flag "dsuppress-idinfo" (PassFlag addOpt) + , Flag "dsuppress-type-signatures" (PassFlag addOpt) , Flag "dppr-user-length" (AnySuffix addOpt) , Flag "dopt-fuel" (AnySuffix addOpt) , Flag "dtrace-level" (AnySuffix addOpt) diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 9b8ea192f0..f9be713d32 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -21,14 +21,17 @@ module StaticFlags ( -- Output style options opt_PprUserLength, + opt_PprStyle_Debug, opt_TraceLevel, + opt_NoDebugOutput, + + -- Suppressing boring aspects of core dumps opt_SuppressAll, opt_SuppressUniques, opt_SuppressCoercions, opt_SuppressModulePrefixes, opt_SuppressTypeApplications, opt_SuppressIdInfo, - opt_PprStyle_Debug, opt_TraceLevel, - opt_NoDebugOutput, + opt_SuppressTypeSignatures, -- profiling opts opt_SccProfilingOn, @@ -219,7 +222,13 @@ opt_SuppressIdInfo :: Bool opt_SuppressIdInfo = lookUp (fsLit "-dsuppress-all") || lookUp (fsLit "-dsuppress-idinfo") - + +-- | Suppress seprate type signatures in core, but leave types on lambda bound vars +opt_SuppressTypeSignatures :: Bool +opt_SuppressTypeSignatures + = lookUp (fsLit "-dsuppress-all") + || lookUp (fsLit "-dsuppress-type-signatures") + opt_PprStyle_Debug :: Bool opt_PprStyle_Debug = lookUp (fsLit "-dppr-debug") |
