3 May
2001
3 May
'01
8:15 a.m.
Thu, 3 May 2001 02:54:26 EDT, Critterrathman@aol.com <Critterrathman@aol.com> pisze:
class Shape a where getx :: a -> Int setx :: a -> Int -> a
data ExistentialShape = forall a. Shape a => MakeExistentialShape a
instance Shape ExistentialShape where getx (MakeExistentialShape a) = getx a setx (MakeExistentialShape a) newx = setx a newx
Should be: setx (MakeExistentialShape a) newx = MakeExistentialShape (setx a newx) The result of setx must have the same type as its first argument. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK