
Hello John, Wednesday, April 5, 2006, 12:02:16 AM, you wrote:
The obvious solution is to allow out-of-defining-module deriving only for data types where all constructors are exported. Presumably, if someone explicitly hid (at least some of) the constructors of a data type, they did it for a reason and we can hope that they carefully considered the external interface of that type (including instances).
indeed, that is actually a requirement of the original proposal.
i can agree with it with one additional requirement to library writers - provide "internal" modules that export data definitions. without this, it's a big problem to add new functionality with optimal performance. for example, to add Binary instance for Data.Map, the only way is to use fromList/toList functions, what is not the fastest method (i still not tested whether TH provide access to structure of abstract types :) ) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com