Gwern Branwen | 9 Aug 17:47

Unhelpful library documentation

I don't know if everyone has seen this, so I thought I'd mention this: <http://lukeplant.me.uk/blog.php?id=1107301692>

> "Haskell API docs suck. A lot."

"Haskell API documentation is very lacking for newbies. For instance, I want to understand how to create
and use regexes. If you start at Text.Regex.Posix documentation, it tells you that =~ and =~~ are the high
level API, and the hyperlinks for those functions go to Text.Regex.Posix.Wrap, where the main functions
are not actually documented at all!"

"Since Haskell libraries are almost always implemented by Haskell gurus, and they implement them with
themselves in mind (I have no objection to this, they are enthusiasts working for free), they use lots of
clever code and advanced Haskell techniques. But this means that if you want people to actually use these
libraries (and by consequence Haskell itself), the documentation for Haskell libraries has to be about
an order of magnitude better than anything you'd find anywhere else. I suspect it is at least an order of
magnitude worse than for something like .NET APIs, which means that relatively speaking the
documentation of Haskell is currently in an absolutely dire state."

These are all interesting points, but I found most interesting the conclusion:

"Moving forward, I guess one problem is contributing to a library's documentation. There is nothing on the
API doc pages that shows you how to do this. I suspect you need to check out the source with darcs (not
something I do normally, I just use cabal) and then start email patches or something. Even then, I don't
know if I would contribute any documentation -- 'howto' style documentation seems out of place on the API
pages, but it is desperately needed."

