[nhc-bugs] problems compiling

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Mon, 3 Dec 2001 15:54:43 +0000


> After a long hiatus (having switched over hugs/ghc due to the *need*
> for rank2 polymorphic types -- hint, hint).

We'd be delighted if someone volunteered to overhaul nhc98's type checker.

>   When compiling Func.hs:
>     module Func where
>     import Prelude hiding ((&&),(||),not)
> 
>   I get this:
>             Error when renaming::
>     Identifier Prelude.&& used at 14:24 is not defined.

Yes, this is a rather ugly bug.  Let me guess that on line 14 you have
a deriving clause for one of Eq, Ord, or Ix?  Unfortunately you have
hidden the function Prelude.&& which is used in the derived code.  As
a workaround, you should add the line

>     import qualified Prelude ((&&))

to your module.  In a future release of nhc98, we will ensure that
Prelude entities introduced by the compiler are always available to
it, even when they are hidden from the user's code.

> Problem 2, when trying to compile for tracing:
> 
>   Fail: The class Prelude.Enum has no instance for the type Prelude.R.
>   Possible sources for the problem are: 9:6

Could you send an example source file for this bug please?

> BTW, Are the "14:24" and "9:6" messages attempting to refer to line
> and columns or something totally different?

Yes, they are line:column references.

Regards,
    Malcolm