
13 Feb
2006
13 Feb
'06
9:27 a.m.
MaurĂcio
Why isn't this one [valid code]?
module Main where main = do { let a = 3; return (); };
My guess is that the compiler is confused about whether you mean do let a = 3 return () or (your intended): do let a = 3 return () A solution which appears to work with GHCi is: do let {a=3}; return () (Note that you don't need the enclosing {}s (although everybody seem to use them), nor the terminating semicolons (they are for statement separation, not termination - Pascal not C) -- they seem to be harmless, though. -k -- If I haven't seen further, it is by standing in the footprints of giants