diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2013-01-30 14:29:20 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2013-01-30 14:29:20 +0000 |
commit | dd86634af16956f555b228948acc578d678219b4 (patch) | |
tree | 314422e13d45aa53f09092064e2f9e2a57697342 /compiler/vectorise | |
parent | 677144b858f4a425e77399bdfbfcd43dbabd1488 (diff) | |
parent | 9c6dd15b206bddc860a537cc059284ba4b6aa80f (diff) | |
download | haskell-dd86634af16956f555b228948acc578d678219b4.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/ghc
Conflicts:
compiler/types/Coercion.lhs
Diffstat (limited to 'compiler/vectorise')
-rw-r--r-- | compiler/vectorise/Vectorise/Generic/PAMethods.hs | 4 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise/Generic/PData.hs | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/compiler/vectorise/Vectorise/Generic/PAMethods.hs b/compiler/vectorise/Vectorise/Generic/PAMethods.hs index f5cbf93434..af815c9294 100644 --- a/compiler/vectorise/Vectorise/Generic/PAMethods.hs +++ b/compiler/vectorise/Vectorise/Generic/PAMethods.hs @@ -23,7 +23,6 @@ import Type import OccName import Coercion import MkId -import Name import FamInst import DynFlags @@ -38,7 +37,8 @@ buildPReprTyCon orig_tc vect_tc repr = do name <- mkLocalisedName mkPReprTyConOcc (tyConName orig_tc) rhs_ty <- sumReprType repr prepr_tc <- builtin preprTyCon - liftDs $ mkFreshenedSynInstLoc (getSrcSpan name) name tyvars prepr_tc instTys rhs_ty + let axiom = mkSingleCoAxiom name tyvars prepr_tc instTys rhs_ty + liftDs $ newFamInst SynFamilyInst False axiom where tyvars = tyConTyVars vect_tc instTys = [mkTyConApp vect_tc . mkTyVarTys $ tyConTyVars vect_tc] diff --git a/compiler/vectorise/Vectorise/Generic/PData.hs b/compiler/vectorise/Vectorise/Generic/PData.hs index cbedf8d8e0..893f1559be 100644 --- a/compiler/vectorise/Vectorise/Generic/PData.hs +++ b/compiler/vectorise/Vectorise/Generic/PData.hs @@ -14,11 +14,13 @@ import Vectorise.Generic.Description import Vectorise.Utils import Vectorise.Env( GlobalEnv( global_fam_inst_env ) ) +import Coercion( mkSingleCoAxiom ) import BasicTypes import BuildTyCl import DataCon import TyCon import Type +import FamInst import FamInstEnv import TcMType import Name @@ -45,9 +47,10 @@ buildDataFamInst name' fam_tc vect_tc rhs = do { axiom_name <- mkDerivedName mkInstTyCoOcc name' ; (_, tyvars') <- liftDs $ tcInstSkolTyVarsLoc (getSrcSpan name') tyvars - ; let fam_inst = mkDataFamInst axiom_name tyvars' fam_tc pat_tys rep_tc - ax = famInstAxiom fam_inst - pat_tys = [mkTyConApp vect_tc (mkTyVarTys tyvars')] + ; let ax = mkSingleCoAxiom axiom_name tyvars' fam_tc pat_tys rep_ty + tys' = mkTyVarTys tyvars' + rep_ty = mkTyConApp rep_tc tys' + pat_tys = [mkTyConApp vect_tc tys'] rep_tc = buildAlgTyCon name' tyvars' Nothing @@ -57,7 +60,7 @@ buildDataFamInst name' fam_tc vect_tc rhs False -- Not promotable False -- not GADT syntax (FamInstTyCon ax fam_tc pat_tys) - ; return fam_inst } + ; liftDs $ newFamInst (DataFamilyInst rep_tc) False ax } where tyvars = tyConTyVars vect_tc rec_flag = boolToRecFlag (isRecursiveTyCon vect_tc) |