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

Li-yao Xia lysxia at gmail.com
Wed Jan 2 16:18:41 UTC 2019


Hello Café,

I would like to propose making haddock keep instance lists collapsed by 
default. Some discussion is in order since it would significantly affect 
the documentation of many packages on Hackage.

Feel free to reply here or on the related Github thread: 
https://github.com/haskell/haddock/issues/698

1. Instance lists take a lot of screen estate

For a motivating example, I can point to the Prelude we all love.

https://hackage.haskell.org/package/base-4.12.0.0/docs/Prelude.html

We are immediately welcomed by half a page of instances of Bool, which 
is not quite bad, but classes have the most impressive instance lists, 
as you may see when you reach Eq.

Many packages, even commonly used ones, have the same issue. For an 
extreme example, see the scrollbar jump when you fold the instance list 
of Apply in singletons.

https://hackage.haskell.org/package/singletons-2.5.1/docs/Data-Singletons.html#t:Apply

2. Current workarounds

They can be collapsed manually one by one, and we can jump to the middle 
of a module with the table of contents, but scrolling up from the bottom 
of an instance list is still a chore.

Of course, instance lists also contain quite important information. 
Would it become too easy to miss if it were hidden by default? Would a 
more fine-grained alternative be better?

Regards,
Li-yao


More information about the Haskell-Cafe mailing list