Hello,

This is indeed by design - it is a relatively new Haddock feature (here’s the original issue) where types of identifiers and identifiers bound are shown on mouse-over.
Here is what this looks like in a graphical browser:


As for the the weird declarations like $cshowList and company, this seems to be a bug - Haddock should not display those identifiers.

Although I’m sympathetic to the accessibility, in this case wouldn’t just directly opening the sources (in a text editor) be simpler? Is there a (simple) way to preserve the experience when browsing using Lynx without also holding back features aimed at a regular browsing experience?

Alec

On Nov 14, 2020, at 1:01 PM, Johannes Waldmann <johannes.waldmann@htwk-leipzig.de> wrote:

I recently noticed that it is no longer possible
to read the source of a module, because extra type information
(which is likely hidden in a modern browser)
is inline with the actual sources.

I confirmed your example, reading with lynx and w3m.

It seems the extra text
is the methods of the type classes (mentioned after "deriving")
and it gets shown on on mouse-over in a graphical browser.

(Re: "nobody writes code like this" - the compiler does?
Some methods here seem auto-generated.)

Looks like a bug in haddock, then? (Or in lynx' handling of CSS?)
The actual HTML source looks legit, at least partially
(see example below)

This seems related:
https://github.com/haskell/haddock/pull/1197

I will open an issue on accessibility.

- J.W.

<span class="hs-keyword">deriving</span><span> </span><span
class="hs-special">(</span><span id="local-6989586621679046279"><span
id="local-6989586621679046281"><span
id="local-6989586621679046283"><span class="annot"><span
class="annottext">Int -&gt; ISBN -&gt; ShowS
[ISBN] -&gt; ShowS
ISBN -&gt; String
(Int -&gt; ISBN -&gt; ShowS)
-&gt; (ISBN -&gt; String) -&gt; ([ISBN] -&gt; ShowS) -&gt; Show ISBN
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS)
-&gt; Show a
showList :: [ISBN] -&gt; ShowS
$cshowList :: [ISBN] -&gt; ShowS
show :: ISBN -&gt; String
$cshow :: ISBN -&gt; String
showsPrec :: Int -&gt; ISBN -&gt; ShowS
$cshowsPrec :: Int -&gt; ISBN -&gt; ShowS
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var
hs-var hs-var hs-var">Show</span>

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.