[Hugs-bugs] existentials

Ross Paterson ross at soi.city.ac.uk
Sat Oct 29 16:35:27 EDT 2005


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.



More information about the Hugs-Bugs mailing list