[Haskell-beginners] Package Documentation (Haddock)

Bastian Erdnüß earthnut at web.de
Thu Nov 18 15:20:45 EST 2010


On Nov 18, 2010, at 20:46, Daniel Fischer wrote:

> On Thursday 18 November 2010 20:25:26, Bastian Erdnüß wrote:
>> Hi,
>> 
>> I found the Haddock documentation to the packages that came with the
>> Haskell Platform locally on my machine.
>> 
>> 1) It's a little bit uncomfortable to always pick the right one by hand.
>> Is there a more comfortable way like doing e.g. 'haddock Data.List'
>> (that's not working) to direct to the documentation of a certain module?
> 
> Sorry, I don't understand what you want.

No matter.  Maybe me not either.

> To view the haddocks, there's an index.html in the docdir, bookmark that in 
> your browser and click from there.

That works for the Modules that came with GHC but not for the others in the Haskell Platform.  (On the Mac with the Haskell Platform there came the GHC.framework and the HaskellPlatform.framework.  In the doc folder of the GHC.framework is a central index.html in the doc folder of the HaskellPlatform, it isn't.)  However, still an improvement.

> If you want to generate haddocks for your project(s) and have it link to 
> the modules you used, the simplest way is to create a .cabal file and let 
> cabal take care of directing haddock to the installed docs (you can do it 
> manually with --read-interface flags, but letting cabal figure out the 
> correct flags is easier).

I'm not that far yet with Haskell.  But I mark that note for later.

>> 2) I cannot find the documentation to the packages I post installed with
>> cabal.  I tried to build them using e.g. 'cabal haddock Yampa' but
>> that's not working.  How do I do it right?
> 
> Edit your ~/.cabal/config, set
> 
> documentation: True

I just did.

> there, then cabal builds docs for all packages it installs automatically 
> (and creates a comprehensive index in ~/.cabal/share/doc). Unfortunately, 
> it doesn't build docs for packages it previously installed, so you'd have 
> to reinstall them or create the haddocks manually [the latter may need 
> unpacking the packages]. If you haven't installed many packages yet, 
> reinstalling is probably the simpler route.

Well, there are to much to reinstall everyone per hand, but not to much if there is a magic command like 'cabal upgrade --reinstall --all' to do it all at once.  Any help how to do that?

>> Thanks for your help in advance,
>> Bastian

^^ still valid


More information about the Beginners mailing list