minor errors in Haskell 2010 report

Iavor Diatchki iavor.diatchki at gmail.com
Thu Aug 23 23:15:21 CEST 2012


On Wed, Aug 22, 2012 at 5:32 AM, Ramana Kumar <ramana at member.fsf.org> wrote:

> I recently read http://www.haskell.org/onlinereport/haskell2010/ and
> noticed a few minor issues in Chapter 5.
> Is it easy to correct them on that web page for future readers? If not, at
> least this may be useful for future reports.
> Apologies if these were known already.
> Section 5.2, the first sentence of list item 5 says "The form “module M”
> names the set of all entities that are in scope with both an unqualified
> name “e” and a qualified name “M.e”."
> It is not clear that "in scope" here really means "in scope and exported
> by module M".
I think that the definition in the report is correct and clear.  In
particular "in scope" does not refer to "in scope and exported by module
M".  Consider this example:

> module A (module M) where
> import A as M
> import B as M
> import C(d)
> import qualified D as M (d)

In this case the "module M" declaration refers to all the entities imported
from A and B and, assuming that "d" refers to the same entity in both C &
D, also "d".

The same section (5.2) does contain a slightly inaccurate remark though.
 The report says:

It is an error to use module M in an export list unless M is the module
bearing the export list, *or **M** is imported by at least one import
declaration* (qualified or unqualified).

The above example illustrates that this is not the case: M really should be
the "qualifier" on one of the imports (if the qualifier is omitted, then it
is the same as the module name).  Here is another example to emphasize the

> -- error module
> module A (module M) where
> import M as B

This is an error because M is not the qualifier for any import (the correct
usage is "module B").

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-prime/attachments/20120823/05972ccc/attachment-0001.htm>

More information about the Haskell-prime mailing list