Proposal: derive Typeable for Data.Monoid types

Herbert Valerio Riedel hvr at gnu.org
Tue May 27 09:56:15 UTC 2014


On 2014-05-27 at 10:42:30 +0200, Roman Cheplyaka wrote:
> * Herbert Valerio Riedel <hvr at gnu.org> [2014-05-27 10:36:46+0200]
>> On 2014-05-27 at 08:31:14 +0200, Roman Cheplyaka wrote:
>> > I was surprised to find out that wrappers like Last do not have Typeable
>> > instances. Let's add them.
>> 
>> Fyi, Data.Monoid has been given a `{-# LANGUAGE AutoDeriveTypeable #-}`
>> in
>> 
>>   http://git.haskell.org/ghc.git/commitdiff/1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11
>> 
>> which should take care of not forgetting a 'deriving Typeable' in the
>> future for any new entities defined in Data.Monoid.
>
> Cool! I take it this is already solved in HEAD, then? Any reason not to enable
> AutoDeriveTypeable for the whole base (and other core packages)?

You can't enable it everywhere in base due to module-import cycles (you
need to import Data.Typeable before you can AutoDeriveTypeable a
module), but other than that, the plan is to enable it wherever
possible in base.

As for other core-packages, it would be sensible to use
AutoDeriveTypeable only for packages which don't support GHC versions
prior to GHC 7.8 (AutoDeriveTypeable was introduced with GHC 7.8.1).


More information about the Libraries mailing list