aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/Backends')
-rw-r--r--src/Haddock/Backends/Hoogle.hs7
-rw-r--r--src/Haddock/Backends/Html.hs14
2 files changed, 15 insertions, 6 deletions
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs
index b1b08b95..25c5d91e 100644
--- a/src/Haddock/Backends/Hoogle.hs
+++ b/src/Haddock/Backends/Hoogle.hs
@@ -145,10 +145,7 @@ ppClass x = out x{tcdSigs=[]} :
f t = HsForAllTy Implicit [] (reL [context]) (reL t)
context = reL $ HsClassP (unL $ tcdLName x)
- (map (reL . HsTyVar . tyVar . unL) (tcdTyVars x))
-
- tyVar (UserTyVar v _) = v
- tyVar (KindedTyVar v _) = v
+ (map (reL . HsTyVar . hsTyVarName . unL) (tcdTyVars x))
ppInstance :: Instance -> [String]
@@ -191,7 +188,7 @@ ppCtor dat subdocs con = doc (lookupCon subdocs (con_name con))
name = out $ unL $ con_name con
resType = case con_res con of
- ResTyH98 -> apps $ map (reL . HsTyVar) $ unL (tcdLName dat) : [x | UserTyVar x _ <- map unL $ tcdTyVars dat]
+ ResTyH98 -> apps $ map (reL . HsTyVar) $ unL (tcdLName dat) : [hsTyVarName v | v@UserTyVar {} <- map unL $ tcdTyVars dat]
ResTyGADT x -> x
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs
index b1290fd5..47930ed4 100644
--- a/src/Haddock/Backends/Html.hs
+++ b/src/Haddock/Backends/Html.hs
@@ -1368,7 +1368,11 @@ ppShortConstr summary con unicode = case con_res con of
mkFunTy a b = noLoc (HsFunTy a b)
-- ppConstrHdr is for (non-GADT) existentials constructors' syntax
+#if __GLASGOW_HASKELL__ == 612
+ppConstrHdr :: HsExplicitForAll -> [Name] -> HsContext DocName -> Bool -> Html
+#else
ppConstrHdr :: HsExplicitFlag -> [Name] -> HsContext DocName -> Bool -> Html
+#endif
ppConstrHdr forall tvs ctxt unicode
= (if null tvs then noHtml else ppForall)
+++
@@ -1580,7 +1584,11 @@ ppFunLhType unicode ty = ppr_mono_ty pREC_FUN ty unicode
-- Drop top-level for-all type variables in user style
-- since they are implicit in Haskell
+#if __GLASGOW_HASKELL__ == 612
+ppForAll :: HsExplicitForAll -> [Located (HsTyVarBndr DocName)]
+#else
ppForAll :: HsExplicitFlag -> [Located (HsTyVarBndr DocName)]
+#endif
-> Located (HsContext DocName) -> Bool -> Html
ppForAll expl tvs cxt unicode
| show_forall = forall_part <+> ppLContext cxt unicode
@@ -1610,8 +1618,12 @@ ppr_mono_ty _ (HsPArrTy ty) u = pabrackets (ppr_mono_lty pREC_TOP
ppr_mono_ty _ (HsPredTy p) u = parens (ppPred u p)
ppr_mono_ty _ (HsNumTy n) _ = toHtml (show n) -- generics only
ppr_mono_ty _ (HsSpliceTy {}) _ = error "ppr_mono_ty HsSpliceTy"
+#if __GLASGOW_HASKELL__ == 612
+ppr_mono_ty _ (HsSpliceTyOut {}) _ = error "ppr_mono_ty HsQuasiQuoteTy"
+#else
ppr_mono_ty _ (HsQuasiQuoteTy {}) _ = error "ppr_mono_ty HsQuasiQuoteTy"
-ppr_mono_ty _ (HsRecTy _) _ = error "ppr_mono_ty HsRecTy"
+#endif
+ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy"
ppr_mono_ty ctxt_prec (HsAppTy fun_ty arg_ty) unicode
= maybeParen ctxt_prec pREC_CON $