Commit 2c5337d3 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Improve specialisation in SpecConstr

This patch enables argToPat to look through let expressions

e.g.	f (let v = rhs in \y -> ...v...)

Here we can specialise for f (\y -> ...) because the rule-matcher will
look through the let.
parent fca93fc5
......@@ -875,6 +875,13 @@ argToPat in_scope con_env (Var v) arg_occ
then return (True, Var v)
else wildCardPat (idType v)
argToPat in_scope con_env (Let _ arg) arg_occ
= argToPat in_scope con_env arg arg_occ
-- Look through let expressions
-- e.g. f (let v = rhs in \y -> ...v...)
-- Here we can specialise for f (\y -> ...)
-- because the rule-matcher will look through the let.
argToPat in_scope con_env arg arg_occ
| is_value_lam arg
= return (True, arg)
......
Markdown is supported
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