Re: Bug in Edison Makefile

1999-12-21 Thread Chris Okasaki

Simon Marlow wrote:
  When you call `make all' from the edison subdir, the compiler and the
  flags change magically and dependencies seem to be broken:
 
 You shouldn't try building in the edison subdir; the Makefile in
 fptools/hslibs/data is designed to reach into edison and build the required
 bits.  That way we can keep a full edison distribution in the tree but still
 have an fptools-style Makefile.

I didn't know that!  In that case, the fix is to adjust the Makefile in 
fptools/hslibs/data to add the following compilation flags
  -fallow-undecidable-instances
and
  -funbox-strict-fields
The latter is not absolutely necessary just to get it to compile, 
but Edison is intended to be used with that flag on.

I'll let you know if and when other compilation flags change...

Chris



bug or feature?

1999-12-16 Thread Chris Okasaki

(I'm using GHC 4.04 patchlevel 1...)

Suppose I have a type involving higher kinds such as

  data H f a = H (f a)

and now suppose I want to define equality on this type.
I *cannot* say

  instance Eq (f a) = Eq (H f a) where
H x == H y = x == y

because I get an error message

  Illegal constaint `Eq (f a)' in instance context
(Instance contexts must constrain only type variables)

(BTW, typo in "constaint"...)

However, I *can* say

  data H f a = H (f a)  deriving (Eq)

which presumably generates code internally that is *identical*
to the instance declaration I tried to write.

Is this inconsistency between what can be written manually
and what can be derived deliberate?

-Chris