
22 Nov
2007
22 Nov
'07
8:19 a.m.
worksFine = if True then putStrLn "True" else putStrLn "False" worksNOT = do if True then putStrLn "True" else putStrLn "False" worksAgain = do if True then putStrLn "True" else putStrLn "False" Of course the worksFine function returns an IO action, so has different behavior, but I mean the indentation is different. Is this by design? Also the following is rather strange: doubleDefError = let x = 1 x = 2 in x * x alsoDoubleDefError = do let x = 1 x = 2 return (x*x) doubleDefNOERROR = do let x = 1 let x = 2 return (x*x) Now I understand why this is (the second let starts a new invisible scope no?), but for newbies, this is all very strange :-) Cheers, Peter