[nhc-bugs] Exporting class methods

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Apr 12 06:42:00 EDT 2005


Ian Lynagh <igloo at earth.li> writes:

> $ 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):

It is a bug, and one I have been aware of for some time.  The
workaround is easy (just change the import line), so fixing it has
not been a high priority.

> 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?

Yes.

> Control.Concurrent.MVar
> Control.Exception (catch, block, unblock, bracket_)

nhc98 at the moment does not implement concurrent threads, nor general
exceptions.  I have made a start on the former (using a similar
cooperative scheduling model to that used in Embedded Gofer), but
it will be some time before it is complete.  If someone else were
looking for a nice self-contained little implementation project,
then either exceptions or threads would be very welcome, and I would
happily pass on the baton.


> System.IO (hPutBuf, hGetBuf)

Implementing binary I/O should be pretty straightforward in nhc98 - it
doesn't perform any CR/LF translation anyway, so there is effectively
no difference between text and binary modes.  Adding these library
functions in particular should come down to writing a few lines of C
and a Haskell FFI wrapper.

Regards,
    Malcolm


More information about the Nhc-bugs mailing list