projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Indexed newtypes
[ghc-hetmet.git]
/
compiler
/
types
/
Coercion.lhs
diff --git
a/compiler/types/Coercion.lhs
b/compiler/types/Coercion.lhs
index
fb91a0d
..
ff49a6e
100644
(file)
--- a/
compiler/types/Coercion.lhs
+++ b/
compiler/types/Coercion.lhs
@@
-40,7
+40,7
@@
import Type ( Type, Kind, PredType, substTyWith, mkAppTy, mkForAllTy,
coreEqType, splitAppTys, isTyVarTy, splitTyConApp_maybe,
tyVarsOfType, mkTyVarTys
)
coreEqType, splitAppTys, isTyVarTy, splitTyConApp_maybe,
tyVarsOfType, mkTyVarTys
)
-import TyCon ( TyCon, tyConArity, mkCoercionTyCon, isNewTyCon,
+import TyCon ( TyCon, tyConArity, mkCoercionTyCon, isClosedNewTyCon,
newTyConRhs, newTyConCo,
isCoercionTyCon, isCoercionTyCon_maybe )
import Var ( Var, TyVar, isTyVar, tyVarKind )
newTyConRhs, newTyConCo,
isCoercionTyCon, isCoercionTyCon_maybe )
import Var ( Var, TyVar, isTyVar, tyVarKind )
@@
-451,7
+451,7
@@
splitNewTypeRepCo_maybe :: Type -> Maybe (Type, Coercion)
splitNewTypeRepCo_maybe ty
| Just ty' <- coreView ty = splitNewTypeRepCo_maybe ty'
splitNewTypeRepCo_maybe (TyConApp tc tys)
splitNewTypeRepCo_maybe ty
| Just ty' <- coreView ty = splitNewTypeRepCo_maybe ty'
splitNewTypeRepCo_maybe (TyConApp tc tys)
- | isNewTyCon tc
+ | isClosedNewTyCon tc
= ASSERT( tys `lengthIs` tyConArity tc ) -- splitNewTypeRepCo_maybe only be applied
-- to *types* (of kind *)
case newTyConRhs tc of
= ASSERT( tys `lengthIs` tyConArity tc ) -- splitNewTypeRepCo_maybe only be applied
-- to *types* (of kind *)
case newTyConRhs tc of