X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=b7f1a00768b77a987d7087d1cff292746d4fda85;hp=a7aeeec5043cb8f2579bfab962afec6ab26e9186;hb=d5c4754dcb857be7b9f4dbf6482e6050a9cd0991;hpb=b5d068a262d7afe153c12ed593cb8bbb39abe932 diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index a7aeeec..b7f1a00 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -117,7 +117,8 @@ import PrelNames( openTypeKindTyConKey, unliftedTypeKindTyConKey, ubxTupleKindTyConKey, argTypeKindTyConKey ) import TyCon ( TyCon, isRecursiveTyCon, isPrimTyCon, isUnboxedTupleTyCon, isUnLiftedTyCon, - isFunTyCon, isNewTyCon, newTyConRep, newTyConRhs, + isFunTyCon, isNewTyCon, isOpenTyCon, newTyConRep, + newTyConRhs, isAlgTyCon, tyConArity, isSuperKindTyCon, tcExpandTyCon_maybe, coreExpandTyCon_maybe, tyConKind, PrimRep(..), tyConPrimRep, tyConUnique, @@ -448,7 +449,7 @@ repType looks through (b) synonyms (c) predicates (d) usage annotations - (e) all newtypes, including recursive ones + (e) all newtypes, including recursive ones, but not newtype families It's useful in the back end. \begin{code} @@ -457,7 +458,8 @@ repType :: Type -> Type repType ty | Just ty' <- coreView ty = repType ty' repType (ForAllTy _ ty) = repType ty repType (TyConApp tc tys) - | isNewTyCon tc = -- Recursive newtypes are opaque to coreView + | isNewTyCon tc && + not (isOpenTyCon tc) = -- Recursive newtypes are opaque to coreView -- but we must expand them here. Sure to -- be saturated because repType is only applied -- to types of kind *