diff options
author | David Waern <david.waern@gmail.com> | 2010-05-11 19:14:31 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2010-05-11 19:14:31 +0000 |
commit | a7cfb1d83c7e0f97a806e1f2c202416e625b2ce2 (patch) | |
tree | a4154de09f38ddee5e17bc16bfac323a41d9b7b5 /tests/golden-tests | |
parent | c7d9f7678de931e580a3fe1bec2fb0e2dead84d3 (diff) |
Re-organise the testsuite structure
Diffstat (limited to 'tests/golden-tests')
63 files changed, 9534 insertions, 0 deletions
diff --git a/tests/golden-tests/README b/tests/golden-tests/README new file mode 100644 index 00000000..f538cea7 --- /dev/null +++ b/tests/golden-tests/README @@ -0,0 +1,28 @@ + +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 runtests.hs. You should now have output/<modulename>.html. The test + passes since there is no reference file to compare with. + + 3) To make a reference file from the output file, do + runhaskell copy.hs <modulename> + +Tips and tricks: + +You can + runhaskell copy.hs + +to copy all output files into reference files. + +You can + runhaskell runtests.hs all + +to continue despite a failing test. + +You can pass extra options to haddock like so + runhaskell runtests.hs --xhtml all diff --git a/tests/golden-tests/copy.hs b/tests/golden-tests/copy.hs new file mode 100644 index 00000000..fa18fe9c --- /dev/null +++ b/tests/golden-tests/copy.hs @@ -0,0 +1,30 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import Data.List +import Control.Monad +import Text.Regex + + +main = do + args <- getArgs + dir <- getCurrentDirectory + contents <- getDirectoryContents (dir </> "output") + if not $ null args + then + mapM copy [ "output" </> file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM copy [ "output" </> file | file <- contents, ".html" `isSuffixOf` file ] + + +copy file = do + let new = "tests" </> takeFileName file <.> ".ref" + print file + print new + contents <- readFile file + writeFile new (stripLinks contents) + + +stripLinks f = subRegex (mkRegexWithOpts "<A HREF=[^>]*>" False False) f "<A HREF=\"\">" diff --git a/tests/golden-tests/runtests.hs b/tests/golden-tests/runtests.hs new file mode 100644 index 00000000..99a47828 --- /dev/null +++ b/tests/golden-tests/runtests.hs @@ -0,0 +1,114 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import System.Process +import Data.List +import Control.Monad +import Text.Printf +import Text.Regex +import Distribution.Simple.Utils +import Distribution.Simple.Program +import Distribution.Verbosity +import Data.Maybe + + +haddockPath = ".." </> "dist" </> "build" </> "haddock" </> "haddock" + + +main = do + test + putStrLn "All tests passed!" + + +test = do + x <- doesFileExist haddockPath + when (not x) $ die "you need to run 'cabal build' successfully first" + + contents <- getDirectoryContents "tests" + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + x:_ | x /= "all" -> [x ++ ".hs"] + _ -> filter ((==) ".hs" . takeExtension) contents + + let outdir = "output" + let mods' = map ("tests" </>) mods + putStrLn "" + putStrLn "Haddock version: " + h1 <- runProcess haddockPath ["--version"] Nothing + (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing + waitForProcess h1 + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing + waitForProcess h2 + putStrLn "" + + -- TODO: use Distribution.* to get the packages instead + libdir <- rawSystemStdout normal haddockPath ["--print-ghc-libdir"] + let librariesPath = ".."</>".."</>"share"</>"doc"</>"ghc"</>"html"</>"libraries" + + let mkDep name version = + let path = init libdir </> librariesPath </> name ++ "-" ++ version + in "-i " ++ path ++ "," ++ path </> name ++ ".haddock" + + let base = mkDep "base" "4.2.0.0" + process = mkDep "process" "1.0.1.2" + ghcprim = mkDep "ghc-prim" "0.2.0.0" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outdir, "-h", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing (Just [("haddock_datadir", "../.")]) Nothing + Nothing Nothing + + code <- waitForProcess handle + when (code /= ExitSuccess) $ error "Haddock run failed! Exiting." + check mods (if not (null args) && args !! 0 == "all" then False else True) + + +check modules strict = do + forM_ modules $ \mod -> do + let outfile = "output" </> (dropExtension mod ++ ".html") + let reffile = "tests" </> dropExtension mod ++ ".html.ref" + b <- doesFileExist reffile + if b + then do + copyFile reffile ("output" </> 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' = "output" </> takeFileName reffile ++ ".nolinks" + outfile' = "output" </> takeFileName outfile ++ ".nolinks" + writeFile reffile' ref' + writeFile outfile' out' + b <- programOnPath "colordiff" + if b + then system $ "colordiff " ++ reffile' ++ " " ++ outfile' + else system $ "diff " ++ reffile' ++ " " ++ outfile' + if strict then exitFailure else return () + else do + putStrLn $ "Pass: " ++ mod + else do + putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" + + +haddockEq file1 file2 = stripLinks file1 == stripLinks file2 + + +stripLinks f = subRegex (mkRegexWithOpts "<A HREF=[^>]*>" False False) f "<A HREF=\"\">" + + +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) + diff --git a/tests/golden-tests/tests/A.hs b/tests/golden-tests/tests/A.hs new file mode 100644 index 00000000..4a344a24 --- /dev/null +++ b/tests/golden-tests/tests/A.hs @@ -0,0 +1,2 @@ +module A where +data A = A diff --git a/tests/golden-tests/tests/A.html.ref b/tests/golden-tests/tests/A.html.ref new file mode 100644 index 00000000..69567351 --- /dev/null +++ b/tests/golden-tests/tests/A.html.ref @@ -0,0 +1,119 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>A</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_A.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>A</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:A" +><A NAME="t%3AA" +></A +></A +><B +>A</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A" +><A NAME="v%3AA" +></A +></A +><B +>A</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/B.hs b/tests/golden-tests/tests/B.hs new file mode 100644 index 00000000..3a31507e --- /dev/null +++ b/tests/golden-tests/tests/B.hs @@ -0,0 +1,2 @@ +module B ( module A ) where +import A diff --git a/tests/golden-tests/tests/B.html.ref b/tests/golden-tests/tests/B.html.ref new file mode 100644 index 00000000..007d084b --- /dev/null +++ b/tests/golden-tests/tests/B.html.ref @@ -0,0 +1,84 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>B</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_B.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>B</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="">A</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug1.hs b/tests/golden-tests/tests/Bug1.hs new file mode 100644 index 00000000..af1ed4d3 --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/Bug1.html.ref b/tests/golden-tests/tests/Bug1.html.ref new file mode 100644 index 00000000..861b7ee7 --- /dev/null +++ b/tests/golden-tests/tests/Bug1.html.ref @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug1</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug1.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug1</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T</A +> = <A HREF="">T</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T" +><A NAME="t%3AT" +></A +></A +><B +>T</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>We should have different anchors for constructors and types/classes. This + hyperlink should point to the type constructor by default: <TT +><A HREF="">T</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:T" +><A NAME="v%3AT" +></A +></A +><B +>T</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug2.hs b/tests/golden-tests/tests/Bug2.hs new file mode 100644 index 00000000..9121922e --- /dev/null +++ b/tests/golden-tests/tests/Bug2.hs @@ -0,0 +1,4 @@ +module Bug2 ( x ) where +import B +x :: A +x = A diff --git a/tests/golden-tests/tests/Bug2.html.ref b/tests/golden-tests/tests/Bug2.html.ref new file mode 100644 index 00000000..e344bd69 --- /dev/null +++ b/tests/golden-tests/tests/Bug2.html.ref @@ -0,0 +1,90 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug2</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug2.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug2</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:x" +><A NAME="v%3Ax" +></A +></A +><B +>x</B +> :: <A HREF="">A</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug3.hs b/tests/golden-tests/tests/Bug3.hs new file mode 100644 index 00000000..67e57892 --- /dev/null +++ b/tests/golden-tests/tests/Bug3.hs @@ -0,0 +1,6 @@ +module Bug3 where + +-- | /multi-line +-- emphasis/ +foo :: Int +foo = undefined diff --git a/tests/golden-tests/tests/Bug3.html.ref b/tests/golden-tests/tests/Bug3.html.ref new file mode 100644 index 00000000..dc24ddd0 --- /dev/null +++ b/tests/golden-tests/tests/Bug3.html.ref @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug3</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug3.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug3</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">foo</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:foo" +><A NAME="v%3Afoo" +></A +></A +><B +>foo</B +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>/multi-line + emphasis/ +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug4.hs b/tests/golden-tests/tests/Bug4.hs new file mode 100644 index 00000000..425a77aa --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/Bug4.html.ref b/tests/golden-tests/tests/Bug4.html.ref new file mode 100644 index 00000000..1a09fff3 --- /dev/null +++ b/tests/golden-tests/tests/Bug4.html.ref @@ -0,0 +1,115 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug4</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug4.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug4</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">foo</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:foo" +><A NAME="v%3Afoo" +></A +></A +><B +>foo</B +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>don't use apostrophe's in the wrong place's +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug6.hs b/tests/golden-tests/tests/Bug6.hs new file mode 100644 index 00000000..17411f31 --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/Bug6.html.ref b/tests/golden-tests/tests/Bug6.html.ref new file mode 100644 index 00000000..3686fd6d --- /dev/null +++ b/tests/golden-tests/tests/Bug6.html.ref @@ -0,0 +1,482 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug6</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug6.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug6</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Exporting records. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">A</A +> = <A HREF="">A</A +> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">B</A +> = <A HREF="">B</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">b</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">C</A +> = <A HREF="">C</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">c1</A +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">c2</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">D</A +> = <A HREF="">D</A +> <A HREF="">Int</A +> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">E</A +> = <A HREF="">E</A +> <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:A" +><A NAME="t%3AA" +></A +></A +><B +>A</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>This record is exported without its field +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A" +><A NAME="v%3AA" +></A +></A +><B +>A</B +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:B" +><A NAME="t%3AB" +></A +></A +><B +>B</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>.. 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) +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:B" +><A NAME="v%3AB" +></A +></A +><B +>B</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:b" +><A NAME="v%3Ab" +></A +></A +><B +>b</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:C" +><A NAME="t%3AC" +></A +></A +><B +>C</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>.. with fields names as subordinate names in the export +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:C" +><A NAME="v%3AC" +></A +></A +><B +>C</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:c1" +><A NAME="v%3Ac1" +></A +></A +><B +>c1</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:c2" +><A NAME="v%3Ac2" +></A +></A +><B +>c2</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:D" +><A NAME="t%3AD" +></A +></A +><B +>D</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>.. with only some of the fields exported (we can't handle this one - + how do we render the declaration?) +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:D" +><A NAME="v%3AD" +></A +></A +><B +>D</B +> <A HREF="">Int</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:E" +><A NAME="t%3AE" +></A +></A +><B +>E</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>a newtype with a field +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:E" +><A NAME="v%3AE" +></A +></A +><B +>E</B +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug7.hs b/tests/golden-tests/tests/Bug7.hs new file mode 100644 index 00000000..8cf57914 --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/Bug7.html.ref b/tests/golden-tests/tests/Bug7.html.ref new file mode 100644 index 00000000..83ce5323 --- /dev/null +++ b/tests/golden-tests/tests/Bug7.html.ref @@ -0,0 +1,244 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug7</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug7.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug7</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>This module caused a duplicate instance in the documentation for the Foo + type. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">Foo</A +> = <A HREF="">Foo</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">Bar</A +> x y </TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Foo" +><A NAME="t%3AFoo" +></A +></A +><B +>Foo</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>The Foo datatype +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Foo" +><A NAME="v%3AFoo" +></A +></A +><B +>Foo</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Foo')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Foo" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">Bar</A +> <A HREF="">Foo</A +> <A HREF="">Foo</A +></TD +><TD CLASS="rdoc" +>Just one instance +</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:Bar" +><A NAME="t%3ABar" +></A +></A +><B +>Bar</B +> x y </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>The Bar class +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Bar')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Bar" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">Bar</A +> <A HREF="">Foo</A +> <A HREF="">Foo</A +></TD +><TD CLASS="rdoc" +>Just one instance +</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bug8.hs b/tests/golden-tests/tests/Bug8.hs new file mode 100644 index 00000000..0f279c29 --- /dev/null +++ b/tests/golden-tests/tests/Bug8.hs @@ -0,0 +1,17 @@ +{- Note that declarations without type signatures are not included in the + documentation. They could be, but that's a missing feature. -} + +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/tests/golden-tests/tests/Bug8.html.ref b/tests/golden-tests/tests/Bug8.html.ref new file mode 100644 index 00000000..907602b7 --- /dev/null +++ b/tests/golden-tests/tests/Bug8.html.ref @@ -0,0 +1,135 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bug8</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bug8.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bug8</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Typ" +><A NAME="t%3ATyp" +></A +></A +><B +>Typ</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Type" +><A NAME="v%3AType" +></A +></A +><B +>Type</B +> (<A HREF="">String</A +>, [<A HREF="">Typ</A +>])</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:TFree" +><A NAME="v%3ATFree" +></A +></A +><B +>TFree</B +> (<A HREF="">String</A +>, [<A HREF="">String</A +>])</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Bugs.hs b/tests/golden-tests/tests/Bugs.hs new file mode 100644 index 00000000..8e1f0079 --- /dev/null +++ b/tests/golden-tests/tests/Bugs.hs @@ -0,0 +1,3 @@ +module Bugs where + +data A a = A a (a -> Int) diff --git a/tests/golden-tests/tests/Bugs.html.ref b/tests/golden-tests/tests/Bugs.html.ref new file mode 100644 index 00000000..75666af0 --- /dev/null +++ b/tests/golden-tests/tests/Bugs.html.ref @@ -0,0 +1,120 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Bugs</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Bugs.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Bugs</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:A" +><A NAME="t%3AA" +></A +></A +><B +>A</B +> a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A" +><A NAME="v%3AA" +></A +></A +><B +>A</B +> a (a -> <A HREF="">Int</A +>)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/CrossPackageDocs.hs b/tests/golden-tests/tests/CrossPackageDocs.hs new file mode 100644 index 00000000..de55060e --- /dev/null +++ b/tests/golden-tests/tests/CrossPackageDocs.hs @@ -0,0 +1,3 @@ +module CrossPackageDocs (map, Monad(..), runInteractiveProcess) where + +import System.Process diff --git a/tests/golden-tests/tests/CrossPackageDocs.html.ref b/tests/golden-tests/tests/CrossPackageDocs.html.ref new file mode 100644 index 00000000..375984dc --- /dev/null +++ b/tests/golden-tests/tests/CrossPackageDocs.html.ref @@ -0,0 +1,525 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>CrossPackageDocs</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_CrossPackageDocs.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>CrossPackageDocs</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">map</A +> :: (a -> b) -> [a] -> [b]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">Monad</A +> m <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">(>>=)</A +> :: m a -> (a -> m b) -> m b</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">(>>)</A +> :: m a -> m b -> m b</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">return</A +> :: a -> m a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">fail</A +> :: <A HREF="">String</A +> -> m a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">runInteractiveProcess</A +> :: <A HREF="">FilePath</A +> -> [<A HREF="">String</A +>] -> <A HREF="">Maybe</A +> <A HREF="">FilePath</A +> -> <A HREF="">Maybe</A +> [(<A HREF="">String</A +>, <A HREF="">String</A +>)] -> <A HREF="">IO</A +> (<A HREF="">Handle</A +>, <A HREF="">Handle</A +>, <A HREF="">Handle</A +>, <A HREF="">ProcessHandle</A +>)</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:map" +><A NAME="v%3Amap" +></A +></A +><B +>map</B +> :: (a -> b) -> [a] -> [b]</TD +></TR +><TR +><TD CLASS="doc" +><P +><TT +><A HREF="">map</A +></TT +> <TT +>f xs</TT +> is the list obtained by applying <TT +>f</TT +> to each element + of <TT +>xs</TT +>, i.e., +</P +><TT +> map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] + map f [x1, x2, ...] == [f x1, f x2, ...] +</TT +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:Monad" +><A NAME="t%3AMonad" +></A +></A +><B +>Monad</B +> m <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>The <TT +><A HREF="">Monad</A +></TT +> class defines the basic operations over a <EM +>monad</EM +>, +a concept from a branch of mathematics known as <EM +>category theory</EM +>. +From the perspective of a Haskell programmer, however, it is best to +think of a monad as an <EM +>abstract datatype</EM +> of actions. +Haskell's <TT +>do</TT +> expressions provide a convenient syntax for writing +monadic expressions. +</P +><P +>Minimal complete definition: <TT +><A HREF="">>>=</A +></TT +> and <TT +><A HREF="">return</A +></TT +>. +</P +><P +>Instances of <TT +><A HREF="">Monad</A +></TT +> should satisfy the following laws: +</P +><TT +> return a >>= k == k a + m >>= return == m + m >>= (\x -> k x >>= h) == (m >>= k) >>= h +</TT +><P +>Instances of both <TT +><A HREF="">Monad</A +></TT +> and <TT +><A HREF="">Functor</A +></TT +> should additionally satisfy the law: +</P +><TT +> fmap f xs == xs >>= return . f +</TT +><P +>The instances of <TT +><A HREF="">Monad</A +></TT +> for lists, Data.Maybe.Maybe and System.IO.IO +defined in the <A HREF="">Prelude</A +> satisfy these laws. +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:>>=" +><A NAME="v%3A%3E%3E%3D" +></A +></A +><B +>(>>=)</B +> :: m a -> (a -> m b) -> m b</TD +></TR +><TR +><TD CLASS="doc" +>Sequentially compose two actions, passing any value produced + by the first as an argument to the second. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:>>" +><A NAME="v%3A%3E%3E" +></A +></A +><B +>(>>)</B +> :: m a -> m b -> m b</TD +></TR +><TR +><TD CLASS="doc" +>Sequentially compose two actions, discarding any value produced + by the first, like sequencing operators (such as the semicolon) + in imperative languages. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:return" +><A NAME="v%3Areturn" +></A +></A +><B +>return</B +> :: a -> m a</TD +></TR +><TR +><TD CLASS="doc" +>Inject a value into the monadic type. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:fail" +><A NAME="v%3Afail" +></A +></A +><B +>fail</B +> :: <A HREF="">String</A +> -> m a</TD +></TR +><TR +><TD CLASS="doc" +>Fail with a message. This operation is not part of the + mathematical definition of a monad, but is invoked on pattern-match + failure in a <TT +>do</TT +> expression. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Monad')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Monad" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">Monad</A +> []</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Monad</A +> <A HREF="">IO</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Monad</A +> Q</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Monad</A +> <A HREF="">Maybe</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Monad</A +> ((->) r)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:runInteractiveProcess" +><A NAME="v%3ArunInteractiveProcess" +></A +></A +><B +>runInteractiveProcess</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="">FilePath</A +></TD +><TD CLASS="rdoc" +>Filename of the executable +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="">String</A +>]</TD +><TD CLASS="rdoc" +>Arguments to pass to the executable +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">Maybe</A +> <A HREF="">FilePath</A +></TD +><TD CLASS="rdoc" +>Optional path to the working directory +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">Maybe</A +> [(<A HREF="">String</A +>, <A HREF="">String</A +>)]</TD +><TD CLASS="rdoc" +>Optional environment (otherwise inherit) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">IO</A +> (<A HREF="">Handle</A +>, <A HREF="">Handle</A +>, <A HREF="">Handle</A +>, <A HREF="">ProcessHandle</A +>)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>Runs a raw command, and returns <TT +><A HREF="">Handle</A +></TT +>s that may be used to communicate + with the process via its <TT +>stdin</TT +>, <TT +>stdout</TT +> and <TT +>stderr</TT +> respectively. +</P +><P +>For example, to start a process and feed a string to its stdin: +</P +><TT +> (inp,out,err,pid) <- runInteractiveProcess "..." + forkIO (hPutStr inp str) +</TT +><P +>The <TT +><A HREF="">Handle</A +></TT +>s are initially in binary mode; if you need them to be + in text mode then use <TT +><A HREF="">hSetBinaryMode</A +></TT +>. +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Examples.hs b/tests/golden-tests/tests/Examples.hs new file mode 100644 index 00000000..ed22b614 --- /dev/null +++ b/tests/golden-tests/tests/Examples.hs @@ -0,0 +1,34 @@ +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- ghci> fib 5 +-- 5 +-- ghci> fib 10 +-- 55 +-- +-- ghci> fib 10 +-- 55 +-- +-- One more Example: +-- +-- ghci> fib 5 +-- 5 +-- +-- One more Example: +-- +-- ghci> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- ghci> import Data.Char +-- ghci> isSpace 'a' +-- False +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/golden-tests/tests/Examples.html.ref b/tests/golden-tests/tests/Examples.html.ref new file mode 100644 index 00000000..64634d26 --- /dev/null +++ b/tests/golden-tests/tests/Examples.html.ref @@ -0,0 +1,208 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Examples</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Examples.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Examples</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3Afib" +>fib</A +> :: <A HREF=" /home/sol/.install/ghc/ghc-6.12.1/lib/ghc-6.12.1/../../share/doc/ghc/html/libraries/base-4.2.0.0/Prelude.html#t%3AInteger" +>Integer</A +> -> <A HREF=" /home/sol/.install/ghc/ghc-6.12.1/lib/ghc-6.12.1/../../share/doc/ghc/html/libraries/base-4.2.0.0/Prelude.html#t%3AInteger" +>Integer</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:fib" +><A NAME="v%3Afib" +></A +></A +><B +>fib</B +> :: <A HREF=" /home/sol/.install/ghc/ghc-6.12.1/lib/ghc-6.12.1/../../share/doc/ghc/html/libraries/base-4.2.0.0/Prelude.html#t%3AInteger" +>Integer</A +> -> <A HREF=" /home/sol/.install/ghc/ghc-6.12.1/lib/ghc-6.12.1/../../share/doc/ghc/html/libraries/base-4.2.0.0/Prelude.html#t%3AInteger" +>Integer</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>Fibonacci number of given <TT +><A HREF=" /home/sol/.install/ghc/ghc-6.12.1/lib/ghc-6.12.1/../../share/doc/ghc/html/libraries/base-4.2.0.0/Prelude.html#t%3AInteger" +>Integer</A +></TT +>. +</P +><P +>Examples: +</P +><PRE CLASS="screen" +><CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>fib 5 +</CODE +></STRONG +>5 +<CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>fib 10 +</CODE +></STRONG +>55 +</PRE +><PRE CLASS="screen" +><CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>fib 10 +</CODE +></STRONG +>55 +</PRE +><P +>One more Example: +</P +><PRE CLASS="screen" +><CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>fib 5 +</CODE +></STRONG +>5 +</PRE +><P +>One more Example: +</P +><PRE CLASS="screen" +><CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>fib 5 +</CODE +></STRONG +>5 +</PRE +><P +>Example with an import: +</P +><PRE CLASS="screen" +><CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>import Data.Char +</CODE +></STRONG +><CODE CLASS="prompt" +>ghci> </CODE +><STRONG CLASS="userinput" +><CODE +>isSpace 'a' +</CODE +></STRONG +>False +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/FunArgs.hs b/tests/golden-tests/tests/FunArgs.hs new file mode 100644 index 00000000..b34d84b7 --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/FunArgs.html.ref b/tests/golden-tests/tests/FunArgs.html.ref new file mode 100644 index 00000000..f6c34bd4 --- /dev/null +++ b/tests/golden-tests/tests/FunArgs.html.ref @@ -0,0 +1,190 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>FunArgs</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_FunArgs.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>FunArgs</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <SPAN CLASS="keyword" +>forall</SPAN +> a . <A HREF="">Ord</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>First argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>Second argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">Bool</A +></TD +><TD CLASS="rdoc" +>Third argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> (a -> a)</TD +><TD CLASS="rdoc" +>Fourth argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">()</A +></TD +><TD CLASS="rdoc" +>Result +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:g" +><A NAME="v%3Ag" +></A +></A +><B +>g</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +>First argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> b</TD +><TD CLASS="rdoc" +>Second argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> c</TD +><TD CLASS="rdoc" +>Third argument +</TD +></TR +><TR +><TD CLASS="arg" +>-> d</TD +><TD CLASS="rdoc" +>Result +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/GADTRecords.hs b/tests/golden-tests/tests/GADTRecords.hs new file mode 100644 index 00000000..a82cb381 --- /dev/null +++ b/tests/golden-tests/tests/GADTRecords.hs @@ -0,0 +1,12 @@ + +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/tests/golden-tests/tests/GADTRecords.html.ref b/tests/golden-tests/tests/GADTRecords.html.ref new file mode 100644 index 00000000..3875b1c6 --- /dev/null +++ b/tests/golden-tests/tests/GADTRecords.html.ref @@ -0,0 +1,288 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>GADTRecords</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_GADTRecords.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>GADTRecords</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">H1</A +> a b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">C1</A +> :: <A HREF="">H1</A +> a b</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">C2</A +> :: <A HREF="">Ord</A +> a => [a] -> <A HREF="">H1</A +> a a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">C3</A +> :: {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">field</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +>} -> <A HREF="">H1</A +> <A HREF="">Int</A +> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">C4</A +> :: {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">field2</A +> :: a</TD +></TR +></TABLE +>} -> <A HREF="">H1</A +> <A HREF="">Int</A +> a</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:H1" +><A NAME="t%3AH1" +></A +></A +><B +>H1</B +> a b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>h1 +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:C1" +><A NAME="v%3AC1" +></A +></A +><B +>C1</B +> :: <A HREF="">H1</A +> a b</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:C2" +><A NAME="v%3AC2" +></A +></A +><B +>C2</B +> :: <A HREF="">Ord</A +> a => [a] -> <A HREF="">H1</A +> a a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:C3" +><A NAME="v%3AC3" +></A +></A +><B +>C3</B +> :: <A HREF="">Int</A +> -> <A HREF="">H1</A +> <A HREF="">Int</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:field" +><A NAME="v%3Afield" +></A +></A +><B +>field</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>hello docs +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:C4" +><A NAME="v%3AC4" +></A +></A +><B +>C4</B +> :: a -> <A HREF="">H1</A +> <A HREF="">Int</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:field2" +><A NAME="v%3Afield2" +></A +></A +><B +>field2</B +> :: a</TD +><TD CLASS="rdoc" +>hello2 docs +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Hash.hs b/tests/golden-tests/tests/Hash.hs new file mode 100644 index 00000000..7d6506f9 --- /dev/null +++ b/tests/golden-tests/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 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/tests/golden-tests/tests/Hash.html.ref b/tests/golden-tests/tests/Hash.html.ref new file mode 100644 index 00000000..3362368a --- /dev/null +++ b/tests/golden-tests/tests/Hash.html.ref @@ -0,0 +1,476 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Hash</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Hash.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Hash</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="">The <TT +>HashTable</TT +> type +</A +></DT +><DD +><DL +><DT +><A HREF="">Operations on <TT +>HashTable</TT +>s +</A +></DT +></DL +></DD +><DT +><A HREF="">The <TT +>Hash</TT +> class +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">HashTable</A +> key val</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">new</A +> :: (<A HREF="">Eq</A +> key, <A HREF="">Hash</A +> key) => <A HREF="">Int</A +> -> <A HREF="">IO</A +> (<A HREF="">HashTable</A +> key val)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">insert</A +> :: (<A HREF="">Eq</A +> key, <A HREF="">Hash</A +> key) => key -> val -> <A HREF="">IO</A +> <A HREF="">()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">lookup</A +> :: <A HREF="">Hash</A +> key => key -> <A HREF="">IO</A +> (<A HREF="">Maybe</A +> val)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">Hash</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">hash</A +> :: a -> <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="1" +><A NAME="1" +>The <TT +>HashTable</TT +> type +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:HashTable" +><A NAME="t%3AHashTable" +></A +></A +><B +>HashTable</B +> key val </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A hash table with keys of type <TT +>key</TT +> and values of type <TT +>val</TT +>. + The type <TT +>key</TT +> should be an instance of <TT +><A HREF="">Eq</A +></TT +>. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="2" +><A NAME="2" +>Operations on <TT +>HashTable</TT +>s +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:new" +><A NAME="v%3Anew" +></A +></A +><B +>new</B +> :: (<A HREF="">Eq</A +> key, <A HREF="">Hash</A +> key) => <A HREF="">Int</A +> -> <A HREF="">IO</A +> (<A HREF="">HashTable</A +> key val)</TD +></TR +><TR +><TD CLASS="doc" +>Builds a new hash table with a given size +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:insert" +><A NAME="v%3Ainsert" +></A +></A +><B +>insert</B +> :: (<A HREF="">Eq</A +> key, <A HREF="">Hash</A +> key) => key -> val -> <A HREF="">IO</A +> <A HREF="">()</A +></TD +></TR +><TR +><TD CLASS="doc" +>Inserts a new element into the hash table +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:lookup" +><A NAME="v%3Alookup" +></A +></A +><B +>lookup</B +> :: <A HREF="">Hash</A +> key => key -> <A HREF="">IO</A +> (<A HREF="">Maybe</A +> val)</TD +></TR +><TR +><TD CLASS="doc" +>Looks up a key in the hash table, returns <TT +><TT +><A HREF="">Just</A +></TT +> val</TT +> if the key + was found, or <TT +><A HREF="">Nothing</A +></TT +> otherwise. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="3" +><A NAME="3" +>The <TT +>Hash</TT +> class +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:Hash" +><A NAME="t%3AHash" +></A +></A +><B +>Hash</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A class of types which can be hashed. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:hash" +><A NAME="v%3Ahash" +></A +></A +><B +>hash</B +> :: a -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>hashes the value of type <TT +>a</TT +> into an <TT +><A HREF="">Int</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Hash')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Hash" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">Hash</A +> <A HREF="">Float</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Hash</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>(<A HREF="">Hash</A +> a, <A HREF="">Hash</A +> b) => <A HREF="">Hash</A +> (a, b)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Hidden.hs b/tests/golden-tests/tests/Hidden.hs new file mode 100644 index 00000000..896da648 --- /dev/null +++ b/tests/golden-tests/tests/Hidden.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Hidden where + +hidden :: Int -> Int +hidden a = a diff --git a/tests/golden-tests/tests/NamedDoc.hs b/tests/golden-tests/tests/NamedDoc.hs new file mode 100644 index 00000000..7c04ba72 --- /dev/null +++ b/tests/golden-tests/tests/NamedDoc.hs @@ -0,0 +1,4 @@ +module NamedDoc where + +-- $foo bar + diff --git a/tests/golden-tests/tests/NamedDoc.html.ref b/tests/golden-tests/tests/NamedDoc.html.ref new file mode 100644 index 00000000..3b1b7f1e --- /dev/null +++ b/tests/golden-tests/tests/NamedDoc.html.ref @@ -0,0 +1,98 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>NamedDoc</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_NamedDoc.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>NamedDoc</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +>bar +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/NoLayout.hs b/tests/golden-tests/tests/NoLayout.hs new file mode 100644 index 00000000..ac8e58bb --- /dev/null +++ b/tests/golden-tests/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 class 'C' + ; + g :: Int; + g = undefined + } + diff --git a/tests/golden-tests/tests/NoLayout.html.ref b/tests/golden-tests/tests/NoLayout.html.ref new file mode 100644 index 00000000..7b365bd1 --- /dev/null +++ b/tests/golden-tests/tests/NoLayout.html.ref @@ -0,0 +1,115 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>NoLayout</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_NoLayout.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>NoLayout</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">g</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:g" +><A NAME="v%3Ag" +></A +></A +><B +>g</B +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>the class C +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/NonGreedy.hs b/tests/golden-tests/tests/NonGreedy.hs new file mode 100644 index 00000000..f51b55f5 --- /dev/null +++ b/tests/golden-tests/tests/NonGreedy.hs @@ -0,0 +1,5 @@ +module NonGreedy where + +-- | <url1> <url2> +f :: a +f = undefined diff --git a/tests/golden-tests/tests/NonGreedy.html.ref b/tests/golden-tests/tests/NonGreedy.html.ref new file mode 100644 index 00000000..670fc34a --- /dev/null +++ b/tests/golden-tests/tests/NonGreedy.html.ref @@ -0,0 +1,115 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>NonGreedy</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_NonGreedy.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>NonGreedy</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">f</A +> :: a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +> :: a</TD +></TR +><TR +><TD CLASS="doc" +><A HREF="">url1</A +> <A HREF="">url2</A +> +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/QuasiExpr.hs b/tests/golden-tests/tests/QuasiExpr.hs new file mode 100644 index 00000000..6fc00a72 --- /dev/null +++ b/tests/golden-tests/tests/QuasiExpr.hs @@ -0,0 +1,36 @@ +{-# LANGUAGE TemplateHaskell #-} + +-- Used by QuasiQuote. Example taken from the GHC documentation. +module QuasiExpr where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote +import Data.Typeable +import Data.Generics + +data Expr = IntExpr Integer + | AntiIntExpr String + | BinopExpr BinOp Expr Expr + | AntiExpr String + deriving(Show, Typeable, Data) + +data BinOp = AddOp + | SubOp + | MulOp + | DivOp + deriving(Show, Typeable, Data) + +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 + +-- cheating... +parseExprExp :: String -> Q Exp +parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/tests/golden-tests/tests/QuasiExpr.html.ref b/tests/golden-tests/tests/QuasiExpr.html.ref new file mode 100644 index 00000000..2cb316b1 --- /dev/null +++ b/tests/golden-tests/tests/QuasiExpr.html.ref @@ -0,0 +1,346 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>QuasiExpr</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_QuasiExpr.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>QuasiExpr</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Expr" +><A NAME="t%3AExpr" +></A +></A +><B +>Expr</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:IntExpr" +><A NAME="v%3AIntExpr" +></A +></A +><B +>IntExpr</B +> <A HREF="">Integer</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:AntiIntExpr" +><A NAME="v%3AAntiIntExpr" +></A +></A +><B +>AntiIntExpr</B +> <A HREF="">String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:BinopExpr" +><A NAME="v%3ABinopExpr" +></A +></A +><B +>BinopExpr</B +> <A HREF="">BinOp</A +> <A HREF="">Expr</A +> <A HREF="">Expr</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:AntiExpr" +><A NAME="v%3AAntiExpr" +></A +></A +><B +>AntiExpr</B +> <A HREF="">String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Expr')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Expr" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">Data</A +> <A HREF="">Expr</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Show</A +> <A HREF="">Expr</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Typeable</A +> <A HREF="">Expr</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:BinOp" +><A NAME="t%3ABinOp" +></A +></A +><B +>BinOp</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:AddOp" +><A NAME="v%3AAddOp" +></A +></A +><B +>AddOp</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:SubOp" +><A NAME="v%3ASubOp" +></A +></A +><B +>SubOp</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:MulOp" +><A NAME="v%3AMulOp" +></A +></A +><B +>MulOp</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:DivOp" +><A NAME="v%3ADivOp" +></A +></A +><B +>DivOp</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:BinOp')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:BinOp" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">Data</A +> <A HREF="">BinOp</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Show</A +> <A HREF="">BinOp</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">Typeable</A +> <A HREF="">BinOp</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:eval" +><A NAME="v%3Aeval" +></A +></A +><B +>eval</B +> :: <A HREF="">Expr</A +> -> <A HREF="">Integer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:parseExprExp" +><A NAME="v%3AparseExprExp" +></A +></A +><B +>parseExprExp</B +> :: <A HREF="">String</A +> -> Q Exp</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/QuasiQuote.hs b/tests/golden-tests/tests/QuasiQuote.hs new file mode 100644 index 00000000..ed3c3787 --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/QuasiQuote.html.ref b/tests/golden-tests/tests/QuasiQuote.html.ref new file mode 100644 index 00000000..4de6086b --- /dev/null +++ b/tests/golden-tests/tests/QuasiQuote.html.ref @@ -0,0 +1,90 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>QuasiQuote</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_QuasiQuote.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>QuasiQuote</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:val" +><A NAME="v%3Aval" +></A +></A +><B +>val</B +> :: <A HREF="">Integer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/TH.hs b/tests/golden-tests/tests/TH.hs new file mode 100644 index 00000000..f8178bcb --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/TH.html.ref b/tests/golden-tests/tests/TH.html.ref new file mode 100644 index 00000000..4d2e0b09 --- /dev/null +++ b/tests/golden-tests/tests/TH.html.ref @@ -0,0 +1,89 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TH</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_TH.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>TH</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:decl" +><A NAME="v%3Adecl" +></A +></A +><B +>decl</B +> :: Q [Dec]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/TH2.hs b/tests/golden-tests/tests/TH2.hs new file mode 100644 index 00000000..f8f27710 --- /dev/null +++ b/tests/golden-tests/tests/TH2.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH2 where + +import TH + +-- we can't add a type sig here, so we get no doc +$( decl ) diff --git a/tests/golden-tests/tests/TH2.html.ref b/tests/golden-tests/tests/TH2.html.ref new file mode 100644 index 00000000..f7aaf18f --- /dev/null +++ b/tests/golden-tests/tests/TH2.html.ref @@ -0,0 +1,71 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TH2</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_TH2.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>TH2</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Test.hs b/tests/golden-tests/tests/Test.hs new file mode 100644 index 00000000..230f32d8 --- /dev/null +++ b/tests/golden-tests/tests/Test.hs @@ -0,0 +1,410 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Test +-- Copyright : (c) Simon Marlow 2002 +-- License : BSD-style +-- +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- This module illustrates & tests most of the features of Haddock. +-- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. +-- +----------------------------------------------------------------------------- + +-- This is plain comment, ignored by Haddock. + +module Test ( + + -- Section headings are introduced with '-- *': + -- * Type declarations + + -- Subsection headings are introduced with '-- **' and so on. + -- ** Data types + T(..), T2, T3(..), T4(..), T5(..), T6(..), + N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), + + -- ** Records + R(..), R1(..), + + -- | test that we can export record selectors on their own: + p, q, u, + + -- * Class declarations + C(a,b), D(..), E, F(..), + + -- | Test that we can export a class method on its own: + a, + + -- * Function types + f, g, + + -- * Auxiliary stuff + + -- $aux1 + + -- $aux2 + + -- $aux3 + + -- $aux4 + + -- $aux5 + + -- $aux6 + + -- $aux7 + + -- $aux8 + + -- $aux9 + + -- $aux10 + + -- $aux11 + + -- $aux12 + + -- | This is some inline documentation in the export list + -- + -- > a code block using bird-tracks + -- > each line must begin with > (which isn't significant unless it + -- > is at the beginning of the line). + + -- * A hidden module + module Hidden, + + -- * A visible module + module Visible, + + {-| nested-style doc comments -} + + -- * Existential \/ Universal types + Ex(..), + + -- * Type signatures with argument docs + k, l, m, o, + + -- * A section + -- and without an intervening comma: + -- ** A subsection + +{-| + > a literal line + + $ a non /literal/ line $ +-} + + f' + ) where + +import Hidden +import Visible +import Data.Maybe + +bla = Nothing + +-- | This comment applies to the /following/ declaration +-- and it continues until the next non-comment line +data T a b + = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor + | -- | This comment describes the 'B' constructor + B (T a b, T Int Float) -- ^ + +-- | An abstract data declaration +data T2 a b = T2 a b + +-- | A data declaration with no documentation annotations on the constructors +data T3 a b = A1 a | B1 b + +-- A data declaration with no documentation annotations at all +data T4 a b = A2 a | B2 b + +-- A data declaration documentation on the constructors only +data T5 a b + = A3 a -- ^ documents 'A3' + | B3 b -- ^ documents 'B3' + +-- | Testing alternative comment styles +data T6 + -- | This is the doc for 'A4' + = A4 + | B4 + | -- ^ This is the doc for 'B4' + + -- | This is the doc for 'C4' + C4 + +-- | A newtype +newtype N1 a = N1 a + +-- | A newtype with a fieldname +newtype N2 a b = N2 {n :: a b} + +-- | A newtype with a fieldname, documentation on the field +newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field + } + +-- | An abstract newtype - we show this one as data rather than newtype because +-- the difference isn\'t visible to the programmer for an abstract type. +newtype N4 a b = N4 a + +newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor + } + +newtype N6 a b = N6 {n6 :: a b + } + -- ^ docs on the constructor only + +-- | docs on the newtype and the constructor +newtype N7 a b = N7 {n7 :: a b + } + -- ^ The 'N7' constructor + + +class (D a) => C a where + -- |this is a description of the 'a' method + a :: IO a + b :: [a] + -- ^ this is a description of the 'b' method + c :: a -- c is hidden in the export list + +-- ^ This comment applies to the /previous/ declaration (the 'C' class) + +class D a where + d :: T a b + e :: (a,a) +-- ^ This is a class declaration with no separate docs for the methods + +instance D Int where + d = undefined + e = undefined + +-- instance with a qualified class name +instance Test.D Float where + d = undefined + e = undefined + +class E a where + ee :: a +-- ^ This is a class declaration with no methods (or no methods exported) + +-- This is a class declaration with no documentation at all +class F a where + ff :: a + +-- | This is the documentation for the 'R' record, which has four fields, +-- 'p', 'q', 'r', and 's'. +data R = + -- | This is the 'C1' record constructor, with the following fields: + C1 { p :: Int -- ^ This comment applies to the 'p' field + , q :: forall a . a->a -- ^ This comment applies to the 'q' field + , -- | This comment applies to both 'r' and 's' + r,s :: Int + } + | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), + u,v :: Int + } + -- ^ This is the 'C2' record constructor, also with some fields: + +-- | Testing different record commenting styles +data R1 + -- | This is the 'C3' record constructor + = C3 { + -- | The 's1' record selector + s1 :: Int + -- | The 's2' record selector + , s2 :: Int + , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. + -- Since GHC doesn't allow that, I have removed it in this file. + -- ^ The 's3' record selector + } + +-- These section headers are only used when there is no export list to +-- give the structure of the documentation: + +-- * This is a section header (level 1) +-- ** This is a section header (level 2) +-- *** This is a section header (level 3) + +{-| +In a comment string we can refer to identifiers in scope with +single quotes like this: 'T', and we can refer to modules by +using double quotes: "Foo". We can add emphasis /like this/. + + * This is a bulleted list + + - This is the next item (different kind of bullet) + + (1) This is an ordered list + + 2. This is the next item (different kind of bullet) + +@ + This is a block of code, which can include other markup: 'R' + formatting + is + significant +@ + +> this is another block of code + +We can also include URLs in documentation: <http://www.haskell.org/>. +-} + +f :: C a => a -> Int + +-- | we can export foreign declarations too +foreign import ccall g :: Int -> IO CInt + +-- | this doc string has a parse error in it: \' +h :: Int +h = 42 + + +-- $aux1 This is some documentation that is attached to a name ($aux1) +-- rather than a source declaration. The documentation may be +-- referred to in the export list using its name. +-- +-- @ code block in named doc @ + +-- $aux2 This is some documentation that is attached to a name ($aux2) + +-- $aux3 +-- @ code block on its own in named doc @ + +-- $aux4 +-- +-- @ code block on its own in named doc (after newline) @ + +{- $aux5 a nested, named doc comment + + with a paragraph, + + @ and a code block @ +-} + +-- some tests for various arrangements of code blocks: + +{- $aux6 +>test +>test1 + +@ test2 + test3 +@ +-} + +{- $aux7 +@ +test1 +test2 +@ +-} + +{- $aux8 +>test3 +>test4 +-} + +{- $aux9 +@ +test1 +test2 +@ + +>test3 +>test4 +-} + +{- $aux10 +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- This one is currently wrong (Haddock 0.4). The @...@ part is +-- interpreted as part of the bird-tracked code block. +{- $aux11 +aux11: + +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- $aux12 +-- > foo +-- +-- > bar +-- + +-- | A data-type using existential\/universal types +data Ex a + = forall b . C b => Ex1 b + | forall b . Ex2 b + | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file + | Ex4 (forall a . a -> a) + +-- | This is a function with documentation for each argument +k :: T () () -- ^ This argument has type 'T' + -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' + -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ + -> T5 () () -- ^ This argument has a very long description that should + -- hopefully cause some wrapping to happen when it is finally + -- rendered by Haddock in the generated HTML page. + -> IO () -- ^ This is the result type + +-- This function has arg docs but no docs for the function itself +l :: (Int, Int, Float) -- ^ takes a triple + -> Int -- ^ returns an 'Int' + +-- | This function has some arg docs +m :: R + -> N1 () -- ^ one of the arguments + -> IO Int -- ^ and the return value + +-- | This function has some arg docs but not a return value doc + +-- can't use the original name ('n') with GHC +newn :: R -- ^ one of the arguments, an 'R' + -> N1 () -- ^ one of the arguments + -> IO Int +newn = undefined + + +-- | A foreign import with argument docs +foreign import ccall unsafe + o :: Float -- ^ The input float + -> IO Float -- ^ The output float + +-- | We should be able to escape this: \#\#\# + +-- p :: Int +-- can't use the above original definition with GHC +newp :: Int +newp = undefined + +-- | a function with a prime can be referred to as 'f'' +-- but f' doesn't get link'd 'f\'' +f' :: Int + + +-- Add some definitions here so that this file can be compiled with GHC + +data T1 +f = undefined +f' = undefined +type CInt = Int +k = undefined +l = undefined +m = undefined diff --git a/tests/golden-tests/tests/Test.html.ref b/tests/golden-tests/tests/Test.html.ref new file mode 100644 index 00000000..3c839612 --- /dev/null +++ b/tests/golden-tests/tests/Test.html.ref @@ -0,0 +1,3110 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Test</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Test.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Test</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>provisional</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>libraries@haskell.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="">Type declarations +</A +></DT +><DD +><DL +><DT +><A HREF="">Data types +</A +></DT +><DT +><A HREF="">Records +</A +></DT +></DL +></DD +><DT +><A HREF="">Class declarations +</A +></DT +><DT +><A HREF="">Function types +</A +></DT +><DT +><A HREF="">Auxiliary stuff +</A +></DT +><DT +><A HREF="">A hidden module +</A +></DT +><DT +><A HREF="">A visible module +</A +></DT +><DT +><A HREF="">Existential / Universal types +</A +></DT +><DT +><A HREF="">Type signatures with argument docs +</A +></DT +><DT +><A HREF="">A section +</A +></DT +><DD +><DL +><DT +><A HREF="">A subsection +</A +></DT +></DL +></DD +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>This module illustrates & tests most of the features of Haddock. + Testing references from the description: <TT +><A HREF="">T</A +></TT +>, <TT +><A HREF="">f</A +></TT +>, <TT +><A HREF="">g</A +></TT +>, <TT +><A HREF="">visible</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="">A</A +> <A HREF="">Int</A +> (<A HREF="">Maybe</A +> <A HREF="">Float</A +>)</TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">B</A +> (<A HREF="">T</A +> a b, <A HREF="">T</A +> <A HREF="">Int</A +> <A HREF="">Float</A +>)</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T2</A +> a b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T3</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="">A1</A +> a</TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">B1</A +> b</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T4</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="">A2</A +> a</TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">B2</A +> b</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T5</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="">A3</A +> a</TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">B3</A +> b</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">T6</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="">A4</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">B4</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">C4</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">N1</A +> a = <A HREF="">N1</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">N2</A +> a b = <A HREF="">N2</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">n</A +> :: a b</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">N3</A +> a b = <A HREF="">N3</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">n3</A +> :: a b</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">N4</A +> a b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">N5</A +> a b = <A HREF="">N5</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">n5</A +> :: a b</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">N6</A +> a b = <A HREF="">N6</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">n6</A +> :: a b</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">N7</A +> a b = <A HREF="">N7</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">n7</A +> :: a b</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">R</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="">C1</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">p</A +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">q</A +> :: <SPAN CLASS="keyword" +>forall</SPAN +> a. a -> a</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">r</A +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">s</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">C2</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">t</A +> :: T1 -> <A HREF="">T2</A +> <A HREF="">Int</A +> <A HREF="">Int</A +> -> <A HREF="">T3</A +> <A HREF="">Bool</A +> <A HREF="">Bool</A +> -> <A HREF="">T4</A +> <A HREF="">Float</A +> <A HREF="">Float</A +> -> <A HREF="">T5</A +> <A HREF="">()</A +> <A HREF="">()</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">u</A +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">v</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">R1</A +> = <A HREF="">C3</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">s1</A +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">s2</A +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="">s3</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">D</A +> a => <A HREF="">C</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">a</A +> :: <A HREF="">IO</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">b</A +> :: [a]</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">D</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">d</A +> :: <A HREF="">T</A +> a b</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">e</A +> :: (a, a)</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">E</A +> a </TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">F</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">ff</A +> :: a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">f</A +> :: <A HREF="">C</A +> a => a -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">g</A +> :: <A HREF="">Int</A +> -> <A HREF="">IO</A +> CInt</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">hidden</A +> :: <A HREF="">Int</A +> -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="">Visible</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">Ex</A +> a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <SPAN CLASS="keyword" +>forall</SPAN +> b . <A HREF="">C</A +> b => <A HREF="">Ex1</A +> b</TD +></TR +><TR +><TD CLASS="decl" +>| <SPAN CLASS="keyword" +>forall</SPAN +> b . <A HREF="">Ex2</A +> b</TD +></TR +><TR +><TD CLASS="decl" +>| <SPAN CLASS="keyword" +>forall</SPAN +> b . <A HREF="">C</A +> a => <A HREF="">Ex3</A +> b</TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="">Ex4</A +> (<SPAN CLASS="keyword" +>forall</SPAN +> a. a -> a)</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">k</A +> :: <A HREF="">T</A +> <A HREF="">()</A +> <A HREF="">()</A +> -> <A HREF="">T2</A +> <A HREF="">Int</A +> <A HREF="">Int</A +> -> (<A HREF="">T3</A +> <A HREF="">Bool</A +> <A HREF="">Bool</A +> -> <A HREF="">T4</A +> <A HREF="">Float</A +> <A HREF="">Float</A +>) -> <A HREF="">T5</A +> <A HREF="">()</A +> <A HREF="">()</A +> -> <A HREF="">IO</A +> <A HREF="">()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">l</A +> :: (<A HREF="">Int</A +>, <A HREF="">Int</A +>, <A HREF="">Float</A +>) -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">m</A +> :: <A HREF="">R</A +> -> <A HREF="">N1</A +> <A HREF="">()</A +> -> <A HREF="">IO</A +> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">o</A +> :: <A HREF="">Float</A +> -> <A HREF="">IO</A +> <A HREF="">Float</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">f'</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="1" +><A NAME="1" +>Type declarations +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="2" +><A NAME="2" +>Data types +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T" +><A NAME="t%3AT" +></A +></A +><B +>T</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>This comment applies to the <EM +>following</EM +> declaration + and it continues until the next non-comment line +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A" +><A NAME="v%3AA" +></A +></A +><B +>A</B +> <A HREF="">Int</A +> (<A HREF="">Maybe</A +> <A HREF="">Float</A +>)</TD +><TD CLASS="rdoc" +>This comment describes the <TT +><A HREF="">A</A +></TT +> constructor +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:B" +><A NAME="v%3AB" +></A +></A +><B +>B</B +> (<A HREF="">T</A +> a b, <A HREF="">T</A +> <A HREF="">Int</A +> <A HREF="">Float</A +>)</TD +><TD CLASS="rdoc" +>This comment describes the <TT +><A HREF="">B</A +></TT +> constructor +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T2" +><A NAME="t%3AT2" +></A +></A +><B +>T2</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>An abstract data declaration +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T3" +><A NAME="t%3AT3" +></A +></A +><B +>T3</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A data declaration with no documentation annotations on the constructors +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A1" +><A NAME="v%3AA1" +></A +></A +><B +>A1</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:B1" +><A NAME="v%3AB1" +></A +></A +><B +>B1</B +> b</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T4" +><A NAME="t%3AT4" +></A +></A +><B +>T4</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A2" +><A NAME="v%3AA2" +></A +></A +><B +>A2</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:B2" +><A NAME="v%3AB2" +></A +></A +><B +>B2</B +> b</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T5" +><A NAME="t%3AT5" +></A +></A +><B +>T5</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A3" +><A NAME="v%3AA3" +></A +></A +><B +>A3</B +> a</TD +><TD CLASS="rdoc" +>documents <TT +><A HREF="">A3</A +></TT +> +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:B3" +><A NAME="v%3AB3" +></A +></A +><B +>B3</B +> b</TD +><TD CLASS="rdoc" +>documents <TT +><A HREF="">B3</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:T6" +><A NAME="t%3AT6" +></A +></A +><B +>T6</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Testing alternative comment styles +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:A4" +><A NAME="v%3AA4" +></A +></A +><B +>A4</B +></TD +><TD CLASS="rdoc" +>This is the doc for <TT +><A HREF="">A4</A +></TT +> +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:B4" +><A NAME="v%3AB4" +></A +></A +><B +>B4</B +></TD +><TD CLASS="rdoc" +>This is the doc for <TT +><A HREF="">B4</A +></TT +> +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:C4" +><A NAME="v%3AC4" +></A +></A +><B +>C4</B +></TD +><TD CLASS="rdoc" +>This is the doc for <TT +><A HREF="">C4</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:N1" +><A NAME="t%3AN1" +></A +></A +><B +>N1</B +> a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A newtype +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:N1" +><A NAME="v%3AN1" +></A +></A +><B +>N1</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:N2" +><A NAME="t%3AN2" +></A +></A +><B +>N2</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A newtype with a fieldname +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:N2" +><A NAME="v%3AN2" +></A +></A +><B +>N2</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:n" +><A NAME="v%3An" +></A +></A +><B +>n</B +> :: a b</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:N3" +><A NAME="t%3AN3" +></A +></A +><B +>N3</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A newtype with a fieldname, documentation on the field +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:N3" +><A NAME="v%3AN3" +></A +></A +><B +>N3</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:n3" +><A NAME="v%3An3" +></A +></A +><B +>n3</B +> :: a b</TD +><TD CLASS="rdoc" +>this is the <TT +><A HREF="">n3</A +></TT +> field +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:N4" +><A NAME="t%3AN4" +></A +></A +><B +>N4</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>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. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:N5" +><A NAME="t%3AN5" +></A +></A +><B +>N5</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:N5" +><A NAME="v%3AN5" +></A +></A +><B +>N5</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:n5" +><A NAME="v%3An5" +></A +></A +><B +>n5</B +> :: a b</TD +><TD CLASS="rdoc" +>no docs on the datatype or the constructor +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:N6" +><A NAME="t%3AN6" +></A +></A +><B +>N6</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:N6" +><A NAME="v%3AN6" +></A +></A +><B +>N6</B +></TD +><TD CLASS="rdoc" +>docs on the constructor only +</TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:n6" +><A NAME="v%3An6" +></A +></A +><B +>n6</B +> :: a b</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:N7" +><A NAME="t%3AN7" +></A +></A +><B +>N7</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>docs on the newtype and the constructor +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:N7" +><A NAME="v%3AN7" +></A +></A +><B +>N7</B +></TD +><TD CLASS="rdoc" +>The <TT +><A HREF="">N7</A +></TT +> constructor +</TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:n7" +><A NAME="v%3An7" +></A +></A +><B +>n7</B +> :: a b</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="3" +><A NAME="3" +>Records +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:R" +><A NAME="t%3AR" +></A +></A +><B +>R</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>This is the documentation for the <TT +><A HREF="">R</A +></TT +> record, which has four fields, + <TT +><A HREF="">p</A +></TT +>, <TT +><A HREF="">q</A +></TT +>, <TT +><A HREF="">r</A +></TT +>, and <TT +><A HREF="">s</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:C1" +><A NAME="v%3AC1" +></A +></A +><B +>C1</B +></TD +><TD CLASS="rdoc" +>This is the <TT +><A HREF="">C1</A +></TT +> record constructor, with the following fields: +</TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:p" +><A NAME="v%3Ap" +></A +></A +><B +>p</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>This comment applies to the <TT +><A HREF="">p</A +></TT +> field +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:q" +><A NAME="v%3Aq" +></A +></A +><B +>q</B +> :: <SPAN CLASS="keyword" +>forall</SPAN +> a. a -> a</TD +><TD CLASS="rdoc" +>This comment applies to the <TT +><A HREF="">q</A +></TT +> field +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:r" +><A NAME="v%3Ar" +></A +></A +><B +>r</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>This comment applies to both <TT +><A HREF="">r</A +></TT +> and <TT +><A HREF="">s</A +></TT +> +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:s" +><A NAME="v%3As" +></A +></A +><B +>s</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>This comment applies to both <TT +><A HREF="">r</A +></TT +> and <TT +><A HREF="">s</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:C2" +><A NAME="v%3AC2" +></A +></A +><B +>C2</B +></TD +><TD CLASS="rdoc" +>This is the <TT +><A HREF="">C2</A +></TT +> record constructor, also with some fields: +</TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:t" +><A NAME="v%3At" +></A +></A +><B +>t</B +> :: T1 -> <A HREF="">T2</A +> <A HREF="">Int</A +> <A HREF="">Int</A +> -> <A HREF="">T3</A +> <A HREF="">Bool</A +> <A HREF="">Bool</A +> -> <A HREF="">T4</A +> <A HREF="">Float</A +> <A HREF="">Float</A +> -> <A HREF="">T5</A +> <A HREF="">()</A +> <A HREF="">()</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:u" +><A NAME="v%3Au" +></A +></A +><B +>u</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:v" +><A NAME="v%3Av" +></A +></A +><B +>v</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:R1" +><A NAME="t%3AR1" +></A +></A +><B +>R1</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Testing different record commenting styles +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:C3" +><A NAME="v%3AC3" +></A +></A +><B +>C3</B +></TD +><TD CLASS="rdoc" +>This is the <TT +><A HREF="">C3</A +></TT +> record constructor +</TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:s1" +><A NAME="v%3As1" +></A +></A +><B +>s1</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>The <TT +><A HREF="">s1</A +></TT +> record selector +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:s2" +><A NAME="v%3As2" +></A +></A +><B +>s2</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>The <TT +><A HREF="">s2</A +></TT +> record selector +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:s3" +><A NAME="v%3As3" +></A +></A +><B +>s3</B +> :: <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>The <TT +><A HREF="">s3</A +></TT +> record selector +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +>test that we can export record selectors on their own: +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="4" +><A NAME="4" +>Class declarations +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">D</A +> a => <A NAME="t:C" +><A NAME="t%3AC" +></A +></A +><B +>C</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>This comment applies to the <EM +>previous</EM +> declaration (the <TT +><A HREF="">C</A +></TT +> class) +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:a" +><A NAME="v%3Aa" +></A +></A +><B +>a</B +> :: <A HREF="">IO</A +> a</TD +></TR +><TR +><TD CLASS="doc" +>this is a description of the <TT +><A HREF="">a</A +></TT +> method +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:b" +><A NAME="v%3Ab" +></A +></A +><B +>b</B +> :: [a]</TD +></TR +><TR +><TD CLASS="doc" +>this is a description of the <TT +><A HREF="">b</A +></TT +> method +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:D" +><A NAME="t%3AD" +></A +></A +><B +>D</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>This is a class declaration with no separate docs for the methods +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:d" +><A NAME="v%3Ad" +></A +></A +><B +>d</B +> :: <A HREF="">T</A +> a b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:e" +><A NAME="v%3Ae" +></A +></A +><B +>e</B +> :: (a, a)</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:D')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:D" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">D</A +> <A HREF="">Float</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A HREF="">D</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:E" +><A NAME="t%3AE" +></A +></A +><B +>E</B +> a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>This is a class declaration with no methods (or no methods exported) +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:F" +><A NAME="t%3AF" +></A +></A +><B +>F</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:ff" +><A NAME="v%3Aff" +></A +></A +><B +>ff</B +> :: a</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +>Test that we can export a class method on its own: +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="5" +><A NAME="5" +>Function types +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +> :: <A HREF="">C</A +> a => a -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>In a comment string we can refer to identifiers in scope with +single quotes like this: <TT +><A HREF="">T</A +></TT +>, and we can refer to modules by +using double quotes: <A HREF="">Foo</A +>. We can add emphasis <EM +>like this</EM +>. +</P +><UL +><LI +> This is a bulleted list +</LI +><LI +> This is the next item (different kind of bullet) +</LI +></UL +><OL +><LI +> This is an ordered list +</LI +></OL +><P +>2. This is the next item (different kind of bullet) +</P +><PRE +> + This is a block of code, which can include other markup: <TT +><A HREF="">R</A +></TT +> + formatting + is + significant +</PRE +><PRE +> this is another block of code +</PRE +><P +>We can also include URLs in documentation: <A HREF="">http://www.haskell.org/</A +>. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:g" +><A NAME="v%3Ag" +></A +></A +><B +>g</B +> :: <A HREF="">Int</A +> -> <A HREF="">IO</A +> CInt</TD +></TR +><TR +><TD CLASS="doc" +>we can export foreign declarations too +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="6" +><A NAME="6" +>Auxiliary stuff +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>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. +</P +><PRE +> code block in named doc</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +>This is some documentation that is attached to a name ($aux2) +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +> code block on its own in named doc</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +> code block on its own in named doc (after newline)</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>a nested, named doc comment +</P +><P +>with a paragraph, +</P +><PRE +> and a code block</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>test +test1 +</PRE +><PRE +> test2 + test3 +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +> +test1 +test2 +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>test3 +test4 +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +> +test1 +test2 +</PRE +><PRE +>test3 +test4 +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>test3 +test4 +</PRE +><PRE +> +test1 +test2 +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>aux11: +</P +><PRE +>test3 +test4 +</PRE +><PRE +> +test1 +test2 +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +> foo +</PRE +><PRE +> bar +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>This is some inline documentation in the export list +</P +><PRE +> a code block using bird-tracks + each line must begin with > (which isn't significant unless it + is at the beginning of the line). +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="7" +><A NAME="7" +>A hidden module +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:hidden" +><A NAME="v%3Ahidden" +></A +></A +><B +>hidden</B +> :: <A HREF="">Int</A +> -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="8" +><A NAME="8" +>A visible module +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="">Visible</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +>nested-style doc comments +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="9" +><A NAME="9" +>Existential / Universal types +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Ex" +><A NAME="t%3AEx" +></A +></A +><B +>Ex</B +> a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A data-type using existential/universal types +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><SPAN CLASS="keyword" +>forall</SPAN +> b . <A HREF="">C</A +> b => <A NAME="v:Ex1" +><A NAME="v%3AEx1" +></A +></A +><B +>Ex1</B +> b</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><SPAN CLASS="keyword" +>forall</SPAN +> b . <A NAME="v:Ex2" +><A NAME="v%3AEx2" +></A +></A +><B +>Ex2</B +> b</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><SPAN CLASS="keyword" +>forall</SPAN +> b . <A HREF="">C</A +> a => <A NAME="v:Ex3" +><A NAME="v%3AEx3" +></A +></A +><B +>Ex3</B +> b</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:Ex4" +><A NAME="v%3AEx4" +></A +></A +><B +>Ex4</B +> (<SPAN CLASS="keyword" +>forall</SPAN +> a. a -> a)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="10" +><A NAME="10" +>Type signatures with argument docs +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:k" +><A NAME="v%3Ak" +></A +></A +><B +>k</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="">T</A +> <A HREF="">()</A +> <A HREF="">()</A +></TD +><TD CLASS="rdoc" +>This argument has type <TT +><A HREF="">T</A +></TT +> +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">T2</A +> <A HREF="">Int</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>This argument has type 'T2 Int Int' +</TD +></TR +><TR +><TD CLASS="arg" +>-> (<A HREF="">T3</A +> <A HREF="">Bool</A +> <A HREF="">Bool</A +> -> <A HREF="">T4</A +> <A HREF="">Float</A +> <A HREF="">Float</A +>)</TD +><TD CLASS="rdoc" +>This argument has type <TT +>T3 Bool Bool -> T4 Float Float</TT +> +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">T5</A +> <A HREF="">()</A +> <A HREF="">()</A +></TD +><TD CLASS="rdoc" +>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. +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">IO</A +> <A HREF="">()</A +></TD +><TD CLASS="rdoc" +>This is the result type +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>This is a function with documentation for each argument +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:l" +><A NAME="v%3Al" +></A +></A +><B +>l</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: (<A HREF="">Int</A +>, <A HREF="">Int</A +>, <A HREF="">Float</A +>)</TD +><TD CLASS="rdoc" +>takes a triple +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>returns an <TT +><A HREF="">Int</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:m" +><A NAME="v%3Am" +></A +></A +><B +>m</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="">R</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">N1</A +> <A HREF="">()</A +></TD +><TD CLASS="rdoc" +>one of the arguments +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">IO</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +>and the return value +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>This function has some arg docs +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:o" +><A NAME="v%3Ao" +></A +></A +><B +>o</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="">Float</A +></TD +><TD CLASS="rdoc" +>The input float +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="">IO</A +> <A HREF="">Float</A +></TD +><TD CLASS="rdoc" +>The output float +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>A foreign import with argument docs +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="11" +><A NAME="11" +>A section +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="12" +><A NAME="12" +>A subsection +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +> a literal line +</PRE +><P +>$ a non <EM +>literal</EM +> line $ +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:f'" +><A NAME="v%3Af%27" +></A +></A +><B +>f'</B +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>a function with a prime can be referred to as <TT +><A HREF="">f'</A +></TT +> + but f' doesn't get link'd 'f\'' +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Ticket112.hs b/tests/golden-tests/tests/Ticket112.hs new file mode 100644 index 00000000..c9cd5117 --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/Ticket112.html.ref b/tests/golden-tests/tests/Ticket112.html.ref new file mode 100644 index 00000000..9ff3a192 --- /dev/null +++ b/tests/golden-tests/tests/Ticket112.html.ref @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Ticket112</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Ticket112.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Ticket112</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="">f</A +> :: a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +> :: a</TD +></TR +><TR +><TD CLASS="doc" +>...given a raw <TT +><A HREF="">Addr#</A +></TT +> to the string, and the length of the string. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Ticket61.hs b/tests/golden-tests/tests/Ticket61.hs new file mode 100644 index 00000000..26ca287f --- /dev/null +++ b/tests/golden-tests/tests/Ticket61.hs @@ -0,0 +1,3 @@ +module Ticket61 (module Ticket61_Hidden) where + +import Ticket61_Hidden diff --git a/tests/golden-tests/tests/Ticket61.html.ref b/tests/golden-tests/tests/Ticket61.html.ref new file mode 100644 index 00000000..7931bbf8 --- /dev/null +++ b/tests/golden-tests/tests/Ticket61.html.ref @@ -0,0 +1,128 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Ticket61</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Ticket61.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Ticket61</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:C" +><A NAME="t%3AC" +></A +></A +><B +>C</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +> :: a</TD +></TR +><TR +><TD CLASS="doc" +>A comment about f +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Ticket61_Hidden.hs b/tests/golden-tests/tests/Ticket61_Hidden.hs new file mode 100644 index 00000000..583c10cd --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/Ticket75.hs b/tests/golden-tests/tests/Ticket75.hs new file mode 100644 index 00000000..94a2f115 --- /dev/null +++ b/tests/golden-tests/tests/Ticket75.hs @@ -0,0 +1,7 @@ +module Ticket75 where + +data a :- b = Q + +-- | A reference to ':-' +f :: Int +f = undefined diff --git a/tests/golden-tests/tests/Ticket75.html.ref b/tests/golden-tests/tests/Ticket75.html.ref new file mode 100644 index 00000000..1490c1dc --- /dev/null +++ b/tests/golden-tests/tests/Ticket75.html.ref @@ -0,0 +1,174 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Ticket75</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Ticket75.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Ticket75</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> a <A HREF="">:-</A +> b = <A HREF="">Q</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">f</A +> :: <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> a <A NAME="t::-" +><A NAME="t%3A%3A-" +></A +></A +><B +>:-</B +> b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Q" +><A NAME="v%3AQ" +></A +></A +><B +>Q</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +> :: <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>A reference to <TT +><A HREF="">:-</A +></TT +> +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/TypeFamilies.hs b/tests/golden-tests/tests/TypeFamilies.hs new file mode 100644 index 00000000..561f95fd --- /dev/null +++ b/tests/golden-tests/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/tests/golden-tests/tests/TypeFamilies.html.ref b/tests/golden-tests/tests/TypeFamilies.html.ref new file mode 100644 index 00000000..101c5c80 --- /dev/null +++ b/tests/golden-tests/tests/TypeFamilies.html.ref @@ -0,0 +1,316 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TypeFamilies</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_TypeFamilies.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>TypeFamilies</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type family</SPAN +> <A HREF="">G</A +> a :: *</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="">A</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">B</A +> a :: * -> *</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">f</A +> :: <A HREF="">B</A +> a <A HREF="">Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type family</SPAN +> <A HREF="">F</A +> a </TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type family</SPAN +> <A NAME="t:G" +><A NAME="t%3AG" +></A +></A +><B +>G</B +> a :: *</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Type family G +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:A" +><A NAME="t%3AA" +></A +></A +><B +>A</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A class with an associated type +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Associated Types</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:B" +><A NAME="t%3AB" +></A +></A +><B +>B</B +> a :: * -> *</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>An associated type +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:f" +><A NAME="v%3Af" +></A +></A +><B +>f</B +> :: <A HREF="">B</A +> a <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>A method +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:A')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:A" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A HREF="">A</A +> <A HREF="">Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type family</SPAN +> <A NAME="t:F" +><A NAME="t%3AF" +></A +></A +><B +>F</B +> a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Doc for family +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/TypeOperators.hs b/tests/golden-tests/tests/TypeOperators.hs new file mode 100644 index 00000000..aa0fbe8c --- /dev/null +++ b/tests/golden-tests/tests/TypeOperators.hs @@ -0,0 +1,22 @@ +module TypeOperators ( + -- * stuff + (:-:), + (:+:), + Op, + O(..), + biO, + Flip(..) +) 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 + +newtype Flip (~>) b a = Flip { unFlip :: a ~> b } diff --git a/tests/golden-tests/tests/TypeOperators.html.ref b/tests/golden-tests/tests/TypeOperators.html.ref new file mode 100644 index 00000000..787737e7 --- /dev/null +++ b/tests/golden-tests/tests/TypeOperators.html.ref @@ -0,0 +1,388 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TypeOperators</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_TypeOperators.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>TypeOperators</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="">stuff +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> a <A HREF="">:-:</A +> b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> (a <A HREF="">:+:</A +> b) c</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="">Op</A +> a b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">O</A +> g f a = <A HREF="">O</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">unO</A +> :: g (f a)</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="">biO</A +> :: (g `<A HREF="">O</A +>` f) a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="">Flip</A +> (~>) b a = <A HREF="">Flip</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="">unFlip</A +> :: a ~> b</TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="1" +><A NAME="1" +>stuff +</A +></A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> a <A NAME="t::-:" +><A NAME="t%3A%3A-%3A" +></A +></A +><B +>:-:</B +> b </TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> (a <A NAME="t::+:" +><A NAME="t%3A%3A%2B%3A" +></A +></A +><B +>:+:</B +> b) c </TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Op" +><A NAME="t%3AOp" +></A +></A +><B +>Op</B +> a b </TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:O" +><A NAME="t%3AO" +></A +></A +><B +>O</B +> g f a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:O" +><A NAME="v%3AO" +></A +></A +><B +>O</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:unO" +><A NAME="v%3AunO" +></A +></A +><B +>unO</B +> :: g (f a)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:biO" +><A NAME="v%3AbiO" +></A +></A +><B +>biO</B +> :: (g `<A HREF="">O</A +>` f) a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t:Flip" +><A NAME="t%3AFlip" +></A +></A +><B +>Flip</B +> (~>) b a </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Flip" +><A NAME="v%3AFlip" +></A +></A +><B +>Flip</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:unFlip" +><A NAME="v%3AunFlip" +></A +></A +><B +>unFlip</B +> :: a ~> b</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> diff --git a/tests/golden-tests/tests/Visible.hs b/tests/golden-tests/tests/Visible.hs new file mode 100644 index 00000000..cad71931 --- /dev/null +++ b/tests/golden-tests/tests/Visible.hs @@ -0,0 +1,3 @@ +module Visible where +visible :: Int -> Int +visible a = a diff --git a/tests/golden-tests/tests/Visible.html.ref b/tests/golden-tests/tests/Visible.html.ref new file mode 100644 index 00000000..5a16acb0 --- /dev/null +++ b/tests/golden-tests/tests/Visible.html.ref @@ -0,0 +1,91 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Visible</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Visible.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="">Contents</A +></TD +><TD CLASS="topbut" +><A HREF="">Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Visible</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:visible" +><A NAME="v%3Avisible" +></A +></A +><B +>visible</B +> :: <A HREF="">Int</A +> -> <A HREF="">Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="">Haddock</A +> version 2.7.2</TD +></TR +></TABLE +></BODY +></HTML +> |