X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FBuildTyCl.lhs;h=9f35453b590cc0e33e561b3e1ec6e8eadc0fe250;hb=2b6729b13977b9fdc4a2120a0bbb7c0865b93198;hp=8689306e6944324cd63a044810260b9e2d8b5f90;hpb=13cd965d80be5c25dc54534a833df39ab7aa7a12;p=ghc-hetmet.git diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index 8689306..9f35453 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -7,7 +7,7 @@ module BuildTyCl ( buildSynTyCon, buildAlgTyCon, buildDataCon, buildClass, - mkAbstractTyConRhs, mkOpenDataTyConRhs, mkOpenNewTyConRhs, + mkAbstractTyConRhs, mkOpenDataTyConRhs, mkNewTyConRhs, mkDataTyConRhs ) where @@ -28,7 +28,6 @@ import Class import TyCon import Type import Coercion -import Outputable import Data.List \end{code} @@ -116,10 +115,7 @@ mkAbstractTyConRhs :: AlgTyConRhs mkAbstractTyConRhs = AbstractTyCon mkOpenDataTyConRhs :: AlgTyConRhs -mkOpenDataTyConRhs = OpenTyCon Nothing False - -mkOpenNewTyConRhs :: AlgTyConRhs -mkOpenNewTyConRhs = OpenTyCon Nothing True +mkOpenDataTyConRhs = OpenTyCon Nothing mkDataTyConRhs :: [DataCon] -> AlgTyConRhs mkDataTyConRhs cons @@ -152,6 +148,8 @@ mkNewTyConRhs tycon_name tycon con 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