I have two very similar functions and both need exactly the same documentation. Is there a way in Haddock to avoid comment duplication?
I could not find description of this feature in Haddock documentation, but I guess there is a way to do so.
For instance in Javadoc there is {@inheritDoc}
and @see SomeClass#someMethod()
. What about Haddock?
Unfortunately, it is not possible for function declarations to have reusable documentation with Haddock at the moment. Here is an issue tracking this.
The -- $chunk_name
documentation chunk naming is only available for module documentation, i.e for the export section. This is only handy for moving documentation from the top of the module to the bottom to reduce the clutter.
Common workarounds for this problem are:
-- | See `functionName`.
OR
-- | See 'functionName'.
bytestring
and vector
packages.