-import DataCon ( DataCon, isNullarySrcDataCon, dataConUnivTyVars,
- mkDataCon, dataConFieldLabels, dataConInstOrigArgTys,
- dataConTyCon )
-import Var ( tyVarKind, TyVar, Id )
-import VarSet ( isEmptyVarSet, intersectVarSet, elemVarSet )
-import TysWiredIn ( unitTy )
-import BasicTypes ( RecFlag, StrictnessMark(..) )
-import Name ( Name )
-import OccName ( mkDataConWrapperOcc, mkDataConWorkerOcc,
- mkClassTyConOcc, mkClassDataConOcc,
- mkSuperDictSelOcc, mkNewTyCoOcc, mkLocalOcc )
-import MkId ( mkDataConIds, mkRecordSelId, mkDictSelId )
-import Class ( mkClass, Class( classTyCon), FunDep, DefMeth(..) )
-import TyCon ( mkSynTyCon, mkAlgTyCon, visibleDataCons,
- tyConStupidTheta, tyConDataCons, isNewTyCon,
- mkClassTyCon, TyCon( tyConTyVars ),
- isRecursiveTyCon, tyConArity, AlgTyConRhs(..),
- SynTyConRhs(..), newTyConRhs, AlgTyConParent(..) )
-import Type ( mkArrowKinds, liftedTypeKind, typeKind,
- tyVarsOfType, tyVarsOfTypes, tyVarsOfPred,
- splitTyConApp_maybe, splitAppTy_maybe,
- getTyVar_maybe,
- mkPredTys, mkTyVarTys, ThetaType, Type, Kind,
- TyThing(..),
- substTyWith, zipTopTvSubst, substTheta, mkForAllTys,
- mkTyConApp, mkTyVarTy )
-import Coercion ( mkNewTypeCoercion )
-import Outputable
-import List ( nub )