Maurício <[EMAIL PROTECTED]> writes:

>    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

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

Reply via email to