aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-09-20 19:44:04 +0100
committerBen Gamari <ben@smart-cactus.org>2016-09-27 17:32:22 -0400
commit240bc38b94ed2d0af27333b23392d03eeb615e82 (patch)
tree84772c5fb7a5e35a363230a035d4f25ff173c8c6
parenta9a520ecca8290f5cb20092618c5ea7a69ed6aa5 (diff)
Fix rendering of class methods for Eq and Ord
See #549 and GHC issue #12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b)
-rw-r--r--haddock-api/src/Haddock/Convert.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs
index 660be723..7de840ee 100644
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@ -82,7 +82,7 @@ tyThingToLHsDecl t = case t of
(map (noLoc . getName) l, map (noLoc . getName) r) ) $
snd $ classTvsFds cl
, tcdSigs = noLoc (MinimalSig mempty . noLoc . fmap noLoc $ classMinimalDef cl) :
- map (noLoc . synifyIdSig DeleteTopLevelQuantification)
+ map (noLoc . synifyTcIdSig DeleteTopLevelQuantification)
(classMethods cl)
, tcdMeths = emptyBag --ignore default method definitions, they don't affect signature
-- class associated-types are a subset of TyCon:
@@ -317,6 +317,8 @@ synifyName = noLoc . getName
synifyIdSig :: SynifyTypeState -> Id -> Sig Name
synifyIdSig s i = TypeSig [synifyName i] (synifySigWcType s (varType i))
+synifyTcIdSig :: SynifyTypeState -> Id -> Sig Name
+synifyTcIdSig s i = ClassOpSig False [synifyName i] (synifySigType s (varType i))
synifyCtx :: [PredType] -> LHsContext Name
synifyCtx = noLoc . map (synifyType WithinType)