Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make Haddock render per-argument docs for type class methods?

It turns out that Haddock does not render per-argument docs for type class methods:

class Foo a where

  foo
    :: Int -- ^ This string will be ignored by Haddock
    -> a

This causes certain issues for users of a library I maintain, because the methods in my case have quite lengthy signatures. I have always had the descriptions in the source formatted like that (certainly works for ordinary functions), but it turns out Haddock does not display them (and does not complain about them either).

Is there a way to display the per-argument docs with Haddock? Some workaround perhaps?

like image 236
Mark Karpov Avatar asked Jun 29 '17 09:06

Mark Karpov


1 Answers

OK, this was a regression. This thing should work (and worked in version 2.16.1), but stopped (2.17.1 and later).

I have reported this: https://github.com/haskell/haddock/issues/647, should be fixed in version 2.18 (you can see there is a PR for this already).

like image 150
Mark Karpov Avatar answered Nov 15 '22 07:11

Mark Karpov