Commit d51d7efd authored by Joachim Breitner's avatar Joachim Breitner
Browse files

Call arity: Handle type application correctly

parent 7e787e7e
...@@ -329,6 +329,10 @@ callArityAnal arity int e@(Var v) ...@@ -329,6 +329,10 @@ callArityAnal arity int e@(Var v)
| otherwise | otherwise
= (emptyVarEnv, e) = (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 -- We have a lambda that we are not sure to call. Tail calls therein
-- are no longer OneAndOnly calls -- are no longer OneAndOnly calls
callArityAnal 0 int (Lam v e) callArityAnal 0 int (Lam v e)
...@@ -355,6 +359,8 @@ callArityAnal arity int (Let bind e) ...@@ -355,6 +359,8 @@ callArityAnal arity int (Let bind e)
-- Application. Increase arity for the called expresion, nothing to know about -- Application. Increase arity for the called expresion, nothing to know about
-- the second -- 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) callArityAnal arity int (App e1 e2)
= (final_ae, App e1' e2') = (final_ae, App e1' e2')
where where
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment