The base library and GHC 6.10

Claus Reinke claus.reinke at
Sun Aug 31 18:02:59 EDT 2008

Leaving Data.Generics.Basics in base while moving
Data.Generics.Instances to syb raises the interesting issue of
dealing with the accidental re-exports of Data.Generics.Instances
from various places. Here is that list again (*):

    $ find . -name '*hs' | grep -v _darcs | xargs grep -l 'Data.Generics' | grep -v Generics

And here is a brief scan of what each of these is doing. References
to 'standard' vs 'dubious' Data instances are wrt the suggested split
in [1], with some possible refinements:

- array: the Data instance for Array could be moved into array,
    avoiding the need for instance imports and syb dependency?

- bytestring: uses deriving, which for Internal.hs depends on
    Data instances for Int [standard] and (ForeignPtr Word8)
    [dubious]; would need to depend on syb; and import both
    standard and dubious instances :-(

    perhaps Data instances for type constructors with phantom
    types should be re-classified into Standard, given that there
    are no data objects to be traversed?

- containers: IntMap.hs, IntSet.hs, Map.hs, Sequencs.hs, Set.hs,
    Tree.hs define their own Data instances, or derive them in such
    a way that they do not need to import any instances :-)

- haskell-src: uses deriving, will need to depend on syb; depends
    almost exclusively on standard instances (the only exception I
    can see in a quick scan is Rational);

    perhaps this is an argument in favour of moving the Data instance
    for 'Ratio a' from Dubious to Standard: the parameter type is
    never meant to be traversed, and tainting every client of 'Ratio a'
    with the really bad instances is not a good idea. Opinions?

- network: uses deriving, will need to depend on syb; depends
    only on standard instances

- packedstring: defines its own instances, no need to import any

- template-haskell: uses deriving, roughly the same situation as
    for haskell-src?


[1] see the last page of

More information about the Libraries mailing list