diff options
author | Ćukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-07-17 18:47:03 +0200 |
---|---|---|
committer | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2015-08-21 18:22:30 +0100 |
commit | 51e145b013380965db7fe2a9983a3064cde57eb9 (patch) | |
tree | 47f78b46ffacb36ac5f3ea394844742345bbe74a /haddock-api/src/Haddock/Backends/Xhtml | |
parent | 9edfaa67b6e4c80df43497f24133530d9a822dc6 (diff) |
Fill in missing cases in specialized type renaming function.
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs | 26 |
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 |