Syb Renovations? Issues with Data.Generics

Ian Lynagh igloo at earth.li
Mon Jul 28 18:23:02 EDT 2008


On Mon, Jul 28, 2008 at 07:13:08PM +0100, Claus Reinke wrote:
> 
>    My suggestion is to split this module into two, and stop the implicit
>    import/export of the incomplete instances from Data.Generics.

I don't think that this is a good idea.

>    Pro: - the instances are still available, and only one explicit import
>                away, so 'deriving instance Data' for types containing
>                uninteresting functions is still convenient

But suppose you want to make such an instance in a library you write.
Then you will import the instance, which means that it will be visible
to all users of your library too, so they cannot define their own
instance. Nor can they use other libraries that define their own
instance.

I believe instances really do have to be global.

>            - the situation is similar to Text.Show.Functions, as the
>                convenience instances don't provide the full expected
>                functionality, just barely enough for deriving to get by

I assumed that the only reason this is in its own module is so that you
can have Prelude not export the instance, as H98 requires, but I don't
know or can't remember the history behind it.


Thanks
Ian



More information about the Libraries mailing list