[Haskell-beginners] Doubt in let expression

Lakshmi Narasimhan lakshminaras2002 at gmail.com
Sun Apr 11 06:40:07 EDT 2010


Thanks Stephen, that helps.

On Sun, Apr 11, 2010 at 1:58 PM, Stephen Tetley <stephen.tetley at gmail.com>wrote:

> Hello
>
> There is no semantic implication of the difference.
>
> http://haskell.org/onlinereport/syntax-iso.html
>
> The Haskell syntax allows multiple declarations within a single let
> expression:
>
> exp10    ->      ...
>        |       let decls in exp
>
> where decls is a list of declarations, (braces and colons can be
> replaced by layout):
>
> decls    ->      { decl1  ; ... ; decln }
>
> As a let ... in ... is an expression you can choose to write a list of
> declarations as nested let instead as you did in the second version.
>
> >From the original description of GHC intermediate form 'core' [1] page
> 3 shows that GHC chooses to desugar a let expression with a list of
> decls into nested singular let expressions, though this might have
> changed and also I might be misreading how GHC core distinguishes
> recursive let declarations which do appear as lists.
>
> Best wishes
>
> Stephen
>
>
> [1] An External Representation for the GHC Core Language (DRAFT for
> GHC5.02)
> Andrew Tolmach and the GHC Team
>
> GHC doesn't define Haskell of course...
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



-- 
Regards
Lakshmi Narasimhan T V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100411/cfd650ce/attachment.html


More information about the Beginners mailing list