[Haskell-cafe] Re: Eta-expansion destroys memoization?

Max Bolingbroke batterseapower at hotmail.com
Fri Oct 8 13:54:33 EDT 2010

On 8 October 2010 10:54, Simon Marlow <marlowsd at gmail.com> wrote:
> We could make GHC respect the report, but we'd have to use
>  (e op)  ==>  let z = e in \x -> z op x
> to retain sharing without relying on full laziness.
> This might be a good idea in fact - all other things being equal, having
> lambdas be more visible to the compiler is a good thing.

Of course, this change could cause a performance regression to existing code.

Personally, I think that this is a report bug: there is no syntactic
lambda in (`op` e) or (`op` e) so I would expect the evaluation of e
to be shared.


More information about the Haskell-Cafe mailing list