How to link to a module with different name in Haddock?

66 views Asked by At

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

There are 1 answers

0
Alexis King On

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