-
Notifications
You must be signed in to change notification settings - Fork 236
Conversation
...when the other method is let through.
There is still no plan for documenting these though.
A while back, class methods changed from 'TypeSig' -> 'ClassOpSig'. I also took the opportunity to at least render default signatures.
In case it isn't clear, this really a bug fix (although I ended up improving the output along the way too). This is what Here is what this branch produces instead: Here is the output of the test cases I added: XHTML default signaturesXHTML default associated typesLaTeX default signatures |
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.
Thanks for working on this, Alec! :)
I have some minor comments.
@@ -72,14 +73,14 @@ ppLFunSig :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> | |||
[Located DocName] -> LHsType DocNameI -> [(DocName, Fixity)] -> | |||
Splice -> Unicode -> Maybe Package -> Qualification -> Html | |||
ppLFunSig summary links loc doc lnames lty fixities splice unicode pkg qual = | |||
ppFunSig summary links loc doc (map unLoc lnames) lty fixities | |||
ppFunSig summary links loc mempty doc (map unLoc lnames) lty fixities |
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.
I think it would be better to have something more explicit than mempty
here.
@@ -226,7 +227,7 @@ ppFor :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName | |||
-> Splice -> Unicode -> Maybe Package -> Qualification -> Html | |||
ppFor summary links loc doc (ForeignImport _ (L _ name) typ _) fixities | |||
splice unicode pkg qual | |||
= ppFunSig summary links loc doc [name] (hsSigType typ) fixities splice unicode pkg qual | |||
= ppFunSig summary links loc mempty doc [name] (hsSigType typ) fixities splice unicode pkg qual |
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.
Ditto.
@@ -503,7 +504,7 @@ ppShortClassDecl summary links (ClassDecl { tcdCtxt = lctxt, tcdLName = lname, t | |||
|
|||
-- ToDo: add associated type defaults | |||
|
|||
[ ppFunSig summary links loc doc names (hsSigType typ) | |||
[ ppFunSig summary links loc mempty doc names (hsSigType typ) |
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.
Ditto.
haddock-api/src/Haddock/GhcUtils.hs
Outdated
uniquifyClassSig _ = 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.
I see several issues with this function but it doesn't appear to be used at all?!
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.
Hah, nice catch! I thought this was funky too: #822 (comment). This snuck in through the cherry-picked commits.
* remove unused (and buggy) function * 'mempty' -> 'noHtml'
Adds back rendering of default methods. While I was at it, I also cherry-picked some old un-merged changes to improve the rendering of: default methods & default associated types (in the XHTML backend) and default methods (in the LaTeX backend).
Note there is still some GHC-side work that needs to be done to collect docs on default methods and default associated types. However, this solves the more urgent problem that we currently aren't rendering anything related to defaults.