aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface/Rename.hs
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2013-06-21 14:08:25 +0100
committerRichard Eisenberg <eir@cis.upenn.edu>2013-06-21 14:08:25 +0100
commitce3ff856c9412d5392fb7a5c37445f60f84cb2d2 (patch)
tree9a3ba795f0def258affe1a4c456edc3bfee6d0fe /src/Haddock/Interface/Rename.hs
parent336e635f0462daadaa280e8c3dbb4f23422e341f (diff)
Updates to reflect changes in HsDecls to support closed type families.
Diffstat (limited to 'src/Haddock/Interface/Rename.hs')
-rw-r--r--src/Haddock/Interface/Rename.hs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs
index a2499726..f21088d8 100644
--- a/src/Haddock/Interface/Rename.hs
+++ b/src/Haddock/Interface/Rename.hs
@@ -379,14 +379,22 @@ renameTyClD d = case d of
renameLSig (L loc sig) = return . L loc =<< renameSig sig
renameFamilyDecl :: FamilyDecl Name -> RnM (FamilyDecl DocName)
-renameFamilyDecl (FamilyDecl { fdFlavour = flav, fdLName = lname
+renameFamilyDecl (FamilyDecl { fdInfo = info, fdLName = lname
, fdTyVars = ltyvars, fdKindSig = tckind }) = do
+ info' <- renameFamilyInfo info
lname' <- renameL lname
ltyvars' <- renameLTyVarBndrs ltyvars
tckind' <- renameMaybeLKind tckind
- return (FamilyDecl { fdFlavour = flav, fdLName = lname'
+ return (FamilyDecl { fdInfo = info', fdLName = lname'
, fdTyVars = ltyvars', fdKindSig = tckind' })
+renameFamilyInfo :: FamilyInfo Name -> RnM (FamilyInfo DocName)
+renameFamilyInfo DataFamily = return DataFamily
+renameFamilyInfo OpenTypeFamily = return OpenTypeFamily
+renameFamilyInfo (ClosedTypeFamily eqns)
+ = do { eqns' <- mapM (renameLThing renameTyFamInstEqn) eqns
+ ; return $ ClosedTypeFamily eqns' }
+
renameDataDefn :: HsDataDefn Name -> RnM (HsDataDefn DocName)
renameDataDefn (HsDataDefn { dd_ND = nd, dd_ctxt = lcontext, dd_cType = cType
, dd_kindSig = k, dd_cons = cons }) = do
@@ -471,10 +479,9 @@ renameClsInstD (ClsInstDecl { cid_poly_ty =ltype, cid_tyfam_insts = lATs, cid_da
renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName)
-renameTyFamInstD (TyFamInstDecl { tfid_eqns = eqns , tfid_group = eqn_group })
- = do { eqns' <- mapM (renameLThing renameTyFamInstEqn) eqns
- ; return (TyFamInstDecl { tfid_eqns = eqns'
- , tfid_group = eqn_group
+renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn })
+ = do { eqn' <- renameLThing renameTyFamInstEqn eqn
+ ; return (TyFamInstDecl { tfid_eqn = eqn'
, tfid_fvs = placeHolderNames }) }
renameTyFamInstEqn :: TyFamInstEqn Name -> RnM (TyFamInstEqn DocName)