syb changes (Re: base-3 vs base-4 (Was: Breakage with 6.10))

Claus Reinke claus.reinke at
Sat Oct 11 06:16:34 EDT 2008

>>  > Btw, I also have problems with the haskell-src-exts that imports
>>  > Data.Generics.Instances (to generate Data and Typeable instances).
>>  > Where would these have moved to in the new base? 

ghc-pkg provides general help for finding packages for modules:

    $ ghc-pkg find-module Data.Generics.Instances
        base-, syb-

So there is a compatibility module in the new syb. Unfortunately,
that won't tell you about the moves and rationale. Most of the time,
you'll want Data.Data (check "ghc -e ':browse Data.Data'" or the
Haddock pages, or google for "syb" in the libraries@ archives):

    $ ghc-pkg find-module Data.Data

    $ ghc -ignore-dot-ghci -e ':browse Data.Data' | grep class
    class (Typeable a) => Data a where
    class Typeable a where typeOf :: a -> TypeRep
    class Typeable1 t where typeOf1 :: t a -> TypeRep
    class Typeable2 t where typeOf2 :: t a b -> TypeRep
    class Typeable3 t where typeOf3 :: t a b c -> TypeRep
    class Typeable4 t where typeOf4 :: t a b c d -> TypeRep
    class Typeable5 t where typeOf5 :: t a b c d e -> TypeRep
    class Typeable6 t where typeOf6 :: t a b c d e f -> TypeRep
    class Typeable7 t where typeOf7 :: t a b c d e f g -> TypeRep

    $ ghc -ignore-dot-ghci -e ':info Data.Data.Data'
    class ..
    instance ..

> .. I would prefer to use the new
> base-4 when possible. The cabal file already includes a conditional
> "if flag(splitBase)" to handle really old versions, I guess what I'm
> asking for is something similar for this case. Is there a splitSyb
> flag or some such?

I was wondering whether there is a way to set user-defined flags
depending on whether some package is available. Then I recalled
that flags don't work the way I expected - instead Cabal will try
all flag settings to find a buildable configuration (a fact I only became
aware of when a different kind of flag was added recently that does
behave the way I expected;-). Which might be what you want in 
this case. Duncan: is this correct, and are these subtleties documented 
> Though obviously this would only work if the module
> Data.Generics.Instances was preserved under that name somewhere else.
> If it was renamed or changed (which I suspect), then the hassle of
> keeping up to date with older versions will probably be too much, and
> I will want to update to the new agenda as soon as 6.10 is released
> for real. So what happened to this module? (Is there a migration
> quicksheet somewhere?)

Pedro: it might be helpful if the haddock pages for the old and new 
syb modules were to point to a syb wiki page (which could then link
to the relevant threads on libraries@)? Or is that information already 
in the documentation patch for the latest builds?


More information about the Glasgow-haskell-users mailing list