So, what can be done here? Offhand, I want to suggest adding a link to some sort of tutorial module or wiki
page. Each page *does* mention that 'Maintainer libraries <at> haskell.org', but this really isn't
helpful; it doesn't tell you where to get the original library source code, how to edit, what libraries@
*is* (anyone with a brain in their head is going to know that libraries@ is some sort of group interface, and
is going to refrain from emailing it until they know that they aren't cluelessly spamming/offending
(Continue reading)

Magnus Therning | 9 Aug 22:33
Gravatar

Re: Unhelpful library documentation

Gwern Branwen wrote:
> I don't know if everyone has seen this, so I thought I'd mention this:
> <http://lukeplant.me.uk/blog.php?id=1107301692>
>
>> "Haskell API docs suck. A lot."
>
> "Haskell API documentation is very lacking for newbies. For instance,
> I want to understand how to create and use regexes. If you start at
> Text.Regex.Posix documentation, it tells you that =~ and =~~ are the
> high level API, and the hyperlinks for those functions go to
> Text.Regex.Posix.Wrap, where the main functions are not actually
> documented at all!"
>
> "Since Haskell libraries are almost always implemented by Haskell
> gurus, and they implement them with themselves in mind (I have no
> objection to this, they are enthusiasts working for free), they use
> lots of clever code and advanced Haskell techniques. But this means
> that if you want people to actually use these libraries (and by
> consequence Haskell itself), the documentation for Haskell libraries
> has to be about an order of magnitude better than anything you'd find
> anywhere else. I suspect it is at least an order of magnitude worse
> than for something like .NET APIs, which means that relatively
> speaking the documentation of Haskell is currently in an absolutely
> dire state."
>
>
> These are all interesting points, but I found most interesting the
> conclusion:
>
> "Moving forward, I guess one problem is contributing to a library's
(Continue reading)

Gwern Branwen | 10 Aug 21:46

Re: Unhelpful library documentation

On 2008.08.09 21:33:01 +0100, Magnus Therning <magnus <at> therning.org> scribbled 4.2K characters:
...
> I think the haskell.org wiki would be a good place to document how to
> use APIs.  In my opinion the Haddock-generated documents are better kept
> purely as reference documentation with a pointer to the entry-point on
> the wiki for the library in question.

That seems like one of the best choices to me as well. Thoughts from everyone else? Suggestions about how to
actually do it? (Do we add a link to the introduction, hack haddock output in some way to add links at the
bottom perhaps, or just use the usual headers - is 'homepage' one of the possible fields?)

> I suppose something similar should be encouraged for libraries on
> Hackage as well.  Here's what I'll do with the only library I have on
> there (dataenc):
>
>    1. Set the 'homepage' cabal property to point to the wiki page I
>       created on the wiki to describe the library
>       (http://www.haskell.org/haskellwiki/Library/Data_encoding).
>    2. Add a link in the Haddock comments of every module to point to the
>       same page.
>
> /M

A useful example; post a link to the Haddock when you do it, would you?

--
gwern
Goodwin Bunny Blowpipe Montenegro Bechtel SLIP SAAM NSA Ufologico Comverse
(Continue reading)

Magnus Therning | 13 Sep 17:02
Gravatar

Re: Unhelpful library documentation

Gwern Branwen wrote:
> On 2008.08.09 21:33:01 +0100, Magnus Therning <magnus <at> therning.org> scribbled 4.2K characters:
> ...
>   
[..]
>> I suppose something similar should be encouraged for libraries on
>> Hackage as well.  Here's what I'll do with the only library I have on
>> there (dataenc):
>>
>>    1. Set the 'homepage' cabal property to point to the wiki page I
>>       created on the wiki to describe the library
>>       (http://www.haskell.org/haskellwiki/Library/Data_encoding).
>>    2. Add a link in the Haddock comments of every module to point to the
>>       same page.
>>
>> /M
>>     
>
> A useful example; post a link to the Haddock when you do it, would you?
>   

It took me a while to get around to get around to it, but  now it's done.

I've just pushed the code to http://code.haskell.org/dataenc/devo/ and
the package is uploaded to hackage
(http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dataenc-0.11.1). 
The documentation will be rebuilt soon (I hope :-).

/M

(Continue reading)

Simon Peyton-Jones | 11 Aug 10:25

RE: Unhelpful library documentation

Lowering the barrier to entry for people to contribute to library documentation would be a Very Good Thing. 
There are lots of intelligent and motivated people out there!

Fortunately, we have the Haskell wiki.  Magnus's comments look spot-on to me.

| I think the haskell.org wiki would be a good place to document how to
| use APIs.  In my opinion the Haddock-generated documents are better kept
| purely as reference documentation with a pointer to the entry-point on
| the wiki for the library in question.

 We could encourage every library author to:
  * Establish a page on the Haskell Wiki for the library
        (http://www.haskell.org/haskellwiki/Library/Data_encoding).
  * Set the 'homepage' cabal property to point to that wiki page
        (or, if the home page is elsewhere, that home page can point to
        the wiki)
  * Add a link in the Haddock comments of every module to point to the
       same page.
  * Make it clear that users are encouraged to write and improve
        the wiki documentation

Perhaps such a practice should be explicitly encouraged in the guidelines for submitting a package to Hackage?

Duncan, Don: perhaps these are ideas you could develop for the Haskell Platform?

Simon

| > These are all interesting points, but I found most interesting the
| > conclusion:
| >
(Continue reading)

Duncan Coutts | 13 Aug 14:38
Gravatar

RE: Unhelpful library documentation

On Mon, 2008-08-11 at 09:25 +0100, Simon Peyton-Jones wrote:
> Lowering the barrier to entry for people to contribute to library documentation would be a Very Good
Thing.  There are lots of intelligent and motivated people out there!
> 
> Fortunately, we have the Haskell wiki.  Magnus's comments look spot-on to me.
> 
> | I think the haskell.org wiki would be a good place to document how to
> | use APIs.  In my opinion the Haddock-generated documents are better kept
> | purely as reference documentation with a pointer to the entry-point on
> | the wiki for the library in question.
> 
>  We could encourage every library author to:
>   * Establish a page on the Haskell Wiki for the library
>         (http://www.haskell.org/haskellwiki/Library/Data_encoding).
>   * Set the 'homepage' cabal property to point to that wiki page
>         (or, if the home page is elsewhere, that home page can point to
>         the wiki)
>   * Add a link in the Haddock comments of every module to point to the
>        same page.
>   * Make it clear that users are encouraged to write and improve
>         the wiki documentation
> 
> Perhaps such a practice should be explicitly encouraged in the
> guidelines for submitting a package to Hackage?
> 
> Duncan, Don: perhaps these are ideas you could develop for the Haskell
> Platform?

Hmm. I think the 'homepage' property should point to the package's
homepage. For many projects that may well be a wiki site, but bigger
(Continue reading)


Gmane