diff options
author | Hécate Moonlight <Kleidukos@users.noreply.github.com> | 2021-02-07 16:21:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-07 16:21:29 +0100 |
commit | 9dab3bdc9f31c0389e69f21c2199f874d151ccb7 (patch) | |
tree | 36252b271f70ae2730063a39dff19fdfb4fadf8d /haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | |
parent | a10d042ac76c990764250244ac801db16858b6ee (diff) | |
parent | 62bf25cb0931e761e8b2ff082a703d79386fc8bc (diff) |
Merge pull request #1314 from tweag/show-linear-backport
Backport #1238 (linear types) to ghc-9.0
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Decl.hs')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index eeb9fa94..0b0050df 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -1213,10 +1213,15 @@ ppr_mono_ty (HsTyVar _ prom (L _ name)) _ q _ | 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 = +ppr_mono_ty (HsFunTy _ mult ty1 ty2) u q e = hsep [ ppr_mono_lty ty1 u q HideEmptyContexts - , arrow u <+> ppr_mono_lty ty2 u q e + , arr <+> ppr_mono_lty ty2 u q e ] + where arr = case mult of + HsLinearArrow _ -> lollipop u + HsUnrestrictedArrow _ -> arrow u + HsExplicitMult _ m -> multAnnotation <> ppr_mono_lty m u q e <+> arrow u + ppr_mono_ty (HsTupleTy _ con tys) u q _ = tupleParens con (map (ppLType u q HideEmptyContexts) tys) ppr_mono_ty (HsSumTy _ tys) u q _ = |