[Haskell-cafe] A cabal odyssey

Daniel Fischer daniel.is.fischer at web.de
Wed Aug 18 14:11:18 EDT 2010

On Wednesday 18 August 2010 19:13:48, Andrew Coppin wrote:
> Ben Millwood wrote:
> > I think it's not completely a stupid idea to have profiling default
> > off. I personally do not really enjoy the fact that I compile
> > everything three times nowadays :)
> Fair enough. However, having documentation off by default is just
> annoying...
> On that note, I just remembered something else: During the course of
> playing with all this Cabal stuff, I discovered that I had somehow
> acquired a global package index. As in, an HTML file that links to the
> documentation of *all* installed packages, not just the ones that come
> with GHC. And when I installed more packages, it seemed to add them to
> this index.

Yes, when cabal runs haddock on a package, it generates a comprehensive 
index if none is present or expands it with the new docs.
Quite cool that :)

> Alas, removing packages doesn't remove them.

Since cabal isn't involved in removing packages, that can't be done.
Of course, a `cabal unregister foo' command that took care of all that 
would be nice, but so far the cabal devs have had more important things to 

> I tried deleting the file to see if Cabal would rebuild it,
> and now I just have no file at all, and no idea how to get it back.

Maybe it's still in the Trashcan? If not, an undelete programme?
Generally, until you know it's safe to delete, move or rename first, so if 
something breaks, it's not gone for good.

If your index is not recoverable, I think you'd have to run cabal haddock 
on your cabal-installed packages to regenerate it.

> Then again, all the links were broken anyway. They all had paths like
> "C:\Program Files\Haskell\...whatever", and Mozilla apparently expects
> them to say "file://C:/Program Files/Haskell/...whatever". It kept
> whining that "the C:\ protocol is not registered".
> Does anybody know anything about this feature?

Apparently, haddock links to absolute paths. That's of course not the right 
thing to do if the path begins with an invalid protocol specifier ("C:"). 
And it's annoying if you want to move the docs.

As a workaround, you could replace all 'HREF="C:' with 'HREF="file://C:' in 
the index.html (but if '\' isn't a valid path separator in urls, that 
probably wouldn't work and replacing all '\'s with '/' would be wrong).
Of course that should be dealt with properly in haddock, file a bug report.

More information about the Haskell-Cafe mailing list