summaryrefslogtreecommitdiff
path: root/compiler/prelude/THNames.hs
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2015-11-11 10:49:22 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2015-12-21 20:47:16 +0100
commiteeecb8647585ad9eea0554b2f97a3645d2c59f88 (patch)
treed2294dd80400f495deab260e4e810b7dcbefb096 /compiler/prelude/THNames.hs
parenta61e717fcff9108337b1d35783ea3afbf591d3c6 (diff)
downloadhaskell-eeecb8647585ad9eea0554b2f97a3645d2c59f88.tar.gz
Add proper GADTs support to Template Haskell
Until now GADTs were supported in Template Haskell by encoding them using normal data types. This patch adds proper support for representing GADTs in TH. Test Plan: T10828 Reviewers: goldfire, austin, bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1465 GHC Trac Issues: #10828
Diffstat (limited to 'compiler/prelude/THNames.hs')
-rw-r--r--compiler/prelude/THNames.hs23
1 files changed, 14 insertions, 9 deletions
diff --git a/compiler/prelude/THNames.hs b/compiler/prelude/THNames.hs
index 571487a274..d683b1a9b4 100644
--- a/compiler/prelude/THNames.hs
+++ b/compiler/prelude/THNames.hs
@@ -76,7 +76,7 @@ templateHaskellNames = [
-- Strict
isStrictName, notStrictName, unpackedName,
-- Con
- normalCName, recCName, infixCName, forallCName,
+ normalCName, recCName, infixCName, forallCName, gadtCName, recGadtCName,
-- StrictType
strictTypeName,
-- VarStrictType
@@ -356,11 +356,13 @@ notStrictName = libFun (fsLit "notStrict") notStrictKey
unpackedName = libFun (fsLit "unpacked") unpackedKey
-- data Con = ...
-normalCName, recCName, infixCName, forallCName :: Name
-normalCName = libFun (fsLit "normalC") normalCIdKey
-recCName = libFun (fsLit "recC") recCIdKey
-infixCName = libFun (fsLit "infixC") infixCIdKey
-forallCName = libFun (fsLit "forallC") forallCIdKey
+normalCName, recCName, infixCName, forallCName, gadtCName, recGadtCName :: Name
+normalCName = libFun (fsLit "normalC" ) normalCIdKey
+recCName = libFun (fsLit "recC" ) recCIdKey
+infixCName = libFun (fsLit "infixC" ) infixCIdKey
+forallCName = libFun (fsLit "forallC" ) forallCIdKey
+gadtCName = libFun (fsLit "gadtC" ) gadtCIdKey
+recGadtCName = libFun (fsLit "recGadtC") recGadtCIdKey
-- type StrictType = ...
strictTypeName :: Name
@@ -801,19 +803,22 @@ notStrictKey = mkPreludeMiscIdUnique 364
unpackedKey = mkPreludeMiscIdUnique 365
-- data Con = ...
-normalCIdKey, recCIdKey, infixCIdKey, forallCIdKey :: Unique
+normalCIdKey, recCIdKey, infixCIdKey, forallCIdKey, gadtCIdKey,
+ recGadtCIdKey :: Unique
normalCIdKey = mkPreludeMiscIdUnique 370
recCIdKey = mkPreludeMiscIdUnique 371
infixCIdKey = mkPreludeMiscIdUnique 372
forallCIdKey = mkPreludeMiscIdUnique 373
+gadtCIdKey = mkPreludeMiscIdUnique 374
+recGadtCIdKey = mkPreludeMiscIdUnique 375
-- type StrictType = ...
strictTKey :: Unique
-strictTKey = mkPreludeMiscIdUnique 374
+strictTKey = mkPreludeMiscIdUnique 376
-- type VarStrictType = ...
varStrictTKey :: Unique
-varStrictTKey = mkPreludeMiscIdUnique 375
+varStrictTKey = mkPreludeMiscIdUnique 377
-- data Type = ...
forallTIdKey, varTIdKey, conTIdKey, tupleTIdKey, unboxedTupleTIdKey, arrowTIdKey,