summaryrefslogtreecommitdiff
path: root/compiler/vectorise
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2014-11-19 22:03:05 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2014-11-20 18:56:36 +0100
commit696fc4ba5b36f478d8daec56656ebf7d99e18159 (patch)
tree17837c1712b5b042cc92f8ca8687f5d08f5c84aa /compiler/vectorise
parent64cb49686457c233d0f58e5cfa324ad28a5453a3 (diff)
downloadhaskell-696fc4ba5b36f478d8daec56656ebf7d99e18159.tar.gz
Split SynTyCon to SynonymTyCon and FamilyTyCon
This patch refactors internal representation of type synonyms and type families by splitting them into two separate data constructors of TyCon data type. The main motivation is is that some fields make sense only for type synonyms and some make sense only for type families. This will be even more true with the upcoming injective type families. There is also some refactoring of names to keep the naming constistent. And thus tc_kind field has become tyConKind and tc_roles has become tcRoles. Both changes are not visible from the outside of TyCon module. Updates haddock submodule Reviewers: simonpj Differential Revision: https://phabricator.haskell.org/D508 GHC Trac Issues: #9812
Diffstat (limited to 'compiler/vectorise')
-rw-r--r--compiler/vectorise/Vectorise/Type/Env.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/vectorise/Vectorise/Type/Env.hs b/compiler/vectorise/Vectorise/Type/Env.hs
index b73d094a65..4643810a24 100644
--- a/compiler/vectorise/Vectorise/Type/Env.hs
+++ b/compiler/vectorise/Vectorise/Type/Env.hs
@@ -234,7 +234,8 @@ vectTypeEnv tycons vectTypeDecls vectClassDecls
-- warn the user about unvectorised type constructors
; let explanation = ptext (sLit "(They use unsupported language extensions") $$
ptext (sLit "or depend on type constructors that are not vectorised)")
- drop_tcs_nosyn = filter (not . isSynTyCon) drop_tcs
+ drop_tcs_nosyn = filter (not . isTypeFamilyTyCon) .
+ filter (not . isTypeSynonymTyCon) $ drop_tcs
; unless (null drop_tcs_nosyn) $
emitVt "Warning: cannot vectorise these type constructors:" $
pprQuotedList drop_tcs_nosyn $$ explanation
@@ -356,7 +357,7 @@ vectTypeEnv tycons vectTypeDecls vectClassDecls
origName = tyConName origTyCon
vectName = tyConName vectTyCon
- mkSyn canonName ty = mkSynTyCon canonName (typeKind ty) [] [] (SynonymTyCon ty) NoParentTyCon
+ mkSyn canonName ty = mkSynonymTyCon canonName (typeKind ty) [] [] ty
defDataCons
| isAbstract = return ()