On Sun, Jan 8, 2012 at 12:53, Silvio Frischknecht <silvio.frischi@gmail.com> wrote:
       module  →       module modid [exports] where body
               |       body
       body    →       { impdecls ; topdecls }
               |       { impdecls }
               |       { topdecls }

You can't see it in this mail because there is no font but
the curly braces { } are meant to match the tokens { } and are not
meant as repetition. However, as I understand it, the layout parser
would modify this code:

       module Foo where
       import Bar
       baz=baz

to this code (which doesn't match):

       module Foo where { import Bar ; baz=baz }

and not to this code (which would be required to match):

       module Foo where { { import Bar } ; { baz=baz } }

Pardon?  As I read the spec you quoted, the former agrees with it and the latter does not.   How do you get the (illegal) latter?

2)
In the same section what is it supposed to mean if "module" consists
of only a "body" and not "module modid [exports] where body".

If you don't name a module, the module is imputed to be Main and the symbol main is exported from it.  See the final paragraph of Section 5.1.

--
brandon s allbery                                      allbery.b@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms