[commit: ghc] wip/generalized-arrow: Type: Special case tyRuntimeRep for Constraint (ef3e900)
git at git.haskell.org
git at git.haskell.org
Fri Mar 25 23:24:30 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/generalized-arrow
Link : http://ghc.haskell.org/trac/ghc/changeset/ef3e9008e640a1a53ca6281718bbb3598a3fa59d/ghc
>---------------------------------------------------------------
commit ef3e9008e640a1a53ca6281718bbb3598a3fa59d
Author: Ben Gamari <ben at smart-cactus.org>
Date: Fri Mar 25 13:13:23 2016 +0100
Type: Special case tyRuntimeRep for Constraint
Since we have been discussing unifying Constraint and * this seems
reasonable for now.
>---------------------------------------------------------------
ef3e9008e640a1a53ca6281718bbb3598a3fa59d
compiler/types/Type.hs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs
index f7c007f..75be46e 100644
--- a/compiler/types/Type.hs
+++ b/compiler/types/Type.hs
@@ -213,7 +213,8 @@ import Class
import TyCon
import TysPrim
import {-# SOURCE #-} TysWiredIn ( listTyCon, typeNatKind
- , typeSymbolKind, runtimeRepTy, liftedTypeKind )
+ , typeSymbolKind, runtimeRepTy, ptrRepLiftedTy
+ , liftedTypeKind )
import PrelNames
import CoAxiom
import {-# SOURCE #-} Coercion
@@ -1023,6 +1024,8 @@ tyConAppArgN n ty
-- | If given a type @TYPE (rr :: RuntimeRep)@ then returns @Just rr@
-- otherwise @Nothing at .
tyRuntimeRep_maybe :: Type -> Maybe Type
+tyRuntimeRep_maybe ty
+ | isConstraintKind ty = Just ptrRepLiftedTy -- FIXME This is a hack
tyRuntimeRep_maybe (TyConApp tc [rr])
| tc == tYPETyCon = ASSERT(typeKind rr `eqType` runtimeRepTy)
Just rr
More information about the ghc-commits
mailing list