<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>worksFine = <br>
&nbsp; if True<br>
&nbsp; then putStrLn "True"<br>
&nbsp; else putStrLn "False"<br>
<br>
worksNOT = do<br>
&nbsp; if True<br>
&nbsp; then putStrLn "True"<br>
&nbsp; else putStrLn "False"<br>
<br>
worksAgain = do<br>
&nbsp; if True<br>
&nbsp;&nbsp;&nbsp; then putStrLn "True"<br>
&nbsp;&nbsp;&nbsp; else putStrLn "False"<br>
</tt><font face="Helvetica, Arial, sans-serif"><br>
Of course the worksFine function returns an IO action, so has different
behavior, but I mean the indentation is different. Is this by design?<br>
<br>
<br>
Also the following is rather strange:<br>
<br>
</font><tt>doubleDefError = let x = 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x = 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in x * x<br>
<br>
alsoDoubleDefError = do<br>
&nbsp; let x = 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x = 2<br>
&nbsp; return (x*x)<br>
<br>
doubleDefNOERROR = do<br>
&nbsp; let x = 1<br>
&nbsp; let x = 2<br>
&nbsp; return (x*x)<br>
<br>
</tt><font face="Helvetica, Arial, sans-serif">Now I understand why
this is (the second let starts a new invisible scope no?), but for
newbies, this is all very strange :-)<br>
</font><tt><br>
</tt><font face="Helvetica, Arial, sans-serif">Cheers,<br>
Peter<br>
<br>
</font>
</body>
</html>