-
Notifications
You must be signed in to change notification settings - Fork 236
Add better support for default signatures in class definitions #822
Conversation
…dock into class-default-sigs Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/GhcUtils.hs haddock-api/src/Haddock/Interface/Create.hs
@RyanGlScott was the only known issue with this that the docstrings for default signatures are not found? |
As far as I could see, yes. |
uniquifyName = liftA2 setName (updateName . getName) id | ||
where | ||
updateName = liftA2 setNameUnique id $ | ||
liftA2 deriveUnique id ((+1) . getKey) . nameUnique |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit suspicious. That said, I think the smell is coming more from the fact that deriveUnique
exists... and I don't see another easy workaround.
This solves the problem of docs, which are associated with default method signatures, not finding their way into the right 'ExportDecl' and consequently not being available in 'ppClassDecl'. The crux of this issue is that since we are keying the docs for default methods under another name, we need to manually look these up and make sure they still end up in the right 'ExportDecl'.
I've solved the issue around However, there is something else we had not considered: the Thoughts? |
If we split Maybe we can instead use a different key type for these maps. Something like
maybe? |
This should fix #30 too. |
Was this subsumed by #938? If so, should this be closed? |
There is still no support for documentation on default methods. #938 just ported over the HTML backend changes from this PR (basically parity with your original screenshot from here: #822 (comment)). However, I'm now thoroughly convinced that the path forward to getting docs on default methods is going to involve their default method names (aka. I don't think there is much more to gain from keeping this PR open (please re-open if you disagree). |
Take two (see @mac-adder's #692 for take one). Fixes #439 and fixes #567.
This almost works without a hitch except for one glitch: Haddock has trouble finding documentation for a default signature. For instance, this file:
Gets rendered as:
Notice that the docstrings for the default signatures have been dropped. I've tried to determine why this is happening—it appears that Haddock drops all docstrings that aren't found in an
AvailInfo
, but default signatures don't correspond toAvailInfo
s. @alexbiehl, do you know how one might get that to work?