
Hi Oleg,
On Tue, Jun 21, 2011 at 09:35,
I have implemented type-level TYPEREP (along with a small library for higher-order functional programming at the type level). Overlapping instances may indeed be avoided. The library does not use functional dependencies either.
At a first glance, I think your TYPEOF encodes less information about types than the new generics Rep. By "less" I mean that one could get that information from Rep (which is derived automatically). Our generics do not, however, encode a type-level natural per type. This greatly simplifies type-level type equality. But I am still doubtful of the runtime performance of your code; also, the need to define a duplicate of the class (MonadState' in your example) bloats the code significantly. Cheers, Pedro