deriving instances for "hidden" types
Hal Daume III
hdaume@ISI.EDU
Fri, 26 Jul 2002 09:28:36 -0700 (PDT)
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)
where the compiler or something "knows" the representation of FiniteMap
even if we don't.
I don't know if something like this would be possible, but if so, I'd find
it very useful.
On the same note, if NFData/DeepSeq instances could be provided for all
the library types, I'd really appreciate it (FiniteMap, Array, etc...).
--
Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu
than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume