diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-07-06 19:47:21 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-07 13:56:18 -0400 |
commit | 204f3f5ddec56403bfb12e74291b3b1d14824138 (patch) | |
tree | eda02d68c935b7fdd9746b0fd3288e0a359b5340 /compiler | |
parent | 0ddae2ba979ac2e01d7d9f6b79a9559fbfde46ea (diff) | |
download | haskell-204f3f5ddec56403bfb12e74291b3b1d14824138.tar.gz |
Remove unused function pprHsForAllExtra (#18423)
The function `pprHsForAllExtra` was called only on `Nothing`
since 2015 (1e041b7382b6aa).
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Hs/Type.hs | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/compiler/GHC/Hs/Type.hs b/compiler/GHC/Hs/Type.hs index 895ce00b88..6ed5566054 100644 --- a/compiler/GHC/Hs/Type.hs +++ b/compiler/GHC/Hs/Type.hs @@ -77,7 +77,7 @@ module GHC.Hs.Type ( setHsTyVarBndrFlag, hsTyVarBndrFlag, -- Printing - pprHsType, pprHsForAll, pprHsForAllExtra, pprHsExplicitForAll, + pprHsType, pprHsForAll, pprHsExplicitForAll, pprLHsContext, hsTypeNeedsParens, parenthesizeHsType, parenthesizeHsContext ) where @@ -1811,24 +1811,11 @@ pprAnonWildCard = char '_' -- | Prints a forall; When passed an empty list, prints @forall .@/@forall ->@ -- only when @-dppr-debug@ is enabled. -pprHsForAll :: OutputableBndrId p +pprHsForAll :: forall p. OutputableBndrId p => HsForAllTelescope (GhcPass p) -> LHsContext (GhcPass p) -> SDoc -pprHsForAll = pprHsForAllExtra Nothing - --- | Version of 'pprHsForAll' that can also print an extra-constraints --- wildcard, e.g. @_ => a -> Bool@ or @(Show a, _) => a -> String@. This --- underscore will be printed when the 'Maybe SrcSpan' argument is a 'Just' --- containing the location of the extra-constraints wildcard. A special --- function for this is needed, as the extra-constraints wildcard is removed --- from the actual context and type, and stored in a separate field, thus just --- printing the type will not print the extra-constraints wildcard. -pprHsForAllExtra :: forall p. OutputableBndrId p - => Maybe SrcSpan - -> HsForAllTelescope (GhcPass p) - -> LHsContext (GhcPass p) -> SDoc -pprHsForAllExtra extra tele cxt - = pp_tele tele <+> pprLHsContextExtra (isJust extra) cxt +pprHsForAll tele cxt + = pp_tele tele <+> pprLHsContext cxt where pp_tele :: HsForAllTelescope (GhcPass p) -> SDoc pp_tele tele = case tele of @@ -1863,16 +1850,6 @@ pprLHsContextAlways (L _ ctxt) [L _ ty] -> ppr_mono_ty ty <+> darrow _ -> parens (interpp'SP ctxt) <+> darrow --- True <=> print an extra-constraints wildcard, e.g. @(Show a, _) =>@ -pprLHsContextExtra :: (OutputableBndrId p) - => Bool -> LHsContext (GhcPass p) -> SDoc -pprLHsContextExtra show_extra lctxt@(L _ ctxt) - | not show_extra = pprLHsContext lctxt - | null ctxt = char '_' <+> darrow - | otherwise = parens (sep (punctuate comma ctxt')) <+> darrow - where - ctxt' = map ppr ctxt ++ [char '_'] - pprConDeclFields :: (OutputableBndrId p) => [LConDeclField (GhcPass p)] -> SDoc pprConDeclFields fields = braces (sep (punctuate comma (map ppr_fld fields))) |