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 )
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