summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2011-11-25 22:57:40 +1100
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2011-11-25 23:03:01 +1100
commit18aae18503442276e14a47eabf4786bc7210662e (patch)
treedfc556a1b047c0031342db4b8e8d429b5f230613 /compiler/deSugar
parent498467cf44e871a6abdb1e16714f6e91c7b10a80 (diff)
downloadhaskell-18aae18503442276e14a47eabf4786bc7210662e.tar.gz
Fix newtype wrapper for 'PData[s] (Wrap a)' and fix VECTORISE type and instance pragmas
* Correct usage of new type wrappers from MkId * 'VECTORISE [SCALAR] type T = S' didn't work correctly across module boundaries * Clean up 'VECTORISE SCALAR instance'
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/Desugar.lhs13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs
index e88b57e835..d0713bcf99 100644
--- a/compiler/deSugar/Desugar.lhs
+++ b/compiler/deSugar/Desugar.lhs
@@ -23,6 +23,7 @@ import TcRnTypes
import MkIface
import Id
import Name
+import Type
import InstEnv
import Class
import Avail
@@ -415,15 +416,19 @@ dsVect (L loc (HsVect (L _ v) rhs))
dsVect (L _loc (HsNoVect (L _ v)))
= return $ NoVect v
dsVect (L _loc (HsVectTypeOut isScalar tycon rhs_tycon))
- = return $ VectType isScalar tycon rhs_tycon
+ = return $ VectType isScalar tycon' rhs_tycon
+ where
+ tycon' | Just ty <- coreView $ mkTyConTy tycon
+ , (tycon', []) <- splitTyConApp ty = tycon'
+ | otherwise = tycon
dsVect vd@(L _ (HsVectTypeIn _ _ _))
= pprPanic "Desugar.dsVect: unexpected 'HsVectTypeIn'" (ppr vd)
dsVect (L _loc (HsVectClassOut cls))
= return $ VectClass (classTyCon cls)
dsVect vc@(L _ (HsVectClassIn _))
= pprPanic "Desugar.dsVect: unexpected 'HsVectClassIn'" (ppr vc)
-dsVect (L _loc (HsVectInstOut isScalar inst))
- = return $ VectInst isScalar (instanceDFunId inst)
-dsVect vi@(L _ (HsVectInstIn _ _))
+dsVect (L _loc (HsVectInstOut inst))
+ = return $ VectInst (instanceDFunId inst)
+dsVect vi@(L _ (HsVectInstIn _))
= pprPanic "Desugar.dsVect: unexpected 'HsVectInstIn'" (ppr vi)
\end{code}