
7 Aug
2011
7 Aug
'11
5:39 p.m.
Hello, I made a parameterized data type EW, which builds on a type of class Read and Show. When showing EW's it shall prefix the output with "EW:". data (Read a,Show a) => EW a = EW a x01 = EW 20 x02 = EW "Test" instance Show (EW a) where show (EW x) = show "EW:" ++ show x But I got a syntax error with this above at "show (EW x) = ...": No instance of (Read a) asrising a use of 'EW' in the pattern .... How can I formulate this show method correctly? I'd appreciate Your help Hartmut