Closed brendanhay closed 5 years ago
CC @lehins
@brendanhay Thank you for raising this issue. I promise, there is a perfect explanation for the current structure of the documentation. All of the modules and functions are exported in alphabetical order ;)
I took a stab at initial improvement to the documentation in this PR: #163 Please, take a look at it see if you have any comments or suggestions. We can improve on it in the future, with more examples and better instructions, but for now I at least wanted to organize the haddock into a usable state.
cc @snoyberg I'll wait for your feedback on this PR.
PR has been merged and released, thanks @lehins!
New Haddocks look great! :ok_man:
When viewing the main entry-point to RIO on Hackage/Stackage, you see a Documentation heading and then you're straight into
Utf8Builder
,Display
, etc. Looking at the right-side contents menu, we see Standard logging functions, Run with logging, and so on:Now, If I was perhaps looking for the penultimate
RIO
newtype - I would peruse the contents menu and see .. nothing? Hmm.So Ctrl-F still seems to work in Netscape Navigator and searching for "newtype RIO" yields the following:
Wat.
What follows is highly personal preference/opinion/bias, but hopefully constructive:
Even if your project has a great
README
, which RIO most certainly does, it's still nice to have a brief introduction full of linked-Hackage identifiers I can click on to get places quickly in the heading of theRIO
module documentation. Doesn't need to be in every leaf module, probably justRIO
.The right contents menu needs more focus on high-level concepts as main headings, with sub-headings to drill down as deemed necessary/useful. Imagine mirroring how a dead-tree technical reference organises its table of contents.
Example:
There's alot of top-level headings such as Text, and Display that then only group logging related functions - the
Display
type class is not under its respective heading.All
whenM
,nubOrd
,view
, etc. functions are just sort of 'exported'. I tend to still think of things in terms of their 'classic' namespaces - ie.Control
->Control.Monad
->when/M
- I understand people new to Haskell probably don't have this baggage, but still grouping things similarly in terms of headings/exports lets people see what the analogies are with pre-existingbase
, preludes, and so on. List things go under a List heading, Either under Either, writeFile and so on under Monad/Unlift/IO, and so forth.Lenses. These probably deserve their own section.
Typeclasses. Probably coincides with 3. - the type classes and related functions should be grouped under respective headings, whether they be top-level
NFData
,Applicative
, etc. or underControl
-esque headings - ordering somewhat according a heirarchy, alaFunctor
->Applicative
->Monad
.