
27 Nov
2009
27 Nov
'09
6:14 p.m.
S. Doaitse Swierstra schrieb: [..]
\begin{code} main = do if True then putStrLn "1"; else putStrLn "2" \end{code}
This does also not work with hugs (";" at the end)
This does not work since now you have two ";"'s; one because you wrote one and one because you did not indent the else. Allowing this additional ; was done to prevent confusion, and as you can see even more confusion pops up now;-{{ That is why I expressed my concerns about this grammar patch.
Doaitse
Indeed, these semicolons are confusing. I think it should be possible to allow "then" and "else" starting in the same column as "if" without these ";"s (in a do block). Christian