[commit: ghc] wip/ttypeable: Fix primitive types (da824f2)

git at git.haskell.org git at git.haskell.org
Sat Oct 1 21:34:33 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ttypeable
Link       : http://ghc.haskell.org/trac/ghc/changeset/da824f2e5fe3c16ce001d921aab2bb7edbc18866/ghc

>---------------------------------------------------------------

commit da824f2e5fe3c16ce001d921aab2bb7edbc18866
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Mar 16 19:52:17 2016 +0100

    Fix primitive types


>---------------------------------------------------------------

da824f2e5fe3c16ce001d921aab2bb7edbc18866
 compiler/prelude/TysPrim.hs      | 2 +-
 compiler/typecheck/TcInteract.hs | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs
index b8f57c4..f5c80ca 100644
--- a/compiler/prelude/TysPrim.hs
+++ b/compiler/prelude/TysPrim.hs
@@ -24,7 +24,7 @@ module TysPrim(
         openAlphaTy, openBetaTy, openAlphaTyVar, openBetaTyVar,
 
         -- Kind constructors...
-        tYPETyConName, unliftedTypeKindTyConName,
+        tYPETyCon, tYPETyConName, unliftedTypeKindTyConName,
 
         -- Kinds
         tYPE,
diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs
index f5ef7fa..8282312 100644
--- a/compiler/typecheck/TcInteract.hs
+++ b/compiler/typecheck/TcInteract.hs
@@ -24,10 +24,10 @@ import Name
 import PrelNames ( knownNatClassName, knownSymbolClassName,
                    typeableClassName, coercibleTyConKey,
                    heqTyConKey, ipClassKey,
-                   trTYPE'PtrRepLiftedName, trRuntimeRepName, trArrowName )
+                   trTYPEName, trTYPE'PtrRepLiftedName, trRuntimeRepName, trArrowName )
 import TysWiredIn ( typeNatKind, typeSymbolKind, heqDataCon,
                     coercibleDataCon, runtimeRepTy )
-import TysPrim    ( eqPrimTyCon, eqReprPrimTyCon )
+import TysPrim    ( eqPrimTyCon, eqReprPrimTyCon, tYPETyCon )
 import Id( idType )
 import CoAxiom ( Eqn, CoAxiom(..), CoAxBranch(..), fromBranches )
 import Class
@@ -2020,7 +2020,9 @@ matchTypeable clas [k,t]  -- clas = Typeable
   | k `eqType` typeNatKind                 = doTyLit knownNatClassName         t
   | k `eqType` typeSymbolKind              = doTyLit knownSymbolClassName      t
   | t `eqType` liftedTypeKind              = doPrimRep trTYPE'PtrRepLiftedName t
+  | t `eqType` mkTyConTy tYPETyCon         = doPrimRep trTYPEName              t
   | t `eqType` runtimeRepTy                = doPrimRep trRuntimeRepName        t
+  | t `eqType` mkTyConTy funTyCon          = doPrimRep trArrowName             t
   | Just (tc, ks) <- splitTyConApp_maybe t -- See Note [Typeable (T a b c)]
   , onlyNamedBndrsApplied tc ks            = doTyConApp clas t tc
   | Just (arg,ret) <- splitFunTy_maybe t   = doFunTy    clas t arg ret



More information about the ghc-commits mailing list