[Haskell-cafe] The Typeable class is changing
Gregory Crosswhite
gcross at phys.washington.edu
Mon Jul 11 23:28:38 CEST 2011
On 7/11/11 11:18 AM, Yitzchak Gale wrote:
> The standard way to create a Typeable instance is
> just to derive it. If you do that, you will not be affected
> by this change.
This is only the "standard way" if one is willing to sacrifice Haskell98
or Haskell2010 compatibility by using the non-standard
DeriveDataTypeable extension.
> But it seems that many packages create Typeable
> instances by explicitly using mkTyCon. If your package
> does this, it will eventually break, after a deprecation
> period.
I have done this in at least one of my packages
(type-level-natural-number) because I wanted to keep my library
compatible with Haskell2010 rather than relying on GHC-specific extensions.
To be clear, I think that the new Typeable is an improvement and don't
mind migrating my package to use it, I just get the sense after reading
the linked exchange that those discussing this have just assumed that
the standard way to use Typeable *should be* to use "deriving Typeable"
and are missing what I suspect is a major reason why people avoid using
it, which is to reduce dependence on GHC-specific extensions.
Again, this not a complaint or an objection at all, I'm just sharing my
own thoughts on the matter. :-)
Cheers,
Greg
More information about the Haskell-Cafe
mailing list