In module B
I have documentation with a link 'A.foo'
, linking to the foo
member of module A
. In module A
I import module B
. Haddock renders this as a link to A.html#t:foo
, namely pointing at the type foo
(which does not exist) not the function foo
, which is at A.html#v:foo
.
t:
for variables that start with a lower case letter? Is that a bug? For 'A.Foo'
I can see that it could be a type or a constructor, so there are namespacing issues. For foo
it seems a variable is at least most plausible.foo
. I tried anchors, but they render as the module name, and for direct hyperlinks you have no control over the displayed text.t:[a-z]
with v:
), but that requires a custom Setup.hs which causes problems and is quite ugly.foo
is a variable.A
to B
without introducing circular imports, which is vile to add purely for documentation.I am running into this problem in the Shake documentation, where as an example removeFilesAfter
does not get the right link.
This was a Haddock bug #228 and Neil's Haddock bug #253 and the fix has been upstream for few months. You can build GHC HEAD and rebuild your documentation or wait for 7.8 and do it then.