On Mon, Apr 1, 2013 at 9:32 AM, Richard Eisenberg <eir@cis.upenn.edu> wrote:

Normal "let":
In a function (which does not use "do"), you can use "let" to make local variables. The word "in" separates the local variable declaration from the part of your function where you want to use that variable. Loosely translating from Haskell to C++:

Haskell:
> let foo = bar in baz

C++:
> /* insert correct type here */ foo = bar;
> baz



For the C++, I'd say

> {
>   /* insert correct type here */ foo = bar;
>   baz
> }

for let ... in, whereas let without in (only permitted in do notation) discards those braces.