diff options
-rw-r--r-- | compiler/coreSyn/CoreSubst.lhs | 6 | ||||
-rw-r--r-- | compiler/specialise/SpecConstr.lhs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs index 7dfa25f146..833f19e8f4 100644 --- a/compiler/coreSyn/CoreSubst.lhs +++ b/compiler/coreSyn/CoreSubst.lhs @@ -1307,7 +1307,7 @@ Note [exprIsLiteral_maybe] This function will, given an expression `e`, try to turn it into the form `Lam v e'` (returned as `Just (v,e')`). Besides using lambdas, it looks through -casts (using the Push rule), and it unfoldes function calls if the unfolding +casts (using the Push rule), and it unfolds function calls if the unfolding has a greater arity than arguments are present. Currently, it is used in Rules.match, and is required to make @@ -1321,7 +1321,7 @@ exprIsLambda_maybe :: InScopeEnv -> CoreExpr -> Maybe (Var, CoreExpr) exprIsLambda_maybe _ (Lam x e) = Just (x, e) --- Also possible: A casted lambda. Push the coercion insinde +-- Also possible: A casted lambda. Push the coercion inside exprIsLambda_maybe (in_scope_set, id_unf) (Cast casted_e co) | Just (x, e) <- exprIsLambda_maybe (in_scope_set, id_unf) casted_e -- Only do value lambdas. @@ -1337,7 +1337,7 @@ exprIsLambda_maybe (in_scope_set, id_unf) e | (Var f, as) <- collectArgs e , let unfolding = id_unf f , Just rhs <- expandUnfolding_maybe unfolding - -- Make sure there is hope to get a lamda + -- Make sure there is hope to get a lambda , unfoldingArity unfolding > length (filter isValArg as) -- Optimize, for beta-reduction , let e' = simpleOptExprWith (mkEmptySubst in_scope_set) (rhs `mkApps` as) diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs index 060c705cda..86a56f4013 100644 --- a/compiler/specialise/SpecConstr.lhs +++ b/compiler/specialise/SpecConstr.lhs @@ -335,7 +335,7 @@ I wonder if SpecConstr couldn't be extended to handle this? After all, lambda is a sort of constructor for functions and perhaps it already has most of the necessary machinery? -Furthermore, there's an immediate win, because you don't need to allocate the lamda +Furthermore, there's an immediate win, because you don't need to allocate the lambda at the call site; and if perchance it's called in the recursive call, then you may avoid allocating it altogether. Just like for constructors. |