X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=480357e80b0054ed93bab6b30c62b568c3c8abb0;hp=de0215e835a15238bd4d8dec191d0be2d8dc5742;hb=121da25a0d638bbe6c7f90525ff50b3a20949bbc;hpb=8bc615fdb45b8e3f2f3ef2167bbb379bf619aab2 diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index de0215e..480357e 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -48,7 +48,7 @@ module Type ( splitTyConApp_maybe, splitTyConApp, splitNewTyConApp_maybe, splitNewTyConApp, - repType, typePrimRep, coreView, tcView, kindView, + repType, repType', typePrimRep, coreView, tcView, kindView, mkForAllTy, mkForAllTys, splitForAllTy_maybe, splitForAllTys, applyTy, applyTys, isForAllTy, dropForAlls, @@ -457,6 +457,16 @@ repType (TyConApp tc tys) repType (new_type_rep tc tys) repType ty = ty +-- repType' aims to be a more thorough version of repType +-- For now it simply looks through the TyConApp args too +repType' ty -- | pprTrace "repType'" (ppr ty $$ ppr (go1 ty)) False = undefined + | otherwise = go1 ty + where + go1 = go . repType + go (TyConApp tc tys) = mkTyConApp tc (map repType' tys) + go ty = ty + + -- new_type_rep doesn't ask any questions: -- it just expands newtype, whether recursive or not new_type_rep new_tycon tys = ASSERT( tys `lengthIs` tyConArity new_tycon )