
17 Aug
2007
17 Aug
'07
9:33 p.m.
Adrian Hey wrote:
Benjamin Franksen wrote:
Adrian Hey wrote:
Is there a type that is an instance of Eq, but not Ord (or could not reasonably be made an instance of Ord)?
Data.Typeable.TypeRep
Interesting problem, but I don't see any reason why this could not be an instance of Ord.
I asked this question once and got as answer (from one of the Simons, IIRC) that exposing the obvious Ord instance would break referential transparency: there is no guarantee that the integer keys and therefore the order among TypeReps is the same for different runs, even of the same program. This (counter-)example may be irrelevant for the discussion at hand or not. Anyway, you asked for one... Cheers Ben