%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1999
%
This stuff is only used for source-code decls; it's recorded in interface
files for imported data types.
-
\begin{code}
module TcTyDecls(
calcRecFlags,
#include "HsVersions.h"
-import TypeRep ( Type(..), TyNote(..), PredType(..) ) -- friend
-import HsSyn ( TyClDecl(..), HsPred(..), LTyClDecl, isClassDecl )
-import RnHsSyn ( extractHsTyNames )
-import Type ( predTypeRep, tcView )
-import HscTypes ( TyThing(..), ModDetails(..) )
-import TyCon ( TyCon, tyConArity, tyConDataCons, tyConTyVars,
- synTyConDefn, isSynTyCon, isAlgTyCon,
- tyConName, isNewTyCon, isProductTyCon, newTyConRhs )
-import Class ( classTyCon )
-import DataCon ( dataConOrigArgTys )
-import Var ( TyVar )
+import TypeRep
+import HsSyn
+import RnHsSyn
+import Type
+import HscTypes
+import TyCon
+import Class
+import DataCon
+import Var
import VarSet
-import Name ( Name, isTyVarName )
+import Name
import NameEnv
import NameSet
-import Digraph ( SCC(..), stronglyConnComp, stronglyConnCompR )
-import BasicTypes ( RecFlag(..) )
-import SrcLoc ( Located(..), unLoc )
+import Digraph
+import BasicTypes
+import SrcLoc
import Outputable
\end{code}
is_rec n | n `elemNameSet` rec_names = Recursive
| otherwise = NonRecursive
- boot_name_set = md_exports boot_details
+ boot_name_set = availsToNameSet (md_exports boot_details)
rec_names = boot_name_set `unionNameSets`
nt_loop_breakers `unionNameSets`
prod_loop_breakers
-- rather less nice, so I'm not going to do that yet.
--------------- Newtypes ----------------------
- new_tycons = filter isNewTyCon all_tycons
+ new_tycons = filter isNewTyConAndNotOpen all_tycons
+ isNewTyConAndNotOpen tycon = isNewTyCon tycon && not (isOpenTyCon tycon)
nt_loop_breakers = mkNameSet (findLoopBreakers nt_edges)
is_rec_nt tc = tyConName tc `elemNameSet` nt_loop_breakers
-- is_rec_nt is a locally-used helper function