diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-01-19 15:59:19 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-02-27 10:14:03 -0500 |
commit | 8459c600e0f6da3f85abefdefe651bbe3ed3da4a (patch) | |
tree | a0f2b418b545bbbc98961f494faec13a9d539bfd /haddock-api/src/Haddock/Backends/LaTeX.hs | |
parent | d667f4e0a4ffc581dbbdddf01b5e5c88bd60e790 (diff) |
Visible dependent quantification (#16326) changes
Diffstat (limited to 'haddock-api/src/Haddock/Backends/LaTeX.hs')
-rw-r--r-- | haddock-api/src/Haddock/Backends/LaTeX.hs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index dc083024..9e2e52c3 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -477,9 +477,10 @@ ppSubSigLike unicode typ argDocs subdocs leader = do_args 0 leader typ arg_doc n = rDoc . fmap _doc $ Map.lookup n argDocs do_args :: Int -> LaTeX -> HsType DocNameI -> [(LaTeX, LaTeX)] - do_args _n leader (HsForAllTy _ tvs ltype) + do_args _n leader (HsForAllTy _ fvf tvs ltype) = [ ( decltt leader - , decltt (hsep (forallSymbol unicode : ppTyVars tvs ++ [dot])) + , decltt (hsep (forallSymbol unicode : ppTyVars tvs ++ + [ppForAllSeparator unicode fvf])) <+> ppLType unicode ltype ) ] do_args n leader (HsQualTy _ lctxt ltype) @@ -508,6 +509,12 @@ ppSubSigLike unicode typ argDocs subdocs leader = do_args 0 leader typ gadtOpen = text "\\{" +ppForAllSeparator :: Bool -> ForallVisFlag -> LaTeX +ppForAllSeparator unicode fvf = + case fvf of + ForallVis -> text "\\ " <> arrow unicode + ForallInvis -> dot + ppTypeSig :: [Name] -> HsType DocNameI -> Bool -> LaTeX ppTypeSig nms ty unicode = hsep (punctuate comma $ map ppSymName nms) @@ -1028,8 +1035,9 @@ ppr_mono_lty ty unicode = ppr_mono_ty (unLoc ty) unicode ppr_mono_ty :: HsType DocNameI -> Bool -> LaTeX -ppr_mono_ty (HsForAllTy _ tvs ty) unicode - = sep [ hsep (forallSymbol unicode : ppTyVars tvs) <> dot +ppr_mono_ty (HsForAllTy _ fvf tvs ty) unicode + = sep [ hsep (forallSymbol unicode : ppTyVars tvs) <> + ppForAllSeparator unicode fvf , ppr_mono_lty ty unicode ] ppr_mono_ty (HsQualTy _ ctxt ty) unicode = sep [ ppLContext ctxt unicode |