projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add non-recursive let-bindings for types
[ghc-hetmet.git]
/
compiler
/
deSugar
/
DsUtils.lhs
diff --git
a/compiler/deSugar/DsUtils.lhs
b/compiler/deSugar/DsUtils.lhs
index
4334a12
..
553b468
100644
(file)
--- a/
compiler/deSugar/DsUtils.lhs
+++ b/
compiler/deSugar/DsUtils.lhs
@@
-347,10
+347,10
@@
wrapBinds [] e = e
wrapBinds ((new,old):prs) e = wrapBind new old (wrapBinds prs e)
wrapBind :: Var -> Var -> CoreExpr -> CoreExpr
wrapBinds ((new,old):prs) e = wrapBind new old (wrapBinds prs e)
wrapBind :: Var -> Var -> CoreExpr -> CoreExpr
-wrapBind new old body
+wrapBind new old body -- Can deal with term variables *or* type variables
| new==old = body
| new==old = body
- | isTyVar new = App (Lam new body) (Type (mkTyVarTy old))
- | otherwise = Let (NonRec new (Var old)) body
+ | isTyVar new = Let (mkTyBind new (mkTyVarTy old)) body
+ | otherwise = Let (NonRec new (Var old)) body
seqVar :: Var -> CoreExpr -> CoreExpr
seqVar var body = Case (Var var) var (exprType body)
seqVar :: Var -> CoreExpr -> CoreExpr
seqVar var body = Case (Var var) var (exprType body)