aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Yamamoto <kazu@iij.ad.jp>2013-02-01 11:59:24 +0900
committerKazu Yamamoto <kazu@iij.ad.jp>2013-02-01 11:59:24 +0900
commit8d4c94ca5a969a5ebbb791939fb0195dc672429e (patch)
tree560a944a7105cd715f9acba46790bd7e1a77f82f
parent266a20afd2d27f28bbb62839ebc3f70bd83bfcce (diff)
parent3d25ea2929a9a9bd0768339b8ac5fd1b7c4670ad (diff)
Merge branch 'ghc-7.6' into ghc-7.6-merge-2
Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail.
-rw-r--r--.ghci1
-rw-r--r--.gitignore11
-rw-r--r--ANNOUNCE37
-rw-r--r--CHANGES29
-rwxr-xr-x[-rw-r--r--]Setup.lhs8
-rw-r--r--doc/README1
-rw-r--r--doc/haddock.xml23
-rw-r--r--driver/Main.hs7
-rw-r--r--examples/A.hs2
-rw-r--r--examples/B.hs2
-rw-r--r--examples/Bug10.hs3
-rw-r--r--examples/Bug3.hs6
-rw-r--r--examples/Bug4.hs4
-rw-r--r--examples/Bug6.hs23
-rw-r--r--examples/Bug8.hs8
-rw-r--r--examples/Bug9.hs6
-rw-r--r--examples/Hash.hs45
-rw-r--r--examples/Hidden.hs4
-rw-r--r--examples/Makefile11
-rw-r--r--examples/NoLayout.hs4
-rw-r--r--examples/Test.hs410
-rw-r--r--examples/hide-bug/A.hs2
-rw-r--r--examples/hide-bug/B.hs5
-rw-r--r--examples/hide-bug/C.hs6
-rw-r--r--examples/hide-bug/D.hs7
-rw-r--r--ghc.mk8
-rw-r--r--haddock.cabal219
-rw-r--r--haddock.spec2
-rw-r--r--html-test/README.markdown27
-rwxr-xr-xhtml-test/accept.lhs49
-rw-r--r--html-test/ref/A.html (renamed from tests/html-tests/tests/A.html.ref)2
-rw-r--r--html-test/ref/AdvanceTypes.html97
-rw-r--r--html-test/ref/B.html (renamed from tests/html-tests/tests/B.html.ref)2
-rw-r--r--html-test/ref/Bug1.html (renamed from tests/html-tests/tests/Bug1.html.ref)2
-rw-r--r--html-test/ref/Bug2.html (renamed from tests/html-tests/tests/Bug2.html.ref)2
-rw-r--r--html-test/ref/Bug3.html (renamed from tests/html-tests/tests/Bug3.html.ref)2
-rw-r--r--html-test/ref/Bug4.html (renamed from tests/html-tests/tests/Bug4.html.ref)2
-rw-r--r--html-test/ref/Bug6.html (renamed from tests/html-tests/tests/Bug6.html.ref)2
-rw-r--r--html-test/ref/Bug7.html (renamed from tests/html-tests/tests/Bug7.html.ref)2
-rw-r--r--html-test/ref/Bug8.html (renamed from tests/html-tests/tests/Bug8.html.ref)2
-rw-r--r--html-test/ref/BugDeprecated.html (renamed from tests/html-tests/tests/BugDeprecated.html.ref)20
-rw-r--r--html-test/ref/BugExportHeadings.html (renamed from tests/html-tests/tests/BugExportHeadings.html.ref)11
-rw-r--r--html-test/ref/Bugs.html (renamed from tests/html-tests/tests/Bugs.html.ref)2
-rw-r--r--html-test/ref/CrossPackageDocs.html (renamed from tests/html-tests/tests/CrossPackageDocs.html.ref)222
-rw-r--r--html-test/ref/DeprecatedClass.html (renamed from tests/html-tests/tests/DeprecatedClass.html.ref)14
-rw-r--r--html-test/ref/DeprecatedData.html (renamed from tests/html-tests/tests/DeprecatedData.html.ref)20
-rw-r--r--html-test/ref/DeprecatedFunction.html110
-rw-r--r--html-test/ref/DeprecatedFunction2.html (renamed from tests/html-tests/tests/DeprecatedFunction2.html.ref)5
-rw-r--r--html-test/ref/DeprecatedFunction3.html (renamed from tests/html-tests/tests/DeprecatedFunction3.html.ref)5
-rw-r--r--html-test/ref/DeprecatedModule.html (renamed from tests/html-tests/tests/DeprecatedModule.html.ref)7
-rw-r--r--html-test/ref/DeprecatedModule2.html (renamed from tests/html-tests/tests/DeprecatedModule2.html.ref)5
-rw-r--r--html-test/ref/DeprecatedNewtype.html (renamed from tests/html-tests/tests/DeprecatedNewtype.html.ref)14
-rw-r--r--html-test/ref/DeprecatedReExport.html133
-rw-r--r--html-test/ref/DeprecatedRecord.html (renamed from tests/html-tests/tests/DeprecatedRecord.html.ref)5
-rw-r--r--html-test/ref/DeprecatedTypeFamily.html (renamed from tests/html-tests/tests/DeprecatedTypeFamily.html.ref)8
-rw-r--r--html-test/ref/DeprecatedTypeSynonym.html (renamed from tests/html-tests/tests/DeprecatedTypeSynonym.html.ref)8
-rw-r--r--html-test/ref/DeprecationMessageParseError.html101
-rw-r--r--html-test/ref/Examples.html (renamed from tests/html-tests/tests/Examples.html.ref)2
-rw-r--r--html-test/ref/FunArgs.html (renamed from tests/html-tests/tests/FunArgs.html.ref)6
-rw-r--r--html-test/ref/GADTRecords.html (renamed from tests/html-tests/tests/GADTRecords.html.ref)2
-rw-r--r--html-test/ref/Hash.html (renamed from tests/html-tests/tests/Hash.html.ref)10
-rw-r--r--html-test/ref/HiddenInstances.html169
-rw-r--r--html-test/ref/HiddenInstancesB.html143
-rw-r--r--html-test/ref/Hyperlinks.html (renamed from tests/html-tests/tests/DeprecatedFunction.html.ref)21
-rw-r--r--html-test/ref/IgnoreExports.html (renamed from tests/html-tests/tests/IgnoreExports.html.ref)2
-rw-r--r--html-test/ref/ModuleWithWarning.html (renamed from tests/html-tests/tests/ModuleWithWarning.html.ref)7
-rw-r--r--html-test/ref/NamedDoc.html (renamed from tests/html-tests/tests/NamedDoc.html.ref)2
-rw-r--r--html-test/ref/NoLayout.html (renamed from tests/html-tests/tests/NoLayout.html.ref)2
-rw-r--r--html-test/ref/NonGreedy.html (renamed from tests/html-tests/tests/NonGreedy.html.ref)2
-rw-r--r--html-test/ref/Properties.html92
-rw-r--r--html-test/ref/PruneWithWarning.html (renamed from tests/html-tests/tests/PruneWithWarning.html.ref)19
-rw-r--r--html-test/ref/QuasiExpr.html (renamed from tests/html-tests/tests/QuasiExpr.html.ref)2
-rw-r--r--html-test/ref/QuasiQuote.html (renamed from tests/html-tests/tests/QuasiQuote.html.ref)2
-rw-r--r--html-test/ref/SpuriousSuperclassConstraints.html128
-rw-r--r--html-test/ref/TH.html (renamed from tests/html-tests/tests/TH.html.ref)2
-rw-r--r--html-test/ref/TH2.html (renamed from tests/html-tests/tests/TH2.html.ref)2
-rw-r--r--html-test/ref/Test.html (renamed from tests/html-tests/tests/Test.html.ref)54
-rw-r--r--html-test/ref/Ticket112.html (renamed from tests/html-tests/tests/Ticket112.html.ref)2
-rw-r--r--html-test/ref/Ticket61.html (renamed from tests/html-tests/tests/Ticket61.html.ref)2
-rw-r--r--html-test/ref/Ticket75.html (renamed from tests/html-tests/tests/Ticket75.html.ref)2
-rw-r--r--html-test/ref/TypeFamilies.html (renamed from tests/html-tests/tests/TypeFamilies.html.ref)2
-rw-r--r--html-test/ref/TypeOperators.html (renamed from tests/html-tests/tests/TypeOperators.html.ref)56
-rw-r--r--html-test/ref/Unicode.html (renamed from tests/html-tests/tests/Unicode.html.ref)2
-rw-r--r--html-test/ref/Visible.html (renamed from tests/html-tests/tests/Visible.html.ref)2
-rw-r--r--html-test/ref/frames.html (renamed from html/frames.html)0
-rw-r--r--html-test/ref/haddock-util.js (renamed from html/haddock-util.js)0
-rw-r--r--html-test/ref/hslogo-16.png (renamed from html/Ocean.std-theme/hslogo-16.png)bin1684 -> 1684 bytes
-rw-r--r--html-test/ref/mini_A.html (renamed from tests/html-tests/tests/mini_A.html.ref)0
-rw-r--r--html-test/ref/mini_AdvanceTypes.html33
-rw-r--r--html-test/ref/mini_B.html (renamed from tests/html-tests/tests/mini_B.html.ref)0
-rw-r--r--html-test/ref/mini_Bug1.html (renamed from tests/html-tests/tests/mini_Bug1.html.ref)0
-rw-r--r--html-test/ref/mini_Bug2.html (renamed from tests/html-tests/tests/mini_Bug2.html.ref)0
-rw-r--r--html-test/ref/mini_Bug3.html (renamed from tests/html-tests/tests/mini_Bug3.html.ref)0
-rw-r--r--html-test/ref/mini_Bug4.html (renamed from tests/html-tests/tests/mini_Bug4.html.ref)0
-rw-r--r--html-test/ref/mini_Bug6.html (renamed from tests/html-tests/tests/mini_Bug6.html.ref)0
-rw-r--r--html-test/ref/mini_Bug7.html (renamed from tests/html-tests/tests/mini_Bug7.html.ref)0
-rw-r--r--html-test/ref/mini_Bug8.html (renamed from tests/html-tests/tests/mini_Bug8.html.ref)0
-rw-r--r--html-test/ref/mini_BugDeprecated.html (renamed from tests/html-tests/tests/mini_BugDeprecated.html.ref)0
-rw-r--r--html-test/ref/mini_BugExportHeadings.html (renamed from tests/html-tests/tests/mini_BugExportHeadings.html.ref)0
-rw-r--r--html-test/ref/mini_Bugs.html (renamed from tests/html-tests/tests/mini_Bugs.html.ref)0
-rw-r--r--html-test/ref/mini_CrossPackageDocs.html (renamed from tests/html-tests/tests/mini_CrossPackageDocs.html.ref)4
-rw-r--r--html-test/ref/mini_DeprecatedClass.html (renamed from tests/html-tests/tests/mini_DeprecatedClass.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedData.html (renamed from tests/html-tests/tests/mini_DeprecatedData.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedFunction.html37
-rw-r--r--html-test/ref/mini_DeprecatedFunction2.html (renamed from tests/html-tests/tests/mini_DeprecatedFunction2.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedFunction3.html (renamed from tests/html-tests/tests/mini_DeprecatedFunction3.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedModule.html (renamed from tests/html-tests/tests/mini_DeprecatedModule.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedModule2.html (renamed from tests/html-tests/tests/mini_DeprecatedModule2.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedNewtype.html (renamed from tests/html-tests/tests/mini_DeprecatedNewtype.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedReExport.html37
-rw-r--r--html-test/ref/mini_DeprecatedRecord.html (renamed from tests/html-tests/tests/mini_DeprecatedRecord.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedTypeFamily.html (renamed from tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecatedTypeSynonym.html (renamed from tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref)0
-rw-r--r--html-test/ref/mini_DeprecationMessageParseError.html31
-rw-r--r--html-test/ref/mini_Examples.html (renamed from tests/html-tests/tests/mini_Examples.html.ref)0
-rw-r--r--html-test/ref/mini_FunArgs.html (renamed from tests/html-tests/tests/mini_FunArgs.html.ref)0
-rw-r--r--html-test/ref/mini_GADTRecords.html (renamed from tests/html-tests/tests/mini_GADTRecords.html.ref)0
-rw-r--r--html-test/ref/mini_Hash.html (renamed from tests/html-tests/tests/mini_Hash.html.ref)0
-rw-r--r--html-test/ref/mini_HiddenInstances.html41
-rw-r--r--html-test/ref/mini_HiddenInstancesB.html41
-rw-r--r--html-test/ref/mini_Hyperlinks.html (renamed from tests/html-tests/tests/mini_DeprecatedFunction.html.ref)4
-rw-r--r--html-test/ref/mini_IgnoreExports.html (renamed from tests/html-tests/tests/mini_IgnoreExports.html.ref)0
-rw-r--r--html-test/ref/mini_ModuleWithWarning.html (renamed from tests/html-tests/tests/mini_ModuleWithWarning.html.ref)0
-rw-r--r--html-test/ref/mini_NamedDoc.html (renamed from tests/html-tests/tests/mini_NamedDoc.html.ref)0
-rw-r--r--html-test/ref/mini_NoLayout.html (renamed from tests/html-tests/tests/mini_NoLayout.html.ref)0
-rw-r--r--html-test/ref/mini_NonGreedy.html (renamed from tests/html-tests/tests/mini_NonGreedy.html.ref)0
-rw-r--r--html-test/ref/mini_Properties.html31
-rw-r--r--html-test/ref/mini_PruneWithWarning.html (renamed from tests/html-tests/tests/mini_PruneWithWarning.html.ref)0
-rw-r--r--html-test/ref/mini_QuasiExpr.html (renamed from tests/html-tests/tests/mini_QuasiExpr.html.ref)0
-rw-r--r--html-test/ref/mini_QuasiQuote.html (renamed from tests/html-tests/tests/mini_QuasiQuote.html.ref)0
-rw-r--r--html-test/ref/mini_SpuriousSuperclassConstraints.html33
-rw-r--r--html-test/ref/mini_TH.html (renamed from tests/html-tests/tests/mini_TH.html.ref)0
-rw-r--r--html-test/ref/mini_TH2.html (renamed from tests/html-tests/tests/mini_TH2.html.ref)0
-rw-r--r--html-test/ref/mini_Test.html (renamed from tests/html-tests/tests/mini_Test.html.ref)0
-rw-r--r--html-test/ref/mini_Ticket112.html (renamed from tests/html-tests/tests/mini_Ticket112.html.ref)0
-rw-r--r--html-test/ref/mini_Ticket61.html (renamed from tests/html-tests/tests/mini_Ticket61.html.ref)0
-rw-r--r--html-test/ref/mini_Ticket75.html (renamed from tests/html-tests/tests/mini_Ticket75.html.ref)0
-rw-r--r--html-test/ref/mini_TypeFamilies.html (renamed from tests/html-tests/tests/mini_TypeFamilies.html.ref)0
-rw-r--r--html-test/ref/mini_TypeOperators.html (renamed from tests/html-tests/tests/mini_TypeOperators.html.ref)8
-rw-r--r--html-test/ref/mini_Unicode.html (renamed from tests/html-tests/tests/mini_Unicode.html.ref)0
-rw-r--r--html-test/ref/mini_Visible.html (renamed from tests/html-tests/tests/mini_Visible.html.ref)0
-rw-r--r--html-test/ref/minus.gif (renamed from html/Classic.theme/minus.gif)bin56 -> 56 bytes
-rw-r--r--html-test/ref/ocean.css (renamed from html/Ocean.std-theme/ocean.css)0
-rw-r--r--html-test/ref/plus.gif (renamed from html/Classic.theme/plus.gif)bin59 -> 59 bytes
-rw-r--r--html-test/ref/synopsis.png (renamed from html/Ocean.std-theme/synopsis.png)bin11327 -> 11327 bytes
-rwxr-xr-x[-rw-r--r--]html-test/run.lhs (renamed from tests/html-tests/runtests.hs)84
-rw-r--r--html-test/src/A.hs (renamed from tests/html-tests/tests/A.hs)0
-rw-r--r--html-test/src/AdvanceTypes.hs9
-rw-r--r--html-test/src/B.hs (renamed from tests/html-tests/tests/B.hs)0
-rw-r--r--html-test/src/Bug1.hs (renamed from examples/Bug1.hs)0
-rw-r--r--html-test/src/Bug2.hs (renamed from examples/Bug2.hs)0
-rw-r--r--html-test/src/Bug3.hs (renamed from tests/html-tests/tests/Bug3.hs)0
-rw-r--r--html-test/src/Bug4.hs (renamed from tests/html-tests/tests/Bug4.hs)0
-rw-r--r--html-test/src/Bug6.hs (renamed from tests/html-tests/tests/Bug6.hs)0
-rw-r--r--html-test/src/Bug7.hs (renamed from examples/Bug7.hs)0
-rw-r--r--html-test/src/Bug8.hs (renamed from tests/html-tests/tests/Bug8.hs)0
-rw-r--r--html-test/src/BugDeprecated.hs (renamed from tests/html-tests/tests/BugDeprecated.hs)0
-rw-r--r--html-test/src/BugExportHeadings.hs (renamed from tests/html-tests/tests/BugExportHeadings.hs)0
-rw-r--r--html-test/src/Bugs.hs (renamed from tests/html-tests/tests/Bugs.hs)0
-rw-r--r--html-test/src/CrossPackageDocs.hs4
-rw-r--r--html-test/src/DeprecatedClass.hs (renamed from tests/html-tests/tests/DeprecatedClass.hs)0
-rw-r--r--html-test/src/DeprecatedData.hs (renamed from tests/html-tests/tests/DeprecatedData.hs)0
-rw-r--r--html-test/src/DeprecatedFunction.hs10
-rw-r--r--html-test/src/DeprecatedFunction2.hs (renamed from tests/html-tests/tests/DeprecatedFunction2.hs)0
-rw-r--r--html-test/src/DeprecatedFunction3.hs (renamed from tests/html-tests/tests/DeprecatedFunction3.hs)0
-rw-r--r--html-test/src/DeprecatedModule.hs5
-rw-r--r--html-test/src/DeprecatedModule2.hs (renamed from tests/html-tests/tests/DeprecatedModule2.hs)0
-rw-r--r--html-test/src/DeprecatedNewtype.hs (renamed from tests/html-tests/tests/DeprecatedNewtype.hs)0
-rw-r--r--html-test/src/DeprecatedReExport.hs16
-rw-r--r--html-test/src/DeprecatedRecord.hs (renamed from tests/html-tests/tests/DeprecatedRecord.hs)0
-rw-r--r--html-test/src/DeprecatedTypeFamily.hs (renamed from tests/html-tests/tests/DeprecatedTypeFamily.hs)0
-rw-r--r--html-test/src/DeprecatedTypeSynonym.hs (renamed from tests/html-tests/tests/DeprecatedTypeSynonym.hs)0
-rw-r--r--html-test/src/DeprecationMessageParseError.hs12
-rw-r--r--html-test/src/Examples.hs (renamed from tests/html-tests/tests/Examples.hs)0
-rw-r--r--html-test/src/FunArgs.hs (renamed from tests/html-tests/tests/FunArgs.hs)0
-rw-r--r--html-test/src/GADTRecords.hs (renamed from tests/html-tests/tests/GADTRecords.hs)0
-rw-r--r--html-test/src/Hash.hs (renamed from tests/html-tests/tests/Hash.hs)0
-rw-r--r--html-test/src/Hidden.hs (renamed from tests/html-tests/tests/Hidden.hs)0
-rw-r--r--html-test/src/HiddenInstances.hs35
-rw-r--r--html-test/src/HiddenInstancesA.hs17
-rw-r--r--html-test/src/HiddenInstancesB.hs2
-rw-r--r--html-test/src/Hyperlinks.hs8
-rw-r--r--html-test/src/IgnoreExports.hs (renamed from tests/html-tests/tests/IgnoreExports.hs)0
-rw-r--r--html-test/src/ModuleWithWarning.hs (renamed from tests/html-tests/tests/ModuleWithWarning.hs)2
-rw-r--r--html-test/src/NamedDoc.hs (renamed from tests/html-tests/tests/NamedDoc.hs)0
-rw-r--r--html-test/src/NoLayout.hs (renamed from tests/html-tests/tests/NoLayout.hs)0
-rw-r--r--html-test/src/NonGreedy.hs (renamed from tests/html-tests/tests/NonGreedy.hs)0
-rw-r--r--html-test/src/Properties.hs9
-rw-r--r--html-test/src/PruneWithWarning.hs15
-rw-r--r--html-test/src/QuasiExpr.hs (renamed from tests/html-tests/tests/QuasiExpr.hs)0
-rw-r--r--html-test/src/QuasiQuote.hs (renamed from tests/html-tests/tests/QuasiQuote.hs)0
-rw-r--r--html-test/src/SpuriousSuperclassConstraints.hs30
-rw-r--r--html-test/src/TH.hs (renamed from tests/html-tests/tests/TH.hs)0
-rw-r--r--html-test/src/TH2.hs (renamed from tests/html-tests/tests/TH2.hs)0
-rw-r--r--html-test/src/Test.hs (renamed from tests/html-tests/tests/Test.hs)0
-rw-r--r--html-test/src/Ticket112.hs (renamed from tests/html-tests/tests/Ticket112.hs)0
-rw-r--r--html-test/src/Ticket61.hs (renamed from tests/html-tests/tests/Ticket61.hs)0
-rw-r--r--html-test/src/Ticket61_Hidden.hs (renamed from tests/html-tests/tests/Ticket61_Hidden.hs)0
-rw-r--r--html-test/src/Ticket75.hs (renamed from tests/html-tests/tests/Ticket75.hs)0
-rw-r--r--html-test/src/TypeFamilies.hs (renamed from tests/html-tests/tests/TypeFamilies.hs)0
-rw-r--r--html-test/src/TypeOperators.hs (renamed from tests/html-tests/tests/TypeOperators.hs)4
-rw-r--r--html-test/src/Unicode.hs.disabled (renamed from tests/html-tests/tests/Unicode.hs)0
-rw-r--r--html-test/src/Visible.hs (renamed from examples/Visible.hs)0
-rw-r--r--resources/html/Classic.theme/haskell_icon.gif (renamed from html/Classic.theme/haskell_icon.gif)bin911 -> 911 bytes
-rw-r--r--resources/html/Classic.theme/minus.gif (renamed from html/Ocean.std-theme/minus.gif)bin56 -> 56 bytes
-rw-r--r--resources/html/Classic.theme/plus.gif (renamed from html/Ocean.std-theme/plus.gif)bin59 -> 59 bytes
-rw-r--r--resources/html/Classic.theme/xhaddock.css (renamed from html/Classic.theme/xhaddock.css)0
-rw-r--r--resources/html/Ocean.std-theme/hslogo-16.pngbin0 -> 1684 bytes
-rw-r--r--resources/html/Ocean.std-theme/minus.gifbin0 -> 56 bytes
-rw-r--r--resources/html/Ocean.std-theme/ocean.css546
-rw-r--r--resources/html/Ocean.std-theme/plus.gifbin0 -> 59 bytes
-rw-r--r--resources/html/Ocean.std-theme/synopsis.pngbin0 -> 11327 bytes
-rw-r--r--resources/html/frames.html (renamed from tests/html-tests/tests/frames.html.ref)0
-rw-r--r--resources/html/haddock-util.js344
-rw-r--r--resources/latex/haddock.sty (renamed from latex/haddock.sty)0
-rw-r--r--src/.ghci1
-rw-r--r--src/Documentation/Haddock.hs15
-rw-r--r--src/Haddock.hs (renamed from src/Main.hs)73
-rw-r--r--src/Haddock/Backends/Hoogle.hs3
-rw-r--r--src/Haddock/Backends/LaTeX.hs7
-rw-r--r--src/Haddock/Backends/Xhtml/DocMarkup.hs4
-rw-r--r--src/Haddock/Interface.hs7
-rw-r--r--src/Haddock/Interface/AttachInstances.hs91
-rw-r--r--src/Haddock/Interface/Create.hs100
-rw-r--r--src/Haddock/Interface/LexParseRn.hs4
-rw-r--r--src/Haddock/Interface/ParseModuleHeader.hs1
-rw-r--r--src/Haddock/Interface/Rename.hs63
-rw-r--r--src/Haddock/InterfaceFile.hs45
-rw-r--r--src/Haddock/Lex.x4
-rw-r--r--src/Haddock/Parse.y27
-rw-r--r--src/Haddock/Types.hs56
-rw-r--r--src/Haddock/Utils.hs7
-rw-r--r--test/Haddock/ParseSpec.hs81
-rw-r--r--test/Spec.hs9
-rw-r--r--test/nanospec/README6
-rw-r--r--test/nanospec/Test/Hspec.hs126
-rw-r--r--tests/html-tests/README24
-rw-r--r--tests/html-tests/accept.hs36
-rw-r--r--tests/html-tests/tests/Bug1.hs6
-rw-r--r--tests/html-tests/tests/Bug2.hs4
-rw-r--r--tests/html-tests/tests/Bug7.hs12
-rw-r--r--tests/html-tests/tests/CrossPackageDocs.hs3
-rw-r--r--tests/html-tests/tests/DeprecatedFunction.hs6
-rw-r--r--tests/html-tests/tests/DeprecatedModule.hs5
-rw-r--r--tests/html-tests/tests/PruneWithWarning.hs9
-rw-r--r--tests/html-tests/tests/Visible.hs3
-rw-r--r--tests/unit-tests/.ghci1
-rw-r--r--tests/unit-tests/parsetests.hs69
-rwxr-xr-xtests/unit-tests/runparsetests.sh15
249 files changed, 3418 insertions, 1469 deletions
diff --git a/.ghci b/.ghci
new file mode 100644
index 00000000..afdd26a8
--- /dev/null
+++ b/.ghci
@@ -0,0 +1 @@
+:set -isrc -idist/build -idist/build/autogen -packageghc -optP-include -optPdist/build/autogen/cabal_macros.h
diff --git a/.gitignore b/.gitignore
index 9bf92b20..b516bcf8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
/dist/
+/html-test/out/
+
/doc/haddock
-/tests/html-tests/output/
-/tests/html-tests/tests/doc-index.html.ref
-/tests/html-tests/tests/index-frames.html.ref
-/tests/html-tests/tests/index.html.ref
+/doc/autom4te.cache/
+/doc/config.log
+/doc/config.mk
+/doc/config.status
+/doc/configure
diff --git a/ANNOUNCE b/ANNOUNCE
index e56f341f..8069437f 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,28 +1,20 @@
--------------------------------------------
--- Haddock 2.9.3
+-- Haddock 2.13.1
--------------------------------------------
-A new version of Haddock, the Haskell documentation tool, is out!
-
-This is the version that comes with GHC 7.2.1 (although that executable claims
-it is version 2.9.2!)
-
-Apologies to people who have sent in patches that haven't made it into this
-release, they will go into the next one.
+A new versions of Haddock has been uploaded to Hackage.
--------------------------------------------
--- Changes in version 2.9.3
+-- Changes in version 2.13.1
--------------------------------------------
-Changes in version 2.9.3
-
- * Build with GHC 7.2.1
+ * Hide instances that are "internal" to a module
- * Support blank lines in results of examples
+ * Add support for properties in documentation
- * A type signatures for multiple names generates one signature in the output
+ * Fix a bug with spurious superclass constraints
- * Minor bug fixes
+ * Fix and extend the Haddock API
--------------------------------------------
-- Links
@@ -32,7 +24,7 @@ Homepage:
http://www.haskell.org/haddock
Hackage page:
- http://hackage.haskell.org/package/haddock-2.9.0
+ http://hackage.haskell.org/package/haddock
Bugtracker and wiki:
http://trac.haskell.org/haddock
@@ -41,7 +33,7 @@ Mailing list:
haddock@projects.haskell.org
Code repository:
- http://code.haskell.org/haddock
+ http://darcs.haskell.org/haddock.git
--------------------------------------------
-- Contributors
@@ -49,13 +41,10 @@ Code repository:
The following people contributed patches to this release:
-Max Bolingbroke
-Ian Lynagh
-Simon Hengel
-Jose Pedro Magalhaes
-Simon Peyton Jones
-Michal Terepeta
+Kazu Yamamoto
+Roman Cheplyaka
David Waern
+Simon Hengel
--------------------------------------------
-- Get Involved
@@ -64,7 +53,7 @@ David Waern
We would be very happy to get more contributors. To get involved, start by
grabbing the code:
- http://code.haskell.org/haddock
+ http://darcs.haskell.org/haddock.git
Then take a look at the bug and feature tracker for things to work on:
diff --git a/CHANGES b/CHANGES
index 527a8fe0..51bb9290 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,30 @@
+Changes in version 2.13.2
+
+ * Handle HsExplicitListTy in renameer (#213)
+
+ * Allow haddock markup in deprecation messages
+
+ * Export more types from Documentation.Haddock
+
+ * Include everything that is required to run the test suite with the cabal
+ package (#230)
+
+Changes in version 2.13.1
+
+ * Hide instances that are "internal" to a module
+
+ * Add support for properties in documentation
+
+ * Fix a bug with spurious superclass constraints
+
+ * Fix and extend the Haddock API
+
+Changes in version 2.12.0
+
+ * Labeled URLs (e.g <http://example.net/ some label>)
+
+ * Improved memory usage (new dependency: deepseq)
+
Changes in version 2.11.0
* Show deprecation messages for identifiers
@@ -8,7 +35,7 @@ Changes in version 2.11.0
* Fix reporting of modules safe haskell mode
- * Fix a case where we were generating invalid xhtml
+ * Fix a case where we were generating invalid xhtml
* Improved --qual option (no crashes, proper error messages)
diff --git a/Setup.lhs b/Setup.lhs
index fe12b5be..5bde0de9 100644..100755
--- a/Setup.lhs
+++ b/Setup.lhs
@@ -1,5 +1,3 @@
-#! /usr/bin/runhaskell
-\begin{code}
-import Distribution.Simple
-main = defaultMain
-\end{code}
+#!/usr/bin/env runhaskell
+> import Distribution.Simple
+> main = defaultMain
diff --git a/doc/README b/doc/README
index ab9c0f2f..5bc038bf 100644
--- a/doc/README
+++ b/doc/README
@@ -8,6 +8,7 @@ process the documentation on your system, and a Makefile to actually
do the processing (so, on Windows, you'll need Cygwin or MSys in
addition to the DocBook XML tools). To build the HTML documentation:
+ $ autoconf
$ ./configure
$ make html
diff --git a/doc/haddock.xml b/doc/haddock.xml
index 27dd69d8..139b2830 100644
--- a/doc/haddock.xml
+++ b/doc/haddock.xml
@@ -21,7 +21,7 @@
<holder>Simon Marlow, David Waern</holder>
</copyright>
<abstract>
- <para>This document describes Haddock version 2.11.0, a Haskell
+ <para>This document describes Haddock version 2.13.2, a Haskell
documentation tool.</para>
</abstract>
</bookinfo>
@@ -1658,7 +1658,7 @@ module A where
by zero or more result lines:</para>
<programlisting>
--- | Two examples are given bellow:
+-- | Two examples are given below:
--
-- &gt;&gt;&gt; fib 10
-- 55
@@ -1672,6 +1672,18 @@ module A where
generated documenation.</para>
</section>
+ <section>
+ <title>Properties</title>
+ <para>
+ Haddock provides markup for properties:
+<programlisting>
+-- | Addition is commutative:
+--
+-- prop> a + b = b + a
+</programlisting>
+ This allows third-party applications to extract and verify them.
+ </para>
+ </section>
<section>
<title>Hyperlinked Identifiers</title>
@@ -1830,6 +1842,13 @@ module A where
<literal>&lt;...&gt;</literal>. If the output format supports
it, the URL will be turned into a hyperlink when
rendered.</para>
+
+ The URL can be followed by an optional label:
+<programlisting>
+&lt;http://example.com label&gt;
+</programlisting>
+ The label is then used as a descriptive text for the hyperlink, if the
+ output format supports it.
</section>
<section>
diff --git a/driver/Main.hs b/driver/Main.hs
new file mode 100644
index 00000000..42b99860
--- /dev/null
+++ b/driver/Main.hs
@@ -0,0 +1,7 @@
+module Main where
+
+import Documentation.Haddock (haddock)
+import System.Environment (getArgs)
+
+main :: IO ()
+main = getArgs >>= haddock
diff --git a/examples/A.hs b/examples/A.hs
deleted file mode 100644
index 4a344a24..00000000
--- a/examples/A.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-module A where
-data A = A
diff --git a/examples/B.hs b/examples/B.hs
deleted file mode 100644
index 3a31507e..00000000
--- a/examples/B.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-module B ( module A ) where
-import A
diff --git a/examples/Bug10.hs b/examples/Bug10.hs
deleted file mode 100644
index 04c5ff50..00000000
--- a/examples/Bug10.hs
+++ /dev/null
@@ -1,3 +0,0 @@
--- | Module: M
-f :: a -> a
-
diff --git a/examples/Bug3.hs b/examples/Bug3.hs
deleted file mode 100644
index cfda7e4c..00000000
--- a/examples/Bug3.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-module Bug3 where
-
--- | /multi-line
--- emphasis/
-foo :: Int
-
diff --git a/examples/Bug4.hs b/examples/Bug4.hs
deleted file mode 100644
index bb3c4fe2..00000000
--- a/examples/Bug4.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-module Bug4 where
--- | don't use apostrophe's in the wrong place's
-foo :: Int
-
diff --git a/examples/Bug6.hs b/examples/Bug6.hs
deleted file mode 100644
index 498983df..00000000
--- a/examples/Bug6.hs
+++ /dev/null
@@ -1,23 +0,0 @@
--- | Exporting records.
-module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where
-
--- |
--- This record is exported without its field
-data A = A { a :: Int }
-
--- |
--- .. with its field, but the field is named separately in the export list
--- (should still be visible as a field name)
-data B = B { b :: Int }
-
--- |
--- .. with fields names as subordinate names in the export
-data C = C { c1 :: Int, c2 :: Int }
-
--- |
--- .. with only some of the fields exported (we can't handle this one -
--- how do we render the declaration?)
-data D = D { d1 :: Int, d2 :: Int }
-
--- | a newtype with a field
-newtype E = E { e :: Int }
diff --git a/examples/Bug8.hs b/examples/Bug8.hs
deleted file mode 100644
index 6481ca3f..00000000
--- a/examples/Bug8.hs
+++ /dev/null
@@ -1,8 +0,0 @@
-infix -->
-infix --->
-
-data Typ = Type (String,[Typ])
- | TFree (String, [String])
-
-x --> y = Type("fun",[s,t])
-(--->) = flip $ foldr (-->)
diff --git a/examples/Bug9.hs b/examples/Bug9.hs
deleted file mode 100644
index 81e341db..00000000
--- a/examples/Bug9.hs
+++ /dev/null
@@ -1,6 +0,0 @@
--- Haddock 0.6 didn't parse this module, because the qualified
--- identifier C.safe was incorrectly lexed as 3 tokens.
-
-module Check where
-import qualified Foo as C
-check = undefined { C.safe = 3 }
diff --git a/examples/Hash.hs b/examples/Hash.hs
deleted file mode 100644
index b399b129..00000000
--- a/examples/Hash.hs
+++ /dev/null
@@ -1,45 +0,0 @@
-{- |
- Implementation of fixed-size hash tables, with a type
- class for constructing hash values for structured types.
--}
-module Hash (
- -- * The @HashTable@ type
- HashTable,
-
- -- ** Operations on @HashTable@s
- new, insert, lookup,
-
- -- * The @Hash@ class
- Hash(..),
- ) where
-
-import Array
-
--- | A hash table with keys of type @key@ and values of type @val@.
--- The type @key@ should be an instance of 'Eq'.
-data HashTable key val = HashTable Int (Array Int [(key,val)])
-
--- | Builds a new hash table with a given size
-new :: (Eq key, Hash key) => Int -> IO (HashTable key val)
-
--- | Inserts a new element into the hash table
-insert :: (Eq key, Hash key) => key -> val -> IO ()
-
--- | Looks up a key in the hash table, returns @'Just' val@ if the key
--- was found, or 'Nothing' otherwise.
-lookup :: Hash key => key -> IO (Maybe val)
-
--- | A class of types which can be hashed.
-class Hash a where
- -- | hashes the value of type @a@ into an 'Int'
- hash :: a -> Int
-
-instance Hash Int where
- hash = id
-
-instance Hash Float where
- hash = trunc
-
-instance (Hash a, Hash b) => Hash (a,b) where
- hash (a,b) = hash a `xor` hash b
-
diff --git a/examples/Hidden.hs b/examples/Hidden.hs
deleted file mode 100644
index d30925b1..00000000
--- a/examples/Hidden.hs
+++ /dev/null
@@ -1,4 +0,0 @@
--- #hide
-module Hidden where
-hidden :: Int -> Int
-hidden a = a
diff --git a/examples/Makefile b/examples/Makefile
deleted file mode 100644
index 034358ec..00000000
--- a/examples/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-TOP = ..
-include $(TOP)/mk/boilerplate.mk
-
-all :: index.html
-
-index.html : $(HS_SRCS) $(HADDOCK_INPLACE)
- $(HADDOCK_INPLACE) -h $(HS_SRCS)
-
-CLEAN_FILES += index.html
-
-include $(TOP)/mk/target.mk
diff --git a/examples/NoLayout.hs b/examples/NoLayout.hs
deleted file mode 100644
index 0be97ba1..00000000
--- a/examples/NoLayout.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-module NoLayout where {
- -- | the class 'C'
- g :: Int;
- }
diff --git a/examples/Test.hs b/examples/Test.hs
deleted file mode 100644
index 230f32d8..00000000
--- a/examples/Test.hs
+++ /dev/null
@@ -1,410 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : Test
--- Copyright : (c) Simon Marlow 2002
--- License : BSD-style
---
--- Maintainer : libraries@haskell.org
--- Stability : provisional
--- Portability : portable
---
--- This module illustrates & tests most of the features of Haddock.
--- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'.
---
------------------------------------------------------------------------------
-
--- This is plain comment, ignored by Haddock.
-
-module Test (
-
- -- Section headings are introduced with '-- *':
- -- * Type declarations
-
- -- Subsection headings are introduced with '-- **' and so on.
- -- ** Data types
- T(..), T2, T3(..), T4(..), T5(..), T6(..),
- N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..),
-
- -- ** Records
- R(..), R1(..),
-
- -- | test that we can export record selectors on their own:
- p, q, u,
-
- -- * Class declarations
- C(a,b), D(..), E, F(..),
-
- -- | Test that we can export a class method on its own:
- a,
-
- -- * Function types
- f, g,
-
- -- * Auxiliary stuff
-
- -- $aux1
-
- -- $aux2
-
- -- $aux3
-
- -- $aux4
-
- -- $aux5
-
- -- $aux6
-
- -- $aux7
-
- -- $aux8
-
- -- $aux9
-
- -- $aux10
-
- -- $aux11
-
- -- $aux12
-
- -- | This is some inline documentation in the export list
- --
- -- > a code block using bird-tracks
- -- > each line must begin with > (which isn't significant unless it
- -- > is at the beginning of the line).
-
- -- * A hidden module
- module Hidden,
-
- -- * A visible module
- module Visible,
-
- {-| nested-style doc comments -}
-
- -- * Existential \/ Universal types
- Ex(..),
-
- -- * Type signatures with argument docs
- k, l, m, o,
-
- -- * A section
- -- and without an intervening comma:
- -- ** A subsection
-
-{-|
- > a literal line
-
- $ a non /literal/ line $
--}
-
- f'
- ) where
-
-import Hidden
-import Visible
-import Data.Maybe
-
-bla = Nothing
-
--- | This comment applies to the /following/ declaration
--- and it continues until the next non-comment line
-data T a b
- = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor
- | -- | This comment describes the 'B' constructor
- B (T a b, T Int Float) -- ^
-
--- | An abstract data declaration
-data T2 a b = T2 a b
-
--- | A data declaration with no documentation annotations on the constructors
-data T3 a b = A1 a | B1 b
-
--- A data declaration with no documentation annotations at all
-data T4 a b = A2 a | B2 b
-
--- A data declaration documentation on the constructors only
-data T5 a b
- = A3 a -- ^ documents 'A3'
- | B3 b -- ^ documents 'B3'
-
--- | Testing alternative comment styles
-data T6
- -- | This is the doc for 'A4'
- = A4
- | B4
- | -- ^ This is the doc for 'B4'
-
- -- | This is the doc for 'C4'
- C4
-
--- | A newtype
-newtype N1 a = N1 a
-
--- | A newtype with a fieldname
-newtype N2 a b = N2 {n :: a b}
-
--- | A newtype with a fieldname, documentation on the field
-newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field
- }
-
--- | An abstract newtype - we show this one as data rather than newtype because
--- the difference isn\'t visible to the programmer for an abstract type.
-newtype N4 a b = N4 a
-
-newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor
- }
-
-newtype N6 a b = N6 {n6 :: a b
- }
- -- ^ docs on the constructor only
-
--- | docs on the newtype and the constructor
-newtype N7 a b = N7 {n7 :: a b
- }
- -- ^ The 'N7' constructor
-
-
-class (D a) => C a where
- -- |this is a description of the 'a' method
- a :: IO a
- b :: [a]
- -- ^ this is a description of the 'b' method
- c :: a -- c is hidden in the export list
-
--- ^ This comment applies to the /previous/ declaration (the 'C' class)
-
-class D a where
- d :: T a b
- e :: (a,a)
--- ^ This is a class declaration with no separate docs for the methods
-
-instance D Int where
- d = undefined
- e = undefined
-
--- instance with a qualified class name
-instance Test.D Float where
- d = undefined
- e = undefined
-
-class E a where
- ee :: a
--- ^ This is a class declaration with no methods (or no methods exported)
-
--- This is a class declaration with no documentation at all
-class F a where
- ff :: a
-
--- | This is the documentation for the 'R' record, which has four fields,
--- 'p', 'q', 'r', and 's'.
-data R =
- -- | This is the 'C1' record constructor, with the following fields:
- C1 { p :: Int -- ^ This comment applies to the 'p' field
- , q :: forall a . a->a -- ^ This comment applies to the 'q' field
- , -- | This comment applies to both 'r' and 's'
- r,s :: Int
- }
- | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (),
- u,v :: Int
- }
- -- ^ This is the 'C2' record constructor, also with some fields:
-
--- | Testing different record commenting styles
-data R1
- -- | This is the 'C3' record constructor
- = C3 {
- -- | The 's1' record selector
- s1 :: Int
- -- | The 's2' record selector
- , s2 :: Int
- , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here.
- -- Since GHC doesn't allow that, I have removed it in this file.
- -- ^ The 's3' record selector
- }
-
--- These section headers are only used when there is no export list to
--- give the structure of the documentation:
-
--- * This is a section header (level 1)
--- ** This is a section header (level 2)
--- *** This is a section header (level 3)
-
-{-|
-In a comment string we can refer to identifiers in scope with
-single quotes like this: 'T', and we can refer to modules by
-using double quotes: "Foo". We can add emphasis /like this/.
-
- * This is a bulleted list
-
- - This is the next item (different kind of bullet)
-
- (1) This is an ordered list
-
- 2. This is the next item (different kind of bullet)
-
-@
- This is a block of code, which can include other markup: 'R'
- formatting
- is
- significant
-@
-
-> this is another block of code
-
-We can also include URLs in documentation: <http://www.haskell.org/>.
--}
-
-f :: C a => a -> Int
-
--- | we can export foreign declarations too
-foreign import ccall g :: Int -> IO CInt
-
--- | this doc string has a parse error in it: \'
-h :: Int
-h = 42
-
-
--- $aux1 This is some documentation that is attached to a name ($aux1)
--- rather than a source declaration. The documentation may be
--- referred to in the export list using its name.
---
--- @ code block in named doc @
-
--- $aux2 This is some documentation that is attached to a name ($aux2)
-
--- $aux3
--- @ code block on its own in named doc @
-
--- $aux4
---
--- @ code block on its own in named doc (after newline) @
-
-{- $aux5 a nested, named doc comment
-
- with a paragraph,
-
- @ and a code block @
--}
-
--- some tests for various arrangements of code blocks:
-
-{- $aux6
->test
->test1
-
-@ test2
- test3
-@
--}
-
-{- $aux7
-@
-test1
-test2
-@
--}
-
-{- $aux8
->test3
->test4
--}
-
-{- $aux9
-@
-test1
-test2
-@
-
->test3
->test4
--}
-
-{- $aux10
->test3
->test4
-
-@
-test1
-test2
-@
--}
-
--- This one is currently wrong (Haddock 0.4). The @...@ part is
--- interpreted as part of the bird-tracked code block.
-{- $aux11
-aux11:
-
->test3
->test4
-
-@
-test1
-test2
-@
--}
-
--- $aux12
--- > foo
---
--- > bar
---
-
--- | A data-type using existential\/universal types
-data Ex a
- = forall b . C b => Ex1 b
- | forall b . Ex2 b
- | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file
- | Ex4 (forall a . a -> a)
-
--- | This is a function with documentation for each argument
-k :: T () () -- ^ This argument has type 'T'
- -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int'
- -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@
- -> T5 () () -- ^ This argument has a very long description that should
- -- hopefully cause some wrapping to happen when it is finally
- -- rendered by Haddock in the generated HTML page.
- -> IO () -- ^ This is the result type
-
--- This function has arg docs but no docs for the function itself
-l :: (Int, Int, Float) -- ^ takes a triple
- -> Int -- ^ returns an 'Int'
-
--- | This function has some arg docs
-m :: R
- -> N1 () -- ^ one of the arguments
- -> IO Int -- ^ and the return value
-
--- | This function has some arg docs but not a return value doc
-
--- can't use the original name ('n') with GHC
-newn :: R -- ^ one of the arguments, an 'R'
- -> N1 () -- ^ one of the arguments
- -> IO Int
-newn = undefined
-
-
--- | A foreign import with argument docs
-foreign import ccall unsafe
- o :: Float -- ^ The input float
- -> IO Float -- ^ The output float
-
--- | We should be able to escape this: \#\#\#
-
--- p :: Int
--- can't use the above original definition with GHC
-newp :: Int
-newp = undefined
-
--- | a function with a prime can be referred to as 'f''
--- but f' doesn't get link'd 'f\''
-f' :: Int
-
-
--- Add some definitions here so that this file can be compiled with GHC
-
-data T1
-f = undefined
-f' = undefined
-type CInt = Int
-k = undefined
-l = undefined
-m = undefined
diff --git a/examples/hide-bug/A.hs b/examples/hide-bug/A.hs
deleted file mode 100644
index a9386a40..00000000
--- a/examples/hide-bug/A.hs
+++ /dev/null
@@ -1,2 +0,0 @@
--- #hide
-module A where { data T = MkT; f :: T; f = MkT }
diff --git a/examples/hide-bug/B.hs b/examples/hide-bug/B.hs
deleted file mode 100644
index eeaa8290..00000000
--- a/examples/hide-bug/B.hs
+++ /dev/null
@@ -1,5 +0,0 @@
-module B(Test, vis) where
-
-vis = id
-
-data Test = Test
diff --git a/examples/hide-bug/C.hs b/examples/hide-bug/C.hs
deleted file mode 100644
index d846035b..00000000
--- a/examples/hide-bug/C.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-module C(C.bla) where
-
-import D
-
-bla :: Test
-bla = undefined
diff --git a/examples/hide-bug/D.hs b/examples/hide-bug/D.hs
deleted file mode 100644
index e8ce5744..00000000
--- a/examples/hide-bug/D.hs
+++ /dev/null
@@ -1,7 +0,0 @@
--- The link to the type T in the doc for this module should point to
--- B.T, not A.T. Bug fixed in rev 1.59 of Main.hs.
-module D(Test, hej) where
-
-import B
-
-hej = vis
diff --git a/ghc.mk b/ghc.mk
index ab57961d..e2043754 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -14,11 +14,11 @@ $(INPLACE_BIN)/$(utils/haddock_dist_PROG): $(INPLACE_LIB)/html $(INPLACE_LIB)/la
$(INPLACE_LIB)/html:
$(call removeTrees,$@)
- "$(CP)" -R utils/haddock/html $@
+ "$(CP)" -R utils/haddock/resources/html $@
$(INPLACE_LIB)/latex:
$(call removeTrees,$@)
- "$(CP)" -R utils/haddock/latex $@
+ "$(CP)" -R utils/haddock/resources/latex $@
endif
@@ -42,12 +42,12 @@ install_utils/haddock_data:
$(foreach i,$(sort $(dir $(utils/haddock_dist_DATA_FILES))), \
$(call make-command,$(call INSTALL_DIR,"$(DESTDIR)$(ghclibdir)/$i")))
$(foreach i,$(utils/haddock_dist_DATA_FILES), \
- $(call make-command,$(call INSTALL_DATA,$(INSTALL_OPTS),utils/haddock/$i,"$(DESTDIR)$(ghclibdir)/$(dir $i)")))
+ $(call make-command,$(call INSTALL_DATA,$(INSTALL_OPTS),utils/haddock/resources/$i,"$(DESTDIR)$(ghclibdir)/$(dir $i)")))
.PHONY: install_utils/haddock_link
install_utils/haddock_link:
$(call removeFiles,"$(DESTDIR)$(bindir)/haddock")
$(LN_S) $(utils/haddock_dist_INSTALL_SHELL_WRAPPER_NAME) "$(DESTDIR)$(bindir)/haddock"
-BINDIST_EXTRAS += $(addprefix utils/haddock/,$(utils/haddock_dist_DATA_FILES))
+BINDIST_EXTRAS += $(addprefix utils/haddock/resources/,$(utils/haddock_dist_DATA_FILES))
diff --git a/haddock.cabal b/haddock.cabal
index ddf0ce65..c4e33ad6 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -1,5 +1,5 @@
name: haddock
-version: 2.11.0
+version: 2.13.2
synopsis: A documentation-generation tool for Haskell libraries
description: Haddock is a documentation-generation tool for Haskell
libraries
@@ -26,119 +26,96 @@ extra-source-files:
doc/docbook-xml.mk
doc/fptools.css
doc/haddock.xml
- examples/A.hs
- examples/B.hs
- examples/Bug1.hs
- examples/Bug2.hs
- examples/Bug3.hs
- examples/Bug4.hs
- examples/Bug6.hs
- examples/Bug7.hs
- examples/Bug8.hs
- examples/Bug9.hs
- examples/Hash.hs
- examples/Hidden.hs
- examples/Makefile
- examples/NoLayout.hs
- examples/Test.hs
- examples/Visible.hs
- examples/hide-bug/A.hs
- examples/hide-bug/B.hs
- examples/hide-bug/C.hs
- examples/hide-bug/D.hs
haddock.spec
haskell.vim
src/haddock.sh
--- The test files shouldn't have to go here, but the source files for
--- the test-suite stanzas don't get picked up by `cabal sdist`.
- tests/html-tests/runtests.hs
-
-data-files:
- html/frames.html
- html/haddock-util.js
- html/Classic.theme/haskell_icon.gif
- html/Classic.theme/minus.gif
- html/Classic.theme/plus.gif
- html/Classic.theme/xhaddock.css
- html/Ocean.std-theme/hslogo-16.png
- html/Ocean.std-theme/minus.gif
- html/Ocean.std-theme/ocean.css
- html/Ocean.std-theme/plus.gif
- html/Ocean.std-theme/synopsis.png
- latex/haddock.sty
+ html-test/src/*.hs
+ html-test/ref/*.html
+
+data-dir: resources
+data-files: html/frames.html
+ html/haddock-util.js
+ html/Classic.theme/haskell_icon.gif
+ html/Classic.theme/minus.gif
+ html/Classic.theme/plus.gif
+ html/Classic.theme/xhaddock.css
+ html/Ocean.std-theme/hslogo-16.png
+ html/Ocean.std-theme/minus.gif
+ html/Ocean.std-theme/ocean.css
+ html/Ocean.std-theme/plus.gif
+ html/Ocean.std-theme/synopsis.png
+ latex/haddock.sty
flag in-ghc-tree
description: Are we in a GHC tree?
default: False
manual: True
-flag test
+-- Using this disables -O2, and hence allows to use --disable-optimization,
+-- which is about twice as fast. This should probably be the default, but we
+-- need some benchmarks first..
+flag dev
default: False
manual: True
executable haddock
default-language: Haskell2010
- -- In a GHC tree - in particular, in a source tarball - we don't
- -- require alex or happy
+ main-is: Main.hs
+ hs-source-dirs: driver
+ if flag(dev)
+ ghc-options: -funbox-strict-fields -Wall -fwarn-tabs
+ else
+ ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
if !flag(in-ghc-tree)
build-tools: alex >= 2.3, happy >= 1.18
build-depends:
- base >= 4.3 && < 4.8,
- filepath,
- directory,
- pretty,
- containers,
- deepseq,
- array,
- xhtml >= 3000.2 && < 3000.3,
- Cabal >= 1.10,
- ghc >= 7.4 && < 7.8
-
+ base >= 4.3 && < 4.8
if flag(in-ghc-tree)
+ hs-source-dirs: src
cpp-options: -DIN_GHC_TREE
+ build-depends:
+ filepath,
+ directory,
+ containers,
+ deepseq,
+ array,
+ xhtml >= 3000.2 && < 3000.3,
+ Cabal >= 1.10,
+ ghc >= 7.4 && < 7.8
+ other-modules:
+ Documentation.Haddock
+ Haddock
+ Haddock.Interface
+ Haddock.Interface.Rename
+ Haddock.Interface.Create
+ Haddock.Interface.AttachInstances
+ Haddock.Interface.LexParseRn
+ Haddock.Interface.ParseModuleHeader
+ Haddock.Lex
+ Haddock.Parse
+ Haddock.Utils
+ Haddock.Backends.Xhtml
+ Haddock.Backends.Xhtml.Decl
+ Haddock.Backends.Xhtml.DocMarkup
+ Haddock.Backends.Xhtml.Layout
+ Haddock.Backends.Xhtml.Names
+ Haddock.Backends.Xhtml.Themes
+ Haddock.Backends.Xhtml.Types
+ Haddock.Backends.Xhtml.Utils
+ Haddock.Backends.LaTeX
+ Haddock.Backends.HaddockDB
+ Haddock.Backends.Hoogle
+ Haddock.ModuleTree
+ Haddock.Types
+ Haddock.Doc
+ Haddock.Version
+ Haddock.InterfaceFile
+ Haddock.Options
+ Haddock.GhcUtils
+ Haddock.Convert
else
- build-depends: ghc-paths
+ build-depends: haddock
- if flag(test)
- cpp-options: -DTEST
- build-depends: QuickCheck >= 2.1 && < 3
-
- main-is: Main.hs
- hs-source-dirs: src
- default-extensions: CPP, DeriveDataTypeable,
- ScopedTypeVariables, MagicHash
- ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs
-
- other-modules:
- Haddock.Interface
- Haddock.Interface.Rename
- Haddock.Interface.Create
- Haddock.Interface.AttachInstances
- Haddock.Interface.LexParseRn
- Haddock.Interface.ParseModuleHeader
- Haddock.Lex
- Haddock.Parse
- Haddock.Utils
- Haddock.Backends.Xhtml
- Haddock.Backends.Xhtml.Decl
- Haddock.Backends.Xhtml.DocMarkup
- Haddock.Backends.Xhtml.Layout
- Haddock.Backends.Xhtml.Names
- Haddock.Backends.Xhtml.Themes
- Haddock.Backends.Xhtml.Types
- Haddock.Backends.Xhtml.Utils
- Haddock.Backends.LaTeX
- Haddock.Backends.HaddockDB
- Haddock.Backends.Hoogle
- Haddock.ModuleTree
- Haddock.Types
- Haddock.Doc
- Haddock.Version
- Haddock.InterfaceFile
- Haddock.Options
- Haddock.GhcUtils
- Haddock.Convert
-
library
default-language: Haskell2010
-- In a GHC tree - in particular, in a source tarball - we don't
@@ -149,8 +126,8 @@ library
base >= 4.3 && < 4.8,
filepath,
directory,
- pretty,
containers,
+ deepseq,
array,
xhtml >= 3000.2 && < 3000.3,
Cabal >= 1.10,
@@ -161,20 +138,17 @@ library
else
build-depends: ghc-paths
- if flag(test)
- cpp-options: -DTEST
- build-depends: QuickCheck >= 2.1 && < 3
-
hs-source-dirs: src
- default-extensions: CPP, DeriveDataTypeable,
- ScopedTypeVariables, MagicHash
- ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs
+ if flag(dev)
+ ghc-options: -funbox-strict-fields -Wall -fwarn-tabs
+ else
+ ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
exposed-modules:
Documentation.Haddock
other-modules:
- Main
+ Haddock
Haddock.Interface
Haddock.Interface.Rename
Haddock.Interface.Create
@@ -204,17 +178,50 @@ library
Haddock.GhcUtils
Haddock.Convert
Paths_haddock
-
+
if flag(in-ghc-tree)
buildable: False
-test-suite html-tests
+test-suite html-test
type: exitcode-stdio-1.0
default-language: Haskell2010
- main-is: runtests.hs
- hs-source-dirs: tests/html-tests
+ main-is: run.lhs
+ hs-source-dirs: html-test
build-depends: base, directory, process, filepath, Cabal
+test-suite spec
+ type: exitcode-stdio-1.0
+ default-language: Haskell2010
+ main-is: Spec.hs
+ hs-source-dirs:
+ test
+ , test/nanospec
+ , src
+
+ other-modules:
+ Test.Hspec
+ Haddock.ParseSpec
+
+ build-depends:
+ base
+ , ghc
+ , containers
+ , deepseq
+ , array
+
+ -- NOTE: As of this writing, Cabal does not properly handle alex/happy for
+ -- test suites. We work around this by adding dist/build to hs-source-dirs,
+ -- so that the the generated lexer/parser from the library is used. In
+ -- addition we depend on 'haddock', so that the library is compiled before
+ -- the test suite.
+ --
+ -- The corresponding cabal ticket is here:
+ -- https://github.com/haskell/cabal/issues/943
+ hs-source-dirs:
+ dist/build
+ build-depends:
+ haddock
+
source-repository head
type: git
location: http://darcs.haskell.org/haddock.git
diff --git a/haddock.spec b/haddock.spec
index 8b2a5599..9d6ea8f6 100644
--- a/haddock.spec
+++ b/haddock.spec
@@ -17,7 +17,7 @@
# version label of your release tarball.
%define name haddock
-%define version 2.11.0
+%define version 2.13.2
%define release 1
Name: %{name}
diff --git a/html-test/README.markdown b/html-test/README.markdown
new file mode 100644
index 00000000..8d57acab
--- /dev/null
+++ b/html-test/README.markdown
@@ -0,0 +1,27 @@
+This is a testsuite for Haddock that uses the concept of "golden files". That
+is, it compares output files against a set of reference files.
+
+To add a new test:
+
+ 1. Create a module in the `html-test/src` directory.
+
+ 2. Run `cabal test`. You should now have `html-test/out/<modulename>.html`.
+ The test passes since there is no reference file to compare with.
+
+ 3. To make a reference file from the output file, run
+
+ html-test/accept.lhs <modulename>
+
+Tips and tricks:
+
+To "accept" all output files (copy them to reference files), run
+
+ runhaskell accept.lhs
+
+You can run all tests despite failing tests, like so
+
+ cabal test --test-option=all
+
+You can pass extra options to haddock like so
+
+ cabal test --test-options='all --title="All Tests"'
diff --git a/html-test/accept.lhs b/html-test/accept.lhs
new file mode 100755
index 00000000..f6dfc4cd
--- /dev/null
+++ b/html-test/accept.lhs
@@ -0,0 +1,49 @@
+#!/usr/bin/env runhaskell
+\begin{code}
+{-# LANGUAGE CPP #-}
+import System.Cmd
+import System.Environment
+import System.FilePath
+import System.Directory
+import Data.List
+import Control.Applicative
+
+baseDir = takeDirectory __FILE__
+
+main :: IO ()
+main = do
+ contents <- filter (not . ignore) <$> getDirectoryContents (baseDir </> "out")
+ args <- getArgs
+ if not $ null args then
+ mapM_ copy [ baseDir </> "out" </> file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ]
+ else
+ mapM_ copy [ baseDir </> "out" </> file | file <- contents]
+ where
+ ignore =
+ foldr (liftA2 (||)) (const False) [
+ (== ".")
+ , (== "..")
+ , (isPrefixOf "index")
+ , (isPrefixOf "doc-index")
+ ]
+
+copy :: FilePath -> IO ()
+copy file = do
+ let new = baseDir </> "ref" </> takeFileName file
+ if ".html" `isSuffixOf` file then do
+ putStrLn (file ++ " -> " ++ new)
+ stripLinks <$> readFile file >>= writeFile new
+ else do
+ -- copy css, images, etc.
+ copyFile file new
+
+stripLinks :: String -> String
+stripLinks str =
+ let prefix = "<a href=\"" in
+ case stripPrefix prefix str of
+ Just str' -> prefix ++ stripLinks (dropWhile (/= '"') str')
+ Nothing ->
+ case str of
+ [] -> []
+ x : xs -> x : stripLinks xs
+\end{code}
diff --git a/tests/html-tests/tests/A.html.ref b/html-test/ref/A.html
index 424ce52c..9a60933e 100644
--- a/tests/html-tests/tests/A.html.ref
+++ b/html-test/ref/A.html
@@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/AdvanceTypes.html b/html-test/ref/AdvanceTypes.html
new file mode 100644
index 00000000..c18e13fc
--- /dev/null
+++ b/html-test/ref/AdvanceTypes.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >AdvanceTypes</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_AdvanceTypes.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >AdvanceTypes</p
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a name="t:Pattern" class="def"
+ >Pattern</a
+ > <span class="keyword"
+ >where</span
+ ></p
+ ><div class="subs constructors"
+ ><p class="caption"
+ >Constructors</p
+ ><table
+ ><tr
+ ><td class="src"
+ ><a name="v:Nil" class="def"
+ >Nil</a
+ > :: <a href=""
+ >Pattern</a
+ > `[]`</td
+ ><td class="doc empty"
+ >&nbsp;</td
+ ></tr
+ ><tr
+ ><td class="src"
+ ><a name="v:Cons" class="def"
+ >Cons</a
+ > :: <a href=""
+ >Maybe</a
+ > h -&gt; <a href=""
+ >Pattern</a
+ > t -&gt; <a href=""
+ >Pattern</a
+ > (h : t)</td
+ ><td class="doc empty"
+ >&nbsp;</td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/B.html.ref b/html-test/ref/B.html
index 717df90f..050e89a8 100644
--- a/tests/html-tests/tests/B.html.ref
+++ b/html-test/ref/B.html
@@ -168,7 +168,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_B.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug1.html.ref b/html-test/ref/Bug1.html
index aae1aaf9..72733816 100644
--- a/tests/html-tests/tests/Bug1.html.ref
+++ b/html-test/ref/Bug1.html
@@ -96,7 +96,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug1.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug2.html.ref b/html-test/ref/Bug2.html
index eec3271b..a6a65b1e 100644
--- a/tests/html-tests/tests/Bug2.html.ref
+++ b/html-test/ref/Bug2.html
@@ -58,7 +58,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug2.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug3.html.ref b/html-test/ref/Bug3.html
index 1c3190b4..2c32e070 100644
--- a/tests/html-tests/tests/Bug3.html.ref
+++ b/html-test/ref/Bug3.html
@@ -76,7 +76,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug3.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug4.html.ref b/html-test/ref/Bug4.html
index f1cf4655..ba726c27 100644
--- a/tests/html-tests/tests/Bug4.html.ref
+++ b/html-test/ref/Bug4.html
@@ -75,7 +75,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug4.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug6.html.ref b/html-test/ref/Bug6.html
index 8704feee..17fab740 100644
--- a/tests/html-tests/tests/Bug6.html.ref
+++ b/html-test/ref/Bug6.html
@@ -328,7 +328,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug6.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug7.html.ref b/html-test/ref/Bug7.html
index 1b986241..a86a75c2 100644
--- a/tests/html-tests/tests/Bug7.html.ref
+++ b/html-test/ref/Bug7.html
@@ -166,7 +166,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bug8.html.ref b/html-test/ref/Bug8.html
index 35ab4f19..4655db6f 100644
--- a/tests/html-tests/tests/Bug8.html.ref
+++ b/html-test/ref/Bug8.html
@@ -124,7 +124,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug8.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/BugDeprecated.html.ref b/html-test/ref/BugDeprecated.html
index d2771521..879b04fc 100644
--- a/tests/html-tests/tests/BugDeprecated.html.ref
+++ b/html-test/ref/BugDeprecated.html
@@ -96,7 +96,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><div class="doc"
><div class="warning"
><p
- >Deprecated: for foo</p
+ >Deprecated: for foo
+</p
></div
></div
></div
@@ -110,7 +111,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><div class="doc"
><div class="warning"
><p
- >Deprecated: for baz</p
+ >Deprecated: for baz
+</p
></div
></div
></div
@@ -124,7 +126,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><div class="doc"
><div class="warning"
><p
- >Deprecated: for bar</p
+ >Deprecated: for bar
+</p
></div
></div
></div
@@ -138,7 +141,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><div class="doc"
><div class="warning"
><p
- >Deprecated: for one</p
+ >Deprecated: for one
+</p
></div
><p
>some documentation for one, two and three
@@ -155,7 +159,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><div class="doc"
><div class="warning"
><p
- >Deprecated: for three</p
+ >Deprecated: for three
+</p
></div
><p
>some documentation for one, two and three
@@ -172,7 +177,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><div class="doc"
><div class="warning"
><p
- >Deprecated: for two</p
+ >Deprecated: for two
+</p
></div
><p
>some documentation for one, two and three
@@ -185,7 +191,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");}
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/BugExportHeadings.html.ref b/html-test/ref/BugExportHeadings.html
index d78dd469..4832d7fb 100644
--- a/tests/html-tests/tests/BugExportHeadings.html.ref
+++ b/html-test/ref/BugExportHeadings.html
@@ -166,7 +166,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugExportHeadings.html
><div class="doc"
><div class="warning"
><p
- >Deprecated: for one</p
+ >Deprecated: for one
+</p
></div
></div
></div
@@ -183,7 +184,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugExportHeadings.html
><div class="doc"
><div class="warning"
><p
- >Deprecated: for two</p
+ >Deprecated: for two
+</p
></div
></div
></div
@@ -200,7 +202,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugExportHeadings.html
><div class="doc"
><div class="warning"
><p
- >Deprecated: for three</p
+ >Deprecated: for three
+</p
></div
></div
></div
@@ -210,7 +213,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugExportHeadings.html
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Bugs.html.ref b/html-test/ref/Bugs.html
index 7b57f021..96fbe9e8 100644
--- a/tests/html-tests/tests/Bugs.html.ref
+++ b/html-test/ref/Bugs.html
@@ -74,7 +74,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bugs.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/html-test/ref/CrossPackageDocs.html
index 3f054bfc..e2925558 100644
--- a/tests/html-tests/tests/CrossPackageDocs.html.ref
+++ b/html-test/ref/CrossPackageDocs.html
@@ -53,28 +53,16 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html"
><span class="keyword"
>class</span
> <a href=""
- >Monad</a
- > m <span class="keyword"
+ >IsString</a
+ > a <span class="keyword"
>where</span
><ul class="subs"
><li
><a href=""
- >(&gt;&gt;=)</a
- > :: m a -&gt; (a -&gt; m b) -&gt; m b</li
- ><li
- ><a href=""
- >(&gt;&gt;)</a
- > :: m a -&gt; m b -&gt; m b</li
- ><li
- ><a href=""
- >return</a
- > :: a -&gt; m a</li
- ><li
- ><a href=""
- >fail</a
- > :: <a href=""
+ >fromString</a
+ > :: <a href=""
>String</a
- > -&gt; m a</li
+ > -&gt; a</li
></ul
></li
><li class="src short"
@@ -140,201 +128,39 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html"
><p class="src"
><span class="keyword"
>class</span
- > <a name="t:Monad" class="def"
- >Monad</a
- > m <span class="keyword"
+ > <a name="t:IsString" class="def"
+ >IsString</a
+ > a <span class="keyword"
>where</span
></p
><div class="doc"
><p
- >The <code
- ><a href=""
- >Monad</a
- ></code
- > class defines the basic operations over a <em
- >monad</em
- >,
-a concept from a branch of mathematics known as <em
- >category theory</em
- >.
-From the perspective of a Haskell programmer, however, it is best to
-think of a monad as an <em
- >abstract datatype</em
- > of actions.
-Haskell's <code
- >do</code
- > expressions provide a convenient syntax for writing
-monadic expressions.
-</p
- ><p
- >Minimal complete definition: <code
- ><a href=""
- >&gt;&gt;=</a
- ></code
- > and <code
- ><a href=""
- >return</a
- ></code
- >.
-</p
- ><p
- >Instances of <code
- ><a href=""
- >Monad</a
- ></code
- > should satisfy the following laws:
-</p
- ><pre
- > return a &gt;&gt;= k == k a
- m &gt;&gt;= return == m
- m &gt;&gt;= (\x -&gt; k x &gt;&gt;= h) == (m &gt;&gt;= k) &gt;&gt;= h
-</pre
- ><p
- >Instances of both <code
- ><a href=""
- >Monad</a
- ></code
- > and <code
- ><a href=""
- >Functor</a
- ></code
- > should additionally satisfy the law:
-</p
- ><pre
- > fmap f xs == xs &gt;&gt;= return . f
-</pre
- ><p
- >The instances of <code
- ><a href=""
- >Monad</a
- ></code
- > for lists, <code
- ><a href=""
- >Maybe</a
- ></code
- > and <code
- ><a href=""
- >IO</a
- ></code
- >
-defined in the <a href=""
- >Prelude</a
- > satisfy these laws.
+ >Class for string-like datastructures; used by the overloaded string
+ extension (-foverloaded-strings in GHC).
</p
></div
><div class="subs methods"
><p class="caption"
>Methods</p
><p class="src"
- ><a name="v:-62--62--61-" class="def"
- >(&gt;&gt;=)</a
- > :: m a -&gt; (a -&gt; m b) -&gt; m b</p
- ><div class="doc"
- ><p
- >Sequentially compose two actions, passing any value produced
- by the first as an argument to the second.
-</p
- ></div
- ><p class="src"
- ><a name="v:-62--62-" class="def"
- >(&gt;&gt;)</a
- > :: m a -&gt; m b -&gt; m b</p
- ><div class="doc"
- ><p
- >Sequentially compose two actions, discarding any value produced
- by the first, like sequencing operators (such as the semicolon)
- in imperative languages.
-</p
- ></div
- ><p class="src"
- ><a name="v:return" class="def"
- >return</a
- > :: a -&gt; m a</p
- ><div class="doc"
- ><p
- >Inject a value into the monadic type.
-</p
- ></div
- ><p class="src"
- ><a name="v:fail" class="def"
- >fail</a
- > :: <a href=""
+ ><a name="v:fromString" class="def"
+ >fromString</a
+ > :: <a href=""
>String</a
- > -&gt; m a</p
- ><div class="doc"
- ><p
- >Fail with a message. This operation is not part of the
- mathematical definition of a monad, but is invoked on pattern-match
- failure in a <code
- >do</code
- > expression.
-</p
- ></div
+ > -&gt; a</p
></div
><div class="subs instances"
- ><p id="control.i:Monad" class="caption collapser" onclick="toggleSection('i:Monad')"
+ ><p id="control.i:IsString" class="caption collapser" onclick="toggleSection('i:IsString')"
>Instances</p
- ><div id="section.i:Monad" class="show"
+ ><div id="section.i:IsString" class="show"
><table
><tr
><td class="src"
><a href=""
- >Monad</a
- > []</td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td class="src"
- ><a href=""
- >Monad</a
- > <a href=""
- >IO</a
- ></td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td class="src"
- ><a href=""
- >Monad</a
- > Q</td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td class="src"
- ><a href=""
- >Monad</a
- > <a href=""
- >Maybe</a
- ></td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td class="src"
- ><a href=""
- >Monad</a
- > PprM</td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td class="src"
- ><a href=""
- >Monad</a
- > ((-&gt;) r)</td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td class="src"
- ><a href=""
- >Monad</a
- > (<a href=""
- >Either</a
- > e)</td
+ >IsString</a
+ > [<a href=""
+ >Char</a
+ >]</td
><td class="doc empty"
>&nbsp;</td
></tr
@@ -358,7 +184,11 @@ defined in the <a href=""
></td
><td class="doc"
><p
- >Filename of the executable
+ >Filename of the executable (see <code
+ ><a href=""
+ >proc</a
+ ></code
+ > for details)
</p
></td
></tr
@@ -461,7 +291,7 @@ defined in the <a href=""
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedClass.html.ref b/html-test/ref/DeprecatedClass.html
index 2648ccf2..f73216ba 100644
--- a/tests/html-tests/tests/DeprecatedClass.html.ref
+++ b/html-test/ref/DeprecatedClass.html
@@ -90,7 +90,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html")
><div class="doc"
><div class="warning"
><p
- >Deprecated: SomeClass</p
+ >Deprecated: SomeClass
+</p
></div
><p
>some class
@@ -106,7 +107,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html")
><div class="doc"
><div class="warning"
><p
- >Deprecated: foo</p
+ >Deprecated: foo
+</p
></div
><p
>documentation for foo
@@ -126,7 +128,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html")
><div class="doc"
><div class="warning"
><p
- >Deprecated: SomeOtherClass</p
+ >Deprecated: SomeOtherClass
+</p
></div
></div
><div class="subs methods"
@@ -139,7 +142,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html")
><div class="doc"
><div class="warning"
><p
- >Deprecated: bar</p
+ >Deprecated: bar
+</p
></div
></div
></div
@@ -150,7 +154,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html")
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedData.html.ref b/html-test/ref/DeprecatedData.html
index 5d98f802..d1a29021 100644
--- a/tests/html-tests/tests/DeprecatedData.html.ref
+++ b/html-test/ref/DeprecatedData.html
@@ -92,7 +92,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><div class="doc"
><div class="warning"
><p
- >Deprecated: Foo</p
+ >Deprecated: Foo
+</p
></div
><p
>type Foo
@@ -110,7 +111,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><td class="doc"
><div class="warning"
><p
- >Deprecated: Foo</p
+ >Deprecated: Foo
+</p
></div
><p
>constructor Foo
@@ -125,7 +127,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><td class="doc"
><div class="warning"
><p
- >Deprecated: Bar</p
+ >Deprecated: Bar
+</p
></div
><p
>constructor Bar
@@ -145,7 +148,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><div class="doc"
><div class="warning"
><p
- >Deprecated: One</p
+ >Deprecated: One
+</p
></div
></div
><div class="subs constructors"
@@ -160,7 +164,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><td class="doc"
><div class="warning"
><p
- >Deprecated: One</p
+ >Deprecated: One
+</p
></div
></td
></tr
@@ -172,7 +177,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><td class="doc"
><div class="warning"
><p
- >Deprecated: Two</p
+ >Deprecated: Two
+</p
></div
></td
></tr
@@ -185,7 +191,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html");
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/DeprecatedFunction.html b/html-test/ref/DeprecatedFunction.html
new file mode 100644
index 00000000..8d0e7d6b
--- /dev/null
+++ b/html-test/ref/DeprecatedFunction.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >DeprecatedFunction</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >DeprecatedFunction</p
+ ></div
+ ><div id="synopsis"
+ ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
+ >Synopsis</p
+ ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
+ ><li class="src short"
+ ><a href=""
+ >foo</a
+ > :: <a href=""
+ >Int</a
+ ></li
+ ><li class="src short"
+ ><a href=""
+ >bar</a
+ > :: <a href=""
+ >Int</a
+ ></li
+ ></ul
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><a name="v:foo" class="def"
+ >foo</a
+ > :: <a href=""
+ >Int</a
+ ></p
+ ><div class="doc"
+ ><div class="warning"
+ ><p
+ >Deprecated: use <code
+ ><a href=""
+ >bar</a
+ ></code
+ > instead
+</p
+ ></div
+ ><p
+ >some documentation for foo
+</p
+ ></div
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><a name="v:bar" class="def"
+ >bar</a
+ > :: <a href=""
+ >Int</a
+ ></p
+ ><div class="doc"
+ ><p
+ >some documentation for bar
+</p
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/DeprecatedFunction2.html.ref b/html-test/ref/DeprecatedFunction2.html
index c2ad3db8..9c7fd335 100644
--- a/tests/html-tests/tests/DeprecatedFunction2.html.ref
+++ b/html-test/ref/DeprecatedFunction2.html
@@ -66,7 +66,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction2.ht
><div class="doc"
><div class="warning"
><p
- >Deprecated: use bar instead</p
+ >Deprecated: use bar instead
+</p
></div
></div
></div
@@ -76,7 +77,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction2.ht
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedFunction3.html.ref b/html-test/ref/DeprecatedFunction3.html
index d37af345..0db7b8be 100644
--- a/tests/html-tests/tests/DeprecatedFunction3.html.ref
+++ b/html-test/ref/DeprecatedFunction3.html
@@ -66,7 +66,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction3.ht
><div class="doc"
><div class="warning"
><p
- >Deprecated: use bar instead</p
+ >Deprecated: use bar instead
+</p
></div
></div
></div
@@ -76,7 +77,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction3.ht
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedModule.html.ref b/html-test/ref/DeprecatedModule.html
index d35bba52..7ab5dcf8 100644
--- a/tests/html-tests/tests/DeprecatedModule.html.ref
+++ b/html-test/ref/DeprecatedModule.html
@@ -47,7 +47,10 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedModule.html"
><div class="doc"
><div class="warning"
><p
- >Deprecated: Use Foo instead</p
+ >Deprecated: Use <a href=""
+ >Foo</a
+ > instead
+</p
></div
><p
>Documentation for <a href=""
@@ -73,7 +76,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedModule.html"
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedModule2.html.ref b/html-test/ref/DeprecatedModule2.html
index 1c9286df..f33e5681 100644
--- a/tests/html-tests/tests/DeprecatedModule2.html.ref
+++ b/html-test/ref/DeprecatedModule2.html
@@ -47,7 +47,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedModule2.html
><div class="doc"
><div class="warning"
><p
- >Deprecated: Use Foo instead</p
+ >Deprecated: Use Foo instead
+</p
></div
></div
></div
@@ -68,7 +69,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedModule2.html
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedNewtype.html.ref b/html-test/ref/DeprecatedNewtype.html
index 19581984..1cd59ab0 100644
--- a/tests/html-tests/tests/DeprecatedNewtype.html.ref
+++ b/html-test/ref/DeprecatedNewtype.html
@@ -80,7 +80,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html
><div class="doc"
><div class="warning"
><p
- >Deprecated: SomeNewType</p
+ >Deprecated: SomeNewType
+</p
></div
><p
>some documentation
@@ -100,7 +101,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html
><td class="doc"
><div class="warning"
><p
- >Deprecated: SomeNewTypeConst</p
+ >Deprecated: SomeNewTypeConst
+</p
></div
><p
>constructor docu
@@ -120,7 +122,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html
><div class="doc"
><div class="warning"
><p
- >Deprecated: SomeOtherNewType</p
+ >Deprecated: SomeOtherNewType
+</p
></div
></div
><div class="subs constructors"
@@ -137,7 +140,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html
><td class="doc"
><div class="warning"
><p
- >Deprecated: SomeOtherNewTypeConst</p
+ >Deprecated: SomeOtherNewTypeConst
+</p
></div
></td
></tr
@@ -150,7 +154,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/DeprecatedReExport.html b/html-test/ref/DeprecatedReExport.html
new file mode 100644
index 00000000..b75850c3
--- /dev/null
+++ b/html-test/ref/DeprecatedReExport.html
@@ -0,0 +1,133 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >DeprecatedReExport</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedReExport.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >DeprecatedReExport</p
+ ></div
+ ><div id="table-of-contents"
+ ><p class="caption"
+ >Contents</p
+ ><ul
+ ><li
+ ><a href=""
+ >Re-exported from an other module
+</a
+ ></li
+ ><li
+ ><a href=""
+ >Re-exported from an other package
+</a
+ ></li
+ ></ul
+ ></div
+ ><div id="description"
+ ><p class="caption"
+ >Description</p
+ ><div class="doc"
+ ><p
+ >What is tested here:
+</p
+ ><ul
+ ><li
+ > Deprecation messages are shown for re-exported items.
+</li
+ ></ul
+ ></div
+ ></div
+ ><div id="synopsis"
+ ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
+ >Synopsis</p
+ ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
+ ><li class="src short"
+ ><a href=""
+ >foo</a
+ > :: <a href=""
+ >Int</a
+ ></li
+ ></ul
+ ></div
+ ><div id="interface"
+ ><h1 id="g:1"
+ >Re-exported from an other module
+</h1
+ ><div class="top"
+ ><p class="src"
+ ><a name="v:foo" class="def"
+ >foo</a
+ > :: <a href=""
+ >Int</a
+ ></p
+ ><div class="doc"
+ ><div class="warning"
+ ><p
+ >Deprecated: use <code
+ ><a href=""
+ >bar</a
+ ></code
+ > instead
+</p
+ ></div
+ ><p
+ >some documentation for foo
+</p
+ ></div
+ ></div
+ ><h1 id="g:2"
+ >Re-exported from an other package
+</h1
+ ><div class="doc"
+ ><p
+ >Not yet working, see <a href=""
+ >http://trac.haskell.org/haddock/ticket/223</a
+ >
+ , isEmptyChan
+</p
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/DeprecatedRecord.html.ref b/html-test/ref/DeprecatedRecord.html
index d6648bc2..62d07c45 100644
--- a/tests/html-tests/tests/DeprecatedRecord.html.ref
+++ b/html-test/ref/DeprecatedRecord.html
@@ -122,7 +122,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedRecord.html"
><dd class="doc"
><div class="warning"
><p
- >Deprecated: do not use this</p
+ >Deprecated: do not use this
+</p
></div
><p
>some value
@@ -143,7 +144,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedRecord.html"
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedTypeFamily.html.ref b/html-test/ref/DeprecatedTypeFamily.html
index a29cef00..4b73c301 100644
--- a/tests/html-tests/tests/DeprecatedTypeFamily.html.ref
+++ b/html-test/ref/DeprecatedTypeFamily.html
@@ -72,7 +72,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedTypeFamily.h
><div class="doc"
><div class="warning"
><p
- >Deprecated: SomeTypeFamily</p
+ >Deprecated: SomeTypeFamily
+</p
></div
><p
>some documentation
@@ -89,7 +90,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedTypeFamily.h
><div class="doc"
><div class="warning"
><p
- >Deprecated: SomeOtherTypeFamily</p
+ >Deprecated: SomeOtherTypeFamily
+</p
></div
></div
></div
@@ -99,7 +101,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedTypeFamily.h
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/DeprecatedTypeSynonym.html.ref b/html-test/ref/DeprecatedTypeSynonym.html
index 89d6986e..c628316e 100644
--- a/tests/html-tests/tests/DeprecatedTypeSynonym.html.ref
+++ b/html-test/ref/DeprecatedTypeSynonym.html
@@ -78,7 +78,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedTypeSynonym.
><div class="doc"
><div class="warning"
><p
- >Deprecated: TypeSyn</p
+ >Deprecated: TypeSyn
+</p
></div
><p
>some documentation
@@ -97,7 +98,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedTypeSynonym.
><div class="doc"
><div class="warning"
><p
- >Deprecated: OtherTypeSyn</p
+ >Deprecated: OtherTypeSyn
+</p
></div
></div
></div
@@ -107,7 +109,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedTypeSynonym.
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/DeprecationMessageParseError.html b/html-test/ref/DeprecationMessageParseError.html
new file mode 100644
index 00000000..3d8f3cdf
--- /dev/null
+++ b/html-test/ref/DeprecationMessageParseError.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >DeprecationMessageParseError</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_DeprecationMessageParseError.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >DeprecationMessageParseError</p
+ ></div
+ ><div id="description"
+ ><p class="caption"
+ >Description</p
+ ><div class="doc"
+ ><p
+ >What is tested here:
+</p
+ ><ul
+ ><li
+ > If parsing of a deprecation message fails, the message is included
+ verbatim.
+</li
+ ></ul
+ ></div
+ ></div
+ ><div id="synopsis"
+ ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
+ >Synopsis</p
+ ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
+ ><li class="src short"
+ ><a href=""
+ >foo</a
+ > :: <a href=""
+ >Int</a
+ ></li
+ ></ul
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><a name="v:foo" class="def"
+ >foo</a
+ > :: <a href=""
+ >Int</a
+ ></p
+ ><div class="doc"
+ ><div class="warning"
+ ><p
+ >Deprecated: use @bar instead</p
+ ></div
+ ><p
+ >some documentation for foo
+</p
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/Examples.html.ref b/html-test/ref/Examples.html
index 822d2fae..f9575eb9 100644
--- a/tests/html-tests/tests/Examples.html.ref
+++ b/html-test/ref/Examples.html
@@ -172,7 +172,7 @@ bar
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/FunArgs.html.ref b/html-test/ref/FunArgs.html
index f9ce5ded..5c7d6c34 100644
--- a/tests/html-tests/tests/FunArgs.html.ref
+++ b/html-test/ref/FunArgs.html
@@ -105,9 +105,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_FunArgs.html");};
></tr
><tr
><td class="src"
- >-&gt; <a href=""
- >()</a
- ></td
+ >-&gt; ()</td
><td class="doc"
><p
>Result
@@ -171,7 +169,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_FunArgs.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/GADTRecords.html.ref b/html-test/ref/GADTRecords.html
index 44846423..a040c954 100644
--- a/tests/html-tests/tests/GADTRecords.html.ref
+++ b/html-test/ref/GADTRecords.html
@@ -227,7 +227,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_GADTRecords.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Hash.html.ref b/html-test/ref/Hash.html
index d254a559..d5f87840 100644
--- a/tests/html-tests/tests/Hash.html.ref
+++ b/html-test/ref/Hash.html
@@ -113,9 +113,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");};
>Hash</a
> key) =&gt; key -&gt; val -&gt; <a href=""
>IO</a
- > <a href=""
- >()</a
- ></li
+ > ()</li
><li class="src short"
><a href=""
>lookup</a
@@ -210,9 +208,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");};
>Hash</a
> key) =&gt; key -&gt; val -&gt; <a href=""
>IO</a
- > <a href=""
- >()</a
- ></p
+ > ()</p
><div class="doc"
><p
>Inserts a new element into the hash table
@@ -334,7 +330,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/HiddenInstances.html b/html-test/ref/HiddenInstances.html
new file mode 100644
index 00000000..4004a650
--- /dev/null
+++ b/html-test/ref/HiddenInstances.html
@@ -0,0 +1,169 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >HiddenInstances</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_HiddenInstances.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >HiddenInstances</p
+ ></div
+ ><div id="synopsis"
+ ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
+ >Synopsis</p
+ ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
+ ><li class="src short"
+ ><span class="keyword"
+ >class</span
+ > <a href=""
+ >VisibleClass</a
+ > a </li
+ ><li class="src short"
+ ><span class="keyword"
+ >data</span
+ > <a href=""
+ >VisibleData</a
+ > </li
+ ></ul
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >class</span
+ > <a name="t:VisibleClass" class="def"
+ >VisibleClass</a
+ > a </p
+ ><div class="doc"
+ ><p
+ >Should be visible
+</p
+ ></div
+ ><div class="subs instances"
+ ><p id="control.i:VisibleClass" class="caption collapser" onclick="toggleSection('i:VisibleClass')"
+ >Instances</p
+ ><div id="section.i:VisibleClass" class="show"
+ ><table
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >VisibleClass</a
+ > <a href=""
+ >Int</a
+ ></td
+ ><td class="doc"
+ ><p
+ >Should be visible
+</p
+ ></td
+ ></tr
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >VisibleClass</a
+ > <a href=""
+ >VisibleData</a
+ ></td
+ ><td class="doc"
+ ><p
+ >Should be visible
+</p
+ ></td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a name="t:VisibleData" class="def"
+ >VisibleData</a
+ > </p
+ ><div class="doc"
+ ><p
+ >Should be visible
+</p
+ ></div
+ ><div class="subs instances"
+ ><p id="control.i:VisibleData" class="caption collapser" onclick="toggleSection('i:VisibleData')"
+ >Instances</p
+ ><div id="section.i:VisibleData" class="show"
+ ><table
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >Num</a
+ > <a href=""
+ >VisibleData</a
+ ></td
+ ><td class="doc"
+ ><p
+ >Should be visible
+</p
+ ></td
+ ></tr
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >VisibleClass</a
+ > <a href=""
+ >VisibleData</a
+ ></td
+ ><td class="doc"
+ ><p
+ >Should be visible
+</p
+ ></td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/html-test/ref/HiddenInstancesB.html b/html-test/ref/HiddenInstancesB.html
new file mode 100644
index 00000000..2a0bdf32
--- /dev/null
+++ b/html-test/ref/HiddenInstancesB.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >HiddenInstancesB</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_HiddenInstancesB.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >HiddenInstancesB</p
+ ></div
+ ><div id="synopsis"
+ ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
+ >Synopsis</p
+ ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
+ ><li class="src short"
+ ><span class="keyword"
+ >class</span
+ > <a href=""
+ >Foo</a
+ > a </li
+ ><li class="src short"
+ ><span class="keyword"
+ >data</span
+ > <a href=""
+ >Bar</a
+ > </li
+ ></ul
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >class</span
+ > <a name="t:Foo" class="def"
+ >Foo</a
+ > a </p
+ ><div class="doc"
+ ><p
+ >Should be visible
+</p
+ ></div
+ ><div class="subs instances"
+ ><p id="control.i:Foo" class="caption collapser" onclick="toggleSection('i:Foo')"
+ >Instances</p
+ ><div id="section.i:Foo" class="show"
+ ><table
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >Foo</a
+ > <a href=""
+ >Bar</a
+ ></td
+ ><td class="doc"
+ ><p
+ >Should be visible
+</p
+ ></td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a name="t:Bar" class="def"
+ >Bar</a
+ > </p
+ ><div class="doc"
+ ><p
+ >Should be visible
+</p
+ ></div
+ ><div class="subs instances"
+ ><p id="control.i:Bar" class="caption collapser" onclick="toggleSection('i:Bar')"
+ >Instances</p
+ ><div id="section.i:Bar" class="show"
+ ><table
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >Foo</a
+ > <a href=""
+ >Bar</a
+ ></td
+ ><td class="doc"
+ ><p
+ >Should be visible
+</p
+ ></td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/DeprecatedFunction.html.ref b/html-test/ref/Hyperlinks.html
index d16345a6..6224c9b5 100644
--- a/tests/html-tests/tests/DeprecatedFunction.html.ref
+++ b/html-test/ref/Hyperlinks.html
@@ -3,13 +3,13 @@
><head
><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/><title
- >DeprecatedFunction</title
+ >Hyperlinks</title
><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
/><script src="haddock-util.js" type="text/javascript"
></script
><script type="text/javascript"
>//<![CDATA[
-window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction.html");};
+window.onload = function () {pageLoad();setSynopsis("mini_Hyperlinks.html");};
//]]>
</script
></head
@@ -39,7 +39,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction.htm
></tr
></table
><p class="caption"
- >DeprecatedFunction</p
+ >Hyperlinks</p
></div
><div id="synopsis"
><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
@@ -64,12 +64,15 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction.htm
>Int</a
></p
><div class="doc"
- ><div class="warning"
- ><p
- >Deprecated: use bar instead</p
- ></div
+ ><p
+ >A plain URL: <a href=""
+ >http://example.com/</a
+ >
+</p
><p
- >some documentation foo
+ >A URL with a label: <a href=""
+ >some link</a
+ >
</p
></div
></div
@@ -79,7 +82,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedFunction.htm
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/IgnoreExports.html.ref b/html-test/ref/IgnoreExports.html
index b70cd789..15a081fd 100644
--- a/tests/html-tests/tests/IgnoreExports.html.ref
+++ b/html-test/ref/IgnoreExports.html
@@ -94,7 +94,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_IgnoreExports.html");}
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/ModuleWithWarning.html.ref b/html-test/ref/ModuleWithWarning.html
index c36a021d..97120c60 100644
--- a/tests/html-tests/tests/ModuleWithWarning.html.ref
+++ b/html-test/ref/ModuleWithWarning.html
@@ -47,7 +47,10 @@ window.onload = function () {pageLoad();setSynopsis("mini_ModuleWithWarning.html
><div class="doc"
><div class="warning"
><p
- >Warning: This is an unstable interface.</p
+ >Warning: This is an unstable interface. Prefer functions from <a href=""
+ >Prelude</a
+ > instead!
+</p
></div
><p
>Documentation for <a href=""
@@ -73,7 +76,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_ModuleWithWarning.html
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/NamedDoc.html.ref b/html-test/ref/NamedDoc.html
index ab864d89..9974486b 100644
--- a/tests/html-tests/tests/NamedDoc.html.ref
+++ b/html-test/ref/NamedDoc.html
@@ -61,7 +61,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_NamedDoc.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/NoLayout.html.ref b/html-test/ref/NoLayout.html
index ee0e4b90..e0e6d2cd 100644
--- a/tests/html-tests/tests/NoLayout.html.ref
+++ b/html-test/ref/NoLayout.html
@@ -79,7 +79,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_NoLayout.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/NonGreedy.html.ref b/html-test/ref/NonGreedy.html
index 93032fee..4b7d60e1 100644
--- a/tests/html-tests/tests/NonGreedy.html.ref
+++ b/html-test/ref/NonGreedy.html
@@ -75,7 +75,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_NonGreedy.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/Properties.html b/html-test/ref/Properties.html
new file mode 100644
index 00000000..a12c4c78
--- /dev/null
+++ b/html-test/ref/Properties.html
@@ -0,0 +1,92 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >Properties</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_Properties.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >Properties</p
+ ></div
+ ><div id="synopsis"
+ ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
+ >Synopsis</p
+ ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
+ ><li class="src short"
+ ><a href=""
+ >fib</a
+ > :: <a href=""
+ >Integer</a
+ > -&gt; <a href=""
+ >Integer</a
+ ></li
+ ></ul
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><a name="v:fib" class="def"
+ >fib</a
+ > :: <a href=""
+ >Integer</a
+ > -&gt; <a href=""
+ >Integer</a
+ ></p
+ ><div class="doc"
+ ><p
+ >Fibonacci number of given <code
+ ><a href=""
+ >Integer</a
+ ></code
+ >.
+</p
+ ><pre
+ >fib n &lt;= fib (n + 1)</pre
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/PruneWithWarning.html.ref b/html-test/ref/PruneWithWarning.html
index 7fe3edf1..b84bca9b 100644
--- a/tests/html-tests/tests/PruneWithWarning.html.ref
+++ b/html-test/ref/PruneWithWarning.html
@@ -41,6 +41,23 @@ window.onload = function () {pageLoad();setSynopsis("mini_PruneWithWarning.html"
><p class="caption"
>PruneWithWarning</p
></div
+ ><div id="description"
+ ><p class="caption"
+ >Description</p
+ ><div class="doc"
+ ><p
+ >What is tested here:
+</p
+ ><ul
+ ><li
+ > If a binding has a deprecation message but no documentation, it is pruned
+ when <code
+ >OPTIONS_HADDOCK prune</code
+ > is used.
+</li
+ ></ul
+ ></div
+ ></div
><div id="interface"
></div
></div
@@ -48,7 +65,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_PruneWithWarning.html"
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/QuasiExpr.html.ref b/html-test/ref/QuasiExpr.html
index 7b680d4f..b6c24d0b 100644
--- a/tests/html-tests/tests/QuasiExpr.html.ref
+++ b/html-test/ref/QuasiExpr.html
@@ -214,7 +214,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_QuasiExpr.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/QuasiQuote.html.ref b/html-test/ref/QuasiQuote.html
index 93b0fb90..c85cbcbd 100644
--- a/tests/html-tests/tests/QuasiQuote.html.ref
+++ b/html-test/ref/QuasiQuote.html
@@ -58,7 +58,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_QuasiQuote.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html-test/ref/SpuriousSuperclassConstraints.html b/html-test/ref/SpuriousSuperclassConstraints.html
new file mode 100644
index 00000000..bc7184d0
--- /dev/null
+++ b/html-test/ref/SpuriousSuperclassConstraints.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >SpuriousSuperclassConstraints</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_SpuriousSuperclassConstraints.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href=""
+ >Contents</a
+ ></li
+ ><li
+ ><a href=""
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >None</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >SpuriousSuperclassConstraints</p
+ ></div
+ ><div id="description"
+ ><p class="caption"
+ >Description</p
+ ><div class="doc"
+ ><p
+ >What is tested here:
+</p
+ ><p
+ >Due to a change in GHC 7.6.1 we had a bug that superclass contraints were
+ included in the instances list. Edward K. repported it here:
+</p
+ ><p
+ ><a href=""
+ >http://www.haskell.org/pipermail/haskell-cafe/2012-September/103600.html</a
+ >
+</p
+ ><p
+ >And here is the corresponding theard on glasgow-haskell-users:
+</p
+ ><p
+ ><a href=""
+ >http://www.haskell.org/pipermail/glasgow-haskell-users/2012-September/022914.html</a
+ >
+</p
+ ><p
+ >It has been fixed in:
+</p
+ ><pre
+ > 6ccf78e15a525282fef61bc4f58a279aa9c21771
+ Fix spurious superclass constraints bug.
+</pre
+ ></div
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a name="t:SomeType" class="def"
+ >SomeType</a
+ > f a </p
+ ><div class="subs instances"
+ ><p id="control.i:SomeType" class="caption collapser" onclick="toggleSection('i:SomeType')"
+ >Instances</p
+ ><div id="section.i:SomeType" class="show"
+ ><table
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >Functor</a
+ > (<a href=""
+ >SomeType</a
+ > f)</td
+ ><td class="doc empty"
+ >&nbsp;</td
+ ></tr
+ ><tr
+ ><td class="src"
+ ><a href=""
+ >Applicative</a
+ > f =&gt; <a href=""
+ >Applicative</a
+ > (<a href=""
+ >SomeType</a
+ > f)</td
+ ><td class="doc empty"
+ >&nbsp;</td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ><p
+ >Produced by <a href=""
+ >Haddock</a
+ > version 2.13.2</p
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/TH.html.ref b/html-test/ref/TH.html
index 804812e6..8d02c280 100644
--- a/tests/html-tests/tests/TH.html.ref
+++ b/html-test/ref/TH.html
@@ -56,7 +56,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TH.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/TH2.html.ref b/html-test/ref/TH2.html
index 55e18d73..7ef0ffe5 100644
--- a/tests/html-tests/tests/TH2.html.ref
+++ b/html-test/ref/TH2.html
@@ -56,7 +56,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TH2.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Test.html.ref b/html-test/ref/Test.html
index 83167477..55fdc6fc 100644
--- a/tests/html-tests/tests/Test.html.ref
+++ b/html-test/ref/Test.html
@@ -410,11 +410,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");};
>Float</a
> -&gt; <a href=""
>T5</a
- > <a href=""
- >()</a
- > <a href=""
- >()</a
- ></li
+ > () ()</li
><li
><a href=""
>u</a
@@ -590,11 +586,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");};
>k</a
> :: <a href=""
>T</a
- > <a href=""
- >()</a
- > <a href=""
- >()</a
- > -&gt; <a href=""
+ > () () -&gt; <a href=""
>T2</a
> <a href=""
>Int</a
@@ -614,15 +606,9 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");};
>Float</a
>) -&gt; <a href=""
>T5</a
- > <a href=""
- >()</a
- > <a href=""
- >()</a
- > -&gt; <a href=""
+ > () () -&gt; <a href=""
>IO</a
- > <a href=""
- >()</a
- ></li
+ > ()</li
><li class="src short"
><a href=""
>l</a
@@ -642,9 +628,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");};
>R</a
> -&gt; <a href=""
>N1</a
- > <a href=""
- >()</a
- > -&gt; <a href=""
+ > () -&gt; <a href=""
>IO</a
> <a href=""
>Int</a
@@ -1391,11 +1375,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");};
>Float</a
> -&gt; <a href=""
>T5</a
- > <a href=""
- >()</a
- > <a href=""
- >()</a
- ></dt
+ > () ()</dt
><dd class="doc empty"
>&nbsp;</dd
><dt class="src"
@@ -1981,11 +1961,7 @@ test2
><td class="src"
>:: <a href=""
>T</a
- > <a href=""
- >()</a
- > <a href=""
- >()</a
- ></td
+ > () ()</td
><td class="doc"
><p
>This argument has type <code
@@ -2038,11 +2014,7 @@ test2
><td class="src"
>-&gt; <a href=""
>T5</a
- > <a href=""
- >()</a
- > <a href=""
- >()</a
- ></td
+ > () ()</td
><td class="doc"
><p
>This argument has a very long description that should
@@ -2055,9 +2027,7 @@ test2
><td class="src"
>-&gt; <a href=""
>IO</a
- > <a href=""
- >()</a
- ></td
+ > ()</td
><td class="doc"
><p
>This is the result type
@@ -2135,9 +2105,7 @@ test2
><td class="src"
>-&gt; <a href=""
>N1</a
- > <a href=""
- >()</a
- ></td
+ > ()</td
><td class="doc"
><p
>one of the arguments
@@ -2270,7 +2238,7 @@ test2
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Ticket112.html.ref b/html-test/ref/Ticket112.html
index b0002d8f..91aa3c90 100644
--- a/tests/html-tests/tests/Ticket112.html.ref
+++ b/html-test/ref/Ticket112.html
@@ -75,7 +75,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Ticket112.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Ticket61.html.ref b/html-test/ref/Ticket61.html
index db570a15..41ec91ba 100644
--- a/tests/html-tests/tests/Ticket61.html.ref
+++ b/html-test/ref/Ticket61.html
@@ -73,7 +73,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Ticket61.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Ticket75.html.ref b/html-test/ref/Ticket75.html
index eb77dcec..bfbbbc73 100644
--- a/tests/html-tests/tests/Ticket75.html.ref
+++ b/html-test/ref/Ticket75.html
@@ -109,7 +109,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Ticket75.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/TypeFamilies.html.ref b/html-test/ref/TypeFamilies.html
index 0d3c4e47..88efdee5 100644
--- a/tests/html-tests/tests/TypeFamilies.html.ref
+++ b/html-test/ref/TypeFamilies.html
@@ -205,7 +205,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeFamilies.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/TypeOperators.html.ref b/html-test/ref/TypeOperators.html
index 022245d3..8329bab2 100644
--- a/tests/html-tests/tests/TypeOperators.html.ref
+++ b/html-test/ref/TypeOperators.html
@@ -94,20 +94,6 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");}
> :: (g `<a href=""
>O</a
>` f) a</li
- ><li class="src short"
- ><span class="keyword"
- >newtype</span
- > <a href=""
- >Flip</a
- > (~&gt;) b a = <a href=""
- >Flip</a
- > {<ul class="subs"
- ><li
- ><a href=""
- >unFlip</a
- > :: a ~&gt; b</li
- ></ul
- >}</li
></ul
></div
><div id="interface"
@@ -186,53 +172,13 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");}
>O</a
>` f) a</p
></div
- ><div class="top"
- ><p class="src"
- ><span class="keyword"
- >newtype</span
- > <a name="t:Flip" class="def"
- >Flip</a
- > (~&gt;) b a </p
- ><div class="subs constructors"
- ><p class="caption"
- >Constructors</p
- ><table
- ><tr
- ><td class="src"
- ><a name="v:Flip" class="def"
- >Flip</a
- ></td
- ><td class="doc empty"
- >&nbsp;</td
- ></tr
- ><tr
- ><td colspan="2"
- ><div class="subs fields"
- ><p class="caption"
- >Fields</p
- ><dl
- ><dt class="src"
- ><a name="v:unFlip" class="def"
- >unFlip</a
- > :: a ~&gt; b</dt
- ><dd class="doc empty"
- >&nbsp;</dd
- ></dl
- ><div class="clear"
- ></div
- ></div
- ></td
- ></tr
- ></table
- ></div
- ></div
></div
></div
><div id="footer"
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Unicode.html.ref b/html-test/ref/Unicode.html
index 7c72e845..110b0a7d 100644
--- a/tests/html-tests/tests/Unicode.html.ref
+++ b/html-test/ref/Unicode.html
@@ -75,7 +75,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Unicode.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/tests/html-tests/tests/Visible.html.ref b/html-test/ref/Visible.html
index 0c0cd4ec..adbca598 100644
--- a/tests/html-tests/tests/Visible.html.ref
+++ b/html-test/ref/Visible.html
@@ -60,7 +60,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Visible.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.11.0</p
+ > version 2.13.2</p
></div
></body
></html
diff --git a/html/frames.html b/html-test/ref/frames.html
index 1b4e38d4..1b4e38d4 100644
--- a/html/frames.html
+++ b/html-test/ref/frames.html
diff --git a/html/haddock-util.js b/html-test/ref/haddock-util.js
index 9a6fccf7..9a6fccf7 100644
--- a/html/haddock-util.js
+++ b/html-test/ref/haddock-util.js
diff --git a/html/Ocean.std-theme/hslogo-16.png b/html-test/ref/hslogo-16.png
index 0ff8579f..0ff8579f 100644
--- a/html/Ocean.std-theme/hslogo-16.png
+++ b/html-test/ref/hslogo-16.png
Binary files differ
diff --git a/tests/html-tests/tests/mini_A.html.ref b/html-test/ref/mini_A.html
index cbe50e41..cbe50e41 100644
--- a/tests/html-tests/tests/mini_A.html.ref
+++ b/html-test/ref/mini_A.html
diff --git a/html-test/ref/mini_AdvanceTypes.html b/html-test/ref/mini_AdvanceTypes.html
new file mode 100644
index 00000000..59d8dcb1
--- /dev/null
+++ b/html-test/ref/mini_AdvanceTypes.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >AdvanceTypes</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >AdvanceTypes</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a href="" target="main"
+ >Pattern</a
+ > </p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_B.html.ref b/html-test/ref/mini_B.html
index 211a7deb..211a7deb 100644
--- a/tests/html-tests/tests/mini_B.html.ref
+++ b/html-test/ref/mini_B.html
diff --git a/tests/html-tests/tests/mini_Bug1.html.ref b/html-test/ref/mini_Bug1.html
index adf81c73..adf81c73 100644
--- a/tests/html-tests/tests/mini_Bug1.html.ref
+++ b/html-test/ref/mini_Bug1.html
diff --git a/tests/html-tests/tests/mini_Bug2.html.ref b/html-test/ref/mini_Bug2.html
index b673e459..b673e459 100644
--- a/tests/html-tests/tests/mini_Bug2.html.ref
+++ b/html-test/ref/mini_Bug2.html
diff --git a/tests/html-tests/tests/mini_Bug3.html.ref b/html-test/ref/mini_Bug3.html
index af4cc445..af4cc445 100644
--- a/tests/html-tests/tests/mini_Bug3.html.ref
+++ b/html-test/ref/mini_Bug3.html
diff --git a/tests/html-tests/tests/mini_Bug4.html.ref b/html-test/ref/mini_Bug4.html
index b403e94a..b403e94a 100644
--- a/tests/html-tests/tests/mini_Bug4.html.ref
+++ b/html-test/ref/mini_Bug4.html
diff --git a/tests/html-tests/tests/mini_Bug6.html.ref b/html-test/ref/mini_Bug6.html
index 5c5c1119..5c5c1119 100644
--- a/tests/html-tests/tests/mini_Bug6.html.ref
+++ b/html-test/ref/mini_Bug6.html
diff --git a/tests/html-tests/tests/mini_Bug7.html.ref b/html-test/ref/mini_Bug7.html
index 1bec82ee..1bec82ee 100644
--- a/tests/html-tests/tests/mini_Bug7.html.ref
+++ b/html-test/ref/mini_Bug7.html
diff --git a/tests/html-tests/tests/mini_Bug8.html.ref b/html-test/ref/mini_Bug8.html
index 070dbcf8..070dbcf8 100644
--- a/tests/html-tests/tests/mini_Bug8.html.ref
+++ b/html-test/ref/mini_Bug8.html
diff --git a/tests/html-tests/tests/mini_BugDeprecated.html.ref b/html-test/ref/mini_BugDeprecated.html
index f0410137..f0410137 100644
--- a/tests/html-tests/tests/mini_BugDeprecated.html.ref
+++ b/html-test/ref/mini_BugDeprecated.html
diff --git a/tests/html-tests/tests/mini_BugExportHeadings.html.ref b/html-test/ref/mini_BugExportHeadings.html
index b481720d..b481720d 100644
--- a/tests/html-tests/tests/mini_BugExportHeadings.html.ref
+++ b/html-test/ref/mini_BugExportHeadings.html
diff --git a/tests/html-tests/tests/mini_Bugs.html.ref b/html-test/ref/mini_Bugs.html
index 3c758375..3c758375 100644
--- a/tests/html-tests/tests/mini_Bugs.html.ref
+++ b/html-test/ref/mini_Bugs.html
diff --git a/tests/html-tests/tests/mini_CrossPackageDocs.html.ref b/html-test/ref/mini_CrossPackageDocs.html
index 9d957c1e..4c0588ba 100644
--- a/tests/html-tests/tests/mini_CrossPackageDocs.html.ref
+++ b/html-test/ref/mini_CrossPackageDocs.html
@@ -30,8 +30,8 @@ window.onload = function () {pageLoad();};
><span class="keyword"
>class</span
> <a href="" target="main"
- >Monad</a
- > m</p
+ >IsString</a
+ > a</p
></div
><div class="top"
><p class="src"
diff --git a/tests/html-tests/tests/mini_DeprecatedClass.html.ref b/html-test/ref/mini_DeprecatedClass.html
index 3923c1ff..3923c1ff 100644
--- a/tests/html-tests/tests/mini_DeprecatedClass.html.ref
+++ b/html-test/ref/mini_DeprecatedClass.html
diff --git a/tests/html-tests/tests/mini_DeprecatedData.html.ref b/html-test/ref/mini_DeprecatedData.html
index 8ef20113..8ef20113 100644
--- a/tests/html-tests/tests/mini_DeprecatedData.html.ref
+++ b/html-test/ref/mini_DeprecatedData.html
diff --git a/html-test/ref/mini_DeprecatedFunction.html b/html-test/ref/mini_DeprecatedFunction.html
new file mode 100644
index 00000000..9bb90dac
--- /dev/null
+++ b/html-test/ref/mini_DeprecatedFunction.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >DeprecatedFunction</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >DeprecatedFunction</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><a href="" target="main"
+ >foo</a
+ ></p
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><a href="" target="main"
+ >bar</a
+ ></p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_DeprecatedFunction2.html.ref b/html-test/ref/mini_DeprecatedFunction2.html
index a03991a9..a03991a9 100644
--- a/tests/html-tests/tests/mini_DeprecatedFunction2.html.ref
+++ b/html-test/ref/mini_DeprecatedFunction2.html
diff --git a/tests/html-tests/tests/mini_DeprecatedFunction3.html.ref b/html-test/ref/mini_DeprecatedFunction3.html
index 4ea60339..4ea60339 100644
--- a/tests/html-tests/tests/mini_DeprecatedFunction3.html.ref
+++ b/html-test/ref/mini_DeprecatedFunction3.html
diff --git a/tests/html-tests/tests/mini_DeprecatedModule.html.ref b/html-test/ref/mini_DeprecatedModule.html
index bfdef611..bfdef611 100644
--- a/tests/html-tests/tests/mini_DeprecatedModule.html.ref
+++ b/html-test/ref/mini_DeprecatedModule.html
diff --git a/tests/html-tests/tests/mini_DeprecatedModule2.html.ref b/html-test/ref/mini_DeprecatedModule2.html
index dbcc43b9..dbcc43b9 100644
--- a/tests/html-tests/tests/mini_DeprecatedModule2.html.ref
+++ b/html-test/ref/mini_DeprecatedModule2.html
diff --git a/tests/html-tests/tests/mini_DeprecatedNewtype.html.ref b/html-test/ref/mini_DeprecatedNewtype.html
index a913525f..a913525f 100644
--- a/tests/html-tests/tests/mini_DeprecatedNewtype.html.ref
+++ b/html-test/ref/mini_DeprecatedNewtype.html
diff --git a/html-test/ref/mini_DeprecatedReExport.html b/html-test/ref/mini_DeprecatedReExport.html
new file mode 100644
index 00000000..8316dda5
--- /dev/null
+++ b/html-test/ref/mini_DeprecatedReExport.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >DeprecatedReExport</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >DeprecatedReExport</p
+ ></div
+ ><div id="interface"
+ ><h1
+ >Re-exported from an other module
+</h1
+ ><div class="top"
+ ><p class="src"
+ ><a href="" target="main"
+ >foo</a
+ ></p
+ ></div
+ ><h1
+ >Re-exported from an other package
+</h1
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_DeprecatedRecord.html.ref b/html-test/ref/mini_DeprecatedRecord.html
index 3d949d2d..3d949d2d 100644
--- a/tests/html-tests/tests/mini_DeprecatedRecord.html.ref
+++ b/html-test/ref/mini_DeprecatedRecord.html
diff --git a/tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref b/html-test/ref/mini_DeprecatedTypeFamily.html
index c87d9637..c87d9637 100644
--- a/tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref
+++ b/html-test/ref/mini_DeprecatedTypeFamily.html
diff --git a/tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref b/html-test/ref/mini_DeprecatedTypeSynonym.html
index 5ade100d..5ade100d 100644
--- a/tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref
+++ b/html-test/ref/mini_DeprecatedTypeSynonym.html
diff --git a/html-test/ref/mini_DeprecationMessageParseError.html b/html-test/ref/mini_DeprecationMessageParseError.html
new file mode 100644
index 00000000..e52f487f
--- /dev/null
+++ b/html-test/ref/mini_DeprecationMessageParseError.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >DeprecationMessageParseError</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >DeprecationMessageParseError</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><a href="" target="main"
+ >foo</a
+ ></p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_Examples.html.ref b/html-test/ref/mini_Examples.html
index c99c2c48..c99c2c48 100644
--- a/tests/html-tests/tests/mini_Examples.html.ref
+++ b/html-test/ref/mini_Examples.html
diff --git a/tests/html-tests/tests/mini_FunArgs.html.ref b/html-test/ref/mini_FunArgs.html
index 89729720..89729720 100644
--- a/tests/html-tests/tests/mini_FunArgs.html.ref
+++ b/html-test/ref/mini_FunArgs.html
diff --git a/tests/html-tests/tests/mini_GADTRecords.html.ref b/html-test/ref/mini_GADTRecords.html
index a8b838f0..a8b838f0 100644
--- a/tests/html-tests/tests/mini_GADTRecords.html.ref
+++ b/html-test/ref/mini_GADTRecords.html
diff --git a/tests/html-tests/tests/mini_Hash.html.ref b/html-test/ref/mini_Hash.html
index 1e6ad1a9..1e6ad1a9 100644
--- a/tests/html-tests/tests/mini_Hash.html.ref
+++ b/html-test/ref/mini_Hash.html
diff --git a/html-test/ref/mini_HiddenInstances.html b/html-test/ref/mini_HiddenInstances.html
new file mode 100644
index 00000000..0f1a2e04
--- /dev/null
+++ b/html-test/ref/mini_HiddenInstances.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >HiddenInstances</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >HiddenInstances</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >class</span
+ > <a href="" target="main"
+ >VisibleClass</a
+ > a</p
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a href="" target="main"
+ >VisibleData</a
+ > </p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/html-test/ref/mini_HiddenInstancesB.html b/html-test/ref/mini_HiddenInstancesB.html
new file mode 100644
index 00000000..3ce4f6a9
--- /dev/null
+++ b/html-test/ref/mini_HiddenInstancesB.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >HiddenInstancesB</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >HiddenInstancesB</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >class</span
+ > <a href="" target="main"
+ >Foo</a
+ > a</p
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a href="" target="main"
+ >Bar</a
+ > </p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_DeprecatedFunction.html.ref b/html-test/ref/mini_Hyperlinks.html
index 17d3e526..f0c7d65a 100644
--- a/tests/html-tests/tests/mini_DeprecatedFunction.html.ref
+++ b/html-test/ref/mini_Hyperlinks.html
@@ -3,7 +3,7 @@
><head
><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/><title
- >DeprecatedFunction</title
+ >Hyperlinks</title
><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
/><script src="haddock-util.js" type="text/javascript"
></script
@@ -16,7 +16,7 @@ window.onload = function () {pageLoad();};
><body id="mini"
><div id="module-header"
><p class="caption"
- >DeprecatedFunction</p
+ >Hyperlinks</p
></div
><div id="interface"
><div class="top"
diff --git a/tests/html-tests/tests/mini_IgnoreExports.html.ref b/html-test/ref/mini_IgnoreExports.html
index a420e65a..a420e65a 100644
--- a/tests/html-tests/tests/mini_IgnoreExports.html.ref
+++ b/html-test/ref/mini_IgnoreExports.html
diff --git a/tests/html-tests/tests/mini_ModuleWithWarning.html.ref b/html-test/ref/mini_ModuleWithWarning.html
index 19315a14..19315a14 100644
--- a/tests/html-tests/tests/mini_ModuleWithWarning.html.ref
+++ b/html-test/ref/mini_ModuleWithWarning.html
diff --git a/tests/html-tests/tests/mini_NamedDoc.html.ref b/html-test/ref/mini_NamedDoc.html
index 066bbc61..066bbc61 100644
--- a/tests/html-tests/tests/mini_NamedDoc.html.ref
+++ b/html-test/ref/mini_NamedDoc.html
diff --git a/tests/html-tests/tests/mini_NoLayout.html.ref b/html-test/ref/mini_NoLayout.html
index 19562d70..19562d70 100644
--- a/tests/html-tests/tests/mini_NoLayout.html.ref
+++ b/html-test/ref/mini_NoLayout.html
diff --git a/tests/html-tests/tests/mini_NonGreedy.html.ref b/html-test/ref/mini_NonGreedy.html
index 698c368e..698c368e 100644
--- a/tests/html-tests/tests/mini_NonGreedy.html.ref
+++ b/html-test/ref/mini_NonGreedy.html
diff --git a/html-test/ref/mini_Properties.html b/html-test/ref/mini_Properties.html
new file mode 100644
index 00000000..5f538dfd
--- /dev/null
+++ b/html-test/ref/mini_Properties.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >Properties</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >Properties</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><a href="" target="main"
+ >fib</a
+ ></p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_PruneWithWarning.html.ref b/html-test/ref/mini_PruneWithWarning.html
index 9eb3aa00..9eb3aa00 100644
--- a/tests/html-tests/tests/mini_PruneWithWarning.html.ref
+++ b/html-test/ref/mini_PruneWithWarning.html
diff --git a/tests/html-tests/tests/mini_QuasiExpr.html.ref b/html-test/ref/mini_QuasiExpr.html
index 7dd9b829..7dd9b829 100644
--- a/tests/html-tests/tests/mini_QuasiExpr.html.ref
+++ b/html-test/ref/mini_QuasiExpr.html
diff --git a/tests/html-tests/tests/mini_QuasiQuote.html.ref b/html-test/ref/mini_QuasiQuote.html
index 5dac6acc..5dac6acc 100644
--- a/tests/html-tests/tests/mini_QuasiQuote.html.ref
+++ b/html-test/ref/mini_QuasiQuote.html
diff --git a/html-test/ref/mini_SpuriousSuperclassConstraints.html b/html-test/ref/mini_SpuriousSuperclassConstraints.html
new file mode 100644
index 00000000..22079a4e
--- /dev/null
+++ b/html-test/ref/mini_SpuriousSuperclassConstraints.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >SpuriousSuperclassConstraints</title
+ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script
+ ></head
+ ><body id="mini"
+ ><div id="module-header"
+ ><p class="caption"
+ >SpuriousSuperclassConstraints</p
+ ></div
+ ><div id="interface"
+ ><div class="top"
+ ><p class="src"
+ ><span class="keyword"
+ >data</span
+ > <a href="" target="main"
+ >SomeType</a
+ > f a</p
+ ></div
+ ></div
+ ></body
+ ></html
+>
diff --git a/tests/html-tests/tests/mini_TH.html.ref b/html-test/ref/mini_TH.html
index d2ddbabc..d2ddbabc 100644
--- a/tests/html-tests/tests/mini_TH.html.ref
+++ b/html-test/ref/mini_TH.html
diff --git a/tests/html-tests/tests/mini_TH2.html.ref b/html-test/ref/mini_TH2.html
index 2c9f1340..2c9f1340 100644
--- a/tests/html-tests/tests/mini_TH2.html.ref
+++ b/html-test/ref/mini_TH2.html
diff --git a/tests/html-tests/tests/mini_Test.html.ref b/html-test/ref/mini_Test.html
index 26db2c0f..26db2c0f 100644
--- a/tests/html-tests/tests/mini_Test.html.ref
+++ b/html-test/ref/mini_Test.html
diff --git a/tests/html-tests/tests/mini_Ticket112.html.ref b/html-test/ref/mini_Ticket112.html
index 68a0a5e5..68a0a5e5 100644
--- a/tests/html-tests/tests/mini_Ticket112.html.ref
+++ b/html-test/ref/mini_Ticket112.html
diff --git a/tests/html-tests/tests/mini_Ticket61.html.ref b/html-test/ref/mini_Ticket61.html
index a73fefca..a73fefca 100644
--- a/tests/html-tests/tests/mini_Ticket61.html.ref
+++ b/html-test/ref/mini_Ticket61.html
diff --git a/tests/html-tests/tests/mini_Ticket75.html.ref b/html-test/ref/mini_Ticket75.html
index 75ce882c..75ce882c 100644
--- a/tests/html-tests/tests/mini_Ticket75.html.ref
+++ b/html-test/ref/mini_Ticket75.html
diff --git a/tests/html-tests/tests/mini_TypeFamilies.html.ref b/html-test/ref/mini_TypeFamilies.html
index 0cf39c88..0cf39c88 100644
--- a/tests/html-tests/tests/mini_TypeFamilies.html.ref
+++ b/html-test/ref/mini_TypeFamilies.html
diff --git a/tests/html-tests/tests/mini_TypeOperators.html.ref b/html-test/ref/mini_TypeOperators.html
index f70a0fae..86b6beec 100644
--- a/tests/html-tests/tests/mini_TypeOperators.html.ref
+++ b/html-test/ref/mini_TypeOperators.html
@@ -60,14 +60,6 @@ window.onload = function () {pageLoad();};
>biO</a
></p
></div
- ><div class="top"
- ><p class="src"
- ><span class="keyword"
- >data</span
- > <a href="" target="main"
- >Flip</a
- > (~&gt;) b a</p
- ></div
></div
></body
></html
diff --git a/tests/html-tests/tests/mini_Unicode.html.ref b/html-test/ref/mini_Unicode.html
index 55336980..55336980 100644
--- a/tests/html-tests/tests/mini_Unicode.html.ref
+++ b/html-test/ref/mini_Unicode.html
diff --git a/tests/html-tests/tests/mini_Visible.html.ref b/html-test/ref/mini_Visible.html
index 976a30c5..976a30c5 100644
--- a/tests/html-tests/tests/mini_Visible.html.ref
+++ b/html-test/ref/mini_Visible.html
diff --git a/html/Classic.theme/minus.gif b/html-test/ref/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/html/Classic.theme/minus.gif
+++ b/html-test/ref/minus.gif
Binary files differ
diff --git a/html/Ocean.std-theme/ocean.css b/html-test/ref/ocean.css
index 42238709..42238709 100644
--- a/html/Ocean.std-theme/ocean.css
+++ b/html-test/ref/ocean.css
diff --git a/html/Classic.theme/plus.gif b/html-test/ref/plus.gif
index 2d15c141..2d15c141 100644
--- a/html/Classic.theme/plus.gif
+++ b/html-test/ref/plus.gif
Binary files differ
diff --git a/html/Ocean.std-theme/synopsis.png b/html-test/ref/synopsis.png
index 85fb86ec..85fb86ec 100644
--- a/html/Ocean.std-theme/synopsis.png
+++ b/html-test/ref/synopsis.png
Binary files differ
diff --git a/tests/html-tests/runtests.hs b/html-test/run.lhs
index 25e53d1a..7d3b805b 100644..100755
--- a/tests/html-tests/runtests.hs
+++ b/html-test/run.lhs
@@ -1,35 +1,45 @@
+#!/usr/bin/env runhaskell
+\begin{code}
+{-# LANGUAGE CPP #-}
+import Prelude hiding (mod)
import Control.Monad
+import Control.Applicative
import Data.List
import Data.Maybe
import Distribution.InstalledPackageInfo
-import Distribution.Package
+import Distribution.Package (PackageName (..))
import Distribution.Simple.Compiler
import Distribution.Simple.GHC
import Distribution.Simple.PackageIndex
import Distribution.Simple.Program
import Distribution.Simple.Utils
import Distribution.Verbosity
+import System.IO
import System.Cmd
import System.Directory
import System.Environment
import System.Exit
import System.FilePath
-import System.Process
-import Text.Printf
+import System.Process (ProcessHandle, runProcess, waitForProcess)
-packageRoot = "."
+packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath
+baseDir = takeDirectory __FILE__
+testDir = baseDir </> "src"
+refDir = baseDir </> "ref"
+outDir = baseDir </> "out"
+packageRoot = baseDir </> ".."
+dataDir = packageRoot </> "resources"
haddockPath = packageRoot </> "dist" </> "build" </> "haddock" </> "haddock"
-testSuiteRoot = packageRoot </> "tests" </> "html-tests"
-testDir = testSuiteRoot </> "tests"
-outDir = testSuiteRoot </> "output"
+main :: IO ()
main = do
test
putStrLn "All tests passed!"
+test :: IO ()
test = do
x <- doesFileExist haddockPath
unless x $ die "you need to run 'cabal build' successfully first"
@@ -39,34 +49,37 @@ test = do
let (opts, spec) = span ("-" `isPrefixOf`) args
let mods =
case spec of
- x:_ | x /= "all" -> [x ++ ".hs"]
+ y:_ | y /= "all" -> [y ++ ".hs"]
_ -> filter ((==) ".hs" . takeExtension) contents
let mods' = map (testDir </>) mods
+
+ -- add haddock_datadir to environment for subprocesses
+ env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment
+
putStrLn ""
putStrLn "Haddock version: "
h1 <- runProcess haddockPath ["--version"] Nothing
- (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing
- waitForProcess h1
+ env Nothing Nothing Nothing
+ wait h1 "*** Running `haddock --version' failed!"
putStrLn ""
putStrLn "GHC version: "
h2 <- runProcess haddockPath ["--ghc-version"] Nothing
- (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing
- waitForProcess h2
+ env Nothing Nothing Nothing
+ wait h2 "*** Running `haddock --ghc-version' failed!"
putStrLn ""
-- TODO: maybe do something more clever here using haddock.cabal
ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"]
(_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration
pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf
- let safeHead xs = case xs of x : _ -> Just x; [] -> Nothing
let mkDep pkgName =
- maybe (error "Couldn't find test dependencies") id $ do
+ fromMaybe (error "Couldn't find test dependencies") $ do
let pkgs = lookupPackageName pkgIndex (PackageName pkgName)
- (_, pkgs') <- safeHead pkgs
- pkg <- safeHead pkgs'
- ifacePath <- safeHead (haddockInterfaces pkg)
- htmlPath <- safeHead (haddockHTMLs pkg)
+ (_, pkgs') <- listToMaybe pkgs
+ pkg <- listToMaybe pkgs'
+ ifacePath <- listToMaybe (haddockInterfaces pkg)
+ htmlPath <- listToMaybe (haddockHTMLs pkg)
return ("-i " ++ htmlPath ++ "," ++ ifacePath)
let base = mkDep "base"
@@ -77,22 +90,27 @@ test = do
handle <- runProcess haddockPath
(["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts"
, "--optghc=-w", base, process, ghcprim] ++ opts ++ mods')
- Nothing (Just [("haddock_datadir", packageRoot)]) Nothing
+ Nothing env Nothing
Nothing Nothing
- code <- waitForProcess handle
- when (code /= ExitSuccess) $ error "Haddock run failed! Exiting."
+ wait handle "*** Haddock run failed! Exiting."
check mods (if not (null args) && args !! 0 == "all" then False else True)
-
-
+ where
+ wait :: ProcessHandle -> String -> IO ()
+ wait h msg = do
+ r <- waitForProcess h
+ unless (r == ExitSuccess) $ do
+ hPutStrLn stderr msg
+ exitFailure
+
+check :: [FilePath] -> Bool -> IO ()
check modules strict = do
forM_ modules $ \mod -> do
- let outfile = outDir </> dropExtension mod ++ ".html"
- let reffile = testDir </> dropExtension mod ++ ".html.ref"
+ let outfile = outDir </> dropExtension mod ++ ".html"
+ let reffile = refDir </> dropExtension mod ++ ".html"
b <- doesFileExist reffile
if b
then do
- copyFile reffile (outDir </> takeFileName reffile)
out <- readFile outfile
ref <- readFile reffile
if not $ haddockEq out ref
@@ -101,22 +119,27 @@ check modules strict = do
let ref' = stripLinks ref
out' = stripLinks out
let reffile' = outDir </> takeFileName reffile ++ ".nolinks"
- outfile' = outDir </> takeFileName outfile ++ ".nolinks"
+ outfile' = outDir </> takeFileName outfile ++ ".ref.nolinks"
writeFile reffile' ref'
writeFile outfile' out'
- b <- programOnPath "colordiff"
- if b
+ r <- programOnPath "colordiff"
+ code <- if r
then system $ "colordiff " ++ reffile' ++ " " ++ outfile'
else system $ "diff " ++ reffile' ++ " " ++ outfile'
if strict then exitFailure else return ()
+ unless (code == ExitSuccess) $ do
+ hPutStrLn stderr "*** Running diff failed!"
+ exitFailure
else do
putStrLn $ "Pass: " ++ mod
else do
putStrLn $ "Pass: " ++ mod ++ " (no .ref file)"
+haddockEq :: String -> String -> Bool
haddockEq file1 file2 = stripLinks file1 == stripLinks file2
+stripLinks :: String -> String
stripLinks str =
let prefix = "<a href=\"" in
case stripPrefix prefix str of
@@ -126,7 +149,8 @@ stripLinks str =
[] -> []
x : xs -> x : stripLinks xs
+programOnPath :: FilePath -> IO Bool
programOnPath p = do
result <- findProgramLocation silent p
return (isJust result)
-
+\end{code}
diff --git a/tests/html-tests/tests/A.hs b/html-test/src/A.hs
index 606b0865..606b0865 100644
--- a/tests/html-tests/tests/A.hs
+++ b/html-test/src/A.hs
diff --git a/html-test/src/AdvanceTypes.hs b/html-test/src/AdvanceTypes.hs
new file mode 100644
index 00000000..939fdf07
--- /dev/null
+++ b/html-test/src/AdvanceTypes.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE TypeOperators #-}
+module AdvanceTypes where
+
+data Pattern :: [*] -> * where
+ Nil :: Pattern '[]
+ Cons :: Maybe h -> Pattern t -> Pattern (h ': t)
diff --git a/tests/html-tests/tests/B.hs b/html-test/src/B.hs
index 5fd69acd..5fd69acd 100644
--- a/tests/html-tests/tests/B.hs
+++ b/html-test/src/B.hs
diff --git a/examples/Bug1.hs b/html-test/src/Bug1.hs
index af1ed4d3..af1ed4d3 100644
--- a/examples/Bug1.hs
+++ b/html-test/src/Bug1.hs
diff --git a/examples/Bug2.hs b/html-test/src/Bug2.hs
index 9121922e..9121922e 100644
--- a/examples/Bug2.hs
+++ b/html-test/src/Bug2.hs
diff --git a/tests/html-tests/tests/Bug3.hs b/html-test/src/Bug3.hs
index 67e57892..67e57892 100644
--- a/tests/html-tests/tests/Bug3.hs
+++ b/html-test/src/Bug3.hs
diff --git a/tests/html-tests/tests/Bug4.hs b/html-test/src/Bug4.hs
index 425a77aa..425a77aa 100644
--- a/tests/html-tests/tests/Bug4.hs
+++ b/html-test/src/Bug4.hs
diff --git a/tests/html-tests/tests/Bug6.hs b/html-test/src/Bug6.hs
index 17411f31..17411f31 100644
--- a/tests/html-tests/tests/Bug6.hs
+++ b/html-test/src/Bug6.hs
diff --git a/examples/Bug7.hs b/html-test/src/Bug7.hs
index 8cf57914..8cf57914 100644
--- a/examples/Bug7.hs
+++ b/html-test/src/Bug7.hs
diff --git a/tests/html-tests/tests/Bug8.hs b/html-test/src/Bug8.hs
index 18df63c8..18df63c8 100644
--- a/tests/html-tests/tests/Bug8.hs
+++ b/html-test/src/Bug8.hs
diff --git a/tests/html-tests/tests/BugDeprecated.hs b/html-test/src/BugDeprecated.hs
index 0f7ac2eb..0f7ac2eb 100644
--- a/tests/html-tests/tests/BugDeprecated.hs
+++ b/html-test/src/BugDeprecated.hs
diff --git a/tests/html-tests/tests/BugExportHeadings.hs b/html-test/src/BugExportHeadings.hs
index a5493a08..a5493a08 100644
--- a/tests/html-tests/tests/BugExportHeadings.hs
+++ b/html-test/src/BugExportHeadings.hs
diff --git a/tests/html-tests/tests/Bugs.hs b/html-test/src/Bugs.hs
index 8e1f0079..8e1f0079 100644
--- a/tests/html-tests/tests/Bugs.hs
+++ b/html-test/src/Bugs.hs
diff --git a/html-test/src/CrossPackageDocs.hs b/html-test/src/CrossPackageDocs.hs
new file mode 100644
index 00000000..4d529f79
--- /dev/null
+++ b/html-test/src/CrossPackageDocs.hs
@@ -0,0 +1,4 @@
+module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where
+
+import System.Process
+import Data.String
diff --git a/tests/html-tests/tests/DeprecatedClass.hs b/html-test/src/DeprecatedClass.hs
index 018904ab..018904ab 100644
--- a/tests/html-tests/tests/DeprecatedClass.hs
+++ b/html-test/src/DeprecatedClass.hs
diff --git a/tests/html-tests/tests/DeprecatedData.hs b/html-test/src/DeprecatedData.hs
index c40ba122..c40ba122 100644
--- a/tests/html-tests/tests/DeprecatedData.hs
+++ b/html-test/src/DeprecatedData.hs
diff --git a/html-test/src/DeprecatedFunction.hs b/html-test/src/DeprecatedFunction.hs
new file mode 100644
index 00000000..8d626435
--- /dev/null
+++ b/html-test/src/DeprecatedFunction.hs
@@ -0,0 +1,10 @@
+module DeprecatedFunction where
+
+-- | some documentation for foo
+foo :: Int
+foo = 23
+{-# DEPRECATED foo "use `bar` instead" #-}
+
+-- | some documentation for bar
+bar :: Int
+bar = 42
diff --git a/tests/html-tests/tests/DeprecatedFunction2.hs b/html-test/src/DeprecatedFunction2.hs
index bdbbf95c..bdbbf95c 100644
--- a/tests/html-tests/tests/DeprecatedFunction2.hs
+++ b/html-test/src/DeprecatedFunction2.hs
diff --git a/tests/html-tests/tests/DeprecatedFunction3.hs b/html-test/src/DeprecatedFunction3.hs
index ca719bda..ca719bda 100644
--- a/tests/html-tests/tests/DeprecatedFunction3.hs
+++ b/html-test/src/DeprecatedFunction3.hs
diff --git a/html-test/src/DeprecatedModule.hs b/html-test/src/DeprecatedModule.hs
new file mode 100644
index 00000000..369dba4f
--- /dev/null
+++ b/html-test/src/DeprecatedModule.hs
@@ -0,0 +1,5 @@
+-- | Documentation for "DeprecatedModule".
+module DeprecatedModule {-# DEPRECATED "Use \"Foo\" instead" #-} where
+
+foo :: Int
+foo = 23
diff --git a/tests/html-tests/tests/DeprecatedModule2.hs b/html-test/src/DeprecatedModule2.hs
index 94185297..94185297 100644
--- a/tests/html-tests/tests/DeprecatedModule2.hs
+++ b/html-test/src/DeprecatedModule2.hs
diff --git a/tests/html-tests/tests/DeprecatedNewtype.hs b/html-test/src/DeprecatedNewtype.hs
index 254f1f55..254f1f55 100644
--- a/tests/html-tests/tests/DeprecatedNewtype.hs
+++ b/html-test/src/DeprecatedNewtype.hs
diff --git a/html-test/src/DeprecatedReExport.hs b/html-test/src/DeprecatedReExport.hs
new file mode 100644
index 00000000..f851e2ff
--- /dev/null
+++ b/html-test/src/DeprecatedReExport.hs
@@ -0,0 +1,16 @@
+-- |
+-- What is tested here:
+--
+-- * Deprecation messages are shown for re-exported items.
+--
+module DeprecatedReExport (
+-- * Re-exported from an other module
+ foo
+-- * Re-exported from an other package
+-- | Not yet working, see <http://trac.haskell.org/haddock/ticket/223>
+-- , isEmptyChan
+,
+) where
+
+import DeprecatedFunction
+import Control.Concurrent.Chan
diff --git a/tests/html-tests/tests/DeprecatedRecord.hs b/html-test/src/DeprecatedRecord.hs
index d44499e7..d44499e7 100644
--- a/tests/html-tests/tests/DeprecatedRecord.hs
+++ b/html-test/src/DeprecatedRecord.hs
diff --git a/tests/html-tests/tests/DeprecatedTypeFamily.hs b/html-test/src/DeprecatedTypeFamily.hs
index 70473bb8..70473bb8 100644
--- a/tests/html-tests/tests/DeprecatedTypeFamily.hs
+++ b/html-test/src/DeprecatedTypeFamily.hs
diff --git a/tests/html-tests/tests/DeprecatedTypeSynonym.hs b/html-test/src/DeprecatedTypeSynonym.hs
index 34df47da..34df47da 100644
--- a/tests/html-tests/tests/DeprecatedTypeSynonym.hs
+++ b/html-test/src/DeprecatedTypeSynonym.hs
diff --git a/html-test/src/DeprecationMessageParseError.hs b/html-test/src/DeprecationMessageParseError.hs
new file mode 100644
index 00000000..2f8fb492
--- /dev/null
+++ b/html-test/src/DeprecationMessageParseError.hs
@@ -0,0 +1,12 @@
+-- |
+-- What is tested here:
+--
+-- * If parsing of a deprecation message fails, the message is included
+-- verbatim.
+--
+module DeprecationMessageParseError where
+
+-- | some documentation for foo
+foo :: Int
+foo = 23
+{-# DEPRECATED foo "use @bar instead" #-}
diff --git a/tests/html-tests/tests/Examples.hs b/html-test/src/Examples.hs
index c8c450f1..c8c450f1 100644
--- a/tests/html-tests/tests/Examples.hs
+++ b/html-test/src/Examples.hs
diff --git a/tests/html-tests/tests/FunArgs.hs b/html-test/src/FunArgs.hs
index b34d84b7..b34d84b7 100644
--- a/tests/html-tests/tests/FunArgs.hs
+++ b/html-test/src/FunArgs.hs
diff --git a/tests/html-tests/tests/GADTRecords.hs b/html-test/src/GADTRecords.hs
index c77810ad..c77810ad 100644
--- a/tests/html-tests/tests/GADTRecords.hs
+++ b/html-test/src/GADTRecords.hs
diff --git a/tests/html-tests/tests/Hash.hs b/html-test/src/Hash.hs
index 343b69e9..343b69e9 100644
--- a/tests/html-tests/tests/Hash.hs
+++ b/html-test/src/Hash.hs
diff --git a/tests/html-tests/tests/Hidden.hs b/html-test/src/Hidden.hs
index 896da648..896da648 100644
--- a/tests/html-tests/tests/Hidden.hs
+++ b/html-test/src/Hidden.hs
diff --git a/html-test/src/HiddenInstances.hs b/html-test/src/HiddenInstances.hs
new file mode 100644
index 00000000..99a6c2fd
--- /dev/null
+++ b/html-test/src/HiddenInstances.hs
@@ -0,0 +1,35 @@
+-- http://trac.haskell.org/haddock/ticket/37
+module HiddenInstances (VisibleClass, VisibleData) where
+
+-- | Should be visible
+class VisibleClass a
+
+-- | Should *not* be visible
+class HiddenClass a
+
+-- | Should *not* be visible
+data HiddenData = HiddenData
+
+-- | Should be visible
+data VisibleData = VisibleData
+
+-- | Should be visible
+instance VisibleClass Int
+
+-- | Should be visible
+instance VisibleClass VisibleData
+
+-- | Should be visible
+instance Num VisibleData
+
+-- | Should *not* be visible
+instance VisibleClass HiddenData
+
+-- | Should *not* be visible
+instance HiddenClass Int
+
+-- | Should *not* be visible
+instance HiddenClass VisibleData
+
+-- | Should *not* be visible
+instance HiddenClass HiddenData
diff --git a/html-test/src/HiddenInstancesA.hs b/html-test/src/HiddenInstancesA.hs
new file mode 100644
index 00000000..f1775208
--- /dev/null
+++ b/html-test/src/HiddenInstancesA.hs
@@ -0,0 +1,17 @@
+{-# OPTIONS_HADDOCK hide #-}
+module HiddenInstancesA where
+
+-- | Should be visible
+class Foo a
+
+-- | Should be visible
+data Bar
+
+-- | Should be visible
+instance Foo Bar
+
+-- | Should *not* be visible
+data Baz
+
+-- | Should *not* be visible
+instance Foo Baz
diff --git a/html-test/src/HiddenInstancesB.hs b/html-test/src/HiddenInstancesB.hs
new file mode 100644
index 00000000..eabf0637
--- /dev/null
+++ b/html-test/src/HiddenInstancesB.hs
@@ -0,0 +1,2 @@
+module HiddenInstancesB (Foo, Bar) where
+import HiddenInstancesA
diff --git a/html-test/src/Hyperlinks.hs b/html-test/src/Hyperlinks.hs
new file mode 100644
index 00000000..34e64448
--- /dev/null
+++ b/html-test/src/Hyperlinks.hs
@@ -0,0 +1,8 @@
+module Hyperlinks where
+
+-- |
+-- A plain URL: <http://example.com/>
+--
+-- A URL with a label: <http://example.com/ some link>
+foo :: Int
+foo = 23
diff --git a/tests/html-tests/tests/IgnoreExports.hs b/html-test/src/IgnoreExports.hs
index 0321ad02..0321ad02 100644
--- a/tests/html-tests/tests/IgnoreExports.hs
+++ b/html-test/src/IgnoreExports.hs
diff --git a/tests/html-tests/tests/ModuleWithWarning.hs b/html-test/src/ModuleWithWarning.hs
index 2114bac6..e64d9d7e 100644
--- a/tests/html-tests/tests/ModuleWithWarning.hs
+++ b/html-test/src/ModuleWithWarning.hs
@@ -1,5 +1,5 @@
-- | Documentation for "ModuleWithWarning".
-module ModuleWithWarning {-# WARNING "This is an unstable interface." #-} where
+module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where
foo :: Int
foo = 23
diff --git a/tests/html-tests/tests/NamedDoc.hs b/html-test/src/NamedDoc.hs
index 7c04ba72..7c04ba72 100644
--- a/tests/html-tests/tests/NamedDoc.hs
+++ b/html-test/src/NamedDoc.hs
diff --git a/tests/html-tests/tests/NoLayout.hs b/html-test/src/NoLayout.hs
index 19b38b1d..19b38b1d 100644
--- a/tests/html-tests/tests/NoLayout.hs
+++ b/html-test/src/NoLayout.hs
diff --git a/tests/html-tests/tests/NonGreedy.hs b/html-test/src/NonGreedy.hs
index f51b55f5..f51b55f5 100644
--- a/tests/html-tests/tests/NonGreedy.hs
+++ b/html-test/src/NonGreedy.hs
diff --git a/html-test/src/Properties.hs b/html-test/src/Properties.hs
new file mode 100644
index 00000000..05930ece
--- /dev/null
+++ b/html-test/src/Properties.hs
@@ -0,0 +1,9 @@
+module Properties where
+
+-- | Fibonacci number of given 'Integer'.
+--
+-- prop> fib n <= fib (n + 1)
+fib :: Integer -> Integer
+fib 0 = 0
+fib 1 = 1
+fib n = fib (n - 1) + fib (n - 2)
diff --git a/html-test/src/PruneWithWarning.hs b/html-test/src/PruneWithWarning.hs
new file mode 100644
index 00000000..bfa55ea2
--- /dev/null
+++ b/html-test/src/PruneWithWarning.hs
@@ -0,0 +1,15 @@
+{-# OPTIONS_HADDOCK prune #-}
+-- |
+-- What is tested here:
+--
+-- * If a binding has a deprecation message but no documentation, it is pruned
+-- when @OPTIONS_HADDOCK prune@ is used.
+--
+module PruneWithWarning (foo, bar) where
+
+foo :: Int
+foo = 23
+{-# DEPRECATED foo "use bar instead" #-}
+
+bar :: Int
+bar = 42
diff --git a/tests/html-tests/tests/QuasiExpr.hs b/html-test/src/QuasiExpr.hs
index 970759ba..970759ba 100644
--- a/tests/html-tests/tests/QuasiExpr.hs
+++ b/html-test/src/QuasiExpr.hs
diff --git a/tests/html-tests/tests/QuasiQuote.hs b/html-test/src/QuasiQuote.hs
index 06762cf9..06762cf9 100644
--- a/tests/html-tests/tests/QuasiQuote.hs
+++ b/html-test/src/QuasiQuote.hs
diff --git a/html-test/src/SpuriousSuperclassConstraints.hs b/html-test/src/SpuriousSuperclassConstraints.hs
new file mode 100644
index 00000000..d9e43e1c
--- /dev/null
+++ b/html-test/src/SpuriousSuperclassConstraints.hs
@@ -0,0 +1,30 @@
+{-# LANGUAGE EmptyDataDecls, KindSignatures #-}
+-- |
+-- What is tested here:
+--
+-- Due to a change in GHC 7.6.1 we had a bug that superclass contraints were
+-- included in the instances list. Edward K. repported it here:
+--
+-- <http://www.haskell.org/pipermail/haskell-cafe/2012-September/103600.html>
+--
+-- And here is the corresponding theard on glasgow-haskell-users:
+--
+-- <http://www.haskell.org/pipermail/glasgow-haskell-users/2012-September/022914.html>
+--
+-- It has been fixed in:
+--
+-- > 6ccf78e15a525282fef61bc4f58a279aa9c21771
+-- > Fix spurious superclass constraints bug.
+--
+module SpuriousSuperclassConstraints where
+
+import Control.Applicative
+
+data SomeType (f :: * -> *) a
+
+instance Functor (SomeType f) where
+ fmap = undefined
+
+instance Applicative f => Applicative (SomeType f) where
+ pure = undefined
+ (<*>) = undefined
diff --git a/tests/html-tests/tests/TH.hs b/html-test/src/TH.hs
index f8178bcb..f8178bcb 100644
--- a/tests/html-tests/tests/TH.hs
+++ b/html-test/src/TH.hs
diff --git a/tests/html-tests/tests/TH2.hs b/html-test/src/TH2.hs
index ea85e547..ea85e547 100644
--- a/tests/html-tests/tests/TH2.hs
+++ b/html-test/src/TH2.hs
diff --git a/tests/html-tests/tests/Test.hs b/html-test/src/Test.hs
index d352f029..d352f029 100644
--- a/tests/html-tests/tests/Test.hs
+++ b/html-test/src/Test.hs
diff --git a/tests/html-tests/tests/Ticket112.hs b/html-test/src/Ticket112.hs
index c9cd5117..c9cd5117 100644
--- a/tests/html-tests/tests/Ticket112.hs
+++ b/html-test/src/Ticket112.hs
diff --git a/tests/html-tests/tests/Ticket61.hs b/html-test/src/Ticket61.hs
index 26ca287f..26ca287f 100644
--- a/tests/html-tests/tests/Ticket61.hs
+++ b/html-test/src/Ticket61.hs
diff --git a/tests/html-tests/tests/Ticket61_Hidden.hs b/html-test/src/Ticket61_Hidden.hs
index 583c10cd..583c10cd 100644
--- a/tests/html-tests/tests/Ticket61_Hidden.hs
+++ b/html-test/src/Ticket61_Hidden.hs
diff --git a/tests/html-tests/tests/Ticket75.hs b/html-test/src/Ticket75.hs
index 94a2f115..94a2f115 100644
--- a/tests/html-tests/tests/Ticket75.hs
+++ b/html-test/src/Ticket75.hs
diff --git a/tests/html-tests/tests/TypeFamilies.hs b/html-test/src/TypeFamilies.hs
index 561f95fd..561f95fd 100644
--- a/tests/html-tests/tests/TypeFamilies.hs
+++ b/html-test/src/TypeFamilies.hs
diff --git a/tests/html-tests/tests/TypeOperators.hs b/html-test/src/TypeOperators.hs
index aa0fbe8c..edbb9344 100644
--- a/tests/html-tests/tests/TypeOperators.hs
+++ b/html-test/src/TypeOperators.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE TypeOperators #-}
module TypeOperators (
-- * stuff
(:-:),
@@ -5,7 +6,6 @@ module TypeOperators (
Op,
O(..),
biO,
- Flip(..)
) where
data a :-: b
@@ -18,5 +18,3 @@ newtype (g `O` f) a = O { unO :: g (f a) }
biO :: (g `O` f) a
biO = undefined
-
-newtype Flip (~>) b a = Flip { unFlip :: a ~> b }
diff --git a/tests/html-tests/tests/Unicode.hs b/html-test/src/Unicode.hs.disabled
index d5bbf445..d5bbf445 100644
--- a/tests/html-tests/tests/Unicode.hs
+++ b/html-test/src/Unicode.hs.disabled
diff --git a/examples/Visible.hs b/html-test/src/Visible.hs
index cad71931..cad71931 100644
--- a/examples/Visible.hs
+++ b/html-test/src/Visible.hs
diff --git a/html/Classic.theme/haskell_icon.gif b/resources/html/Classic.theme/haskell_icon.gif
index 10589f91..10589f91 100644
--- a/html/Classic.theme/haskell_icon.gif
+++ b/resources/html/Classic.theme/haskell_icon.gif
Binary files differ
diff --git a/html/Ocean.std-theme/minus.gif b/resources/html/Classic.theme/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/html/Ocean.std-theme/minus.gif
+++ b/resources/html/Classic.theme/minus.gif
Binary files differ
diff --git a/html/Ocean.std-theme/plus.gif b/resources/html/Classic.theme/plus.gif
index 2d15c141..2d15c141 100644
--- a/html/Ocean.std-theme/plus.gif
+++ b/resources/html/Classic.theme/plus.gif
Binary files differ
diff --git a/html/Classic.theme/xhaddock.css b/resources/html/Classic.theme/xhaddock.css
index 40ea0d06..40ea0d06 100644
--- a/html/Classic.theme/xhaddock.css
+++ b/resources/html/Classic.theme/xhaddock.css
diff --git a/resources/html/Ocean.std-theme/hslogo-16.png b/resources/html/Ocean.std-theme/hslogo-16.png
new file mode 100644
index 00000000..0ff8579f
--- /dev/null
+++ b/resources/html/Ocean.std-theme/hslogo-16.png
Binary files differ
diff --git a/resources/html/Ocean.std-theme/minus.gif b/resources/html/Ocean.std-theme/minus.gif
new file mode 100644
index 00000000..1deac2fe
--- /dev/null
+++ b/resources/html/Ocean.std-theme/minus.gif
Binary files differ
diff --git a/resources/html/Ocean.std-theme/ocean.css b/resources/html/Ocean.std-theme/ocean.css
new file mode 100644
index 00000000..42238709
--- /dev/null
+++ b/resources/html/Ocean.std-theme/ocean.css
@@ -0,0 +1,546 @@
+/* @group Fundamentals */
+
+* { margin: 0; padding: 0 }
+
+/* Is this portable? */
+html {
+ background-color: white;
+ width: 100%;
+ height: 100%;
+}
+
+body {
+ background: white;
+ color: black;
+ text-align: left;
+ min-height: 100%;
+ position: relative;
+}
+
+p {
+ margin: 0.8em 0;
+}
+
+ul, ol {
+ margin: 0.8em 0 0.8em 2em;
+}
+
+dl {
+ margin: 0.8em 0;
+}
+
+dt {
+ font-weight: bold;
+}
+dd {
+ margin-left: 2em;
+}
+
+a { text-decoration: none; }
+a[href]:link { color: rgb(196,69,29); }
+a[href]:visited { color: rgb(171,105,84); }
+a[href]:hover { text-decoration:underline; }
+
+/* @end */
+
+/* @group Fonts & Sizes */
+
+/* Basic technique & IE workarounds from YUI 3
+ For reasons, see:
+ http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css
+ */
+
+body {
+ font:13px/1.4 sans-serif;
+ *font-size:small; /* for IE */
+ *font:x-small; /* for IE in quirks mode */
+}
+
+h1 { font-size: 146.5%; /* 19pt */ }
+h2 { font-size: 131%; /* 17pt */ }
+h3 { font-size: 116%; /* 15pt */ }
+h4 { font-size: 100%; /* 13pt */ }
+h5 { font-size: 100%; /* 13pt */ }
+
+select, input, button, textarea {
+ font:99% sans-serif;
+}
+
+table {
+ font-size:inherit;
+ font:100%;
+}
+
+pre, code, kbd, samp, tt, .src {
+ font-family:monospace;
+ *font-size:108%;
+ line-height: 124%;
+}
+
+.links, .link {
+ font-size: 85%; /* 11pt */
+}
+
+#module-header .caption {
+ font-size: 182%; /* 24pt */
+}
+
+.info {
+ font-size: 85%; /* 11pt */
+}
+
+#table-of-contents, #synopsis {
+ /* font-size: 85%; /* 11pt */
+}
+
+
+/* @end */
+
+/* @group Common */
+
+.caption, h1, h2, h3, h4, h5, h6 {
+ font-weight: bold;
+ color: rgb(78,98,114);
+ margin: 0.8em 0 0.4em;
+}
+
+* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 {
+ margin-top: 2em;
+}
+
+h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 {
+ margin-top: inherit;
+}
+
+ul.links {
+ list-style: none;
+ text-align: left;
+ float: right;
+ display: inline-table;
+ margin: 0 0 0 1em;
+}
+
+ul.links li {
+ display: inline;
+ border-left: 1px solid #d5d5d5;
+ white-space: nowrap;
+ padding: 0;
+}
+
+ul.links li a {
+ padding: 0.2em 0.5em;
+}
+
+.hide { display: none; }
+.show { display: inherit; }
+.clear { clear: both; }
+
+.collapser {
+ background-image: url(minus.gif);
+ background-repeat: no-repeat;
+}
+.expander {
+ background-image: url(plus.gif);
+ background-repeat: no-repeat;
+}
+p.caption.collapser,
+p.caption.expander {
+ background-position: 0 0.4em;
+}
+.collapser, .expander {
+ padding-left: 14px;
+ margin-left: -14px;
+ cursor: pointer;
+}
+
+pre {
+ padding: 0.25em;
+ margin: 0.8em 0;
+ background: rgb(229,237,244);
+ overflow: auto;
+ border-bottom: 0.25em solid white;
+ /* white border adds some space below the box to compensate
+ for visual extra space that paragraphs have between baseline
+ and the bounding box */
+}
+
+.src {
+ background: #f0f0f0;
+ padding: 0.2em 0.5em;
+}
+
+.keyword { font-weight: normal; }
+.def { font-weight: bold; }
+
+
+/* @end */
+
+/* @group Page Structure */
+
+#content {
+ margin: 0 auto;
+ padding: 0 2em 6em;
+}
+
+#package-header {
+ background: rgb(41,56,69);
+ border-top: 5px solid rgb(78,98,114);
+ color: #ddd;
+ padding: 0.2em;
+ position: relative;
+ text-align: left;
+}
+
+#package-header .caption {
+ background: url(hslogo-16.png) no-repeat 0em;
+ color: white;
+ margin: 0 2em;
+ font-weight: normal;
+ font-style: normal;
+ padding-left: 2em;
+}
+
+#package-header a:link, #package-header a:visited { color: white; }
+#package-header a:hover { background: rgb(78,98,114); }
+
+#module-header .caption {
+ color: rgb(78,98,114);
+ font-weight: bold;
+ border-bottom: 1px solid #ddd;
+}
+
+table.info {
+ float: right;
+ padding: 0.5em 1em;
+ border: 1px solid #ddd;
+ color: rgb(78,98,114);
+ background-color: #fff;
+ max-width: 40%;
+ border-spacing: 0;
+ position: relative;
+ top: -0.5em;
+ margin: 0 0 0 2em;
+}
+
+.info th {
+ padding: 0 1em 0 0;
+}
+
+div#style-menu-holder {
+ position: relative;
+ z-index: 2;
+ display: inline;
+}
+
+#style-menu {
+ position: absolute;
+ z-index: 1;
+ overflow: visible;
+ background: #374c5e;
+ margin: 0;
+ text-align: center;
+ right: 0;
+ padding: 0;
+ top: 1.25em;
+}
+
+#style-menu li {
+ display: list-item;
+ border-style: none;
+ margin: 0;
+ padding: 0;
+ color: #000;
+ list-style-type: none;
+}
+
+#style-menu li + li {
+ border-top: 1px solid #919191;
+}
+
+#style-menu a {
+ width: 6em;
+ padding: 3px;
+ display: block;
+}
+
+#footer {
+ background: #ddd;
+ border-top: 1px solid #aaa;
+ padding: 0.5em 0;
+ color: #666;
+ text-align: center;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ height: 3em;
+}
+
+/* @end */
+
+/* @group Front Matter */
+
+#table-of-contents {
+ float: right;
+ clear: right;
+ background: #faf9dc;
+ border: 1px solid #d8d7ad;
+ padding: 0.5em 1em;
+ max-width: 20em;
+ margin: 0.5em 0 1em 1em;
+}
+
+#table-of-contents .caption {
+ text-align: center;
+ margin: 0;
+}
+
+#table-of-contents ul {
+ list-style: none;
+ margin: 0;
+}
+
+#table-of-contents ul ul {
+ margin-left: 2em;
+}
+
+#description .caption {
+ display: none;
+}
+
+#synopsis {
+ display: none;
+}
+
+.no-frame #synopsis {
+ display: block;
+ position: fixed;
+ right: 0;
+ height: 80%;
+ top: 10%;
+ padding: 0;
+}
+
+#synopsis .caption {
+ float: left;
+ width: 29px;
+ color: rgba(255,255,255,0);
+ height: 110px;
+ margin: 0;
+ font-size: 1px;
+ padding: 0;
+}
+
+#synopsis p.caption.collapser {
+ background: url(synopsis.png) no-repeat -64px -8px;
+}
+
+#synopsis p.caption.expander {
+ background: url(synopsis.png) no-repeat 0px -8px;
+}
+
+#synopsis ul {
+ height: 100%;
+ overflow: auto;
+ padding: 0.5em;
+ margin: 0;
+}
+
+#synopsis ul ul {
+ overflow: hidden;
+}
+
+#synopsis ul,
+#synopsis ul li.src {
+ background-color: #faf9dc;
+ white-space: nowrap;
+ list-style: none;
+ margin-left: 0;
+}
+
+/* @end */
+
+/* @group Main Content */
+
+#interface div.top { margin: 2em 0; }
+#interface h1 + div.top,
+#interface h2 + div.top,
+#interface h3 + div.top,
+#interface h4 + div.top,
+#interface h5 + div.top {
+ margin-top: 1em;
+}
+#interface p.src .link {
+ float: right;
+ color: #919191;
+ border-left: 1px solid #919191;
+ background: #f0f0f0;
+ padding: 0 0.5em 0.2em;
+ margin: 0 -0.5em 0 0.5em;
+}
+
+#interface table { border-spacing: 2px; }
+#interface td {
+ vertical-align: top;
+ padding-left: 0.5em;
+}
+#interface td.src {
+ white-space: nowrap;
+}
+#interface td.doc p {
+ margin: 0;
+}
+#interface td.doc p + p {
+ margin-top: 0.8em;
+}
+
+.subs dl {
+ margin: 0;
+}
+
+.subs dt {
+ float: left;
+ clear: left;
+ display: block;
+ margin: 1px 0;
+}
+
+.subs dd {
+ float: right;
+ width: 90%;
+ display: block;
+ padding-left: 0.5em;
+ margin-bottom: 0.5em;
+}
+
+.subs dd.empty {
+ display: none;
+}
+
+.subs dd p {
+ margin: 0;
+}
+
+.top p.src {
+ border-top: 1px solid #ccc;
+}
+
+.subs, .doc {
+ /* use this selector for one level of indent */
+ padding-left: 2em;
+}
+
+.warning {
+ color: red;
+}
+
+.arguments {
+ margin-top: -0.4em;
+}
+.arguments .caption {
+ display: none;
+}
+
+.fields { padding-left: 1em; }
+
+.fields .caption { display: none; }
+
+.fields p { margin: 0 0; }
+
+/* this seems bulky to me
+.methods, .constructors {
+ background: #f8f8f8;
+ border: 1px solid #eee;
+}
+*/
+
+/* @end */
+
+/* @group Auxillary Pages */
+
+#mini {
+ margin: 0 auto;
+ padding: 0 1em 1em;
+}
+
+#mini > * {
+ font-size: 93%; /* 12pt */
+}
+
+#mini #module-list .caption,
+#mini #module-header .caption {
+ font-size: 125%; /* 15pt */
+}
+
+#mini #interface h1,
+#mini #interface h2,
+#mini #interface h3,
+#mini #interface h4 {
+ font-size: 109%; /* 13pt */
+ margin: 1em 0 0;
+}
+
+#mini #interface .top,
+#mini #interface .src {
+ margin: 0;
+}
+
+#mini #module-list ul {
+ list-style: none;
+ margin: 0;
+}
+
+#alphabet ul {
+ list-style: none;
+ padding: 0;
+ margin: 0.5em 0 0;
+ text-align: center;
+}
+
+#alphabet li {
+ display: inline;
+ margin: 0 0.25em;
+}
+
+#alphabet a {
+ font-weight: bold;
+}
+
+#index .caption,
+#module-list .caption { font-size: 131%; /* 17pt */ }
+
+#index table {
+ margin-left: 2em;
+}
+
+#index .src {
+ font-weight: bold;
+}
+#index .alt {
+ font-size: 77%; /* 10pt */
+ font-style: italic;
+ padding-left: 2em;
+}
+
+#index td + td {
+ padding-left: 1em;
+}
+
+#module-list ul {
+ list-style: none;
+ margin: 0 0 0 2em;
+}
+
+#module-list li {
+ clear: right;
+}
+
+#module-list span.collapser,
+#module-list span.expander {
+ background-position: 0 0.3em;
+}
+
+#module-list .package {
+ float: right;
+}
+
+/* @end */
diff --git a/resources/html/Ocean.std-theme/plus.gif b/resources/html/Ocean.std-theme/plus.gif
new file mode 100644
index 00000000..2d15c141
--- /dev/null
+++ b/resources/html/Ocean.std-theme/plus.gif
Binary files differ
diff --git a/resources/html/Ocean.std-theme/synopsis.png b/resources/html/Ocean.std-theme/synopsis.png
new file mode 100644
index 00000000..85fb86ec
--- /dev/null
+++ b/resources/html/Ocean.std-theme/synopsis.png
Binary files differ
diff --git a/tests/html-tests/tests/frames.html.ref b/resources/html/frames.html
index 1b4e38d4..1b4e38d4 100644
--- a/tests/html-tests/tests/frames.html.ref
+++ b/resources/html/frames.html
diff --git a/resources/html/haddock-util.js b/resources/html/haddock-util.js
new file mode 100644
index 00000000..9a6fccf7
--- /dev/null
+++ b/resources/html/haddock-util.js
@@ -0,0 +1,344 @@
+// Haddock JavaScript utilities
+
+var rspace = /\s\s+/g,
+ rtrim = /^\s+|\s+$/g;
+
+function spaced(s) { return (" " + s + " ").replace(rspace, " "); }
+function trim(s) { return s.replace(rtrim, ""); }
+
+function hasClass(elem, value) {
+ var className = spaced(elem.className || "");
+ return className.indexOf( " " + value + " " ) >= 0;
+}
+
+function addClass(elem, value) {
+ var className = spaced(elem.className || "");
+ if ( className.indexOf( " " + value + " " ) < 0 ) {
+ elem.className = trim(className + " " + value);
+ }
+}
+
+function removeClass(elem, value) {
+ var className = spaced(elem.className || "");
+ className = className.replace(" " + value + " ", " ");
+ elem.className = trim(className);
+}
+
+function toggleClass(elem, valueOn, valueOff, bool) {
+ if (bool == null) { bool = ! hasClass(elem, valueOn); }
+ if (bool) {
+ removeClass(elem, valueOff);
+ addClass(elem, valueOn);
+ }
+ else {
+ removeClass(elem, valueOn);
+ addClass(elem, valueOff);
+ }
+ return bool;
+}
+
+
+function makeClassToggle(valueOn, valueOff)
+{
+ return function(elem, bool) {
+ return toggleClass(elem, valueOn, valueOff, bool);
+ }
+}
+
+toggleShow = makeClassToggle("show", "hide");
+toggleCollapser = makeClassToggle("collapser", "expander");
+
+function toggleSection(id)
+{
+ var b = toggleShow(document.getElementById("section." + id));
+ toggleCollapser(document.getElementById("control." + id), b);
+ rememberCollapsed(id, b);
+ return b;
+}
+
+var collapsed = {};
+function rememberCollapsed(id, b)
+{
+ if(b)
+ delete collapsed[id]
+ else
+ collapsed[id] = null;
+
+ var sections = [];
+ for(var i in collapsed)
+ {
+ if(collapsed.hasOwnProperty(i))
+ sections.push(i);
+ }
+ // cookie specific to this page; don't use setCookie which sets path=/
+ document.cookie = "collapsed=" + escape(sections.join('+'));
+}
+
+function restoreCollapsed()
+{
+ var cookie = getCookie("collapsed");
+ if(!cookie)
+ return;
+
+ var ids = cookie.split('+');
+ for(var i in ids)
+ {
+ if(document.getElementById("section." + ids[i]))
+ toggleSection(ids[i]);
+ }
+}
+
+function setCookie(name, value) {
+ document.cookie = name + "=" + escape(value) + ";path=/;";
+}
+
+function clearCookie(name) {
+ document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;";
+}
+
+function getCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) {
+ return unescape(c.substring(nameEQ.length,c.length));
+ }
+ }
+ return null;
+}
+
+
+
+var max_results = 75; // 50 is not enough to search for map in the base libraries
+var shown_range = null;
+var last_search = null;
+
+function quick_search()
+{
+ perform_search(false);
+}
+
+function full_search()
+{
+ perform_search(true);
+}
+
+
+function perform_search(full)
+{
+ var text = document.getElementById("searchbox").value.toLowerCase();
+ if (text == last_search && !full) return;
+ last_search = text;
+
+ var table = document.getElementById("indexlist");
+ var status = document.getElementById("searchmsg");
+ var children = table.firstChild.childNodes;
+
+ // first figure out the first node with the prefix
+ var first = bisect(-1);
+ var last = (first == -1 ? -1 : bisect(1));
+
+ if (first == -1)
+ {
+ table.className = "";
+ status.innerHTML = "No results found, displaying all";
+ }
+ else if (first == 0 && last == children.length - 1)
+ {
+ table.className = "";
+ status.innerHTML = "";
+ }
+ else if (last - first >= max_results && !full)
+ {
+ table.className = "";
+ status.innerHTML = "More than " + max_results + ", press Search to display";
+ }
+ else
+ {
+ // decide what you need to clear/show
+ if (shown_range)
+ setclass(shown_range[0], shown_range[1], "indexrow");
+ setclass(first, last, "indexshow");
+ shown_range = [first, last];
+ table.className = "indexsearch";
+ status.innerHTML = "";
+ }
+
+
+ function setclass(first, last, status)
+ {
+ for (var i = first; i <= last; i++)
+ {
+ children[i].className = status;
+ }
+ }
+
+
+ // do a binary search, treating 0 as ...
+ // return either -1 (no 0's found) or location of most far match
+ function bisect(dir)
+ {
+ var first = 0, finish = children.length - 1;
+ var mid, success = false;
+
+ while (finish - first > 3)
+ {
+ mid = Math.floor((finish + first) / 2);
+
+ var i = checkitem(mid);
+ if (i == 0) i = dir;
+ if (i == -1)
+ finish = mid;
+ else
+ first = mid;
+ }
+ var a = (dir == 1 ? first : finish);
+ var b = (dir == 1 ? finish : first);
+ for (var i = b; i != a - dir; i -= dir)
+ {
+ if (checkitem(i) == 0) return i;
+ }
+ return -1;
+ }
+
+
+ // from an index, decide what the result is
+ // 0 = match, -1 is lower, 1 is higher
+ function checkitem(i)
+ {
+ var s = getitem(i).toLowerCase().substr(0, text.length);
+ if (s == text) return 0;
+ else return (s > text ? -1 : 1);
+ }
+
+
+ // from an index, get its string
+ // this abstracts over alternates
+ function getitem(i)
+ {
+ for ( ; i >= 0; i--)
+ {
+ var s = children[i].firstChild.firstChild.data;
+ if (s.indexOf(' ') == -1)
+ return s;
+ }
+ return ""; // should never be reached
+ }
+}
+
+function setSynopsis(filename) {
+ if (parent.window.synopsis) {
+ if (parent.window.synopsis.location.replace) {
+ // In Firefox this avoids adding the change to the history.
+ parent.window.synopsis.location.replace(filename);
+ } else {
+ parent.window.synopsis.location = filename;
+ }
+ }
+}
+
+function addMenuItem(html) {
+ var menu = document.getElementById("page-menu");
+ if (menu) {
+ var btn = menu.firstChild.cloneNode(false);
+ btn.innerHTML = html;
+ menu.appendChild(btn);
+ }
+}
+
+function adjustForFrames() {
+ var bodyCls;
+
+ if (parent.location.href == window.location.href) {
+ // not in frames, so add Frames button
+ addMenuItem("<a href='#' onclick='reframe();return true;'>Frames</a>");
+ bodyCls = "no-frame";
+ }
+ else {
+ bodyCls = "in-frame";
+ }
+ addClass(document.body, bodyCls);
+}
+
+function reframe() {
+ setCookie("haddock-reframe", document.URL);
+ window.location = "frames.html";
+}
+
+function postReframe() {
+ var s = getCookie("haddock-reframe");
+ if (s) {
+ parent.window.main.location = s;
+ clearCookie("haddock-reframe");
+ }
+}
+
+function styles() {
+ var i, a, es = document.getElementsByTagName("link"), rs = [];
+ for (i = 0; a = es[i]; i++) {
+ if(a.rel.indexOf("style") != -1 && a.title) {
+ rs.push(a);
+ }
+ }
+ return rs;
+}
+
+function addStyleMenu() {
+ var as = styles();
+ var i, a, btns = "";
+ for(i=0; a = as[i]; i++) {
+ btns += "<li><a href='#' onclick=\"setActiveStyleSheet('"
+ + a.title + "'); return false;\">"
+ + a.title + "</a></li>"
+ }
+ if (as.length > 1) {
+ var h = "<div id='style-menu-holder'>"
+ + "<a href='#' onclick='styleMenu(); return false;'>Style &#9662;</a>"
+ + "<ul id='style-menu' class='hide'>" + btns + "</ul>"
+ + "</div>";
+ addMenuItem(h);
+ }
+}
+
+function setActiveStyleSheet(title) {
+ var as = styles();
+ var i, a, found;
+ for(i=0; a = as[i]; i++) {
+ a.disabled = true;
+ // need to do this always, some browsers are edge triggered
+ if(a.title == title) {
+ found = a;
+ }
+ }
+ if (found) {
+ found.disabled = false;
+ setCookie("haddock-style", title);
+ }
+ else {
+ as[0].disabled = false;
+ clearCookie("haddock-style");
+ }
+ styleMenu(false);
+}
+
+function resetStyle() {
+ var s = getCookie("haddock-style");
+ if (s) setActiveStyleSheet(s);
+}
+
+
+function styleMenu(show) {
+ var m = document.getElementById('style-menu');
+ if (m) toggleShow(m, show);
+}
+
+
+function pageLoad() {
+ addStyleMenu();
+ adjustForFrames();
+ resetStyle();
+ restoreCollapsed();
+}
+
diff --git a/latex/haddock.sty b/resources/latex/haddock.sty
index 6e031a98..6e031a98 100644
--- a/latex/haddock.sty
+++ b/resources/latex/haddock.sty
diff --git a/src/.ghci b/src/.ghci
deleted file mode 100644
index f00e6d55..00000000
--- a/src/.ghci
+++ /dev/null
@@ -1 +0,0 @@
-:set -i../dist/build/autogen -i../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../dist/build/autogen/cabal_macros.h -XCPP -XDeriveDataTypeable -XScopedTypeVariables -XMagicHash
diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs
index 60bb3147..36115a2a 100644
--- a/src/Documentation/Haddock.hs
+++ b/src/Documentation/Haddock.hs
@@ -35,7 +35,13 @@ module Documentation.Haddock (
-- * Documentation comments
Doc(..),
Example(..),
+ Hyperlink(..),
DocMarkup(..),
+ Documentation(..),
+ ArgMap,
+ AliasMap,
+ WarningMap,
+ DocMap,
HaddockModInfo(..),
markup,
@@ -48,8 +54,10 @@ module Documentation.Haddock (
-- * Flags and options
Flag(..),
- DocOption(..)
+ DocOption(..),
+ -- * Program entry point
+ haddock,
) where
@@ -58,7 +66,7 @@ import Haddock.Interface
import Haddock.Types
import Haddock.Options
import Haddock.Utils
-import Main
+import Haddock
-- | Create 'Interface' structures from a given list of Haddock command-line
@@ -70,6 +78,5 @@ createInterfaces
-> [String] -- ^ File or module names
-> IO [Interface] -- ^ Resulting list of interfaces
createInterfaces flags modules = do
- (_, ifaces, _) <- readPackagesAndProcessModules flags modules
+ (_, ifaces, _) <- withGhc' flags (readPackagesAndProcessModules flags modules)
return ifaces
-
diff --git a/src/Main.hs b/src/Haddock.hs
index dc5a49d2..3b31c756 100644
--- a/src/Main.hs
+++ b/src/Haddock.hs
@@ -1,8 +1,8 @@
{-# OPTIONS_GHC -Wwarn #-}
-{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE CPP, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
--- Module : Main
+-- Module : Haddock
-- Copyright : (c) Simon Marlow 2003-2006,
-- David Waern 2006-2010
-- License : BSD-like
@@ -15,7 +15,7 @@
--
-- Program entry point and top-level code.
-----------------------------------------------------------------------------
-module Main (main, readPackagesAndProcessModules) where
+module Haddock (haddock, readPackagesAndProcessModules, withGhc') where
import Haddock.Backends.Xhtml
@@ -32,14 +32,14 @@ import Haddock.Options
import Haddock.Utils
import Haddock.GhcUtils hiding (pretty)
-import Control.Monad
+import Control.Monad hiding (forM_)
+import Data.Foldable (forM_)
import Control.Exception
import Data.Maybe
import Data.IORef
import qualified Data.Map as Map
import System.IO
import System.Exit
-import System.Environment
#if defined(mingw32_HOST_OS)
import Foreign
@@ -61,9 +61,6 @@ import StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals)
import Panic (handleGhcException)
import Module
-import Control.Monad.Fix (MonadFix)
-
-
--------------------------------------------------------------------------------
-- * Exception handling
--------------------------------------------------------------------------------
@@ -123,27 +120,23 @@ handleGhcExceptions =
-------------------------------------------------------------------------------
-main :: IO ()
-main = handleTopExceptions $ do
+-- | Run Haddock with given list of arguments.
+--
+-- Haddock's own main function is defined in terms of this:
+--
+-- > main = getArgs >>= haddock
+haddock :: [String] -> IO ()
+haddock args = handleTopExceptions $ do
-- Parse command-line flags and handle some of them initially.
-- TODO: unify all of this (and some of what's in the 'render' function),
-- into one function that returns a record with a field for each option,
-- or which exits with an error or help message.
- args <- getArgs
(flags, files) <- parseHaddockOpts args
shortcutFlags flags
qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q}
- libDir <- fmap snd (getGhcDirs flags)
-
- -- Catches all GHC source errors, then prints and re-throws them.
- let handleSrcErrors action' = flip handleSourceError action' $ \err -> do
- printException err
- liftIO exitFailure
-
- -- Initialize GHC.
- withGhc libDir (ghcFlags flags) $ \_ -> handleSrcErrors $ do
+ withGhc' flags $ do
dflags <- getDynFlags
@@ -151,9 +144,11 @@ main = handleTopExceptions $ do
(packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files
-- Dump an "interface file" (.haddock file), if requested.
- case optDumpInterfaceFile flags of
- Just f -> liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks
- Nothing -> return ()
+ forM_ (optDumpInterfaceFile flags) $ \path -> liftIO $ do
+ writeInterfaceFile path InterfaceFile {
+ ifInstalledIfaces = map toInstalledIface ifaces
+ , ifLinkEnv = homeLinks
+ }
-- Render the interfaces.
liftIO $ renderStep dflags flags qual packages ifaces
@@ -169,6 +164,18 @@ main = handleTopExceptions $ do
liftIO $ renderStep dflags flags qual packages []
+withGhc' :: [Flag] -> Ghc a -> IO a
+withGhc' flags action = do
+ libDir <- fmap snd (getGhcDirs flags)
+
+ -- Catches all GHC source errors, then prints and re-throws them.
+ let handleSrcErrors action' = flip handleSourceError action' $ \err -> do
+ printException err
+ liftIO exitFailure
+
+ withGhc libDir (ghcFlags flags) (\_ -> handleSrcErrors action)
+
+
readPackagesAndProcessModules :: [Flag] -> [String]
-> Ghc ([(DocPaths, InterfaceFile)], [Interface], LinkEnv)
readPackagesAndProcessModules flags files = do
@@ -260,13 +267,12 @@ render dflags flags qual ifaces installedIfaces srcMap = do
-------------------------------------------------------------------------------
-readInterfaceFiles :: (MonadFix m, MonadIO m) =>
- NameCacheAccessor m
- -> [(DocPaths, FilePath)] ->
- m [(DocPaths, InterfaceFile)]
+readInterfaceFiles :: MonadIO m
+ => NameCacheAccessor m
+ -> [(DocPaths, FilePath)]
+ -> m [(DocPaths, InterfaceFile)]
readInterfaceFiles name_cache_accessor pairs = do
- mbPackages <- mapM tryReadIface pairs
- return (catMaybes mbPackages)
+ catMaybes `liftM` mapM tryReadIface pairs
where
-- try to read an interface, warn if we can't
tryReadIface (paths, file) = do
@@ -280,15 +286,6 @@ readInterfaceFiles name_cache_accessor pairs = do
Right f -> return $ Just (paths, f)
-dumpInterfaceFile :: FilePath -> [InstalledInterface] -> LinkEnv -> IO ()
-dumpInterfaceFile path ifaces homeLinks = writeInterfaceFile path ifaceFile
- where
- ifaceFile = InterfaceFile {
- ifInstalledIfaces = ifaces,
- ifLinkEnv = homeLinks
- }
-
-
-------------------------------------------------------------------------------
-- * Creating a GHC session
-------------------------------------------------------------------------------
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs
index 4417dc52..64905a37 100644
--- a/src/Haddock/Backends/Hoogle.hs
+++ b/src/Haddock/Backends/Hoogle.hs
@@ -253,8 +253,9 @@ markupTag dflags = Markup {
markupOrderedList = box (TagL 'o'),
markupDefList = box (TagL 'u') . map (\(a,b) -> TagInline "i" a : Str " " : b),
markupCodeBlock = box TagPre,
- markupURL = box (TagInline "a") . str,
+ markupHyperlink = \(Hyperlink url mLabel) -> (box (TagInline "a") . str) (fromMaybe url mLabel),
markupAName = const $ str "",
+ markupProperty = box TagPre . str,
markupExample = box TagPre . str . unlines . map exampleToString
}
diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs
index 6df9062e..5d0fabe9 100644
--- a/src/Haddock/Backends/LaTeX.hs
+++ b/src/Haddock/Backends/LaTeX.hs
@@ -1002,8 +1002,9 @@ parLatexMarkup ppId = Markup {
markupOrderedList = \p v -> enumeratedList (map ($v) p) $$ text "",
markupDefList = \l v -> descriptionList (map (\(a,b) -> (a v, b v)) l),
markupCodeBlock = \p _ -> quote (verb (p Verb)) $$ text "",
- markupURL = \u _ -> text "\\url" <> braces (text u),
+ markupHyperlink = \l _ -> markupLink l,
markupAName = \_ _ -> empty,
+ markupProperty = \p _ -> quote $ verb $ text p,
markupExample = \e _ -> quote $ verb $ text $ unlines $ map exampleToString e
}
where
@@ -1011,6 +1012,10 @@ parLatexMarkup ppId = Markup {
fixString Verb s = s
fixString Mono s = latexMonoFilter s
+ markupLink (Hyperlink url mLabel) = case mLabel of
+ Just label -> text "\\href" <> braces (text url) <> braces (text label)
+ Nothing -> text "\\url" <> braces (text url)
+
markupId ppId_ id v =
case v of
Verb -> theid
diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs
index 052116ee..aa4ba377 100644
--- a/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -25,6 +25,7 @@ import Haddock.Types
import Haddock.Utils
import Text.XHtml hiding ( name, title, p, quote )
+import Data.Maybe (fromMaybe)
import GHC
@@ -46,9 +47,10 @@ parHtmlMarkup qual ppId = Markup {
markupOrderedList = ordList,
markupDefList = defList,
markupCodeBlock = pre,
- markupURL = \url -> anchor ! [href url] << url,
+ markupHyperlink = \(Hyperlink url mLabel) -> anchor ! [href url] << fromMaybe url mLabel,
markupAName = \aname -> namedAnchor aname << "",
markupPic = \path -> image ! [src path],
+ markupProperty = pre . toHtml,
markupExample = examplesToHtml
}
where
diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs
index e1e65d18..ea1f42e5 100644
--- a/src/Haddock/Interface.hs
+++ b/src/Haddock/Interface.hs
@@ -43,6 +43,7 @@ import Haddock.Utils
import Control.Monad
import Data.List
import qualified Data.Map as Map
+import qualified Data.Set as Set
import Distribution.Verbosity
import System.Directory
import System.FilePath
@@ -72,8 +73,12 @@ processModules verbosity modules flags extIfaces = do
, iface <- ifInstalledIfaces ext ]
interfaces <- createIfaces0 verbosity modules flags instIfaceMap
+ let exportedNames =
+ Set.unions $ map (Set.fromList . ifaceExports) $
+ filter (\i -> not $ OptHide `elem` ifaceOptions i) interfaces
+ mods = Set.fromList $ map ifaceMod interfaces
out verbosity verbose "Attaching instances..."
- interfaces' <- attachInstances interfaces instIfaceMap
+ interfaces' <- attachInstances (exportedNames, mods) interfaces instIfaceMap
out verbosity verbose "Building cross-linking environment..."
-- Combine the link envs of the external packages into one
diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs
index 427ef84d..04c4e5e1 100644
--- a/src/Haddock/Interface/AttachInstances.hs
+++ b/src/Haddock/Interface/AttachInstances.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE CPP, MagicHash #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Interface.AttachInstances
@@ -20,37 +20,42 @@ import Haddock.Convert
import Control.Arrow
import Data.List
import qualified Data.Map as Map
+import qualified Data.Set as Set
-import GHC
-import Name
-import InstEnv
import Class
+import FastString
+import GHC
import GhcMonad (withSession)
-import TysPrim( funTyCon )
+import Id
+import InstEnv
import MonadUtils (liftIO)
+import Name
+import PrelNames
import TcRnDriver (tcRnGetInfo)
+import TyCon
import TypeRep
+import TysPrim( funTyCon )
import Var hiding (varName)
-import TyCon
-import PrelNames
-import FastString
#define FSLIT(x) (mkFastString# (x#))
+type ExportedNames = Set.Set Name
+type Modules = Set.Set Module
+type ExportInfo = (ExportedNames, Modules)
-attachInstances :: [Interface] -> InstIfaceMap -> Ghc [Interface]
-attachInstances ifaces instIfaceMap = mapM attach ifaces
+attachInstances :: ExportInfo -> [Interface] -> InstIfaceMap -> Ghc [Interface]
+attachInstances expInfo ifaces instIfaceMap = mapM attach ifaces
where
-- TODO: take an IfaceMap as input
ifaceMap = Map.fromList [ (ifaceMod i, i) | i <- ifaces ]
attach iface = do
- newItems <- mapM (attachToExportItem iface ifaceMap instIfaceMap)
+ newItems <- mapM (attachToExportItem expInfo iface ifaceMap instIfaceMap)
(ifaceExportItems iface)
return $ iface { ifaceExportItems = newItems }
-attachToExportItem :: Interface -> IfaceMap -> InstIfaceMap -> ExportItem Name -> Ghc (ExportItem Name)
-attachToExportItem iface ifaceMap instIfaceMap export =
+attachToExportItem :: ExportInfo -> Interface -> IfaceMap -> InstIfaceMap -> ExportItem Name -> Ghc (ExportItem Name)
+attachToExportItem expInfo iface ifaceMap instIfaceMap export =
case export of
ExportDecl { expItemDecl = L _ (TyClD d) } -> do
mb_info <- getAllInfo (tcdName d)
@@ -61,6 +66,11 @@ attachToExportItem iface ifaceMap instIfaceMap export =
Just (_, _, instances) ->
let insts = map (first synifyInstHead) $ sortImage (first instHead)
[ (instanceSig i, getName i) | i <- instances ]
+{- FIXME
+ let insts = map (first synifyInstHead) $ sortImage (first instHead) $
+ filter (\((_,_,cls,tys),_) -> not $ isInstanceHidden expInfo cls tys)
+ [ (instanceHead' i, getName i) | i <- instances ]
+-}
in [ (inst, lookupInstDoc name iface ifaceMap instIfaceMap)
| (inst, name) <- insts ]
Nothing -> []
@@ -89,6 +99,22 @@ lookupInstDoc name iface ifaceMap instIfaceMap =
modName = nameModule name
+-- | Like GHC's 'instanceHead' but drops "silent" arguments.
+{- FIXME
+instanceHead' :: ClsInst -> ([TyVar], ThetaType, Class, [Type])
+instanceHead' ispec = (tvs, dropSilentArgs dfun theta, cls, tys)
+ where
+ dfun = is_dfun ispec
+ (tvs, theta, cls, tys) = instanceHead ispec
+-}
+
+
+-- | Drop "silent" arguments. See GHC Note [Silent superclass
+-- arguments].
+dropSilentArgs :: DFunId -> ThetaType -> ThetaType
+dropSilentArgs dfun theta = drop (dfunNSilent dfun) theta
+
+
-- | Like GHC's getInfo but doesn't cut things out depending on the
-- interative context, which we don't set sufficiently anyway.
getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[ClsInst]))
@@ -143,3 +169,42 @@ funTyConName = mkWiredInName gHC_PRIM
funTyConKey
(ATyCon funTyCon) -- Relevant TyCon
BuiltInSyntax
+
+--------------------------------------------------------------------------------
+-- Filtering hidden instances
+--------------------------------------------------------------------------------
+
+-- | A class or data type is hidden iff
+--
+-- * it is defined in one of the modules that are being processed
+--
+-- * and it is not exported by any non-hidden module
+isNameHidden :: ExportInfo -> Name -> Bool
+isNameHidden (names, modules) name =
+ nameModule name `Set.member` modules &&
+ not (name `Set.member` names)
+
+-- | We say that an instance is «hidden» iff its class or any (part)
+-- of its type(s) is hidden.
+isInstanceHidden :: ExportInfo -> Class -> [Type] -> Bool
+isInstanceHidden expInfo cls tys =
+ instClassHidden || instTypeHidden
+ where
+ instClassHidden :: Bool
+ instClassHidden = isNameHidden expInfo $ getName cls
+
+ instTypeHidden :: Bool
+ instTypeHidden = any typeHidden tys
+
+ nameHidden :: Name -> Bool
+ nameHidden = isNameHidden expInfo
+
+ typeHidden :: Type -> Bool
+ typeHidden t =
+ case t of
+ TyVarTy {} -> False
+ AppTy t1 t2 -> typeHidden t1 || typeHidden t2
+ TyConApp tcon args -> nameHidden (getName tcon) || any typeHidden args
+ FunTy t1 t2 -> typeHidden t1 || typeHidden t2
+ ForAllTy _ ty -> typeHidden ty
+ LitTy _ -> False
diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs
index 8f429d9c..40016a0b 100644
--- a/src/Haddock/Interface/Create.hs
+++ b/src/Haddock/Interface/Create.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE TupleSections, BangPatterns #-}
+{-# OPTIONS_GHC -Wwarn #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Interface.Create
@@ -40,7 +41,7 @@ import Name
import Bag
import RdrName
import TcRnTypes
-import FastString (unpackFS)
+import FastString (unpackFS, concatFS)
-- | Use a 'TypecheckedModule' to produce an 'Interface'.
@@ -89,8 +90,11 @@ createInterface tm flags modMap instIfaceMap = do
liftErrMsg $ warnAboutFilteredDecls dflags mdl decls
- let warningMap = mkWarningMap warnings gre exportedNames
- exportItems <- mkExportItems modMap mdl warningMap gre exportedNames decls maps exports
+ warningMap <- liftErrMsg $ mkWarningMap dflags warnings gre exportedNames
+
+ let allWarnings = M.unions (warningMap : map ifaceWarningMap (M.elems modMap))
+
+ exportItems <- mkExportItems modMap mdl allWarnings gre exportedNames decls maps exports
instances instIfaceMap dflags
let !visibleNames = mkVisibleNames exportItems opts
@@ -111,26 +115,29 @@ createInterface tm flags modMap instIfaceMap = do
let !aliases =
mkAliasMap dflags $ tm_renamed_source tm
+ modWarn <- liftErrMsg $ moduleWarning dflags gre warnings
+
return $! Interface {
- ifaceMod = mdl,
- ifaceOrigFilename = msHsFilePath ms,
- ifaceInfo = info,
- ifaceDoc = Documentation mbDoc (moduleWarning warnings),
- ifaceRnDoc = Documentation Nothing Nothing,
- ifaceOptions = opts,
- ifaceDocMap = docMap,
- ifaceArgMap = argMap,
- ifaceRnDocMap = M.empty,
- ifaceRnArgMap = M.empty,
- ifaceExportItems = prunedExportItems,
- ifaceRnExportItems = [],
- ifaceExports = exportedNames,
- ifaceVisibleExports = visibleNames,
- ifaceDeclMap = declMap,
- ifaceSubMap = subMap,
- ifaceModuleAliases = aliases,
- ifaceInstances = instances,
- ifaceHaddockCoverage = coverage
+ ifaceMod = mdl
+ , ifaceOrigFilename = msHsFilePath ms
+ , ifaceInfo = info
+ , ifaceDoc = Documentation mbDoc modWarn
+ , ifaceRnDoc = Documentation Nothing Nothing
+ , ifaceOptions = opts
+ , ifaceDocMap = docMap
+ , ifaceArgMap = argMap
+ , ifaceRnDocMap = M.empty
+ , ifaceRnArgMap = M.empty
+ , ifaceExportItems = prunedExportItems
+ , ifaceRnExportItems = []
+ , ifaceExports = exportedNames
+ , ifaceVisibleExports = visibleNames
+ , ifaceDeclMap = declMap
+ , ifaceSubMap = subMap
+ , ifaceModuleAliases = aliases
+ , ifaceInstances = instances
+ , ifaceHaddockCoverage = coverage
+ , ifaceWarningMap = warningMap
}
mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName
@@ -166,31 +173,35 @@ lookupModuleDyn dflags Nothing mdlName =
-- Warnings
-------------------------------------------------------------------------------
-type WarningMap = DocMap Name
-
-mkWarningMap :: Warnings -> GlobalRdrEnv -> [Name] -> WarningMap
-mkWarningMap NoWarnings _ _ = M.empty
-mkWarningMap (WarnAll _) _ _ = M.empty
-mkWarningMap (WarnSome ws) gre exps = M.fromList
- [ (n, warnToDoc w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ
- , let n = gre_name elt, n `elem` exps ]
+mkWarningMap :: DynFlags -> Warnings -> GlobalRdrEnv -> [Name] -> ErrMsgM WarningMap
+mkWarningMap dflags warnings gre exps = case warnings of
+ NoWarnings -> return M.empty
+ WarnAll _ -> return M.empty
+ WarnSome ws -> do
+ let ws' = [ (n, w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ
+ , let n = gre_name elt, n `elem` exps ]
+ M.fromList <$> mapM parse ws'
+ where
+ parse (n, w) = (,) n <$> parseWarning dflags gre w
-moduleWarning :: Warnings -> Maybe (Doc id)
-moduleWarning ws =
+moduleWarning :: DynFlags -> GlobalRdrEnv -> Warnings -> ErrMsgM (Maybe (Doc Name))
+moduleWarning dflags gre ws =
case ws of
- NoWarnings -> Nothing
- WarnSome _ -> Nothing
- WarnAll w -> Just $! warnToDoc w
-
-
-warnToDoc :: WarningTxt -> Doc id
-warnToDoc w = case w of
- (DeprecatedTxt msg) -> format "Deprecated: " msg
- (WarningTxt msg) -> format "Warning: " msg
+ NoWarnings -> return Nothing
+ WarnSome _ -> return Nothing
+ WarnAll w -> Just <$> parseWarning dflags gre w
+
+parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Doc Name)
+parseWarning dflags gre w = do
+ r <- case w of
+ (DeprecatedTxt msg) -> format "Deprecated: " (concatFS msg)
+ (WarningTxt msg) -> format "Warning: " (concatFS msg)
+ r `deepseq` return r
where
- format x xs = let !str = force $ concat (x : map unpackFS xs)
- in DocWarning $ DocParagraph $ DocString str
+ format x xs = DocWarning . DocParagraph . DocAppend (DocString x)
+ . fromMaybe (DocString . unpackFS $ xs)
+ <$> processDocString dflags gre (HsDocString xs)
-------------------------------------------------------------------------------
@@ -703,6 +714,7 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap) decls =
f (L l (SigD (GenericSig names t))) xs = foldr (\n acc -> L l (SigD (GenericSig [n] t)) : acc) xs names
f x xs = x : xs
+ mkExportItem :: LHsDecl Name -> ErrMsgGhc (Maybe (ExportItem Name))
mkExportItem (L _ (DocD (DocGroup lev docStr))) = do
mbDoc <- liftErrMsg $ processDocString dflags gre docStr
return $ fmap (ExportGroup lev "") mbDoc
@@ -777,7 +789,7 @@ extractRecSel nm mdl t tvs (L _ con : rest) =
data_ty = foldl (\x y -> noLoc (HsAppTy x y)) (noLoc (HsTyVar t)) (map toTypeNoLoc tvs)
--- | Keep exprt items with docs.
+-- | Keep export items with docs.
pruneExportItems :: [ExportItem Name] -> [ExportItem Name]
pruneExportItems = filter hasDoc
where
diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs
index 8070b137..ced12d8d 100644
--- a/src/Haddock/Interface/LexParseRn.hs
+++ b/src/Haddock/Interface/LexParseRn.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -Wwarn #-}
{-# LANGUAGE BangPatterns #-}
-----------------------------------------------------------------------------
-- |
@@ -117,9 +118,10 @@ rename dflags gre = rn
DocCodeBlock doc -> DocCodeBlock (rn doc)
DocIdentifierUnchecked x -> DocIdentifierUnchecked x
DocModule str -> DocModule str
- DocURL str -> DocURL str
+ DocHyperlink l -> DocHyperlink l
DocPic str -> DocPic str
DocAName str -> DocAName str
+ DocProperty p -> DocProperty p
DocExamples e -> DocExamples e
DocEmpty -> DocEmpty
DocString str -> DocString str
diff --git a/src/Haddock/Interface/ParseModuleHeader.hs b/src/Haddock/Interface/ParseModuleHeader.hs
index 411b6661..18f4c768 100644
--- a/src/Haddock/Interface/ParseModuleHeader.hs
+++ b/src/Haddock/Interface/ParseModuleHeader.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -Wwarn #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Interface.ParseModuleHeader
diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs
index b384886c..a2499726 100644
--- a/src/Haddock/Interface/Rename.hs
+++ b/src/Haddock/Interface/Rename.hs
@@ -82,42 +82,41 @@ renameInterface dflags renamingEnv warnings iface =
--------------------------------------------------------------------------------
-newtype GenRnM n a =
- RnM { unRn :: (n -> (Bool, DocName)) -- name lookup function
- -> (a,[n])
+newtype RnM a =
+ RnM { unRn :: (Name -> (Bool, DocName)) -- name lookup function
+ -> (a,[Name])
}
-type RnM a = GenRnM Name a
-
-instance Monad (GenRnM n) where
+instance Monad RnM where
(>>=) = thenRn
return = returnRn
-instance Functor (GenRnM n) where
+instance Functor RnM where
fmap f x = do a <- x; return (f a)
-instance Applicative (GenRnM n) where
+instance Applicative RnM where
pure = return
(<*>) = ap
-returnRn :: a -> GenRnM n a
+returnRn :: a -> RnM a
returnRn a = RnM (const (a,[]))
-thenRn :: GenRnM n a -> (a -> GenRnM n b) -> GenRnM n b
+thenRn :: RnM a -> (a -> RnM b) -> RnM b
m `thenRn` k = RnM (\lkp -> case unRn m lkp of
(a,out1) -> case unRn (k a) lkp of
(b,out2) -> (b,out1++out2))
getLookupRn :: RnM (Name -> (Bool, DocName))
getLookupRn = RnM (\lkp -> (lkp,[]))
+
outRn :: Name -> RnM ()
outRn name = RnM (const ((),[name]))
-lookupRn :: (DocName -> a) -> Name -> RnM a
-lookupRn and_then name = do
+lookupRn :: Name -> RnM DocName
+lookupRn name = do
lkp <- getLookupRn
case lkp name of
- (False,maps_to) -> do outRn name; return (and_then maps_to)
- (True, maps_to) -> return (and_then maps_to)
+ (False,maps_to) -> do outRn name; return maps_to
+ (True, maps_to) -> return maps_to
runRnFM :: LinkEnv -> RnM a -> (a,[Name])
@@ -134,7 +133,7 @@ runRnFM env rn = unRn rn lkp
rename :: Name -> RnM DocName
-rename = lookupRn id
+rename = lookupRn
renameL :: Located Name -> RnM (Located DocName)
@@ -199,9 +198,10 @@ renameDoc d = case d of
DocCodeBlock doc -> do
doc' <- renameDoc doc
return (DocCodeBlock doc')
- DocURL str -> return (DocURL str)
+ DocHyperlink l -> return (DocHyperlink l)
DocPic str -> return (DocPic str)
DocAName str -> return (DocAName str)
+ DocProperty p -> return (DocProperty p)
DocExamples e -> return (DocExamples e)
@@ -270,8 +270,16 @@ renameType t = case t of
HsTyLit x -> return (HsTyLit x)
- _ -> error "renameType"
+ HsWrapTy a b -> HsWrapTy a <$> renameType b
+ HsRecTy a -> HsRecTy <$> mapM renameConDeclFieldField a
+ HsCoreTy a -> pure (HsCoreTy a)
+ HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b
+ HsExplicitTupleTy a b -> HsExplicitTupleTy a <$> mapM renameLType b
+ HsQuasiQuoteTy a -> HsQuasiQuoteTy <$> renameHsQuasiQuote a
+ HsSpliceTy _ _ _ -> error "renameType: HsSpliceTy"
+renameHsQuasiQuote :: HsQuasiQuote Name -> RnM (HsQuasiQuote DocName)
+renameHsQuasiQuote (HsQuasiQuote a b c) = HsQuasiQuote <$> rename a <*> pure b <*> pure c
renameLTyVarBndrs :: LHsTyVarBndrs Name -> RnM (LHsTyVarBndrs DocName)
renameLTyVarBndrs (HsQTvs { hsq_kvs = _, hsq_tvs = tvs })
@@ -402,22 +410,25 @@ renameCon decl@(ConDecl { con_name = lname, con_qvars = ltyvars
return (decl { con_name = lname', con_qvars = ltyvars', con_cxt = lcontext'
, con_details = details', con_res = restype', con_doc = mbldoc' })
where
- renameDetails (RecCon fields) = return . RecCon =<< mapM renameField fields
+ renameDetails (RecCon fields) = return . RecCon =<< mapM renameConDeclFieldField fields
renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps
renameDetails (InfixCon a b) = do
a' <- renameLType a
b' <- renameLType b
return (InfixCon a' b')
- renameField (ConDeclField name t doc) = do
- name' <- renameL name
- t' <- renameLType t
- doc' <- mapM renameLDocHsSyn doc
- return (ConDeclField name' t' doc')
-
renameResType (ResTyH98) = return ResTyH98
renameResType (ResTyGADT t) = return . ResTyGADT =<< renameLType t
+
+renameConDeclFieldField :: ConDeclField Name -> RnM (ConDeclField DocName)
+renameConDeclFieldField (ConDeclField name t doc) = do
+ name' <- renameL name
+ t' <- renameLType t
+ doc' <- mapM renameLDocHsSyn doc
+ return (ConDeclField name' t' doc')
+
+
renameSig :: Sig Name -> RnM (Sig DocName)
renameSig sig = case sig of
TypeSig lnames ltype -> do
@@ -498,8 +509,8 @@ renameExportItem item = case item of
return (inst', idoc')
return (ExportDecl decl' doc' subs' instances')
ExportNoDecl x subs -> do
- x' <- lookupRn id x
- subs' <- mapM (lookupRn id) subs
+ x' <- lookupRn x
+ subs' <- mapM lookupRn subs
return (ExportNoDecl x' subs')
ExportDoc doc -> do
doc' <- renameDoc doc
diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs
index a07b1b03..ec7272e7 100644
--- a/src/Haddock/InterfaceFile.hs
+++ b/src/Haddock/InterfaceFile.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
@@ -61,9 +61,18 @@ binaryInterfaceMagic :: Word32
binaryInterfaceMagic = 0xD0Cface
--- Since datatypes in the GHC API might change between major versions, and
--- because we store GHC datatypes in our interface files, we need to make sure
--- we version our interface files accordingly.
+-- IMPORTANT: Since datatypes in the GHC API might change between major
+-- versions, and because we store GHC datatypes in our interface files, we need
+-- to make sure we version our interface files accordingly.
+--
+-- If you change the interface file format or adapt Haddock to work with a new
+-- major version of GHC (so that the format changes indirectly) *you* need to
+-- follow these steps:
+--
+-- (1) increase `binaryInterfaceVersion`
+--
+-- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion]
+--
binaryInterfaceVersion :: Word16
#if __GLASGOW_HASKELL__ == 702
binaryInterfaceVersion = 20
@@ -76,9 +85,12 @@ binaryInterfaceVersion = 20
#elif __GLASGOW_HASKELL__ == 706
binaryInterfaceVersion = 20
#elif __GLASGOW_HASKELL__ == 707
-binaryInterfaceVersion = 20
+binaryInterfaceVersion = 22
+
+binaryInterfaceVersionCompatibility :: [Word16]
+binaryInterfaceVersionCompatibility = [21, 22]
#else
-#error Unknown GHC version
+#error Unsupported GHC version
#endif
@@ -189,7 +201,7 @@ readInterfaceFile (get_name_cache, set_name_cache) filename = do
case () of
_ | magic /= binaryInterfaceMagic -> return . Left $
"Magic number mismatch: couldn't load interface file: " ++ filename
- | version /= binaryInterfaceVersion -> return . Left $
+ | version `notElem` binaryInterfaceVersionCompatibility -> return . Left $
"Interface file is of wrong version: " ++ filename
| otherwise -> with_name_cache $ \update_nc -> do
@@ -417,6 +429,15 @@ instance Binary Example where
result <- get bh
return (Example expression result)
+instance Binary Hyperlink where
+ put_ bh (Hyperlink url label) = do
+ put_ bh url
+ put_ bh label
+ get bh = do
+ url <- get bh
+ label <- get bh
+ return (Hyperlink url label)
+
{-* Generated by DrIFT : Look, but Don't Touch. *-}
instance (Binary id) => Binary (Doc id) where
@@ -456,7 +477,7 @@ instance (Binary id) => Binary (Doc id) where
put_ bh (DocCodeBlock al) = do
putByte bh 11
put_ bh al
- put_ bh (DocURL am) = do
+ put_ bh (DocHyperlink am) = do
putByte bh 12
put_ bh am
put_ bh (DocPic x) = do
@@ -474,6 +495,9 @@ instance (Binary id) => Binary (Doc id) where
put_ bh (DocWarning ag) = do
putByte bh 17
put_ bh ag
+ put_ bh (DocProperty x) = do
+ putByte bh 18
+ put_ bh x
get bh = do
h <- getByte bh
case h of
@@ -515,7 +539,7 @@ instance (Binary id) => Binary (Doc id) where
return (DocCodeBlock al)
12 -> do
am <- get bh
- return (DocURL am)
+ return (DocHyperlink am)
13 -> do
x <- get bh
return (DocPic x)
@@ -531,6 +555,9 @@ instance (Binary id) => Binary (Doc id) where
17 -> do
ag <- get bh
return (DocWarning ag)
+ 18 -> do
+ x <- get bh
+ return (DocProperty x)
_ -> fail "invalid binary data found"
diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x
index b9ebe688..0d8dd954 100644
--- a/src/Haddock/Lex.x
+++ b/src/Haddock/Lex.x
@@ -50,6 +50,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
<0,para> {
$ws* \n ;
$ws* \> { begin birdtrack }
+ $ws* prop \> .* \n { strtoken TokProperty `andBegin` property}
$ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr }
$ws* [\*\-] { token TokBullet `andBegin` string }
$ws* \[ { token TokDefStart `andBegin` def }
@@ -74,6 +75,8 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
<birdtrack> .* \n? { strtokenNL TokBirdTrack `andBegin` line }
+<property> () { token TokPara `andBegin` para }
+
<example> {
$ws* \n { token TokPara `andBegin` para }
$ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr }
@@ -129,6 +132,7 @@ data Token
| TokEmphasis String
| TokAName String
| TokBirdTrack String
+ | TokProperty String
| TokExamplePrompt String
| TokExampleExpression String
| TokExampleResult String
diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y
index e36e8416..f40ff521 100644
--- a/src/Haddock/Parse.y
+++ b/src/Haddock/Parse.y
@@ -7,10 +7,10 @@
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
-- for details
-module Haddock.Parse where
+module Haddock.Parse (parseString, parseParas) where
import Haddock.Lex
-import Haddock.Types (Doc(..), Example(Example))
+import Haddock.Types (Doc(..), Example(Example), Hyperlink(..))
import Haddock.Doc
import HsSyn
import RdrName
@@ -35,6 +35,7 @@ import Data.List (stripPrefix)
'-' { (TokBullet,_) }
'(n)' { (TokNumber,_) }
'>..' { (TokBirdTrack $$,_) }
+ PROP { (TokProperty $$,_) }
PROMPT { (TokExamplePrompt $$,_) }
RESULT { (TokExampleResult $$,_) }
EXP { (TokExampleExpression $$,_) }
@@ -73,12 +74,16 @@ defpara :: { (Doc RdrName, Doc RdrName) }
para :: { Doc RdrName }
: seq { docParagraph $1 }
| codepara { DocCodeBlock $1 }
+ | property { $1 }
| examples { DocExamples $1 }
codepara :: { Doc RdrName }
: '>..' codepara { docAppend (DocString $1) $2 }
| '>..' { DocString $1 }
+property :: { Doc RdrName }
+ : PROP { makeProperty $1 }
+
examples :: { [Example] }
: example examples { $1 : $2 }
| example { [$1] }
@@ -107,7 +112,7 @@ seq1 :: { Doc RdrName }
elem1 :: { Doc RdrName }
: STRING { DocString $1 }
| '/../' { DocEmphasis (DocString $1) }
- | URL { DocURL $1 }
+ | URL { DocHyperlink (makeHyperlink $1) }
| PIC { DocPic $1 }
| ANAME { DocAName $1 }
| IDENT { DocIdentifier $1 }
@@ -121,6 +126,22 @@ strings :: { String }
happyError :: [LToken] -> Maybe a
happyError toks = Nothing
+-- | Create a `Hyperlink` from given string.
+--
+-- A hyperlink consists of a URL and an optional label. The label is separated
+-- from the url by one or more whitespace characters.
+makeHyperlink :: String -> Hyperlink
+makeHyperlink input = case break isSpace $ strip input of
+ (url, "") -> Hyperlink url Nothing
+ (url, label) -> Hyperlink url (Just . dropWhile isSpace $ label)
+
+makeProperty :: String -> Doc RdrName
+makeProperty s = case strip s of
+ 'p':'r':'o':'p':'>':xs ->
+ DocProperty (dropWhile isSpace xs)
+ xs ->
+ error $ "makeProperty: invalid input " ++ show xs
+
-- | Create an 'Example', stripping superfluous characters as appropriate
makeExample :: String -> String -> [String] -> Example
makeExample prompt expression result =
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index 8ea5b930..181ea026 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -1,5 +1,5 @@
-{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Types
@@ -22,6 +22,7 @@ module Haddock.Types (
import Control.Exception
import Control.Arrow
+import Control.DeepSeq
import Data.Typeable
import Data.Map (Map)
import Data.Maybe
@@ -113,8 +114,13 @@ data Interface = Interface
-- | The number of haddockable and haddocked items in the module, as a
-- tuple. Haddockable items are the exports and the module itself.
, ifaceHaddockCoverage :: !(Int, Int)
+
+ -- | Warnings for things defined in this module.
+ , ifaceWarningMap :: !WarningMap
}
+type WarningMap = DocMap Name
+
-- | A subset of the fields of 'Interface' that we store in the interface
-- files.
@@ -303,9 +309,10 @@ data Doc id
| DocOrderedList [Doc id]
| DocDefList [(Doc id, Doc id)]
| DocCodeBlock (Doc id)
- | DocURL String
+ | DocHyperlink Hyperlink
| DocPic String
| DocAName String
+ | DocProperty String
| DocExamples [Example]
deriving (Functor)
@@ -315,12 +322,54 @@ instance Monoid (Doc id) where
mappend = DocAppend
+instance NFData a => NFData (Doc a) where
+ rnf doc = case doc of
+ DocEmpty -> ()
+ DocAppend a b -> a `deepseq` b `deepseq` ()
+ DocString a -> a `deepseq` ()
+ DocParagraph a -> a `deepseq` ()
+ DocIdentifier a -> a `deepseq` ()
+ DocIdentifierUnchecked a -> a `deepseq` ()
+ DocModule a -> a `deepseq` ()
+ DocWarning a -> a `deepseq` ()
+ DocEmphasis a -> a `deepseq` ()
+ DocMonospaced a -> a `deepseq` ()
+ DocUnorderedList a -> a `deepseq` ()
+ DocOrderedList a -> a `deepseq` ()
+ DocDefList a -> a `deepseq` ()
+ DocCodeBlock a -> a `deepseq` ()
+ DocHyperlink a -> a `deepseq` ()
+ DocPic a -> a `deepseq` ()
+ DocAName a -> a `deepseq` ()
+ DocProperty a -> a `deepseq` ()
+ DocExamples a -> a `deepseq` ()
+
+
+instance NFData Name
+instance NFData OccName
+instance NFData ModuleName
+
+
+data Hyperlink = Hyperlink
+ { hyperlinkUrl :: String
+ , hyperlinkLabel :: Maybe String
+ } deriving (Eq, Show)
+
+
+instance NFData Hyperlink where
+ rnf (Hyperlink a b) = a `deepseq` b `deepseq` ()
+
+
data Example = Example
{ exampleExpression :: String
, exampleResult :: [String]
} deriving (Eq, Show)
+instance NFData Example where
+ rnf (Example a b) = a `deepseq` b `deepseq` ()
+
+
exampleToString :: Example -> String
exampleToString (Example expression result) =
">>> " ++ expression ++ "\n" ++ unlines result
@@ -341,9 +390,10 @@ data DocMarkup id a = Markup
, markupOrderedList :: [a] -> a
, markupDefList :: [(a,a)] -> a
, markupCodeBlock :: a -> a
- , markupURL :: String -> a
+ , markupHyperlink :: Hyperlink -> a
, markupAName :: String -> a
, markupPic :: String -> a
+ , markupProperty :: String -> a
, markupExample :: [Example] -> a
}
diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs
index 20f45c95..e0b86350 100644
--- a/src/Haddock/Utils.hs
+++ b/src/Haddock/Utils.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Utils
@@ -426,9 +427,10 @@ markup m (DocUnorderedList ds) = markupUnorderedList m (map (markup m) ds)
markup m (DocOrderedList ds) = markupOrderedList m (map (markup m) ds)
markup m (DocDefList ds) = markupDefList m (map (markupPair m) ds)
markup m (DocCodeBlock d) = markupCodeBlock m (markup m d)
-markup m (DocURL url) = markupURL m url
+markup m (DocHyperlink l) = markupHyperlink m l
markup m (DocAName ref) = markupAName m ref
markup m (DocPic img) = markupPic m img
+markup m (DocProperty p) = markupProperty m p
markup m (DocExamples e) = markupExample m e
@@ -453,9 +455,10 @@ idMarkup = Markup {
markupOrderedList = DocOrderedList,
markupDefList = DocDefList,
markupCodeBlock = DocCodeBlock,
- markupURL = DocURL,
+ markupHyperlink = DocHyperlink,
markupAName = DocAName,
markupPic = DocPic,
+ markupProperty = DocProperty,
markupExample = DocExamples
}
diff --git a/test/Haddock/ParseSpec.hs b/test/Haddock/ParseSpec.hs
new file mode 100644
index 00000000..d692cb0c
--- /dev/null
+++ b/test/Haddock/ParseSpec.hs
@@ -0,0 +1,81 @@
+{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+module Haddock.ParseSpec (main, spec) where
+
+import Test.Hspec
+import RdrName (RdrName)
+import DynFlags (DynFlags, defaultDynFlags)
+import Haddock.Lex (tokenise)
+import qualified Haddock.Parse as Parse
+import Haddock.Types
+import Outputable (Outputable, showSDoc, ppr)
+import Data.Monoid
+import Data.String
+
+dynFlags :: DynFlags
+dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined")
+
+instance Outputable a => Show a where
+ show = showSDoc dynFlags . ppr
+
+deriving instance Show a => Show (Doc a)
+deriving instance Eq a =>Eq (Doc a)
+
+instance IsString (Doc RdrName) where
+ fromString = DocString
+
+parseParas :: String -> Maybe (Doc RdrName)
+parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0)
+
+main :: IO ()
+main = hspec spec
+
+spec :: Spec
+spec = do
+ describe "parseParas" $ do
+ it "parses a paragraph" $ do
+ parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n")
+
+ context "when parsing an example" $ do
+ it "requires an example to be separated from a previous paragrap by an empty line" $ do
+ parseParas "foobar\n\n>>> fib 10\n55" `shouldBe`
+ Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]])
+
+ -- parse error
+ parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing
+
+ it "parses a result line that only contains <BLANKLINE> as an emptly line" $ do
+ parseParas ">>> putFooBar\nfoo\n<BLANKLINE>\nbar" `shouldBe`
+ Just (DocExamples [Example "putFooBar" ["foo","","bar"]])
+
+ context "when parsing a code block" $ do
+ it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do
+ parseParas "foobar\n\n> some code" `shouldBe`
+ Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n")
+
+ -- parse error
+ parseParas "foobar\n> some code" `shouldBe` Nothing
+
+
+ context "when parsing a URL" $ do
+ it "parses a URL" $ do
+ parseParas "<http://example.com/>" `shouldBe`
+ Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n")
+
+ it "accepts an optional label" $ do
+ parseParas "<http://example.com/ some link>" `shouldBe`
+ Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n")
+
+ context "when parsing properties" $ do
+ it "can parse a single property" $ do
+ parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23")
+
+ it "can parse multiple subsequent properties" $ do
+ parseParas $ unlines [
+ "prop> 23 == 23"
+ , "prop> 42 == 42"
+ ]
+ `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42")
+ where
+ hyperlink :: String -> Maybe String -> Doc RdrName
+ hyperlink url = DocHyperlink . Hyperlink url
diff --git a/test/Spec.hs b/test/Spec.hs
new file mode 100644
index 00000000..68521c03
--- /dev/null
+++ b/test/Spec.hs
@@ -0,0 +1,9 @@
+module Main where
+
+import Test.Hspec
+
+import qualified Haddock.ParseSpec
+
+main :: IO ()
+main = hspec $ do
+ describe "Haddock.Parse" Haddock.ParseSpec.spec
diff --git a/test/nanospec/README b/test/nanospec/README
new file mode 100644
index 00000000..ffce7c74
--- /dev/null
+++ b/test/nanospec/README
@@ -0,0 +1,6 @@
+A lightweight implementation of a subset of Hspec's API with minimal
+dependencies.
+
+http://hackage.haskell.org/package/nanospec
+
+This is a copy of version 0.1.0.
diff --git a/test/nanospec/Test/Hspec.hs b/test/nanospec/Test/Hspec.hs
new file mode 100644
index 00000000..904ce2e0
--- /dev/null
+++ b/test/nanospec/Test/Hspec.hs
@@ -0,0 +1,126 @@
+{-# LANGUAGE DeriveDataTypeable, CPP #-}
+-- | A lightweight implementation of a subset of Hspec's API.
+module Test.Hspec (
+-- * Types
+ SpecM
+, Spec
+
+-- * Defining a spec
+, describe
+, context
+, it
+
+-- ** Setting expectations
+, Expectation
+, expect
+, shouldBe
+, shouldReturn
+
+-- * Running a spec
+, hspec
+) where
+
+import Control.Applicative
+import Control.Monad
+import Data.Monoid
+import Data.List (intercalate)
+import Data.Typeable
+import qualified Control.Exception as E
+import System.Exit
+
+-- a writer monad
+data SpecM a = SpecM a [SpecTree]
+
+add :: SpecTree -> SpecM ()
+add s = SpecM () [s]
+
+instance Monad SpecM where
+ return a = SpecM a []
+ SpecM a xs >>= f = case f a of
+ SpecM b ys -> SpecM b (xs ++ ys)
+
+data SpecTree = SpecGroup String Spec
+ | SpecExample String (IO Result)
+
+data Result = Success | Failure String
+ deriving (Eq, Show)
+
+type Spec = SpecM ()
+
+describe :: String -> Spec -> Spec
+describe label = add . SpecGroup label
+
+context :: String -> Spec -> Spec
+context = describe
+
+it :: String -> Expectation -> Spec
+it label = add . SpecExample label . evaluateExpectation
+
+-- | Summary of a test run.
+data Summary = Summary Int Int
+
+instance Monoid Summary where
+ mempty = Summary 0 0
+ (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2)
+
+runSpec :: Spec -> IO Summary
+runSpec = runForrest []
+ where
+ runForrest :: [String] -> Spec -> IO Summary
+ runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs
+
+ runTree :: [String] -> SpecTree -> IO Summary
+ runTree labels spec = case spec of
+ SpecExample label x -> do
+ putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ "
+ r <- x
+ case r of
+ Success -> do
+ putStrLn "OK"
+ return (Summary 1 0)
+ Failure err -> do
+ putStrLn "FAILED"
+ putStrLn err
+ return (Summary 1 1)
+ SpecGroup label xs -> do
+ runForrest (label:labels) xs
+
+hspec :: Spec -> IO ()
+hspec spec = do
+ Summary total failures <- runSpec spec
+ putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)")
+ when (failures /= 0) exitFailure
+
+type Expectation = IO ()
+
+infix 1 `shouldBe`, `shouldReturn`
+
+shouldBe :: (Show a, Eq a) => a -> a -> Expectation
+actual `shouldBe` expected =
+ expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected)
+
+shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation
+action `shouldReturn` expected = action >>= (`shouldBe` expected)
+
+expect :: String -> Bool -> Expectation
+expect label f
+ | f = return ()
+ | otherwise = E.throwIO (ExpectationFailure label)
+
+data ExpectationFailure = ExpectationFailure String
+ deriving (Show, Eq, Typeable)
+
+instance E.Exception ExpectationFailure
+
+evaluateExpectation :: Expectation -> IO Result
+evaluateExpectation action = (action >> return Success)
+ `E.catches` [
+ -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT
+ -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt)
+ -- because all of them indicate severe conditions and should not occur during
+ -- normal operation.
+ E.Handler $ \e -> E.throw (e :: E.AsyncException)
+
+ , E.Handler $ \(ExpectationFailure err) -> return (Failure err)
+ , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException))
+ ]
diff --git a/tests/html-tests/README b/tests/html-tests/README
deleted file mode 100644
index 9afb10e7..00000000
--- a/tests/html-tests/README
+++ /dev/null
@@ -1,24 +0,0 @@
-This is a testsuite for Haddock that uses the concept of "golden files". That
-is, it compares output files against a set of reference files.
-
-To add a new test:
-
- 1) Create a module in the "tests" directory.
-
- 2) Run "cabal test". You should now have output/<modulename>.html. The test
- passes since there is no reference file to compare with.
-
- 3) To make a reference file from the output file, do
- runhaskell accept.hs <modulename>
-
-Tips and tricks:
-
-To "accept" all output files (copy them to reference files), run
- runhaskell accept.hs
-
-You can run all tests despite failing tests, like so
- cabal test --test-option=all
-
-You can pass extra options to haddock like so
- cabal test --test-options='all --title="All Tests"'
-
diff --git a/tests/html-tests/accept.hs b/tests/html-tests/accept.hs
deleted file mode 100644
index 49da5c5a..00000000
--- a/tests/html-tests/accept.hs
+++ /dev/null
@@ -1,36 +0,0 @@
-import System.Cmd
-import System.Environment
-import System.FilePath
-import System.Exit
-import System.Directory
-import Data.List
-import Control.Monad
-
-
-main = do
- args <- getArgs
- dir <- getCurrentDirectory
- contents <- getDirectoryContents (dir </> "output")
- if not $ null args
- then
- mapM_ copy [ "output" </> file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ]
- else
- mapM_ copy [ "output" </> file | file <- contents, ".html" `isSuffixOf` file ]
-
-
-copy file = do
- let new = "tests" </> takeFileName file <.> ".ref"
- print file
- print new
- contents <- readFile file
- writeFile new (stripLinks contents)
-
-
-stripLinks str =
- let prefix = "<a href=\"" in
- case stripPrefix prefix str of
- Just str' -> prefix ++ stripLinks (dropWhile (/= '"') str')
- Nothing ->
- case str of
- [] -> []
- x : xs -> x : stripLinks xs
diff --git a/tests/html-tests/tests/Bug1.hs b/tests/html-tests/tests/Bug1.hs
deleted file mode 100644
index af1ed4d3..00000000
--- a/tests/html-tests/tests/Bug1.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-module Bug1 where
-
--- | We should have different anchors for constructors and types\/classes. This
--- hyperlink should point to the type constructor by default: 'T'.
-data T = T
-
diff --git a/tests/html-tests/tests/Bug2.hs b/tests/html-tests/tests/Bug2.hs
deleted file mode 100644
index 9121922e..00000000
--- a/tests/html-tests/tests/Bug2.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-module Bug2 ( x ) where
-import B
-x :: A
-x = A
diff --git a/tests/html-tests/tests/Bug7.hs b/tests/html-tests/tests/Bug7.hs
deleted file mode 100644
index 8cf57914..00000000
--- a/tests/html-tests/tests/Bug7.hs
+++ /dev/null
@@ -1,12 +0,0 @@
--- | This module caused a duplicate instance in the documentation for the Foo
--- type.
-module Bug7 where
-
--- | The Foo datatype
-data Foo = Foo
-
--- | The Bar class
-class Bar x y
-
--- | Just one instance
-instance Bar Foo Foo
diff --git a/tests/html-tests/tests/CrossPackageDocs.hs b/tests/html-tests/tests/CrossPackageDocs.hs
deleted file mode 100644
index de55060e..00000000
--- a/tests/html-tests/tests/CrossPackageDocs.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-module CrossPackageDocs (map, Monad(..), runInteractiveProcess) where
-
-import System.Process
diff --git a/tests/html-tests/tests/DeprecatedFunction.hs b/tests/html-tests/tests/DeprecatedFunction.hs
deleted file mode 100644
index 55416369..00000000
--- a/tests/html-tests/tests/DeprecatedFunction.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-module DeprecatedFunction where
-
--- | some documentation foo
-foo :: Int
-foo = 23
-{-# DEPRECATED foo "use bar instead" #-}
diff --git a/tests/html-tests/tests/DeprecatedModule.hs b/tests/html-tests/tests/DeprecatedModule.hs
deleted file mode 100644
index 61a09d64..00000000
--- a/tests/html-tests/tests/DeprecatedModule.hs
+++ /dev/null
@@ -1,5 +0,0 @@
--- | Documentation for "DeprecatedModule".
-module DeprecatedModule {-# DEPRECATED "Use Foo instead" #-} where
-
-foo :: Int
-foo = 23
diff --git a/tests/html-tests/tests/PruneWithWarning.hs b/tests/html-tests/tests/PruneWithWarning.hs
deleted file mode 100644
index fefe81f5..00000000
--- a/tests/html-tests/tests/PruneWithWarning.hs
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS_HADDOCK prune #-}
-module PruneWithWarning (foo, bar) where
-
-foo :: Int
-foo = 23
-{-# DEPRECATED foo "use bar instead" #-}
-
-bar :: Int
-bar = 42
diff --git a/tests/html-tests/tests/Visible.hs b/tests/html-tests/tests/Visible.hs
deleted file mode 100644
index cad71931..00000000
--- a/tests/html-tests/tests/Visible.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-module Visible where
-visible :: Int -> Int
-visible a = a
diff --git a/tests/unit-tests/.ghci b/tests/unit-tests/.ghci
deleted file mode 100644
index 10563664..00000000
--- a/tests/unit-tests/.ghci
+++ /dev/null
@@ -1 +0,0 @@
-:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h -XCPP -XDeriveDataTypeable -XScopedTypeVariables -XMagicHash
diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs
deleted file mode 100644
index 7180a79e..00000000
--- a/tests/unit-tests/parsetests.hs
+++ /dev/null
@@ -1,69 +0,0 @@
-{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-}
-{-# OPTIONS_GHC -fno-warn-orphans #-}
-module Main (main) where
-
-import Test.HUnit
-import RdrName (RdrName)
-import DynFlags (defaultDynFlags)
-import Haddock.Lex (tokenise)
-import Haddock.Parse (parseParas)
-import Haddock.Types
-import Outputable
-
-instance Outputable a => Show a where
- show = showSDoc . ppr
-
-deriving instance Show a => Show (Doc a)
-deriving instance Eq a =>Eq (Doc a)
-
-data ParseTest = ParseTest {
- input :: String
- , result :: (Maybe (Doc RdrName))
- }
-
-tests :: [ParseTest]
-tests = [
- ParseTest {
- input = "foobar"
- , result = Just $ DocParagraph $ DocString "foobar\n"
- }
-
- , ParseTest {
- input = "foobar\n\n>>> fib 10\n55"
- , result = Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])
- }
-
- , ParseTest {
- input = "foobar\n>>> fib 10\n55"
- , result = Nothing -- parse error
- }
-
- , ParseTest {
- input = "foobar\n\n> some code"
- , result = Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n")))
- }
-
- , ParseTest {
- input = "foobar\n> some code"
- , result = Nothing -- parse error
- }
-
- -- test <BLANKLINE> support
- , ParseTest {
- input = ">>> putFooBar\nfoo\n<BLANKLINE>\nbar"
- , result = Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]
- }
- ]
-
-
-main :: IO ()
-main = do
- _ <- runTestTT $ TestList $ map toTestCase tests
- return ();
- where
-
- toTestCase :: ParseTest -> Test
- toTestCase (ParseTest s r) = TestCase $ assertEqual s r (parse s)
-
- parse :: String -> Maybe (Doc RdrName)
- parse s = parseParas $ tokenise (defaultDynFlags undefined) s (0,0)
diff --git a/tests/unit-tests/runparsetests.sh b/tests/unit-tests/runparsetests.sh
deleted file mode 100755
index ead0ccf5..00000000
--- a/tests/unit-tests/runparsetests.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-cd `dirname $0`
-
-runhaskell \
- -i../../src \
- -i../../dist/build/autogen \
- -i../../dist/build/haddock/haddock-tmp/ \
- -packageghc \
- -optP-include \
- -optP../../dist/build/autogen/cabal_macros.h \
- -XCPP \
- -XDeriveDataTypeable \
- -XScopedTypeVariables \
- -XMagicHash \
- parsetests.hs