
20 Aug
2004
20 Aug
'04
8:48 a.m.
On Thu, 19 Aug 2004, Sam Mason wrote:
class Foo t where encode :: String -> t decode :: t -> String
test = decode . encode
This currently fails, because the type checker insists on trying to figure out what its type should be - even though it shouldn't be needed.
In contrast to that, test = encode . decode should not fail. :-) Btw. for my association of the names 'encode' and 'decode' the signatures are the other way round, i.e.
decode :: String -> t encode :: t -> String