[Haskell-cafe] Getting some funny brackets in Haddock docs

Steven Shaw steven at steshaw.org
Wed Jan 10 11:28:42 UTC 2018


Johanne
​s, can you explain again what's wrong with the code example you gave. It
looks like you're saying that `M.size [(2,3)]` should not be 1 (but I'm not
sure).


David, perhaps you could add your own neat GHC language extension for
UnicodeOverloadedLists which lets you use those unicode characters to
delimit lists in addition to the usual []. When, I'd think it best to
assume `UnicodeOverloadedLists` is enabled by making a comment at the top
of the documentation.
 The just put those unicode character into the documentation. Damn people
those that stare at the square boxes ;). I have no idea how unicode
characters work with fonts πŸ˜… ...

There are so many approaches though. You could teach Haddock how to syntax
highlight Haskell code​
​
​ (ghc-exactprint?). Then use a pretty-printer that uses your favourite
sequence delimiters β€” perhaps ⟦⟧.​ Then ensure that you display the Haskell
code blocks using your new pretty-printer. Also, you'll need a regular
Haskell pretty-printer for use with a "copy" icon to allow folks to copy
"regular" Haskell to try in their REPLs (so you probably need to "inject" a
tiny bit of JS into the docs).

That sounds like a lot of work so you could hack something together with JS
(or GHCJS), munging the normal Haddock output to your tastes.​ If you use
GHCJS, you could perhaps even still use ghc-exactprint to help munge the
<pre> sections.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180110/0080851a/attachment.html>


More information about the Haskell-Cafe mailing list