diff options
author | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2014-12-02 13:57:46 +0100 |
---|---|---|
committer | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2014-12-02 14:10:09 +0100 |
commit | 668a1379778189495679840e0151dfceed4b8ef7 (patch) | |
tree | d5dfd1a8d27c67070506fd3741695528984f9981 | |
parent | 5d9bb563b5d2cea4635ded27a35dfc421c5558db (diff) | |
download | haskell-668a1379778189495679840e0151dfceed4b8ef7.tar.gz |
Remove references to SynTyCon. Fixes #9812
-rw-r--r-- | compiler/typecheck/TcTyDecls.lhs | 9 | ||||
-rw-r--r-- | compiler/types/TyCon.hs | 4 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise/Utils/Base.hs | 6 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise/Utils/PADict.hs | 3 |
4 files changed, 12 insertions, 10 deletions
diff --git a/compiler/typecheck/TcTyDecls.lhs b/compiler/typecheck/TcTyDecls.lhs index c998853b2a..3f8b234777 100644 --- a/compiler/typecheck/TcTyDecls.lhs +++ b/compiler/typecheck/TcTyDecls.lhs @@ -97,10 +97,10 @@ If we reverse this decision, this comment came from tcTyDecl1, and should We'd also need to add back in this definition -synTyConsOfType :: Type -> [TyCon] +synonymTyConsOfType :: Type -> [TyCon] -- Does not look through type synonyms at all -- Return a list of synonym tycons -synTyConsOfType ty +synonymTyConsOfType ty = nameEnvElts (go ty) where go :: Type -> NameEnv TyCon -- The NameEnv does duplicate elim @@ -110,8 +110,9 @@ synTyConsOfType ty go (FunTy a b) = go a `plusNameEnv` go b go (ForAllTy _ ty) = go ty - go_tc tc tys | isSynTyCon tc = extendNameEnv (go_s tys) (tyConName tc) tc - | otherwise = go_s tys + go_tc tc tys | isTypeSynonymTyCon tc = extendNameEnv (go_s tys) + (tyConName tc) tc + | otherwise = go_s tys go_s tys = foldr (plusNameEnv . go) emptyNameEnv tys ---------------------------------------- END NOTE ] diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 5a2b33e70b..42835452f8 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -140,14 +140,14 @@ Note [Type synonym families] * Translation of type family decl: type family F a :: * translates to - a SynTyCon 'F', whose SynTyConRhs is OpenSynFamilyTyCon + a FamilyTyCon 'F', whose FamTyConFlav is OpenSynFamilyTyCon type family G a :: * where G Int = Bool G Bool = Char G a = () translates to - a SynTyCon 'G', whose SynTyConRhs is ClosedSynFamilyTyCon, with the + a FamilyTyCon 'G', whose FamTyConFlav is ClosedSynFamilyTyCon, with the appropriate CoAxiom representing the equations * In the future we might want to support diff --git a/compiler/vectorise/Vectorise/Utils/Base.hs b/compiler/vectorise/Vectorise/Utils/Base.hs index 7d4bae3046..dc1f210369 100644 --- a/compiler/vectorise/Vectorise/Utils/Base.hs +++ b/compiler/vectorise/Vectorise/Utils/Base.hs @@ -24,7 +24,7 @@ module Vectorise.Utils.Base , pdatasReprTyConExact , pdataUnwrapScrut - , preprSynTyCon + , preprFamInst ) where import Vectorise.Monad @@ -258,5 +258,5 @@ pdataUnwrapScrut (ve, le) -- |Get the representation tycon of the 'PRepr' type family for a given type. -- -preprSynTyCon :: Type -> VM FamInstMatch -preprSynTyCon ty = builtin preprTyCon >>= (`lookupFamInst` [ty]) +preprFamInst :: Type -> VM FamInstMatch +preprFamInst ty = builtin preprTyCon >>= (`lookupFamInst` [ty]) diff --git a/compiler/vectorise/Vectorise/Utils/PADict.hs b/compiler/vectorise/Vectorise/Utils/PADict.hs index 01fbede4bd..c2ca20a683 100644 --- a/compiler/vectorise/Vectorise/Utils/PADict.hs +++ b/compiler/vectorise/Vectorise/Utils/PADict.hs @@ -118,7 +118,8 @@ paMethod method _ ty prDictOfPReprInst :: Type -> VM CoreExpr prDictOfPReprInst ty = do - { (FamInstMatch { fim_instance = prepr_fam, fim_tys = prepr_args }) <- preprSynTyCon ty + { (FamInstMatch { fim_instance = prepr_fam, fim_tys = prepr_args }) + <- preprFamInst ty ; prDictOfPReprInstTyCon ty (famInstAxiom prepr_fam) prepr_args } |