cannot build superclass instance
pablocardenal@laplatavive.com
pablocardenal@laplatavive.com
Thu, 5 Apr 2001 21:06:36 -0300
Hello, where is the error?
Tested on Hugs 98 February 2001 in Windows 98 Operating System with options -98 +som
===========================================================
>class Result r where
> nullR :: r
> toList :: Result r' => r -> [r']
instance Result [a] where
nullR = []
-----------------------------------------------
>class Result r => SubResult r where
> sub :: r
>instance SubResult [a] where -- this is the line 22
> sub = []
-----------------------------------------------
if add this line 31, then error in line 22
if remove this line 31, then not error
>instance Result String -- this is the line 31
Reading file "..\core\result.lhs":
Type checking
ERROR ..\core\result.lhs:22 - Cannot build superclass instance
*** Instance : SubResult [a]
*** Context supplied : ()
*** Required superclass : Result [a]
Obviously if replace line 22 with
instance Result [a] => SubResult [a] where -- this is
-- the new line 22
no error occurs, but why if remove the line 31 the error
not occurs ?
In previous version of Hugs (March 1999) this error not
occurs
Thanks.
Pablo de la Hoya Cardenal from Argentina