aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs26
1 files changed, 15 insertions, 11 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs
index 1a8446ee..c59dd2c8 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs
@@ -122,26 +122,26 @@ renameType (HsFunTy la lr) = HsFunTy <$> renameLType la <*> renameLType lr
renameType (HsListTy lt) = HsListTy <$> renameLType lt
renameType (HsPArrTy lt) = HsPArrTy <$> renameLType lt
renameType (HsTupleTy srt lt) = HsTupleTy srt <$> mapM renameLType lt
-renameType (HsOpTy la lop lb) = HsOpTy
- <$> renameLType la
- <*> pure lop -- TODO.
- <*> renameLType lb
+renameType (HsOpTy la lop lb) =
+ HsOpTy <$> renameLType la <*> renameLTyOp lop <*> renameLType lb
renameType (HsParTy lt) = HsParTy <$> renameLType lt
renameType (HsIParamTy ip lt) = HsIParamTy ip <$> renameLType lt
renameType (HsEqTy la lb) = HsEqTy <$> renameLType la <*> renameLType lb
renameType (HsKindSig lt lk) = HsKindSig <$> renameLType lt <*> pure lk
-renameType t@(HsQuasiQuoteTy _) = pure t -- TODO.
-renameType t@(HsSpliceTy _ _) = pure t -- TODO.
-renameType t@(HsDocTy _ _) = pure t -- TODO.
+renameType t@(HsQuasiQuoteTy _) = pure t
+renameType t@(HsSpliceTy _ _) = pure t
+renameType (HsDocTy lt doc) = HsDocTy <$> renameLType lt <*> pure doc
renameType (HsBangTy bang lt) = HsBangTy bang <$> renameLType lt
-renameType t@(HsRecTy _) = pure t -- TODO.
+renameType t@(HsRecTy _) = pure t
renameType t@(HsCoreTy _) = pure t
-renameType t@(HsExplicitListTy _ _) = pure t -- TODO.
-renameType t@(HsExplicitTupleTy _ _) = pure t -- TODO.
+renameType (HsExplicitListTy ph ltys) =
+ HsExplicitListTy ph <$> mapM renameLType ltys
+renameType (HsExplicitTupleTy phs ltys) =
+ HsExplicitTupleTy phs <$> mapM renameLType ltys
renameType t@(HsTyLit _) = pure t
renameType (HsWrapTy wrap t) = HsWrapTy wrap <$> renameType t
renameType HsWildcardTy = pure HsWildcardTy
-renameType t@(HsNamedWildcardTy _) = pure t -- TODO.
+renameType (HsNamedWildcardTy name) = HsNamedWildcardTy <$> renameName name
renameLType :: Ord name => LHsType name -> Rename name (LHsType name)
@@ -165,6 +165,10 @@ renameTyVarBndr (KindedTyVar name kinds) =
KindedTyVar <$> located renameNameBndr name <*> pure kinds
+renameLTyOp :: Ord name => LHsTyOp name -> Rename name (LHsTyOp name)
+renameLTyOp (wrap, lname) = (,) wrap <$> located renameName lname
+
+
renameNameBndr :: Ord name => name -> Rename name name
renameNameBndr name = do
fv <- ask