[Haskell-cafe] RFC: in haddock, collapse instances by default

Li-yao Xia lysxia at gmail.com
Fri Jan 4 11:55:08 UTC 2019


Thanks everyone for the response! To summarize the discussion:

- There is general agreement that the current default can be 
problematic, but switching it the other way around doesn't seem 
unequivocally good either.

To add to that counterpoint, I must admit that mtl and time are examples 
where the instance lists are arguably quite essential to understand 
those libraries, and for familiar users they aren't that uncomfortably long.

In that case, a safer solution seems to keep the current default to not 
surprise users that are already happy with the current state of things, 
but add a new option to change the default, to address the cases where 
they are indeed a problem.

- A button to fold/unfold all instance lists seems like an unanimously 
good idea.

     * Perhaps the same feature for collapsible examples would be 
similarly useful.

     * We can record users preferences. In fact, it appears Haddock 
already records which instance lists are folded.

I am currently interested in implementing the features mentioned above.

- There were also suggestions to make the presentation of instance lists 
more compact, rather than entirely hide them. I am in favor of them, but 
of course that is more work to flesh out and implement.

     * Show only some instances (for example, those that have comments 
attached).

     * List the relevant classes/types on a single line (rather than the 
whole instance heads, that are somewhat redundant), with the option to 
switch to the current display for more details.

It seems reasonable to leave these as future tasks, and interested 
parties are free to discuss and take them on any time.

Regards,
Li-yao


More information about the Haskell-Cafe mailing list