
Is there a way to get cabal to tell hscolour to add anchors for top-level defs (hscolour's -anchor option)?

On Sun, 2008-03-02 at 12:06 -0800, Conal Elliott wrote:
Is there a way to get cabal to tell hscolour to add anchors for top-level defs (hscolour's -anchor option)?
From a quick look at the code it looks like Cabal always passes the "-anchor" option to HsColour. Do you have a test case where that's not working? Run with -v to see how Cabal is calling HsColour.
Duncan

duncan.coutts:
On Sun, 2008-03-02 at 12:06 -0800, Conal Elliott wrote:
Is there a way to get cabal to tell hscolour to add anchors for top-level defs (hscolour's -anchor option)?
From a quick look at the code it looks like Cabal always passes the "-anchor" option to HsColour. Do you have a test case where that's not working? Run with -v to see how Cabal is calling HsColour.
Btw, something that just occured to me: hscolour is GPL'd -- do we ever link against it as a library? Or are we careful to only call the binary? -- Don

On Sun, 2008-03-02 at 17:10 -0800, Don Stewart wrote:
duncan.coutts:
On Sun, 2008-03-02 at 12:06 -0800, Conal Elliott wrote:
Is there a way to get cabal to tell hscolour to add anchors for top-level defs (hscolour's -anchor option)?
From a quick look at the code it looks like Cabal always passes the "-anchor" option to HsColour. Do you have a test case where that's not working? Run with -v to see how Cabal is calling HsColour.
Btw, something that just occured to me: hscolour is GPL'd -- do we ever link against it as a library? Or are we careful to only call the binary?
It's called as a binary. You can convince yourself by checking the build-depends. Duncan

Thanks for questioning my assumption. hscolour is getting -anchor, after
all. It's somehow failing to make anchors some classes. - Conal
On Sun, Mar 2, 2008 at 1:00 PM, Duncan Coutts
On Sun, 2008-03-02 at 12:06 -0800, Conal Elliott wrote:
Is there a way to get cabal to tell hscolour to add anchors for top-level defs (hscolour's -anchor option)?
From a quick look at the code it looks like Cabal always passes the "-anchor" option to HsColour. Do you have a test case where that's not working? Run with -v to see how Cabal is calling HsColour.
Duncan

"Conal Elliott"
Thanks for questioning my assumption. hscolour is getting -anchor, after all. It's somehow failing to make anchors some classes.
There was a bug in hscolour-1.8 whereby many top-level definitions failed to get an anchor - it is fixed in 1.9. If you have a reproducible case where it still fails, please let me know. However, there is also a more long-standing issue with class methods, which never get an anchor. This is primarily because they are tricky to recognise, purely lexically, in a reliable way. In any case, it is rare for the source defn of a class method to contain any more information than the generated haddock (because the method only has code if there is a default defn, and in most cases, you can't navigate to the instance code). Regards, Malcolm
participants (4)
-
Conal Elliott
-
Don Stewart
-
Duncan Coutts
-
Malcolm Wallace