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.
- Why does Haddock link to
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. Forfooit seems a variable is at least most plausible. - Is there any way to fake a link? I am writing this in code samples, so I need it to be rendered as
foo. I tried anchors, but they render as the module name, and for direct hyperlinks you have no control over the displayed text. - I considered a post processor (replacing
t:[a-z]withv:), but that requires a custom Setup.hs which causes problems and is quite ugly. - I couldn't find any Haddock command line flags to obtain a more reasonable behavior, such as specifying that
foois a variable. - I can't add an import of
AtoBwithout 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.