[Haskell-cafe] GHC magic optimization ?

Luke Palmer lrpalmer at gmail.com
Fri Dec 4 12:15:05 EST 2009


On Fri, Dec 4, 2009 at 9:44 AM, Mark Lentczner <markl at glyphic.com> wrote:
>
> 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?

where is just sugar for let.

>
>> 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
> http://www.ozonehouse.com/mark/
> mark at glyphic.com
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list