12 Feb
2005
12 Feb
'05
12:42 a.m.
Iavor Diatchki writes in response to Thomas Jäger
Literal patterns need equality: f 2 = e is like: f x | x == 2 = e
These do not force the 'Num' class to be a superclass of 'Ord' or 'Eq'. If 'Num' was not a superclass of 'Eq', whenver you used a literal pattern there would be an extra constraint that there should be equality on the corresponding type.
You mean of course that Eq is a superclass of Num, not the reverse. Anyway, I always hated this, especially working with functional objects for which I had some arithmetic defined... Jerzy Karczmarczuk