Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit ba9176a

Browse files
harpocratessjakobi
authored andcommitted
Address review comments
* remove unused (and buggy) function * 'mempty' -> 'noHtml'
1 parent 97954c1 commit ba9176a

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

haddock-api/src/Haddock/Backends/Xhtml/Decl.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ppLFunSig :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName ->
7373
[Located DocName] -> LHsType DocNameI -> [(DocName, Fixity)] ->
7474
Splice -> Unicode -> Maybe Package -> Qualification -> Html
7575
ppLFunSig summary links loc doc lnames lty fixities splice unicode pkg qual =
76-
ppFunSig summary links loc mempty doc (map unLoc lnames) lty fixities
76+
ppFunSig summary links loc noHtml doc (map unLoc lnames) lty fixities
7777
splice unicode pkg qual
7878

7979
ppFunSig :: Bool -> LinksInfo -> SrcSpan -> Html -> DocForDecl DocName ->
@@ -227,7 +227,7 @@ ppFor :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName
227227
-> Splice -> Unicode -> Maybe Package -> Qualification -> Html
228228
ppFor summary links loc doc (ForeignImport _ (L _ name) typ _) fixities
229229
splice unicode pkg qual
230-
= ppFunSig summary links loc mempty doc [name] (hsSigType typ) fixities splice unicode pkg qual
230+
= ppFunSig summary links loc noHtml doc [name] (hsSigType typ) fixities splice unicode pkg qual
231231
ppFor _ _ _ _ _ _ _ _ _ _ = error "ppFor"
232232

233233

@@ -504,7 +504,7 @@ ppShortClassDecl summary links (ClassDecl { tcdCtxt = lctxt, tcdLName = lname, t
504504

505505
-- ToDo: add associated type defaults
506506

507-
[ ppFunSig summary links loc mempty doc names (hsSigType typ)
507+
[ ppFunSig summary links loc noHtml doc names (hsSigType typ)
508508
[] splice unicode pkg qual
509509
| L _ (ClassOpSig _ False lnames typ) <- sigs
510510
, let doc = lookupAnySubdoc (head names) subdocs
@@ -577,7 +577,7 @@ ppClassDecl summary links instances fixities loc d subdocs
577577

578578
-- Methods
579579
methodBit = subMethods
580-
[ ppFunSig summary links loc mempty doc [name] (hsSigType typ)
580+
[ ppFunSig summary links loc noHtml doc [name] (hsSigType typ)
581581
subfixs splice unicode pkg qual
582582
<+>
583583
subDefaults (maybeToList defSigs)

haddock-api/src/Haddock/GhcUtils.hs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
module Haddock.GhcUtils where
1818

1919

20-
import Control.Applicative (liftA2)
2120
import Control.Arrow
2221
import Haddock.Types( DocNameI )
2322

@@ -37,9 +36,7 @@ import VarSet ( VarSet, emptyVarSet )
3736
import TyCoRep ( Type(..) )
3837

3938
import HsTypes (HsType(..))
40-
import Unique (deriveUnique, getKey)
4139

42-
import Haddock.Types (SetName(..))
4340

4441
moduleString :: Module -> String
4542
moduleString = moduleNameString . moduleName
@@ -66,13 +63,6 @@ getMainDeclBinder (ForD _ (ForeignImport _ name _ _)) = [unLoc name]
6663
getMainDeclBinder (ForD _ (ForeignExport _ _ _ _)) = []
6764
getMainDeclBinder _ = []
6865

69-
uniquifyClassSig :: (NamedThing name, SetName name) => Bool -> name -> name
70-
uniquifyClassSig False = id
71-
uniquifyClassSig _ = liftA2 setName (updateName . getName) id
72-
where
73-
updateName = liftA2 setNameUnique id $
74-
liftA2 deriveUnique id ((+1) . getKey) . nameUnique
75-
7666
-- Extract the source location where an instance is defined. This is used
7767
-- to correlate InstDecls with their Instance/CoAxiom Names, via the
7868
-- instanceMap.

0 commit comments

Comments
 (0)