diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2018-12-23 10:23:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-23 10:23:20 -0500 |
commit | 7dd0a79cce7c4c048e7c145c9f378da3a96392d0 (patch) | |
tree | 30d9449b76bd90bae0030651e839e7f98cada91f /haddock-api/src/Haddock/Backends/Xhtml | |
parent | ed43757aa371f9a532665783e27cff1703b4ac90 (diff) |
Properly synify and render promoted type variables (#985)
* Synify and render properly promoted type variables
Fixes #923.
* Accept output
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 4492739b..819a4747 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -34,7 +34,7 @@ import qualified Data.Map as Map import Data.Maybe import Text.XHtml hiding ( name, title, p, quote ) -import BasicTypes (PromotionFlag(..)) +import BasicTypes (PromotionFlag(..), isPromoted) import GHC hiding (LexicalFixity(..)) import GHC.Exts import Name @@ -1163,8 +1163,9 @@ ppr_mono_ty (HsTyVar _ _ (L _ name)) True _ _ ppr_mono_ty (HsBangTy _ b ty) u q _ = ppBang b +++ ppLParendType u q HideEmptyContexts ty -ppr_mono_ty (HsTyVar _ _ (L _ name)) _ q _ = - ppDocName q Prefix True name +ppr_mono_ty (HsTyVar _ prom (L _ name)) _ q _ + | isPromoted prom = promoQuote (ppDocName q Prefix True name) + | otherwise = ppDocName q Prefix True name ppr_mono_ty (HsStarTy _ isUni) u _ _ = toHtml (if u || isUni then "★" else "*") ppr_mono_ty (HsFunTy _ ty1 ty2) u q e = |