
3 Oct
2012
3 Oct
'12
4:26 p.m.
On 03/10/12 14:20, Edward Kmett wrote:
I don't think anyone has proposed weakening parametricity in this way. [snip]
I don't think so either, but is there any reason it shouldn't be done? If you give every type a Typeable instance automatically, then it's not effective as a constraint. The compiler would be free to either still use the type-class mechanism behind the scenes or "simply" replace it with magic:- typeOf :: a -> TypeRep typeOf = rtsInternalGetTypeOf Simon's comment that it "would save tons of lookup in the massive Typeable-instance table" seemed to me to imply that there was some kind of optimisation you could make if Typeable wasn't really a type-class internally anyway. Regards, -- Robin KAY