[nhc-bugs] Exporting class methods

Ian Lynagh igloo at earth.li
Mon Apr 11 16:22:03 EDT 2005


Hi,

Andother problem with both nhc98 1.16 and 1.18.

$ cat Q.hs 
module Q where
import Data.Bits (shiftL)

$ nhc98 -c Q.hs
======  Errors when renaming:
Identifier shiftL used at 4:19-4:24 is not defined.


If I change the second line to

import Data.Bits (Bits(shiftL))

then it compiles fine. ghc and hugs are both happy with it either way.
My reading of the report suggests the first form should be allowed (and
hence this is a bug in nhc98):

http://www.haskell.org/onlinereport/modules.html says:

--------8<----------------8<----------------8<--------
5.2  Export Lists

Entities in an export list may be named as follows:

1. A value, field name, or class method, whether declared in the module
   body or imported, may be named by giving the name of the value as a
   qvarid, which must be in scope.

5.3.1  What is imported

Exactly which entities are to be imported can be specified in one of the
following three ways:

1. The imported entities can be specified explicitly by listing them in
   parentheses. Items in the list have the same form as those in export
   lists, except qualifiers are not permitted and the `module modid'
   entity is not permitted.
--------8<----------------8<----------------8<--------


By the way, these bugs are coming from looking at compiling darcs with
nhc98, but there are also a number of modules/functions missing. Are you
interested in a list of these?

Here is a (probably incomplete) one:

Control.Concurrent.MVar
System.IO (hPutBuf, hGetBuf)
Control.Exception (catch, block, unblock, bracket_)


Thanks
Ian



More information about the Nhc-bugs mailing list