[project @ 2002-03-29 21:39:36 by sof]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcTyClsDecls.lhs
index 5101ab3..27476db 100644 (file)
@@ -25,11 +25,11 @@ import TcMonad
 import TcEnv           ( TcEnv, RecTcEnv, TcTyThing(..), TyThing(..), TyThingDetails(..),
                          tcExtendKindEnv, tcLookup, tcExtendGlobalEnv,
                          isLocalThing )
-import TcTyDecls       ( tcTyDecl, kcConDetails, checkValidTyCon )
-import TcClassDcl      ( tcClassDecl1, checkValidClass )
+import TcTyDecls       ( tcTyDecl, kcConDetails )
+import TcClassDcl      ( tcClassDecl1 )
 import TcInstDcls      ( tcAddDeclCtxt )
 import TcMonoType      ( kcHsTyVars, kcHsType, kcHsLiftedSigType, kcHsContext, mkTyClTyVars )
-import TcMType         ( newKindVar, zonkKindEnv )
+import TcMType         ( newKindVar, zonkKindEnv, checkValidTyCon, checkValidClass )
 import TcUnify         ( unifyKind )
 import TcType          ( Type, Kind, TcKind, mkArrowKind, liftedTypeKind, zipFunTys )
 import Type            ( splitTyConApp_maybe )
@@ -334,6 +334,9 @@ buildTyConOrClass dflags is_rec kenv rec_vrcs  rec_details
        tycon = mkAlgTyCon tycon_name tycon_kind tyvars ctxt argvrcs
                           data_cons sel_ids
                           flavour is_rec gen_info
+       -- It's not strictly necesary to mark newtypes as
+       -- recursive if the loop is broken via a data type.
+       -- But I'm not sure it's worth the hassle of discovering that.
 
        gen_info | not (dopt Opt_Generics dflags) = Nothing
                 | otherwise = mkTyConGenInfo tycon sys_names