
Does anyone know of any Haskell texts that introduce 'deriving' fairly comprehensively? All I've been able to find out from what I have is that your type can derive Eq, Ord, Show etc. and then they'll magically work as if you'd written the instance declarations yourself. I've no idea how you can make your own type classes that types can 'derive' from, etc. IYSWIM, or really what's going on at all. -- Mark

Mark Carroll writes: | Does anyone know of any Haskell texts that introduce 'deriving' | fairly comprehensively? Appendix D of the Haskell 98 report gives the basic standard. Have a look at this extension too. http://research.microsoft.com/Users/simonpj/Papers/derive.htm

On Tue, 21 Aug 2001, Tom Pledger wrote: (snip)
http://research.microsoft.com/Users/simonpj/Papers/derive.htm
Aha, thank you very much. This explains a lot - I had assumed that Haskell must already have had something of the sort that nobody had told me about, but apparently not! I again tripped over my assumptions. (-: So, as Haskell 98 stands, you _can't_ make your own type classes that types can 'derive' from. It is interesting to see the extensions that people have been proposing - I wonder what the next version of Haskell will look like, and when. (-: -- Mark
participants (2)
-
Mark Carroll
-
Tom Pledger