[commit: ghc] master: Call arity: Handle type application correctly (d51d7ef)

git at git.haskell.org git at git.haskell.org
Tue Feb 18 18:58:05 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d51d7efd67fec4fd55b42c95d5a8cf17759b9023/ghc

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

commit d51d7efd67fec4fd55b42c95d5a8cf17759b9023
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Feb 18 14:11:11 2014 +0000

    Call arity: Handle type application correctly


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

d51d7efd67fec4fd55b42c95d5a8cf17759b9023
 compiler/simplCore/CallArity.hs |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/compiler/simplCore/CallArity.hs b/compiler/simplCore/CallArity.hs
index 975c703..ccde1ae 100644
--- a/compiler/simplCore/CallArity.hs
+++ b/compiler/simplCore/CallArity.hs
@@ -329,6 +329,10 @@ callArityAnal arity int e@(Var v)
     | otherwise
     = (emptyVarEnv, e)
 
+-- Non-value lambdas are ignored
+callArityAnal arity int (Lam v e) | not (isId v)
+    = second (Lam v) $ callArityAnal arity int e
+
 -- We have a lambda that we are not sure to call. Tail calls therein
 -- are no longer OneAndOnly calls
 callArityAnal 0     int (Lam v e)
@@ -355,6 +359,8 @@ callArityAnal arity int (Let bind e)
 
 -- Application. Increase arity for the called expresion, nothing to know about
 -- the second
+callArityAnal arity int (App e (Type t))
+    = second (\e -> App e (Type t)) $ callArityAnal arity int e
 callArityAnal arity int (App e1 e2)
     = (final_ae, App e1' e2')
   where



More information about the ghc-commits mailing list