[commit: ghc] overlapping-tyfams: Updates to Haddock to deal with changes in Hs syntax tree (21352a3)
Richard Eisenberg
eir at cis.upenn.edu
Wed Aug 15 17:00:47 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : overlapping-tyfams
http://hackage.haskell.org/trac/ghc/changeset/21352a30cf1956f1e6aa7915f5cd35036893a8b2
>---------------------------------------------------------------
commit 21352a30cf1956f1e6aa7915f5cd35036893a8b2
Author: Richard Eisenberg <eir at seas.upenn.edu>
Date: Tue Aug 7 11:11:57 2012 -0400
Updates to Haddock to deal with changes in Hs syntax tree
>---------------------------------------------------------------
compiler/hsSyn/HsDecls.lhs | 11 +++++++++--
compiler/typecheck/TcTyClsDecls.lhs | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs
index dfa24ca..da14a8a 100644
--- a/compiler/hsSyn/HsDecls.lhs
+++ b/compiler/hsSyn/HsDecls.lhs
@@ -18,7 +18,7 @@ module HsDecls (
isClassDecl, isDataDecl, isSynDecl, isFamilyDecl, tcdName,
tyFamInstDeclName, tyFamInstDeclLName,
countTyClDecls, pprTyClDeclFlavour,
- tyClDeclLName,
+ tyClDeclLName, tyClDeclTyVars,
FamilyDecl(..), LFamilyDecl,
-- ** Instance declarations
@@ -527,6 +527,11 @@ tyClDeclLName decl = tcdLName decl
tcdName :: TyClDecl name -> name
tcdName = unLoc . tyClDeclLName
+
+tyClDeclTyVars :: OutputableBndr name => TyClDecl name -> LHsTyVarBndrs name
+tyClDeclTyVars decl@(ForeignType {}) = pprPanic "tyClDeclTyVars" (ppr decl)
+tyClDeclTyVars (FamDecl { tcdFam = FamilyDecl { fdTyVars = tvs } }) = tvs
+tyClDeclTyVars d = tcdTyVars d
\end{code}
\begin{code}
@@ -819,7 +824,9 @@ pprConDecl (ConDecl {con_name = con, con_details = InfixCon {}, con_res = ResTyG
\begin{code}
-- see note [Family instance equation groups]
type LTyFamInstEqn name = Located (TyFamInstEqn name)
-data TyFamInstEqn name -- ^ one equation in a family instance declaration
+
+-- | one equation in a family instance declaration
+data TyFamInstEqn name
= TyFamInstEqn
{ tfie_tycon :: Located name
, tfie_pats :: HsWithBndrs [LHsType name]
diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs
index 48747bc..d4dfa31 100644
--- a/compiler/typecheck/TcTyClsDecls.lhs
+++ b/compiler/typecheck/TcTyClsDecls.lhs
@@ -313,6 +313,7 @@ kcTyClGroup decls
= pprPanic "generaliseTCD" (ppr decl)
| otherwise
+ -- Note: tcdTyVars is safe here because we've eliminated FamDecl and ForeignType
= do { res <- generalise kind_env (tcdName decl) (tcdTyVars decl)
; return [res] }
More information about the Cvs-ghc
mailing list