[Haskell-cafe] GHC magic optimization ?

Mark Lentczner markl at glyphic.com
Fri Dec 4 11:44:44 EST 2009

On Dec 4, 2009, at 2:43 AM, Luke Palmer wrote:

> So GHC leaves it to the user to specify sharing.  If you want an
> expression shared, let bind it and reuse.

Does GHC treat where and let the same in this regard? Or in code, are these treated the same?

> x'' = sum l + product l where l = [1..10^6]

> x' = let l = [1..10^6] in sum l + product l

I couldn't tell if the report implies that or not.

	- Mark

Mark Lentczner
mark at glyphic.com

More information about the Haskell-Cafe mailing list