Ross Paterson | 29 Oct 22:35 2005
Picon

existentials

Iavor Diatchki writes:
> It appears that Hugs (20050909) does not deal correctly with
> existentials and multi-parameter type classes:
> 
> > class C a b where
> >   f              :: a -> b
> >
> > data T b          = forall a. C a b => T a
> >
> > test (T a)        = f a
> 
> Hugs accepts this program, inferring the following type for 'test':
>   Main> :t test
>   test :: C _5 a => T b -> a
>   Main> :t test (undefined :: T Char)
>   test undefined :: C (T Char) a => a

The same bug shows without multi-parameter type classes: Hugs accepts

	data T = forall a. C a

        test (C x) = toInteger x

Now fixed in CVS.

Gmane