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

git at git.haskell.org git at git.haskell.org
Fri Jul 8 14:31:23 UTC 2016


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

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

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

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

    Fix primitive types


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

221620edc26d6dbb1879d08021f5ddc8013f4192
 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 1e81004..04a0677 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 277ab6a..2d3a17a 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