Old code broken by new Typeable class

Edward Kmett ekmett at gmail.com
Tue Aug 5 19:29:21 UTC 2014


If you can't change the definition you can use the syntax Björn Bringert
added back in 2006 or so for StandaloneDeriving.

Just turn on

{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-}

and then you can use

deriving instance Typeable Foo

-Edward


On Tue, Aug 5, 2014 at 1:47 PM, Volker Wysk <verteiler at volker-wysk.de>
wrote:

> Am Dienstag, 5. August 2014, 12:46:23 schrieb Carter Schonwald:
> > i assume 7.6 and 7.8, if we're talking GHC rather than GCC :)
> >
> > in 7.8 you can't define userland typeable instances, you need only write
> > deriving (Typeable) and you're all set.
> > add some CPP to select the instances suitable
>
> So you need to be able to change the definition of the data type, in order
> to
> add deriving (Typeable). It's not possible to add a Typeable instance
> declaration later.
>
> When you can't change the definition, you're out of luck.
>
> Okay,
> V.W.
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20140805/7c440794/attachment.html>


More information about the Glasgow-haskell-users mailing list