X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Fdocs%2Fusers_guide%2Fglasgow_exts.xml;fp=ghc%2Fdocs%2Fusers_guide%2Fglasgow_exts.xml;h=7dca09a2b382dc709eebc6653abffc64066ffef8;hb=9bc17c05ec0ef9820a3561c280d4062712e52260;hp=9e712f8aaa3745f08bfdf07a506f017c2a25516d;hpb=fe1f6b03e7f151fcd27170046e2116fd7f400d4d;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/glasgow_exts.xml b/ghc/docs/users_guide/glasgow_exts.xml index 9e712f8..7dca09a 100644 --- a/ghc/docs/users_guide/glasgow_exts.xml +++ b/ghc/docs/users_guide/glasgow_exts.xml @@ -3208,6 +3208,20 @@ GHC extends this list with two more classes that may be automatically derived modules Data.Typeable and Data.Generics respectively, and the appropriate class must be in scope before it can be mentioned in the deriving clause. +An instance of Typeable can only be derived if the +data type has seven or fewer type parameters, all of kind *. +The reason for this is that the Typeable class is derived using the scheme +described in + +Scrap More Boilerplate: Reflection, Zips, and Generalised Casts +. +(Section 7.4 of the paper describes the multiple Typeable classes that +are used, and only Typeable1 up to +Typeable7 are provided in the library.) +In other cases, there is nothing to stop the programmer writing a TypableX +class, whose kind suits that of the data type constructor, and +then writing the data type instance by hand. +