The let's aren't really statements, they're just named expressions and are 
still subject to lazy evaluation.

In:

 let x = putStrLn "Name" >> getLine
 putStrLn "Welcome"
 x

The program will print:

 Welcome
 Name?

and then prompt for input, even though the let comes first.

And if you never ran the 'x' action, then the user would just see "Welcome" and 
the block of code would finish (because lazy evaluation still applies).

On Tuesday Aug 10, 2010, at 12:49 PM, Felipe Lessa wrote:

> The (let ... in ...) construct is an expression, while the (let ...)
> inside 'do' is a statement.  The (do ...) itself is an expression.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to