aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface/Rename.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/Interface/Rename.hs')
-rw-r--r--src/Haddock/Interface/Rename.hs27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs
index 546ba62b..88e64cfa 100644
--- a/src/Haddock/Interface/Rename.hs
+++ b/src/Haddock/Interface/Rename.hs
@@ -211,6 +211,12 @@ renameFnArgsDoc = mapM renameDoc
renameLType :: LHsType Name -> RnM (LHsType DocName)
renameLType = mapM renameType
+renameLKind :: LHsKind Name -> RnM (LHsKind DocName)
+renameLKind = renameLType
+
+renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName))
+renameMaybeLKind Nothing = return Nothing
+renameMaybeLKind (Just ki) = renameLKind ki >>= return . Just
renameType :: HsType Name -> RnM (HsType DocName)
renameType t = case t of
@@ -240,17 +246,18 @@ renameType t = case t of
HsTupleTy b ts -> return . HsTupleTy b =<< mapM renameLType ts
- HsOpTy a (L loc op) b -> do
+ HsOpTy a (w, (L loc op)) b -> do
op' <- rename op
a' <- renameLType a
b' <- renameLType b
- return (HsOpTy a' (L loc op') b')
+ return (HsOpTy a' (w, (L loc op')) b')
HsParTy ty -> return . HsParTy =<< renameLType ty
HsKindSig ty k -> do
ty' <- renameLType ty
- return (HsKindSig ty' k)
+ k' <- renameLKind k
+ return (HsKindSig ty' k')
HsDocTy ty doc -> do
ty' <- renameLType ty
@@ -263,7 +270,8 @@ renameType t = case t of
renameLTyVarBndr :: LHsTyVarBndr Name -> RnM (LHsTyVarBndr DocName)
renameLTyVarBndr (L loc tv) = do
name' <- rename (hsTyVarName tv)
- return $ L loc (replaceTyVarName tv name')
+ tyvar' <- replaceTyVarName tv name' renameLKind
+ return $ L loc tyvar'
renameLContext :: Located [LHsType Name] -> RnM (Located [LHsType DocName])
@@ -311,19 +319,24 @@ renameTyClD d = case d of
lname' <- renameL lname
return (ForeignType lname' b)
- TyFamily flav lname ltyvars kind -> do
+-- TyFamily flav lname ltyvars kind tckind -> do
+ TyFamily flav lname ltyvars tckind -> do
lname' <- renameL lname
ltyvars' <- mapM renameLTyVarBndr ltyvars
- return (TyFamily flav lname' ltyvars' kind)
+-- kind' <- renameMaybeLKind kind
+ tckind' <- renameMaybeLKind tckind
+-- return (TyFamily flav lname' ltyvars' kind' tckind)
+ return (TyFamily flav lname' ltyvars' tckind')
TyData x lcontext lname ltyvars typats k cons _ -> do
lcontext' <- renameLContext lcontext
lname' <- renameL lname
ltyvars' <- mapM renameLTyVarBndr ltyvars
typats' <- mapM (mapM renameLType) typats
+ k' <- renameMaybeLKind k
cons' <- mapM renameLCon cons
-- I don't think we need the derivings, so we return Nothing
- return (TyData x lcontext' lname' ltyvars' typats' k cons' Nothing)
+ return (TyData x lcontext' lname' ltyvars' typats' k' cons' Nothing)
TySynonym lname ltyvars typats ltype -> do
lname' <- renameL lname