From 958d64d77572c47d249965d7146ac17a23de806d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 10:34:28 +0200 Subject: Move HTML tests to directory /html-test/ --- html-test/README | 24 + html-test/accept.hs | 43 + html-test/runtests.hs | 152 ++ html-test/tests/A.hs | 17 + html-test/tests/A.html.ref | 183 ++ html-test/tests/AdvanceTypes.hs | 9 + html-test/tests/AdvanceTypes.html.ref | 97 + html-test/tests/B.hs | 8 + html-test/tests/B.html.ref | 175 ++ html-test/tests/Bug1.hs | 6 + html-test/tests/Bug1.html.ref | 103 + html-test/tests/Bug2.hs | 4 + html-test/tests/Bug2.html.ref | 65 + html-test/tests/Bug3.hs | 6 + html-test/tests/Bug3.html.ref | 83 + html-test/tests/Bug4.hs | 5 + html-test/tests/Bug4.html.ref | 82 + html-test/tests/Bug6.hs | 23 + html-test/tests/Bug6.html.ref | 335 +++ html-test/tests/Bug7.hs | 12 + html-test/tests/Bug7.html.ref | 173 ++ html-test/tests/Bug8.hs | 14 + html-test/tests/Bug8.html.ref | 131 ++ html-test/tests/BugDeprecated.hs | 18 + html-test/tests/BugDeprecated.html.ref | 198 ++ html-test/tests/BugExportHeadings.hs | 29 + html-test/tests/BugExportHeadings.html.ref | 220 ++ html-test/tests/Bugs.hs | 3 + html-test/tests/Bugs.html.ref | 81 + html-test/tests/CrossPackageDocs.hs | 4 + html-test/tests/CrossPackageDocs.html.ref | 298 +++ html-test/tests/DeprecatedClass.hs | 15 + html-test/tests/DeprecatedClass.html.ref | 161 ++ html-test/tests/DeprecatedData.hs | 15 + html-test/tests/DeprecatedData.html.ref | 198 ++ html-test/tests/DeprecatedFunction.hs | 10 + html-test/tests/DeprecatedFunction.html.ref | 110 + html-test/tests/DeprecatedFunction2.hs | 6 + html-test/tests/DeprecatedFunction2.html.ref | 84 + html-test/tests/DeprecatedFunction3.hs | 6 + html-test/tests/DeprecatedFunction3.html.ref | 84 + html-test/tests/DeprecatedModule.hs | 5 + html-test/tests/DeprecatedModule.html.ref | 83 + html-test/tests/DeprecatedModule2.hs | 4 + html-test/tests/DeprecatedModule2.html.ref | 76 + html-test/tests/DeprecatedNewtype.hs | 10 + html-test/tests/DeprecatedNewtype.html.ref | 161 ++ html-test/tests/DeprecatedReExport.hs | 16 + html-test/tests/DeprecatedReExport.html.ref | 133 ++ html-test/tests/DeprecatedRecord.hs | 9 + html-test/tests/DeprecatedRecord.html.ref | 151 ++ html-test/tests/DeprecatedTypeFamily.hs | 9 + html-test/tests/DeprecatedTypeFamily.html.ref | 108 + html-test/tests/DeprecatedTypeSynonym.hs | 9 + html-test/tests/DeprecatedTypeSynonym.html.ref | 116 + html-test/tests/DeprecationMessageParseError.hs | 12 + .../tests/DeprecationMessageParseError.html.ref | 101 + html-test/tests/Examples.hs | 39 + html-test/tests/Examples.html.ref | 179 ++ html-test/tests/FunArgs.hs | 16 + html-test/tests/FunArgs.html.ref | 176 ++ html-test/tests/GADTRecords.hs | 12 + html-test/tests/GADTRecords.html.ref | 234 ++ html-test/tests/Hash.hs | 51 + html-test/tests/Hash.html.ref | 337 +++ html-test/tests/Hidden.hs | 6 + html-test/tests/HiddenInstances.hs | 35 + html-test/tests/HiddenInstances.html.ref | 169 ++ html-test/tests/HiddenInstancesA.hs | 17 + html-test/tests/HiddenInstancesB.hs | 2 + html-test/tests/HiddenInstancesB.html.ref | 143 ++ html-test/tests/Hyperlinks.hs | 8 + html-test/tests/Hyperlinks.html.ref | 89 + html-test/tests/IgnoreExports.hs | 10 + html-test/tests/IgnoreExports.html.ref | 101 + html-test/tests/ModuleWithWarning.hs | 5 + html-test/tests/ModuleWithWarning.html.ref | 83 + html-test/tests/NamedDoc.hs | 4 + html-test/tests/NamedDoc.html.ref | 68 + html-test/tests/NoLayout.hs | 12 + html-test/tests/NoLayout.html.ref | 86 + html-test/tests/NonGreedy.hs | 5 + html-test/tests/NonGreedy.html.ref | 82 + html-test/tests/Properties.hs | 9 + html-test/tests/Properties.html.ref | 92 + html-test/tests/PruneWithWarning.hs | 15 + html-test/tests/PruneWithWarning.html.ref | 72 + html-test/tests/QuasiExpr.hs | 34 + html-test/tests/QuasiExpr.html.ref | 221 ++ html-test/tests/QuasiQuote.hs | 9 + html-test/tests/QuasiQuote.html.ref | 65 + html-test/tests/TH.hs | 8 + html-test/tests/TH.html.ref | 63 + html-test/tests/TH2.hs | 7 + html-test/tests/TH2.html.ref | 63 + html-test/tests/Test.hs | 422 ++++ html-test/tests/Test.html.ref | 2245 ++++++++++++++++++++ html-test/tests/Ticket112.hs | 9 + html-test/tests/Ticket112.html.ref | 82 + html-test/tests/Ticket61.hs | 3 + html-test/tests/Ticket61.html.ref | 80 + html-test/tests/Ticket61_Hidden.hs | 7 + html-test/tests/Ticket75.hs | 7 + html-test/tests/Ticket75.html.ref | 116 + html-test/tests/TypeFamilies.hs | 28 + html-test/tests/TypeFamilies.html.ref | 212 ++ html-test/tests/TypeOperators.hs | 20 + html-test/tests/TypeOperators.html.ref | 185 ++ html-test/tests/Unicode.hs.disabled | 6 + html-test/tests/Unicode.html.ref | 82 + html-test/tests/Visible.hs | 3 + html-test/tests/Visible.html.ref | 67 + html-test/tests/frames.html.ref | 30 + html-test/tests/mini_A.html.ref | 59 + html-test/tests/mini_AdvanceTypes.html.ref | 33 + html-test/tests/mini_B.html.ref | 45 + html-test/tests/mini_Bug1.html.ref | 33 + html-test/tests/mini_Bug2.html.ref | 31 + html-test/tests/mini_Bug3.html.ref | 31 + html-test/tests/mini_Bug4.html.ref | 31 + html-test/tests/mini_Bug6.html.ref | 65 + html-test/tests/mini_Bug7.html.ref | 41 + html-test/tests/mini_Bug8.html.ref | 63 + html-test/tests/mini_BugDeprecated.html.ref | 61 + html-test/tests/mini_BugExportHeadings.html.ref | 79 + html-test/tests/mini_Bugs.html.ref | 33 + html-test/tests/mini_CrossPackageDocs.html.ref | 45 + html-test/tests/mini_DeprecatedClass.html.ref | 41 + html-test/tests/mini_DeprecatedData.html.ref | 41 + html-test/tests/mini_DeprecatedFunction.html.ref | 37 + html-test/tests/mini_DeprecatedFunction2.html.ref | 31 + html-test/tests/mini_DeprecatedFunction3.html.ref | 31 + html-test/tests/mini_DeprecatedModule.html.ref | 31 + html-test/tests/mini_DeprecatedModule2.html.ref | 31 + html-test/tests/mini_DeprecatedNewtype.html.ref | 41 + html-test/tests/mini_DeprecatedReExport.html.ref | 37 + html-test/tests/mini_DeprecatedRecord.html.ref | 33 + html-test/tests/mini_DeprecatedTypeFamily.html.ref | 41 + .../tests/mini_DeprecatedTypeSynonym.html.ref | 41 + .../mini_DeprecationMessageParseError.html.ref | 31 + html-test/tests/mini_Examples.html.ref | 31 + html-test/tests/mini_FunArgs.html.ref | 37 + html-test/tests/mini_GADTRecords.html.ref | 33 + html-test/tests/mini_Hash.html.ref | 74 + html-test/tests/mini_HiddenInstances.html.ref | 41 + html-test/tests/mini_HiddenInstancesB.html.ref | 41 + html-test/tests/mini_Hyperlinks.html.ref | 31 + html-test/tests/mini_IgnoreExports.html.ref | 37 + html-test/tests/mini_ModuleWithWarning.html.ref | 31 + html-test/tests/mini_NamedDoc.html.ref | 25 + html-test/tests/mini_NoLayout.html.ref | 31 + html-test/tests/mini_NonGreedy.html.ref | 31 + html-test/tests/mini_Properties.html.ref | 31 + html-test/tests/mini_PruneWithWarning.html.ref | 25 + html-test/tests/mini_QuasiExpr.html.ref | 59 + html-test/tests/mini_QuasiQuote.html.ref | 31 + html-test/tests/mini_TH.html.ref | 31 + html-test/tests/mini_TH2.html.ref | 31 + html-test/tests/mini_Test.html.ref | 269 +++ html-test/tests/mini_Ticket112.html.ref | 31 + html-test/tests/mini_Ticket61.html.ref | 33 + html-test/tests/mini_Ticket75.html.ref | 39 + html-test/tests/mini_TypeFamilies.html.ref | 55 + html-test/tests/mini_TypeOperators.html.ref | 66 + html-test/tests/mini_Unicode.html.ref | 31 + html-test/tests/mini_Visible.html.ref | 31 + 166 files changed, 12847 insertions(+) create mode 100644 html-test/README create mode 100644 html-test/accept.hs create mode 100644 html-test/runtests.hs create mode 100644 html-test/tests/A.hs create mode 100644 html-test/tests/A.html.ref create mode 100644 html-test/tests/AdvanceTypes.hs create mode 100644 html-test/tests/AdvanceTypes.html.ref create mode 100644 html-test/tests/B.hs create mode 100644 html-test/tests/B.html.ref create mode 100644 html-test/tests/Bug1.hs create mode 100644 html-test/tests/Bug1.html.ref create mode 100644 html-test/tests/Bug2.hs create mode 100644 html-test/tests/Bug2.html.ref create mode 100644 html-test/tests/Bug3.hs create mode 100644 html-test/tests/Bug3.html.ref create mode 100644 html-test/tests/Bug4.hs create mode 100644 html-test/tests/Bug4.html.ref create mode 100644 html-test/tests/Bug6.hs create mode 100644 html-test/tests/Bug6.html.ref create mode 100644 html-test/tests/Bug7.hs create mode 100644 html-test/tests/Bug7.html.ref create mode 100644 html-test/tests/Bug8.hs create mode 100644 html-test/tests/Bug8.html.ref create mode 100644 html-test/tests/BugDeprecated.hs create mode 100644 html-test/tests/BugDeprecated.html.ref create mode 100644 html-test/tests/BugExportHeadings.hs create mode 100644 html-test/tests/BugExportHeadings.html.ref create mode 100644 html-test/tests/Bugs.hs create mode 100644 html-test/tests/Bugs.html.ref create mode 100644 html-test/tests/CrossPackageDocs.hs create mode 100644 html-test/tests/CrossPackageDocs.html.ref create mode 100644 html-test/tests/DeprecatedClass.hs create mode 100644 html-test/tests/DeprecatedClass.html.ref create mode 100644 html-test/tests/DeprecatedData.hs create mode 100644 html-test/tests/DeprecatedData.html.ref create mode 100644 html-test/tests/DeprecatedFunction.hs create mode 100644 html-test/tests/DeprecatedFunction.html.ref create mode 100644 html-test/tests/DeprecatedFunction2.hs create mode 100644 html-test/tests/DeprecatedFunction2.html.ref create mode 100644 html-test/tests/DeprecatedFunction3.hs create mode 100644 html-test/tests/DeprecatedFunction3.html.ref create mode 100644 html-test/tests/DeprecatedModule.hs create mode 100644 html-test/tests/DeprecatedModule.html.ref create mode 100644 html-test/tests/DeprecatedModule2.hs create mode 100644 html-test/tests/DeprecatedModule2.html.ref create mode 100644 html-test/tests/DeprecatedNewtype.hs create mode 100644 html-test/tests/DeprecatedNewtype.html.ref create mode 100644 html-test/tests/DeprecatedReExport.hs create mode 100644 html-test/tests/DeprecatedReExport.html.ref create mode 100644 html-test/tests/DeprecatedRecord.hs create mode 100644 html-test/tests/DeprecatedRecord.html.ref create mode 100644 html-test/tests/DeprecatedTypeFamily.hs create mode 100644 html-test/tests/DeprecatedTypeFamily.html.ref create mode 100644 html-test/tests/DeprecatedTypeSynonym.hs create mode 100644 html-test/tests/DeprecatedTypeSynonym.html.ref create mode 100644 html-test/tests/DeprecationMessageParseError.hs create mode 100644 html-test/tests/DeprecationMessageParseError.html.ref create mode 100644 html-test/tests/Examples.hs create mode 100644 html-test/tests/Examples.html.ref create mode 100644 html-test/tests/FunArgs.hs create mode 100644 html-test/tests/FunArgs.html.ref create mode 100644 html-test/tests/GADTRecords.hs create mode 100644 html-test/tests/GADTRecords.html.ref create mode 100644 html-test/tests/Hash.hs create mode 100644 html-test/tests/Hash.html.ref create mode 100644 html-test/tests/Hidden.hs create mode 100644 html-test/tests/HiddenInstances.hs create mode 100644 html-test/tests/HiddenInstances.html.ref create mode 100644 html-test/tests/HiddenInstancesA.hs create mode 100644 html-test/tests/HiddenInstancesB.hs create mode 100644 html-test/tests/HiddenInstancesB.html.ref create mode 100644 html-test/tests/Hyperlinks.hs create mode 100644 html-test/tests/Hyperlinks.html.ref create mode 100644 html-test/tests/IgnoreExports.hs create mode 100644 html-test/tests/IgnoreExports.html.ref create mode 100644 html-test/tests/ModuleWithWarning.hs create mode 100644 html-test/tests/ModuleWithWarning.html.ref create mode 100644 html-test/tests/NamedDoc.hs create mode 100644 html-test/tests/NamedDoc.html.ref create mode 100644 html-test/tests/NoLayout.hs create mode 100644 html-test/tests/NoLayout.html.ref create mode 100644 html-test/tests/NonGreedy.hs create mode 100644 html-test/tests/NonGreedy.html.ref create mode 100644 html-test/tests/Properties.hs create mode 100644 html-test/tests/Properties.html.ref create mode 100644 html-test/tests/PruneWithWarning.hs create mode 100644 html-test/tests/PruneWithWarning.html.ref create mode 100644 html-test/tests/QuasiExpr.hs create mode 100644 html-test/tests/QuasiExpr.html.ref create mode 100644 html-test/tests/QuasiQuote.hs create mode 100644 html-test/tests/QuasiQuote.html.ref create mode 100644 html-test/tests/TH.hs create mode 100644 html-test/tests/TH.html.ref create mode 100644 html-test/tests/TH2.hs create mode 100644 html-test/tests/TH2.html.ref create mode 100644 html-test/tests/Test.hs create mode 100644 html-test/tests/Test.html.ref create mode 100644 html-test/tests/Ticket112.hs create mode 100644 html-test/tests/Ticket112.html.ref create mode 100644 html-test/tests/Ticket61.hs create mode 100644 html-test/tests/Ticket61.html.ref create mode 100644 html-test/tests/Ticket61_Hidden.hs create mode 100644 html-test/tests/Ticket75.hs create mode 100644 html-test/tests/Ticket75.html.ref create mode 100644 html-test/tests/TypeFamilies.hs create mode 100644 html-test/tests/TypeFamilies.html.ref create mode 100644 html-test/tests/TypeOperators.hs create mode 100644 html-test/tests/TypeOperators.html.ref create mode 100644 html-test/tests/Unicode.hs.disabled create mode 100644 html-test/tests/Unicode.html.ref create mode 100644 html-test/tests/Visible.hs create mode 100644 html-test/tests/Visible.html.ref create mode 100644 html-test/tests/frames.html.ref create mode 100644 html-test/tests/mini_A.html.ref create mode 100644 html-test/tests/mini_AdvanceTypes.html.ref create mode 100644 html-test/tests/mini_B.html.ref create mode 100644 html-test/tests/mini_Bug1.html.ref create mode 100644 html-test/tests/mini_Bug2.html.ref create mode 100644 html-test/tests/mini_Bug3.html.ref create mode 100644 html-test/tests/mini_Bug4.html.ref create mode 100644 html-test/tests/mini_Bug6.html.ref create mode 100644 html-test/tests/mini_Bug7.html.ref create mode 100644 html-test/tests/mini_Bug8.html.ref create mode 100644 html-test/tests/mini_BugDeprecated.html.ref create mode 100644 html-test/tests/mini_BugExportHeadings.html.ref create mode 100644 html-test/tests/mini_Bugs.html.ref create mode 100644 html-test/tests/mini_CrossPackageDocs.html.ref create mode 100644 html-test/tests/mini_DeprecatedClass.html.ref create mode 100644 html-test/tests/mini_DeprecatedData.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction2.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction3.html.ref create mode 100644 html-test/tests/mini_DeprecatedModule.html.ref create mode 100644 html-test/tests/mini_DeprecatedModule2.html.ref create mode 100644 html-test/tests/mini_DeprecatedNewtype.html.ref create mode 100644 html-test/tests/mini_DeprecatedReExport.html.ref create mode 100644 html-test/tests/mini_DeprecatedRecord.html.ref create mode 100644 html-test/tests/mini_DeprecatedTypeFamily.html.ref create mode 100644 html-test/tests/mini_DeprecatedTypeSynonym.html.ref create mode 100644 html-test/tests/mini_DeprecationMessageParseError.html.ref create mode 100644 html-test/tests/mini_Examples.html.ref create mode 100644 html-test/tests/mini_FunArgs.html.ref create mode 100644 html-test/tests/mini_GADTRecords.html.ref create mode 100644 html-test/tests/mini_Hash.html.ref create mode 100644 html-test/tests/mini_HiddenInstances.html.ref create mode 100644 html-test/tests/mini_HiddenInstancesB.html.ref create mode 100644 html-test/tests/mini_Hyperlinks.html.ref create mode 100644 html-test/tests/mini_IgnoreExports.html.ref create mode 100644 html-test/tests/mini_ModuleWithWarning.html.ref create mode 100644 html-test/tests/mini_NamedDoc.html.ref create mode 100644 html-test/tests/mini_NoLayout.html.ref create mode 100644 html-test/tests/mini_NonGreedy.html.ref create mode 100644 html-test/tests/mini_Properties.html.ref create mode 100644 html-test/tests/mini_PruneWithWarning.html.ref create mode 100644 html-test/tests/mini_QuasiExpr.html.ref create mode 100644 html-test/tests/mini_QuasiQuote.html.ref create mode 100644 html-test/tests/mini_TH.html.ref create mode 100644 html-test/tests/mini_TH2.html.ref create mode 100644 html-test/tests/mini_Test.html.ref create mode 100644 html-test/tests/mini_Ticket112.html.ref create mode 100644 html-test/tests/mini_Ticket61.html.ref create mode 100644 html-test/tests/mini_Ticket75.html.ref create mode 100644 html-test/tests/mini_TypeFamilies.html.ref create mode 100644 html-test/tests/mini_TypeOperators.html.ref create mode 100644 html-test/tests/mini_Unicode.html.ref create mode 100644 html-test/tests/mini_Visible.html.ref (limited to 'html-test') diff --git a/html-test/README b/html-test/README new file mode 100644 index 00000000..9afb10e7 --- /dev/null +++ b/html-test/README @@ -0,0 +1,24 @@ +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/.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 + +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/html-test/accept.hs b/html-test/accept.hs new file mode 100644 index 00000000..45b32078 --- /dev/null +++ b/html-test/accept.hs @@ -0,0 +1,43 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import Data.List +import Control.Monad +import Control.Applicative + + +main = do + args <- getArgs + dir <- getCurrentDirectory + contents <- filter (`notElem` ignore) <$> 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 ] + where + ignore = [ + "doc-index.html" + , "index-frames.html" + , "index.html" + ] + + +copy file = do + let new = "tests" takeFileName file <.> ".ref" + print file + print new + contents <- readFile file + writeFile new (stripLinks contents) + + +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs diff --git a/html-test/runtests.hs b/html-test/runtests.hs new file mode 100644 index 00000000..292deb8b --- /dev/null +++ b/html-test/runtests.hs @@ -0,0 +1,152 @@ +import Prelude hiding (mod) +import Control.Monad +import Control.Applicative +import Data.List +import Data.Maybe +import Distribution.InstalledPackageInfo +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 (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath +packageRoot = "." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" +testSuiteRoot = packageRoot "html-test" +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" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + 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 + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + 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 mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + 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" + b <- doesFileExist reffile + if b + then do + copyFile reffile (outDir takeFileName reffile) + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".nolinks" + writeFile reffile' ref' + writeFile outfile' out' + 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 = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) diff --git a/html-test/tests/A.hs b/html-test/tests/A.hs new file mode 100644 index 00000000..606b0865 --- /dev/null +++ b/html-test/tests/A.hs @@ -0,0 +1,17 @@ +module A where + +data A = A + +other :: Int +other = 2 + +-- | Doc for test2 +test2 :: Bool +test2 = False + +-- | Should show up on the page for both modules A and B +data X = X -- ^ Doc for consructor + +-- | Should show up on the page for both modules A and B +reExport :: Int +reExport = 1 diff --git a/html-test/tests/A.html.ref b/html-test/tests/A.html.ref new file mode 100644 index 00000000..328fec02 --- /dev/null +++ b/html-test/tests/A.html.ref @@ -0,0 +1,183 @@ + +A
Safe HaskellNone

A

Synopsis

Documentation

data A

Constructors

A 

test2 :: Bool

Doc for test2 +

data X

Should show up on the page for both modules A and B +

Constructors

X

Doc for consructor +

reExport :: Int

Should show up on the page for both modules A and B +

diff --git a/html-test/tests/AdvanceTypes.hs b/html-test/tests/AdvanceTypes.hs new file mode 100644 index 00000000..939fdf07 --- /dev/null +++ b/html-test/tests/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/html-test/tests/AdvanceTypes.html.ref b/html-test/tests/AdvanceTypes.html.ref new file mode 100644 index 00000000..bac545be --- /dev/null +++ b/html-test/tests/AdvanceTypes.html.ref @@ -0,0 +1,97 @@ + +AdvanceTypes
Safe HaskellNone

AdvanceTypes

Documentation

data Pattern where

Constructors

Nil :: Pattern `[]` 
Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
diff --git a/html-test/tests/B.hs b/html-test/tests/B.hs new file mode 100644 index 00000000..5fd69acd --- /dev/null +++ b/html-test/tests/B.hs @@ -0,0 +1,8 @@ +module B ( module A, test, reExport, X(..) ) where +import A ( A(..), test2, reExport, X(..) ) + +-- | This link shouldn't work: 'other'. +-- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. +-- Module link: "Prelude". +test :: Int +test = 1 diff --git a/html-test/tests/B.html.ref b/html-test/tests/B.html.ref new file mode 100644 index 00000000..410bc75b --- /dev/null +++ b/html-test/tests/B.html.ref @@ -0,0 +1,175 @@ + +B
Safe HaskellNone

B

Synopsis

Documentation

module A

test :: Int

This link shouldn't work: other. + These links should work: other, sortBy, test2, test2, fromMaybe. + Module link: Prelude. +

reExport :: Int

Should show up on the page for both modules A and B +

data X

Should show up on the page for both modules A and B +

Constructors

X

Doc for consructor +

diff --git a/html-test/tests/Bug1.hs b/html-test/tests/Bug1.hs new file mode 100644 index 00000000..af1ed4d3 --- /dev/null +++ b/html-test/tests/Bug1.hs @@ -0,0 +1,6 @@ +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/html-test/tests/Bug1.html.ref b/html-test/tests/Bug1.html.ref new file mode 100644 index 00000000..f8a86948 --- /dev/null +++ b/html-test/tests/Bug1.html.ref @@ -0,0 +1,103 @@ + +Bug1
Safe HaskellNone

Bug1

Synopsis

  • data T = T

Documentation

data T

We should have different anchors for constructors and types/classes. This + hyperlink should point to the type constructor by default: T. +

Constructors

T 
diff --git a/html-test/tests/Bug2.hs b/html-test/tests/Bug2.hs new file mode 100644 index 00000000..9121922e --- /dev/null +++ b/html-test/tests/Bug2.hs @@ -0,0 +1,4 @@ +module Bug2 ( x ) where +import B +x :: A +x = A diff --git a/html-test/tests/Bug2.html.ref b/html-test/tests/Bug2.html.ref new file mode 100644 index 00000000..813035a6 --- /dev/null +++ b/html-test/tests/Bug2.html.ref @@ -0,0 +1,65 @@ + +Bug2
Safe HaskellNone

Bug2

Documentation

x :: A

diff --git a/html-test/tests/Bug3.hs b/html-test/tests/Bug3.hs new file mode 100644 index 00000000..67e57892 --- /dev/null +++ b/html-test/tests/Bug3.hs @@ -0,0 +1,6 @@ +module Bug3 where + +-- | /multi-line +-- emphasis/ +foo :: Int +foo = undefined diff --git a/html-test/tests/Bug3.html.ref b/html-test/tests/Bug3.html.ref new file mode 100644 index 00000000..76d4e730 --- /dev/null +++ b/html-test/tests/Bug3.html.ref @@ -0,0 +1,83 @@ + +Bug3
Safe HaskellNone

Bug3

Synopsis

Documentation

foo :: Int

/multi-line + emphasis/ +

diff --git a/html-test/tests/Bug4.hs b/html-test/tests/Bug4.hs new file mode 100644 index 00000000..425a77aa --- /dev/null +++ b/html-test/tests/Bug4.hs @@ -0,0 +1,5 @@ +module Bug4 where +-- | don't use apostrophe's in the wrong place's +foo :: Int +foo = undefined + diff --git a/html-test/tests/Bug4.html.ref b/html-test/tests/Bug4.html.ref new file mode 100644 index 00000000..9e852978 --- /dev/null +++ b/html-test/tests/Bug4.html.ref @@ -0,0 +1,82 @@ + +Bug4
Safe HaskellNone

Bug4

Synopsis

Documentation

foo :: Int

don't use apostrophe's in the wrong place's +

diff --git a/html-test/tests/Bug6.hs b/html-test/tests/Bug6.hs new file mode 100644 index 00000000..17411f31 --- /dev/null +++ b/html-test/tests/Bug6.hs @@ -0,0 +1,23 @@ +-- | 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 +-- (the field isn't documented separately since it is already documented here) +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/html-test/tests/Bug6.html.ref b/html-test/tests/Bug6.html.ref new file mode 100644 index 00000000..606e45e3 --- /dev/null +++ b/html-test/tests/Bug6.html.ref @@ -0,0 +1,335 @@ + +Bug6
Safe HaskellNone

Bug6

Description

Exporting records. +

Synopsis

Documentation

data A

This record is exported without its field +

Constructors

A Int 

data B

.. with its field, but the field is named separately in the export list + (the field isn't documented separately since it is already documented here) +

Constructors

B 

Fields

b :: Int
 

data C

.. with fields names as subordinate names in the export +

Constructors

C 

Fields

c1 :: Int
 
c2 :: Int
 

data D

.. with only some of the fields exported (we can't handle this one - + how do we render the declaration?) +

Constructors

D Int Int 

newtype E

a newtype with a field +

Constructors

E Int 
diff --git a/html-test/tests/Bug7.hs b/html-test/tests/Bug7.hs new file mode 100644 index 00000000..8cf57914 --- /dev/null +++ b/html-test/tests/Bug7.hs @@ -0,0 +1,12 @@ +-- | 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/html-test/tests/Bug7.html.ref b/html-test/tests/Bug7.html.ref new file mode 100644 index 00000000..8ac72b16 --- /dev/null +++ b/html-test/tests/Bug7.html.ref @@ -0,0 +1,173 @@ + +Bug7
Safe HaskellNone

Bug7

Description

This module caused a duplicate instance in the documentation for the Foo + type. +

Synopsis

Documentation

data Foo

The Foo datatype +

Constructors

Foo 

Instances

Bar Foo Foo

Just one instance +

class Bar x y

The Bar class +

Instances

Bar Foo Foo

Just one instance +

diff --git a/html-test/tests/Bug8.hs b/html-test/tests/Bug8.hs new file mode 100644 index 00000000..18df63c8 --- /dev/null +++ b/html-test/tests/Bug8.hs @@ -0,0 +1,14 @@ +module Bug8 where + +infix --> +infix ---> + +data Typ = Type (String,[Typ]) + | TFree (String, [String]) + +x --> y = Type("fun",[s,t]) +(--->) = flip $ foldr (-->) + +s = undefined +t = undefined +main = undefined diff --git a/html-test/tests/Bug8.html.ref b/html-test/tests/Bug8.html.ref new file mode 100644 index 00000000..469151f1 --- /dev/null +++ b/html-test/tests/Bug8.html.ref @@ -0,0 +1,131 @@ + +Bug8
Safe HaskellNone

Bug8

Documentation

data Typ

Constructors

Type (String, [Typ]) 
TFree (String, [String]) 

(-->) :: t -> t1 -> Typ

(--->) :: [a] -> Typ -> Typ

s :: a

t :: a

main :: a

diff --git a/html-test/tests/BugDeprecated.hs b/html-test/tests/BugDeprecated.hs new file mode 100644 index 00000000..0f7ac2eb --- /dev/null +++ b/html-test/tests/BugDeprecated.hs @@ -0,0 +1,18 @@ +module BugDeprecated where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 +{-# DEPRECATED foo "for foo" #-} +{-# DEPRECATED bar "for bar" #-} +{-# DEPRECATED baz "for baz" #-} + +-- | some documentation for one, two and three +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/BugDeprecated.html.ref b/html-test/tests/BugDeprecated.html.ref new file mode 100644 index 00000000..913b189d --- /dev/null +++ b/html-test/tests/BugDeprecated.html.ref @@ -0,0 +1,198 @@ + +BugDeprecated
Safe HaskellNone

BugDeprecated

Synopsis

Documentation

foo :: Int

Deprecated: for foo +

baz :: Int

Deprecated: for baz +

bar :: Int

Deprecated: for bar +

one :: Int

Deprecated: for one +

some documentation for one, two and three +

three :: Int

Deprecated: for three +

some documentation for one, two and three +

two :: Int

Deprecated: for two +

some documentation for one, two and three +

diff --git a/html-test/tests/BugExportHeadings.hs b/html-test/tests/BugExportHeadings.hs new file mode 100644 index 00000000..a5493a08 --- /dev/null +++ b/html-test/tests/BugExportHeadings.hs @@ -0,0 +1,29 @@ +-- test for #192 +module BugExportHeadings ( +-- * Foo + foo +-- * Bar +, bar +-- * Baz +, baz + +-- * One +, one +-- * Two +, two +-- * Three +, three +) where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 + +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/BugExportHeadings.html.ref b/html-test/tests/BugExportHeadings.html.ref new file mode 100644 index 00000000..457e2c50 --- /dev/null +++ b/html-test/tests/BugExportHeadings.html.ref @@ -0,0 +1,220 @@ + +BugExportHeadings
Safe HaskellNone

BugExportHeadings

Synopsis

Foo +

foo :: Int

Bar +

bar :: Int

Baz +

baz :: Int

One +

one :: Int

Deprecated: for one +

Two +

two :: Int

Deprecated: for two +

Three +

three :: Int

Deprecated: for three +

diff --git a/html-test/tests/Bugs.hs b/html-test/tests/Bugs.hs new file mode 100644 index 00000000..8e1f0079 --- /dev/null +++ b/html-test/tests/Bugs.hs @@ -0,0 +1,3 @@ +module Bugs where + +data A a = A a (a -> Int) diff --git a/html-test/tests/Bugs.html.ref b/html-test/tests/Bugs.html.ref new file mode 100644 index 00000000..c5a4ca9d --- /dev/null +++ b/html-test/tests/Bugs.html.ref @@ -0,0 +1,81 @@ + +Bugs
Safe HaskellNone

Bugs

Documentation

data A a

Constructors

A a (a -> Int) 
diff --git a/html-test/tests/CrossPackageDocs.hs b/html-test/tests/CrossPackageDocs.hs new file mode 100644 index 00000000..4d529f79 --- /dev/null +++ b/html-test/tests/CrossPackageDocs.hs @@ -0,0 +1,4 @@ +module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where + +import System.Process +import Data.String diff --git a/html-test/tests/CrossPackageDocs.html.ref b/html-test/tests/CrossPackageDocs.html.ref new file mode 100644 index 00000000..fea3d0cc --- /dev/null +++ b/html-test/tests/CrossPackageDocs.html.ref @@ -0,0 +1,298 @@ + +CrossPackageDocs
Safe HaskellNone

CrossPackageDocs

Synopsis

Documentation

map :: (a -> b) -> [a] -> [b]

map f xs is the list obtained by applying f to each element + of xs, i.e., +

 map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
+ map f [x1, x2, ...] == [f x1, f x2, ...]
+

class IsString a where

Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC). +

Methods

fromString :: String -> a

Instances

runInteractiveProcess

Arguments

:: FilePath

Filename of the executable (see proc for details) +

-> [String]

Arguments to pass to the executable +

-> Maybe FilePath

Optional path to the working directory +

-> Maybe [(String, String)]

Optional environment (otherwise inherit) +

-> IO (Handle, Handle, Handle, ProcessHandle) 

Runs a raw command, and returns Handles that may be used to communicate + with the process via its stdin, stdout and stderr respectively. +

For example, to start a process and feed a string to its stdin: +

   (inp,out,err,pid) <- runInteractiveProcess "..."
+   forkIO (hPutStr inp str)
+

The Handles are initially in binary mode; if you need them to be + in text mode then use hSetBinaryMode. +

diff --git a/html-test/tests/DeprecatedClass.hs b/html-test/tests/DeprecatedClass.hs new file mode 100644 index 00000000..018904ab --- /dev/null +++ b/html-test/tests/DeprecatedClass.hs @@ -0,0 +1,15 @@ +module DeprecatedClass where + +-- | some class +class SomeClass a where + -- | documentation for foo + foo :: a -> a + +{-# DEPRECATED SomeClass "SomeClass" #-} +{-# DEPRECATED foo "foo" #-} + +class SomeOtherClass a where + bar :: a -> a + +{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} +{-# DEPRECATED bar "bar" #-} diff --git a/html-test/tests/DeprecatedClass.html.ref b/html-test/tests/DeprecatedClass.html.ref new file mode 100644 index 00000000..d716c1d8 --- /dev/null +++ b/html-test/tests/DeprecatedClass.html.ref @@ -0,0 +1,161 @@ + +DeprecatedClass
Safe HaskellNone

DeprecatedClass

Synopsis

Documentation

class SomeClass a where

Deprecated: SomeClass +

some class +

Methods

foo :: a -> a

Deprecated: foo +

documentation for foo +

class SomeOtherClass a where

Deprecated: SomeOtherClass +

Methods

bar :: a -> a

Deprecated: bar +

diff --git a/html-test/tests/DeprecatedData.hs b/html-test/tests/DeprecatedData.hs new file mode 100644 index 00000000..c40ba122 --- /dev/null +++ b/html-test/tests/DeprecatedData.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedData where + +-- | type Foo +data Foo = Foo -- ^ constructor Foo + | Bar -- ^ constructor Bar + +{-# DEPRECATED Foo "Foo" #-} +{-# DEPRECATED Bar "Bar" #-} + +data One = One + | Two + +{-# DEPRECATED One "One" #-} +{-# DEPRECATED Two "Two" #-} diff --git a/html-test/tests/DeprecatedData.html.ref b/html-test/tests/DeprecatedData.html.ref new file mode 100644 index 00000000..24758345 --- /dev/null +++ b/html-test/tests/DeprecatedData.html.ref @@ -0,0 +1,198 @@ + +DeprecatedData
Safe HaskellNone

DeprecatedData

Synopsis

Documentation

data Foo

Deprecated: Foo +

type Foo +

Constructors

Foo

Deprecated: Foo +

constructor Foo +

Bar

Deprecated: Bar +

constructor Bar +

data One

Deprecated: One +

Constructors

One

Deprecated: One +

Two

Deprecated: Two +

diff --git a/html-test/tests/DeprecatedFunction.hs b/html-test/tests/DeprecatedFunction.hs new file mode 100644 index 00000000..8d626435 --- /dev/null +++ b/html-test/tests/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/html-test/tests/DeprecatedFunction.html.ref b/html-test/tests/DeprecatedFunction.html.ref new file mode 100644 index 00000000..1fc678bb --- /dev/null +++ b/html-test/tests/DeprecatedFunction.html.ref @@ -0,0 +1,110 @@ + +DeprecatedFunction
Safe HaskellNone

DeprecatedFunction

Synopsis

Documentation

foo :: Int

Deprecated: use bar instead +

some documentation for foo +

bar :: Int

some documentation for bar +

diff --git a/html-test/tests/DeprecatedFunction2.hs b/html-test/tests/DeprecatedFunction2.hs new file mode 100644 index 00000000..bdbbf95c --- /dev/null +++ b/html-test/tests/DeprecatedFunction2.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction2 where + + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedFunction2.html.ref b/html-test/tests/DeprecatedFunction2.html.ref new file mode 100644 index 00000000..b5068c8e --- /dev/null +++ b/html-test/tests/DeprecatedFunction2.html.ref @@ -0,0 +1,84 @@ + +DeprecatedFunction2
Safe HaskellNone

DeprecatedFunction2

Synopsis

Documentation

foo :: Int

Deprecated: use bar instead +

diff --git a/html-test/tests/DeprecatedFunction3.hs b/html-test/tests/DeprecatedFunction3.hs new file mode 100644 index 00000000..ca719bda --- /dev/null +++ b/html-test/tests/DeprecatedFunction3.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction3 where + + + +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedFunction3.html.ref b/html-test/tests/DeprecatedFunction3.html.ref new file mode 100644 index 00000000..f24eb666 --- /dev/null +++ b/html-test/tests/DeprecatedFunction3.html.ref @@ -0,0 +1,84 @@ + +DeprecatedFunction3
Safe HaskellNone

DeprecatedFunction3

Synopsis

Documentation

foo :: Integer

Deprecated: use bar instead +

diff --git a/html-test/tests/DeprecatedModule.hs b/html-test/tests/DeprecatedModule.hs new file mode 100644 index 00000000..369dba4f --- /dev/null +++ b/html-test/tests/DeprecatedModule.hs @@ -0,0 +1,5 @@ +-- | Documentation for "DeprecatedModule". +module DeprecatedModule {-# DEPRECATED "Use \"Foo\" instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/tests/DeprecatedModule.html.ref b/html-test/tests/DeprecatedModule.html.ref new file mode 100644 index 00000000..0ca4fafe --- /dev/null +++ b/html-test/tests/DeprecatedModule.html.ref @@ -0,0 +1,83 @@ + +DeprecatedModule
Safe HaskellNone

DeprecatedModule

Description

Deprecated: Use Foo instead +

Documentation for DeprecatedModule. +

Documentation

foo :: Int

diff --git a/html-test/tests/DeprecatedModule2.hs b/html-test/tests/DeprecatedModule2.hs new file mode 100644 index 00000000..94185297 --- /dev/null +++ b/html-test/tests/DeprecatedModule2.hs @@ -0,0 +1,4 @@ +module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/tests/DeprecatedModule2.html.ref b/html-test/tests/DeprecatedModule2.html.ref new file mode 100644 index 00000000..0a313ae9 --- /dev/null +++ b/html-test/tests/DeprecatedModule2.html.ref @@ -0,0 +1,76 @@ + +DeprecatedModule2
Safe HaskellNone

DeprecatedModule2

Description

Deprecated: Use Foo instead +

Documentation

foo :: Int

diff --git a/html-test/tests/DeprecatedNewtype.hs b/html-test/tests/DeprecatedNewtype.hs new file mode 100644 index 00000000..254f1f55 --- /dev/null +++ b/html-test/tests/DeprecatedNewtype.hs @@ -0,0 +1,10 @@ +module DeprecatedNewtype where + +-- | some documentation +newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} +{-# DEPRECATED SomeNewType "SomeNewType" #-} +{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} + +newtype SomeOtherNewType = SomeOtherNewTypeConst String +{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} +{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} diff --git a/html-test/tests/DeprecatedNewtype.html.ref b/html-test/tests/DeprecatedNewtype.html.ref new file mode 100644 index 00000000..521ffb92 --- /dev/null +++ b/html-test/tests/DeprecatedNewtype.html.ref @@ -0,0 +1,161 @@ + +DeprecatedNewtype
Safe HaskellNone

DeprecatedNewtype

Documentation

newtype SomeNewType

Deprecated: SomeNewType +

some documentation +

Constructors

SomeNewTypeConst String

Deprecated: SomeNewTypeConst +

constructor docu +

newtype SomeOtherNewType

Deprecated: SomeOtherNewType +

Constructors

SomeOtherNewTypeConst String

Deprecated: SomeOtherNewTypeConst +

diff --git a/html-test/tests/DeprecatedReExport.hs b/html-test/tests/DeprecatedReExport.hs new file mode 100644 index 00000000..f851e2ff --- /dev/null +++ b/html-test/tests/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 +-- , isEmptyChan +, +) where + +import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/html-test/tests/DeprecatedReExport.html.ref b/html-test/tests/DeprecatedReExport.html.ref new file mode 100644 index 00000000..611c181d --- /dev/null +++ b/html-test/tests/DeprecatedReExport.html.ref @@ -0,0 +1,133 @@ + +DeprecatedReExport
Safe HaskellNone

DeprecatedReExport

Description

What is tested here: +

  • Deprecation messages are shown for re-exported items. +

Synopsis

Re-exported from an other module +

foo :: Int

Deprecated: use bar instead +

some documentation for foo +

Re-exported from an other package +

Not yet working, see http://trac.haskell.org/haddock/ticket/223 + , isEmptyChan +

diff --git a/html-test/tests/DeprecatedRecord.hs b/html-test/tests/DeprecatedRecord.hs new file mode 100644 index 00000000..d44499e7 --- /dev/null +++ b/html-test/tests/DeprecatedRecord.hs @@ -0,0 +1,9 @@ +module DeprecatedRecord where + +-- | type Foo +data Foo = Foo { + fooName :: String -- ^ some name +, fooValue :: Int -- ^ some value +} + +{-# DEPRECATED fooValue "do not use this" #-} diff --git a/html-test/tests/DeprecatedRecord.html.ref b/html-test/tests/DeprecatedRecord.html.ref new file mode 100644 index 00000000..9ade8377 --- /dev/null +++ b/html-test/tests/DeprecatedRecord.html.ref @@ -0,0 +1,151 @@ + +DeprecatedRecord
Safe HaskellNone

DeprecatedRecord

Synopsis

Documentation

data Foo

type Foo +

Constructors

Foo 

Fields

fooName :: String

some name +

fooValue :: Int

Deprecated: do not use this +

some value +

diff --git a/html-test/tests/DeprecatedTypeFamily.hs b/html-test/tests/DeprecatedTypeFamily.hs new file mode 100644 index 00000000..70473bb8 --- /dev/null +++ b/html-test/tests/DeprecatedTypeFamily.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedTypeFamily where + +-- | some documentation +data family SomeTypeFamily k :: * -> * +{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} + +data family SomeOtherTypeFamily k :: * -> * +{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/html-test/tests/DeprecatedTypeFamily.html.ref b/html-test/tests/DeprecatedTypeFamily.html.ref new file mode 100644 index 00000000..ffc069a6 --- /dev/null +++ b/html-test/tests/DeprecatedTypeFamily.html.ref @@ -0,0 +1,108 @@ + +DeprecatedTypeFamily
Safe HaskellNone

DeprecatedTypeFamily

Synopsis

Documentation

data family SomeTypeFamily k :: * -> *

Deprecated: SomeTypeFamily +

some documentation +

data family SomeOtherTypeFamily k :: * -> *

Deprecated: SomeOtherTypeFamily +

diff --git a/html-test/tests/DeprecatedTypeSynonym.hs b/html-test/tests/DeprecatedTypeSynonym.hs new file mode 100644 index 00000000..34df47da --- /dev/null +++ b/html-test/tests/DeprecatedTypeSynonym.hs @@ -0,0 +1,9 @@ + +module DeprecatedTypeSynonym where + +-- | some documentation +type TypeSyn = String +{-# DEPRECATED TypeSyn "TypeSyn" #-} + +type OtherTypeSyn = String +{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} diff --git a/html-test/tests/DeprecatedTypeSynonym.html.ref b/html-test/tests/DeprecatedTypeSynonym.html.ref new file mode 100644 index 00000000..665dcf5d --- /dev/null +++ b/html-test/tests/DeprecatedTypeSynonym.html.ref @@ -0,0 +1,116 @@ + +DeprecatedTypeSynonym
Safe HaskellNone

DeprecatedTypeSynonym

Synopsis

Documentation

type TypeSyn = String

Deprecated: TypeSyn +

some documentation +

type OtherTypeSyn = String

Deprecated: OtherTypeSyn +

diff --git a/html-test/tests/DeprecationMessageParseError.hs b/html-test/tests/DeprecationMessageParseError.hs new file mode 100644 index 00000000..2f8fb492 --- /dev/null +++ b/html-test/tests/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/html-test/tests/DeprecationMessageParseError.html.ref b/html-test/tests/DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..75f9bf54 --- /dev/null +++ b/html-test/tests/DeprecationMessageParseError.html.ref @@ -0,0 +1,101 @@ + +DeprecationMessageParseError
Safe HaskellNone

DeprecationMessageParseError

Description

What is tested here: +

  • If parsing of a deprecation message fails, the message is included + verbatim. +

Synopsis

Documentation

foo :: Int

Deprecated: use @bar instead

some documentation for foo +

diff --git a/html-test/tests/Examples.hs b/html-test/tests/Examples.hs new file mode 100644 index 00000000..c8c450f1 --- /dev/null +++ b/html-test/tests/Examples.hs @@ -0,0 +1,39 @@ +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- >>> fib 5 +-- 5 +-- >>> fib 10 +-- 55 +-- +-- >>> fib 10 +-- 55 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- >>> import Data.Char +-- >>> isSpace 'a' +-- False +-- +-- >>> putStrLn "foo\n\nbar" +-- foo +-- +-- bar +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/Examples.html.ref b/html-test/tests/Examples.html.ref new file mode 100644 index 00000000..7ebe7770 --- /dev/null +++ b/html-test/tests/Examples.html.ref @@ -0,0 +1,179 @@ + +Examples
Safe HaskellNone

Examples

Synopsis

Documentation

fib :: Integer -> Integer

Fibonacci number of given Integer. +

Examples: +

>>> fib 5
+5
+>>> fib 10
+55
+
>>> fib 10
+55
+

One more Example: +

>>> fib 5
+5
+

One more Example: +

>>> fib 5
+5
+

Example with an import: +

>>> import Data.Char
+>>> isSpace 'a'
+False
+
>>> putStrLn "foo\n\nbar"
+foo
+
+bar
+
diff --git a/html-test/tests/FunArgs.hs b/html-test/tests/FunArgs.hs new file mode 100644 index 00000000..b34d84b7 --- /dev/null +++ b/html-test/tests/FunArgs.hs @@ -0,0 +1,16 @@ +module FunArgs where + +f :: forall a. Ord a + => Int -- ^ First argument + -> a -- ^ Second argument + -> Bool -- ^ Third argument + -> (a -> a) -- ^ Fourth argument + -> () -- ^ Result +f = undefined + + +g :: a -- ^ First argument + -> b -- ^ Second argument + -> c -- ^ Third argument + -> d -- ^ Result +g = undefined diff --git a/html-test/tests/FunArgs.html.ref b/html-test/tests/FunArgs.html.ref new file mode 100644 index 00000000..6c87d1e6 --- /dev/null +++ b/html-test/tests/FunArgs.html.ref @@ -0,0 +1,176 @@ + +FunArgs
Safe HaskellNone

FunArgs

Documentation

f

Arguments

:: forall a . Ord a 
=> Int

First argument +

-> a

Second argument +

-> Bool

Third argument +

-> (a -> a)

Fourth argument +

-> ()

Result +

g

Arguments

:: a

First argument +

-> b

Second argument +

-> c

Third argument +

-> d

Result +

diff --git a/html-test/tests/GADTRecords.hs b/html-test/tests/GADTRecords.hs new file mode 100644 index 00000000..c77810ad --- /dev/null +++ b/html-test/tests/GADTRecords.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE GADTs #-} +module GADTRecords (H1(..)) where + +-- | h1 +data H1 a b where + C1 :: H1 a b + C2 :: Ord a => [a] -> H1 a a + C3 { field :: Int -- ^ hello docs + } :: H1 Int Int + C4 { field2 :: a -- ^ hello2 docs + } :: H1 Int a + diff --git a/html-test/tests/GADTRecords.html.ref b/html-test/tests/GADTRecords.html.ref new file mode 100644 index 00000000..e3fcd2fe --- /dev/null +++ b/html-test/tests/GADTRecords.html.ref @@ -0,0 +1,234 @@ + +GADTRecords
Safe HaskellNone

GADTRecords

Synopsis

Documentation

data H1 a b where

h1 +

Constructors

C1 :: H1 a b 
C2 :: Ord a => [a] -> H1 a a 
C3 :: Int -> H1 Int Int 

Fields

field :: Int

hello docs +

C4 :: a -> H1 Int a 

Fields

field2 :: a

hello2 docs +

diff --git a/html-test/tests/Hash.hs b/html-test/tests/Hash.hs new file mode 100644 index 00000000..343b69e9 --- /dev/null +++ b/html-test/tests/Hash.hs @@ -0,0 +1,51 @@ +{- | + 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 Data.Array +import Prelude hiding (lookup) + +-- | 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) +new = undefined + +-- | Inserts a new element into the hash table +insert :: (Eq key, Hash key) => key -> val -> IO () +insert = undefined + +-- | 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) +lookup = undefined + +-- | 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 + +trunc = undefined +xor = undefined diff --git a/html-test/tests/Hash.html.ref b/html-test/tests/Hash.html.ref new file mode 100644 index 00000000..b0cd183c --- /dev/null +++ b/html-test/tests/Hash.html.ref @@ -0,0 +1,337 @@ + +Hash
Safe HaskellNone

Hash

Description

Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +

Synopsis

The HashTable type +

data HashTable key val

A hash table with keys of type key and values of type val. + The type key should be an instance of Eq. +

Operations on HashTables +

new :: (Eq key, Hash key) => Int -> IO (HashTable key val)

Builds a new hash table with a given size +

insert :: (Eq key, Hash key) => key -> val -> IO ()

Inserts a new element into the hash table +

lookup :: Hash key => key -> IO (Maybe val)

Looks up a key in the hash table, returns Just val if the key + was found, or Nothing otherwise. +

The Hash class +

class Hash a where

A class of types which can be hashed. +

Methods

hash :: a -> Int

hashes the value of type a into an Int +

Instances

Hash Float 
Hash Int 
(Hash a, Hash b) => Hash (a, b) 
diff --git a/html-test/tests/Hidden.hs b/html-test/tests/Hidden.hs new file mode 100644 index 00000000..896da648 --- /dev/null +++ b/html-test/tests/Hidden.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Hidden where + +hidden :: Int -> Int +hidden a = a diff --git a/html-test/tests/HiddenInstances.hs b/html-test/tests/HiddenInstances.hs new file mode 100644 index 00000000..99a6c2fd --- /dev/null +++ b/html-test/tests/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/tests/HiddenInstances.html.ref b/html-test/tests/HiddenInstances.html.ref new file mode 100644 index 00000000..999c114d --- /dev/null +++ b/html-test/tests/HiddenInstances.html.ref @@ -0,0 +1,169 @@ + +HiddenInstances
Safe HaskellNone

HiddenInstances

Synopsis

Documentation

class VisibleClass a

Should be visible +

Instances

VisibleClass Int

Should be visible +

VisibleClass VisibleData

Should be visible +

data VisibleData

Should be visible +

Instances

Num VisibleData

Should be visible +

VisibleClass VisibleData

Should be visible +

diff --git a/html-test/tests/HiddenInstancesA.hs b/html-test/tests/HiddenInstancesA.hs new file mode 100644 index 00000000..f1775208 --- /dev/null +++ b/html-test/tests/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/tests/HiddenInstancesB.hs b/html-test/tests/HiddenInstancesB.hs new file mode 100644 index 00000000..eabf0637 --- /dev/null +++ b/html-test/tests/HiddenInstancesB.hs @@ -0,0 +1,2 @@ +module HiddenInstancesB (Foo, Bar) where +import HiddenInstancesA diff --git a/html-test/tests/HiddenInstancesB.html.ref b/html-test/tests/HiddenInstancesB.html.ref new file mode 100644 index 00000000..207a5146 --- /dev/null +++ b/html-test/tests/HiddenInstancesB.html.ref @@ -0,0 +1,143 @@ + +HiddenInstancesB
Safe HaskellNone

HiddenInstancesB

Synopsis

Documentation

class Foo a

Should be visible +

Instances

Foo Bar

Should be visible +

data Bar

Should be visible +

Instances

Foo Bar

Should be visible +

diff --git a/html-test/tests/Hyperlinks.hs b/html-test/tests/Hyperlinks.hs new file mode 100644 index 00000000..34e64448 --- /dev/null +++ b/html-test/tests/Hyperlinks.hs @@ -0,0 +1,8 @@ +module Hyperlinks where + +-- | +-- A plain URL: +-- +-- A URL with a label: +foo :: Int +foo = 23 diff --git a/html-test/tests/Hyperlinks.html.ref b/html-test/tests/Hyperlinks.html.ref new file mode 100644 index 00000000..e7351a63 --- /dev/null +++ b/html-test/tests/Hyperlinks.html.ref @@ -0,0 +1,89 @@ + +Hyperlinks
Safe HaskellNone

Hyperlinks

Synopsis

Documentation

foo :: Int

A plain URL: http://example.com/ +

A URL with a label: some link +

diff --git a/html-test/tests/IgnoreExports.hs b/html-test/tests/IgnoreExports.hs new file mode 100644 index 00000000..0321ad02 --- /dev/null +++ b/html-test/tests/IgnoreExports.hs @@ -0,0 +1,10 @@ +{-# OPTIONS_HADDOCK ignore-exports #-} +module IgnoreExports (foo) where + +-- | documentation for foo +foo :: Int +foo = 23 + +-- | documentation for bar +bar :: Int +bar = 23 diff --git a/html-test/tests/IgnoreExports.html.ref b/html-test/tests/IgnoreExports.html.ref new file mode 100644 index 00000000..c661b48c --- /dev/null +++ b/html-test/tests/IgnoreExports.html.ref @@ -0,0 +1,101 @@ + +IgnoreExports
Safe HaskellNone

IgnoreExports

Synopsis

Documentation

foo :: Int

documentation for foo +

bar :: Int

documentation for bar +

diff --git a/html-test/tests/ModuleWithWarning.hs b/html-test/tests/ModuleWithWarning.hs new file mode 100644 index 00000000..e64d9d7e --- /dev/null +++ b/html-test/tests/ModuleWithWarning.hs @@ -0,0 +1,5 @@ +-- | Documentation for "ModuleWithWarning". +module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/tests/ModuleWithWarning.html.ref b/html-test/tests/ModuleWithWarning.html.ref new file mode 100644 index 00000000..348f0822 --- /dev/null +++ b/html-test/tests/ModuleWithWarning.html.ref @@ -0,0 +1,83 @@ + +ModuleWithWarning
Safe HaskellNone

ModuleWithWarning

Description

Warning: This is an unstable interface. Prefer functions from Prelude instead! +

Documentation for ModuleWithWarning. +

Documentation

foo :: Int

diff --git a/html-test/tests/NamedDoc.hs b/html-test/tests/NamedDoc.hs new file mode 100644 index 00000000..7c04ba72 --- /dev/null +++ b/html-test/tests/NamedDoc.hs @@ -0,0 +1,4 @@ +module NamedDoc where + +-- $foo bar + diff --git a/html-test/tests/NamedDoc.html.ref b/html-test/tests/NamedDoc.html.ref new file mode 100644 index 00000000..d2b8ede1 --- /dev/null +++ b/html-test/tests/NamedDoc.html.ref @@ -0,0 +1,68 @@ + +NamedDoc
Safe HaskellNone

NamedDoc

Synopsis

    Documentation

    bar +

    diff --git a/html-test/tests/NoLayout.hs b/html-test/tests/NoLayout.hs new file mode 100644 index 00000000..19b38b1d --- /dev/null +++ b/html-test/tests/NoLayout.hs @@ -0,0 +1,12 @@ + +-- Haddock comments are parsed as separate declarations so we +-- need to insert a ';' when using them with explicit layout. +-- This should probably be changed. + +module NoLayout where { + -- | the function 'g' + ; + g :: Int; + g = undefined + } + diff --git a/html-test/tests/NoLayout.html.ref b/html-test/tests/NoLayout.html.ref new file mode 100644 index 00000000..871add05 --- /dev/null +++ b/html-test/tests/NoLayout.html.ref @@ -0,0 +1,86 @@ + +NoLayout
    Safe HaskellNone

    NoLayout

    Synopsis

    Documentation

    g :: Int

    the function g +

    diff --git a/html-test/tests/NonGreedy.hs b/html-test/tests/NonGreedy.hs new file mode 100644 index 00000000..f51b55f5 --- /dev/null +++ b/html-test/tests/NonGreedy.hs @@ -0,0 +1,5 @@ +module NonGreedy where + +-- | +f :: a +f = undefined diff --git a/html-test/tests/NonGreedy.html.ref b/html-test/tests/NonGreedy.html.ref new file mode 100644 index 00000000..23d3f695 --- /dev/null +++ b/html-test/tests/NonGreedy.html.ref @@ -0,0 +1,82 @@ + +NonGreedy
    Safe HaskellNone

    NonGreedy

    Synopsis

    • f :: a

    Documentation

    f :: a

    diff --git a/html-test/tests/Properties.hs b/html-test/tests/Properties.hs new file mode 100644 index 00000000..05930ece --- /dev/null +++ b/html-test/tests/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/tests/Properties.html.ref b/html-test/tests/Properties.html.ref new file mode 100644 index 00000000..1c4ce893 --- /dev/null +++ b/html-test/tests/Properties.html.ref @@ -0,0 +1,92 @@ + +Properties
    Safe HaskellNone

    Properties

    Synopsis

    Documentation

    fib :: Integer -> Integer

    Fibonacci number of given Integer. +

    fib n <= fib (n + 1)
    diff --git a/html-test/tests/PruneWithWarning.hs b/html-test/tests/PruneWithWarning.hs new file mode 100644 index 00000000..bfa55ea2 --- /dev/null +++ b/html-test/tests/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/html-test/tests/PruneWithWarning.html.ref b/html-test/tests/PruneWithWarning.html.ref new file mode 100644 index 00000000..3c31fbdf --- /dev/null +++ b/html-test/tests/PruneWithWarning.html.ref @@ -0,0 +1,72 @@ + +PruneWithWarning
    Safe HaskellNone

    PruneWithWarning

    Description

    What is tested here: +

    • If a binding has a deprecation message but no documentation, it is pruned + when OPTIONS_HADDOCK prune is used. +
    diff --git a/html-test/tests/QuasiExpr.hs b/html-test/tests/QuasiExpr.hs new file mode 100644 index 00000000..970759ba --- /dev/null +++ b/html-test/tests/QuasiExpr.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE TemplateHaskell #-} + +-- Used by QuasiQuote. Example taken from the GHC documentation. +module QuasiExpr where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote + +data Expr = IntExpr Integer + | AntiIntExpr String + | BinopExpr BinOp Expr Expr + | AntiExpr String + deriving Show + +data BinOp = AddOp + | SubOp + | MulOp + | DivOp + deriving Show + +eval :: Expr -> Integer +eval (IntExpr n) = n +eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) + where + opToFun AddOp = (+) + opToFun SubOp = (-) + opToFun MulOp = (*) + opToFun DivOp = div + +expr = QuasiQuoter parseExprExp undefined undefined undefined + +-- cheating... +parseExprExp :: String -> Q Exp +parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/html-test/tests/QuasiExpr.html.ref b/html-test/tests/QuasiExpr.html.ref new file mode 100644 index 00000000..0a699f35 --- /dev/null +++ b/html-test/tests/QuasiExpr.html.ref @@ -0,0 +1,221 @@ + +QuasiExpr
    Safe HaskellNone

    QuasiExpr

    Documentation

    data BinOp

    Constructors

    AddOp 
    SubOp 
    MulOp 
    DivOp 

    Instances

    expr :: QuasiQuoter

    parseExprExp :: String -> Q Exp

    diff --git a/html-test/tests/QuasiQuote.hs b/html-test/tests/QuasiQuote.hs new file mode 100644 index 00000000..06762cf9 --- /dev/null +++ b/html-test/tests/QuasiQuote.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} + +-- example taken from the GHC documentation +module QuasiQuote where + +import QuasiExpr + +val :: Integer +val = eval [expr|1 + 2|] diff --git a/html-test/tests/QuasiQuote.html.ref b/html-test/tests/QuasiQuote.html.ref new file mode 100644 index 00000000..f61f2b84 --- /dev/null +++ b/html-test/tests/QuasiQuote.html.ref @@ -0,0 +1,65 @@ + +QuasiQuote
    Safe HaskellNone

    QuasiQuote

    Documentation

    diff --git a/html-test/tests/TH.hs b/html-test/tests/TH.hs new file mode 100644 index 00000000..f8178bcb --- /dev/null +++ b/html-test/tests/TH.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH where + +import Language.Haskell.TH + +decl :: Q [Dec] +decl = [d| f x = x|] diff --git a/html-test/tests/TH.html.ref b/html-test/tests/TH.html.ref new file mode 100644 index 00000000..086d6a4a --- /dev/null +++ b/html-test/tests/TH.html.ref @@ -0,0 +1,63 @@ + +TH
    Safe HaskellNone

    TH

    Documentation

    decl :: Q [Dec]

    diff --git a/html-test/tests/TH2.hs b/html-test/tests/TH2.hs new file mode 100644 index 00000000..ea85e547 --- /dev/null +++ b/html-test/tests/TH2.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH2 where + +import TH + +$( decl ) diff --git a/html-test/tests/TH2.html.ref b/html-test/tests/TH2.html.ref new file mode 100644 index 00000000..4d4a8914 --- /dev/null +++ b/html-test/tests/TH2.html.ref @@ -0,0 +1,63 @@ + +TH2
    Safe HaskellNone

    TH2

    Documentation

    f :: t -> t

    diff --git a/html-test/tests/Test.hs b/html-test/tests/Test.hs new file mode 100644 index 00000000..d352f029 --- /dev/null +++ b/html-test/tests/Test.hs @@ -0,0 +1,422 @@ +----------------------------------------------------------------------------- +-- | +-- 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', + + withType, withoutType + ) 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) + + [cat] a small, furry, domesticated mammal + + [pineapple] a fruit grown in the tropics + +@ + 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: . +-} + +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 + +-- | Comment on a definition without type signature +withoutType = undefined + +-- | Comment on a definition with type signature +withType :: Int +withType = 1 + +-- 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/html-test/tests/Test.html.ref b/html-test/tests/Test.html.ref new file mode 100644 index 00000000..f2ef2b28 --- /dev/null +++ b/html-test/tests/Test.html.ref @@ -0,0 +1,2245 @@ + +Test
    Portabilityportable
    Stabilityprovisional
    Maintainerlibraries@haskell.org
    Safe HaskellNone

    Test

    Description

    This module illustrates & tests most of the features of Haddock. + Testing references from the description: T, f, g, visible. +

    Synopsis

    Type declarations +

    Data types +

    data T a b

    This comment applies to the following declaration + and it continues until the next non-comment line +

    Constructors

    A Int (Maybe Float)

    This comment describes the A constructor +

    B (T a b, T Int Float)

    This comment describes the B constructor +

    data T2 a b

    An abstract data declaration +

    data T3 a b

    A data declaration with no documentation annotations on the constructors +

    Constructors

    A1 a 
    B1 b 

    data T4 a b

    Constructors

    A2 a 
    B2 b 

    data T5 a b

    Constructors

    A3 a

    documents A3 +

    B3 b

    documents B3 +

    data T6

    Testing alternative comment styles +

    Constructors

    A4

    This is the doc for A4 +

    B4

    This is the doc for B4 +

    C4

    This is the doc for C4 +

    newtype N1 a

    A newtype +

    Constructors

    N1 a 

    newtype N2 a b

    A newtype with a fieldname +

    Constructors

    N2 

    Fields

    n :: a b
     

    newtype N3 a b

    A newtype with a fieldname, documentation on the field +

    Constructors

    N3 

    Fields

    n3 :: a b

    this is the n3 field +

    data N4 a b

    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 N5 a b

    Constructors

    N5 

    Fields

    n5 :: a b

    no docs on the datatype or the constructor +

    newtype N6 a b

    Constructors

    N6

    docs on the constructor only +

    Fields

    n6 :: a b
     

    newtype N7 a b

    docs on the newtype and the constructor +

    Constructors

    N7

    The N7 constructor +

    Fields

    n7 :: a b
     

    Records +

    data R

    This is the documentation for the R record, which has four fields, + p, q, r, and s. +

    Constructors

    C1

    This is the C1 record constructor, with the following fields: +

    Fields

    p :: Int

    This comment applies to the p field +

    q :: forall a. a -> a

    This comment applies to the q field +

    r :: Int

    This comment applies to both r and s +

    s :: Int

    This comment applies to both r and s +

    C2

    This is the C2 record constructor, also with some fields: +

    Fields

    t :: T1 -> T2 Int Int -> T3 Bool Bool -> T4 Float Float -> T5 () ()
     
    u :: Int
     
    v :: Int
     

    data R1

    Testing different record commenting styles +

    Constructors

    C3

    This is the C3 record constructor +

    Fields

    s1 :: Int

    The s1 record selector +

    s2 :: Int

    The s2 record selector +

    s3 :: Int

    The s3 record selector +

    test that we can export record selectors on their own: +

    Class declarations +

    class D a => C a where

    This comment applies to the previous declaration (the C class) +

    Methods

    a :: IO a

    this is a description of the a method +

    b :: [a]

    this is a description of the b method +

    class D a where

    This is a class declaration with no separate docs for the methods +

    Methods

    d :: T a b

    e :: (a, a)

    Instances

    class E a

    This is a class declaration with no methods (or no methods exported) +

    class F a where

    Methods

    ff :: a

    Test that we can export a class method on its own: +

    Function types +

    f :: C a => a -> Int

    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) +
    cat
    a small, furry, domesticated mammal +
    pineapple
    a fruit grown in the tropics +
    +     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/. +

    g :: Int -> IO CInt

    we can export foreign declarations too +

    Auxiliary stuff +

    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

    This is some documentation that is attached to a name ($aux2) +

     code block on its own in named doc
     code block on its own in named doc (after newline)

    a nested, named doc comment +

    with a paragraph, +

     and a code block
    test
    +test1
    +
     test2
    +  test3
    +
    +test1
    +test2
    +
    test3
    +test4
    +
    +test1
    +test2
    +
    test3
    +test4
    +
    test3
    +test4
    +
    +test1
    +test2
    +

    aux11: +

    test3
    +test4
    +
    +test1
    +test2
    +
     foo
    +
     bar
    +

    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 +

    hidden :: Int -> Int

    A visible module +

    module Visible

    nested-style doc comments +

    Existential / Universal types +

    data Ex a

    A data-type using existential/universal types +

    Constructors

    forall b . C b => Ex1 b 
    forall b . Ex2 b 
    forall b . C a => Ex3 b 
    Ex4 (forall a. a -> a) 

    Type signatures with argument docs +

    k

    Arguments

    :: 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 is a function with documentation for each argument +

    l

    Arguments

    :: (Int, Int, Float)

    takes a triple +

    -> Int

    returns an Int +

    m

    Arguments

    :: R 
    -> N1 ()

    one of the arguments +

    -> IO Int

    and the return value +

    This function has some arg docs +

    o

    Arguments

    :: Float

    The input float +

    -> IO Float

    The output float +

    A foreign import with argument docs +

    A section +

    A subsection +

     a literal line
    +

    $ a non literal line $ +

    f' :: Int

    a function with a prime can be referred to as f' + but f' doesn't get link'd 'f\'' +

    withType :: Int

    Comment on a definition with type signature +

    withoutType :: a

    Comment on a definition without type signature +

    diff --git a/html-test/tests/Ticket112.hs b/html-test/tests/Ticket112.hs new file mode 100644 index 00000000..c9cd5117 --- /dev/null +++ b/html-test/tests/Ticket112.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE MagicHash #-} + +module Ticket112 where + +import GHC.Prim + +-- | ...given a raw 'Addr#' to the string, and the length of the string. +f :: a +f = undefined diff --git a/html-test/tests/Ticket112.html.ref b/html-test/tests/Ticket112.html.ref new file mode 100644 index 00000000..c5c61703 --- /dev/null +++ b/html-test/tests/Ticket112.html.ref @@ -0,0 +1,82 @@ + +Ticket112
    Safe HaskellNone

    Ticket112

    Synopsis

    • f :: a

    Documentation

    f :: a

    ...given a raw Addr# to the string, and the length of the string. +

    diff --git a/html-test/tests/Ticket61.hs b/html-test/tests/Ticket61.hs new file mode 100644 index 00000000..26ca287f --- /dev/null +++ b/html-test/tests/Ticket61.hs @@ -0,0 +1,3 @@ +module Ticket61 (module Ticket61_Hidden) where + +import Ticket61_Hidden diff --git a/html-test/tests/Ticket61.html.ref b/html-test/tests/Ticket61.html.ref new file mode 100644 index 00000000..8c22488b --- /dev/null +++ b/html-test/tests/Ticket61.html.ref @@ -0,0 +1,80 @@ + +Ticket61
    Safe HaskellNone

    Ticket61

    Documentation

    class C a where

    Methods

    f :: a

    A comment about f +

    diff --git a/html-test/tests/Ticket61_Hidden.hs b/html-test/tests/Ticket61_Hidden.hs new file mode 100644 index 00000000..583c10cd --- /dev/null +++ b/html-test/tests/Ticket61_Hidden.hs @@ -0,0 +1,7 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Ticket61_Hidden where + +class C a where + -- | A comment about f + f :: a diff --git a/html-test/tests/Ticket75.hs b/html-test/tests/Ticket75.hs new file mode 100644 index 00000000..94a2f115 --- /dev/null +++ b/html-test/tests/Ticket75.hs @@ -0,0 +1,7 @@ +module Ticket75 where + +data a :- b = Q + +-- | A reference to ':-' +f :: Int +f = undefined diff --git a/html-test/tests/Ticket75.html.ref b/html-test/tests/Ticket75.html.ref new file mode 100644 index 00000000..cd510ea5 --- /dev/null +++ b/html-test/tests/Ticket75.html.ref @@ -0,0 +1,116 @@ + +Ticket75
    Safe HaskellNone

    Ticket75

    Synopsis

    Documentation

    data a :- b

    Constructors

    Q 

    f :: Int

    A reference to :- +

    diff --git a/html-test/tests/TypeFamilies.hs b/html-test/tests/TypeFamilies.hs new file mode 100644 index 00000000..561f95fd --- /dev/null +++ b/html-test/tests/TypeFamilies.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TypeFamilies #-} + +module TypeFamilies where + +-- | Type family G +type family G a :: * + +-- | A class with an associated type +class A a where + -- | An associated type + data B a :: * -> * + -- | A method + f :: B a Int + +-- | Doc for family +type family F a + + +-- | Doc for G Int +type instance G Int = Bool +type instance G Float = Int + + +instance A Int where + data B Int x = Con x + f = Con 3 + +g = Con 5 diff --git a/html-test/tests/TypeFamilies.html.ref b/html-test/tests/TypeFamilies.html.ref new file mode 100644 index 00000000..196d60ec --- /dev/null +++ b/html-test/tests/TypeFamilies.html.ref @@ -0,0 +1,212 @@ + +TypeFamilies
    Safe HaskellNone

    TypeFamilies

    Synopsis

    Documentation

    type family G a :: *

    Type family G +

    class A a where

    A class with an associated type +

    Associated Types

    data B a :: * -> *

    An associated type +

    Methods

    f :: B a Int

    A method +

    Instances

    A Int 

    type family F a

    Doc for family +

    diff --git a/html-test/tests/TypeOperators.hs b/html-test/tests/TypeOperators.hs new file mode 100644 index 00000000..edbb9344 --- /dev/null +++ b/html-test/tests/TypeOperators.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TypeOperators #-} +module TypeOperators ( + -- * stuff + (:-:), + (:+:), + Op, + O(..), + biO, +) where + +data a :-: b + +data (a :+: b) c + +data a `Op` b + +newtype (g `O` f) a = O { unO :: g (f a) } + +biO :: (g `O` f) a +biO = undefined diff --git a/html-test/tests/TypeOperators.html.ref b/html-test/tests/TypeOperators.html.ref new file mode 100644 index 00000000..2b18727f --- /dev/null +++ b/html-test/tests/TypeOperators.html.ref @@ -0,0 +1,185 @@ + +TypeOperators
    Safe HaskellNone

    TypeOperators

    Contents

    Synopsis

    • data a :-: b
    • data (a :+: b) c
    • data Op a b
    • newtype O g f a = O {}
    • biO :: (g `O` f) a

    stuff +

    data a :-: b

    data (a :+: b) c

    data Op a b

    newtype O g f a

    Constructors

    O 

    Fields

    unO :: g (f a)
     

    biO :: (g `O` f) a

    diff --git a/html-test/tests/Unicode.hs.disabled b/html-test/tests/Unicode.hs.disabled new file mode 100644 index 00000000..d5bbf445 --- /dev/null +++ b/html-test/tests/Unicode.hs.disabled @@ -0,0 +1,6 @@ +module Unicode where + +-- | γλώσσα +x :: Int +x = 1 + diff --git a/html-test/tests/Unicode.html.ref b/html-test/tests/Unicode.html.ref new file mode 100644 index 00000000..13ef6c1e --- /dev/null +++ b/html-test/tests/Unicode.html.ref @@ -0,0 +1,82 @@ + +Unicode
    Safe HaskellNone

    Unicode

    Synopsis

    Documentation

    x :: Int

    γλώσσα +

    diff --git a/html-test/tests/Visible.hs b/html-test/tests/Visible.hs new file mode 100644 index 00000000..cad71931 --- /dev/null +++ b/html-test/tests/Visible.hs @@ -0,0 +1,3 @@ +module Visible where +visible :: Int -> Int +visible a = a diff --git a/html-test/tests/Visible.html.ref b/html-test/tests/Visible.html.ref new file mode 100644 index 00000000..de8b8d80 --- /dev/null +++ b/html-test/tests/Visible.html.ref @@ -0,0 +1,67 @@ + +Visible
    Safe HaskellNone

    Visible

    Documentation

    diff --git a/html-test/tests/frames.html.ref b/html-test/tests/frames.html.ref new file mode 100644 index 00000000..1b4e38d4 --- /dev/null +++ b/html-test/tests/frames.html.ref @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/html-test/tests/mini_A.html.ref b/html-test/tests/mini_A.html.ref new file mode 100644 index 00000000..cbe50e41 --- /dev/null +++ b/html-test/tests/mini_A.html.ref @@ -0,0 +1,59 @@ + +A

    A

    diff --git a/html-test/tests/mini_AdvanceTypes.html.ref b/html-test/tests/mini_AdvanceTypes.html.ref new file mode 100644 index 00000000..59d8dcb1 --- /dev/null +++ b/html-test/tests/mini_AdvanceTypes.html.ref @@ -0,0 +1,33 @@ + +AdvanceTypes

    AdvanceTypes

    data Pattern

    diff --git a/html-test/tests/mini_B.html.ref b/html-test/tests/mini_B.html.ref new file mode 100644 index 00000000..211a7deb --- /dev/null +++ b/html-test/tests/mini_B.html.ref @@ -0,0 +1,45 @@ + +B

    B

    diff --git a/html-test/tests/mini_Bug1.html.ref b/html-test/tests/mini_Bug1.html.ref new file mode 100644 index 00000000..adf81c73 --- /dev/null +++ b/html-test/tests/mini_Bug1.html.ref @@ -0,0 +1,33 @@ + +Bug1

    Bug1

    data T

    diff --git a/html-test/tests/mini_Bug2.html.ref b/html-test/tests/mini_Bug2.html.ref new file mode 100644 index 00000000..b673e459 --- /dev/null +++ b/html-test/tests/mini_Bug2.html.ref @@ -0,0 +1,31 @@ + +Bug2

    Bug2

    diff --git a/html-test/tests/mini_Bug3.html.ref b/html-test/tests/mini_Bug3.html.ref new file mode 100644 index 00000000..af4cc445 --- /dev/null +++ b/html-test/tests/mini_Bug3.html.ref @@ -0,0 +1,31 @@ + +Bug3

    Bug3

    diff --git a/html-test/tests/mini_Bug4.html.ref b/html-test/tests/mini_Bug4.html.ref new file mode 100644 index 00000000..b403e94a --- /dev/null +++ b/html-test/tests/mini_Bug4.html.ref @@ -0,0 +1,31 @@ + +Bug4

    Bug4

    diff --git a/html-test/tests/mini_Bug6.html.ref b/html-test/tests/mini_Bug6.html.ref new file mode 100644 index 00000000..5c5c1119 --- /dev/null +++ b/html-test/tests/mini_Bug6.html.ref @@ -0,0 +1,65 @@ + +Bug6

    Bug6

    data A

    data B

    data C

    data D

    data E

    diff --git a/html-test/tests/mini_Bug7.html.ref b/html-test/tests/mini_Bug7.html.ref new file mode 100644 index 00000000..1bec82ee --- /dev/null +++ b/html-test/tests/mini_Bug7.html.ref @@ -0,0 +1,41 @@ + +Bug7

    Bug7

    data Foo

    class Bar x y

    diff --git a/html-test/tests/mini_Bug8.html.ref b/html-test/tests/mini_Bug8.html.ref new file mode 100644 index 00000000..070dbcf8 --- /dev/null +++ b/html-test/tests/mini_Bug8.html.ref @@ -0,0 +1,63 @@ + +Bug8

    Bug8

    diff --git a/html-test/tests/mini_BugDeprecated.html.ref b/html-test/tests/mini_BugDeprecated.html.ref new file mode 100644 index 00000000..f0410137 --- /dev/null +++ b/html-test/tests/mini_BugDeprecated.html.ref @@ -0,0 +1,61 @@ + +BugDeprecated

    BugDeprecated

    diff --git a/html-test/tests/mini_BugExportHeadings.html.ref b/html-test/tests/mini_BugExportHeadings.html.ref new file mode 100644 index 00000000..b481720d --- /dev/null +++ b/html-test/tests/mini_BugExportHeadings.html.ref @@ -0,0 +1,79 @@ + +BugExportHeadings

    BugExportHeadings

    Foo +

    Bar +

    Baz +

    One +

    Two +

    Three +

    diff --git a/html-test/tests/mini_Bugs.html.ref b/html-test/tests/mini_Bugs.html.ref new file mode 100644 index 00000000..3c758375 --- /dev/null +++ b/html-test/tests/mini_Bugs.html.ref @@ -0,0 +1,33 @@ + +Bugs

    Bugs

    data A a

    diff --git a/html-test/tests/mini_CrossPackageDocs.html.ref b/html-test/tests/mini_CrossPackageDocs.html.ref new file mode 100644 index 00000000..4c0588ba --- /dev/null +++ b/html-test/tests/mini_CrossPackageDocs.html.ref @@ -0,0 +1,45 @@ + +CrossPackageDocs

    CrossPackageDocs

    diff --git a/html-test/tests/mini_DeprecatedClass.html.ref b/html-test/tests/mini_DeprecatedClass.html.ref new file mode 100644 index 00000000..3923c1ff --- /dev/null +++ b/html-test/tests/mini_DeprecatedClass.html.ref @@ -0,0 +1,41 @@ + +DeprecatedClass

    DeprecatedClass

    class SomeClass a

    diff --git a/html-test/tests/mini_DeprecatedData.html.ref b/html-test/tests/mini_DeprecatedData.html.ref new file mode 100644 index 00000000..8ef20113 --- /dev/null +++ b/html-test/tests/mini_DeprecatedData.html.ref @@ -0,0 +1,41 @@ + +DeprecatedData

    DeprecatedData

    data Foo

    data One

    diff --git a/html-test/tests/mini_DeprecatedFunction.html.ref b/html-test/tests/mini_DeprecatedFunction.html.ref new file mode 100644 index 00000000..9bb90dac --- /dev/null +++ b/html-test/tests/mini_DeprecatedFunction.html.ref @@ -0,0 +1,37 @@ + +DeprecatedFunction

    DeprecatedFunction

    diff --git a/html-test/tests/mini_DeprecatedFunction2.html.ref b/html-test/tests/mini_DeprecatedFunction2.html.ref new file mode 100644 index 00000000..a03991a9 --- /dev/null +++ b/html-test/tests/mini_DeprecatedFunction2.html.ref @@ -0,0 +1,31 @@ + +DeprecatedFunction2

    DeprecatedFunction2

    diff --git a/html-test/tests/mini_DeprecatedFunction3.html.ref b/html-test/tests/mini_DeprecatedFunction3.html.ref new file mode 100644 index 00000000..4ea60339 --- /dev/null +++ b/html-test/tests/mini_DeprecatedFunction3.html.ref @@ -0,0 +1,31 @@ + +DeprecatedFunction3

    DeprecatedFunction3

    diff --git a/html-test/tests/mini_DeprecatedModule.html.ref b/html-test/tests/mini_DeprecatedModule.html.ref new file mode 100644 index 00000000..bfdef611 --- /dev/null +++ b/html-test/tests/mini_DeprecatedModule.html.ref @@ -0,0 +1,31 @@ + +DeprecatedModule

    DeprecatedModule

    diff --git a/html-test/tests/mini_DeprecatedModule2.html.ref b/html-test/tests/mini_DeprecatedModule2.html.ref new file mode 100644 index 00000000..dbcc43b9 --- /dev/null +++ b/html-test/tests/mini_DeprecatedModule2.html.ref @@ -0,0 +1,31 @@ + +DeprecatedModule2

    DeprecatedModule2

    diff --git a/html-test/tests/mini_DeprecatedNewtype.html.ref b/html-test/tests/mini_DeprecatedNewtype.html.ref new file mode 100644 index 00000000..a913525f --- /dev/null +++ b/html-test/tests/mini_DeprecatedNewtype.html.ref @@ -0,0 +1,41 @@ + +DeprecatedNewtype

    DeprecatedNewtype

    diff --git a/html-test/tests/mini_DeprecatedReExport.html.ref b/html-test/tests/mini_DeprecatedReExport.html.ref new file mode 100644 index 00000000..8316dda5 --- /dev/null +++ b/html-test/tests/mini_DeprecatedReExport.html.ref @@ -0,0 +1,37 @@ + +DeprecatedReExport

    DeprecatedReExport

    Re-exported from an other module +

    Re-exported from an other package +

    diff --git a/html-test/tests/mini_DeprecatedRecord.html.ref b/html-test/tests/mini_DeprecatedRecord.html.ref new file mode 100644 index 00000000..3d949d2d --- /dev/null +++ b/html-test/tests/mini_DeprecatedRecord.html.ref @@ -0,0 +1,33 @@ + +DeprecatedRecord

    DeprecatedRecord

    data Foo

    diff --git a/html-test/tests/mini_DeprecatedTypeFamily.html.ref b/html-test/tests/mini_DeprecatedTypeFamily.html.ref new file mode 100644 index 00000000..c87d9637 --- /dev/null +++ b/html-test/tests/mini_DeprecatedTypeFamily.html.ref @@ -0,0 +1,41 @@ + +DeprecatedTypeFamily

    DeprecatedTypeFamily

    data family SomeTypeFamily k :: * -> *

    data family SomeOtherTypeFamily k :: * -> *

    diff --git a/html-test/tests/mini_DeprecatedTypeSynonym.html.ref b/html-test/tests/mini_DeprecatedTypeSynonym.html.ref new file mode 100644 index 00000000..5ade100d --- /dev/null +++ b/html-test/tests/mini_DeprecatedTypeSynonym.html.ref @@ -0,0 +1,41 @@ + +DeprecatedTypeSynonym

    DeprecatedTypeSynonym

    diff --git a/html-test/tests/mini_DeprecationMessageParseError.html.ref b/html-test/tests/mini_DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..e52f487f --- /dev/null +++ b/html-test/tests/mini_DeprecationMessageParseError.html.ref @@ -0,0 +1,31 @@ + +DeprecationMessageParseError

    DeprecationMessageParseError

    diff --git a/html-test/tests/mini_Examples.html.ref b/html-test/tests/mini_Examples.html.ref new file mode 100644 index 00000000..c99c2c48 --- /dev/null +++ b/html-test/tests/mini_Examples.html.ref @@ -0,0 +1,31 @@ + +Examples

    Examples

    diff --git a/html-test/tests/mini_FunArgs.html.ref b/html-test/tests/mini_FunArgs.html.ref new file mode 100644 index 00000000..89729720 --- /dev/null +++ b/html-test/tests/mini_FunArgs.html.ref @@ -0,0 +1,37 @@ + +FunArgs

    FunArgs

    diff --git a/html-test/tests/mini_GADTRecords.html.ref b/html-test/tests/mini_GADTRecords.html.ref new file mode 100644 index 00000000..a8b838f0 --- /dev/null +++ b/html-test/tests/mini_GADTRecords.html.ref @@ -0,0 +1,33 @@ + +GADTRecords

    GADTRecords

    data H1 a b

    diff --git a/html-test/tests/mini_Hash.html.ref b/html-test/tests/mini_Hash.html.ref new file mode 100644 index 00000000..1e6ad1a9 --- /dev/null +++ b/html-test/tests/mini_Hash.html.ref @@ -0,0 +1,74 @@ + +Hash

    Hash

    The HashTable type +

    data HashTable key val

    Operations on HashTables +

    The Hash class +

    class Hash a

    diff --git a/html-test/tests/mini_HiddenInstances.html.ref b/html-test/tests/mini_HiddenInstances.html.ref new file mode 100644 index 00000000..0f1a2e04 --- /dev/null +++ b/html-test/tests/mini_HiddenInstances.html.ref @@ -0,0 +1,41 @@ + +HiddenInstances

    HiddenInstances

    diff --git a/html-test/tests/mini_HiddenInstancesB.html.ref b/html-test/tests/mini_HiddenInstancesB.html.ref new file mode 100644 index 00000000..3ce4f6a9 --- /dev/null +++ b/html-test/tests/mini_HiddenInstancesB.html.ref @@ -0,0 +1,41 @@ + +HiddenInstancesB

    HiddenInstancesB

    class Foo a

    data Bar

    diff --git a/html-test/tests/mini_Hyperlinks.html.ref b/html-test/tests/mini_Hyperlinks.html.ref new file mode 100644 index 00000000..f0c7d65a --- /dev/null +++ b/html-test/tests/mini_Hyperlinks.html.ref @@ -0,0 +1,31 @@ + +Hyperlinks

    Hyperlinks

    diff --git a/html-test/tests/mini_IgnoreExports.html.ref b/html-test/tests/mini_IgnoreExports.html.ref new file mode 100644 index 00000000..a420e65a --- /dev/null +++ b/html-test/tests/mini_IgnoreExports.html.ref @@ -0,0 +1,37 @@ + +IgnoreExports

    IgnoreExports

    diff --git a/html-test/tests/mini_ModuleWithWarning.html.ref b/html-test/tests/mini_ModuleWithWarning.html.ref new file mode 100644 index 00000000..19315a14 --- /dev/null +++ b/html-test/tests/mini_ModuleWithWarning.html.ref @@ -0,0 +1,31 @@ + +ModuleWithWarning

    ModuleWithWarning

    diff --git a/html-test/tests/mini_NamedDoc.html.ref b/html-test/tests/mini_NamedDoc.html.ref new file mode 100644 index 00000000..066bbc61 --- /dev/null +++ b/html-test/tests/mini_NamedDoc.html.ref @@ -0,0 +1,25 @@ + +NamedDoc

    NamedDoc

    diff --git a/html-test/tests/mini_NoLayout.html.ref b/html-test/tests/mini_NoLayout.html.ref new file mode 100644 index 00000000..19562d70 --- /dev/null +++ b/html-test/tests/mini_NoLayout.html.ref @@ -0,0 +1,31 @@ + +NoLayout

    NoLayout

    diff --git a/html-test/tests/mini_NonGreedy.html.ref b/html-test/tests/mini_NonGreedy.html.ref new file mode 100644 index 00000000..698c368e --- /dev/null +++ b/html-test/tests/mini_NonGreedy.html.ref @@ -0,0 +1,31 @@ + +NonGreedy

    NonGreedy

    diff --git a/html-test/tests/mini_Properties.html.ref b/html-test/tests/mini_Properties.html.ref new file mode 100644 index 00000000..5f538dfd --- /dev/null +++ b/html-test/tests/mini_Properties.html.ref @@ -0,0 +1,31 @@ + +Properties

    Properties

    diff --git a/html-test/tests/mini_PruneWithWarning.html.ref b/html-test/tests/mini_PruneWithWarning.html.ref new file mode 100644 index 00000000..9eb3aa00 --- /dev/null +++ b/html-test/tests/mini_PruneWithWarning.html.ref @@ -0,0 +1,25 @@ + +PruneWithWarning

    PruneWithWarning

    diff --git a/html-test/tests/mini_QuasiExpr.html.ref b/html-test/tests/mini_QuasiExpr.html.ref new file mode 100644 index 00000000..7dd9b829 --- /dev/null +++ b/html-test/tests/mini_QuasiExpr.html.ref @@ -0,0 +1,59 @@ + +QuasiExpr

    QuasiExpr

    diff --git a/html-test/tests/mini_QuasiQuote.html.ref b/html-test/tests/mini_QuasiQuote.html.ref new file mode 100644 index 00000000..5dac6acc --- /dev/null +++ b/html-test/tests/mini_QuasiQuote.html.ref @@ -0,0 +1,31 @@ + +QuasiQuote

    QuasiQuote

    diff --git a/html-test/tests/mini_TH.html.ref b/html-test/tests/mini_TH.html.ref new file mode 100644 index 00000000..d2ddbabc --- /dev/null +++ b/html-test/tests/mini_TH.html.ref @@ -0,0 +1,31 @@ + +TH

    TH

    diff --git a/html-test/tests/mini_TH2.html.ref b/html-test/tests/mini_TH2.html.ref new file mode 100644 index 00000000..2c9f1340 --- /dev/null +++ b/html-test/tests/mini_TH2.html.ref @@ -0,0 +1,31 @@ + +TH2

    TH2

    diff --git a/html-test/tests/mini_Test.html.ref b/html-test/tests/mini_Test.html.ref new file mode 100644 index 00000000..26db2c0f --- /dev/null +++ b/html-test/tests/mini_Test.html.ref @@ -0,0 +1,269 @@ + +Test

    Test

    Type declarations +

    Data types +

    data T a b

    data T2 a b

    data T3 a b

    data T4 a b

    data T5 a b

    data T6

    data N1 a

    data N2 a b

    data N3 a b

    data N4 a b

    data N5 a b

    data N6 a b

    data N7 a b

    Records +

    data R

    data R1

    Class declarations +

    class C a

    class D a

    class E a

    class F a

    Function types +

    Auxiliary stuff +

    A hidden module +

    A visible module +

    Existential / Universal types +

    data Ex a

    Type signatures with argument docs +

    A section +

    A subsection +

    diff --git a/html-test/tests/mini_Ticket112.html.ref b/html-test/tests/mini_Ticket112.html.ref new file mode 100644 index 00000000..68a0a5e5 --- /dev/null +++ b/html-test/tests/mini_Ticket112.html.ref @@ -0,0 +1,31 @@ + +Ticket112

    Ticket112

    diff --git a/html-test/tests/mini_Ticket61.html.ref b/html-test/tests/mini_Ticket61.html.ref new file mode 100644 index 00000000..a73fefca --- /dev/null +++ b/html-test/tests/mini_Ticket61.html.ref @@ -0,0 +1,33 @@ + +Ticket61

    Ticket61

    class C a

    diff --git a/html-test/tests/mini_Ticket75.html.ref b/html-test/tests/mini_Ticket75.html.ref new file mode 100644 index 00000000..75ce882c --- /dev/null +++ b/html-test/tests/mini_Ticket75.html.ref @@ -0,0 +1,39 @@ + +Ticket75

    Ticket75

    data a :- b

    diff --git a/html-test/tests/mini_TypeFamilies.html.ref b/html-test/tests/mini_TypeFamilies.html.ref new file mode 100644 index 00000000..0cf39c88 --- /dev/null +++ b/html-test/tests/mini_TypeFamilies.html.ref @@ -0,0 +1,55 @@ + +TypeFamilies

    TypeFamilies

    type family G a :: *

    class A a

    type family F a

    diff --git a/html-test/tests/mini_TypeOperators.html.ref b/html-test/tests/mini_TypeOperators.html.ref new file mode 100644 index 00000000..86b6beec --- /dev/null +++ b/html-test/tests/mini_TypeOperators.html.ref @@ -0,0 +1,66 @@ + +TypeOperators

    TypeOperators

    stuff +

    data a :-: b

    data (a :+: b) c

    data Op a b

    data O g f a

    diff --git a/html-test/tests/mini_Unicode.html.ref b/html-test/tests/mini_Unicode.html.ref new file mode 100644 index 00000000..55336980 --- /dev/null +++ b/html-test/tests/mini_Unicode.html.ref @@ -0,0 +1,31 @@ + +Unicode

    Unicode

    diff --git a/html-test/tests/mini_Visible.html.ref b/html-test/tests/mini_Visible.html.ref new file mode 100644 index 00000000..976a30c5 --- /dev/null +++ b/html-test/tests/mini_Visible.html.ref @@ -0,0 +1,31 @@ + +Visible

    Visible

    -- cgit v1.2.3 From f21570e5526ce564ac8abeff5310cf753f86ffb8 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 10:41:29 +0200 Subject: Move HTML reference renderings to /html-test/ref/ --- html-test/accept.hs | 2 +- html-test/ref/A.html | 183 ++ html-test/ref/AdvanceTypes.html | 97 + html-test/ref/B.html | 175 ++ html-test/ref/Bug1.html | 103 + html-test/ref/Bug2.html | 65 + html-test/ref/Bug3.html | 83 + html-test/ref/Bug4.html | 82 + html-test/ref/Bug6.html | 335 +++ html-test/ref/Bug7.html | 173 ++ html-test/ref/Bug8.html | 131 ++ html-test/ref/BugDeprecated.html | 198 ++ html-test/ref/BugExportHeadings.html | 220 ++ html-test/ref/Bugs.html | 81 + html-test/ref/CrossPackageDocs.html | 298 +++ html-test/ref/DeprecatedClass.html | 161 ++ html-test/ref/DeprecatedData.html | 198 ++ html-test/ref/DeprecatedFunction.html | 110 + html-test/ref/DeprecatedFunction2.html | 84 + html-test/ref/DeprecatedFunction3.html | 84 + html-test/ref/DeprecatedModule.html | 83 + html-test/ref/DeprecatedModule2.html | 76 + html-test/ref/DeprecatedNewtype.html | 161 ++ html-test/ref/DeprecatedReExport.html | 133 ++ html-test/ref/DeprecatedRecord.html | 151 ++ html-test/ref/DeprecatedTypeFamily.html | 108 + html-test/ref/DeprecatedTypeSynonym.html | 116 + html-test/ref/DeprecationMessageParseError.html | 101 + html-test/ref/Examples.html | 179 ++ html-test/ref/FunArgs.html | 176 ++ html-test/ref/GADTRecords.html | 234 ++ html-test/ref/Hash.html | 337 +++ html-test/ref/HiddenInstances.html | 169 ++ html-test/ref/HiddenInstancesB.html | 143 ++ html-test/ref/Hyperlinks.html | 89 + html-test/ref/IgnoreExports.html | 101 + html-test/ref/ModuleWithWarning.html | 83 + html-test/ref/NamedDoc.html | 68 + html-test/ref/NoLayout.html | 86 + html-test/ref/NonGreedy.html | 82 + html-test/ref/Properties.html | 92 + html-test/ref/PruneWithWarning.html | 72 + html-test/ref/QuasiExpr.html | 221 ++ html-test/ref/QuasiQuote.html | 65 + html-test/ref/TH.html | 63 + html-test/ref/TH2.html | 63 + html-test/ref/Test.html | 2245 ++++++++++++++++++++ html-test/ref/Ticket112.html | 82 + html-test/ref/Ticket61.html | 80 + html-test/ref/Ticket75.html | 116 + html-test/ref/TypeFamilies.html | 212 ++ html-test/ref/TypeOperators.html | 185 ++ html-test/ref/Unicode.html | 82 + html-test/ref/Visible.html | 67 + html-test/ref/frames.html | 30 + html-test/ref/mini_A.html | 59 + html-test/ref/mini_AdvanceTypes.html | 33 + html-test/ref/mini_B.html | 45 + html-test/ref/mini_Bug1.html | 33 + html-test/ref/mini_Bug2.html | 31 + html-test/ref/mini_Bug3.html | 31 + html-test/ref/mini_Bug4.html | 31 + html-test/ref/mini_Bug6.html | 65 + html-test/ref/mini_Bug7.html | 41 + html-test/ref/mini_Bug8.html | 63 + html-test/ref/mini_BugDeprecated.html | 61 + html-test/ref/mini_BugExportHeadings.html | 79 + html-test/ref/mini_Bugs.html | 33 + html-test/ref/mini_CrossPackageDocs.html | 45 + html-test/ref/mini_DeprecatedClass.html | 41 + html-test/ref/mini_DeprecatedData.html | 41 + html-test/ref/mini_DeprecatedFunction.html | 37 + html-test/ref/mini_DeprecatedFunction2.html | 31 + html-test/ref/mini_DeprecatedFunction3.html | 31 + html-test/ref/mini_DeprecatedModule.html | 31 + html-test/ref/mini_DeprecatedModule2.html | 31 + html-test/ref/mini_DeprecatedNewtype.html | 41 + html-test/ref/mini_DeprecatedReExport.html | 37 + html-test/ref/mini_DeprecatedRecord.html | 33 + html-test/ref/mini_DeprecatedTypeFamily.html | 41 + html-test/ref/mini_DeprecatedTypeSynonym.html | 41 + .../ref/mini_DeprecationMessageParseError.html | 31 + html-test/ref/mini_Examples.html | 31 + html-test/ref/mini_FunArgs.html | 37 + html-test/ref/mini_GADTRecords.html | 33 + html-test/ref/mini_Hash.html | 74 + html-test/ref/mini_HiddenInstances.html | 41 + html-test/ref/mini_HiddenInstancesB.html | 41 + html-test/ref/mini_Hyperlinks.html | 31 + html-test/ref/mini_IgnoreExports.html | 37 + html-test/ref/mini_ModuleWithWarning.html | 31 + html-test/ref/mini_NamedDoc.html | 25 + html-test/ref/mini_NoLayout.html | 31 + html-test/ref/mini_NonGreedy.html | 31 + html-test/ref/mini_Properties.html | 31 + html-test/ref/mini_PruneWithWarning.html | 25 + html-test/ref/mini_QuasiExpr.html | 59 + html-test/ref/mini_QuasiQuote.html | 31 + html-test/ref/mini_TH.html | 31 + html-test/ref/mini_TH2.html | 31 + html-test/ref/mini_Test.html | 269 +++ html-test/ref/mini_Ticket112.html | 31 + html-test/ref/mini_Ticket61.html | 33 + html-test/ref/mini_Ticket75.html | 39 + html-test/ref/mini_TypeFamilies.html | 55 + html-test/ref/mini_TypeOperators.html | 66 + html-test/ref/mini_Unicode.html | 31 + html-test/ref/mini_Visible.html | 31 + html-test/runtests.hs | 8 +- html-test/tests/A.html.ref | 183 -- html-test/tests/AdvanceTypes.html.ref | 97 - html-test/tests/B.html.ref | 175 -- html-test/tests/Bug1.html.ref | 103 - html-test/tests/Bug2.html.ref | 65 - html-test/tests/Bug3.html.ref | 83 - html-test/tests/Bug4.html.ref | 82 - html-test/tests/Bug6.html.ref | 335 --- html-test/tests/Bug7.html.ref | 173 -- html-test/tests/Bug8.html.ref | 131 -- html-test/tests/BugDeprecated.html.ref | 198 -- html-test/tests/BugExportHeadings.html.ref | 220 -- html-test/tests/Bugs.html.ref | 81 - html-test/tests/CrossPackageDocs.html.ref | 298 --- html-test/tests/DeprecatedClass.html.ref | 161 -- html-test/tests/DeprecatedData.html.ref | 198 -- html-test/tests/DeprecatedFunction.html.ref | 110 - html-test/tests/DeprecatedFunction2.html.ref | 84 - html-test/tests/DeprecatedFunction3.html.ref | 84 - html-test/tests/DeprecatedModule.html.ref | 83 - html-test/tests/DeprecatedModule2.html.ref | 76 - html-test/tests/DeprecatedNewtype.html.ref | 161 -- html-test/tests/DeprecatedReExport.html.ref | 133 -- html-test/tests/DeprecatedRecord.html.ref | 151 -- html-test/tests/DeprecatedTypeFamily.html.ref | 108 - html-test/tests/DeprecatedTypeSynonym.html.ref | 116 - .../tests/DeprecationMessageParseError.html.ref | 101 - html-test/tests/Examples.html.ref | 179 -- html-test/tests/FunArgs.html.ref | 176 -- html-test/tests/GADTRecords.html.ref | 234 -- html-test/tests/Hash.html.ref | 337 --- html-test/tests/HiddenInstances.html.ref | 169 -- html-test/tests/HiddenInstancesB.html.ref | 143 -- html-test/tests/Hyperlinks.html.ref | 89 - html-test/tests/IgnoreExports.html.ref | 101 - html-test/tests/ModuleWithWarning.html.ref | 83 - html-test/tests/NamedDoc.html.ref | 68 - html-test/tests/NoLayout.html.ref | 86 - html-test/tests/NonGreedy.html.ref | 82 - html-test/tests/Properties.html.ref | 92 - html-test/tests/PruneWithWarning.html.ref | 72 - html-test/tests/QuasiExpr.html.ref | 221 -- html-test/tests/QuasiQuote.html.ref | 65 - html-test/tests/TH.html.ref | 63 - html-test/tests/TH2.html.ref | 63 - html-test/tests/Test.html.ref | 2245 -------------------- html-test/tests/Ticket112.html.ref | 82 - html-test/tests/Ticket61.html.ref | 80 - html-test/tests/Ticket75.html.ref | 116 - html-test/tests/TypeFamilies.html.ref | 212 -- html-test/tests/TypeOperators.html.ref | 185 -- html-test/tests/Unicode.html.ref | 82 - html-test/tests/Visible.html.ref | 67 - html-test/tests/frames.html.ref | 30 - html-test/tests/mini_A.html.ref | 59 - html-test/tests/mini_AdvanceTypes.html.ref | 33 - html-test/tests/mini_B.html.ref | 45 - html-test/tests/mini_Bug1.html.ref | 33 - html-test/tests/mini_Bug2.html.ref | 31 - html-test/tests/mini_Bug3.html.ref | 31 - html-test/tests/mini_Bug4.html.ref | 31 - html-test/tests/mini_Bug6.html.ref | 65 - html-test/tests/mini_Bug7.html.ref | 41 - html-test/tests/mini_Bug8.html.ref | 63 - html-test/tests/mini_BugDeprecated.html.ref | 61 - html-test/tests/mini_BugExportHeadings.html.ref | 79 - html-test/tests/mini_Bugs.html.ref | 33 - html-test/tests/mini_CrossPackageDocs.html.ref | 45 - html-test/tests/mini_DeprecatedClass.html.ref | 41 - html-test/tests/mini_DeprecatedData.html.ref | 41 - html-test/tests/mini_DeprecatedFunction.html.ref | 37 - html-test/tests/mini_DeprecatedFunction2.html.ref | 31 - html-test/tests/mini_DeprecatedFunction3.html.ref | 31 - html-test/tests/mini_DeprecatedModule.html.ref | 31 - html-test/tests/mini_DeprecatedModule2.html.ref | 31 - html-test/tests/mini_DeprecatedNewtype.html.ref | 41 - html-test/tests/mini_DeprecatedReExport.html.ref | 37 - html-test/tests/mini_DeprecatedRecord.html.ref | 33 - html-test/tests/mini_DeprecatedTypeFamily.html.ref | 41 - .../tests/mini_DeprecatedTypeSynonym.html.ref | 41 - .../mini_DeprecationMessageParseError.html.ref | 31 - html-test/tests/mini_Examples.html.ref | 31 - html-test/tests/mini_FunArgs.html.ref | 37 - html-test/tests/mini_GADTRecords.html.ref | 33 - html-test/tests/mini_Hash.html.ref | 74 - html-test/tests/mini_HiddenInstances.html.ref | 41 - html-test/tests/mini_HiddenInstancesB.html.ref | 41 - html-test/tests/mini_Hyperlinks.html.ref | 31 - html-test/tests/mini_IgnoreExports.html.ref | 37 - html-test/tests/mini_ModuleWithWarning.html.ref | 31 - html-test/tests/mini_NamedDoc.html.ref | 25 - html-test/tests/mini_NoLayout.html.ref | 31 - html-test/tests/mini_NonGreedy.html.ref | 31 - html-test/tests/mini_Properties.html.ref | 31 - html-test/tests/mini_PruneWithWarning.html.ref | 25 - html-test/tests/mini_QuasiExpr.html.ref | 59 - html-test/tests/mini_QuasiQuote.html.ref | 31 - html-test/tests/mini_TH.html.ref | 31 - html-test/tests/mini_TH2.html.ref | 31 - html-test/tests/mini_Test.html.ref | 269 --- html-test/tests/mini_Ticket112.html.ref | 31 - html-test/tests/mini_Ticket61.html.ref | 33 - html-test/tests/mini_Ticket75.html.ref | 39 - html-test/tests/mini_TypeFamilies.html.ref | 55 - html-test/tests/mini_TypeOperators.html.ref | 66 - html-test/tests/mini_Unicode.html.ref | 31 - html-test/tests/mini_Visible.html.ref | 31 - 216 files changed, 11540 insertions(+), 11540 deletions(-) create mode 100644 html-test/ref/A.html create mode 100644 html-test/ref/AdvanceTypes.html create mode 100644 html-test/ref/B.html create mode 100644 html-test/ref/Bug1.html create mode 100644 html-test/ref/Bug2.html create mode 100644 html-test/ref/Bug3.html create mode 100644 html-test/ref/Bug4.html create mode 100644 html-test/ref/Bug6.html create mode 100644 html-test/ref/Bug7.html create mode 100644 html-test/ref/Bug8.html create mode 100644 html-test/ref/BugDeprecated.html create mode 100644 html-test/ref/BugExportHeadings.html create mode 100644 html-test/ref/Bugs.html create mode 100644 html-test/ref/CrossPackageDocs.html create mode 100644 html-test/ref/DeprecatedClass.html create mode 100644 html-test/ref/DeprecatedData.html create mode 100644 html-test/ref/DeprecatedFunction.html create mode 100644 html-test/ref/DeprecatedFunction2.html create mode 100644 html-test/ref/DeprecatedFunction3.html create mode 100644 html-test/ref/DeprecatedModule.html create mode 100644 html-test/ref/DeprecatedModule2.html create mode 100644 html-test/ref/DeprecatedNewtype.html create mode 100644 html-test/ref/DeprecatedReExport.html create mode 100644 html-test/ref/DeprecatedRecord.html create mode 100644 html-test/ref/DeprecatedTypeFamily.html create mode 100644 html-test/ref/DeprecatedTypeSynonym.html create mode 100644 html-test/ref/DeprecationMessageParseError.html create mode 100644 html-test/ref/Examples.html create mode 100644 html-test/ref/FunArgs.html create mode 100644 html-test/ref/GADTRecords.html create mode 100644 html-test/ref/Hash.html create mode 100644 html-test/ref/HiddenInstances.html create mode 100644 html-test/ref/HiddenInstancesB.html create mode 100644 html-test/ref/Hyperlinks.html create mode 100644 html-test/ref/IgnoreExports.html create mode 100644 html-test/ref/ModuleWithWarning.html create mode 100644 html-test/ref/NamedDoc.html create mode 100644 html-test/ref/NoLayout.html create mode 100644 html-test/ref/NonGreedy.html create mode 100644 html-test/ref/Properties.html create mode 100644 html-test/ref/PruneWithWarning.html create mode 100644 html-test/ref/QuasiExpr.html create mode 100644 html-test/ref/QuasiQuote.html create mode 100644 html-test/ref/TH.html create mode 100644 html-test/ref/TH2.html create mode 100644 html-test/ref/Test.html create mode 100644 html-test/ref/Ticket112.html create mode 100644 html-test/ref/Ticket61.html create mode 100644 html-test/ref/Ticket75.html create mode 100644 html-test/ref/TypeFamilies.html create mode 100644 html-test/ref/TypeOperators.html create mode 100644 html-test/ref/Unicode.html create mode 100644 html-test/ref/Visible.html create mode 100644 html-test/ref/frames.html create mode 100644 html-test/ref/mini_A.html create mode 100644 html-test/ref/mini_AdvanceTypes.html create mode 100644 html-test/ref/mini_B.html create mode 100644 html-test/ref/mini_Bug1.html create mode 100644 html-test/ref/mini_Bug2.html create mode 100644 html-test/ref/mini_Bug3.html create mode 100644 html-test/ref/mini_Bug4.html create mode 100644 html-test/ref/mini_Bug6.html create mode 100644 html-test/ref/mini_Bug7.html create mode 100644 html-test/ref/mini_Bug8.html create mode 100644 html-test/ref/mini_BugDeprecated.html create mode 100644 html-test/ref/mini_BugExportHeadings.html create mode 100644 html-test/ref/mini_Bugs.html create mode 100644 html-test/ref/mini_CrossPackageDocs.html create mode 100644 html-test/ref/mini_DeprecatedClass.html create mode 100644 html-test/ref/mini_DeprecatedData.html create mode 100644 html-test/ref/mini_DeprecatedFunction.html create mode 100644 html-test/ref/mini_DeprecatedFunction2.html create mode 100644 html-test/ref/mini_DeprecatedFunction3.html create mode 100644 html-test/ref/mini_DeprecatedModule.html create mode 100644 html-test/ref/mini_DeprecatedModule2.html create mode 100644 html-test/ref/mini_DeprecatedNewtype.html create mode 100644 html-test/ref/mini_DeprecatedReExport.html create mode 100644 html-test/ref/mini_DeprecatedRecord.html create mode 100644 html-test/ref/mini_DeprecatedTypeFamily.html create mode 100644 html-test/ref/mini_DeprecatedTypeSynonym.html create mode 100644 html-test/ref/mini_DeprecationMessageParseError.html create mode 100644 html-test/ref/mini_Examples.html create mode 100644 html-test/ref/mini_FunArgs.html create mode 100644 html-test/ref/mini_GADTRecords.html create mode 100644 html-test/ref/mini_Hash.html create mode 100644 html-test/ref/mini_HiddenInstances.html create mode 100644 html-test/ref/mini_HiddenInstancesB.html create mode 100644 html-test/ref/mini_Hyperlinks.html create mode 100644 html-test/ref/mini_IgnoreExports.html create mode 100644 html-test/ref/mini_ModuleWithWarning.html create mode 100644 html-test/ref/mini_NamedDoc.html create mode 100644 html-test/ref/mini_NoLayout.html create mode 100644 html-test/ref/mini_NonGreedy.html create mode 100644 html-test/ref/mini_Properties.html create mode 100644 html-test/ref/mini_PruneWithWarning.html create mode 100644 html-test/ref/mini_QuasiExpr.html create mode 100644 html-test/ref/mini_QuasiQuote.html create mode 100644 html-test/ref/mini_TH.html create mode 100644 html-test/ref/mini_TH2.html create mode 100644 html-test/ref/mini_Test.html create mode 100644 html-test/ref/mini_Ticket112.html create mode 100644 html-test/ref/mini_Ticket61.html create mode 100644 html-test/ref/mini_Ticket75.html create mode 100644 html-test/ref/mini_TypeFamilies.html create mode 100644 html-test/ref/mini_TypeOperators.html create mode 100644 html-test/ref/mini_Unicode.html create mode 100644 html-test/ref/mini_Visible.html delete mode 100644 html-test/tests/A.html.ref delete mode 100644 html-test/tests/AdvanceTypes.html.ref delete mode 100644 html-test/tests/B.html.ref delete mode 100644 html-test/tests/Bug1.html.ref delete mode 100644 html-test/tests/Bug2.html.ref delete mode 100644 html-test/tests/Bug3.html.ref delete mode 100644 html-test/tests/Bug4.html.ref delete mode 100644 html-test/tests/Bug6.html.ref delete mode 100644 html-test/tests/Bug7.html.ref delete mode 100644 html-test/tests/Bug8.html.ref delete mode 100644 html-test/tests/BugDeprecated.html.ref delete mode 100644 html-test/tests/BugExportHeadings.html.ref delete mode 100644 html-test/tests/Bugs.html.ref delete mode 100644 html-test/tests/CrossPackageDocs.html.ref delete mode 100644 html-test/tests/DeprecatedClass.html.ref delete mode 100644 html-test/tests/DeprecatedData.html.ref delete mode 100644 html-test/tests/DeprecatedFunction.html.ref delete mode 100644 html-test/tests/DeprecatedFunction2.html.ref delete mode 100644 html-test/tests/DeprecatedFunction3.html.ref delete mode 100644 html-test/tests/DeprecatedModule.html.ref delete mode 100644 html-test/tests/DeprecatedModule2.html.ref delete mode 100644 html-test/tests/DeprecatedNewtype.html.ref delete mode 100644 html-test/tests/DeprecatedReExport.html.ref delete mode 100644 html-test/tests/DeprecatedRecord.html.ref delete mode 100644 html-test/tests/DeprecatedTypeFamily.html.ref delete mode 100644 html-test/tests/DeprecatedTypeSynonym.html.ref delete mode 100644 html-test/tests/DeprecationMessageParseError.html.ref delete mode 100644 html-test/tests/Examples.html.ref delete mode 100644 html-test/tests/FunArgs.html.ref delete mode 100644 html-test/tests/GADTRecords.html.ref delete mode 100644 html-test/tests/Hash.html.ref delete mode 100644 html-test/tests/HiddenInstances.html.ref delete mode 100644 html-test/tests/HiddenInstancesB.html.ref delete mode 100644 html-test/tests/Hyperlinks.html.ref delete mode 100644 html-test/tests/IgnoreExports.html.ref delete mode 100644 html-test/tests/ModuleWithWarning.html.ref delete mode 100644 html-test/tests/NamedDoc.html.ref delete mode 100644 html-test/tests/NoLayout.html.ref delete mode 100644 html-test/tests/NonGreedy.html.ref delete mode 100644 html-test/tests/Properties.html.ref delete mode 100644 html-test/tests/PruneWithWarning.html.ref delete mode 100644 html-test/tests/QuasiExpr.html.ref delete mode 100644 html-test/tests/QuasiQuote.html.ref delete mode 100644 html-test/tests/TH.html.ref delete mode 100644 html-test/tests/TH2.html.ref delete mode 100644 html-test/tests/Test.html.ref delete mode 100644 html-test/tests/Ticket112.html.ref delete mode 100644 html-test/tests/Ticket61.html.ref delete mode 100644 html-test/tests/Ticket75.html.ref delete mode 100644 html-test/tests/TypeFamilies.html.ref delete mode 100644 html-test/tests/TypeOperators.html.ref delete mode 100644 html-test/tests/Unicode.html.ref delete mode 100644 html-test/tests/Visible.html.ref delete mode 100644 html-test/tests/frames.html.ref delete mode 100644 html-test/tests/mini_A.html.ref delete mode 100644 html-test/tests/mini_AdvanceTypes.html.ref delete mode 100644 html-test/tests/mini_B.html.ref delete mode 100644 html-test/tests/mini_Bug1.html.ref delete mode 100644 html-test/tests/mini_Bug2.html.ref delete mode 100644 html-test/tests/mini_Bug3.html.ref delete mode 100644 html-test/tests/mini_Bug4.html.ref delete mode 100644 html-test/tests/mini_Bug6.html.ref delete mode 100644 html-test/tests/mini_Bug7.html.ref delete mode 100644 html-test/tests/mini_Bug8.html.ref delete mode 100644 html-test/tests/mini_BugDeprecated.html.ref delete mode 100644 html-test/tests/mini_BugExportHeadings.html.ref delete mode 100644 html-test/tests/mini_Bugs.html.ref delete mode 100644 html-test/tests/mini_CrossPackageDocs.html.ref delete mode 100644 html-test/tests/mini_DeprecatedClass.html.ref delete mode 100644 html-test/tests/mini_DeprecatedData.html.ref delete mode 100644 html-test/tests/mini_DeprecatedFunction.html.ref delete mode 100644 html-test/tests/mini_DeprecatedFunction2.html.ref delete mode 100644 html-test/tests/mini_DeprecatedFunction3.html.ref delete mode 100644 html-test/tests/mini_DeprecatedModule.html.ref delete mode 100644 html-test/tests/mini_DeprecatedModule2.html.ref delete mode 100644 html-test/tests/mini_DeprecatedNewtype.html.ref delete mode 100644 html-test/tests/mini_DeprecatedReExport.html.ref delete mode 100644 html-test/tests/mini_DeprecatedRecord.html.ref delete mode 100644 html-test/tests/mini_DeprecatedTypeFamily.html.ref delete mode 100644 html-test/tests/mini_DeprecatedTypeSynonym.html.ref delete mode 100644 html-test/tests/mini_DeprecationMessageParseError.html.ref delete mode 100644 html-test/tests/mini_Examples.html.ref delete mode 100644 html-test/tests/mini_FunArgs.html.ref delete mode 100644 html-test/tests/mini_GADTRecords.html.ref delete mode 100644 html-test/tests/mini_Hash.html.ref delete mode 100644 html-test/tests/mini_HiddenInstances.html.ref delete mode 100644 html-test/tests/mini_HiddenInstancesB.html.ref delete mode 100644 html-test/tests/mini_Hyperlinks.html.ref delete mode 100644 html-test/tests/mini_IgnoreExports.html.ref delete mode 100644 html-test/tests/mini_ModuleWithWarning.html.ref delete mode 100644 html-test/tests/mini_NamedDoc.html.ref delete mode 100644 html-test/tests/mini_NoLayout.html.ref delete mode 100644 html-test/tests/mini_NonGreedy.html.ref delete mode 100644 html-test/tests/mini_Properties.html.ref delete mode 100644 html-test/tests/mini_PruneWithWarning.html.ref delete mode 100644 html-test/tests/mini_QuasiExpr.html.ref delete mode 100644 html-test/tests/mini_QuasiQuote.html.ref delete mode 100644 html-test/tests/mini_TH.html.ref delete mode 100644 html-test/tests/mini_TH2.html.ref delete mode 100644 html-test/tests/mini_Test.html.ref delete mode 100644 html-test/tests/mini_Ticket112.html.ref delete mode 100644 html-test/tests/mini_Ticket61.html.ref delete mode 100644 html-test/tests/mini_Ticket75.html.ref delete mode 100644 html-test/tests/mini_TypeFamilies.html.ref delete mode 100644 html-test/tests/mini_TypeOperators.html.ref delete mode 100644 html-test/tests/mini_Unicode.html.ref delete mode 100644 html-test/tests/mini_Visible.html.ref (limited to 'html-test') diff --git a/html-test/accept.hs b/html-test/accept.hs index 45b32078..82eb3c65 100644 --- a/html-test/accept.hs +++ b/html-test/accept.hs @@ -26,7 +26,7 @@ main = do copy file = do - let new = "tests" takeFileName file <.> ".ref" + let new = "ref" takeFileName file print file print new contents <- readFile file diff --git a/html-test/ref/A.html b/html-test/ref/A.html new file mode 100644 index 00000000..328fec02 --- /dev/null +++ b/html-test/ref/A.html @@ -0,0 +1,183 @@ + +A
    Safe HaskellNone

    A

    Synopsis

    Documentation

    data A

    Constructors

    A 

    test2 :: Bool

    Doc for test2 +

    data X

    Should show up on the page for both modules A and B +

    Constructors

    X

    Doc for consructor +

    reExport :: Int

    Should show up on the page for both modules A and B +

    diff --git a/html-test/ref/AdvanceTypes.html b/html-test/ref/AdvanceTypes.html new file mode 100644 index 00000000..bac545be --- /dev/null +++ b/html-test/ref/AdvanceTypes.html @@ -0,0 +1,97 @@ + +AdvanceTypes
    Safe HaskellNone

    AdvanceTypes

    Documentation

    data Pattern where

    Constructors

    Nil :: Pattern `[]` 
    Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
    diff --git a/html-test/ref/B.html b/html-test/ref/B.html new file mode 100644 index 00000000..410bc75b --- /dev/null +++ b/html-test/ref/B.html @@ -0,0 +1,175 @@ + +B
    Safe HaskellNone

    B

    Synopsis

    Documentation

    module A

    test :: Int

    This link shouldn't work: other. + These links should work: other, sortBy, test2, test2, fromMaybe. + Module link: Prelude. +

    reExport :: Int

    Should show up on the page for both modules A and B +

    data X

    Should show up on the page for both modules A and B +

    Constructors

    X

    Doc for consructor +

    diff --git a/html-test/ref/Bug1.html b/html-test/ref/Bug1.html new file mode 100644 index 00000000..f8a86948 --- /dev/null +++ b/html-test/ref/Bug1.html @@ -0,0 +1,103 @@ + +Bug1
    Safe HaskellNone

    Bug1

    Synopsis

    • data T = T

    Documentation

    data T

    We should have different anchors for constructors and types/classes. This + hyperlink should point to the type constructor by default: T. +

    Constructors

    T 
    diff --git a/html-test/ref/Bug2.html b/html-test/ref/Bug2.html new file mode 100644 index 00000000..813035a6 --- /dev/null +++ b/html-test/ref/Bug2.html @@ -0,0 +1,65 @@ + +Bug2
    Safe HaskellNone

    Bug2

    Documentation

    x :: A

    diff --git a/html-test/ref/Bug3.html b/html-test/ref/Bug3.html new file mode 100644 index 00000000..76d4e730 --- /dev/null +++ b/html-test/ref/Bug3.html @@ -0,0 +1,83 @@ + +Bug3
    Safe HaskellNone

    Bug3

    Synopsis

    Documentation

    foo :: Int

    /multi-line + emphasis/ +

    diff --git a/html-test/ref/Bug4.html b/html-test/ref/Bug4.html new file mode 100644 index 00000000..9e852978 --- /dev/null +++ b/html-test/ref/Bug4.html @@ -0,0 +1,82 @@ + +Bug4
    Safe HaskellNone

    Bug4

    Synopsis

    Documentation

    foo :: Int

    don't use apostrophe's in the wrong place's +

    diff --git a/html-test/ref/Bug6.html b/html-test/ref/Bug6.html new file mode 100644 index 00000000..606e45e3 --- /dev/null +++ b/html-test/ref/Bug6.html @@ -0,0 +1,335 @@ + +Bug6
    Safe HaskellNone

    Bug6

    Description

    Exporting records. +

    Synopsis

    Documentation

    data A

    This record is exported without its field +

    Constructors

    A Int 

    data B

    .. with its field, but the field is named separately in the export list + (the field isn't documented separately since it is already documented here) +

    Constructors

    B 

    Fields

    b :: Int
     

    data C

    .. with fields names as subordinate names in the export +

    Constructors

    C 

    Fields

    c1 :: Int
     
    c2 :: Int
     

    data D

    .. with only some of the fields exported (we can't handle this one - + how do we render the declaration?) +

    Constructors

    D Int Int 

    newtype E

    a newtype with a field +

    Constructors

    E Int 
    diff --git a/html-test/ref/Bug7.html b/html-test/ref/Bug7.html new file mode 100644 index 00000000..8ac72b16 --- /dev/null +++ b/html-test/ref/Bug7.html @@ -0,0 +1,173 @@ + +Bug7
    Safe HaskellNone

    Bug7

    Description

    This module caused a duplicate instance in the documentation for the Foo + type. +

    Synopsis

    Documentation

    data Foo

    The Foo datatype +

    Constructors

    Foo 

    Instances

    Bar Foo Foo

    Just one instance +

    class Bar x y

    The Bar class +

    Instances

    Bar Foo Foo

    Just one instance +

    diff --git a/html-test/ref/Bug8.html b/html-test/ref/Bug8.html new file mode 100644 index 00000000..469151f1 --- /dev/null +++ b/html-test/ref/Bug8.html @@ -0,0 +1,131 @@ + +Bug8
    Safe HaskellNone

    Bug8

    Documentation

    data Typ

    Constructors

    Type (String, [Typ]) 
    TFree (String, [String]) 

    (-->) :: t -> t1 -> Typ

    (--->) :: [a] -> Typ -> Typ

    s :: a

    t :: a

    main :: a

    diff --git a/html-test/ref/BugDeprecated.html b/html-test/ref/BugDeprecated.html new file mode 100644 index 00000000..913b189d --- /dev/null +++ b/html-test/ref/BugDeprecated.html @@ -0,0 +1,198 @@ + +BugDeprecated
    Safe HaskellNone

    BugDeprecated

    Synopsis

    Documentation

    foo :: Int

    Deprecated: for foo +

    baz :: Int

    Deprecated: for baz +

    bar :: Int

    Deprecated: for bar +

    one :: Int

    Deprecated: for one +

    some documentation for one, two and three +

    three :: Int

    Deprecated: for three +

    some documentation for one, two and three +

    two :: Int

    Deprecated: for two +

    some documentation for one, two and three +

    diff --git a/html-test/ref/BugExportHeadings.html b/html-test/ref/BugExportHeadings.html new file mode 100644 index 00000000..457e2c50 --- /dev/null +++ b/html-test/ref/BugExportHeadings.html @@ -0,0 +1,220 @@ + +BugExportHeadings
    Safe HaskellNone

    BugExportHeadings

    Synopsis

    Foo +

    foo :: Int

    Bar +

    bar :: Int

    Baz +

    baz :: Int

    One +

    one :: Int

    Deprecated: for one +

    Two +

    two :: Int

    Deprecated: for two +

    Three +

    three :: Int

    Deprecated: for three +

    diff --git a/html-test/ref/Bugs.html b/html-test/ref/Bugs.html new file mode 100644 index 00000000..c5a4ca9d --- /dev/null +++ b/html-test/ref/Bugs.html @@ -0,0 +1,81 @@ + +Bugs
    Safe HaskellNone

    Bugs

    Documentation

    data A a

    Constructors

    A a (a -> Int) 
    diff --git a/html-test/ref/CrossPackageDocs.html b/html-test/ref/CrossPackageDocs.html new file mode 100644 index 00000000..fea3d0cc --- /dev/null +++ b/html-test/ref/CrossPackageDocs.html @@ -0,0 +1,298 @@ + +CrossPackageDocs
    Safe HaskellNone

    CrossPackageDocs

    Synopsis

    Documentation

    map :: (a -> b) -> [a] -> [b]

    map f xs is the list obtained by applying f to each element + of xs, i.e., +

     map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
    + map f [x1, x2, ...] == [f x1, f x2, ...]
    +

    class IsString a where

    Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC). +

    Methods

    fromString :: String -> a

    Instances

    runInteractiveProcess

    Arguments

    :: FilePath

    Filename of the executable (see proc for details) +

    -> [String]

    Arguments to pass to the executable +

    -> Maybe FilePath

    Optional path to the working directory +

    -> Maybe [(String, String)]

    Optional environment (otherwise inherit) +

    -> IO (Handle, Handle, Handle, ProcessHandle) 

    Runs a raw command, and returns Handles that may be used to communicate + with the process via its stdin, stdout and stderr respectively. +

    For example, to start a process and feed a string to its stdin: +

       (inp,out,err,pid) <- runInteractiveProcess "..."
    +   forkIO (hPutStr inp str)
    +

    The Handles are initially in binary mode; if you need them to be + in text mode then use hSetBinaryMode. +

    diff --git a/html-test/ref/DeprecatedClass.html b/html-test/ref/DeprecatedClass.html new file mode 100644 index 00000000..d716c1d8 --- /dev/null +++ b/html-test/ref/DeprecatedClass.html @@ -0,0 +1,161 @@ + +DeprecatedClass
    Safe HaskellNone

    DeprecatedClass

    Synopsis

    Documentation

    class SomeClass a where

    Deprecated: SomeClass +

    some class +

    Methods

    foo :: a -> a

    Deprecated: foo +

    documentation for foo +

    class SomeOtherClass a where

    Deprecated: SomeOtherClass +

    Methods

    bar :: a -> a

    Deprecated: bar +

    diff --git a/html-test/ref/DeprecatedData.html b/html-test/ref/DeprecatedData.html new file mode 100644 index 00000000..24758345 --- /dev/null +++ b/html-test/ref/DeprecatedData.html @@ -0,0 +1,198 @@ + +DeprecatedData
    Safe HaskellNone

    DeprecatedData

    Synopsis

    Documentation

    data Foo

    Deprecated: Foo +

    type Foo +

    Constructors

    Foo

    Deprecated: Foo +

    constructor Foo +

    Bar

    Deprecated: Bar +

    constructor Bar +

    data One

    Deprecated: One +

    Constructors

    One

    Deprecated: One +

    Two

    Deprecated: Two +

    diff --git a/html-test/ref/DeprecatedFunction.html b/html-test/ref/DeprecatedFunction.html new file mode 100644 index 00000000..1fc678bb --- /dev/null +++ b/html-test/ref/DeprecatedFunction.html @@ -0,0 +1,110 @@ + +DeprecatedFunction
    Safe HaskellNone

    DeprecatedFunction

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    bar :: Int

    some documentation for bar +

    diff --git a/html-test/ref/DeprecatedFunction2.html b/html-test/ref/DeprecatedFunction2.html new file mode 100644 index 00000000..b5068c8e --- /dev/null +++ b/html-test/ref/DeprecatedFunction2.html @@ -0,0 +1,84 @@ + +DeprecatedFunction2
    Safe HaskellNone

    DeprecatedFunction2

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    diff --git a/html-test/ref/DeprecatedFunction3.html b/html-test/ref/DeprecatedFunction3.html new file mode 100644 index 00000000..f24eb666 --- /dev/null +++ b/html-test/ref/DeprecatedFunction3.html @@ -0,0 +1,84 @@ + +DeprecatedFunction3
    Safe HaskellNone

    DeprecatedFunction3

    Synopsis

    Documentation

    foo :: Integer

    Deprecated: use bar instead +

    diff --git a/html-test/ref/DeprecatedModule.html b/html-test/ref/DeprecatedModule.html new file mode 100644 index 00000000..0ca4fafe --- /dev/null +++ b/html-test/ref/DeprecatedModule.html @@ -0,0 +1,83 @@ + +DeprecatedModule
    Safe HaskellNone

    DeprecatedModule

    Description

    Deprecated: Use Foo instead +

    Documentation for DeprecatedModule. +

    Documentation

    foo :: Int

    diff --git a/html-test/ref/DeprecatedModule2.html b/html-test/ref/DeprecatedModule2.html new file mode 100644 index 00000000..0a313ae9 --- /dev/null +++ b/html-test/ref/DeprecatedModule2.html @@ -0,0 +1,76 @@ + +DeprecatedModule2
    Safe HaskellNone

    DeprecatedModule2

    Description

    Deprecated: Use Foo instead +

    Documentation

    foo :: Int

    diff --git a/html-test/ref/DeprecatedNewtype.html b/html-test/ref/DeprecatedNewtype.html new file mode 100644 index 00000000..521ffb92 --- /dev/null +++ b/html-test/ref/DeprecatedNewtype.html @@ -0,0 +1,161 @@ + +DeprecatedNewtype
    Safe HaskellNone

    DeprecatedNewtype

    Documentation

    newtype SomeNewType

    Deprecated: SomeNewType +

    some documentation +

    Constructors

    SomeNewTypeConst String

    Deprecated: SomeNewTypeConst +

    constructor docu +

    newtype SomeOtherNewType

    Deprecated: SomeOtherNewType +

    Constructors

    SomeOtherNewTypeConst String

    Deprecated: SomeOtherNewTypeConst +

    diff --git a/html-test/ref/DeprecatedReExport.html b/html-test/ref/DeprecatedReExport.html new file mode 100644 index 00000000..611c181d --- /dev/null +++ b/html-test/ref/DeprecatedReExport.html @@ -0,0 +1,133 @@ + +DeprecatedReExport
    Safe HaskellNone

    DeprecatedReExport

    Description

    What is tested here: +

    • Deprecation messages are shown for re-exported items. +

    Synopsis

    Re-exported from an other module +

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    Re-exported from an other package +

    Not yet working, see http://trac.haskell.org/haddock/ticket/223 + , isEmptyChan +

    diff --git a/html-test/ref/DeprecatedRecord.html b/html-test/ref/DeprecatedRecord.html new file mode 100644 index 00000000..9ade8377 --- /dev/null +++ b/html-test/ref/DeprecatedRecord.html @@ -0,0 +1,151 @@ + +DeprecatedRecord
    Safe HaskellNone

    DeprecatedRecord

    Synopsis

    Documentation

    data Foo

    type Foo +

    Constructors

    Foo 

    Fields

    fooName :: String

    some name +

    fooValue :: Int

    Deprecated: do not use this +

    some value +

    diff --git a/html-test/ref/DeprecatedTypeFamily.html b/html-test/ref/DeprecatedTypeFamily.html new file mode 100644 index 00000000..ffc069a6 --- /dev/null +++ b/html-test/ref/DeprecatedTypeFamily.html @@ -0,0 +1,108 @@ + +DeprecatedTypeFamily
    Safe HaskellNone

    DeprecatedTypeFamily

    Synopsis

    Documentation

    data family SomeTypeFamily k :: * -> *

    Deprecated: SomeTypeFamily +

    some documentation +

    data family SomeOtherTypeFamily k :: * -> *

    Deprecated: SomeOtherTypeFamily +

    diff --git a/html-test/ref/DeprecatedTypeSynonym.html b/html-test/ref/DeprecatedTypeSynonym.html new file mode 100644 index 00000000..665dcf5d --- /dev/null +++ b/html-test/ref/DeprecatedTypeSynonym.html @@ -0,0 +1,116 @@ + +DeprecatedTypeSynonym
    Safe HaskellNone

    DeprecatedTypeSynonym

    Synopsis

    Documentation

    type TypeSyn = String

    Deprecated: TypeSyn +

    some documentation +

    type OtherTypeSyn = String

    Deprecated: OtherTypeSyn +

    diff --git a/html-test/ref/DeprecationMessageParseError.html b/html-test/ref/DeprecationMessageParseError.html new file mode 100644 index 00000000..75f9bf54 --- /dev/null +++ b/html-test/ref/DeprecationMessageParseError.html @@ -0,0 +1,101 @@ + +DeprecationMessageParseError
    Safe HaskellNone

    DeprecationMessageParseError

    Description

    What is tested here: +

    • If parsing of a deprecation message fails, the message is included + verbatim. +

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use @bar instead

    some documentation for foo +

    diff --git a/html-test/ref/Examples.html b/html-test/ref/Examples.html new file mode 100644 index 00000000..7ebe7770 --- /dev/null +++ b/html-test/ref/Examples.html @@ -0,0 +1,179 @@ + +Examples
    Safe HaskellNone

    Examples

    Synopsis

    Documentation

    fib :: Integer -> Integer

    Fibonacci number of given Integer. +

    Examples: +

    >>> fib 5
    +5
    +>>> fib 10
    +55
    +
    >>> fib 10
    +55
    +

    One more Example: +

    >>> fib 5
    +5
    +

    One more Example: +

    >>> fib 5
    +5
    +

    Example with an import: +

    >>> import Data.Char
    +>>> isSpace 'a'
    +False
    +
    >>> putStrLn "foo\n\nbar"
    +foo
    +
    +bar
    +
    diff --git a/html-test/ref/FunArgs.html b/html-test/ref/FunArgs.html new file mode 100644 index 00000000..6c87d1e6 --- /dev/null +++ b/html-test/ref/FunArgs.html @@ -0,0 +1,176 @@ + +FunArgs
    Safe HaskellNone

    FunArgs

    Documentation

    f

    Arguments

    :: forall a . Ord a 
    => Int

    First argument +

    -> a

    Second argument +

    -> Bool

    Third argument +

    -> (a -> a)

    Fourth argument +

    -> ()

    Result +

    g

    Arguments

    :: a

    First argument +

    -> b

    Second argument +

    -> c

    Third argument +

    -> d

    Result +

    diff --git a/html-test/ref/GADTRecords.html b/html-test/ref/GADTRecords.html new file mode 100644 index 00000000..e3fcd2fe --- /dev/null +++ b/html-test/ref/GADTRecords.html @@ -0,0 +1,234 @@ + +GADTRecords
    Safe HaskellNone

    GADTRecords

    Synopsis

    Documentation

    data H1 a b where

    h1 +

    Constructors

    C1 :: H1 a b 
    C2 :: Ord a => [a] -> H1 a a 
    C3 :: Int -> H1 Int Int 

    Fields

    field :: Int

    hello docs +

    C4 :: a -> H1 Int a 

    Fields

    field2 :: a

    hello2 docs +

    diff --git a/html-test/ref/Hash.html b/html-test/ref/Hash.html new file mode 100644 index 00000000..b0cd183c --- /dev/null +++ b/html-test/ref/Hash.html @@ -0,0 +1,337 @@ + +Hash
    Safe HaskellNone

    Hash

    Description

    Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +

    Synopsis

    The HashTable type +

    data HashTable key val

    A hash table with keys of type key and values of type val. + The type key should be an instance of Eq. +

    Operations on HashTables +

    new :: (Eq key, Hash key) => Int -> IO (HashTable key val)

    Builds a new hash table with a given size +

    insert :: (Eq key, Hash key) => key -> val -> IO ()

    Inserts a new element into the hash table +

    lookup :: Hash key => key -> IO (Maybe val)

    Looks up a key in the hash table, returns Just val if the key + was found, or Nothing otherwise. +

    The Hash class +

    class Hash a where

    A class of types which can be hashed. +

    Methods

    hash :: a -> Int

    hashes the value of type a into an Int +

    Instances

    Hash Float 
    Hash Int 
    (Hash a, Hash b) => Hash (a, b) 
    diff --git a/html-test/ref/HiddenInstances.html b/html-test/ref/HiddenInstances.html new file mode 100644 index 00000000..999c114d --- /dev/null +++ b/html-test/ref/HiddenInstances.html @@ -0,0 +1,169 @@ + +HiddenInstances
    Safe HaskellNone

    HiddenInstances

    Synopsis

    Documentation

    class VisibleClass a

    Should be visible +

    Instances

    VisibleClass Int

    Should be visible +

    VisibleClass VisibleData

    Should be visible +

    data VisibleData

    Should be visible +

    Instances

    Num VisibleData

    Should be visible +

    VisibleClass VisibleData

    Should be visible +

    diff --git a/html-test/ref/HiddenInstancesB.html b/html-test/ref/HiddenInstancesB.html new file mode 100644 index 00000000..207a5146 --- /dev/null +++ b/html-test/ref/HiddenInstancesB.html @@ -0,0 +1,143 @@ + +HiddenInstancesB
    Safe HaskellNone

    HiddenInstancesB

    Synopsis

    Documentation

    class Foo a

    Should be visible +

    Instances

    Foo Bar

    Should be visible +

    data Bar

    Should be visible +

    Instances

    Foo Bar

    Should be visible +

    diff --git a/html-test/ref/Hyperlinks.html b/html-test/ref/Hyperlinks.html new file mode 100644 index 00000000..e7351a63 --- /dev/null +++ b/html-test/ref/Hyperlinks.html @@ -0,0 +1,89 @@ + +Hyperlinks
    Safe HaskellNone

    Hyperlinks

    Synopsis

    Documentation

    foo :: Int

    A plain URL: http://example.com/ +

    A URL with a label: some link +

    diff --git a/html-test/ref/IgnoreExports.html b/html-test/ref/IgnoreExports.html new file mode 100644 index 00000000..c661b48c --- /dev/null +++ b/html-test/ref/IgnoreExports.html @@ -0,0 +1,101 @@ + +IgnoreExports
    Safe HaskellNone

    IgnoreExports

    Synopsis

    Documentation

    foo :: Int

    documentation for foo +

    bar :: Int

    documentation for bar +

    diff --git a/html-test/ref/ModuleWithWarning.html b/html-test/ref/ModuleWithWarning.html new file mode 100644 index 00000000..348f0822 --- /dev/null +++ b/html-test/ref/ModuleWithWarning.html @@ -0,0 +1,83 @@ + +ModuleWithWarning
    Safe HaskellNone

    ModuleWithWarning

    Description

    Warning: This is an unstable interface. Prefer functions from Prelude instead! +

    Documentation for ModuleWithWarning. +

    Documentation

    foo :: Int

    diff --git a/html-test/ref/NamedDoc.html b/html-test/ref/NamedDoc.html new file mode 100644 index 00000000..d2b8ede1 --- /dev/null +++ b/html-test/ref/NamedDoc.html @@ -0,0 +1,68 @@ + +NamedDoc
    Safe HaskellNone

    NamedDoc

    Synopsis

      Documentation

      bar +

      diff --git a/html-test/ref/NoLayout.html b/html-test/ref/NoLayout.html new file mode 100644 index 00000000..871add05 --- /dev/null +++ b/html-test/ref/NoLayout.html @@ -0,0 +1,86 @@ + +NoLayout
      Safe HaskellNone

      NoLayout

      Synopsis

      Documentation

      g :: Int

      the function g +

      diff --git a/html-test/ref/NonGreedy.html b/html-test/ref/NonGreedy.html new file mode 100644 index 00000000..23d3f695 --- /dev/null +++ b/html-test/ref/NonGreedy.html @@ -0,0 +1,82 @@ + +NonGreedy
      Safe HaskellNone

      NonGreedy

      Synopsis

      • f :: a

      Documentation

      f :: a

      diff --git a/html-test/ref/Properties.html b/html-test/ref/Properties.html new file mode 100644 index 00000000..1c4ce893 --- /dev/null +++ b/html-test/ref/Properties.html @@ -0,0 +1,92 @@ + +Properties
      Safe HaskellNone

      Properties

      Synopsis

      Documentation

      fib :: Integer -> Integer

      Fibonacci number of given Integer. +

      fib n <= fib (n + 1)
      diff --git a/html-test/ref/PruneWithWarning.html b/html-test/ref/PruneWithWarning.html new file mode 100644 index 00000000..3c31fbdf --- /dev/null +++ b/html-test/ref/PruneWithWarning.html @@ -0,0 +1,72 @@ + +PruneWithWarning
      Safe HaskellNone

      PruneWithWarning

      Description

      What is tested here: +

      • If a binding has a deprecation message but no documentation, it is pruned + when OPTIONS_HADDOCK prune is used. +
      diff --git a/html-test/ref/QuasiExpr.html b/html-test/ref/QuasiExpr.html new file mode 100644 index 00000000..0a699f35 --- /dev/null +++ b/html-test/ref/QuasiExpr.html @@ -0,0 +1,221 @@ + +QuasiExpr
      Safe HaskellNone

      QuasiExpr

      Documentation

      data BinOp

      Constructors

      AddOp 
      SubOp 
      MulOp 
      DivOp 

      Instances

      expr :: QuasiQuoter

      parseExprExp :: String -> Q Exp

      diff --git a/html-test/ref/QuasiQuote.html b/html-test/ref/QuasiQuote.html new file mode 100644 index 00000000..f61f2b84 --- /dev/null +++ b/html-test/ref/QuasiQuote.html @@ -0,0 +1,65 @@ + +QuasiQuote
      Safe HaskellNone

      QuasiQuote

      Documentation

      diff --git a/html-test/ref/TH.html b/html-test/ref/TH.html new file mode 100644 index 00000000..086d6a4a --- /dev/null +++ b/html-test/ref/TH.html @@ -0,0 +1,63 @@ + +TH
      Safe HaskellNone

      TH

      Documentation

      decl :: Q [Dec]

      diff --git a/html-test/ref/TH2.html b/html-test/ref/TH2.html new file mode 100644 index 00000000..4d4a8914 --- /dev/null +++ b/html-test/ref/TH2.html @@ -0,0 +1,63 @@ + +TH2
      Safe HaskellNone

      TH2

      Documentation

      f :: t -> t

      diff --git a/html-test/ref/Test.html b/html-test/ref/Test.html new file mode 100644 index 00000000..f2ef2b28 --- /dev/null +++ b/html-test/ref/Test.html @@ -0,0 +1,2245 @@ + +Test
      Portabilityportable
      Stabilityprovisional
      Maintainerlibraries@haskell.org
      Safe HaskellNone

      Test

      Description

      This module illustrates & tests most of the features of Haddock. + Testing references from the description: T, f, g, visible. +

      Synopsis

      Type declarations +

      Data types +

      data T a b

      This comment applies to the following declaration + and it continues until the next non-comment line +

      Constructors

      A Int (Maybe Float)

      This comment describes the A constructor +

      B (T a b, T Int Float)

      This comment describes the B constructor +

      data T2 a b

      An abstract data declaration +

      data T3 a b

      A data declaration with no documentation annotations on the constructors +

      Constructors

      A1 a 
      B1 b 

      data T4 a b

      Constructors

      A2 a 
      B2 b 

      data T5 a b

      Constructors

      A3 a

      documents A3 +

      B3 b

      documents B3 +

      data T6

      Testing alternative comment styles +

      Constructors

      A4

      This is the doc for A4 +

      B4

      This is the doc for B4 +

      C4

      This is the doc for C4 +

      newtype N1 a

      A newtype +

      Constructors

      N1 a 

      newtype N2 a b

      A newtype with a fieldname +

      Constructors

      N2 

      Fields

      n :: a b
       

      newtype N3 a b

      A newtype with a fieldname, documentation on the field +

      Constructors

      N3 

      Fields

      n3 :: a b

      this is the n3 field +

      data N4 a b

      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 N5 a b

      Constructors

      N5 

      Fields

      n5 :: a b

      no docs on the datatype or the constructor +

      newtype N6 a b

      Constructors

      N6

      docs on the constructor only +

      Fields

      n6 :: a b
       

      newtype N7 a b

      docs on the newtype and the constructor +

      Constructors

      N7

      The N7 constructor +

      Fields

      n7 :: a b
       

      Records +

      data R

      This is the documentation for the R record, which has four fields, + p, q, r, and s. +

      Constructors

      C1

      This is the C1 record constructor, with the following fields: +

      Fields

      p :: Int

      This comment applies to the p field +

      q :: forall a. a -> a

      This comment applies to the q field +

      r :: Int

      This comment applies to both r and s +

      s :: Int

      This comment applies to both r and s +

      C2

      This is the C2 record constructor, also with some fields: +

      Fields

      t :: T1 -> T2 Int Int -> T3 Bool Bool -> T4 Float Float -> T5 () ()
       
      u :: Int
       
      v :: Int
       

      data R1

      Testing different record commenting styles +

      Constructors

      C3

      This is the C3 record constructor +

      Fields

      s1 :: Int

      The s1 record selector +

      s2 :: Int

      The s2 record selector +

      s3 :: Int

      The s3 record selector +

      test that we can export record selectors on their own: +

      Class declarations +

      class D a => C a where

      This comment applies to the previous declaration (the C class) +

      Methods

      a :: IO a

      this is a description of the a method +

      b :: [a]

      this is a description of the b method +

      class D a where

      This is a class declaration with no separate docs for the methods +

      Methods

      d :: T a b

      e :: (a, a)

      Instances

      class E a

      This is a class declaration with no methods (or no methods exported) +

      class F a where

      Methods

      ff :: a

      Test that we can export a class method on its own: +

      Function types +

      f :: C a => a -> Int

      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) +
      cat
      a small, furry, domesticated mammal +
      pineapple
      a fruit grown in the tropics +
      +     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/. +

      g :: Int -> IO CInt

      we can export foreign declarations too +

      Auxiliary stuff +

      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

      This is some documentation that is attached to a name ($aux2) +

       code block on its own in named doc
       code block on its own in named doc (after newline)

      a nested, named doc comment +

      with a paragraph, +

       and a code block
      test
      +test1
      +
       test2
      +  test3
      +
      +test1
      +test2
      +
      test3
      +test4
      +
      +test1
      +test2
      +
      test3
      +test4
      +
      test3
      +test4
      +
      +test1
      +test2
      +

      aux11: +

      test3
      +test4
      +
      +test1
      +test2
      +
       foo
      +
       bar
      +

      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 +

      hidden :: Int -> Int

      A visible module +

      module Visible

      nested-style doc comments +

      Existential / Universal types +

      data Ex a

      A data-type using existential/universal types +

      Constructors

      forall b . C b => Ex1 b 
      forall b . Ex2 b 
      forall b . C a => Ex3 b 
      Ex4 (forall a. a -> a) 

      Type signatures with argument docs +

      k

      Arguments

      :: 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 is a function with documentation for each argument +

      l

      Arguments

      :: (Int, Int, Float)

      takes a triple +

      -> Int

      returns an Int +

      m

      Arguments

      :: R 
      -> N1 ()

      one of the arguments +

      -> IO Int

      and the return value +

      This function has some arg docs +

      o

      Arguments

      :: Float

      The input float +

      -> IO Float

      The output float +

      A foreign import with argument docs +

      A section +

      A subsection +

       a literal line
      +

      $ a non literal line $ +

      f' :: Int

      a function with a prime can be referred to as f' + but f' doesn't get link'd 'f\'' +

      withType :: Int

      Comment on a definition with type signature +

      withoutType :: a

      Comment on a definition without type signature +

      diff --git a/html-test/ref/Ticket112.html b/html-test/ref/Ticket112.html new file mode 100644 index 00000000..c5c61703 --- /dev/null +++ b/html-test/ref/Ticket112.html @@ -0,0 +1,82 @@ + +Ticket112
      Safe HaskellNone

      Ticket112

      Synopsis

      • f :: a

      Documentation

      f :: a

      ...given a raw Addr# to the string, and the length of the string. +

      diff --git a/html-test/ref/Ticket61.html b/html-test/ref/Ticket61.html new file mode 100644 index 00000000..8c22488b --- /dev/null +++ b/html-test/ref/Ticket61.html @@ -0,0 +1,80 @@ + +Ticket61
      Safe HaskellNone

      Ticket61

      Documentation

      class C a where

      Methods

      f :: a

      A comment about f +

      diff --git a/html-test/ref/Ticket75.html b/html-test/ref/Ticket75.html new file mode 100644 index 00000000..cd510ea5 --- /dev/null +++ b/html-test/ref/Ticket75.html @@ -0,0 +1,116 @@ + +Ticket75
      Safe HaskellNone

      Ticket75

      Synopsis

      Documentation

      data a :- b

      Constructors

      Q 

      f :: Int

      A reference to :- +

      diff --git a/html-test/ref/TypeFamilies.html b/html-test/ref/TypeFamilies.html new file mode 100644 index 00000000..196d60ec --- /dev/null +++ b/html-test/ref/TypeFamilies.html @@ -0,0 +1,212 @@ + +TypeFamilies
      Safe HaskellNone

      TypeFamilies

      Synopsis

      Documentation

      type family G a :: *

      Type family G +

      class A a where

      A class with an associated type +

      Associated Types

      data B a :: * -> *

      An associated type +

      Methods

      f :: B a Int

      A method +

      Instances

      A Int 

      type family F a

      Doc for family +

      diff --git a/html-test/ref/TypeOperators.html b/html-test/ref/TypeOperators.html new file mode 100644 index 00000000..2b18727f --- /dev/null +++ b/html-test/ref/TypeOperators.html @@ -0,0 +1,185 @@ + +TypeOperators
      Safe HaskellNone

      TypeOperators

      Contents

      Synopsis

      • data a :-: b
      • data (a :+: b) c
      • data Op a b
      • newtype O g f a = O {}
      • biO :: (g `O` f) a

      stuff +

      data a :-: b

      data (a :+: b) c

      data Op a b

      newtype O g f a

      Constructors

      O 

      Fields

      unO :: g (f a)
       

      biO :: (g `O` f) a

      diff --git a/html-test/ref/Unicode.html b/html-test/ref/Unicode.html new file mode 100644 index 00000000..13ef6c1e --- /dev/null +++ b/html-test/ref/Unicode.html @@ -0,0 +1,82 @@ + +Unicode
      Safe HaskellNone

      Unicode

      Synopsis

      Documentation

      x :: Int

      γλώσσα +

      diff --git a/html-test/ref/Visible.html b/html-test/ref/Visible.html new file mode 100644 index 00000000..de8b8d80 --- /dev/null +++ b/html-test/ref/Visible.html @@ -0,0 +1,67 @@ + +Visible
      Safe HaskellNone

      Visible

      Documentation

      diff --git a/html-test/ref/frames.html b/html-test/ref/frames.html new file mode 100644 index 00000000..1b4e38d4 --- /dev/null +++ b/html-test/ref/frames.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/html-test/ref/mini_A.html b/html-test/ref/mini_A.html new file mode 100644 index 00000000..cbe50e41 --- /dev/null +++ b/html-test/ref/mini_A.html @@ -0,0 +1,59 @@ + +A

      A

      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 @@ + +AdvanceTypes

      AdvanceTypes

      data Pattern

      diff --git a/html-test/ref/mini_B.html b/html-test/ref/mini_B.html new file mode 100644 index 00000000..211a7deb --- /dev/null +++ b/html-test/ref/mini_B.html @@ -0,0 +1,45 @@ + +B

      B

      diff --git a/html-test/ref/mini_Bug1.html b/html-test/ref/mini_Bug1.html new file mode 100644 index 00000000..adf81c73 --- /dev/null +++ b/html-test/ref/mini_Bug1.html @@ -0,0 +1,33 @@ + +Bug1

      Bug1

      data T

      diff --git a/html-test/ref/mini_Bug2.html b/html-test/ref/mini_Bug2.html new file mode 100644 index 00000000..b673e459 --- /dev/null +++ b/html-test/ref/mini_Bug2.html @@ -0,0 +1,31 @@ + +Bug2

      Bug2

      diff --git a/html-test/ref/mini_Bug3.html b/html-test/ref/mini_Bug3.html new file mode 100644 index 00000000..af4cc445 --- /dev/null +++ b/html-test/ref/mini_Bug3.html @@ -0,0 +1,31 @@ + +Bug3

      Bug3

      diff --git a/html-test/ref/mini_Bug4.html b/html-test/ref/mini_Bug4.html new file mode 100644 index 00000000..b403e94a --- /dev/null +++ b/html-test/ref/mini_Bug4.html @@ -0,0 +1,31 @@ + +Bug4

      Bug4

      diff --git a/html-test/ref/mini_Bug6.html b/html-test/ref/mini_Bug6.html new file mode 100644 index 00000000..5c5c1119 --- /dev/null +++ b/html-test/ref/mini_Bug6.html @@ -0,0 +1,65 @@ + +Bug6

      Bug6

      data A

      data B

      data C

      data D

      data E

      diff --git a/html-test/ref/mini_Bug7.html b/html-test/ref/mini_Bug7.html new file mode 100644 index 00000000..1bec82ee --- /dev/null +++ b/html-test/ref/mini_Bug7.html @@ -0,0 +1,41 @@ + +Bug7

      Bug7

      data Foo

      class Bar x y

      diff --git a/html-test/ref/mini_Bug8.html b/html-test/ref/mini_Bug8.html new file mode 100644 index 00000000..070dbcf8 --- /dev/null +++ b/html-test/ref/mini_Bug8.html @@ -0,0 +1,63 @@ + +Bug8

      Bug8

      diff --git a/html-test/ref/mini_BugDeprecated.html b/html-test/ref/mini_BugDeprecated.html new file mode 100644 index 00000000..f0410137 --- /dev/null +++ b/html-test/ref/mini_BugDeprecated.html @@ -0,0 +1,61 @@ + +BugDeprecated

      BugDeprecated

      diff --git a/html-test/ref/mini_BugExportHeadings.html b/html-test/ref/mini_BugExportHeadings.html new file mode 100644 index 00000000..b481720d --- /dev/null +++ b/html-test/ref/mini_BugExportHeadings.html @@ -0,0 +1,79 @@ + +BugExportHeadings

      BugExportHeadings

      Foo +

      Bar +

      Baz +

      One +

      Two +

      Three +

      diff --git a/html-test/ref/mini_Bugs.html b/html-test/ref/mini_Bugs.html new file mode 100644 index 00000000..3c758375 --- /dev/null +++ b/html-test/ref/mini_Bugs.html @@ -0,0 +1,33 @@ + +Bugs

      Bugs

      data A a

      diff --git a/html-test/ref/mini_CrossPackageDocs.html b/html-test/ref/mini_CrossPackageDocs.html new file mode 100644 index 00000000..4c0588ba --- /dev/null +++ b/html-test/ref/mini_CrossPackageDocs.html @@ -0,0 +1,45 @@ + +CrossPackageDocs

      CrossPackageDocs

      diff --git a/html-test/ref/mini_DeprecatedClass.html b/html-test/ref/mini_DeprecatedClass.html new file mode 100644 index 00000000..3923c1ff --- /dev/null +++ b/html-test/ref/mini_DeprecatedClass.html @@ -0,0 +1,41 @@ + +DeprecatedClass

      DeprecatedClass

      class SomeClass a

      diff --git a/html-test/ref/mini_DeprecatedData.html b/html-test/ref/mini_DeprecatedData.html new file mode 100644 index 00000000..8ef20113 --- /dev/null +++ b/html-test/ref/mini_DeprecatedData.html @@ -0,0 +1,41 @@ + +DeprecatedData

      DeprecatedData

      data Foo

      data One

      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 @@ + +DeprecatedFunction

      DeprecatedFunction

      diff --git a/html-test/ref/mini_DeprecatedFunction2.html b/html-test/ref/mini_DeprecatedFunction2.html new file mode 100644 index 00000000..a03991a9 --- /dev/null +++ b/html-test/ref/mini_DeprecatedFunction2.html @@ -0,0 +1,31 @@ + +DeprecatedFunction2

      DeprecatedFunction2

      diff --git a/html-test/ref/mini_DeprecatedFunction3.html b/html-test/ref/mini_DeprecatedFunction3.html new file mode 100644 index 00000000..4ea60339 --- /dev/null +++ b/html-test/ref/mini_DeprecatedFunction3.html @@ -0,0 +1,31 @@ + +DeprecatedFunction3

      DeprecatedFunction3

      diff --git a/html-test/ref/mini_DeprecatedModule.html b/html-test/ref/mini_DeprecatedModule.html new file mode 100644 index 00000000..bfdef611 --- /dev/null +++ b/html-test/ref/mini_DeprecatedModule.html @@ -0,0 +1,31 @@ + +DeprecatedModule

      DeprecatedModule

      diff --git a/html-test/ref/mini_DeprecatedModule2.html b/html-test/ref/mini_DeprecatedModule2.html new file mode 100644 index 00000000..dbcc43b9 --- /dev/null +++ b/html-test/ref/mini_DeprecatedModule2.html @@ -0,0 +1,31 @@ + +DeprecatedModule2

      DeprecatedModule2

      diff --git a/html-test/ref/mini_DeprecatedNewtype.html b/html-test/ref/mini_DeprecatedNewtype.html new file mode 100644 index 00000000..a913525f --- /dev/null +++ b/html-test/ref/mini_DeprecatedNewtype.html @@ -0,0 +1,41 @@ + +DeprecatedNewtype

      DeprecatedNewtype

      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 @@ + +DeprecatedReExport

      DeprecatedReExport

      Re-exported from an other module +

      Re-exported from an other package +

      diff --git a/html-test/ref/mini_DeprecatedRecord.html b/html-test/ref/mini_DeprecatedRecord.html new file mode 100644 index 00000000..3d949d2d --- /dev/null +++ b/html-test/ref/mini_DeprecatedRecord.html @@ -0,0 +1,33 @@ + +DeprecatedRecord

      DeprecatedRecord

      data Foo

      diff --git a/html-test/ref/mini_DeprecatedTypeFamily.html b/html-test/ref/mini_DeprecatedTypeFamily.html new file mode 100644 index 00000000..c87d9637 --- /dev/null +++ b/html-test/ref/mini_DeprecatedTypeFamily.html @@ -0,0 +1,41 @@ + +DeprecatedTypeFamily

      DeprecatedTypeFamily

      data family SomeTypeFamily k :: * -> *

      data family SomeOtherTypeFamily k :: * -> *

      diff --git a/html-test/ref/mini_DeprecatedTypeSynonym.html b/html-test/ref/mini_DeprecatedTypeSynonym.html new file mode 100644 index 00000000..5ade100d --- /dev/null +++ b/html-test/ref/mini_DeprecatedTypeSynonym.html @@ -0,0 +1,41 @@ + +DeprecatedTypeSynonym

      DeprecatedTypeSynonym

      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 @@ + +DeprecationMessageParseError

      DeprecationMessageParseError

      diff --git a/html-test/ref/mini_Examples.html b/html-test/ref/mini_Examples.html new file mode 100644 index 00000000..c99c2c48 --- /dev/null +++ b/html-test/ref/mini_Examples.html @@ -0,0 +1,31 @@ + +Examples

      Examples

      diff --git a/html-test/ref/mini_FunArgs.html b/html-test/ref/mini_FunArgs.html new file mode 100644 index 00000000..89729720 --- /dev/null +++ b/html-test/ref/mini_FunArgs.html @@ -0,0 +1,37 @@ + +FunArgs

      FunArgs

      diff --git a/html-test/ref/mini_GADTRecords.html b/html-test/ref/mini_GADTRecords.html new file mode 100644 index 00000000..a8b838f0 --- /dev/null +++ b/html-test/ref/mini_GADTRecords.html @@ -0,0 +1,33 @@ + +GADTRecords

      GADTRecords

      data H1 a b

      diff --git a/html-test/ref/mini_Hash.html b/html-test/ref/mini_Hash.html new file mode 100644 index 00000000..1e6ad1a9 --- /dev/null +++ b/html-test/ref/mini_Hash.html @@ -0,0 +1,74 @@ + +Hash

      Hash

      The HashTable type +

      data HashTable key val

      Operations on HashTables +

      The Hash class +

      class Hash a

      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 @@ + +HiddenInstances

      HiddenInstances

      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 @@ + +HiddenInstancesB

      HiddenInstancesB

      class Foo a

      data Bar

      diff --git a/html-test/ref/mini_Hyperlinks.html b/html-test/ref/mini_Hyperlinks.html new file mode 100644 index 00000000..f0c7d65a --- /dev/null +++ b/html-test/ref/mini_Hyperlinks.html @@ -0,0 +1,31 @@ + +Hyperlinks

      Hyperlinks

      diff --git a/html-test/ref/mini_IgnoreExports.html b/html-test/ref/mini_IgnoreExports.html new file mode 100644 index 00000000..a420e65a --- /dev/null +++ b/html-test/ref/mini_IgnoreExports.html @@ -0,0 +1,37 @@ + +IgnoreExports

      IgnoreExports

      diff --git a/html-test/ref/mini_ModuleWithWarning.html b/html-test/ref/mini_ModuleWithWarning.html new file mode 100644 index 00000000..19315a14 --- /dev/null +++ b/html-test/ref/mini_ModuleWithWarning.html @@ -0,0 +1,31 @@ + +ModuleWithWarning

      ModuleWithWarning

      diff --git a/html-test/ref/mini_NamedDoc.html b/html-test/ref/mini_NamedDoc.html new file mode 100644 index 00000000..066bbc61 --- /dev/null +++ b/html-test/ref/mini_NamedDoc.html @@ -0,0 +1,25 @@ + +NamedDoc

      NamedDoc

      diff --git a/html-test/ref/mini_NoLayout.html b/html-test/ref/mini_NoLayout.html new file mode 100644 index 00000000..19562d70 --- /dev/null +++ b/html-test/ref/mini_NoLayout.html @@ -0,0 +1,31 @@ + +NoLayout

      NoLayout

      diff --git a/html-test/ref/mini_NonGreedy.html b/html-test/ref/mini_NonGreedy.html new file mode 100644 index 00000000..698c368e --- /dev/null +++ b/html-test/ref/mini_NonGreedy.html @@ -0,0 +1,31 @@ + +NonGreedy

      NonGreedy

      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 @@ + +Properties

      Properties

      diff --git a/html-test/ref/mini_PruneWithWarning.html b/html-test/ref/mini_PruneWithWarning.html new file mode 100644 index 00000000..9eb3aa00 --- /dev/null +++ b/html-test/ref/mini_PruneWithWarning.html @@ -0,0 +1,25 @@ + +PruneWithWarning

      PruneWithWarning

      diff --git a/html-test/ref/mini_QuasiExpr.html b/html-test/ref/mini_QuasiExpr.html new file mode 100644 index 00000000..7dd9b829 --- /dev/null +++ b/html-test/ref/mini_QuasiExpr.html @@ -0,0 +1,59 @@ + +QuasiExpr

      QuasiExpr

      diff --git a/html-test/ref/mini_QuasiQuote.html b/html-test/ref/mini_QuasiQuote.html new file mode 100644 index 00000000..5dac6acc --- /dev/null +++ b/html-test/ref/mini_QuasiQuote.html @@ -0,0 +1,31 @@ + +QuasiQuote

      QuasiQuote

      diff --git a/html-test/ref/mini_TH.html b/html-test/ref/mini_TH.html new file mode 100644 index 00000000..d2ddbabc --- /dev/null +++ b/html-test/ref/mini_TH.html @@ -0,0 +1,31 @@ + +TH

      TH

      diff --git a/html-test/ref/mini_TH2.html b/html-test/ref/mini_TH2.html new file mode 100644 index 00000000..2c9f1340 --- /dev/null +++ b/html-test/ref/mini_TH2.html @@ -0,0 +1,31 @@ + +TH2

      TH2

      diff --git a/html-test/ref/mini_Test.html b/html-test/ref/mini_Test.html new file mode 100644 index 00000000..26db2c0f --- /dev/null +++ b/html-test/ref/mini_Test.html @@ -0,0 +1,269 @@ + +Test

      Test

      Type declarations +

      Data types +

      data T a b

      data T2 a b

      data T3 a b

      data T4 a b

      data T5 a b

      data T6

      data N1 a

      data N2 a b

      data N3 a b

      data N4 a b

      data N5 a b

      data N6 a b

      data N7 a b

      Records +

      data R

      data R1

      Class declarations +

      class C a

      class D a

      class E a

      class F a

      Function types +

      Auxiliary stuff +

      A hidden module +

      A visible module +

      Existential / Universal types +

      data Ex a

      Type signatures with argument docs +

      A section +

      A subsection +

      diff --git a/html-test/ref/mini_Ticket112.html b/html-test/ref/mini_Ticket112.html new file mode 100644 index 00000000..68a0a5e5 --- /dev/null +++ b/html-test/ref/mini_Ticket112.html @@ -0,0 +1,31 @@ + +Ticket112

      Ticket112

      diff --git a/html-test/ref/mini_Ticket61.html b/html-test/ref/mini_Ticket61.html new file mode 100644 index 00000000..a73fefca --- /dev/null +++ b/html-test/ref/mini_Ticket61.html @@ -0,0 +1,33 @@ + +Ticket61

      Ticket61

      class C a

      diff --git a/html-test/ref/mini_Ticket75.html b/html-test/ref/mini_Ticket75.html new file mode 100644 index 00000000..75ce882c --- /dev/null +++ b/html-test/ref/mini_Ticket75.html @@ -0,0 +1,39 @@ + +Ticket75

      Ticket75

      data a :- b

      diff --git a/html-test/ref/mini_TypeFamilies.html b/html-test/ref/mini_TypeFamilies.html new file mode 100644 index 00000000..0cf39c88 --- /dev/null +++ b/html-test/ref/mini_TypeFamilies.html @@ -0,0 +1,55 @@ + +TypeFamilies

      TypeFamilies

      type family G a :: *

      class A a

      type family F a

      diff --git a/html-test/ref/mini_TypeOperators.html b/html-test/ref/mini_TypeOperators.html new file mode 100644 index 00000000..86b6beec --- /dev/null +++ b/html-test/ref/mini_TypeOperators.html @@ -0,0 +1,66 @@ + +TypeOperators

      TypeOperators

      stuff +

      data a :-: b

      data (a :+: b) c

      data Op a b

      data O g f a

      diff --git a/html-test/ref/mini_Unicode.html b/html-test/ref/mini_Unicode.html new file mode 100644 index 00000000..55336980 --- /dev/null +++ b/html-test/ref/mini_Unicode.html @@ -0,0 +1,31 @@ + +Unicode

      Unicode

      diff --git a/html-test/ref/mini_Visible.html b/html-test/ref/mini_Visible.html new file mode 100644 index 00000000..976a30c5 --- /dev/null +++ b/html-test/ref/mini_Visible.html @@ -0,0 +1,31 @@ + +Visible

      Visible

      diff --git a/html-test/runtests.hs b/html-test/runtests.hs index 292deb8b..1898cde3 100644 --- a/html-test/runtests.hs +++ b/html-test/runtests.hs @@ -26,6 +26,7 @@ dataDir = packageRoot "resources" haddockPath = packageRoot "dist" "build" "haddock" "haddock" testSuiteRoot = packageRoot "html-test" testDir = testSuiteRoot "tests" +refDir = testSuiteRoot "ref" outDir = testSuiteRoot "output" @@ -102,12 +103,11 @@ test = do 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 @@ -116,7 +116,7 @@ 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' r <- programOnPath "colordiff" diff --git a/html-test/tests/A.html.ref b/html-test/tests/A.html.ref deleted file mode 100644 index 328fec02..00000000 --- a/html-test/tests/A.html.ref +++ /dev/null @@ -1,183 +0,0 @@ - -A
      Safe HaskellNone

      A

      Synopsis

      Documentation

      data A

      Constructors

      A 

      test2 :: Bool

      Doc for test2 -

      data X

      Should show up on the page for both modules A and B -

      Constructors

      X

      Doc for consructor -

      reExport :: Int

      Should show up on the page for both modules A and B -

      diff --git a/html-test/tests/AdvanceTypes.html.ref b/html-test/tests/AdvanceTypes.html.ref deleted file mode 100644 index bac545be..00000000 --- a/html-test/tests/AdvanceTypes.html.ref +++ /dev/null @@ -1,97 +0,0 @@ - -AdvanceTypes
      Safe HaskellNone

      AdvanceTypes

      Documentation

      data Pattern where

      Constructors

      Nil :: Pattern `[]` 
      Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
      diff --git a/html-test/tests/B.html.ref b/html-test/tests/B.html.ref deleted file mode 100644 index 410bc75b..00000000 --- a/html-test/tests/B.html.ref +++ /dev/null @@ -1,175 +0,0 @@ - -B
      Safe HaskellNone

      B

      Synopsis

      Documentation

      module A

      test :: Int

      This link shouldn't work: other. - These links should work: other, sortBy, test2, test2, fromMaybe. - Module link: Prelude. -

      reExport :: Int

      Should show up on the page for both modules A and B -

      data X

      Should show up on the page for both modules A and B -

      Constructors

      X

      Doc for consructor -

      diff --git a/html-test/tests/Bug1.html.ref b/html-test/tests/Bug1.html.ref deleted file mode 100644 index f8a86948..00000000 --- a/html-test/tests/Bug1.html.ref +++ /dev/null @@ -1,103 +0,0 @@ - -Bug1
      Safe HaskellNone

      Bug1

      Synopsis

      • data T = T

      Documentation

      data T

      We should have different anchors for constructors and types/classes. This - hyperlink should point to the type constructor by default: T. -

      Constructors

      T 
      diff --git a/html-test/tests/Bug2.html.ref b/html-test/tests/Bug2.html.ref deleted file mode 100644 index 813035a6..00000000 --- a/html-test/tests/Bug2.html.ref +++ /dev/null @@ -1,65 +0,0 @@ - -Bug2
      Safe HaskellNone

      Bug2

      Documentation

      x :: A

      diff --git a/html-test/tests/Bug3.html.ref b/html-test/tests/Bug3.html.ref deleted file mode 100644 index 76d4e730..00000000 --- a/html-test/tests/Bug3.html.ref +++ /dev/null @@ -1,83 +0,0 @@ - -Bug3
      Safe HaskellNone

      Bug3

      Synopsis

      Documentation

      foo :: Int

      /multi-line - emphasis/ -

      diff --git a/html-test/tests/Bug4.html.ref b/html-test/tests/Bug4.html.ref deleted file mode 100644 index 9e852978..00000000 --- a/html-test/tests/Bug4.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -Bug4
      Safe HaskellNone

      Bug4

      Synopsis

      Documentation

      foo :: Int

      don't use apostrophe's in the wrong place's -

      diff --git a/html-test/tests/Bug6.html.ref b/html-test/tests/Bug6.html.ref deleted file mode 100644 index 606e45e3..00000000 --- a/html-test/tests/Bug6.html.ref +++ /dev/null @@ -1,335 +0,0 @@ - -Bug6
      Safe HaskellNone

      Bug6

      Description

      Exporting records. -

      Synopsis

      Documentation

      data A

      This record is exported without its field -

      Constructors

      A Int 

      data B

      .. with its field, but the field is named separately in the export list - (the field isn't documented separately since it is already documented here) -

      Constructors

      B 

      Fields

      b :: Int
       

      data C

      .. with fields names as subordinate names in the export -

      Constructors

      C 

      Fields

      c1 :: Int
       
      c2 :: Int
       

      data D

      .. with only some of the fields exported (we can't handle this one - - how do we render the declaration?) -

      Constructors

      D Int Int 

      newtype E

      a newtype with a field -

      Constructors

      E Int 
      diff --git a/html-test/tests/Bug7.html.ref b/html-test/tests/Bug7.html.ref deleted file mode 100644 index 8ac72b16..00000000 --- a/html-test/tests/Bug7.html.ref +++ /dev/null @@ -1,173 +0,0 @@ - -Bug7
      Safe HaskellNone

      Bug7

      Description

      This module caused a duplicate instance in the documentation for the Foo - type. -

      Synopsis

      Documentation

      data Foo

      The Foo datatype -

      Constructors

      Foo 

      Instances

      Bar Foo Foo

      Just one instance -

      class Bar x y

      The Bar class -

      Instances

      Bar Foo Foo

      Just one instance -

      diff --git a/html-test/tests/Bug8.html.ref b/html-test/tests/Bug8.html.ref deleted file mode 100644 index 469151f1..00000000 --- a/html-test/tests/Bug8.html.ref +++ /dev/null @@ -1,131 +0,0 @@ - -Bug8
      Safe HaskellNone

      Bug8

      Documentation

      data Typ

      Constructors

      Type (String, [Typ]) 
      TFree (String, [String]) 

      (-->) :: t -> t1 -> Typ

      (--->) :: [a] -> Typ -> Typ

      s :: a

      t :: a

      main :: a

      diff --git a/html-test/tests/BugDeprecated.html.ref b/html-test/tests/BugDeprecated.html.ref deleted file mode 100644 index 913b189d..00000000 --- a/html-test/tests/BugDeprecated.html.ref +++ /dev/null @@ -1,198 +0,0 @@ - -BugDeprecated
      Safe HaskellNone

      BugDeprecated

      Synopsis

      Documentation

      foo :: Int

      Deprecated: for foo -

      baz :: Int

      Deprecated: for baz -

      bar :: Int

      Deprecated: for bar -

      one :: Int

      Deprecated: for one -

      some documentation for one, two and three -

      three :: Int

      Deprecated: for three -

      some documentation for one, two and three -

      two :: Int

      Deprecated: for two -

      some documentation for one, two and three -

      diff --git a/html-test/tests/BugExportHeadings.html.ref b/html-test/tests/BugExportHeadings.html.ref deleted file mode 100644 index 457e2c50..00000000 --- a/html-test/tests/BugExportHeadings.html.ref +++ /dev/null @@ -1,220 +0,0 @@ - -BugExportHeadings
      Safe HaskellNone

      BugExportHeadings

      Synopsis

      Foo -

      foo :: Int

      Bar -

      bar :: Int

      Baz -

      baz :: Int

      One -

      one :: Int

      Deprecated: for one -

      Two -

      two :: Int

      Deprecated: for two -

      Three -

      three :: Int

      Deprecated: for three -

      diff --git a/html-test/tests/Bugs.html.ref b/html-test/tests/Bugs.html.ref deleted file mode 100644 index c5a4ca9d..00000000 --- a/html-test/tests/Bugs.html.ref +++ /dev/null @@ -1,81 +0,0 @@ - -Bugs
      Safe HaskellNone

      Bugs

      Documentation

      data A a

      Constructors

      A a (a -> Int) 
      diff --git a/html-test/tests/CrossPackageDocs.html.ref b/html-test/tests/CrossPackageDocs.html.ref deleted file mode 100644 index fea3d0cc..00000000 --- a/html-test/tests/CrossPackageDocs.html.ref +++ /dev/null @@ -1,298 +0,0 @@ - -CrossPackageDocs
      Safe HaskellNone

      CrossPackageDocs

      Synopsis

      Documentation

      map :: (a -> b) -> [a] -> [b]

      map f xs is the list obtained by applying f to each element - of xs, i.e., -

       map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
      - map f [x1, x2, ...] == [f x1, f x2, ...]
      -

      class IsString a where

      Class for string-like datastructures; used by the overloaded string - extension (-foverloaded-strings in GHC). -

      Methods

      fromString :: String -> a

      Instances

      runInteractiveProcess

      Arguments

      :: FilePath

      Filename of the executable (see proc for details) -

      -> [String]

      Arguments to pass to the executable -

      -> Maybe FilePath

      Optional path to the working directory -

      -> Maybe [(String, String)]

      Optional environment (otherwise inherit) -

      -> IO (Handle, Handle, Handle, ProcessHandle) 

      Runs a raw command, and returns Handles that may be used to communicate - with the process via its stdin, stdout and stderr respectively. -

      For example, to start a process and feed a string to its stdin: -

         (inp,out,err,pid) <- runInteractiveProcess "..."
      -   forkIO (hPutStr inp str)
      -

      The Handles are initially in binary mode; if you need them to be - in text mode then use hSetBinaryMode. -

      diff --git a/html-test/tests/DeprecatedClass.html.ref b/html-test/tests/DeprecatedClass.html.ref deleted file mode 100644 index d716c1d8..00000000 --- a/html-test/tests/DeprecatedClass.html.ref +++ /dev/null @@ -1,161 +0,0 @@ - -DeprecatedClass
      Safe HaskellNone

      DeprecatedClass

      Synopsis

      Documentation

      class SomeClass a where

      Deprecated: SomeClass -

      some class -

      Methods

      foo :: a -> a

      Deprecated: foo -

      documentation for foo -

      class SomeOtherClass a where

      Deprecated: SomeOtherClass -

      Methods

      bar :: a -> a

      Deprecated: bar -

      diff --git a/html-test/tests/DeprecatedData.html.ref b/html-test/tests/DeprecatedData.html.ref deleted file mode 100644 index 24758345..00000000 --- a/html-test/tests/DeprecatedData.html.ref +++ /dev/null @@ -1,198 +0,0 @@ - -DeprecatedData
      Safe HaskellNone

      DeprecatedData

      Synopsis

      Documentation

      data Foo

      Deprecated: Foo -

      type Foo -

      Constructors

      Foo

      Deprecated: Foo -

      constructor Foo -

      Bar

      Deprecated: Bar -

      constructor Bar -

      data One

      Deprecated: One -

      Constructors

      One

      Deprecated: One -

      Two

      Deprecated: Two -

      diff --git a/html-test/tests/DeprecatedFunction.html.ref b/html-test/tests/DeprecatedFunction.html.ref deleted file mode 100644 index 1fc678bb..00000000 --- a/html-test/tests/DeprecatedFunction.html.ref +++ /dev/null @@ -1,110 +0,0 @@ - -DeprecatedFunction
      Safe HaskellNone

      DeprecatedFunction

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use bar instead -

      some documentation for foo -

      bar :: Int

      some documentation for bar -

      diff --git a/html-test/tests/DeprecatedFunction2.html.ref b/html-test/tests/DeprecatedFunction2.html.ref deleted file mode 100644 index b5068c8e..00000000 --- a/html-test/tests/DeprecatedFunction2.html.ref +++ /dev/null @@ -1,84 +0,0 @@ - -DeprecatedFunction2
      Safe HaskellNone

      DeprecatedFunction2

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use bar instead -

      diff --git a/html-test/tests/DeprecatedFunction3.html.ref b/html-test/tests/DeprecatedFunction3.html.ref deleted file mode 100644 index f24eb666..00000000 --- a/html-test/tests/DeprecatedFunction3.html.ref +++ /dev/null @@ -1,84 +0,0 @@ - -DeprecatedFunction3
      Safe HaskellNone

      DeprecatedFunction3

      Synopsis

      Documentation

      foo :: Integer

      Deprecated: use bar instead -

      diff --git a/html-test/tests/DeprecatedModule.html.ref b/html-test/tests/DeprecatedModule.html.ref deleted file mode 100644 index 0ca4fafe..00000000 --- a/html-test/tests/DeprecatedModule.html.ref +++ /dev/null @@ -1,83 +0,0 @@ - -DeprecatedModule
      Safe HaskellNone

      DeprecatedModule

      Description

      Deprecated: Use Foo instead -

      Documentation for DeprecatedModule. -

      Documentation

      foo :: Int

      diff --git a/html-test/tests/DeprecatedModule2.html.ref b/html-test/tests/DeprecatedModule2.html.ref deleted file mode 100644 index 0a313ae9..00000000 --- a/html-test/tests/DeprecatedModule2.html.ref +++ /dev/null @@ -1,76 +0,0 @@ - -DeprecatedModule2
      Safe HaskellNone

      DeprecatedModule2

      Description

      Deprecated: Use Foo instead -

      Documentation

      foo :: Int

      diff --git a/html-test/tests/DeprecatedNewtype.html.ref b/html-test/tests/DeprecatedNewtype.html.ref deleted file mode 100644 index 521ffb92..00000000 --- a/html-test/tests/DeprecatedNewtype.html.ref +++ /dev/null @@ -1,161 +0,0 @@ - -DeprecatedNewtype
      Safe HaskellNone

      DeprecatedNewtype

      Documentation

      newtype SomeNewType

      Deprecated: SomeNewType -

      some documentation -

      Constructors

      SomeNewTypeConst String

      Deprecated: SomeNewTypeConst -

      constructor docu -

      newtype SomeOtherNewType

      Deprecated: SomeOtherNewType -

      Constructors

      SomeOtherNewTypeConst String

      Deprecated: SomeOtherNewTypeConst -

      diff --git a/html-test/tests/DeprecatedReExport.html.ref b/html-test/tests/DeprecatedReExport.html.ref deleted file mode 100644 index 611c181d..00000000 --- a/html-test/tests/DeprecatedReExport.html.ref +++ /dev/null @@ -1,133 +0,0 @@ - -DeprecatedReExport
      Safe HaskellNone

      DeprecatedReExport

      Description

      What is tested here: -

      • Deprecation messages are shown for re-exported items. -

      Synopsis

      Re-exported from an other module -

      foo :: Int

      Deprecated: use bar instead -

      some documentation for foo -

      Re-exported from an other package -

      Not yet working, see http://trac.haskell.org/haddock/ticket/223 - , isEmptyChan -

      diff --git a/html-test/tests/DeprecatedRecord.html.ref b/html-test/tests/DeprecatedRecord.html.ref deleted file mode 100644 index 9ade8377..00000000 --- a/html-test/tests/DeprecatedRecord.html.ref +++ /dev/null @@ -1,151 +0,0 @@ - -DeprecatedRecord
      Safe HaskellNone

      DeprecatedRecord

      Synopsis

      Documentation

      data Foo

      type Foo -

      Constructors

      Foo 

      Fields

      fooName :: String

      some name -

      fooValue :: Int

      Deprecated: do not use this -

      some value -

      diff --git a/html-test/tests/DeprecatedTypeFamily.html.ref b/html-test/tests/DeprecatedTypeFamily.html.ref deleted file mode 100644 index ffc069a6..00000000 --- a/html-test/tests/DeprecatedTypeFamily.html.ref +++ /dev/null @@ -1,108 +0,0 @@ - -DeprecatedTypeFamily
      Safe HaskellNone

      DeprecatedTypeFamily

      Synopsis

      Documentation

      data family SomeTypeFamily k :: * -> *

      Deprecated: SomeTypeFamily -

      some documentation -

      data family SomeOtherTypeFamily k :: * -> *

      Deprecated: SomeOtherTypeFamily -

      diff --git a/html-test/tests/DeprecatedTypeSynonym.html.ref b/html-test/tests/DeprecatedTypeSynonym.html.ref deleted file mode 100644 index 665dcf5d..00000000 --- a/html-test/tests/DeprecatedTypeSynonym.html.ref +++ /dev/null @@ -1,116 +0,0 @@ - -DeprecatedTypeSynonym
      Safe HaskellNone

      DeprecatedTypeSynonym

      Synopsis

      Documentation

      type TypeSyn = String

      Deprecated: TypeSyn -

      some documentation -

      type OtherTypeSyn = String

      Deprecated: OtherTypeSyn -

      diff --git a/html-test/tests/DeprecationMessageParseError.html.ref b/html-test/tests/DeprecationMessageParseError.html.ref deleted file mode 100644 index 75f9bf54..00000000 --- a/html-test/tests/DeprecationMessageParseError.html.ref +++ /dev/null @@ -1,101 +0,0 @@ - -DeprecationMessageParseError
      Safe HaskellNone

      DeprecationMessageParseError

      Description

      What is tested here: -

      • If parsing of a deprecation message fails, the message is included - verbatim. -

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use @bar instead

      some documentation for foo -

      diff --git a/html-test/tests/Examples.html.ref b/html-test/tests/Examples.html.ref deleted file mode 100644 index 7ebe7770..00000000 --- a/html-test/tests/Examples.html.ref +++ /dev/null @@ -1,179 +0,0 @@ - -Examples
      Safe HaskellNone

      Examples

      Synopsis

      Documentation

      fib :: Integer -> Integer

      Fibonacci number of given Integer. -

      Examples: -

      >>> fib 5
      -5
      ->>> fib 10
      -55
      -
      >>> fib 10
      -55
      -

      One more Example: -

      >>> fib 5
      -5
      -

      One more Example: -

      >>> fib 5
      -5
      -

      Example with an import: -

      >>> import Data.Char
      ->>> isSpace 'a'
      -False
      -
      >>> putStrLn "foo\n\nbar"
      -foo
      -
      -bar
      -
      diff --git a/html-test/tests/FunArgs.html.ref b/html-test/tests/FunArgs.html.ref deleted file mode 100644 index 6c87d1e6..00000000 --- a/html-test/tests/FunArgs.html.ref +++ /dev/null @@ -1,176 +0,0 @@ - -FunArgs
      Safe HaskellNone

      FunArgs

      Documentation

      f

      Arguments

      :: forall a . Ord a 
      => Int

      First argument -

      -> a

      Second argument -

      -> Bool

      Third argument -

      -> (a -> a)

      Fourth argument -

      -> ()

      Result -

      g

      Arguments

      :: a

      First argument -

      -> b

      Second argument -

      -> c

      Third argument -

      -> d

      Result -

      diff --git a/html-test/tests/GADTRecords.html.ref b/html-test/tests/GADTRecords.html.ref deleted file mode 100644 index e3fcd2fe..00000000 --- a/html-test/tests/GADTRecords.html.ref +++ /dev/null @@ -1,234 +0,0 @@ - -GADTRecords
      Safe HaskellNone

      GADTRecords

      Synopsis

      Documentation

      data H1 a b where

      h1 -

      Constructors

      C1 :: H1 a b 
      C2 :: Ord a => [a] -> H1 a a 
      C3 :: Int -> H1 Int Int 

      Fields

      field :: Int

      hello docs -

      C4 :: a -> H1 Int a 

      Fields

      field2 :: a

      hello2 docs -

      diff --git a/html-test/tests/Hash.html.ref b/html-test/tests/Hash.html.ref deleted file mode 100644 index b0cd183c..00000000 --- a/html-test/tests/Hash.html.ref +++ /dev/null @@ -1,337 +0,0 @@ - -Hash
      Safe HaskellNone

      Hash

      Description

      Implementation of fixed-size hash tables, with a type - class for constructing hash values for structured types. -

      Synopsis

      The HashTable type -

      data HashTable key val

      A hash table with keys of type key and values of type val. - The type key should be an instance of Eq. -

      Operations on HashTables -

      new :: (Eq key, Hash key) => Int -> IO (HashTable key val)

      Builds a new hash table with a given size -

      insert :: (Eq key, Hash key) => key -> val -> IO ()

      Inserts a new element into the hash table -

      lookup :: Hash key => key -> IO (Maybe val)

      Looks up a key in the hash table, returns Just val if the key - was found, or Nothing otherwise. -

      The Hash class -

      class Hash a where

      A class of types which can be hashed. -

      Methods

      hash :: a -> Int

      hashes the value of type a into an Int -

      Instances

      Hash Float 
      Hash Int 
      (Hash a, Hash b) => Hash (a, b) 
      diff --git a/html-test/tests/HiddenInstances.html.ref b/html-test/tests/HiddenInstances.html.ref deleted file mode 100644 index 999c114d..00000000 --- a/html-test/tests/HiddenInstances.html.ref +++ /dev/null @@ -1,169 +0,0 @@ - -HiddenInstances
      Safe HaskellNone

      HiddenInstances

      Synopsis

      Documentation

      class VisibleClass a

      Should be visible -

      Instances

      VisibleClass Int

      Should be visible -

      VisibleClass VisibleData

      Should be visible -

      data VisibleData

      Should be visible -

      Instances

      Num VisibleData

      Should be visible -

      VisibleClass VisibleData

      Should be visible -

      diff --git a/html-test/tests/HiddenInstancesB.html.ref b/html-test/tests/HiddenInstancesB.html.ref deleted file mode 100644 index 207a5146..00000000 --- a/html-test/tests/HiddenInstancesB.html.ref +++ /dev/null @@ -1,143 +0,0 @@ - -HiddenInstancesB
      Safe HaskellNone

      HiddenInstancesB

      Synopsis

      Documentation

      class Foo a

      Should be visible -

      Instances

      Foo Bar

      Should be visible -

      data Bar

      Should be visible -

      Instances

      Foo Bar

      Should be visible -

      diff --git a/html-test/tests/Hyperlinks.html.ref b/html-test/tests/Hyperlinks.html.ref deleted file mode 100644 index e7351a63..00000000 --- a/html-test/tests/Hyperlinks.html.ref +++ /dev/null @@ -1,89 +0,0 @@ - -Hyperlinks
      Safe HaskellNone

      Hyperlinks

      Synopsis

      Documentation

      foo :: Int

      A plain URL: http://example.com/ -

      A URL with a label: some link -

      diff --git a/html-test/tests/IgnoreExports.html.ref b/html-test/tests/IgnoreExports.html.ref deleted file mode 100644 index c661b48c..00000000 --- a/html-test/tests/IgnoreExports.html.ref +++ /dev/null @@ -1,101 +0,0 @@ - -IgnoreExports
      Safe HaskellNone

      IgnoreExports

      Synopsis

      Documentation

      foo :: Int

      documentation for foo -

      bar :: Int

      documentation for bar -

      diff --git a/html-test/tests/ModuleWithWarning.html.ref b/html-test/tests/ModuleWithWarning.html.ref deleted file mode 100644 index 348f0822..00000000 --- a/html-test/tests/ModuleWithWarning.html.ref +++ /dev/null @@ -1,83 +0,0 @@ - -ModuleWithWarning
      Safe HaskellNone

      ModuleWithWarning

      Description

      Warning: This is an unstable interface. Prefer functions from Prelude instead! -

      Documentation for ModuleWithWarning. -

      Documentation

      foo :: Int

      diff --git a/html-test/tests/NamedDoc.html.ref b/html-test/tests/NamedDoc.html.ref deleted file mode 100644 index d2b8ede1..00000000 --- a/html-test/tests/NamedDoc.html.ref +++ /dev/null @@ -1,68 +0,0 @@ - -NamedDoc
      Safe HaskellNone

      NamedDoc

      Synopsis

        Documentation

        bar -

        diff --git a/html-test/tests/NoLayout.html.ref b/html-test/tests/NoLayout.html.ref deleted file mode 100644 index 871add05..00000000 --- a/html-test/tests/NoLayout.html.ref +++ /dev/null @@ -1,86 +0,0 @@ - -NoLayout
        Safe HaskellNone

        NoLayout

        Synopsis

        Documentation

        g :: Int

        the function g -

        diff --git a/html-test/tests/NonGreedy.html.ref b/html-test/tests/NonGreedy.html.ref deleted file mode 100644 index 23d3f695..00000000 --- a/html-test/tests/NonGreedy.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -NonGreedy
        Safe HaskellNone

        NonGreedy

        Synopsis

        • f :: a

        Documentation

        f :: a

        diff --git a/html-test/tests/Properties.html.ref b/html-test/tests/Properties.html.ref deleted file mode 100644 index 1c4ce893..00000000 --- a/html-test/tests/Properties.html.ref +++ /dev/null @@ -1,92 +0,0 @@ - -Properties
        Safe HaskellNone

        Properties

        Synopsis

        Documentation

        fib :: Integer -> Integer

        Fibonacci number of given Integer. -

        fib n <= fib (n + 1)
        diff --git a/html-test/tests/PruneWithWarning.html.ref b/html-test/tests/PruneWithWarning.html.ref deleted file mode 100644 index 3c31fbdf..00000000 --- a/html-test/tests/PruneWithWarning.html.ref +++ /dev/null @@ -1,72 +0,0 @@ - -PruneWithWarning
        Safe HaskellNone

        PruneWithWarning

        Description

        What is tested here: -

        • If a binding has a deprecation message but no documentation, it is pruned - when OPTIONS_HADDOCK prune is used. -
        diff --git a/html-test/tests/QuasiExpr.html.ref b/html-test/tests/QuasiExpr.html.ref deleted file mode 100644 index 0a699f35..00000000 --- a/html-test/tests/QuasiExpr.html.ref +++ /dev/null @@ -1,221 +0,0 @@ - -QuasiExpr
        Safe HaskellNone

        QuasiExpr

        Documentation

        data BinOp

        Constructors

        AddOp 
        SubOp 
        MulOp 
        DivOp 

        Instances

        expr :: QuasiQuoter

        parseExprExp :: String -> Q Exp

        diff --git a/html-test/tests/QuasiQuote.html.ref b/html-test/tests/QuasiQuote.html.ref deleted file mode 100644 index f61f2b84..00000000 --- a/html-test/tests/QuasiQuote.html.ref +++ /dev/null @@ -1,65 +0,0 @@ - -QuasiQuote
        Safe HaskellNone

        QuasiQuote

        Documentation

        diff --git a/html-test/tests/TH.html.ref b/html-test/tests/TH.html.ref deleted file mode 100644 index 086d6a4a..00000000 --- a/html-test/tests/TH.html.ref +++ /dev/null @@ -1,63 +0,0 @@ - -TH
        Safe HaskellNone

        TH

        Documentation

        decl :: Q [Dec]

        diff --git a/html-test/tests/TH2.html.ref b/html-test/tests/TH2.html.ref deleted file mode 100644 index 4d4a8914..00000000 --- a/html-test/tests/TH2.html.ref +++ /dev/null @@ -1,63 +0,0 @@ - -TH2
        Safe HaskellNone

        TH2

        Documentation

        f :: t -> t

        diff --git a/html-test/tests/Test.html.ref b/html-test/tests/Test.html.ref deleted file mode 100644 index f2ef2b28..00000000 --- a/html-test/tests/Test.html.ref +++ /dev/null @@ -1,2245 +0,0 @@ - -Test
        Portabilityportable
        Stabilityprovisional
        Maintainerlibraries@haskell.org
        Safe HaskellNone

        Test

        Description

        This module illustrates & tests most of the features of Haddock. - Testing references from the description: T, f, g, visible. -

        Synopsis

        Type declarations -

        Data types -

        data T a b

        This comment applies to the following declaration - and it continues until the next non-comment line -

        Constructors

        A Int (Maybe Float)

        This comment describes the A constructor -

        B (T a b, T Int Float)

        This comment describes the B constructor -

        data T2 a b

        An abstract data declaration -

        data T3 a b

        A data declaration with no documentation annotations on the constructors -

        Constructors

        A1 a 
        B1 b 

        data T4 a b

        Constructors

        A2 a 
        B2 b 

        data T5 a b

        Constructors

        A3 a

        documents A3 -

        B3 b

        documents B3 -

        data T6

        Testing alternative comment styles -

        Constructors

        A4

        This is the doc for A4 -

        B4

        This is the doc for B4 -

        C4

        This is the doc for C4 -

        newtype N1 a

        A newtype -

        Constructors

        N1 a 

        newtype N2 a b

        A newtype with a fieldname -

        Constructors

        N2 

        Fields

        n :: a b
         

        newtype N3 a b

        A newtype with a fieldname, documentation on the field -

        Constructors

        N3 

        Fields

        n3 :: a b

        this is the n3 field -

        data N4 a b

        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 N5 a b

        Constructors

        N5 

        Fields

        n5 :: a b

        no docs on the datatype or the constructor -

        newtype N6 a b

        Constructors

        N6

        docs on the constructor only -

        Fields

        n6 :: a b
         

        newtype N7 a b

        docs on the newtype and the constructor -

        Constructors

        N7

        The N7 constructor -

        Fields

        n7 :: a b
         

        Records -

        data R

        This is the documentation for the R record, which has four fields, - p, q, r, and s. -

        Constructors

        C1

        This is the C1 record constructor, with the following fields: -

        Fields

        p :: Int

        This comment applies to the p field -

        q :: forall a. a -> a

        This comment applies to the q field -

        r :: Int

        This comment applies to both r and s -

        s :: Int

        This comment applies to both r and s -

        C2

        This is the C2 record constructor, also with some fields: -

        Fields

        t :: T1 -> T2 Int Int -> T3 Bool Bool -> T4 Float Float -> T5 () ()
         
        u :: Int
         
        v :: Int
         

        data R1

        Testing different record commenting styles -

        Constructors

        C3

        This is the C3 record constructor -

        Fields

        s1 :: Int

        The s1 record selector -

        s2 :: Int

        The s2 record selector -

        s3 :: Int

        The s3 record selector -

        test that we can export record selectors on their own: -

        Class declarations -

        class D a => C a where

        This comment applies to the previous declaration (the C class) -

        Methods

        a :: IO a

        this is a description of the a method -

        b :: [a]

        this is a description of the b method -

        class D a where

        This is a class declaration with no separate docs for the methods -

        Methods

        d :: T a b

        e :: (a, a)

        Instances

        class E a

        This is a class declaration with no methods (or no methods exported) -

        class F a where

        Methods

        ff :: a

        Test that we can export a class method on its own: -

        Function types -

        f :: C a => a -> Int

        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) -
        cat
        a small, furry, domesticated mammal -
        pineapple
        a fruit grown in the tropics -
        -     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/. -

        g :: Int -> IO CInt

        we can export foreign declarations too -

        Auxiliary stuff -

        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

        This is some documentation that is attached to a name ($aux2) -

         code block on its own in named doc
         code block on its own in named doc (after newline)

        a nested, named doc comment -

        with a paragraph, -

         and a code block
        test
        -test1
        -
         test2
        -  test3
        -
        -test1
        -test2
        -
        test3
        -test4
        -
        -test1
        -test2
        -
        test3
        -test4
        -
        test3
        -test4
        -
        -test1
        -test2
        -

        aux11: -

        test3
        -test4
        -
        -test1
        -test2
        -
         foo
        -
         bar
        -

        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 -

        hidden :: Int -> Int

        A visible module -

        module Visible

        nested-style doc comments -

        Existential / Universal types -

        data Ex a

        A data-type using existential/universal types -

        Constructors

        forall b . C b => Ex1 b 
        forall b . Ex2 b 
        forall b . C a => Ex3 b 
        Ex4 (forall a. a -> a) 

        Type signatures with argument docs -

        k

        Arguments

        :: 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 is a function with documentation for each argument -

        l

        Arguments

        :: (Int, Int, Float)

        takes a triple -

        -> Int

        returns an Int -

        m

        Arguments

        :: R 
        -> N1 ()

        one of the arguments -

        -> IO Int

        and the return value -

        This function has some arg docs -

        o

        Arguments

        :: Float

        The input float -

        -> IO Float

        The output float -

        A foreign import with argument docs -

        A section -

        A subsection -

         a literal line
        -

        $ a non literal line $ -

        f' :: Int

        a function with a prime can be referred to as f' - but f' doesn't get link'd 'f\'' -

        withType :: Int

        Comment on a definition with type signature -

        withoutType :: a

        Comment on a definition without type signature -

        diff --git a/html-test/tests/Ticket112.html.ref b/html-test/tests/Ticket112.html.ref deleted file mode 100644 index c5c61703..00000000 --- a/html-test/tests/Ticket112.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -Ticket112
        Safe HaskellNone

        Ticket112

        Synopsis

        • f :: a

        Documentation

        f :: a

        ...given a raw Addr# to the string, and the length of the string. -

        diff --git a/html-test/tests/Ticket61.html.ref b/html-test/tests/Ticket61.html.ref deleted file mode 100644 index 8c22488b..00000000 --- a/html-test/tests/Ticket61.html.ref +++ /dev/null @@ -1,80 +0,0 @@ - -Ticket61
        Safe HaskellNone

        Ticket61

        Documentation

        class C a where

        Methods

        f :: a

        A comment about f -

        diff --git a/html-test/tests/Ticket75.html.ref b/html-test/tests/Ticket75.html.ref deleted file mode 100644 index cd510ea5..00000000 --- a/html-test/tests/Ticket75.html.ref +++ /dev/null @@ -1,116 +0,0 @@ - -Ticket75
        Safe HaskellNone

        Ticket75

        Synopsis

        Documentation

        data a :- b

        Constructors

        Q 

        f :: Int

        A reference to :- -

        diff --git a/html-test/tests/TypeFamilies.html.ref b/html-test/tests/TypeFamilies.html.ref deleted file mode 100644 index 196d60ec..00000000 --- a/html-test/tests/TypeFamilies.html.ref +++ /dev/null @@ -1,212 +0,0 @@ - -TypeFamilies
        Safe HaskellNone

        TypeFamilies

        Synopsis

        Documentation

        type family G a :: *

        Type family G -

        class A a where

        A class with an associated type -

        Associated Types

        data B a :: * -> *

        An associated type -

        Methods

        f :: B a Int

        A method -

        Instances

        A Int 

        type family F a

        Doc for family -

        diff --git a/html-test/tests/TypeOperators.html.ref b/html-test/tests/TypeOperators.html.ref deleted file mode 100644 index 2b18727f..00000000 --- a/html-test/tests/TypeOperators.html.ref +++ /dev/null @@ -1,185 +0,0 @@ - -TypeOperators
        Safe HaskellNone

        TypeOperators

        Contents

        Synopsis

        • data a :-: b
        • data (a :+: b) c
        • data Op a b
        • newtype O g f a = O {}
        • biO :: (g `O` f) a

        stuff -

        data a :-: b

        data (a :+: b) c

        data Op a b

        newtype O g f a

        Constructors

        O 

        Fields

        unO :: g (f a)
         

        biO :: (g `O` f) a

        diff --git a/html-test/tests/Unicode.html.ref b/html-test/tests/Unicode.html.ref deleted file mode 100644 index 13ef6c1e..00000000 --- a/html-test/tests/Unicode.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -Unicode
        Safe HaskellNone

        Unicode

        Synopsis

        Documentation

        x :: Int

        γλώσσα -

        diff --git a/html-test/tests/Visible.html.ref b/html-test/tests/Visible.html.ref deleted file mode 100644 index de8b8d80..00000000 --- a/html-test/tests/Visible.html.ref +++ /dev/null @@ -1,67 +0,0 @@ - -Visible
        Safe HaskellNone

        Visible

        Documentation

        diff --git a/html-test/tests/frames.html.ref b/html-test/tests/frames.html.ref deleted file mode 100644 index 1b4e38d4..00000000 --- a/html-test/tests/frames.html.ref +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/html-test/tests/mini_A.html.ref b/html-test/tests/mini_A.html.ref deleted file mode 100644 index cbe50e41..00000000 --- a/html-test/tests/mini_A.html.ref +++ /dev/null @@ -1,59 +0,0 @@ - -A

        A

        diff --git a/html-test/tests/mini_AdvanceTypes.html.ref b/html-test/tests/mini_AdvanceTypes.html.ref deleted file mode 100644 index 59d8dcb1..00000000 --- a/html-test/tests/mini_AdvanceTypes.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -AdvanceTypes

        AdvanceTypes

        data Pattern

        diff --git a/html-test/tests/mini_B.html.ref b/html-test/tests/mini_B.html.ref deleted file mode 100644 index 211a7deb..00000000 --- a/html-test/tests/mini_B.html.ref +++ /dev/null @@ -1,45 +0,0 @@ - -B

        B

        diff --git a/html-test/tests/mini_Bug1.html.ref b/html-test/tests/mini_Bug1.html.ref deleted file mode 100644 index adf81c73..00000000 --- a/html-test/tests/mini_Bug1.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -Bug1

        Bug1

        data T

        diff --git a/html-test/tests/mini_Bug2.html.ref b/html-test/tests/mini_Bug2.html.ref deleted file mode 100644 index b673e459..00000000 --- a/html-test/tests/mini_Bug2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Bug2

        Bug2

        diff --git a/html-test/tests/mini_Bug3.html.ref b/html-test/tests/mini_Bug3.html.ref deleted file mode 100644 index af4cc445..00000000 --- a/html-test/tests/mini_Bug3.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Bug3

        Bug3

        diff --git a/html-test/tests/mini_Bug4.html.ref b/html-test/tests/mini_Bug4.html.ref deleted file mode 100644 index b403e94a..00000000 --- a/html-test/tests/mini_Bug4.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Bug4

        Bug4

        diff --git a/html-test/tests/mini_Bug6.html.ref b/html-test/tests/mini_Bug6.html.ref deleted file mode 100644 index 5c5c1119..00000000 --- a/html-test/tests/mini_Bug6.html.ref +++ /dev/null @@ -1,65 +0,0 @@ - -Bug6

        Bug6

        data A

        data B

        data C

        data D

        data E

        diff --git a/html-test/tests/mini_Bug7.html.ref b/html-test/tests/mini_Bug7.html.ref deleted file mode 100644 index 1bec82ee..00000000 --- a/html-test/tests/mini_Bug7.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -Bug7

        Bug7

        data Foo

        class Bar x y

        diff --git a/html-test/tests/mini_Bug8.html.ref b/html-test/tests/mini_Bug8.html.ref deleted file mode 100644 index 070dbcf8..00000000 --- a/html-test/tests/mini_Bug8.html.ref +++ /dev/null @@ -1,63 +0,0 @@ - -Bug8

        Bug8

        diff --git a/html-test/tests/mini_BugDeprecated.html.ref b/html-test/tests/mini_BugDeprecated.html.ref deleted file mode 100644 index f0410137..00000000 --- a/html-test/tests/mini_BugDeprecated.html.ref +++ /dev/null @@ -1,61 +0,0 @@ - -BugDeprecated

        BugDeprecated

        diff --git a/html-test/tests/mini_BugExportHeadings.html.ref b/html-test/tests/mini_BugExportHeadings.html.ref deleted file mode 100644 index b481720d..00000000 --- a/html-test/tests/mini_BugExportHeadings.html.ref +++ /dev/null @@ -1,79 +0,0 @@ - -BugExportHeadings

        BugExportHeadings

        Foo -

        Bar -

        Baz -

        One -

        Two -

        Three -

        diff --git a/html-test/tests/mini_Bugs.html.ref b/html-test/tests/mini_Bugs.html.ref deleted file mode 100644 index 3c758375..00000000 --- a/html-test/tests/mini_Bugs.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -Bugs

        Bugs

        data A a

        diff --git a/html-test/tests/mini_CrossPackageDocs.html.ref b/html-test/tests/mini_CrossPackageDocs.html.ref deleted file mode 100644 index 4c0588ba..00000000 --- a/html-test/tests/mini_CrossPackageDocs.html.ref +++ /dev/null @@ -1,45 +0,0 @@ - -CrossPackageDocs

        CrossPackageDocs

        diff --git a/html-test/tests/mini_DeprecatedClass.html.ref b/html-test/tests/mini_DeprecatedClass.html.ref deleted file mode 100644 index 3923c1ff..00000000 --- a/html-test/tests/mini_DeprecatedClass.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedClass

        DeprecatedClass

        class SomeClass a

        diff --git a/html-test/tests/mini_DeprecatedData.html.ref b/html-test/tests/mini_DeprecatedData.html.ref deleted file mode 100644 index 8ef20113..00000000 --- a/html-test/tests/mini_DeprecatedData.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedData

        DeprecatedData

        data Foo

        data One

        diff --git a/html-test/tests/mini_DeprecatedFunction.html.ref b/html-test/tests/mini_DeprecatedFunction.html.ref deleted file mode 100644 index 9bb90dac..00000000 --- a/html-test/tests/mini_DeprecatedFunction.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -DeprecatedFunction

        DeprecatedFunction

        diff --git a/html-test/tests/mini_DeprecatedFunction2.html.ref b/html-test/tests/mini_DeprecatedFunction2.html.ref deleted file mode 100644 index a03991a9..00000000 --- a/html-test/tests/mini_DeprecatedFunction2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedFunction2

        DeprecatedFunction2

        diff --git a/html-test/tests/mini_DeprecatedFunction3.html.ref b/html-test/tests/mini_DeprecatedFunction3.html.ref deleted file mode 100644 index 4ea60339..00000000 --- a/html-test/tests/mini_DeprecatedFunction3.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedFunction3

        DeprecatedFunction3

        diff --git a/html-test/tests/mini_DeprecatedModule.html.ref b/html-test/tests/mini_DeprecatedModule.html.ref deleted file mode 100644 index bfdef611..00000000 --- a/html-test/tests/mini_DeprecatedModule.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedModule

        DeprecatedModule

        diff --git a/html-test/tests/mini_DeprecatedModule2.html.ref b/html-test/tests/mini_DeprecatedModule2.html.ref deleted file mode 100644 index dbcc43b9..00000000 --- a/html-test/tests/mini_DeprecatedModule2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedModule2

        DeprecatedModule2

        diff --git a/html-test/tests/mini_DeprecatedNewtype.html.ref b/html-test/tests/mini_DeprecatedNewtype.html.ref deleted file mode 100644 index a913525f..00000000 --- a/html-test/tests/mini_DeprecatedNewtype.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedNewtype

        DeprecatedNewtype

        diff --git a/html-test/tests/mini_DeprecatedReExport.html.ref b/html-test/tests/mini_DeprecatedReExport.html.ref deleted file mode 100644 index 8316dda5..00000000 --- a/html-test/tests/mini_DeprecatedReExport.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -DeprecatedReExport

        DeprecatedReExport

        Re-exported from an other module -

        Re-exported from an other package -

        diff --git a/html-test/tests/mini_DeprecatedRecord.html.ref b/html-test/tests/mini_DeprecatedRecord.html.ref deleted file mode 100644 index 3d949d2d..00000000 --- a/html-test/tests/mini_DeprecatedRecord.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -DeprecatedRecord

        DeprecatedRecord

        data Foo

        diff --git a/html-test/tests/mini_DeprecatedTypeFamily.html.ref b/html-test/tests/mini_DeprecatedTypeFamily.html.ref deleted file mode 100644 index c87d9637..00000000 --- a/html-test/tests/mini_DeprecatedTypeFamily.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedTypeFamily

        DeprecatedTypeFamily

        data family SomeTypeFamily k :: * -> *

        data family SomeOtherTypeFamily k :: * -> *

        diff --git a/html-test/tests/mini_DeprecatedTypeSynonym.html.ref b/html-test/tests/mini_DeprecatedTypeSynonym.html.ref deleted file mode 100644 index 5ade100d..00000000 --- a/html-test/tests/mini_DeprecatedTypeSynonym.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedTypeSynonym

        DeprecatedTypeSynonym

        diff --git a/html-test/tests/mini_DeprecationMessageParseError.html.ref b/html-test/tests/mini_DeprecationMessageParseError.html.ref deleted file mode 100644 index e52f487f..00000000 --- a/html-test/tests/mini_DeprecationMessageParseError.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecationMessageParseError

        DeprecationMessageParseError

        diff --git a/html-test/tests/mini_Examples.html.ref b/html-test/tests/mini_Examples.html.ref deleted file mode 100644 index c99c2c48..00000000 --- a/html-test/tests/mini_Examples.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Examples

        Examples

        diff --git a/html-test/tests/mini_FunArgs.html.ref b/html-test/tests/mini_FunArgs.html.ref deleted file mode 100644 index 89729720..00000000 --- a/html-test/tests/mini_FunArgs.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -FunArgs

        FunArgs

        diff --git a/html-test/tests/mini_GADTRecords.html.ref b/html-test/tests/mini_GADTRecords.html.ref deleted file mode 100644 index a8b838f0..00000000 --- a/html-test/tests/mini_GADTRecords.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -GADTRecords

        GADTRecords

        data H1 a b

        diff --git a/html-test/tests/mini_Hash.html.ref b/html-test/tests/mini_Hash.html.ref deleted file mode 100644 index 1e6ad1a9..00000000 --- a/html-test/tests/mini_Hash.html.ref +++ /dev/null @@ -1,74 +0,0 @@ - -Hash

        Hash

        The HashTable type -

        data HashTable key val

        Operations on HashTables -

        The Hash class -

        class Hash a

        diff --git a/html-test/tests/mini_HiddenInstances.html.ref b/html-test/tests/mini_HiddenInstances.html.ref deleted file mode 100644 index 0f1a2e04..00000000 --- a/html-test/tests/mini_HiddenInstances.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -HiddenInstances

        HiddenInstances

        diff --git a/html-test/tests/mini_HiddenInstancesB.html.ref b/html-test/tests/mini_HiddenInstancesB.html.ref deleted file mode 100644 index 3ce4f6a9..00000000 --- a/html-test/tests/mini_HiddenInstancesB.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -HiddenInstancesB

        HiddenInstancesB

        class Foo a

        data Bar

        diff --git a/html-test/tests/mini_Hyperlinks.html.ref b/html-test/tests/mini_Hyperlinks.html.ref deleted file mode 100644 index f0c7d65a..00000000 --- a/html-test/tests/mini_Hyperlinks.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Hyperlinks

        Hyperlinks

        diff --git a/html-test/tests/mini_IgnoreExports.html.ref b/html-test/tests/mini_IgnoreExports.html.ref deleted file mode 100644 index a420e65a..00000000 --- a/html-test/tests/mini_IgnoreExports.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -IgnoreExports

        IgnoreExports

        diff --git a/html-test/tests/mini_ModuleWithWarning.html.ref b/html-test/tests/mini_ModuleWithWarning.html.ref deleted file mode 100644 index 19315a14..00000000 --- a/html-test/tests/mini_ModuleWithWarning.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -ModuleWithWarning

        ModuleWithWarning

        diff --git a/html-test/tests/mini_NamedDoc.html.ref b/html-test/tests/mini_NamedDoc.html.ref deleted file mode 100644 index 066bbc61..00000000 --- a/html-test/tests/mini_NamedDoc.html.ref +++ /dev/null @@ -1,25 +0,0 @@ - -NamedDoc

        NamedDoc

        diff --git a/html-test/tests/mini_NoLayout.html.ref b/html-test/tests/mini_NoLayout.html.ref deleted file mode 100644 index 19562d70..00000000 --- a/html-test/tests/mini_NoLayout.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -NoLayout

        NoLayout

        diff --git a/html-test/tests/mini_NonGreedy.html.ref b/html-test/tests/mini_NonGreedy.html.ref deleted file mode 100644 index 698c368e..00000000 --- a/html-test/tests/mini_NonGreedy.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -NonGreedy

        NonGreedy

        diff --git a/html-test/tests/mini_Properties.html.ref b/html-test/tests/mini_Properties.html.ref deleted file mode 100644 index 5f538dfd..00000000 --- a/html-test/tests/mini_Properties.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Properties

        Properties

        diff --git a/html-test/tests/mini_PruneWithWarning.html.ref b/html-test/tests/mini_PruneWithWarning.html.ref deleted file mode 100644 index 9eb3aa00..00000000 --- a/html-test/tests/mini_PruneWithWarning.html.ref +++ /dev/null @@ -1,25 +0,0 @@ - -PruneWithWarning

        PruneWithWarning

        diff --git a/html-test/tests/mini_QuasiExpr.html.ref b/html-test/tests/mini_QuasiExpr.html.ref deleted file mode 100644 index 7dd9b829..00000000 --- a/html-test/tests/mini_QuasiExpr.html.ref +++ /dev/null @@ -1,59 +0,0 @@ - -QuasiExpr

        QuasiExpr

        diff --git a/html-test/tests/mini_QuasiQuote.html.ref b/html-test/tests/mini_QuasiQuote.html.ref deleted file mode 100644 index 5dac6acc..00000000 --- a/html-test/tests/mini_QuasiQuote.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -QuasiQuote

        QuasiQuote

        diff --git a/html-test/tests/mini_TH.html.ref b/html-test/tests/mini_TH.html.ref deleted file mode 100644 index d2ddbabc..00000000 --- a/html-test/tests/mini_TH.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -TH

        TH

        diff --git a/html-test/tests/mini_TH2.html.ref b/html-test/tests/mini_TH2.html.ref deleted file mode 100644 index 2c9f1340..00000000 --- a/html-test/tests/mini_TH2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -TH2

        TH2

        diff --git a/html-test/tests/mini_Test.html.ref b/html-test/tests/mini_Test.html.ref deleted file mode 100644 index 26db2c0f..00000000 --- a/html-test/tests/mini_Test.html.ref +++ /dev/null @@ -1,269 +0,0 @@ - -Test

        Test

        Type declarations -

        Data types -

        data T a b

        data T2 a b

        data T3 a b

        data T4 a b

        data T5 a b

        data T6

        data N1 a

        data N2 a b

        data N3 a b

        data N4 a b

        data N5 a b

        data N6 a b

        data N7 a b

        Records -

        data R

        data R1

        Class declarations -

        class C a

        class D a

        class E a

        class F a

        Function types -

        Auxiliary stuff -

        A hidden module -

        A visible module -

        Existential / Universal types -

        data Ex a

        Type signatures with argument docs -

        A section -

        A subsection -

        diff --git a/html-test/tests/mini_Ticket112.html.ref b/html-test/tests/mini_Ticket112.html.ref deleted file mode 100644 index 68a0a5e5..00000000 --- a/html-test/tests/mini_Ticket112.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Ticket112

        Ticket112

        diff --git a/html-test/tests/mini_Ticket61.html.ref b/html-test/tests/mini_Ticket61.html.ref deleted file mode 100644 index a73fefca..00000000 --- a/html-test/tests/mini_Ticket61.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -Ticket61

        Ticket61

        class C a

        diff --git a/html-test/tests/mini_Ticket75.html.ref b/html-test/tests/mini_Ticket75.html.ref deleted file mode 100644 index 75ce882c..00000000 --- a/html-test/tests/mini_Ticket75.html.ref +++ /dev/null @@ -1,39 +0,0 @@ - -Ticket75

        Ticket75

        data a :- b

        diff --git a/html-test/tests/mini_TypeFamilies.html.ref b/html-test/tests/mini_TypeFamilies.html.ref deleted file mode 100644 index 0cf39c88..00000000 --- a/html-test/tests/mini_TypeFamilies.html.ref +++ /dev/null @@ -1,55 +0,0 @@ - -TypeFamilies

        TypeFamilies

        type family G a :: *

        class A a

        type family F a

        diff --git a/html-test/tests/mini_TypeOperators.html.ref b/html-test/tests/mini_TypeOperators.html.ref deleted file mode 100644 index 86b6beec..00000000 --- a/html-test/tests/mini_TypeOperators.html.ref +++ /dev/null @@ -1,66 +0,0 @@ - -TypeOperators

        TypeOperators

        stuff -

        data a :-: b

        data (a :+: b) c

        data Op a b

        data O g f a

        diff --git a/html-test/tests/mini_Unicode.html.ref b/html-test/tests/mini_Unicode.html.ref deleted file mode 100644 index 55336980..00000000 --- a/html-test/tests/mini_Unicode.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Unicode

        Unicode

        diff --git a/html-test/tests/mini_Visible.html.ref b/html-test/tests/mini_Visible.html.ref deleted file mode 100644 index 976a30c5..00000000 --- a/html-test/tests/mini_Visible.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Visible

        Visible

        -- cgit v1.2.3 From 8be6dc23701dcc1387fd56d61ad05df76a88f790 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 11:24:57 +0200 Subject: Copy css, images, etc. on accept --- html-test/accept.hs | 31 +-- html-test/ref/haddock-util.js | 344 ++++++++++++++++++++++++++ html-test/ref/hslogo-16.png | Bin 0 -> 1684 bytes html-test/ref/minus.gif | Bin 0 -> 56 bytes html-test/ref/ocean.css | 546 ++++++++++++++++++++++++++++++++++++++++++ html-test/ref/plus.gif | Bin 0 -> 59 bytes html-test/ref/synopsis.png | Bin 0 -> 11327 bytes 7 files changed, 906 insertions(+), 15 deletions(-) create mode 100644 html-test/ref/haddock-util.js create mode 100644 html-test/ref/hslogo-16.png create mode 100644 html-test/ref/minus.gif create mode 100644 html-test/ref/ocean.css create mode 100644 html-test/ref/plus.gif create mode 100644 html-test/ref/synopsis.png (limited to 'html-test') diff --git a/html-test/accept.hs b/html-test/accept.hs index 82eb3c65..4722dbf9 100644 --- a/html-test/accept.hs +++ b/html-test/accept.hs @@ -1,38 +1,39 @@ import System.Cmd import System.Environment import System.FilePath -import System.Exit import System.Directory import Data.List -import Control.Monad import Control.Applicative - +main :: IO () main = do args <- getArgs dir <- getCurrentDirectory contents <- filter (`notElem` ignore) <$> 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 ] + 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] where ignore = [ - "doc-index.html" + "." + , ".." + , "doc-index.html" , "index-frames.html" , "index.html" ] - +copy :: FilePath -> IO () copy file = do let new = "ref" takeFileName file - print file - print new - contents <- readFile file - writeFile new (stripLinks contents) - + 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 = "= 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("Frames"); + 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 += "
      • " + + a.title + "
      • " + } + if (as.length > 1) { + var h = "
        " + + "Style ▾" + + "
          " + btns + "
        " + + "
        "; + 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/html-test/ref/hslogo-16.png b/html-test/ref/hslogo-16.png new file mode 100644 index 00000000..0ff8579f Binary files /dev/null and b/html-test/ref/hslogo-16.png differ diff --git a/html-test/ref/minus.gif b/html-test/ref/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/html-test/ref/minus.gif differ diff --git a/html-test/ref/ocean.css b/html-test/ref/ocean.css new file mode 100644 index 00000000..42238709 --- /dev/null +++ b/html-test/ref/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/html-test/ref/plus.gif b/html-test/ref/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/html-test/ref/plus.gif differ diff --git a/html-test/ref/synopsis.png b/html-test/ref/synopsis.png new file mode 100644 index 00000000..85fb86ec Binary files /dev/null and b/html-test/ref/synopsis.png differ -- cgit v1.2.3 From 3c5efc1361484f55d9e40b6be4618b2ff8aded26 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 16:10:24 +0200 Subject: Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts --- haddock.cabal | 4 +- html-test/README | 4 +- html-test/accept.hs | 44 -------------- html-test/accept.lhs | 49 ++++++++++++++++ html-test/runtests.hs | 152 ----------------------------------------------- html-test/runtests.lhs | 156 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 209 insertions(+), 200 deletions(-) delete mode 100644 html-test/accept.hs create mode 100755 html-test/accept.lhs delete mode 100644 html-test/runtests.hs create mode 100755 html-test/runtests.lhs (limited to 'html-test') diff --git a/haddock.cabal b/haddock.cabal index 8f655d83..67e86452 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -31,7 +31,7 @@ extra-source-files: 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-test/runtests.hs + tests/html-test/runtests.lhs data-dir: resources data-files: html/frames.html @@ -172,7 +172,7 @@ library test-suite html-test type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: runtests.hs + main-is: runtests.lhs hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal diff --git a/html-test/README b/html-test/README index 9afb10e7..d261888c 100644 --- a/html-test/README +++ b/html-test/README @@ -9,12 +9,12 @@ To add a new 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 + runhaskell accept.lhs Tips and tricks: To "accept" all output files (copy them to reference files), run - runhaskell accept.hs + runhaskell accept.lhs You can run all tests despite failing tests, like so cabal test --test-option=all diff --git a/html-test/accept.hs b/html-test/accept.hs deleted file mode 100644 index 4722dbf9..00000000 --- a/html-test/accept.hs +++ /dev/null @@ -1,44 +0,0 @@ -import System.Cmd -import System.Environment -import System.FilePath -import System.Directory -import Data.List -import Control.Applicative - -main :: IO () -main = do - args <- getArgs - dir <- getCurrentDirectory - contents <- filter (`notElem` ignore) <$> 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] - where - ignore = [ - "." - , ".." - , "doc-index.html" - , "index-frames.html" - , "index.html" - ] - -copy :: FilePath -> IO () -copy file = do - let new = "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 = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs diff --git a/html-test/accept.lhs b/html-test/accept.lhs new file mode 100755 index 00000000..3dfc099b --- /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 (`notElem` ignore) <$> getDirectoryContents (baseDir "output") + args <- getArgs + if not $ null args then + mapM_ copy [ baseDir "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM_ copy [ baseDir "output" file | file <- contents] + where + ignore = [ + "." + , ".." + , "doc-index.html" + , "index-frames.html" + , "index.html" + ] + +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 = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs +\end{code} diff --git a/html-test/runtests.hs b/html-test/runtests.hs deleted file mode 100644 index 1898cde3..00000000 --- a/html-test/runtests.hs +++ /dev/null @@ -1,152 +0,0 @@ -import Prelude hiding (mod) -import Control.Monad -import Control.Applicative -import Data.List -import Data.Maybe -import Distribution.InstalledPackageInfo -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 (ProcessHandle, runProcess, waitForProcess) - - -packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath -packageRoot = "." -dataDir = packageRoot "resources" -haddockPath = packageRoot "dist" "build" "haddock" "haddock" -testSuiteRoot = packageRoot "html-test" -testDir = testSuiteRoot "tests" -refDir = testSuiteRoot "ref" -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" - - contents <- getDirectoryContents testDir - args <- getArgs - let (opts, spec) = span ("-" `isPrefixOf`) args - let mods = - case spec of - 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 - env Nothing Nothing Nothing - wait h1 "*** Running `haddock --version' failed!" - putStrLn "" - putStrLn "GHC version: " - h2 <- runProcess haddockPath ["--ghc-version"] Nothing - 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 mkDep pkgName = - fromMaybe (error "Couldn't find test dependencies") $ do - let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- listToMaybe pkgs - pkg <- listToMaybe pkgs' - ifacePath <- listToMaybe (haddockInterfaces pkg) - htmlPath <- listToMaybe (haddockHTMLs pkg) - return ("-i " ++ htmlPath ++ "," ++ ifacePath) - - let base = mkDep "base" - process = mkDep "process" - ghcprim = mkDep "ghc-prim" - - putStrLn "Running tests..." - handle <- runProcess haddockPath - (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" - , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing env Nothing - Nothing Nothing - - 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 = refDir dropExtension mod ++ ".html" - b <- doesFileExist reffile - if b - then do - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq out ref - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = stripLinks ref - out' = stripLinks out - let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".ref.nolinks" - writeFile reffile' ref' - writeFile outfile' out' - 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 = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) diff --git a/html-test/runtests.lhs b/html-test/runtests.lhs new file mode 100755 index 00000000..c8671a76 --- /dev/null +++ b/html-test/runtests.lhs @@ -0,0 +1,156 @@ +#!/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 (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 (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath +baseDir = takeDirectory __FILE__ +testDir = baseDir "tests" +refDir = baseDir "ref" +outDir = baseDir "output" +packageRoot = baseDir ".." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" + + +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" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + 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 + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + 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 mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + 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 = refDir dropExtension mod ++ ".html" + b <- doesFileExist reffile + if b + then do + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".ref.nolinks" + writeFile reffile' ref' + writeFile outfile' out' + 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 = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) +\end{code} -- cgit v1.2.3 From 0007a5adc2460ec3bca4b86eda670a93bf91c3c3 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:03:43 +0200 Subject: Add test case for "spurious superclass constraints bug" --- html-test/ref/SpuriousSuperclassConstraints.html | 128 +++++++++++++++++++++ .../ref/mini_SpuriousSuperclassConstraints.html | 33 ++++++ html-test/tests/SpuriousSuperclassConstraints.hs | 30 +++++ 3 files changed, 191 insertions(+) create mode 100644 html-test/ref/SpuriousSuperclassConstraints.html create mode 100644 html-test/ref/mini_SpuriousSuperclassConstraints.html create mode 100644 html-test/tests/SpuriousSuperclassConstraints.hs (limited to 'html-test') diff --git a/html-test/ref/SpuriousSuperclassConstraints.html b/html-test/ref/SpuriousSuperclassConstraints.html new file mode 100644 index 00000000..26b30d24 --- /dev/null +++ b/html-test/ref/SpuriousSuperclassConstraints.html @@ -0,0 +1,128 @@ + +SpuriousSuperclassConstraints
        Safe HaskellNone

        SpuriousSuperclassConstraints

        Description

        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.
        +

        Documentation

        data SomeType f a

        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 @@ + +SpuriousSuperclassConstraints

        SpuriousSuperclassConstraints

        data SomeType f a

        diff --git a/html-test/tests/SpuriousSuperclassConstraints.hs b/html-test/tests/SpuriousSuperclassConstraints.hs new file mode 100644 index 00000000..d9e43e1c --- /dev/null +++ b/html-test/tests/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: +-- +-- +-- +-- And here is the corresponding theard on glasgow-haskell-users: +-- +-- +-- +-- 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 -- cgit v1.2.3 From 18fd9f5a0a1debe23bef4ba813143b886d586740 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:28:26 +0200 Subject: Adapt accept.lhs, so that it ignores more index files --- html-test/accept.lhs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'html-test') diff --git a/html-test/accept.lhs b/html-test/accept.lhs index 3dfc099b..ea55c35c 100755 --- a/html-test/accept.lhs +++ b/html-test/accept.lhs @@ -12,19 +12,19 @@ baseDir = takeDirectory __FILE__ main :: IO () main = do - contents <- filter (`notElem` ignore) <$> getDirectoryContents (baseDir "output") + contents <- filter (not . ignore) <$> getDirectoryContents (baseDir "output") args <- getArgs if not $ null args then mapM_ copy [ baseDir "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] else mapM_ copy [ baseDir "output" file | file <- contents] where - ignore = [ - "." - , ".." - , "doc-index.html" - , "index-frames.html" - , "index.html" + ignore = + foldr (liftA2 (||)) (const False) [ + (== ".") + , (== "..") + , (isPrefixOf "index") + , (isPrefixOf "doc-index") ] copy :: FilePath -> IO () -- cgit v1.2.3 From a4fb9cb0a44101d858d69281a3ee0aa0dbf7ddda Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:29:43 +0200 Subject: Rename html-test/runtests.lhs to html-test/run.lhs --- haddock.cabal | 4 +- html-test/run.lhs | 156 +++++++++++++++++++++++++++++++++++++++++++++++++ html-test/runtests.lhs | 156 ------------------------------------------------- 3 files changed, 158 insertions(+), 158 deletions(-) create mode 100755 html-test/run.lhs delete mode 100755 html-test/runtests.lhs (limited to 'html-test') diff --git a/haddock.cabal b/haddock.cabal index 78a6ed73..99bf5e4a 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -31,7 +31,7 @@ extra-source-files: 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-test/runtests.lhs + tests/html-test/run.lhs data-dir: resources data-files: html/frames.html @@ -186,7 +186,7 @@ library test-suite html-test type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: runtests.lhs + main-is: run.lhs hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal diff --git a/html-test/run.lhs b/html-test/run.lhs new file mode 100755 index 00000000..c8671a76 --- /dev/null +++ b/html-test/run.lhs @@ -0,0 +1,156 @@ +#!/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 (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 (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath +baseDir = takeDirectory __FILE__ +testDir = baseDir "tests" +refDir = baseDir "ref" +outDir = baseDir "output" +packageRoot = baseDir ".." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" + + +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" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + 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 + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + 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 mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + 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 = refDir dropExtension mod ++ ".html" + b <- doesFileExist reffile + if b + then do + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".ref.nolinks" + writeFile reffile' ref' + writeFile outfile' out' + 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 = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) +\end{code} diff --git a/html-test/runtests.lhs b/html-test/runtests.lhs deleted file mode 100755 index c8671a76..00000000 --- a/html-test/runtests.lhs +++ /dev/null @@ -1,156 +0,0 @@ -#!/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 (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 (ProcessHandle, runProcess, waitForProcess) - - -packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath -baseDir = takeDirectory __FILE__ -testDir = baseDir "tests" -refDir = baseDir "ref" -outDir = baseDir "output" -packageRoot = baseDir ".." -dataDir = packageRoot "resources" -haddockPath = packageRoot "dist" "build" "haddock" "haddock" - - -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" - - contents <- getDirectoryContents testDir - args <- getArgs - let (opts, spec) = span ("-" `isPrefixOf`) args - let mods = - case spec of - 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 - env Nothing Nothing Nothing - wait h1 "*** Running `haddock --version' failed!" - putStrLn "" - putStrLn "GHC version: " - h2 <- runProcess haddockPath ["--ghc-version"] Nothing - 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 mkDep pkgName = - fromMaybe (error "Couldn't find test dependencies") $ do - let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- listToMaybe pkgs - pkg <- listToMaybe pkgs' - ifacePath <- listToMaybe (haddockInterfaces pkg) - htmlPath <- listToMaybe (haddockHTMLs pkg) - return ("-i " ++ htmlPath ++ "," ++ ifacePath) - - let base = mkDep "base" - process = mkDep "process" - ghcprim = mkDep "ghc-prim" - - putStrLn "Running tests..." - handle <- runProcess haddockPath - (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" - , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing env Nothing - Nothing Nothing - - 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 = refDir dropExtension mod ++ ".html" - b <- doesFileExist reffile - if b - then do - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq out ref - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = stripLinks ref - out' = stripLinks out - let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".ref.nolinks" - writeFile reffile' ref' - writeFile outfile' out' - 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 = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) -\end{code} -- cgit v1.2.3 From 7e1fed4da8bb913d25f447afd1f1e485d428e37f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:32:03 +0200 Subject: Move source files for HTML tests to html-test/src --- html-test/README | 2 +- html-test/run.lhs | 2 +- html-test/src/A.hs | 17 + html-test/src/AdvanceTypes.hs | 9 + html-test/src/B.hs | 8 + html-test/src/Bug1.hs | 6 + html-test/src/Bug2.hs | 4 + html-test/src/Bug3.hs | 6 + html-test/src/Bug4.hs | 5 + html-test/src/Bug6.hs | 23 ++ html-test/src/Bug7.hs | 12 + html-test/src/Bug8.hs | 14 + html-test/src/BugDeprecated.hs | 18 + html-test/src/BugExportHeadings.hs | 29 ++ html-test/src/Bugs.hs | 3 + html-test/src/CrossPackageDocs.hs | 4 + html-test/src/DeprecatedClass.hs | 15 + html-test/src/DeprecatedData.hs | 15 + html-test/src/DeprecatedFunction.hs | 10 + html-test/src/DeprecatedFunction2.hs | 6 + html-test/src/DeprecatedFunction3.hs | 6 + html-test/src/DeprecatedModule.hs | 5 + html-test/src/DeprecatedModule2.hs | 4 + html-test/src/DeprecatedNewtype.hs | 10 + html-test/src/DeprecatedReExport.hs | 16 + html-test/src/DeprecatedRecord.hs | 9 + html-test/src/DeprecatedTypeFamily.hs | 9 + html-test/src/DeprecatedTypeSynonym.hs | 9 + html-test/src/DeprecationMessageParseError.hs | 12 + html-test/src/Examples.hs | 39 +++ html-test/src/FunArgs.hs | 16 + html-test/src/GADTRecords.hs | 12 + html-test/src/Hash.hs | 51 +++ html-test/src/Hidden.hs | 6 + html-test/src/HiddenInstances.hs | 35 ++ html-test/src/HiddenInstancesA.hs | 17 + html-test/src/HiddenInstancesB.hs | 2 + html-test/src/Hyperlinks.hs | 8 + html-test/src/IgnoreExports.hs | 10 + html-test/src/ModuleWithWarning.hs | 5 + html-test/src/NamedDoc.hs | 4 + html-test/src/NoLayout.hs | 12 + html-test/src/NonGreedy.hs | 5 + html-test/src/Properties.hs | 9 + html-test/src/PruneWithWarning.hs | 15 + html-test/src/QuasiExpr.hs | 34 ++ html-test/src/QuasiQuote.hs | 9 + html-test/src/SpuriousSuperclassConstraints.hs | 30 ++ html-test/src/TH.hs | 8 + html-test/src/TH2.hs | 7 + html-test/src/Test.hs | 422 +++++++++++++++++++++++ html-test/src/Ticket112.hs | 9 + html-test/src/Ticket61.hs | 3 + html-test/src/Ticket61_Hidden.hs | 7 + html-test/src/Ticket75.hs | 7 + html-test/src/TypeFamilies.hs | 28 ++ html-test/src/TypeOperators.hs | 20 ++ html-test/src/Unicode.hs.disabled | 6 + html-test/src/Visible.hs | 3 + html-test/tests/A.hs | 17 - html-test/tests/AdvanceTypes.hs | 9 - html-test/tests/B.hs | 8 - html-test/tests/Bug1.hs | 6 - html-test/tests/Bug2.hs | 4 - html-test/tests/Bug3.hs | 6 - html-test/tests/Bug4.hs | 5 - html-test/tests/Bug6.hs | 23 -- html-test/tests/Bug7.hs | 12 - html-test/tests/Bug8.hs | 14 - html-test/tests/BugDeprecated.hs | 18 - html-test/tests/BugExportHeadings.hs | 29 -- html-test/tests/Bugs.hs | 3 - html-test/tests/CrossPackageDocs.hs | 4 - html-test/tests/DeprecatedClass.hs | 15 - html-test/tests/DeprecatedData.hs | 15 - html-test/tests/DeprecatedFunction.hs | 10 - html-test/tests/DeprecatedFunction2.hs | 6 - html-test/tests/DeprecatedFunction3.hs | 6 - html-test/tests/DeprecatedModule.hs | 5 - html-test/tests/DeprecatedModule2.hs | 4 - html-test/tests/DeprecatedNewtype.hs | 10 - html-test/tests/DeprecatedReExport.hs | 16 - html-test/tests/DeprecatedRecord.hs | 9 - html-test/tests/DeprecatedTypeFamily.hs | 9 - html-test/tests/DeprecatedTypeSynonym.hs | 9 - html-test/tests/DeprecationMessageParseError.hs | 12 - html-test/tests/Examples.hs | 39 --- html-test/tests/FunArgs.hs | 16 - html-test/tests/GADTRecords.hs | 12 - html-test/tests/Hash.hs | 51 --- html-test/tests/Hidden.hs | 6 - html-test/tests/HiddenInstances.hs | 35 -- html-test/tests/HiddenInstancesA.hs | 17 - html-test/tests/HiddenInstancesB.hs | 2 - html-test/tests/Hyperlinks.hs | 8 - html-test/tests/IgnoreExports.hs | 10 - html-test/tests/ModuleWithWarning.hs | 5 - html-test/tests/NamedDoc.hs | 4 - html-test/tests/NoLayout.hs | 12 - html-test/tests/NonGreedy.hs | 5 - html-test/tests/Properties.hs | 9 - html-test/tests/PruneWithWarning.hs | 15 - html-test/tests/QuasiExpr.hs | 34 -- html-test/tests/QuasiQuote.hs | 9 - html-test/tests/SpuriousSuperclassConstraints.hs | 30 -- html-test/tests/TH.hs | 8 - html-test/tests/TH2.hs | 7 - html-test/tests/Test.hs | 422 ----------------------- html-test/tests/Ticket112.hs | 9 - html-test/tests/Ticket61.hs | 3 - html-test/tests/Ticket61_Hidden.hs | 7 - html-test/tests/Ticket75.hs | 7 - html-test/tests/TypeFamilies.hs | 28 -- html-test/tests/TypeOperators.hs | 20 -- html-test/tests/Unicode.hs.disabled | 6 - html-test/tests/Visible.hs | 3 - 116 files changed, 1125 insertions(+), 1125 deletions(-) create mode 100644 html-test/src/A.hs create mode 100644 html-test/src/AdvanceTypes.hs create mode 100644 html-test/src/B.hs create mode 100644 html-test/src/Bug1.hs create mode 100644 html-test/src/Bug2.hs create mode 100644 html-test/src/Bug3.hs create mode 100644 html-test/src/Bug4.hs create mode 100644 html-test/src/Bug6.hs create mode 100644 html-test/src/Bug7.hs create mode 100644 html-test/src/Bug8.hs create mode 100644 html-test/src/BugDeprecated.hs create mode 100644 html-test/src/BugExportHeadings.hs create mode 100644 html-test/src/Bugs.hs create mode 100644 html-test/src/CrossPackageDocs.hs create mode 100644 html-test/src/DeprecatedClass.hs create mode 100644 html-test/src/DeprecatedData.hs create mode 100644 html-test/src/DeprecatedFunction.hs create mode 100644 html-test/src/DeprecatedFunction2.hs create mode 100644 html-test/src/DeprecatedFunction3.hs create mode 100644 html-test/src/DeprecatedModule.hs create mode 100644 html-test/src/DeprecatedModule2.hs create mode 100644 html-test/src/DeprecatedNewtype.hs create mode 100644 html-test/src/DeprecatedReExport.hs create mode 100644 html-test/src/DeprecatedRecord.hs create mode 100644 html-test/src/DeprecatedTypeFamily.hs create mode 100644 html-test/src/DeprecatedTypeSynonym.hs create mode 100644 html-test/src/DeprecationMessageParseError.hs create mode 100644 html-test/src/Examples.hs create mode 100644 html-test/src/FunArgs.hs create mode 100644 html-test/src/GADTRecords.hs create mode 100644 html-test/src/Hash.hs create mode 100644 html-test/src/Hidden.hs create mode 100644 html-test/src/HiddenInstances.hs create mode 100644 html-test/src/HiddenInstancesA.hs create mode 100644 html-test/src/HiddenInstancesB.hs create mode 100644 html-test/src/Hyperlinks.hs create mode 100644 html-test/src/IgnoreExports.hs create mode 100644 html-test/src/ModuleWithWarning.hs create mode 100644 html-test/src/NamedDoc.hs create mode 100644 html-test/src/NoLayout.hs create mode 100644 html-test/src/NonGreedy.hs create mode 100644 html-test/src/Properties.hs create mode 100644 html-test/src/PruneWithWarning.hs create mode 100644 html-test/src/QuasiExpr.hs create mode 100644 html-test/src/QuasiQuote.hs create mode 100644 html-test/src/SpuriousSuperclassConstraints.hs create mode 100644 html-test/src/TH.hs create mode 100644 html-test/src/TH2.hs create mode 100644 html-test/src/Test.hs create mode 100644 html-test/src/Ticket112.hs create mode 100644 html-test/src/Ticket61.hs create mode 100644 html-test/src/Ticket61_Hidden.hs create mode 100644 html-test/src/Ticket75.hs create mode 100644 html-test/src/TypeFamilies.hs create mode 100644 html-test/src/TypeOperators.hs create mode 100644 html-test/src/Unicode.hs.disabled create mode 100644 html-test/src/Visible.hs delete mode 100644 html-test/tests/A.hs delete mode 100644 html-test/tests/AdvanceTypes.hs delete mode 100644 html-test/tests/B.hs delete mode 100644 html-test/tests/Bug1.hs delete mode 100644 html-test/tests/Bug2.hs delete mode 100644 html-test/tests/Bug3.hs delete mode 100644 html-test/tests/Bug4.hs delete mode 100644 html-test/tests/Bug6.hs delete mode 100644 html-test/tests/Bug7.hs delete mode 100644 html-test/tests/Bug8.hs delete mode 100644 html-test/tests/BugDeprecated.hs delete mode 100644 html-test/tests/BugExportHeadings.hs delete mode 100644 html-test/tests/Bugs.hs delete mode 100644 html-test/tests/CrossPackageDocs.hs delete mode 100644 html-test/tests/DeprecatedClass.hs delete mode 100644 html-test/tests/DeprecatedData.hs delete mode 100644 html-test/tests/DeprecatedFunction.hs delete mode 100644 html-test/tests/DeprecatedFunction2.hs delete mode 100644 html-test/tests/DeprecatedFunction3.hs delete mode 100644 html-test/tests/DeprecatedModule.hs delete mode 100644 html-test/tests/DeprecatedModule2.hs delete mode 100644 html-test/tests/DeprecatedNewtype.hs delete mode 100644 html-test/tests/DeprecatedReExport.hs delete mode 100644 html-test/tests/DeprecatedRecord.hs delete mode 100644 html-test/tests/DeprecatedTypeFamily.hs delete mode 100644 html-test/tests/DeprecatedTypeSynonym.hs delete mode 100644 html-test/tests/DeprecationMessageParseError.hs delete mode 100644 html-test/tests/Examples.hs delete mode 100644 html-test/tests/FunArgs.hs delete mode 100644 html-test/tests/GADTRecords.hs delete mode 100644 html-test/tests/Hash.hs delete mode 100644 html-test/tests/Hidden.hs delete mode 100644 html-test/tests/HiddenInstances.hs delete mode 100644 html-test/tests/HiddenInstancesA.hs delete mode 100644 html-test/tests/HiddenInstancesB.hs delete mode 100644 html-test/tests/Hyperlinks.hs delete mode 100644 html-test/tests/IgnoreExports.hs delete mode 100644 html-test/tests/ModuleWithWarning.hs delete mode 100644 html-test/tests/NamedDoc.hs delete mode 100644 html-test/tests/NoLayout.hs delete mode 100644 html-test/tests/NonGreedy.hs delete mode 100644 html-test/tests/Properties.hs delete mode 100644 html-test/tests/PruneWithWarning.hs delete mode 100644 html-test/tests/QuasiExpr.hs delete mode 100644 html-test/tests/QuasiQuote.hs delete mode 100644 html-test/tests/SpuriousSuperclassConstraints.hs delete mode 100644 html-test/tests/TH.hs delete mode 100644 html-test/tests/TH2.hs delete mode 100644 html-test/tests/Test.hs delete mode 100644 html-test/tests/Ticket112.hs delete mode 100644 html-test/tests/Ticket61.hs delete mode 100644 html-test/tests/Ticket61_Hidden.hs delete mode 100644 html-test/tests/Ticket75.hs delete mode 100644 html-test/tests/TypeFamilies.hs delete mode 100644 html-test/tests/TypeOperators.hs delete mode 100644 html-test/tests/Unicode.hs.disabled delete mode 100644 html-test/tests/Visible.hs (limited to 'html-test') diff --git a/html-test/README b/html-test/README index d261888c..b5fff14b 100644 --- a/html-test/README +++ b/html-test/README @@ -3,7 +3,7 @@ is, it compares output files against a set of reference files. To add a new test: - 1) Create a module in the "tests" directory. + 1) Create a module in the "html-test/src" directory. 2) Run "cabal test". You should now have output/.html. The test passes since there is no reference file to compare with. diff --git a/html-test/run.lhs b/html-test/run.lhs index c8671a76..c543e020 100755 --- a/html-test/run.lhs +++ b/html-test/run.lhs @@ -25,7 +25,7 @@ import System.Process (ProcessHandle, runProcess, waitForProcess) packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath baseDir = takeDirectory __FILE__ -testDir = baseDir "tests" +testDir = baseDir "src" refDir = baseDir "ref" outDir = baseDir "output" packageRoot = baseDir ".." diff --git a/html-test/src/A.hs b/html-test/src/A.hs new file mode 100644 index 00000000..606b0865 --- /dev/null +++ b/html-test/src/A.hs @@ -0,0 +1,17 @@ +module A where + +data A = A + +other :: Int +other = 2 + +-- | Doc for test2 +test2 :: Bool +test2 = False + +-- | Should show up on the page for both modules A and B +data X = X -- ^ Doc for consructor + +-- | Should show up on the page for both modules A and B +reExport :: Int +reExport = 1 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/html-test/src/B.hs b/html-test/src/B.hs new file mode 100644 index 00000000..5fd69acd --- /dev/null +++ b/html-test/src/B.hs @@ -0,0 +1,8 @@ +module B ( module A, test, reExport, X(..) ) where +import A ( A(..), test2, reExport, X(..) ) + +-- | This link shouldn't work: 'other'. +-- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. +-- Module link: "Prelude". +test :: Int +test = 1 diff --git a/html-test/src/Bug1.hs b/html-test/src/Bug1.hs new file mode 100644 index 00000000..af1ed4d3 --- /dev/null +++ b/html-test/src/Bug1.hs @@ -0,0 +1,6 @@ +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/html-test/src/Bug2.hs b/html-test/src/Bug2.hs new file mode 100644 index 00000000..9121922e --- /dev/null +++ b/html-test/src/Bug2.hs @@ -0,0 +1,4 @@ +module Bug2 ( x ) where +import B +x :: A +x = A diff --git a/html-test/src/Bug3.hs b/html-test/src/Bug3.hs new file mode 100644 index 00000000..67e57892 --- /dev/null +++ b/html-test/src/Bug3.hs @@ -0,0 +1,6 @@ +module Bug3 where + +-- | /multi-line +-- emphasis/ +foo :: Int +foo = undefined diff --git a/html-test/src/Bug4.hs b/html-test/src/Bug4.hs new file mode 100644 index 00000000..425a77aa --- /dev/null +++ b/html-test/src/Bug4.hs @@ -0,0 +1,5 @@ +module Bug4 where +-- | don't use apostrophe's in the wrong place's +foo :: Int +foo = undefined + diff --git a/html-test/src/Bug6.hs b/html-test/src/Bug6.hs new file mode 100644 index 00000000..17411f31 --- /dev/null +++ b/html-test/src/Bug6.hs @@ -0,0 +1,23 @@ +-- | 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 +-- (the field isn't documented separately since it is already documented here) +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/html-test/src/Bug7.hs b/html-test/src/Bug7.hs new file mode 100644 index 00000000..8cf57914 --- /dev/null +++ b/html-test/src/Bug7.hs @@ -0,0 +1,12 @@ +-- | 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/html-test/src/Bug8.hs b/html-test/src/Bug8.hs new file mode 100644 index 00000000..18df63c8 --- /dev/null +++ b/html-test/src/Bug8.hs @@ -0,0 +1,14 @@ +module Bug8 where + +infix --> +infix ---> + +data Typ = Type (String,[Typ]) + | TFree (String, [String]) + +x --> y = Type("fun",[s,t]) +(--->) = flip $ foldr (-->) + +s = undefined +t = undefined +main = undefined diff --git a/html-test/src/BugDeprecated.hs b/html-test/src/BugDeprecated.hs new file mode 100644 index 00000000..0f7ac2eb --- /dev/null +++ b/html-test/src/BugDeprecated.hs @@ -0,0 +1,18 @@ +module BugDeprecated where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 +{-# DEPRECATED foo "for foo" #-} +{-# DEPRECATED bar "for bar" #-} +{-# DEPRECATED baz "for baz" #-} + +-- | some documentation for one, two and three +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/src/BugExportHeadings.hs b/html-test/src/BugExportHeadings.hs new file mode 100644 index 00000000..a5493a08 --- /dev/null +++ b/html-test/src/BugExportHeadings.hs @@ -0,0 +1,29 @@ +-- test for #192 +module BugExportHeadings ( +-- * Foo + foo +-- * Bar +, bar +-- * Baz +, baz + +-- * One +, one +-- * Two +, two +-- * Three +, three +) where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 + +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/src/Bugs.hs b/html-test/src/Bugs.hs new file mode 100644 index 00000000..8e1f0079 --- /dev/null +++ b/html-test/src/Bugs.hs @@ -0,0 +1,3 @@ +module Bugs where + +data A a = A a (a -> Int) 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/html-test/src/DeprecatedClass.hs b/html-test/src/DeprecatedClass.hs new file mode 100644 index 00000000..018904ab --- /dev/null +++ b/html-test/src/DeprecatedClass.hs @@ -0,0 +1,15 @@ +module DeprecatedClass where + +-- | some class +class SomeClass a where + -- | documentation for foo + foo :: a -> a + +{-# DEPRECATED SomeClass "SomeClass" #-} +{-# DEPRECATED foo "foo" #-} + +class SomeOtherClass a where + bar :: a -> a + +{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} +{-# DEPRECATED bar "bar" #-} diff --git a/html-test/src/DeprecatedData.hs b/html-test/src/DeprecatedData.hs new file mode 100644 index 00000000..c40ba122 --- /dev/null +++ b/html-test/src/DeprecatedData.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedData where + +-- | type Foo +data Foo = Foo -- ^ constructor Foo + | Bar -- ^ constructor Bar + +{-# DEPRECATED Foo "Foo" #-} +{-# DEPRECATED Bar "Bar" #-} + +data One = One + | Two + +{-# DEPRECATED One "One" #-} +{-# DEPRECATED Two "Two" #-} 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/html-test/src/DeprecatedFunction2.hs b/html-test/src/DeprecatedFunction2.hs new file mode 100644 index 00000000..bdbbf95c --- /dev/null +++ b/html-test/src/DeprecatedFunction2.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction2 where + + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/src/DeprecatedFunction3.hs b/html-test/src/DeprecatedFunction3.hs new file mode 100644 index 00000000..ca719bda --- /dev/null +++ b/html-test/src/DeprecatedFunction3.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction3 where + + + +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} 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/html-test/src/DeprecatedModule2.hs b/html-test/src/DeprecatedModule2.hs new file mode 100644 index 00000000..94185297 --- /dev/null +++ b/html-test/src/DeprecatedModule2.hs @@ -0,0 +1,4 @@ +module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/src/DeprecatedNewtype.hs b/html-test/src/DeprecatedNewtype.hs new file mode 100644 index 00000000..254f1f55 --- /dev/null +++ b/html-test/src/DeprecatedNewtype.hs @@ -0,0 +1,10 @@ +module DeprecatedNewtype where + +-- | some documentation +newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} +{-# DEPRECATED SomeNewType "SomeNewType" #-} +{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} + +newtype SomeOtherNewType = SomeOtherNewTypeConst String +{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} +{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} 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 +-- , isEmptyChan +, +) where + +import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/html-test/src/DeprecatedRecord.hs b/html-test/src/DeprecatedRecord.hs new file mode 100644 index 00000000..d44499e7 --- /dev/null +++ b/html-test/src/DeprecatedRecord.hs @@ -0,0 +1,9 @@ +module DeprecatedRecord where + +-- | type Foo +data Foo = Foo { + fooName :: String -- ^ some name +, fooValue :: Int -- ^ some value +} + +{-# DEPRECATED fooValue "do not use this" #-} diff --git a/html-test/src/DeprecatedTypeFamily.hs b/html-test/src/DeprecatedTypeFamily.hs new file mode 100644 index 00000000..70473bb8 --- /dev/null +++ b/html-test/src/DeprecatedTypeFamily.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedTypeFamily where + +-- | some documentation +data family SomeTypeFamily k :: * -> * +{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} + +data family SomeOtherTypeFamily k :: * -> * +{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/html-test/src/DeprecatedTypeSynonym.hs b/html-test/src/DeprecatedTypeSynonym.hs new file mode 100644 index 00000000..34df47da --- /dev/null +++ b/html-test/src/DeprecatedTypeSynonym.hs @@ -0,0 +1,9 @@ + +module DeprecatedTypeSynonym where + +-- | some documentation +type TypeSyn = String +{-# DEPRECATED TypeSyn "TypeSyn" #-} + +type OtherTypeSyn = String +{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} 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/html-test/src/Examples.hs b/html-test/src/Examples.hs new file mode 100644 index 00000000..c8c450f1 --- /dev/null +++ b/html-test/src/Examples.hs @@ -0,0 +1,39 @@ +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- >>> fib 5 +-- 5 +-- >>> fib 10 +-- 55 +-- +-- >>> fib 10 +-- 55 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- >>> import Data.Char +-- >>> isSpace 'a' +-- False +-- +-- >>> putStrLn "foo\n\nbar" +-- foo +-- +-- bar +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/src/FunArgs.hs b/html-test/src/FunArgs.hs new file mode 100644 index 00000000..b34d84b7 --- /dev/null +++ b/html-test/src/FunArgs.hs @@ -0,0 +1,16 @@ +module FunArgs where + +f :: forall a. Ord a + => Int -- ^ First argument + -> a -- ^ Second argument + -> Bool -- ^ Third argument + -> (a -> a) -- ^ Fourth argument + -> () -- ^ Result +f = undefined + + +g :: a -- ^ First argument + -> b -- ^ Second argument + -> c -- ^ Third argument + -> d -- ^ Result +g = undefined diff --git a/html-test/src/GADTRecords.hs b/html-test/src/GADTRecords.hs new file mode 100644 index 00000000..c77810ad --- /dev/null +++ b/html-test/src/GADTRecords.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE GADTs #-} +module GADTRecords (H1(..)) where + +-- | h1 +data H1 a b where + C1 :: H1 a b + C2 :: Ord a => [a] -> H1 a a + C3 { field :: Int -- ^ hello docs + } :: H1 Int Int + C4 { field2 :: a -- ^ hello2 docs + } :: H1 Int a + diff --git a/html-test/src/Hash.hs b/html-test/src/Hash.hs new file mode 100644 index 00000000..343b69e9 --- /dev/null +++ b/html-test/src/Hash.hs @@ -0,0 +1,51 @@ +{- | + 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 Data.Array +import Prelude hiding (lookup) + +-- | 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) +new = undefined + +-- | Inserts a new element into the hash table +insert :: (Eq key, Hash key) => key -> val -> IO () +insert = undefined + +-- | 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) +lookup = undefined + +-- | 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 + +trunc = undefined +xor = undefined diff --git a/html-test/src/Hidden.hs b/html-test/src/Hidden.hs new file mode 100644 index 00000000..896da648 --- /dev/null +++ b/html-test/src/Hidden.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Hidden where + +hidden :: Int -> Int +hidden a = a 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: +-- +-- A URL with a label: +foo :: Int +foo = 23 diff --git a/html-test/src/IgnoreExports.hs b/html-test/src/IgnoreExports.hs new file mode 100644 index 00000000..0321ad02 --- /dev/null +++ b/html-test/src/IgnoreExports.hs @@ -0,0 +1,10 @@ +{-# OPTIONS_HADDOCK ignore-exports #-} +module IgnoreExports (foo) where + +-- | documentation for foo +foo :: Int +foo = 23 + +-- | documentation for bar +bar :: Int +bar = 23 diff --git a/html-test/src/ModuleWithWarning.hs b/html-test/src/ModuleWithWarning.hs new file mode 100644 index 00000000..e64d9d7e --- /dev/null +++ b/html-test/src/ModuleWithWarning.hs @@ -0,0 +1,5 @@ +-- | Documentation for "ModuleWithWarning". +module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/src/NamedDoc.hs b/html-test/src/NamedDoc.hs new file mode 100644 index 00000000..7c04ba72 --- /dev/null +++ b/html-test/src/NamedDoc.hs @@ -0,0 +1,4 @@ +module NamedDoc where + +-- $foo bar + diff --git a/html-test/src/NoLayout.hs b/html-test/src/NoLayout.hs new file mode 100644 index 00000000..19b38b1d --- /dev/null +++ b/html-test/src/NoLayout.hs @@ -0,0 +1,12 @@ + +-- Haddock comments are parsed as separate declarations so we +-- need to insert a ';' when using them with explicit layout. +-- This should probably be changed. + +module NoLayout where { + -- | the function 'g' + ; + g :: Int; + g = undefined + } + diff --git a/html-test/src/NonGreedy.hs b/html-test/src/NonGreedy.hs new file mode 100644 index 00000000..f51b55f5 --- /dev/null +++ b/html-test/src/NonGreedy.hs @@ -0,0 +1,5 @@ +module NonGreedy where + +-- | +f :: a +f = undefined 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/html-test/src/QuasiExpr.hs b/html-test/src/QuasiExpr.hs new file mode 100644 index 00000000..970759ba --- /dev/null +++ b/html-test/src/QuasiExpr.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE TemplateHaskell #-} + +-- Used by QuasiQuote. Example taken from the GHC documentation. +module QuasiExpr where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote + +data Expr = IntExpr Integer + | AntiIntExpr String + | BinopExpr BinOp Expr Expr + | AntiExpr String + deriving Show + +data BinOp = AddOp + | SubOp + | MulOp + | DivOp + deriving Show + +eval :: Expr -> Integer +eval (IntExpr n) = n +eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) + where + opToFun AddOp = (+) + opToFun SubOp = (-) + opToFun MulOp = (*) + opToFun DivOp = div + +expr = QuasiQuoter parseExprExp undefined undefined undefined + +-- cheating... +parseExprExp :: String -> Q Exp +parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/html-test/src/QuasiQuote.hs b/html-test/src/QuasiQuote.hs new file mode 100644 index 00000000..06762cf9 --- /dev/null +++ b/html-test/src/QuasiQuote.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} + +-- example taken from the GHC documentation +module QuasiQuote where + +import QuasiExpr + +val :: Integer +val = eval [expr|1 + 2|] 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: +-- +-- +-- +-- And here is the corresponding theard on glasgow-haskell-users: +-- +-- +-- +-- 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/html-test/src/TH.hs b/html-test/src/TH.hs new file mode 100644 index 00000000..f8178bcb --- /dev/null +++ b/html-test/src/TH.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH where + +import Language.Haskell.TH + +decl :: Q [Dec] +decl = [d| f x = x|] diff --git a/html-test/src/TH2.hs b/html-test/src/TH2.hs new file mode 100644 index 00000000..ea85e547 --- /dev/null +++ b/html-test/src/TH2.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH2 where + +import TH + +$( decl ) diff --git a/html-test/src/Test.hs b/html-test/src/Test.hs new file mode 100644 index 00000000..d352f029 --- /dev/null +++ b/html-test/src/Test.hs @@ -0,0 +1,422 @@ +----------------------------------------------------------------------------- +-- | +-- 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', + + withType, withoutType + ) 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) + + [cat] a small, furry, domesticated mammal + + [pineapple] a fruit grown in the tropics + +@ + 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: . +-} + +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 + +-- | Comment on a definition without type signature +withoutType = undefined + +-- | Comment on a definition with type signature +withType :: Int +withType = 1 + +-- 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/html-test/src/Ticket112.hs b/html-test/src/Ticket112.hs new file mode 100644 index 00000000..c9cd5117 --- /dev/null +++ b/html-test/src/Ticket112.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE MagicHash #-} + +module Ticket112 where + +import GHC.Prim + +-- | ...given a raw 'Addr#' to the string, and the length of the string. +f :: a +f = undefined diff --git a/html-test/src/Ticket61.hs b/html-test/src/Ticket61.hs new file mode 100644 index 00000000..26ca287f --- /dev/null +++ b/html-test/src/Ticket61.hs @@ -0,0 +1,3 @@ +module Ticket61 (module Ticket61_Hidden) where + +import Ticket61_Hidden diff --git a/html-test/src/Ticket61_Hidden.hs b/html-test/src/Ticket61_Hidden.hs new file mode 100644 index 00000000..583c10cd --- /dev/null +++ b/html-test/src/Ticket61_Hidden.hs @@ -0,0 +1,7 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Ticket61_Hidden where + +class C a where + -- | A comment about f + f :: a diff --git a/html-test/src/Ticket75.hs b/html-test/src/Ticket75.hs new file mode 100644 index 00000000..94a2f115 --- /dev/null +++ b/html-test/src/Ticket75.hs @@ -0,0 +1,7 @@ +module Ticket75 where + +data a :- b = Q + +-- | A reference to ':-' +f :: Int +f = undefined diff --git a/html-test/src/TypeFamilies.hs b/html-test/src/TypeFamilies.hs new file mode 100644 index 00000000..561f95fd --- /dev/null +++ b/html-test/src/TypeFamilies.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TypeFamilies #-} + +module TypeFamilies where + +-- | Type family G +type family G a :: * + +-- | A class with an associated type +class A a where + -- | An associated type + data B a :: * -> * + -- | A method + f :: B a Int + +-- | Doc for family +type family F a + + +-- | Doc for G Int +type instance G Int = Bool +type instance G Float = Int + + +instance A Int where + data B Int x = Con x + f = Con 3 + +g = Con 5 diff --git a/html-test/src/TypeOperators.hs b/html-test/src/TypeOperators.hs new file mode 100644 index 00000000..edbb9344 --- /dev/null +++ b/html-test/src/TypeOperators.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TypeOperators #-} +module TypeOperators ( + -- * stuff + (:-:), + (:+:), + Op, + O(..), + biO, +) where + +data a :-: b + +data (a :+: b) c + +data a `Op` b + +newtype (g `O` f) a = O { unO :: g (f a) } + +biO :: (g `O` f) a +biO = undefined diff --git a/html-test/src/Unicode.hs.disabled b/html-test/src/Unicode.hs.disabled new file mode 100644 index 00000000..d5bbf445 --- /dev/null +++ b/html-test/src/Unicode.hs.disabled @@ -0,0 +1,6 @@ +module Unicode where + +-- | γλώσσα +x :: Int +x = 1 + diff --git a/html-test/src/Visible.hs b/html-test/src/Visible.hs new file mode 100644 index 00000000..cad71931 --- /dev/null +++ b/html-test/src/Visible.hs @@ -0,0 +1,3 @@ +module Visible where +visible :: Int -> Int +visible a = a diff --git a/html-test/tests/A.hs b/html-test/tests/A.hs deleted file mode 100644 index 606b0865..00000000 --- a/html-test/tests/A.hs +++ /dev/null @@ -1,17 +0,0 @@ -module A where - -data A = A - -other :: Int -other = 2 - --- | Doc for test2 -test2 :: Bool -test2 = False - --- | Should show up on the page for both modules A and B -data X = X -- ^ Doc for consructor - --- | Should show up on the page for both modules A and B -reExport :: Int -reExport = 1 diff --git a/html-test/tests/AdvanceTypes.hs b/html-test/tests/AdvanceTypes.hs deleted file mode 100644 index 939fdf07..00000000 --- a/html-test/tests/AdvanceTypes.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# 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/html-test/tests/B.hs b/html-test/tests/B.hs deleted file mode 100644 index 5fd69acd..00000000 --- a/html-test/tests/B.hs +++ /dev/null @@ -1,8 +0,0 @@ -module B ( module A, test, reExport, X(..) ) where -import A ( A(..), test2, reExport, X(..) ) - --- | This link shouldn't work: 'other'. --- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. --- Module link: "Prelude". -test :: Int -test = 1 diff --git a/html-test/tests/Bug1.hs b/html-test/tests/Bug1.hs deleted file mode 100644 index af1ed4d3..00000000 --- a/html-test/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/html-test/tests/Bug2.hs b/html-test/tests/Bug2.hs deleted file mode 100644 index 9121922e..00000000 --- a/html-test/tests/Bug2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Bug2 ( x ) where -import B -x :: A -x = A diff --git a/html-test/tests/Bug3.hs b/html-test/tests/Bug3.hs deleted file mode 100644 index 67e57892..00000000 --- a/html-test/tests/Bug3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug3 where - --- | /multi-line --- emphasis/ -foo :: Int -foo = undefined diff --git a/html-test/tests/Bug4.hs b/html-test/tests/Bug4.hs deleted file mode 100644 index 425a77aa..00000000 --- a/html-test/tests/Bug4.hs +++ /dev/null @@ -1,5 +0,0 @@ -module Bug4 where --- | don't use apostrophe's in the wrong place's -foo :: Int -foo = undefined - diff --git a/html-test/tests/Bug6.hs b/html-test/tests/Bug6.hs deleted file mode 100644 index 17411f31..00000000 --- a/html-test/tests/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 --- (the field isn't documented separately since it is already documented here) -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/html-test/tests/Bug7.hs b/html-test/tests/Bug7.hs deleted file mode 100644 index 8cf57914..00000000 --- a/html-test/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/html-test/tests/Bug8.hs b/html-test/tests/Bug8.hs deleted file mode 100644 index 18df63c8..00000000 --- a/html-test/tests/Bug8.hs +++ /dev/null @@ -1,14 +0,0 @@ -module Bug8 where - -infix --> -infix ---> - -data Typ = Type (String,[Typ]) - | TFree (String, [String]) - -x --> y = Type("fun",[s,t]) -(--->) = flip $ foldr (-->) - -s = undefined -t = undefined -main = undefined diff --git a/html-test/tests/BugDeprecated.hs b/html-test/tests/BugDeprecated.hs deleted file mode 100644 index 0f7ac2eb..00000000 --- a/html-test/tests/BugDeprecated.hs +++ /dev/null @@ -1,18 +0,0 @@ -module BugDeprecated where - -foo, bar, baz :: Int -foo = 23 -bar = 23 -baz = 23 -{-# DEPRECATED foo "for foo" #-} -{-# DEPRECATED bar "for bar" #-} -{-# DEPRECATED baz "for baz" #-} - --- | some documentation for one, two and three -one, two, three :: Int -one = 23 -two = 23 -three = 23 -{-# DEPRECATED one "for one" #-} -{-# DEPRECATED two "for two" #-} -{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/BugExportHeadings.hs b/html-test/tests/BugExportHeadings.hs deleted file mode 100644 index a5493a08..00000000 --- a/html-test/tests/BugExportHeadings.hs +++ /dev/null @@ -1,29 +0,0 @@ --- test for #192 -module BugExportHeadings ( --- * Foo - foo --- * Bar -, bar --- * Baz -, baz - --- * One -, one --- * Two -, two --- * Three -, three -) where - -foo, bar, baz :: Int -foo = 23 -bar = 23 -baz = 23 - -one, two, three :: Int -one = 23 -two = 23 -three = 23 -{-# DEPRECATED one "for one" #-} -{-# DEPRECATED two "for two" #-} -{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/Bugs.hs b/html-test/tests/Bugs.hs deleted file mode 100644 index 8e1f0079..00000000 --- a/html-test/tests/Bugs.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Bugs where - -data A a = A a (a -> Int) diff --git a/html-test/tests/CrossPackageDocs.hs b/html-test/tests/CrossPackageDocs.hs deleted file mode 100644 index 4d529f79..00000000 --- a/html-test/tests/CrossPackageDocs.hs +++ /dev/null @@ -1,4 +0,0 @@ -module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where - -import System.Process -import Data.String diff --git a/html-test/tests/DeprecatedClass.hs b/html-test/tests/DeprecatedClass.hs deleted file mode 100644 index 018904ab..00000000 --- a/html-test/tests/DeprecatedClass.hs +++ /dev/null @@ -1,15 +0,0 @@ -module DeprecatedClass where - --- | some class -class SomeClass a where - -- | documentation for foo - foo :: a -> a - -{-# DEPRECATED SomeClass "SomeClass" #-} -{-# DEPRECATED foo "foo" #-} - -class SomeOtherClass a where - bar :: a -> a - -{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} -{-# DEPRECATED bar "bar" #-} diff --git a/html-test/tests/DeprecatedData.hs b/html-test/tests/DeprecatedData.hs deleted file mode 100644 index c40ba122..00000000 --- a/html-test/tests/DeprecatedData.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} -module DeprecatedData where - --- | type Foo -data Foo = Foo -- ^ constructor Foo - | Bar -- ^ constructor Bar - -{-# DEPRECATED Foo "Foo" #-} -{-# DEPRECATED Bar "Bar" #-} - -data One = One - | Two - -{-# DEPRECATED One "One" #-} -{-# DEPRECATED Two "Two" #-} diff --git a/html-test/tests/DeprecatedFunction.hs b/html-test/tests/DeprecatedFunction.hs deleted file mode 100644 index 8d626435..00000000 --- a/html-test/tests/DeprecatedFunction.hs +++ /dev/null @@ -1,10 +0,0 @@ -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/html-test/tests/DeprecatedFunction2.hs b/html-test/tests/DeprecatedFunction2.hs deleted file mode 100644 index bdbbf95c..00000000 --- a/html-test/tests/DeprecatedFunction2.hs +++ /dev/null @@ -1,6 +0,0 @@ -module DeprecatedFunction2 where - - -foo :: Int -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedFunction3.hs b/html-test/tests/DeprecatedFunction3.hs deleted file mode 100644 index ca719bda..00000000 --- a/html-test/tests/DeprecatedFunction3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module DeprecatedFunction3 where - - - -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedModule.hs b/html-test/tests/DeprecatedModule.hs deleted file mode 100644 index 369dba4f..00000000 --- a/html-test/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/html-test/tests/DeprecatedModule2.hs b/html-test/tests/DeprecatedModule2.hs deleted file mode 100644 index 94185297..00000000 --- a/html-test/tests/DeprecatedModule2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where - -foo :: Int -foo = 23 diff --git a/html-test/tests/DeprecatedNewtype.hs b/html-test/tests/DeprecatedNewtype.hs deleted file mode 100644 index 254f1f55..00000000 --- a/html-test/tests/DeprecatedNewtype.hs +++ /dev/null @@ -1,10 +0,0 @@ -module DeprecatedNewtype where - --- | some documentation -newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} -{-# DEPRECATED SomeNewType "SomeNewType" #-} -{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} - -newtype SomeOtherNewType = SomeOtherNewTypeConst String -{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} -{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} diff --git a/html-test/tests/DeprecatedReExport.hs b/html-test/tests/DeprecatedReExport.hs deleted file mode 100644 index f851e2ff..00000000 --- a/html-test/tests/DeprecatedReExport.hs +++ /dev/null @@ -1,16 +0,0 @@ --- | --- 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 --- , isEmptyChan -, -) where - -import DeprecatedFunction -import Control.Concurrent.Chan diff --git a/html-test/tests/DeprecatedRecord.hs b/html-test/tests/DeprecatedRecord.hs deleted file mode 100644 index d44499e7..00000000 --- a/html-test/tests/DeprecatedRecord.hs +++ /dev/null @@ -1,9 +0,0 @@ -module DeprecatedRecord where - --- | type Foo -data Foo = Foo { - fooName :: String -- ^ some name -, fooValue :: Int -- ^ some value -} - -{-# DEPRECATED fooValue "do not use this" #-} diff --git a/html-test/tests/DeprecatedTypeFamily.hs b/html-test/tests/DeprecatedTypeFamily.hs deleted file mode 100644 index 70473bb8..00000000 --- a/html-test/tests/DeprecatedTypeFamily.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} -module DeprecatedTypeFamily where - --- | some documentation -data family SomeTypeFamily k :: * -> * -{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} - -data family SomeOtherTypeFamily k :: * -> * -{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/html-test/tests/DeprecatedTypeSynonym.hs b/html-test/tests/DeprecatedTypeSynonym.hs deleted file mode 100644 index 34df47da..00000000 --- a/html-test/tests/DeprecatedTypeSynonym.hs +++ /dev/null @@ -1,9 +0,0 @@ - -module DeprecatedTypeSynonym where - --- | some documentation -type TypeSyn = String -{-# DEPRECATED TypeSyn "TypeSyn" #-} - -type OtherTypeSyn = String -{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} diff --git a/html-test/tests/DeprecationMessageParseError.hs b/html-test/tests/DeprecationMessageParseError.hs deleted file mode 100644 index 2f8fb492..00000000 --- a/html-test/tests/DeprecationMessageParseError.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | --- 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/html-test/tests/Examples.hs b/html-test/tests/Examples.hs deleted file mode 100644 index c8c450f1..00000000 --- a/html-test/tests/Examples.hs +++ /dev/null @@ -1,39 +0,0 @@ -module Examples where - --- | Fibonacci number of given 'Integer'. --- --- Examples: --- --- >>> fib 5 --- 5 --- >>> fib 10 --- 55 --- --- >>> fib 10 --- 55 --- --- One more Example: --- --- >>> fib 5 --- 5 --- --- One more Example: --- --- >>> fib 5 --- 5 --- --- Example with an import: --- --- >>> import Data.Char --- >>> isSpace 'a' --- False --- --- >>> putStrLn "foo\n\nbar" --- foo --- --- bar --- -fib :: Integer -> Integer -fib 0 = 0 -fib 1 = 1 -fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/FunArgs.hs b/html-test/tests/FunArgs.hs deleted file mode 100644 index b34d84b7..00000000 --- a/html-test/tests/FunArgs.hs +++ /dev/null @@ -1,16 +0,0 @@ -module FunArgs where - -f :: forall a. Ord a - => Int -- ^ First argument - -> a -- ^ Second argument - -> Bool -- ^ Third argument - -> (a -> a) -- ^ Fourth argument - -> () -- ^ Result -f = undefined - - -g :: a -- ^ First argument - -> b -- ^ Second argument - -> c -- ^ Third argument - -> d -- ^ Result -g = undefined diff --git a/html-test/tests/GADTRecords.hs b/html-test/tests/GADTRecords.hs deleted file mode 100644 index c77810ad..00000000 --- a/html-test/tests/GADTRecords.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE GADTs #-} -module GADTRecords (H1(..)) where - --- | h1 -data H1 a b where - C1 :: H1 a b - C2 :: Ord a => [a] -> H1 a a - C3 { field :: Int -- ^ hello docs - } :: H1 Int Int - C4 { field2 :: a -- ^ hello2 docs - } :: H1 Int a - diff --git a/html-test/tests/Hash.hs b/html-test/tests/Hash.hs deleted file mode 100644 index 343b69e9..00000000 --- a/html-test/tests/Hash.hs +++ /dev/null @@ -1,51 +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 Data.Array -import Prelude hiding (lookup) - --- | 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) -new = undefined - --- | Inserts a new element into the hash table -insert :: (Eq key, Hash key) => key -> val -> IO () -insert = undefined - --- | 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) -lookup = undefined - --- | 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 - -trunc = undefined -xor = undefined diff --git a/html-test/tests/Hidden.hs b/html-test/tests/Hidden.hs deleted file mode 100644 index 896da648..00000000 --- a/html-test/tests/Hidden.hs +++ /dev/null @@ -1,6 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Hidden where - -hidden :: Int -> Int -hidden a = a diff --git a/html-test/tests/HiddenInstances.hs b/html-test/tests/HiddenInstances.hs deleted file mode 100644 index 99a6c2fd..00000000 --- a/html-test/tests/HiddenInstances.hs +++ /dev/null @@ -1,35 +0,0 @@ --- 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/tests/HiddenInstancesA.hs b/html-test/tests/HiddenInstancesA.hs deleted file mode 100644 index f1775208..00000000 --- a/html-test/tests/HiddenInstancesA.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# 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/tests/HiddenInstancesB.hs b/html-test/tests/HiddenInstancesB.hs deleted file mode 100644 index eabf0637..00000000 --- a/html-test/tests/HiddenInstancesB.hs +++ /dev/null @@ -1,2 +0,0 @@ -module HiddenInstancesB (Foo, Bar) where -import HiddenInstancesA diff --git a/html-test/tests/Hyperlinks.hs b/html-test/tests/Hyperlinks.hs deleted file mode 100644 index 34e64448..00000000 --- a/html-test/tests/Hyperlinks.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Hyperlinks where - --- | --- A plain URL: --- --- A URL with a label: -foo :: Int -foo = 23 diff --git a/html-test/tests/IgnoreExports.hs b/html-test/tests/IgnoreExports.hs deleted file mode 100644 index 0321ad02..00000000 --- a/html-test/tests/IgnoreExports.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# OPTIONS_HADDOCK ignore-exports #-} -module IgnoreExports (foo) where - --- | documentation for foo -foo :: Int -foo = 23 - --- | documentation for bar -bar :: Int -bar = 23 diff --git a/html-test/tests/ModuleWithWarning.hs b/html-test/tests/ModuleWithWarning.hs deleted file mode 100644 index e64d9d7e..00000000 --- a/html-test/tests/ModuleWithWarning.hs +++ /dev/null @@ -1,5 +0,0 @@ --- | Documentation for "ModuleWithWarning". -module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where - -foo :: Int -foo = 23 diff --git a/html-test/tests/NamedDoc.hs b/html-test/tests/NamedDoc.hs deleted file mode 100644 index 7c04ba72..00000000 --- a/html-test/tests/NamedDoc.hs +++ /dev/null @@ -1,4 +0,0 @@ -module NamedDoc where - --- $foo bar - diff --git a/html-test/tests/NoLayout.hs b/html-test/tests/NoLayout.hs deleted file mode 100644 index 19b38b1d..00000000 --- a/html-test/tests/NoLayout.hs +++ /dev/null @@ -1,12 +0,0 @@ - --- Haddock comments are parsed as separate declarations so we --- need to insert a ';' when using them with explicit layout. --- This should probably be changed. - -module NoLayout where { - -- | the function 'g' - ; - g :: Int; - g = undefined - } - diff --git a/html-test/tests/NonGreedy.hs b/html-test/tests/NonGreedy.hs deleted file mode 100644 index f51b55f5..00000000 --- a/html-test/tests/NonGreedy.hs +++ /dev/null @@ -1,5 +0,0 @@ -module NonGreedy where - --- | -f :: a -f = undefined diff --git a/html-test/tests/Properties.hs b/html-test/tests/Properties.hs deleted file mode 100644 index 05930ece..00000000 --- a/html-test/tests/Properties.hs +++ /dev/null @@ -1,9 +0,0 @@ -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/tests/PruneWithWarning.hs b/html-test/tests/PruneWithWarning.hs deleted file mode 100644 index bfa55ea2..00000000 --- a/html-test/tests/PruneWithWarning.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# 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/html-test/tests/QuasiExpr.hs b/html-test/tests/QuasiExpr.hs deleted file mode 100644 index 970759ba..00000000 --- a/html-test/tests/QuasiExpr.hs +++ /dev/null @@ -1,34 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - --- Used by QuasiQuote. Example taken from the GHC documentation. -module QuasiExpr where - -import Language.Haskell.TH -import Language.Haskell.TH.Quote - -data Expr = IntExpr Integer - | AntiIntExpr String - | BinopExpr BinOp Expr Expr - | AntiExpr String - deriving Show - -data BinOp = AddOp - | SubOp - | MulOp - | DivOp - deriving Show - -eval :: Expr -> Integer -eval (IntExpr n) = n -eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) - where - opToFun AddOp = (+) - opToFun SubOp = (-) - opToFun MulOp = (*) - opToFun DivOp = div - -expr = QuasiQuoter parseExprExp undefined undefined undefined - --- cheating... -parseExprExp :: String -> Q Exp -parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/html-test/tests/QuasiQuote.hs b/html-test/tests/QuasiQuote.hs deleted file mode 100644 index 06762cf9..00000000 --- a/html-test/tests/QuasiQuote.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} - --- example taken from the GHC documentation -module QuasiQuote where - -import QuasiExpr - -val :: Integer -val = eval [expr|1 + 2|] diff --git a/html-test/tests/SpuriousSuperclassConstraints.hs b/html-test/tests/SpuriousSuperclassConstraints.hs deleted file mode 100644 index d9e43e1c..00000000 --- a/html-test/tests/SpuriousSuperclassConstraints.hs +++ /dev/null @@ -1,30 +0,0 @@ -{-# 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: --- --- --- --- And here is the corresponding theard on glasgow-haskell-users: --- --- --- --- 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/html-test/tests/TH.hs b/html-test/tests/TH.hs deleted file mode 100644 index f8178bcb..00000000 --- a/html-test/tests/TH.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TH where - -import Language.Haskell.TH - -decl :: Q [Dec] -decl = [d| f x = x|] diff --git a/html-test/tests/TH2.hs b/html-test/tests/TH2.hs deleted file mode 100644 index ea85e547..00000000 --- a/html-test/tests/TH2.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TH2 where - -import TH - -$( decl ) diff --git a/html-test/tests/Test.hs b/html-test/tests/Test.hs deleted file mode 100644 index d352f029..00000000 --- a/html-test/tests/Test.hs +++ /dev/null @@ -1,422 +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', - - withType, withoutType - ) 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) - - [cat] a small, furry, domesticated mammal - - [pineapple] a fruit grown in the tropics - -@ - 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: . --} - -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 - --- | Comment on a definition without type signature -withoutType = undefined - --- | Comment on a definition with type signature -withType :: Int -withType = 1 - --- 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/html-test/tests/Ticket112.hs b/html-test/tests/Ticket112.hs deleted file mode 100644 index c9cd5117..00000000 --- a/html-test/tests/Ticket112.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE MagicHash #-} - -module Ticket112 where - -import GHC.Prim - --- | ...given a raw 'Addr#' to the string, and the length of the string. -f :: a -f = undefined diff --git a/html-test/tests/Ticket61.hs b/html-test/tests/Ticket61.hs deleted file mode 100644 index 26ca287f..00000000 --- a/html-test/tests/Ticket61.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Ticket61 (module Ticket61_Hidden) where - -import Ticket61_Hidden diff --git a/html-test/tests/Ticket61_Hidden.hs b/html-test/tests/Ticket61_Hidden.hs deleted file mode 100644 index 583c10cd..00000000 --- a/html-test/tests/Ticket61_Hidden.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Ticket61_Hidden where - -class C a where - -- | A comment about f - f :: a diff --git a/html-test/tests/Ticket75.hs b/html-test/tests/Ticket75.hs deleted file mode 100644 index 94a2f115..00000000 --- a/html-test/tests/Ticket75.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Ticket75 where - -data a :- b = Q - --- | A reference to ':-' -f :: Int -f = undefined diff --git a/html-test/tests/TypeFamilies.hs b/html-test/tests/TypeFamilies.hs deleted file mode 100644 index 561f95fd..00000000 --- a/html-test/tests/TypeFamilies.hs +++ /dev/null @@ -1,28 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} - -module TypeFamilies where - --- | Type family G -type family G a :: * - --- | A class with an associated type -class A a where - -- | An associated type - data B a :: * -> * - -- | A method - f :: B a Int - --- | Doc for family -type family F a - - --- | Doc for G Int -type instance G Int = Bool -type instance G Float = Int - - -instance A Int where - data B Int x = Con x - f = Con 3 - -g = Con 5 diff --git a/html-test/tests/TypeOperators.hs b/html-test/tests/TypeOperators.hs deleted file mode 100644 index edbb9344..00000000 --- a/html-test/tests/TypeOperators.hs +++ /dev/null @@ -1,20 +0,0 @@ -{-# LANGUAGE TypeOperators #-} -module TypeOperators ( - -- * stuff - (:-:), - (:+:), - Op, - O(..), - biO, -) where - -data a :-: b - -data (a :+: b) c - -data a `Op` b - -newtype (g `O` f) a = O { unO :: g (f a) } - -biO :: (g `O` f) a -biO = undefined diff --git a/html-test/tests/Unicode.hs.disabled b/html-test/tests/Unicode.hs.disabled deleted file mode 100644 index d5bbf445..00000000 --- a/html-test/tests/Unicode.hs.disabled +++ /dev/null @@ -1,6 +0,0 @@ -module Unicode where - --- | γλώσσα -x :: Int -x = 1 - diff --git a/html-test/tests/Visible.hs b/html-test/tests/Visible.hs deleted file mode 100644 index cad71931..00000000 --- a/html-test/tests/Visible.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Visible where -visible :: Int -> Int -visible a = a -- cgit v1.2.3 From 410d8a4f7cfe3b45b98719f75bffc9ac06626fbc Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:34:40 +0200 Subject: Adapt output directory for HTML tests --- .gitignore | 2 +- html-test/accept.lhs | 6 +++--- html-test/run.lhs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'html-test') diff --git a/.gitignore b/.gitignore index 3d242029..b516bcf8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /dist/ -/html-test/output/ +/html-test/out/ /doc/haddock /doc/autom4te.cache/ diff --git a/html-test/accept.lhs b/html-test/accept.lhs index ea55c35c..f6dfc4cd 100755 --- a/html-test/accept.lhs +++ b/html-test/accept.lhs @@ -12,12 +12,12 @@ baseDir = takeDirectory __FILE__ main :: IO () main = do - contents <- filter (not . ignore) <$> getDirectoryContents (baseDir "output") + contents <- filter (not . ignore) <$> getDirectoryContents (baseDir "out") args <- getArgs if not $ null args then - mapM_ copy [ baseDir "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + mapM_ copy [ baseDir "out" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] else - mapM_ copy [ baseDir "output" file | file <- contents] + mapM_ copy [ baseDir "out" file | file <- contents] where ignore = foldr (liftA2 (||)) (const False) [ diff --git a/html-test/run.lhs b/html-test/run.lhs index c543e020..7d3b805b 100755 --- a/html-test/run.lhs +++ b/html-test/run.lhs @@ -27,7 +27,7 @@ packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath baseDir = takeDirectory __FILE__ testDir = baseDir "src" refDir = baseDir "ref" -outDir = baseDir "output" +outDir = baseDir "out" packageRoot = baseDir ".." dataDir = packageRoot "resources" haddockPath = packageRoot "dist" "build" "haddock" "haddock" -- cgit v1.2.3 From cbc8e789b8b6308144ebdaf866ec202fe608647d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 18 Oct 2012 08:42:48 +0200 Subject: Update html-test/README --- html-test/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'html-test') diff --git a/html-test/README b/html-test/README index b5fff14b..082104b0 100644 --- a/html-test/README +++ b/html-test/README @@ -5,8 +5,8 @@ To add a new test: 1) Create a module in the "html-test/src" directory. - 2) Run "cabal test". You should now have output/.html. The test - passes since there is no reference file to compare with. + 2) Run "cabal test". You should now have "html-test/out/.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.lhs -- cgit v1.2.3 From a20efa02eef21b70c2cc3183217b55ce470b2826 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 18 Oct 2012 08:48:02 +0200 Subject: Use markdown for html-test/README --- html-test/README | 24 ------------------------ html-test/README.markdown | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) delete mode 100644 html-test/README create mode 100644 html-test/README.markdown (limited to 'html-test') diff --git a/html-test/README b/html-test/README deleted file mode 100644 index 082104b0..00000000 --- a/html-test/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 "html-test/src" directory. - - 2) Run "cabal test". You should now have "html-test/out/.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.lhs - -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/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/.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 + +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"' -- cgit v1.2.3 From e2c75d48f4dfd4140e977d097a95aa06b614fa24 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 7 Dec 2012 19:52:58 +0100 Subject: Bump version --- doc/haddock.xml | 2 +- haddock.cabal | 2 +- haddock.spec | 2 +- html-test/ref/A.html | 2 +- html-test/ref/AdvanceTypes.html | 2 +- html-test/ref/B.html | 2 +- html-test/ref/Bug1.html | 2 +- html-test/ref/Bug2.html | 2 +- html-test/ref/Bug3.html | 2 +- html-test/ref/Bug4.html | 2 +- html-test/ref/Bug6.html | 2 +- html-test/ref/Bug7.html | 2 +- html-test/ref/Bug8.html | 2 +- html-test/ref/BugDeprecated.html | 2 +- html-test/ref/BugExportHeadings.html | 2 +- html-test/ref/Bugs.html | 2 +- html-test/ref/CrossPackageDocs.html | 2 +- html-test/ref/DeprecatedClass.html | 2 +- html-test/ref/DeprecatedData.html | 2 +- html-test/ref/DeprecatedFunction.html | 2 +- html-test/ref/DeprecatedFunction2.html | 2 +- html-test/ref/DeprecatedFunction3.html | 2 +- html-test/ref/DeprecatedModule.html | 2 +- html-test/ref/DeprecatedModule2.html | 2 +- html-test/ref/DeprecatedNewtype.html | 2 +- html-test/ref/DeprecatedReExport.html | 2 +- html-test/ref/DeprecatedRecord.html | 2 +- html-test/ref/DeprecatedTypeFamily.html | 2 +- html-test/ref/DeprecatedTypeSynonym.html | 2 +- html-test/ref/DeprecationMessageParseError.html | 2 +- html-test/ref/Examples.html | 2 +- html-test/ref/FunArgs.html | 2 +- html-test/ref/GADTRecords.html | 2 +- html-test/ref/Hash.html | 2 +- html-test/ref/HiddenInstances.html | 2 +- html-test/ref/HiddenInstancesB.html | 2 +- html-test/ref/Hyperlinks.html | 2 +- html-test/ref/IgnoreExports.html | 2 +- html-test/ref/ModuleWithWarning.html | 2 +- html-test/ref/NamedDoc.html | 2 +- html-test/ref/NoLayout.html | 2 +- html-test/ref/NonGreedy.html | 2 +- html-test/ref/Properties.html | 2 +- html-test/ref/PruneWithWarning.html | 2 +- html-test/ref/QuasiExpr.html | 2 +- html-test/ref/QuasiQuote.html | 2 +- html-test/ref/SpuriousSuperclassConstraints.html | 2 +- html-test/ref/TH.html | 2 +- html-test/ref/TH2.html | 2 +- html-test/ref/Test.html | 2 +- html-test/ref/Ticket112.html | 2 +- html-test/ref/Ticket61.html | 2 +- html-test/ref/Ticket75.html | 2 +- html-test/ref/TypeFamilies.html | 2 +- html-test/ref/TypeOperators.html | 2 +- html-test/ref/Unicode.html | 2 +- html-test/ref/Visible.html | 2 +- 57 files changed, 57 insertions(+), 57 deletions(-) (limited to 'html-test') diff --git a/doc/haddock.xml b/doc/haddock.xml index 4e4447dc..139b2830 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.13.1, a Haskell + This document describes Haddock version 2.13.2, a Haskell documentation tool. diff --git a/haddock.cabal b/haddock.cabal index 99bf5e4a..06a85364 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.13.1 +version: 2.13.2 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries diff --git a/haddock.spec b/haddock.spec index 401f1e8a..9d6ea8f6 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.13.1 +%define version 2.13.2 %define release 1 Name: %{name} diff --git a/html-test/ref/A.html b/html-test/ref/A.html index 328fec02..9a60933e 100644 --- a/html-test/ref/A.html +++ b/html-test/ref/A.html @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2

        Produced by Haddock version 2.13.1

        version 2.13.2