| This is a bug that I found in the latest version of Hugs1.4, but not in
| Hugs98.
| 
| I loaded the following piece of code.
| 
| >>>
| class Foo a where
|   foo :: a -> Int
| 
| instance Foo a => Foo [a] where
|   foo = sum . map foo
| 
| class Bar a where
|   bar :: Foo b => a -> [b] -> Int
| 
| instance Bar Int where
|   bar n bs = n + foo bs
| <<<
| 
| The use of "foo" with the list "bs" on the last line is valid, because of
| the instance declaration Foo a => Foo [a]. But Hugs complains.

Yes, this is described (very briefly) in the section of the Hugs 1.4
manual describing differences between Hugs 1.4 and Haskell 1.4.  The
relevant text is attached below.  It is caused by a fundamental difference
in the underlying type systems of Hugs 1.4 and Haskell 1.4.  In the move
to Hugs 98, the type checker was given a major overhaul and the differences
were eliminated.  That's why you won't experience these problems with
Hugs 98.  (The problem with polymorphic recursion, also mentioned
below, was also fixed by the same overhaul.)

As far as I'm aware, nobody is planning to support Hugs 1.4 or older
any more, and you're strongly encouraged to move on up to Hugs/Haskell 98
which does all that the old system did, plus much more.

All the best,
Mark


------------------

There are some subtle differences between the Hugs and Haskell
type systems.  In particular:

 o  Polymorphic recursion is only supported for values whose declared
    types do not include any class constraints.
 o  Some valid Haskell programs that make essential use of the local
    class constraints that are sometimes associated with individual
    member functions are treated as type errors in Hugs.

Reply via email to