Commit eb2d8fe3 authored by benl's avatar benl

Implement -dsuppress-type-signatures

parent 69a804e3
......@@ -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 *)
......
......@@ -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)
......
......@@ -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")
......
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