projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement -X=GADTs and -X=RelaxedPolyRec
[ghc-hetmet.git]
/
compiler
/
typecheck
/
TcTyDecls.lhs
diff --git
a/compiler/typecheck/TcTyDecls.lhs
b/compiler/typecheck/TcTyDecls.lhs
index
04602ac
..
d05ade3
100644
(file)
--- a/
compiler/typecheck/TcTyDecls.lhs
+++ b/
compiler/typecheck/TcTyDecls.lhs
@@
-8,7
+8,6
@@
Analysis functions over data types. Specficially, detecting recursive types.
This stuff is only used for source-code decls; it's recorded in interface
files for imported data types.
This stuff is only used for source-code decls; it's recorded in interface
files for imported data types.
-
\begin{code}
module TcTyDecls(
calcRecFlags,
\begin{code}
module TcTyDecls(
calcRecFlags,
@@
-25,8
+24,6
@@
import HscTypes
import TyCon
import Class
import DataCon
import TyCon
import Class
import DataCon
-import Var
-import VarSet
import Name
import NameEnv
import NameSet
import Name
import NameEnv
import NameSet
@@
-281,6
+278,7
@@
new_tc_rhs tc = snd (newTyConRhs tc) -- Ignore the type variables
getTyCon (ATyCon tc) = tc
getTyCon (AClass cl) = classTyCon cl
getTyCon (ATyCon tc) = tc
getTyCon (AClass cl) = classTyCon cl
+getTyCon other = panic "getTyCon"
findLoopBreakers :: [(TyCon, [TyCon])] -> [Name]
-- Finds a set of tycons that cut all loops
findLoopBreakers :: [(TyCon, [TyCon])] -> [Name]
-- Finds a set of tycons that cut all loops
@@
-313,6
+311,7
@@
tcTyConsOfType ty
go (PredTy (IParam _ ty)) = go ty
go (PredTy (ClassP cls tys)) = go_tc (classTyCon cls) tys
go (ForAllTy _ ty) = go ty
go (PredTy (IParam _ ty)) = go ty
go (PredTy (ClassP cls tys)) = go_tc (classTyCon cls) tys
go (ForAllTy _ ty) = go ty
+ go other = panic "tcTyConsOfType"
go_tc tc tys = extendNameEnv (go_s tys) (tyConName tc) tc
go_s tys = foldr (plusNameEnv . go) emptyNameEnv tys
go_tc tc tys = extendNameEnv (go_s tys) (tyConName tc) tc
go_s tys = foldr (plusNameEnv . go) emptyNameEnv tys