Chris Okasaki wrote:

> I'm using the November 99 Hugs on an x86 running Linux.
> It seems to be hanging when it tries to access a dictionary
> through a superclass.  Here's the simplest program
> I can come up with that exhibits the bug.
>
> >  class Eq a => Super c a where
> >      empty :: c a
> >  class Super c a => Sub c a where
> >      f :: c a -> Bool
> >      g :: c a -> Bool
> >
> >  instance Eq a => Super [] a
> >  instance Eq a => Sub [] a where
> >      f [x,y] = x == y
> >      g [x,y] = True
> >
> >  p :: [Int]
> >  p = [1,2]
>
> Now, when I say
>     g p
> it immediately returns True as expected.  But when I say
>     f p
> it hangs.

The problem is that hugs fools itself into thinking that the `Sub'
instance doesn't really depend on `Eq a' (if you comment out the `Eq a',
in the `Subst' instance, hugs is happy), and conjures an `Eq' dictionary
from out of the ether, which in this case means bottom.

I have no idea how easy this is to fix.

--Jeff

Reply via email to