module BuildTyCl (
buildSynTyCon, buildAlgTyCon, buildDataCon,
buildClass,
- mkAbstractTyConRhs, mkOpenDataTyConRhs, mkOpenNewTyConRhs,
+ mkAbstractTyConRhs, mkOpenDataTyConRhs,
mkNewTyConRhs, mkDataTyConRhs
) where
import TyCon
import Type
import Coercion
-import Outputable
import Data.List
\end{code}
mkAbstractTyConRhs = AbstractTyCon
mkOpenDataTyConRhs :: AlgTyConRhs
-mkOpenDataTyConRhs = OpenTyCon Nothing False
-
-mkOpenNewTyConRhs :: AlgTyConRhs
-mkOpenNewTyConRhs = OpenTyCon Nothing True
+mkOpenDataTyConRhs = OpenTyCon Nothing
mkDataTyConRhs :: [DataCon] -> AlgTyConRhs
mkDataTyConRhs cons
rhs_ty = head (dataConInstOrigArgTys con (mkTyVarTys tvs))
-- Instantiate the data con with the
-- type variables from the tycon
+ -- NB: a newtype DataCon has no existentials; hence the
+ -- call to dataConInstOrigArgTys has the right type args
etad_tvs :: [TyVar] -- Matched lazily, so that mkNewTypeCoercion can
etad_rhs :: Type -- return a TyCon without pulling on rhs_ty