1

I have a module defined as foo.bar and I want to reference it from a different part of the project. However for legibility I want it to show up as bar not foo.bar.

Normally I would just use "foo.bar", but Haddock would show foo.bar. Is there a way to customize the name?

Follow up: What if I want to complexly change the name of the link? Sometimes I want to reference module from a middle of the text. I want to write something like:

-- | There are (other examples)[foo.bar] and ..

to get

There are other examples and ..

where the bolded part is a link to foo.bar

However the best I can do right now is:

-- | There are other examples ("foo.bar") and .. 

which produces

There are other examples (foo.bar) and ..

Which is not always ideal.

  • 1
    It seems haddock now supports your use case https://haskell-haddock.readthedocs.io/en/latest/markup.html#linking-to-modules – Damian Nadales Dec 29 '22 at 15:53

1 Answers1

2

I’m afraid that, at the time of this writing, the answer is “no.”

Alexis King
  • 43,109
  • 15
  • 131
  • 205