Empty modules

Morel Pisum morel.pisum at googlemail.com
Thu Sep 20 20:58:51 CEST 2012


Hi Robert Baratheon,

as an alternative, you could just write "module X where" and let the
body empty, I mean, do not write anything afterwards.

But yeah, the report should probably be fixed anyway.

Regards,
Morel Pisum



Am 20.09.2012 20:14, schrieb Reid Barton:
> Just a minor inconsistency in the Haskell 2010 report I happened to
> notice.  The BNF in Section 5.1 disallows an empty module
> 
>     module X where {}
> 
> while the following prose suggests that both the list of import
> declarations and the list of top-level declarations may be empty.  GHC
> does accept such an empty module and I assume the intent of the Report
> is that an empty module should be allowed.
> 
> The Report could be fixed by
> 1. adding an alternative "{ }" production for body
> or
> 2. replacing the bounds on n in impdecls and topdecls by "n >= 0" to
> match the prose. Then the empty module would match both the second and
> third alternatives for body but I do not think this is a concern.
> 
> Regards,
> Reid Barton
> 
> _______________________________________________
> Haskell-prime mailing list
> Haskell-prime at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-prime




More information about the Haskell-prime mailing list