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