DrIFT can do this: http://repetae.net/john/computer/haskell/DrIFT/ it is nearing its 2.0 release, if anyone finds any bugs/obvious misfeatures let me know soon. John
----- Original Message ----- From: "Simon Peyton-Jones" <simonpj@microsoft.com> To: "Hal Daume III" <hdaume@ISI.EDU>; "Haskell Mailing List" <haskell@haskell.org> Sent: Monday, July 29, 2002 11:26 AM Subject: RE: deriving instances for "hidden" types
| I've often felt a tinge of disappointment not being able to | derive classes over data structures that are defined in the | libraries (DeepSeq FiniteMap, for instance). I was wondering | if any of the tools (drift, etc.) or GHCs built-in meta | programming would allow you to say something like: | | derive (DeepSeq a, DeepSeq b) => DeepSeq (FiniteMap a b)
I think Hal was only suggesting doing this in case where the representation of the data structure was visible to the library client. (As others have said, it's not a good idea if the rep is abstract.)
Template Haskell will be able to do this. Heart transplant operation is in progress. Blood on floor, but patient still alive.
Simon --
John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------