summaryrefslogtreecommitdiff
path: root/compiler/parser/ParserCore.y
diff options
context:
space:
mode:
authorMax Bolingbroke <batterseapower@hotmail.com>2011-09-10 10:16:38 +0100
committerMax Bolingbroke <batterseapower@hotmail.com>2011-09-27 06:40:58 +0100
commit5d7173f9ab8405511f75765e0541a04796d9bd07 (patch)
treecd34c9f9af8c13c4b6dfa9f953c5c570f1f8f961 /compiler/parser/ParserCore.y
parente2496a8193849620fc6b60a212d855e1624e8587 (diff)
downloadhaskell-5d7173f9ab8405511f75765e0541a04796d9bd07.tar.gz
Change the way IfExtName is serialized so (most) wired-in names get special representation
This lets IfaceType be dumber, with fewer special cases, because deserialization for more wired-in names will work. Once we have polymorphic kinds we will be able to replace IfaceTyCon with a simple IfExtName.
Diffstat (limited to 'compiler/parser/ParserCore.y')
-rw-r--r--compiler/parser/ParserCore.y21
1 files changed, 9 insertions, 12 deletions
diff --git a/compiler/parser/ParserCore.y b/compiler/parser/ParserCore.y
index cd76284df8..99efa7a4ae 100644
--- a/compiler/parser/ParserCore.y
+++ b/compiler/parser/ParserCore.y
@@ -15,19 +15,20 @@ import RdrHsSyn
import HsSyn
import RdrName
import OccName
+import TypeRep ( TyThing(..) )
import Type ( Kind,
liftedTypeKindTyCon, openTypeKindTyCon, unliftedTypeKindTyCon,
argTypeKindTyCon, ubxTupleKindTyCon, mkTyConApp
)
import Coercion( mkArrowKind )
-import Name( Name, nameOccName, nameModule, mkExternalName )
+import Name( Name, nameOccName, nameModule, mkExternalName, wiredInNameTyThing_maybe )
import Module
import ParserCoreUtils
import LexCore
import Literal
import SrcLoc
-import TysPrim( wordPrimTyCon, intPrimTyCon, charPrimTyCon,
- floatPrimTyCon, doublePrimTyCon, addrPrimTyCon )
+import PrelNames
+import TysPrim
import TyCon ( TyCon, tyConName )
import FastString
import Outputable
@@ -362,18 +363,14 @@ toKind (IfaceTyConApp ifKc []) = mkTyConApp (toKindTc ifKc) []
toKind other = pprPanic "toKind" (ppr other)
toKindTc :: IfaceTyCon -> TyCon
-toKindTc IfaceLiftedTypeKindTc = liftedTypeKindTyCon
-toKindTc IfaceOpenTypeKindTc = openTypeKindTyCon
-toKindTc IfaceUnliftedTypeKindTc = unliftedTypeKindTyCon
-toKindTc IfaceUbxTupleKindTc = ubxTupleKindTyCon
-toKindTc IfaceArgTypeKindTc = argTypeKindTyCon
-toKindTc other = pprPanic "toKindTc" (ppr other)
+toKindTc (IfaceTc n) | Just (ATyCon tc) <- wiredInNameTyThing_maybe n = tc
+toKindTc other = pprPanic "toKindTc" (ppr other)
ifaceTcType ifTc = IfaceTyConApp ifTc []
-ifaceLiftedTypeKind = ifaceTcType IfaceLiftedTypeKindTc
-ifaceOpenTypeKind = ifaceTcType IfaceOpenTypeKindTc
-ifaceUnliftedTypeKind = ifaceTcType IfaceUnliftedTypeKindTc
+ifaceLiftedTypeKind = ifaceTcType (IfaceTc liftedTypeKindTyConName)
+ifaceOpenTypeKind = ifaceTcType (IfaceTc openTypeKindTyConName)
+ifaceUnliftedTypeKind = ifaceTcType (IfaceTc unliftedTypeKindTyConName)
ifaceArrow ifT1 ifT2 = IfaceFunTy ifT1 ifT2