[Haskell-cafe] Error in Installing Data.deriveTH

Daniel Fischer daniel.is.fischer at googlemail.com
Fri Sep 16 00:48:20 CEST 2011

On Thursday 15 September 2011, 21:37:29, mukesh tiwari wrote: 
> I tried to resolve this issue on #haskell and i got suggestion that it
> was due to conflict in
> global and local namespace [ see here for more detail
> http://hpaste.org/51376 ].

Yes.The containers in the global db is shadowed by the user containers.

> One idea is i should wipe ~/.ghc and install all the libraries
> individually.

That'll work. If there are only few packages broken, unregistering only 
those could be less work.

$ ghc-pkg check

should indicate whether there's a chance that surgical removal of 
individual packages might be worthwhile. If the breakage is recent and only 
few packages are affected, it is, otherwise wiping out the entire user db 
would likely be simpler.

> Could some one please suggest if there is another idea to
> resolve this issue.

There is no fundamentally different way, the only method to fix broken 
packages is to remove them. The only question is whether it's better to get 
completely rid of the entire user db [and if you have the bad luck of 
having breakage within the global db by doing global installs, you'd 
probably need an entire new ghc installation] or only of individual 

> Currently i have ghc-6.12.3  and  installing 
> ghc-7.0 will resolve the issue ?

In a certain sense, yes. With a new version of ghc, you start with a clean 
slate without broken packages. However, you could pretty much introduce the 
same kind of breakage with that.

Generally, it's a bad idea to reinstall any library that came with the ghc 
installation (there are some exceptions, e.g. installing a newer version of 
Cabal has a fair chance of not causing havoc).
As rules of thumb,
- don't mess with the global db, user installs only
- don't install any library which already has a version in the global db[*]
- be careful when upgrading any library, it could break everything 
depending on that.

Of course, if you know what you're doing, there can be good reasons to 
break any of these rules, but if you don't know why it's right, it's 
probably wrong.
Although it's tedious, checking all cabal install with a --dry-run first 
helps avoiding breakage.

[*] and if you do, the more packages you have installed, the more likely it 
will break some of those.

More information about the Haskell-Cafe mailing list