From b19a4bea999c684e092e0ea0feaf02ff8747d2a5 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 4 Apr 2012 16:32:11 +0200 Subject: Add an optional label to URLs --- src/Haddock/Backends/Hoogle.hs | 2 +- src/Haddock/Backends/LaTeX.hs | 6 +++++- src/Haddock/Backends/Xhtml/DocMarkup.hs | 3 ++- src/Haddock/Interface/LexParseRn.hs | 2 +- src/Haddock/Interface/Rename.hs | 2 +- src/Haddock/InterfaceFile.hs | 21 +++++++++++++++------ src/Haddock/Parse.y | 4 ++-- src/Haddock/Types.hs | 10 ++++++++-- src/Haddock/Utils.hs | 4 ++-- 9 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index d27ca80f..25ca65e9 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -247,7 +247,7 @@ markupTag = Markup { markupOrderedList = box (TagL 'o'), markupDefList = box (TagL 'u') . map (\(a,b) -> TagInline "i" a : Str " " : b), markupCodeBlock = box TagPre, - markupURL = box (TagInline "a") . str, + markupHyperlink = \(Hyperlink url mLabel) -> (box (TagInline "a") . str) (fromMaybe url mLabel), markupAName = const $ str "", markupExample = box TagPre . str . unlines . map exampleToString } diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 31ba3b0b..ef72505c 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -1011,7 +1011,7 @@ parLatexMarkup ppId = Markup { markupOrderedList = \p v -> enumeratedList (map ($v) p) $$ text "", markupDefList = \l v -> descriptionList (map (\(a,b) -> (a v, b v)) l), markupCodeBlock = \p _ -> quote (verb (p Verb)) $$ text "", - markupURL = \u _ -> text "\\url" <> braces (text u), + markupHyperlink = \l _ -> markupLink l, markupAName = \_ _ -> empty, markupExample = \e _ -> quote $ verb $ text $ unlines $ map exampleToString e } @@ -1020,6 +1020,10 @@ parLatexMarkup ppId = Markup { fixString Verb s = s fixString Mono s = latexMonoFilter s + markupLink (Hyperlink url mLabel) = case mLabel of + Just label -> text "\\href" <> braces (text url) <> braces (text label) + Nothing -> text "\\url" <> braces (text url) + markupId ppId_ id v = case v of Verb -> theid diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs index 052116ee..e75cfaba 100644 --- a/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -25,6 +25,7 @@ import Haddock.Types import Haddock.Utils import Text.XHtml hiding ( name, title, p, quote ) +import Data.Maybe (fromMaybe) import GHC @@ -46,7 +47,7 @@ parHtmlMarkup qual ppId = Markup { markupOrderedList = ordList, markupDefList = defList, markupCodeBlock = pre, - markupURL = \url -> anchor ! [href url] << url, + markupHyperlink = \(Hyperlink url mLabel) -> anchor ! [href url] << fromMaybe url mLabel, markupAName = \aname -> namedAnchor aname << "", markupPic = \path -> image ! [src path], markupExample = examplesToHtml diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs index 56ed1b42..de006386 100644 --- a/src/Haddock/Interface/LexParseRn.hs +++ b/src/Haddock/Interface/LexParseRn.hs @@ -113,7 +113,7 @@ rename gre = rn DocCodeBlock doc -> DocCodeBlock (rn doc) DocIdentifierUnchecked x -> DocIdentifierUnchecked x DocModule str -> DocModule str - DocURL str -> DocURL str + DocHyperlink l -> DocHyperlink l DocPic str -> DocPic str DocAName str -> DocAName str DocExamples e -> DocExamples e diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index b703da0f..18e5f1d2 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -200,7 +200,7 @@ renameDoc d = case d of DocCodeBlock doc -> do doc' <- renameDoc doc return (DocCodeBlock doc') - DocURL str -> return (DocURL str) + DocHyperlink l -> return (DocHyperlink l) DocPic str -> return (DocPic str) DocAName str -> return (DocAName str) DocExamples e -> return (DocExamples e) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 970093df..ebe15325 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -66,13 +66,13 @@ binaryInterfaceMagic = 0xD0Cface -- we version our interface files accordingly. binaryInterfaceVersion :: Word16 #if __GLASGOW_HASKELL__ == 702 -binaryInterfaceVersion = 20 +binaryInterfaceVersion = 21 #elif __GLASGOW_HASKELL__ == 703 -binaryInterfaceVersion = 20 +binaryInterfaceVersion = 21 #elif __GLASGOW_HASKELL__ == 704 -binaryInterfaceVersion = 20 +binaryInterfaceVersion = 21 #elif __GLASGOW_HASKELL__ == 705 -binaryInterfaceVersion = 20 +binaryInterfaceVersion = 21 #else #error Unknown GHC version #endif @@ -413,6 +413,15 @@ instance Binary Example where result <- get bh return (Example expression result) +instance Binary Hyperlink where + put_ bh (Hyperlink url label) = do + put_ bh url + put_ bh label + get bh = do + url <- get bh + label <- get bh + return (Hyperlink url label) + {-* Generated by DrIFT : Look, but Don't Touch. *-} instance (Binary id) => Binary (Doc id) where @@ -452,7 +461,7 @@ instance (Binary id) => Binary (Doc id) where put_ bh (DocCodeBlock al) = do putByte bh 11 put_ bh al - put_ bh (DocURL am) = do + put_ bh (DocHyperlink am) = do putByte bh 12 put_ bh am put_ bh (DocPic x) = do @@ -511,7 +520,7 @@ instance (Binary id) => Binary (Doc id) where return (DocCodeBlock al) 12 -> do am <- get bh - return (DocURL am) + return (DocHyperlink am) 13 -> do x <- get bh return (DocPic x) diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y index e36e8416..0cc783ee 100644 --- a/src/Haddock/Parse.y +++ b/src/Haddock/Parse.y @@ -10,7 +10,7 @@ module Haddock.Parse where import Haddock.Lex -import Haddock.Types (Doc(..), Example(Example)) +import Haddock.Types (Doc(..), Example(Example), Hyperlink(..)) import Haddock.Doc import HsSyn import RdrName @@ -107,7 +107,7 @@ seq1 :: { Doc RdrName } elem1 :: { Doc RdrName } : STRING { DocString $1 } | '/../' { DocEmphasis (DocString $1) } - | URL { DocURL $1 } + | URL { DocHyperlink (Hyperlink $1 Nothing) } | PIC { DocPic $1 } | ANAME { DocAName $1 } | IDENT { DocIdentifier $1 } diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 048a7ff7..f8890ebf 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -303,7 +303,7 @@ data Doc id | DocOrderedList [Doc id] | DocDefList [(Doc id, Doc id)] | DocCodeBlock (Doc id) - | DocURL String + | DocHyperlink Hyperlink | DocPic String | DocAName String | DocExamples [Example] @@ -315,6 +315,12 @@ instance Monoid (Doc id) where mappend = DocAppend +data Hyperlink = Hyperlink + { hyperlinkUrl :: String + , hyperlinkLabel :: Maybe String + } + + data Example = Example { exampleExpression :: String , exampleResult :: [String] @@ -341,7 +347,7 @@ data DocMarkup id a = Markup , markupOrderedList :: [a] -> a , markupDefList :: [(a,a)] -> a , markupCodeBlock :: a -> a - , markupURL :: String -> a + , markupHyperlink :: Hyperlink -> a , markupAName :: String -> a , markupPic :: String -> a , markupExample :: [Example] -> a diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index 3a2f1d28..ad61e88a 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -416,7 +416,7 @@ markup m (DocUnorderedList ds) = markupUnorderedList m (map (markup m) ds) markup m (DocOrderedList ds) = markupOrderedList m (map (markup m) ds) markup m (DocDefList ds) = markupDefList m (map (markupPair m) ds) markup m (DocCodeBlock d) = markupCodeBlock m (markup m d) -markup m (DocURL url) = markupURL m url +markup m (DocHyperlink l) = markupHyperlink m l markup m (DocAName ref) = markupAName m ref markup m (DocPic img) = markupPic m img markup m (DocExamples e) = markupExample m e @@ -443,7 +443,7 @@ idMarkup = Markup { markupOrderedList = DocOrderedList, markupDefList = DocDefList, markupCodeBlock = DocCodeBlock, - markupURL = DocURL, + markupHyperlink = DocHyperlink, markupAName = DocAName, markupPic = DocPic, markupExample = DocExamples -- cgit v1.2.3 From b8dcf173c272ebf85bbf2b427f84522e1474d092 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 11 Apr 2012 07:54:33 +0200 Subject: Add support for hyperlink labels to parser --- src/Haddock/Parse.y | 11 ++++++++++- src/Haddock/Types.hs | 2 +- tests/unit-tests/parsetests.hs | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y index 0cc783ee..b34b14b9 100644 --- a/src/Haddock/Parse.y +++ b/src/Haddock/Parse.y @@ -107,7 +107,7 @@ seq1 :: { Doc RdrName } elem1 :: { Doc RdrName } : STRING { DocString $1 } | '/../' { DocEmphasis (DocString $1) } - | URL { DocHyperlink (Hyperlink $1 Nothing) } + | URL { DocHyperlink (makeHyperlink $1) } | PIC { DocPic $1 } | ANAME { DocAName $1 } | IDENT { DocIdentifier $1 } @@ -121,6 +121,15 @@ strings :: { String } happyError :: [LToken] -> Maybe a happyError toks = Nothing +-- | Create a `Hyperlink` from given string. +-- +-- A hyperlink consists of a URL and an optional label. The label is separated +-- from the url by one or more whitespace characters. +makeHyperlink :: String -> Hyperlink +makeHyperlink input = case break isSpace $ strip input of + (url, "") -> Hyperlink url Nothing + (url, label) -> Hyperlink url (Just . dropWhile isSpace $ label) + -- | Create an 'Example', stripping superfluous characters as appropriate makeExample :: String -> String -> [String] -> Example makeExample prompt expression result = diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index f8890ebf..0d486ae8 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -318,7 +318,7 @@ instance Monoid (Doc id) where data Hyperlink = Hyperlink { hyperlinkUrl :: String , hyperlinkLabel :: Maybe String - } + } deriving (Eq, Show) data Example = Example diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 7180a79e..0192ebfc 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -9,6 +9,7 @@ import Haddock.Lex (tokenise) import Haddock.Parse (parseParas) import Haddock.Types import Outputable +import Data.Monoid instance Outputable a => Show a where show = showSDoc . ppr @@ -53,8 +54,21 @@ tests = [ input = ">>> putFooBar\nfoo\n\nbar" , result = Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]] } + + -- tests for links + , ParseTest { + input = "" + , result = Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n" + } + + , ParseTest { + input = "" + , result = Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n" + } ] +hyperlink :: String -> Maybe String -> Doc RdrName +hyperlink url = DocHyperlink . Hyperlink url main :: IO () main = do -- cgit v1.2.3 From 108f1588d31c9f7b90f31b15be4489e6067982b0 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 12 Apr 2012 08:23:05 +0200 Subject: Add golden test for hyperlinks --- tests/html-tests/tests/Hyperlinks.hs | 8 +++ tests/html-tests/tests/Hyperlinks.html.ref | 89 +++++++++++++++++++++++++ tests/html-tests/tests/mini_Hyperlinks.html.ref | 31 +++++++++ 3 files changed, 128 insertions(+) create mode 100644 tests/html-tests/tests/Hyperlinks.hs create mode 100644 tests/html-tests/tests/Hyperlinks.html.ref create mode 100644 tests/html-tests/tests/mini_Hyperlinks.html.ref diff --git a/tests/html-tests/tests/Hyperlinks.hs b/tests/html-tests/tests/Hyperlinks.hs new file mode 100644 index 00000000..34e64448 --- /dev/null +++ b/tests/html-tests/tests/Hyperlinks.hs @@ -0,0 +1,8 @@ +module Hyperlinks where + +-- | +-- A plain URL: +-- +-- A URL with a label: +foo :: Int +foo = 23 diff --git a/tests/html-tests/tests/Hyperlinks.html.ref b/tests/html-tests/tests/Hyperlinks.html.ref new file mode 100644 index 00000000..59ec6c26 --- /dev/null +++ b/tests/html-tests/tests/Hyperlinks.html.ref @@ -0,0 +1,89 @@ + +Hyperlinks
Safe HaskellNone

Hyperlinks

Synopsis

Documentation

foo :: Int

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

A URL with a label: some link +

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

Hyperlinks

-- cgit v1.2.3 From 1483f369caaacc25e07f9715b15e49c35205b417 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 16 May 2012 13:37:02 +0200 Subject: Use LANGUAGE pragmas instead of default-extensions in cabal file --- haddock.cabal | 4 ---- src/.ghci | 2 +- src/Haddock/Interface/AttachInstances.hs | 2 +- src/Haddock/InterfaceFile.hs | 2 +- src/Haddock/Utils.hs | 1 + src/Main.hs | 2 +- tests/unit-tests/.ghci | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 9d6f1a9b..609df296 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -104,8 +104,6 @@ executable haddock main-is: Main.hs hs-source-dirs: src - default-extensions: CPP, DeriveDataTypeable, - ScopedTypeVariables, MagicHash ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs other-modules: @@ -165,8 +163,6 @@ library build-depends: QuickCheck >= 2.1 && < 3 hs-source-dirs: src - default-extensions: CPP, DeriveDataTypeable, - ScopedTypeVariables, MagicHash ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs exposed-modules: diff --git a/src/.ghci b/src/.ghci index f00e6d55..3e83f04c 100644 --- a/src/.ghci +++ b/src/.ghci @@ -1 +1 @@ -:set -i../dist/build/autogen -i../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../dist/build/autogen/cabal_macros.h -XCPP -XDeriveDataTypeable -XScopedTypeVariables -XMagicHash +:set -i../dist/build/autogen -i../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../dist/build/autogen/cabal_macros.h diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index c012f2e0..d9f4350f 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE MagicHash #-} +{-# LANGUAGE CPP, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.AttachInstances diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index ebe15325..7abb0583 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index ad61e88a..ef1b0469 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Utils diff --git a/src/Main.hs b/src/Main.hs index 8c15661d..52406821 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,5 +1,5 @@ {-# OPTIONS_GHC -Wwarn #-} -{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE CPP, ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Main diff --git a/tests/unit-tests/.ghci b/tests/unit-tests/.ghci index 10563664..dcc5b13d 100644 --- a/tests/unit-tests/.ghci +++ b/tests/unit-tests/.ghci @@ -1 +1 @@ -:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h -XCPP -XDeriveDataTypeable -XScopedTypeVariables -XMagicHash +:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h -- cgit v1.2.3 From 8344dcced9607de9f969ed2e226346e5ba57df03 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 16 May 2012 14:13:15 +0200 Subject: Fix typo in comment --- src/Haddock/Interface/Create.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 50f468db..6fa6c598 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -764,7 +764,7 @@ extractRecSel nm mdl t tvs (L _ con : rest) = data_ty = foldl (\x y -> noLoc (HsAppTy x y)) (noLoc (HsTyVar t)) (map toTypeNoLoc tvs) --- | Keep exprt items with docs. +-- | Keep export items with docs. pruneExportItems :: [ExportItem Name] -> [ExportItem Name] pruneExportItems = filter hasDoc where -- cgit v1.2.3 From 0730c1b4088fd5d2c36671b0adf3c9e11222e233 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 16 May 2012 14:13:37 +0200 Subject: Add a type signature for a where-binding --- src/Haddock/Interface/Create.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 6fa6c598..32d187a5 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -690,6 +690,7 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap) decls = f (L l (SigD (GenericSig names t))) xs = foldr (\n acc -> L l (SigD (GenericSig [n] t)) : acc) xs names f x xs = x : xs + mkExportItem :: LHsDecl Name -> ErrMsgGhc (Maybe (ExportItem Name)) mkExportItem (L _ (DocD (DocGroup lev docStr))) = do mbDoc <- liftErrMsg $ processDocString dflags gre docStr return $ fmap (ExportGroup lev "") mbDoc -- cgit v1.2.3 From 83a2a6ab67b25eec42c50b99b0b594313b8abe44 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Wed, 11 Jul 2012 17:15:05 +0100 Subject: Update dependencies. --- haddock.cabal | 4 ++-- src/Haddock/InterfaceFile.hs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 1b7eb513..e133e51e 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -91,7 +91,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.4 && < 7.6 + ghc >= 7.4 && < 7.8 if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE @@ -153,7 +153,7 @@ library array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.4 && < 7.6 + ghc >= 7.4 && < 7.8 if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 970093df..c2f1eb5c 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -73,6 +73,8 @@ binaryInterfaceVersion = 20 binaryInterfaceVersion = 20 #elif __GLASGOW_HASKELL__ == 705 binaryInterfaceVersion = 20 +#elif __GLASGOW_HASKELL__ == 706 +binaryInterfaceVersion = 20 #else #error Unknown GHC version #endif -- cgit v1.2.3 From faf426df787f0feea54e8fcef8c9d79393a6bd4d Mon Sep 17 00:00:00 2001 From: David Waern Date: Mon, 23 Jul 2012 16:52:07 +0200 Subject: Bump version number. --- doc/haddock.xml | 2 +- haddock.cabal | 2 +- haddock.spec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 27dd69d8..7ddfdccd 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.11.0, a Haskell + This document describes Haddock version 2.12.0, a Haskell documentation tool. diff --git a/haddock.cabal b/haddock.cabal index c9bad59a..5c950f98 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.11.0 +version: 2.12.0 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries diff --git a/haddock.spec b/haddock.spec index 8b2a5599..d8821a4a 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.11.0 +%define version 2.12.0 %define release 1 Name: %{name} -- cgit v1.2.3 From 2ea02e816f5cdeb7d07ac2e788ab757d1e2e9058 Mon Sep 17 00:00:00 2001 From: David Waern Date: Mon, 23 Jul 2012 16:57:58 +0200 Subject: Update CHANGES. --- CHANGES | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 527a8fe0..6705a357 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Changes in version 2.12.0 + + * Labeled URLs (e.g ) + Changes in version 2.11.0 * Show deprecation messages for identifiers @@ -8,7 +12,7 @@ Changes in version 2.11.0 * Fix reporting of modules safe haskell mode - * Fix a case where we were generating invalid xhtml + * Fix a case where we were generating invalid xhtml * Improved --qual option (no crashes, proper error messages) -- cgit v1.2.3 From 2cbeae0385bddcd294a5b80a4e2c86b66ff3e1cc Mon Sep 17 00:00:00 2001 From: Roman Cheplyaka Date: Wed, 13 Jun 2012 14:31:22 +0300 Subject: Hide "internal" instances This fixes #37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. --- src/Haddock/Interface.hs | 7 +++- src/Haddock/Interface/AttachInstances.hs | 55 ++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs index 09f01883..0003cba2 100644 --- a/src/Haddock/Interface.hs +++ b/src/Haddock/Interface.hs @@ -43,6 +43,7 @@ import Haddock.Utils import Control.Monad import Data.List import qualified Data.Map as Map +import qualified Data.Set as Set import Distribution.Verbosity import System.Directory import System.FilePath @@ -71,8 +72,12 @@ processModules verbosity modules flags extIfaces = do , iface <- ifInstalledIfaces ext ] interfaces <- createIfaces0 verbosity modules flags instIfaceMap + let exportedNames = + Set.unions $ map (Set.fromList . ifaceExports) $ + filter (\i -> not $ OptHide `elem` ifaceOptions i) interfaces + mods = Set.fromList $ map ifaceMod interfaces out verbosity verbose "Attaching instances..." - interfaces' <- attachInstances interfaces instIfaceMap + interfaces' <- attachInstances (exportedNames, mods) interfaces instIfaceMap out verbosity verbose "Building cross-linking environment..." -- Combine the link envs of the external packages into one diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index c012f2e0..089f31b4 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -20,6 +20,7 @@ import Haddock.Convert import Control.Arrow import Data.List import qualified Data.Map as Map +import qualified Data.Set as Set import GHC import Name @@ -36,21 +37,24 @@ import PrelNames import FastString #define FSLIT(x) (mkFastString# (x#)) +type ExportedNames = Set.Set Name +type Modules = Set.Set Module +type ExportInfo = (ExportedNames, Modules) -attachInstances :: [Interface] -> InstIfaceMap -> Ghc [Interface] -attachInstances ifaces instIfaceMap = mapM attach ifaces +attachInstances :: ExportInfo -> [Interface] -> InstIfaceMap -> Ghc [Interface] +attachInstances expInfo ifaces instIfaceMap = mapM attach ifaces where -- TODO: take an IfaceMap as input ifaceMap = Map.fromList [ (ifaceMod i, i) | i <- ifaces ] attach iface = do - newItems <- mapM (attachToExportItem iface ifaceMap instIfaceMap) + newItems <- mapM (attachToExportItem expInfo iface ifaceMap instIfaceMap) (ifaceExportItems iface) return $ iface { ifaceExportItems = newItems } -attachToExportItem :: Interface -> IfaceMap -> InstIfaceMap -> ExportItem Name -> Ghc (ExportItem Name) -attachToExportItem iface ifaceMap instIfaceMap export = +attachToExportItem :: ExportInfo -> Interface -> IfaceMap -> InstIfaceMap -> ExportItem Name -> Ghc (ExportItem Name) +attachToExportItem expInfo iface ifaceMap instIfaceMap export = case export of ExportDecl { expItemDecl = L _ (TyClD d) } -> do mb_info <- getAllInfo (unLoc (tcdLName d)) @@ -59,7 +63,8 @@ attachToExportItem iface ifaceMap instIfaceMap export = expItemInstances = case mb_info of Just (_, _, instances) -> - let insts = map (first synifyInstHead) $ sortImage (first instHead) + let insts = map (first synifyInstHead) $ sortImage (first instHead) $ + filter (\((_,_,cls,tys),_) -> not $ isInstanceHidden expInfo cls tys) [ (instanceHead i, getName i) | i <- instances ] in [ (inst, lookupInstDoc name iface ifaceMap instIfaceMap) | (inst, name) <- insts ] @@ -140,3 +145,41 @@ funTyConName = mkWiredInName gHC_PRIM funTyConKey (ATyCon funTyCon) -- Relevant TyCon BuiltInSyntax + +-------------------------------------------------------------------------------- +-- Filtering hidden instances +-------------------------------------------------------------------------------- + +-- | A class or data type is hidden iff +-- +-- * it is defined in one of the modules that are being processed +-- +-- * and it is not exported by any non-hidden module +isNameHidden :: ExportInfo -> Name -> Bool +isNameHidden (names, modules) name = + nameModule name `Set.member` modules && + not (name `Set.member` names) + +-- | We say that an instance is «hidden» iff its class or any (part) +-- of its type(s) is hidden. +isInstanceHidden :: ExportInfo -> Class -> [Type] -> Bool +isInstanceHidden expInfo cls tys = + instClassHidden || instTypeHidden + where + instClassHidden :: Bool + instClassHidden = isNameHidden expInfo $ getName cls + + instTypeHidden :: Bool + instTypeHidden = any typeHidden tys + + nameHidden :: Name -> Bool + nameHidden = isNameHidden expInfo + + typeHidden :: Type -> Bool + typeHidden t = + case t of + TyVarTy {} -> False + AppTy t1 t2 -> typeHidden t1 || typeHidden t2 + TyConApp tcon args -> nameHidden (getName tcon) || any typeHidden args + FunTy t1 t2 -> typeHidden t1 || typeHidden t2 + ForAllTy _ ty -> typeHidden ty -- cgit v1.2.3 From d7adab3dbda0fc2ebabc2374adf5fab3ecd790ef Mon Sep 17 00:00:00 2001 From: Roman Cheplyaka Date: Wed, 20 Jun 2012 14:08:04 +0300 Subject: Tests for hiding instances (#37) --- tests/html-tests/tests/HiddenInstances.hs | 35 +++++ tests/html-tests/tests/HiddenInstances.html.ref | 169 ++++++++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 tests/html-tests/tests/HiddenInstances.hs create mode 100644 tests/html-tests/tests/HiddenInstances.html.ref diff --git a/tests/html-tests/tests/HiddenInstances.hs b/tests/html-tests/tests/HiddenInstances.hs new file mode 100644 index 00000000..99a6c2fd --- /dev/null +++ b/tests/html-tests/tests/HiddenInstances.hs @@ -0,0 +1,35 @@ +-- http://trac.haskell.org/haddock/ticket/37 +module HiddenInstances (VisibleClass, VisibleData) where + +-- | Should be visible +class VisibleClass a + +-- | Should *not* be visible +class HiddenClass a + +-- | Should *not* be visible +data HiddenData = HiddenData + +-- | Should be visible +data VisibleData = VisibleData + +-- | Should be visible +instance VisibleClass Int + +-- | Should be visible +instance VisibleClass VisibleData + +-- | Should be visible +instance Num VisibleData + +-- | Should *not* be visible +instance VisibleClass HiddenData + +-- | Should *not* be visible +instance HiddenClass Int + +-- | Should *not* be visible +instance HiddenClass VisibleData + +-- | Should *not* be visible +instance HiddenClass HiddenData diff --git a/tests/html-tests/tests/HiddenInstances.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref new file mode 100644 index 00000000..c1b75927 --- /dev/null +++ b/tests/html-tests/tests/HiddenInstances.html.ref @@ -0,0 +1,169 @@ + +HiddenInstances
Safe HaskellNone

HiddenInstances

Synopsis

Documentation

class VisibleClass a

Should be visible +

Instances

VisibleClass Int

Should be visible +

VisibleClass VisibleData

Should be visible +

data VisibleData

Should be visible +

Instances

Num VisibleData

Should be visible +

VisibleClass VisibleData

Should be visible +

-- cgit v1.2.3 From 8fe6416bcc1078540c21984cee7ef453dd9f1cfb Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 20 Jun 2012 15:42:35 +0200 Subject: Add an other test for hiding instances (#37) --- tests/html-tests/tests/HiddenInstancesA.hs | 17 +++ tests/html-tests/tests/HiddenInstancesB.hs | 2 + tests/html-tests/tests/HiddenInstancesB.html.ref | 143 +++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 tests/html-tests/tests/HiddenInstancesA.hs create mode 100644 tests/html-tests/tests/HiddenInstancesB.hs create mode 100644 tests/html-tests/tests/HiddenInstancesB.html.ref diff --git a/tests/html-tests/tests/HiddenInstancesA.hs b/tests/html-tests/tests/HiddenInstancesA.hs new file mode 100644 index 00000000..f1775208 --- /dev/null +++ b/tests/html-tests/tests/HiddenInstancesA.hs @@ -0,0 +1,17 @@ +{-# OPTIONS_HADDOCK hide #-} +module HiddenInstancesA where + +-- | Should be visible +class Foo a + +-- | Should be visible +data Bar + +-- | Should be visible +instance Foo Bar + +-- | Should *not* be visible +data Baz + +-- | Should *not* be visible +instance Foo Baz diff --git a/tests/html-tests/tests/HiddenInstancesB.hs b/tests/html-tests/tests/HiddenInstancesB.hs new file mode 100644 index 00000000..eabf0637 --- /dev/null +++ b/tests/html-tests/tests/HiddenInstancesB.hs @@ -0,0 +1,2 @@ +module HiddenInstancesB (Foo, Bar) where +import HiddenInstancesA diff --git a/tests/html-tests/tests/HiddenInstancesB.html.ref b/tests/html-tests/tests/HiddenInstancesB.html.ref new file mode 100644 index 00000000..4d037bec --- /dev/null +++ b/tests/html-tests/tests/HiddenInstancesB.html.ref @@ -0,0 +1,143 @@ + +HiddenInstancesB
Safe HaskellNone

HiddenInstancesB

Synopsis

Documentation

class Foo a

Should be visible +

Instances

Foo Bar

Should be visible +

data Bar

Should be visible +

Instances

Foo Bar

Should be visible +

-- cgit v1.2.3 From ed9ff6c9ba93f0759d276715fd1162edc4d21ad7 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 13 Aug 2012 22:12:27 +0100 Subject: Improve haddock memory usage --- haddock.cabal | 1 + src/Haddock/Interface/Create.hs | 55 +++++++++++++++++----------- src/Haddock/Interface/LexParseRn.hs | 5 ++- src/Haddock/Interface/ParseModuleHeader.hs | 1 + src/Haddock/Types.hs | 58 +++++++++++++++--------------- 5 files changed, 69 insertions(+), 51 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 5c950f98..116ee00c 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -88,6 +88,7 @@ executable haddock directory, pretty, containers, + deepseq, array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 64995a5f..32f287f5 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -1,4 +1,5 @@ -{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TupleSections, BangPatterns #-} +{-# OPTIONS_GHC -Wwarn #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Create @@ -27,6 +28,7 @@ import Data.Maybe import Data.Monoid import Data.Ord import Control.Applicative +import Control.DeepSeq import Control.Monad import qualified Data.Traversable as T @@ -48,13 +50,13 @@ import FastString (unpackFS) createInterface :: TypecheckedModule -> [Flag] -> IfaceMap -> InstIfaceMap -> ErrMsgGhc Interface createInterface tm flags modMap instIfaceMap = do - let ms = pm_mod_summary . tm_parsed_module $ tm - mi = moduleInfo tm - safety = modInfoSafe mi - mdl = ms_mod ms - dflags = ms_hspp_opts ms - instances = modInfoInstances mi - exportedNames = modInfoExports mi + let ms = pm_mod_summary . tm_parsed_module $ tm + mi = moduleInfo tm + !safety = modInfoSafe mi + mdl = ms_mod ms + dflags = ms_hspp_opts ms + !instances = modInfoInstances mi + !exportedNames = modInfoExports mi (TcGblEnv {tcg_rdr_env = gre, tcg_warns = warnings}, _) = tm_internals_ tm @@ -72,13 +74,13 @@ createInterface tm flags modMap instIfaceMap = do | Flag_IgnoreAllExports `elem` flags = OptIgnoreExports : opts0 | otherwise = opts0 - (info, mbDoc) <- liftErrMsg $ processModuleHeader dflags gre safety mayDocHeader + (!info, mbDoc) <- liftErrMsg $ processModuleHeader dflags gre safety mayDocHeader let declsWithDocs = topDecls group_ (decls, _) = unzip declsWithDocs localInsts = filter (nameIsLocalOrFrom mdl . getName) instances - maps@(docMap, argMap, subMap, declMap) <- + maps@(!docMap, !argMap, !subMap, !declMap) <- liftErrMsg $ mkMaps dflags gre localInsts declsWithDocs let exports0 = fmap (reverse . map unLoc) mayExports @@ -92,24 +94,25 @@ createInterface tm flags modMap instIfaceMap = do exportItems <- mkExportItems modMap mdl warningMap gre exportedNames decls maps exports instances instIfaceMap dflags - let visibleNames = mkVisibleNames exportItems opts + let !visibleNames = mkVisibleNames exportItems opts -- Measure haddock documentation coverage. let prunedExportItems0 = pruneExportItems exportItems - haddockable = 1 + length exportItems -- module + exports - haddocked = (if isJust mbDoc then 1 else 0) + length prunedExportItems0 - coverage = (haddockable, haddocked) + !haddockable = 1 + length exportItems -- module + exports + !haddocked = (if isJust mbDoc then 1 else 0) + length prunedExportItems0 + !coverage = (haddockable, haddocked) -- Prune the export list to just those declarations that have -- documentation, if the 'prune' option is on. - let prunedExportItems + let prunedExportItems' | OptPrune `elem` opts = prunedExportItems0 | otherwise = exportItems + !prunedExportItems = seqList prunedExportItems' `seq` prunedExportItems' - let aliases = + let !aliases = mkAliasMap dflags $ tm_renamed_source tm - return Interface { + return $! Interface { ifaceMod = mdl, ifaceOrigFilename = msHsFilePath ms, ifaceInfo = info, @@ -179,7 +182,7 @@ moduleWarning ws = case ws of NoWarnings -> Nothing WarnSome _ -> Nothing - WarnAll w -> Just (warnToDoc w) + WarnAll w -> Just $! warnToDoc w warnToDoc :: WarningTxt -> Doc id @@ -187,7 +190,8 @@ warnToDoc w = case w of (DeprecatedTxt msg) -> format "Deprecated: " msg (WarningTxt msg) -> format "Warning: " msg where - format x xs = DocWarning . DocParagraph . DocString . concat $ x : map unpackFS xs + format x xs = let !str = force $ concat (x : map unpackFS xs) + in DocWarning $ DocParagraph $ DocString str ------------------------------------------------------------------------------- @@ -254,7 +258,12 @@ mkMaps dflags gre instances decls = do am = [ (n, args) | n <- ns ] ++ zip subNs subArgs sm = [ (n, subNs) | n <- ns ] cm = [ (n, [ldecl]) | n <- ns ++ subNs ] - return (dm, am, sm, cm) + seqList ns `seq` + seqList subNs `seq` + doc `seq` + seqList subDocs `seq` + seqList subArgs `seq` + return (dm, am, sm, cm) instanceMap :: Map SrcSpan Name instanceMap = M.fromList [ (getSrcSpan n, n) | i <- instances, let n = getName i ] @@ -774,7 +783,8 @@ pruneExportItems = filter hasDoc mkVisibleNames :: [ExportItem Name] -> [DocOption] -> [Name] mkVisibleNames exports opts | OptHide `elem` opts = [] - | otherwise = concatMap exportName exports + | otherwise = let ns = concatMap exportName exports + in seqList ns `seq` ns where exportName e@ExportDecl {} = getMainDeclBinder (unL $ expItemDecl e) ++ subs where subs = map fst (expItemSubDocs e) @@ -782,6 +792,9 @@ mkVisibleNames exports opts -- we don't want links to go to them. exportName _ = [] +seqList :: [a] -> () +seqList [] = () +seqList (x : xs) = x `seq` seqList xs -- | Find a stand-alone documentation comment by its name. findNamedDoc :: String -> [HsDecl Name] -> ErrMsgM (Maybe HsDocString) diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs index a5eb1143..3ad9719e 100644 --- a/src/Haddock/Interface/LexParseRn.hs +++ b/src/Haddock/Interface/LexParseRn.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wwarn #-} +{-# LANGUAGE BangPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.LexParseRn @@ -78,7 +80,8 @@ processModuleHeader dflags gre safety mayStr = do tell ["haddock module header parse failed: " ++ msg] return failure Right (hmi, doc) -> do - let hmi' = hmi { hmi_description = rename dflags gre <$> hmi_description hmi } + let !descr = rename dflags gre <$> hmi_description hmi + hmi' = hmi { hmi_description = descr } doc' = rename dflags gre doc return (hmi', Just doc') return (hmi { hmi_safety = Just $ showPpr dflags safety }, doc) diff --git a/src/Haddock/Interface/ParseModuleHeader.hs b/src/Haddock/Interface/ParseModuleHeader.hs index 411b6661..18f4c768 100644 --- a/src/Haddock/Interface/ParseModuleHeader.hs +++ b/src/Haddock/Interface/ParseModuleHeader.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wwarn #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.ParseModuleHeader diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index e1e7ce4b..fbd05fae 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -59,10 +59,10 @@ type DocPaths = (FilePath, Maybe FilePath) -- paths to HTML and sources data Interface = Interface { -- | The module behind this interface. - ifaceMod :: Module + ifaceMod :: !Module -- | Original file name of the module. - , ifaceOrigFilename :: FilePath + , ifaceOrigFilename :: !FilePath -- | Textual information about the module. , ifaceInfo :: !(HaddockModInfo Name) @@ -71,7 +71,7 @@ data Interface = Interface , ifaceDoc :: !(Documentation Name) -- | Documentation header with cross-reference information. - , ifaceRnDoc :: Documentation DocName + , ifaceRnDoc :: !(Documentation DocName) -- | Haddock options for this module (prune, ignore-exports, etc). , ifaceOptions :: ![DocOption] @@ -79,22 +79,22 @@ data Interface = Interface -- | Declarations originating from the module. Excludes declarations without -- names (instances and stand-alone documentation comments). Includes -- names of subordinate declarations mapped to their parent declarations. - , ifaceDeclMap :: Map Name [LHsDecl Name] + , ifaceDeclMap :: !(Map Name [LHsDecl Name]) -- | Documentation of declarations originating from the module (including -- subordinates). - , ifaceDocMap :: DocMap Name - , ifaceArgMap :: ArgMap Name + , ifaceDocMap :: !(DocMap Name) + , ifaceArgMap :: !(ArgMap Name) -- | Documentation of declarations originating from the module (including -- subordinates). - , ifaceRnDocMap :: DocMap DocName - , ifaceRnArgMap :: ArgMap DocName + , ifaceRnDocMap :: !(DocMap DocName) + , ifaceRnArgMap :: !(ArgMap DocName) - , ifaceSubMap :: Map Name [Name] + , ifaceSubMap :: !(Map Name [Name]) , ifaceExportItems :: ![ExportItem Name] - , ifaceRnExportItems :: [ExportItem DocName] + , ifaceRnExportItems :: ![ExportItem DocName] -- | All names exported by the module. , ifaceExports :: ![Name] @@ -105,14 +105,14 @@ data Interface = Interface , ifaceVisibleExports :: ![Name] -- | Aliases of module imports as in @import A.B.C as C@. - , ifaceModuleAliases :: AliasMap + , ifaceModuleAliases :: !AliasMap -- | Instances exported by the module. , ifaceInstances :: ![ClsInst] -- | The number of haddockable and haddocked items in the module, as a -- tuple. Haddockable items are the exports and the module itself. - , ifaceHaddockCoverage :: (Int,Int) + , ifaceHaddockCoverage :: !(Int, Int) } @@ -172,51 +172,51 @@ data ExportItem name = ExportDecl { -- | A declaration. - expItemDecl :: LHsDecl name + expItemDecl :: !(LHsDecl name) -- | Maybe a doc comment, and possibly docs for arguments (if this -- decl is a function or type-synonym). - , expItemMbDoc :: DocForDecl name + , expItemMbDoc :: !(DocForDecl name) -- | Subordinate names, possibly with documentation. - , expItemSubDocs :: [(name, DocForDecl name)] + , expItemSubDocs :: ![(name, DocForDecl name)] -- | Instances relevant to this declaration, possibly with -- documentation. - , expItemInstances :: [DocInstance name] + , expItemInstances :: ![DocInstance name] } -- | An exported entity for which we have no documentation (perhaps because it -- resides in another package). | ExportNoDecl - { expItemName :: name + { expItemName :: !name -- | Subordinate names. - , expItemSubs :: [name] + , expItemSubs :: ![name] } -- | A section heading. | ExportGroup { -- | Section level (1, 2, 3, ...). - expItemSectionLevel :: Int + expItemSectionLevel :: !Int -- | Section id (for hyperlinks). - , expItemSectionId :: String + , expItemSectionId :: !String -- | Section heading text. - , expItemSectionText :: Doc name + , expItemSectionText :: !(Doc name) } -- | Some documentation. - | ExportDoc (Doc name) + | ExportDoc !(Doc name) -- | A cross-reference to another module. - | ExportModule Module + | ExportModule !Module data Documentation name = Documentation { documentationDoc :: Maybe (Doc name) - , documentationWarning :: Maybe (Doc name) + , documentationWarning :: !(Maybe (Doc name)) } deriving Functor @@ -355,11 +355,11 @@ data DocMarkup id a = Markup data HaddockModInfo name = HaddockModInfo - { hmi_description :: Maybe (Doc name) - , hmi_portability :: Maybe String - , hmi_stability :: Maybe String - , hmi_maintainer :: Maybe String - , hmi_safety :: Maybe String + { hmi_description :: (Maybe (Doc name)) + , hmi_portability :: (Maybe String) + , hmi_stability :: (Maybe String) + , hmi_maintainer :: (Maybe String) + , hmi_safety :: (Maybe String) } -- cgit v1.2.3 From 147d9cbcc1d468a2a71ff419aee9c0725a5e70c7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 25 Aug 2012 13:19:34 +0200 Subject: Add missing dependency to library --- haddock.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock.cabal b/haddock.cabal index 116ee00c..f70d6813 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -149,6 +149,7 @@ library directory, pretty, containers, + deepseq, array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, -- cgit v1.2.3 From 16cdfa33ce7a043465a653d87e04c746ab10a797 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 25 Aug 2012 13:50:52 +0200 Subject: Move .ghci to project root --- .ghci | 1 + src/.ghci | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .ghci delete mode 100644 src/.ghci diff --git a/.ghci b/.ghci new file mode 100644 index 00000000..ff2b6637 --- /dev/null +++ b/.ghci @@ -0,0 +1 @@ +:set -isrc -idist/build/autogen -idist/build/haddock/haddock-tmp/ -packageghc -optP-include -optPdist/build/autogen/cabal_macros.h diff --git a/src/.ghci b/src/.ghci deleted file mode 100644 index 3e83f04c..00000000 --- a/src/.ghci +++ /dev/null @@ -1 +0,0 @@ -:set -i../dist/build/autogen -i../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../dist/build/autogen/cabal_macros.h -- cgit v1.2.3 From dd941462345ad638fd00d661e2a3ca239a259ab2 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 25 Aug 2012 13:49:04 +0200 Subject: accept.hs: Ignore some files --- .gitignore | 4 ---- tests/html-tests/accept.hs | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 9bf92b20..7fcbdc38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ /dist/ /doc/haddock -/tests/html-tests/output/ -/tests/html-tests/tests/doc-index.html.ref -/tests/html-tests/tests/index-frames.html.ref -/tests/html-tests/tests/index.html.ref diff --git a/tests/html-tests/accept.hs b/tests/html-tests/accept.hs index 49da5c5a..45b32078 100644 --- a/tests/html-tests/accept.hs +++ b/tests/html-tests/accept.hs @@ -5,17 +5,24 @@ import System.Exit import System.Directory import Data.List import Control.Monad +import Control.Applicative main = do args <- getArgs dir <- getCurrentDirectory - contents <- getDirectoryContents (dir "output") + contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") if not $ null args then mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] else mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + where + ignore = [ + "doc-index.html" + , "index-frames.html" + , "index.html" + ] copy file = do -- cgit v1.2.3 From 62ecd8bdb0c9e1860f676d8ff793621ef56e477d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 25 Aug 2012 13:30:41 +0200 Subject: Update reference renderings (bump version) --- tests/html-tests/tests/A.html.ref | 2 +- tests/html-tests/tests/B.html.ref | 2 +- tests/html-tests/tests/Bug1.html.ref | 2 +- tests/html-tests/tests/Bug2.html.ref | 2 +- tests/html-tests/tests/Bug3.html.ref | 2 +- tests/html-tests/tests/Bug4.html.ref | 2 +- tests/html-tests/tests/Bug6.html.ref | 2 +- tests/html-tests/tests/Bug7.html.ref | 2 +- tests/html-tests/tests/Bug8.html.ref | 2 +- tests/html-tests/tests/BugDeprecated.html.ref | 2 +- tests/html-tests/tests/BugExportHeadings.html.ref | 2 +- tests/html-tests/tests/Bugs.html.ref | 2 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 2 +- tests/html-tests/tests/DeprecatedClass.html.ref | 2 +- tests/html-tests/tests/DeprecatedData.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction2.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction3.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule2.html.ref | 2 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 2 +- tests/html-tests/tests/DeprecatedRecord.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeFamily.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeSynonym.html.ref | 2 +- tests/html-tests/tests/Examples.html.ref | 2 +- tests/html-tests/tests/FunArgs.html.ref | 2 +- tests/html-tests/tests/GADTRecords.html.ref | 2 +- tests/html-tests/tests/Hash.html.ref | 2 +- tests/html-tests/tests/Hyperlinks.html.ref | 2 +- tests/html-tests/tests/IgnoreExports.html.ref | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 2 +- tests/html-tests/tests/NamedDoc.html.ref | 2 +- tests/html-tests/tests/NoLayout.html.ref | 2 +- tests/html-tests/tests/NonGreedy.html.ref | 2 +- tests/html-tests/tests/PruneWithWarning.html.ref | 2 +- tests/html-tests/tests/QuasiExpr.html.ref | 2 +- tests/html-tests/tests/QuasiQuote.html.ref | 2 +- tests/html-tests/tests/TH.html.ref | 2 +- tests/html-tests/tests/TH2.html.ref | 2 +- tests/html-tests/tests/Test.html.ref | 2 +- tests/html-tests/tests/Ticket112.html.ref | 2 +- tests/html-tests/tests/Ticket61.html.ref | 2 +- tests/html-tests/tests/Ticket75.html.ref | 2 +- tests/html-tests/tests/TypeFamilies.html.ref | 2 +- tests/html-tests/tests/TypeOperators.html.ref | 2 +- tests/html-tests/tests/Unicode.html.ref | 2 +- tests/html-tests/tests/Visible.html.ref | 2 +- 47 files changed, 47 insertions(+), 47 deletions(-) diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index 424ce52c..ec9dc975 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.10.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Date: Sun, 26 Aug 2012 13:41:32 +0200 Subject: Update reference renderings (remove links for ()) --- tests/html-tests/tests/FunArgs.html.ref | 4 +-- tests/html-tests/tests/Hash.html.ref | 8 ++--- tests/html-tests/tests/Test.html.ref | 52 +++++++-------------------------- 3 files changed, 13 insertions(+), 51 deletions(-) diff --git a/tests/html-tests/tests/FunArgs.html.ref b/tests/html-tests/tests/FunArgs.html.ref index f3f00f43..0c551487 100644 --- a/tests/html-tests/tests/FunArgs.html.ref +++ b/tests/html-tests/tests/FunArgs.html.ref @@ -105,9 +105,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_FunArgs.html");}; >-> ()-> ()

Result diff --git a/tests/html-tests/tests/Hash.html.ref b/tests/html-tests/tests/Hash.html.ref index 4fbca19a..889ec1d9 100644 --- a/tests/html-tests/tests/Hash.html.ref +++ b/tests/html-tests/tests/Hash.html.ref @@ -113,9 +113,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");}; >Hash key) => key -> val -> IO () ()

  • lookupHash key) => key -> val -> IO ()

    ()

    Inserts a new element into the hash table diff --git a/tests/html-tests/tests/Test.html.ref b/tests/html-tests/tests/Test.html.ref index ea3b193a..3ee3706b 100644 --- a/tests/html-tests/tests/Test.html.ref +++ b/tests/html-tests/tests/Test.html.ref @@ -410,11 +410,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");}; >Float -> T5 () ()

  • () ()
  • uk :: T () () -> () () -> T2 IntFloat) -> T5 () () -> () () -> IO ()
  • ()
  • lR -> N1 () -> () -> IO IntFloat -> T5 () () () ()
     
    :: T () () () ()

    This argument has type -> T5 () () () ()

    This argument has a very long description that should @@ -2055,9 +2027,7 @@ test2 >-> IO () ()

    This is the result type @@ -2135,9 +2105,7 @@ test2 >-> N1 () ()

    one of the arguments -- cgit v1.2.3 From a427422fae865a06f5fa23d904e7e12cc5b1af6e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 26 Aug 2012 13:54:24 +0200 Subject: Update documentation of `runInteractiveProcess` in reference rendering --- tests/html-tests/tests/CrossPackageDocs.html.ref | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index f57f0e70..57bf900d 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -358,7 +358,11 @@ defined in the

    Filename of the executable + >Filename of the executable (see proc for details)

    Date: Fri, 7 Sep 2012 14:29:27 +0200 Subject: Follow changes in GHC. --- src/Haddock/Interface/AttachInstances.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index 8fff4d7a..ebe62cb6 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -186,3 +186,4 @@ isInstanceHidden expInfo cls tys = TyConApp tcon args -> nameHidden (getName tcon) || any typeHidden args FunTy t1 t2 -> typeHidden t1 || typeHidden t2 ForAllTy _ ty -> typeHidden ty + LitTy _ -> False -- cgit v1.2.3 From ad375d43fd04ad533b806352c07d7ceb92ca7b72 Mon Sep 17 00:00:00 2001 From: David Waern Date: Fri, 7 Sep 2012 14:59:24 +0200 Subject: Update CHANGES. --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 6705a357..fdd5f43c 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes in version 2.12.0 * Labeled URLs (e.g ) + * Improved memory usage (new dependency: deepseq) + Changes in version 2.11.0 * Show deprecation messages for identifiers -- cgit v1.2.3 From 8bfe43db4fbd50510c66fc73546f2087e8acf310 Mon Sep 17 00:00:00 2001 From: David Waern Date: Fri, 7 Sep 2012 15:21:30 +0200 Subject: Update ANNOUNCE. --- ANNOUNCE | 52 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index e56f341f..36df3765 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,28 +1,41 @@ -------------------------------------------- --- Haddock 2.9.3 +-- Haddock 2.10.0 and 2.11.0 -------------------------------------------- -A new version of Haddock, the Haskell documentation tool, is out! +Two new versions of Haddock have been uploaded to Hackage: version +2.10.0 which comes with GHC 7.4.2 and 2.11.0 which comes with the new +GHC 7.6.1! -This is the version that comes with GHC 7.2.1 (although that executable claims -it is version 2.9.2!) +-------------------------------------------- +-- Changes in version 2.12.0 +-------------------------------------------- + + * Labeled URLs (e.g ) -Apologies to people who have sent in patches that haven't made it into this -release, they will go into the next one. + * Improved memory usage (new dependency: deepseq) -------------------------------------------- --- Changes in version 2.9.3 +-- Changes in version 2.11.0 -------------------------------------------- -Changes in version 2.9.3 + * Show deprecation messages for identifiers + + * List identifiers declared on the same line (with a common type) separately + + * Don't crash on unicode strings in doc comments - * Build with GHC 7.2.1 + * Fix reporting of modules safe haskell mode - * Support blank lines in results of examples + * Fix a case where we were generating invalid xhtml - * A type signatures for multiple names generates one signature in the output + * Improved --qual option (no crashes, proper error messages) - * Minor bug fixes + * A new --qual option "aliased" which qualifies identifers by the module alias + used in the source code + + * The Haddock API restores GHC's static flags after invocation + + * Access to unexported identifiers through the Haddock API again -------------------------------------------- -- Links @@ -32,7 +45,7 @@ Homepage: http://www.haskell.org/haddock Hackage page: - http://hackage.haskell.org/package/haddock-2.9.0 + http://hackage.haskell.org/package/haddock-2.12.0 Bugtracker and wiki: http://trac.haskell.org/haddock @@ -41,7 +54,7 @@ Mailing list: haddock@projects.haskell.org Code repository: - http://code.haskell.org/haddock + http://darcs.haskell.org/haddock.git -------------------------------------------- -- Contributors @@ -49,12 +62,13 @@ Code repository: The following people contributed patches to this release: -Max Bolingbroke -Ian Lynagh +Paolo Capriotti Simon Hengel -Jose Pedro Magalhaes +Ian Lynagh Simon Peyton Jones -Michal Terepeta +Iavor S. Diatchki +David Terei +Henning Thielemann David Waern -------------------------------------------- @@ -64,7 +78,7 @@ David Waern We would be very happy to get more contributors. To get involved, start by grabbing the code: - http://code.haskell.org/haddock + http://darcs.haskell.org/haddock.git Then take a look at the bug and feature tracker for things to work on: -- cgit v1.2.3 From ff2e024f737017d32e3dc39a7ab2322d54e56ca3 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 8 Sep 2012 12:08:37 +0200 Subject: Update doc/README --- doc/README | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/README b/doc/README index ab9c0f2f..5bc038bf 100644 --- a/doc/README +++ b/doc/README @@ -8,6 +8,7 @@ process the documentation on your system, and a Makefile to actually do the processing (so, on Windows, you'll need Cygwin or MSys in addition to the DocBook XML tools). To build the HTML documentation: + $ autoconf $ ./configure $ make html -- cgit v1.2.3 From 0f6c13f66ea335bf371ab49125371ac665de6cf8 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 8 Sep 2012 12:17:17 +0200 Subject: Add documentation for URL labels --- doc/haddock.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index 7ddfdccd..a38b70cf 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1830,6 +1830,13 @@ module A where <...>. If the output format supports it, the URL will be turned into a hyperlink when rendered. + + The URL can be followed by an optional label: + +<http://example.com label> + + The label is then used as a descriptive text for the hyperlink, if the + output format supports it.
    -- cgit v1.2.3 From 80922e0f52f304c357779292254305ad6f17805d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 21 Sep 2012 14:22:32 +0200 Subject: Disable Unicode test for now --- tests/html-tests/tests/Unicode.hs | 6 ------ tests/html-tests/tests/Unicode.hs.disabled | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 tests/html-tests/tests/Unicode.hs create mode 100644 tests/html-tests/tests/Unicode.hs.disabled diff --git a/tests/html-tests/tests/Unicode.hs b/tests/html-tests/tests/Unicode.hs deleted file mode 100644 index d5bbf445..00000000 --- a/tests/html-tests/tests/Unicode.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Unicode where - --- | γλώσσα -x :: Int -x = 1 - diff --git a/tests/html-tests/tests/Unicode.hs.disabled b/tests/html-tests/tests/Unicode.hs.disabled new file mode 100644 index 00000000..d5bbf445 --- /dev/null +++ b/tests/html-tests/tests/Unicode.hs.disabled @@ -0,0 +1,6 @@ +module Unicode where + +-- | γλώσσα +x :: Int +x = 1 + -- cgit v1.2.3 From 605502fbd9879268a13bf5f400d98b128fb8d1fc Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 21 Sep 2012 14:35:45 +0200 Subject: Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! --- tests/html-tests/tests/TypeOperators.hs | 4 +- tests/html-tests/tests/TypeOperators.html.ref | 54 ---------------------- tests/html-tests/tests/mini_TypeOperators.html.ref | 8 ---- 3 files changed, 1 insertion(+), 65 deletions(-) diff --git a/tests/html-tests/tests/TypeOperators.hs b/tests/html-tests/tests/TypeOperators.hs index aa0fbe8c..edbb9344 100644 --- a/tests/html-tests/tests/TypeOperators.hs +++ b/tests/html-tests/tests/TypeOperators.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeOperators #-} module TypeOperators ( -- * stuff (:-:), @@ -5,7 +6,6 @@ module TypeOperators ( Op, O(..), biO, - Flip(..) ) where data a :-: b @@ -18,5 +18,3 @@ newtype (g `O` f) a = O { unO :: g (f a) } biO :: (g `O` f) a biO = undefined - -newtype Flip (~>) b a = Flip { unFlip :: a ~> b } diff --git a/tests/html-tests/tests/TypeOperators.html.ref b/tests/html-tests/tests/TypeOperators.html.ref index 0155ab0d..519547d6 100644 --- a/tests/html-tests/tests/TypeOperators.html.ref +++ b/tests/html-tests/tests/TypeOperators.html.ref @@ -94,20 +94,6 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");} > :: (g `O` f) a
  • newtype Flip (~>) b a = Flip {}
  • O` f) a

    newtype Flip (~>) b a

    Constructors

    Flip 

    Fields

    unFlip :: a ~> b
     

    data Flip (~>) b a

    Date: Fri, 21 Sep 2012 16:02:24 +0200 Subject: Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. --- tests/html-tests/tests/CrossPackageDocs.html.ref | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index 57bf900d..39353720 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -328,16 +328,6 @@ defined in the  Monad (Either e)  Date: Thu, 27 Sep 2012 15:48:19 +0200 Subject: Update hidden instances tests. --- tests/html-tests/tests/HiddenInstances.html.ref | 4 ++-- tests/html-tests/tests/HiddenInstancesB.html.ref | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/html-tests/tests/HiddenInstances.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref index c1b75927..163008f6 100644 --- a/tests/html-tests/tests/HiddenInstances.html.ref +++ b/tests/html-tests/tests/HiddenInstances.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_HiddenInstances.html") >Index

     

    Produced by Haddock version 2.10.0

    version 2.12.0

    Produced by Haddock version 2.11.0

    version 2.12.0

    Date: Fri, 28 Sep 2012 10:21:32 +0200 Subject: Make API buildable with GHC 7.6. --- src/Documentation/Haddock.hs | 2 +- src/Main.hs | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index 60bb3147..cbdc4d61 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -70,6 +70,6 @@ createInterfaces -> [String] -- ^ File or module names -> IO [Interface] -- ^ Resulting list of interfaces createInterfaces flags modules = do - (_, ifaces, _) <- readPackagesAndProcessModules flags modules + (_, ifaces, _) <- withGhc' flags (readPackagesAndProcessModules flags modules) return ifaces diff --git a/src/Main.hs b/src/Main.hs index 31e2726c..abeda77f 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -15,7 +15,7 @@ -- -- Program entry point and top-level code. ----------------------------------------------------------------------------- -module Main (main, readPackagesAndProcessModules) where +module Main (main, readPackagesAndProcessModules, withGhc') where import Haddock.Backends.Xhtml @@ -135,15 +135,7 @@ main = handleTopExceptions $ do shortcutFlags flags qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q} - libDir <- fmap snd (getGhcDirs flags) - - -- Catches all GHC source errors, then prints and re-throws them. - let handleSrcErrors action' = flip handleSourceError action' $ \err -> do - printException err - liftIO exitFailure - - -- Initialize GHC. - withGhc libDir (ghcFlags flags) $ \_ -> handleSrcErrors $ do + withGhc' flags $ do dflags <- getDynFlags @@ -169,6 +161,18 @@ main = handleTopExceptions $ do liftIO $ renderStep dflags flags qual packages [] +withGhc' :: [Flag] -> Ghc a -> IO a +withGhc' flags action = do + libDir <- fmap snd (getGhcDirs flags) + + -- Catches all GHC source errors, then prints and re-throws them. + let handleSrcErrors action' = flip handleSourceError action' $ \err -> do + printException err + liftIO exitFailure + + withGhc libDir (ghcFlags flags) (\_ -> handleSrcErrors action) + + readPackagesAndProcessModules :: [Flag] -> [String] -> Ghc ([(DocPaths, InterfaceFile)], [Interface], LinkEnv) readPackagesAndProcessModules flags files = do -- cgit v1.2.3 From 6ccf78e15a525282fef61bc4f58a279aa9c21771 Mon Sep 17 00:00:00 2001 From: David Waern Date: Fri, 28 Sep 2012 19:50:20 +0200 Subject: Fix spurious superclass constraints bug. --- src/Haddock/Interface/AttachInstances.hs | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index ebe62cb6..4b5f159d 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -22,19 +22,20 @@ import Data.List import qualified Data.Map as Map import qualified Data.Set as Set -import GHC -import Name -import InstEnv import Class +import FastString +import GHC import GhcMonad (withSession) -import TysPrim( funTyCon ) +import Id +import InstEnv import MonadUtils (liftIO) +import Name +import PrelNames import TcRnDriver (tcRnGetInfo) +import TyCon import TypeRep +import TysPrim( funTyCon ) import Var hiding (varName) -import TyCon -import PrelNames -import FastString #define FSLIT(x) (mkFastString# (x#)) type ExportedNames = Set.Set Name @@ -65,7 +66,7 @@ attachToExportItem expInfo iface ifaceMap instIfaceMap export = Just (_, _, instances) -> let insts = map (first synifyInstHead) $ sortImage (first instHead) $ filter (\((_,_,cls,tys),_) -> not $ isInstanceHidden expInfo cls tys) - [ (instanceHead i, getName i) | i <- instances ] + [ (instanceHead' i, getName i) | i <- instances ] in [ (inst, lookupInstDoc name iface ifaceMap instIfaceMap) | (inst, name) <- insts ] Nothing -> [] @@ -94,6 +95,20 @@ lookupInstDoc name iface ifaceMap instIfaceMap = modName = nameModule name +-- | Like GHC's 'instanceHead' but drops "silent" arguments. +instanceHead' :: ClsInst -> ([TyVar], ThetaType, Class, [Type]) +instanceHead' ispec = (tvs, dropSilentArgs dfun theta, cls, tys) + where + dfun = is_dfun ispec + (tvs, theta, cls, tys) = instanceHead ispec + + +-- | Drop "silent" arguments. See GHC Note [Silent superclass +-- arguments]. +dropSilentArgs :: DFunId -> ThetaType -> ThetaType +dropSilentArgs dfun theta = drop (dfunNSilent dfun) theta + + -- | Like GHC's getInfo but doesn't cut things out depending on the -- interative context, which we don't set sufficiently anyway. getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[ClsInst])) -- cgit v1.2.3 From 762cc901a0d72ebdc770adaaf68c9fd4c3ca4d87 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 22 Sep 2012 18:55:47 +0200 Subject: Remove old examples --- examples/A.hs | 2 - examples/B.hs | 2 - examples/Bug1.hs | 6 - examples/Bug10.hs | 3 - examples/Bug2.hs | 4 - examples/Bug3.hs | 6 - examples/Bug4.hs | 4 - examples/Bug6.hs | 23 --- examples/Bug7.hs | 12 -- examples/Bug8.hs | 8 - examples/Bug9.hs | 6 - examples/Hash.hs | 45 ------ examples/Hidden.hs | 4 - examples/Makefile | 11 -- examples/NoLayout.hs | 4 - examples/Test.hs | 410 ------------------------------------------------- examples/Visible.hs | 3 - examples/hide-bug/A.hs | 2 - examples/hide-bug/B.hs | 5 - examples/hide-bug/C.hs | 6 - examples/hide-bug/D.hs | 7 - 21 files changed, 573 deletions(-) delete mode 100644 examples/A.hs delete mode 100644 examples/B.hs delete mode 100644 examples/Bug1.hs delete mode 100644 examples/Bug10.hs delete mode 100644 examples/Bug2.hs delete mode 100644 examples/Bug3.hs delete mode 100644 examples/Bug4.hs delete mode 100644 examples/Bug6.hs delete mode 100644 examples/Bug7.hs delete mode 100644 examples/Bug8.hs delete mode 100644 examples/Bug9.hs delete mode 100644 examples/Hash.hs delete mode 100644 examples/Hidden.hs delete mode 100644 examples/Makefile delete mode 100644 examples/NoLayout.hs delete mode 100644 examples/Test.hs delete mode 100644 examples/Visible.hs delete mode 100644 examples/hide-bug/A.hs delete mode 100644 examples/hide-bug/B.hs delete mode 100644 examples/hide-bug/C.hs delete mode 100644 examples/hide-bug/D.hs diff --git a/examples/A.hs b/examples/A.hs deleted file mode 100644 index 4a344a24..00000000 --- a/examples/A.hs +++ /dev/null @@ -1,2 +0,0 @@ -module A where -data A = A diff --git a/examples/B.hs b/examples/B.hs deleted file mode 100644 index 3a31507e..00000000 --- a/examples/B.hs +++ /dev/null @@ -1,2 +0,0 @@ -module B ( module A ) where -import A diff --git a/examples/Bug1.hs b/examples/Bug1.hs deleted file mode 100644 index af1ed4d3..00000000 --- a/examples/Bug1.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug1 where - --- | We should have different anchors for constructors and types\/classes. This --- hyperlink should point to the type constructor by default: 'T'. -data T = T - diff --git a/examples/Bug10.hs b/examples/Bug10.hs deleted file mode 100644 index 04c5ff50..00000000 --- a/examples/Bug10.hs +++ /dev/null @@ -1,3 +0,0 @@ --- | Module: M -f :: a -> a - diff --git a/examples/Bug2.hs b/examples/Bug2.hs deleted file mode 100644 index 9121922e..00000000 --- a/examples/Bug2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Bug2 ( x ) where -import B -x :: A -x = A diff --git a/examples/Bug3.hs b/examples/Bug3.hs deleted file mode 100644 index cfda7e4c..00000000 --- a/examples/Bug3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug3 where - --- | /multi-line --- emphasis/ -foo :: Int - diff --git a/examples/Bug4.hs b/examples/Bug4.hs deleted file mode 100644 index bb3c4fe2..00000000 --- a/examples/Bug4.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Bug4 where --- | don't use apostrophe's in the wrong place's -foo :: Int - diff --git a/examples/Bug6.hs b/examples/Bug6.hs deleted file mode 100644 index 498983df..00000000 --- a/examples/Bug6.hs +++ /dev/null @@ -1,23 +0,0 @@ --- | Exporting records. -module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where - --- | --- This record is exported without its field -data A = A { a :: Int } - --- | --- .. with its field, but the field is named separately in the export list --- (should still be visible as a field name) -data B = B { b :: Int } - --- | --- .. with fields names as subordinate names in the export -data C = C { c1 :: Int, c2 :: Int } - --- | --- .. with only some of the fields exported (we can't handle this one - --- how do we render the declaration?) -data D = D { d1 :: Int, d2 :: Int } - --- | a newtype with a field -newtype E = E { e :: Int } diff --git a/examples/Bug7.hs b/examples/Bug7.hs deleted file mode 100644 index 8cf57914..00000000 --- a/examples/Bug7.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | This module caused a duplicate instance in the documentation for the Foo --- type. -module Bug7 where - --- | The Foo datatype -data Foo = Foo - --- | The Bar class -class Bar x y - --- | Just one instance -instance Bar Foo Foo diff --git a/examples/Bug8.hs b/examples/Bug8.hs deleted file mode 100644 index 6481ca3f..00000000 --- a/examples/Bug8.hs +++ /dev/null @@ -1,8 +0,0 @@ -infix --> -infix ---> - -data Typ = Type (String,[Typ]) - | TFree (String, [String]) - -x --> y = Type("fun",[s,t]) -(--->) = flip $ foldr (-->) diff --git a/examples/Bug9.hs b/examples/Bug9.hs deleted file mode 100644 index 81e341db..00000000 --- a/examples/Bug9.hs +++ /dev/null @@ -1,6 +0,0 @@ --- Haddock 0.6 didn't parse this module, because the qualified --- identifier C.safe was incorrectly lexed as 3 tokens. - -module Check where -import qualified Foo as C -check = undefined { C.safe = 3 } diff --git a/examples/Hash.hs b/examples/Hash.hs deleted file mode 100644 index b399b129..00000000 --- a/examples/Hash.hs +++ /dev/null @@ -1,45 +0,0 @@ -{- | - Implementation of fixed-size hash tables, with a type - class for constructing hash values for structured types. --} -module Hash ( - -- * The @HashTable@ type - HashTable, - - -- ** Operations on @HashTable@s - new, insert, lookup, - - -- * The @Hash@ class - Hash(..), - ) where - -import Array - --- | A hash table with keys of type @key@ and values of type @val@. --- The type @key@ should be an instance of 'Eq'. -data HashTable key val = HashTable Int (Array Int [(key,val)]) - --- | Builds a new hash table with a given size -new :: (Eq key, Hash key) => Int -> IO (HashTable key val) - --- | Inserts a new element into the hash table -insert :: (Eq key, Hash key) => key -> val -> IO () - --- | Looks up a key in the hash table, returns @'Just' val@ if the key --- was found, or 'Nothing' otherwise. -lookup :: Hash key => key -> IO (Maybe val) - --- | A class of types which can be hashed. -class Hash a where - -- | hashes the value of type @a@ into an 'Int' - hash :: a -> Int - -instance Hash Int where - hash = id - -instance Hash Float where - hash = trunc - -instance (Hash a, Hash b) => Hash (a,b) where - hash (a,b) = hash a `xor` hash b - diff --git a/examples/Hidden.hs b/examples/Hidden.hs deleted file mode 100644 index d30925b1..00000000 --- a/examples/Hidden.hs +++ /dev/null @@ -1,4 +0,0 @@ --- #hide -module Hidden where -hidden :: Int -> Int -hidden a = a diff --git a/examples/Makefile b/examples/Makefile deleted file mode 100644 index 034358ec..00000000 --- a/examples/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -TOP = .. -include $(TOP)/mk/boilerplate.mk - -all :: index.html - -index.html : $(HS_SRCS) $(HADDOCK_INPLACE) - $(HADDOCK_INPLACE) -h $(HS_SRCS) - -CLEAN_FILES += index.html - -include $(TOP)/mk/target.mk diff --git a/examples/NoLayout.hs b/examples/NoLayout.hs deleted file mode 100644 index 0be97ba1..00000000 --- a/examples/NoLayout.hs +++ /dev/null @@ -1,4 +0,0 @@ -module NoLayout where { - -- | the class 'C' - g :: Int; - } diff --git a/examples/Test.hs b/examples/Test.hs deleted file mode 100644 index 230f32d8..00000000 --- a/examples/Test.hs +++ /dev/null @@ -1,410 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Test --- Copyright : (c) Simon Marlow 2002 --- License : BSD-style --- --- Maintainer : libraries@haskell.org --- Stability : provisional --- Portability : portable --- --- This module illustrates & tests most of the features of Haddock. --- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. --- ------------------------------------------------------------------------------ - --- This is plain comment, ignored by Haddock. - -module Test ( - - -- Section headings are introduced with '-- *': - -- * Type declarations - - -- Subsection headings are introduced with '-- **' and so on. - -- ** Data types - T(..), T2, T3(..), T4(..), T5(..), T6(..), - N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), - - -- ** Records - R(..), R1(..), - - -- | test that we can export record selectors on their own: - p, q, u, - - -- * Class declarations - C(a,b), D(..), E, F(..), - - -- | Test that we can export a class method on its own: - a, - - -- * Function types - f, g, - - -- * Auxiliary stuff - - -- $aux1 - - -- $aux2 - - -- $aux3 - - -- $aux4 - - -- $aux5 - - -- $aux6 - - -- $aux7 - - -- $aux8 - - -- $aux9 - - -- $aux10 - - -- $aux11 - - -- $aux12 - - -- | This is some inline documentation in the export list - -- - -- > a code block using bird-tracks - -- > each line must begin with > (which isn't significant unless it - -- > is at the beginning of the line). - - -- * A hidden module - module Hidden, - - -- * A visible module - module Visible, - - {-| nested-style doc comments -} - - -- * Existential \/ Universal types - Ex(..), - - -- * Type signatures with argument docs - k, l, m, o, - - -- * A section - -- and without an intervening comma: - -- ** A subsection - -{-| - > a literal line - - $ a non /literal/ line $ --} - - f' - ) where - -import Hidden -import Visible -import Data.Maybe - -bla = Nothing - --- | This comment applies to the /following/ declaration --- and it continues until the next non-comment line -data T a b - = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor - | -- | This comment describes the 'B' constructor - B (T a b, T Int Float) -- ^ - --- | An abstract data declaration -data T2 a b = T2 a b - --- | A data declaration with no documentation annotations on the constructors -data T3 a b = A1 a | B1 b - --- A data declaration with no documentation annotations at all -data T4 a b = A2 a | B2 b - --- A data declaration documentation on the constructors only -data T5 a b - = A3 a -- ^ documents 'A3' - | B3 b -- ^ documents 'B3' - --- | Testing alternative comment styles -data T6 - -- | This is the doc for 'A4' - = A4 - | B4 - | -- ^ This is the doc for 'B4' - - -- | This is the doc for 'C4' - C4 - --- | A newtype -newtype N1 a = N1 a - --- | A newtype with a fieldname -newtype N2 a b = N2 {n :: a b} - --- | A newtype with a fieldname, documentation on the field -newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field - } - --- | An abstract newtype - we show this one as data rather than newtype because --- the difference isn\'t visible to the programmer for an abstract type. -newtype N4 a b = N4 a - -newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor - } - -newtype N6 a b = N6 {n6 :: a b - } - -- ^ docs on the constructor only - --- | docs on the newtype and the constructor -newtype N7 a b = N7 {n7 :: a b - } - -- ^ The 'N7' constructor - - -class (D a) => C a where - -- |this is a description of the 'a' method - a :: IO a - b :: [a] - -- ^ this is a description of the 'b' method - c :: a -- c is hidden in the export list - --- ^ This comment applies to the /previous/ declaration (the 'C' class) - -class D a where - d :: T a b - e :: (a,a) --- ^ This is a class declaration with no separate docs for the methods - -instance D Int where - d = undefined - e = undefined - --- instance with a qualified class name -instance Test.D Float where - d = undefined - e = undefined - -class E a where - ee :: a --- ^ This is a class declaration with no methods (or no methods exported) - --- This is a class declaration with no documentation at all -class F a where - ff :: a - --- | This is the documentation for the 'R' record, which has four fields, --- 'p', 'q', 'r', and 's'. -data R = - -- | This is the 'C1' record constructor, with the following fields: - C1 { p :: Int -- ^ This comment applies to the 'p' field - , q :: forall a . a->a -- ^ This comment applies to the 'q' field - , -- | This comment applies to both 'r' and 's' - r,s :: Int - } - | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), - u,v :: Int - } - -- ^ This is the 'C2' record constructor, also with some fields: - --- | Testing different record commenting styles -data R1 - -- | This is the 'C3' record constructor - = C3 { - -- | The 's1' record selector - s1 :: Int - -- | The 's2' record selector - , s2 :: Int - , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. - -- Since GHC doesn't allow that, I have removed it in this file. - -- ^ The 's3' record selector - } - --- These section headers are only used when there is no export list to --- give the structure of the documentation: - --- * This is a section header (level 1) --- ** This is a section header (level 2) --- *** This is a section header (level 3) - -{-| -In a comment string we can refer to identifiers in scope with -single quotes like this: 'T', and we can refer to modules by -using double quotes: "Foo". We can add emphasis /like this/. - - * This is a bulleted list - - - This is the next item (different kind of bullet) - - (1) This is an ordered list - - 2. This is the next item (different kind of bullet) - -@ - This is a block of code, which can include other markup: 'R' - formatting - is - significant -@ - -> this is another block of code - -We can also include URLs in documentation: . --} - -f :: C a => a -> Int - --- | we can export foreign declarations too -foreign import ccall g :: Int -> IO CInt - --- | this doc string has a parse error in it: \' -h :: Int -h = 42 - - --- $aux1 This is some documentation that is attached to a name ($aux1) --- rather than a source declaration. The documentation may be --- referred to in the export list using its name. --- --- @ code block in named doc @ - --- $aux2 This is some documentation that is attached to a name ($aux2) - --- $aux3 --- @ code block on its own in named doc @ - --- $aux4 --- --- @ code block on its own in named doc (after newline) @ - -{- $aux5 a nested, named doc comment - - with a paragraph, - - @ and a code block @ --} - --- some tests for various arrangements of code blocks: - -{- $aux6 ->test ->test1 - -@ test2 - test3 -@ --} - -{- $aux7 -@ -test1 -test2 -@ --} - -{- $aux8 ->test3 ->test4 --} - -{- $aux9 -@ -test1 -test2 -@ - ->test3 ->test4 --} - -{- $aux10 ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- This one is currently wrong (Haddock 0.4). The @...@ part is --- interpreted as part of the bird-tracked code block. -{- $aux11 -aux11: - ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- $aux12 --- > foo --- --- > bar --- - --- | A data-type using existential\/universal types -data Ex a - = forall b . C b => Ex1 b - | forall b . Ex2 b - | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file - | Ex4 (forall a . a -> a) - --- | This is a function with documentation for each argument -k :: T () () -- ^ This argument has type 'T' - -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' - -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ - -> T5 () () -- ^ This argument has a very long description that should - -- hopefully cause some wrapping to happen when it is finally - -- rendered by Haddock in the generated HTML page. - -> IO () -- ^ This is the result type - --- This function has arg docs but no docs for the function itself -l :: (Int, Int, Float) -- ^ takes a triple - -> Int -- ^ returns an 'Int' - --- | This function has some arg docs -m :: R - -> N1 () -- ^ one of the arguments - -> IO Int -- ^ and the return value - --- | This function has some arg docs but not a return value doc - --- can't use the original name ('n') with GHC -newn :: R -- ^ one of the arguments, an 'R' - -> N1 () -- ^ one of the arguments - -> IO Int -newn = undefined - - --- | A foreign import with argument docs -foreign import ccall unsafe - o :: Float -- ^ The input float - -> IO Float -- ^ The output float - --- | We should be able to escape this: \#\#\# - --- p :: Int --- can't use the above original definition with GHC -newp :: Int -newp = undefined - --- | a function with a prime can be referred to as 'f'' --- but f' doesn't get link'd 'f\'' -f' :: Int - - --- Add some definitions here so that this file can be compiled with GHC - -data T1 -f = undefined -f' = undefined -type CInt = Int -k = undefined -l = undefined -m = undefined diff --git a/examples/Visible.hs b/examples/Visible.hs deleted file mode 100644 index cad71931..00000000 --- a/examples/Visible.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Visible where -visible :: Int -> Int -visible a = a diff --git a/examples/hide-bug/A.hs b/examples/hide-bug/A.hs deleted file mode 100644 index a9386a40..00000000 --- a/examples/hide-bug/A.hs +++ /dev/null @@ -1,2 +0,0 @@ --- #hide -module A where { data T = MkT; f :: T; f = MkT } diff --git a/examples/hide-bug/B.hs b/examples/hide-bug/B.hs deleted file mode 100644 index eeaa8290..00000000 --- a/examples/hide-bug/B.hs +++ /dev/null @@ -1,5 +0,0 @@ -module B(Test, vis) where - -vis = id - -data Test = Test diff --git a/examples/hide-bug/C.hs b/examples/hide-bug/C.hs deleted file mode 100644 index d846035b..00000000 --- a/examples/hide-bug/C.hs +++ /dev/null @@ -1,6 +0,0 @@ -module C(C.bla) where - -import D - -bla :: Test -bla = undefined diff --git a/examples/hide-bug/D.hs b/examples/hide-bug/D.hs deleted file mode 100644 index e8ce5744..00000000 --- a/examples/hide-bug/D.hs +++ /dev/null @@ -1,7 +0,0 @@ --- The link to the type T in the doc for this module should point to --- B.T, not A.T. Bug fixed in rev 1.59 of Main.hs. -module D(Test, hej) where - -import B - -hej = vis -- cgit v1.2.3 From c0d71b685dfdcbafa8ca0b3924aef6629142e6dc Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 22 Sep 2012 14:15:53 +0200 Subject: Adapt parsetests for GHC 7.6.1 --- tests/unit-tests/parsetests.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 0192ebfc..58348a59 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -11,8 +11,10 @@ import Haddock.Types import Outputable import Data.Monoid +dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") + instance Outputable a => Show a where - show = showSDoc . ppr + show = showSDoc dynFlags . ppr deriving instance Show a => Show (Doc a) deriving instance Eq a =>Eq (Doc a) @@ -80,4 +82,4 @@ main = do toTestCase (ParseTest s r) = TestCase $ assertEqual s r (parse s) parse :: String -> Maybe (Doc RdrName) - parse s = parseParas $ tokenise (defaultDynFlags undefined) s (0,0) + parse s = parseParas $ tokenise dynFlags s (0,0) -- cgit v1.2.3 From 25badd84cf6e09f4e556c7511a78144d38578d9f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 24 Sep 2012 10:07:44 +0200 Subject: Add test-suite section for parsetests to cabal file + get rid of HUnit dependency --- haddock.cabal | 28 +++++++++ tests/nanospec/README | 6 ++ tests/nanospec/Test/Hspec.hs | 126 ++++++++++++++++++++++++++++++++++++++ tests/unit-tests/.ghci | 1 - tests/unit-tests/parsetests.hs | 125 ++++++++++++++++--------------------- tests/unit-tests/runparsetests.sh | 15 ----- 6 files changed, 214 insertions(+), 87 deletions(-) create mode 100644 tests/nanospec/README create mode 100644 tests/nanospec/Test/Hspec.hs delete mode 100644 tests/unit-tests/.ghci delete mode 100755 tests/unit-tests/runparsetests.sh diff --git a/haddock.cabal b/haddock.cabal index f70d6813..3486b2f7 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -212,6 +212,34 @@ test-suite html-tests hs-source-dirs: tests/html-tests build-depends: base, directory, process, filepath, Cabal +test-suite spec + type: exitcode-stdio-1.0 + default-language: Haskell2010 + main-is: parsetests.hs + hs-source-dirs: + tests/unit-tests + , tests/nanospec + , src + + build-depends: + base + , ghc + , containers + , array + + -- NOTE: As of this writing, Cabal does not properly handle alex/happy for + -- test suites. We work around this by adding dist/build to hs-source-dirs, + -- so that the the generated lexer/parser from the library is used. I + -- addition we depend on 'haddock', so that the library is compiled before + -- the test suite. + -- + -- The corresponding cabal ticket is here: + -- https://github.com/haskell/cabal/issues/943 + hs-source-dirs: + dist/build + build-depends: + haddock + source-repository head type: git location: http://darcs.haskell.org/haddock.git diff --git a/tests/nanospec/README b/tests/nanospec/README new file mode 100644 index 00000000..ffce7c74 --- /dev/null +++ b/tests/nanospec/README @@ -0,0 +1,6 @@ +A lightweight implementation of a subset of Hspec's API with minimal +dependencies. + +http://hackage.haskell.org/package/nanospec + +This is a copy of version 0.1.0. diff --git a/tests/nanospec/Test/Hspec.hs b/tests/nanospec/Test/Hspec.hs new file mode 100644 index 00000000..904ce2e0 --- /dev/null +++ b/tests/nanospec/Test/Hspec.hs @@ -0,0 +1,126 @@ +{-# LANGUAGE DeriveDataTypeable, CPP #-} +-- | A lightweight implementation of a subset of Hspec's API. +module Test.Hspec ( +-- * Types + SpecM +, Spec + +-- * Defining a spec +, describe +, context +, it + +-- ** Setting expectations +, Expectation +, expect +, shouldBe +, shouldReturn + +-- * Running a spec +, hspec +) where + +import Control.Applicative +import Control.Monad +import Data.Monoid +import Data.List (intercalate) +import Data.Typeable +import qualified Control.Exception as E +import System.Exit + +-- a writer monad +data SpecM a = SpecM a [SpecTree] + +add :: SpecTree -> SpecM () +add s = SpecM () [s] + +instance Monad SpecM where + return a = SpecM a [] + SpecM a xs >>= f = case f a of + SpecM b ys -> SpecM b (xs ++ ys) + +data SpecTree = SpecGroup String Spec + | SpecExample String (IO Result) + +data Result = Success | Failure String + deriving (Eq, Show) + +type Spec = SpecM () + +describe :: String -> Spec -> Spec +describe label = add . SpecGroup label + +context :: String -> Spec -> Spec +context = describe + +it :: String -> Expectation -> Spec +it label = add . SpecExample label . evaluateExpectation + +-- | Summary of a test run. +data Summary = Summary Int Int + +instance Monoid Summary where + mempty = Summary 0 0 + (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2) + +runSpec :: Spec -> IO Summary +runSpec = runForrest [] + where + runForrest :: [String] -> Spec -> IO Summary + runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs + + runTree :: [String] -> SpecTree -> IO Summary + runTree labels spec = case spec of + SpecExample label x -> do + putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ " + r <- x + case r of + Success -> do + putStrLn "OK" + return (Summary 1 0) + Failure err -> do + putStrLn "FAILED" + putStrLn err + return (Summary 1 1) + SpecGroup label xs -> do + runForrest (label:labels) xs + +hspec :: Spec -> IO () +hspec spec = do + Summary total failures <- runSpec spec + putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)") + when (failures /= 0) exitFailure + +type Expectation = IO () + +infix 1 `shouldBe`, `shouldReturn` + +shouldBe :: (Show a, Eq a) => a -> a -> Expectation +actual `shouldBe` expected = + expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected) + +shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation +action `shouldReturn` expected = action >>= (`shouldBe` expected) + +expect :: String -> Bool -> Expectation +expect label f + | f = return () + | otherwise = E.throwIO (ExpectationFailure label) + +data ExpectationFailure = ExpectationFailure String + deriving (Show, Eq, Typeable) + +instance E.Exception ExpectationFailure + +evaluateExpectation :: Expectation -> IO Result +evaluateExpectation action = (action >> return Success) + `E.catches` [ + -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT + -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt) + -- because all of them indicate severe conditions and should not occur during + -- normal operation. + E.Handler $ \e -> E.throw (e :: E.AsyncException) + + , E.Handler $ \(ExpectationFailure err) -> return (Failure err) + , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException)) + ] diff --git a/tests/unit-tests/.ghci b/tests/unit-tests/.ghci deleted file mode 100644 index dcc5b13d..00000000 --- a/tests/unit-tests/.ghci +++ /dev/null @@ -1 +0,0 @@ -:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 58348a59..4a6c8d90 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -1,16 +1,17 @@ {-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -module Main (main) where - -import Test.HUnit -import RdrName (RdrName) -import DynFlags (defaultDynFlags) -import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) -import Haddock.Types -import Outputable -import Data.Monoid - +module Main (main, spec) where + +import Test.Hspec +import RdrName (RdrName) +import DynFlags (DynFlags, defaultDynFlags) +import Haddock.Lex (tokenise) +import Haddock.Parse (parseParas) +import Haddock.Types +import Outputable +import Data.Monoid + +dynFlags :: DynFlags dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") instance Outputable a => Show a where @@ -19,67 +20,49 @@ instance Outputable a => Show a where deriving instance Show a => Show (Doc a) deriving instance Eq a =>Eq (Doc a) -data ParseTest = ParseTest { - input :: String - , result :: (Maybe (Doc RdrName)) - } - -tests :: [ParseTest] -tests = [ - ParseTest { - input = "foobar" - , result = Just $ DocParagraph $ DocString "foobar\n" - } - - , ParseTest { - input = "foobar\n\n>>> fib 10\n55" - , result = Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]]) - } - - , ParseTest { - input = "foobar\n>>> fib 10\n55" - , result = Nothing -- parse error - } - - , ParseTest { - input = "foobar\n\n> some code" - , result = Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) - } - - , ParseTest { - input = "foobar\n> some code" - , result = Nothing -- parse error - } - - -- test support - , ParseTest { - input = ">>> putFooBar\nfoo\n\nbar" - , result = Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]] - } - - -- tests for links - , ParseTest { - input = "" - , result = Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n" - } - - , ParseTest { - input = "" - , result = Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n" - } - ] - -hyperlink :: String -> Maybe String -> Doc RdrName -hyperlink url = DocHyperlink . Hyperlink url +parse :: String -> Maybe (Doc RdrName) +parse s = parseParas $ tokenise dynFlags s (0,0) main :: IO () -main = do - _ <- runTestTT $ TestList $ map toTestCase tests - return (); - where +main = hspec spec + +spec :: Spec +spec = do + describe "parseParas" $ do + + it "parses a paragraph" $ do + parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" + + context "when parsing an example" $ do + + it "requires an example to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n>>> fib 10\n55" `shouldBe` + (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) - toTestCase :: ParseTest -> Test - toTestCase (ParseTest s r) = TestCase $ assertEqual s r (parse s) + -- parse error + parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing - parse :: String -> Maybe (Doc RdrName) - parse s = parseParas $ tokenise dynFlags s (0,0) + it "parses a result line that only contains as an emptly line" $ do + parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` + (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) + + context "when parsing a code block" $ do + it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n> some code" `shouldBe` + Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) + + -- parse error + parse "foobar\n> some code" `shouldBe` Nothing + + + context "when parsing a URL" $ do + it "parses a URL" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") + + it "accepts an optional label" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + where + hyperlink :: String -> Maybe String -> Doc RdrName + hyperlink url = DocHyperlink . Hyperlink url diff --git a/tests/unit-tests/runparsetests.sh b/tests/unit-tests/runparsetests.sh deleted file mode 100755 index ead0ccf5..00000000 --- a/tests/unit-tests/runparsetests.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -cd `dirname $0` - -runhaskell \ - -i../../src \ - -i../../dist/build/autogen \ - -i../../dist/build/haddock/haddock-tmp/ \ - -packageghc \ - -optP-include \ - -optP../../dist/build/autogen/cabal_macros.h \ - -XCPP \ - -XDeriveDataTypeable \ - -XScopedTypeVariables \ - -XMagicHash \ - parsetests.hs -- cgit v1.2.3 From 34953914bf4d577a9609e7e291eca43c45b29aba Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 24 Sep 2012 11:35:28 +0200 Subject: Remove test flag from cabal file This was not really used. --- haddock.cabal | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 3486b2f7..bbd4e755 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -72,10 +72,6 @@ flag in-ghc-tree default: False manual: True -flag test - default: False - manual: True - executable haddock default-language: Haskell2010 -- In a GHC tree - in particular, in a source tarball - we don't @@ -99,10 +95,6 @@ executable haddock else build-depends: ghc-paths - if flag(test) - cpp-options: -DTEST - build-depends: QuickCheck >= 2.1 && < 3 - main-is: Main.hs hs-source-dirs: src ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs @@ -160,10 +152,6 @@ library else build-depends: ghc-paths - if flag(test) - cpp-options: -DTEST - build-depends: QuickCheck >= 2.1 && < 3 - hs-source-dirs: src ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs -- cgit v1.2.3 From 72eaac4a758ea28b7585db1b0dc7b22068e78b48 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 1 Oct 2012 23:46:12 +0200 Subject: Remove redundant dependency from cabal file --- haddock.cabal | 2 -- 1 file changed, 2 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index bbd4e755..da8f0afc 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -82,7 +82,6 @@ executable haddock base >= 4.3 && < 4.7, filepath, directory, - pretty, containers, deepseq, array, @@ -139,7 +138,6 @@ library base >= 4.3 && < 4.7, filepath, directory, - pretty, containers, deepseq, array, -- cgit v1.2.3 From e4ffa1964a3188a8b461e6f6c4c9febaddb6a35f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 2 Oct 2012 00:17:10 +0200 Subject: Fix typo --- haddock.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock.cabal b/haddock.cabal index da8f0afc..5931db0e 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -215,7 +215,7 @@ test-suite spec -- NOTE: As of this writing, Cabal does not properly handle alex/happy for -- test suites. We work around this by adding dist/build to hs-source-dirs, - -- so that the the generated lexer/parser from the library is used. I + -- so that the the generated lexer/parser from the library is used. In -- addition we depend on 'haddock', so that the library is compiled before -- the test suite. -- -- cgit v1.2.3 From 96e57fc09b13779c43b1f2465561a7ede242533e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 4 Oct 2012 16:11:41 +0200 Subject: Remove trailing whitespace from cabal file --- haddock.cabal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 5931db0e..91c2e494 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -123,11 +123,11 @@ executable haddock Haddock.Types Haddock.Doc Haddock.Version - Haddock.InterfaceFile + Haddock.InterfaceFile Haddock.Options Haddock.GhcUtils Haddock.Convert - + library default-language: Haskell2010 -- In a GHC tree - in particular, in a source tarball - we don't @@ -187,7 +187,7 @@ library Haddock.GhcUtils Haddock.Convert Paths_haddock - + if flag(in-ghc-tree) buildable: False -- cgit v1.2.3 From ae3690c2349b595a1fb459a4374cfe2e668a04aa Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 2 Oct 2012 00:47:46 +0200 Subject: Export Haddock's main entry point from library --- driver/Main.hs | 7 + haddock.cabal | 6 +- src/Documentation/Haddock.hs | 7 +- src/Haddock.hs | 461 +++++++++++++++++++++++++++++++++++++++++++ src/Main.hs | 458 ------------------------------------------ 5 files changed, 476 insertions(+), 463 deletions(-) create mode 100644 driver/Main.hs create mode 100644 src/Haddock.hs delete mode 100644 src/Main.hs diff --git a/driver/Main.hs b/driver/Main.hs new file mode 100644 index 00000000..42b99860 --- /dev/null +++ b/driver/Main.hs @@ -0,0 +1,7 @@ +module Main where + +import Documentation.Haddock (haddock) +import System.Environment (getArgs) + +main :: IO () +main = getArgs >>= haddock diff --git a/haddock.cabal b/haddock.cabal index 91c2e494..42dc9771 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -95,10 +95,12 @@ executable haddock build-depends: ghc-paths main-is: Main.hs - hs-source-dirs: src + hs-source-dirs: src, driver ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs other-modules: + Documentation.Haddock + Haddock Haddock.Interface Haddock.Interface.Rename Haddock.Interface.Create @@ -157,7 +159,7 @@ library Documentation.Haddock other-modules: - Main + Haddock Haddock.Interface Haddock.Interface.Rename Haddock.Interface.Create diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index cbdc4d61..855cdc79 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -48,8 +48,10 @@ module Documentation.Haddock ( -- * Flags and options Flag(..), - DocOption(..) + DocOption(..), + -- * Program entry point + haddock, ) where @@ -58,7 +60,7 @@ import Haddock.Interface import Haddock.Types import Haddock.Options import Haddock.Utils -import Main +import Haddock -- | Create 'Interface' structures from a given list of Haddock command-line @@ -72,4 +74,3 @@ createInterfaces createInterfaces flags modules = do (_, ifaces, _) <- withGhc' flags (readPackagesAndProcessModules flags modules) return ifaces - diff --git a/src/Haddock.hs b/src/Haddock.hs new file mode 100644 index 00000000..f53e01a9 --- /dev/null +++ b/src/Haddock.hs @@ -0,0 +1,461 @@ +{-# OPTIONS_GHC -Wwarn #-} +{-# LANGUAGE CPP, ScopedTypeVariables #-} +----------------------------------------------------------------------------- +-- | +-- Module : Haddock +-- Copyright : (c) Simon Marlow 2003-2006, +-- David Waern 2006-2010 +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +-- +-- Haddock - A Haskell Documentation Tool +-- +-- Program entry point and top-level code. +----------------------------------------------------------------------------- +module Haddock (haddock, readPackagesAndProcessModules, withGhc') where + + +import Haddock.Backends.Xhtml +import Haddock.Backends.Xhtml.Themes (getThemes) +import Haddock.Backends.LaTeX +import Haddock.Backends.Hoogle +import Haddock.Interface +import Haddock.Lex +import Haddock.Parse +import Haddock.Types +import Haddock.Version +import Haddock.InterfaceFile +import Haddock.Options +import Haddock.Utils +import Haddock.GhcUtils hiding (pretty) + +import Control.Monad +import Control.Exception +import Data.Maybe +import Data.IORef +import qualified Data.Map as Map +import System.IO +import System.Exit + +#if defined(mingw32_HOST_OS) +import Foreign +import Foreign.C +import Data.Int +#endif + +#ifdef IN_GHC_TREE +import System.FilePath +#else +import qualified GHC.Paths as GhcPaths +import Paths_haddock +#endif + +import GHC hiding (flags, verbosity) +import Config +import DynFlags hiding (flags, verbosity) +import StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals) +import Panic (panic, handleGhcException) +import Module + +import Control.Monad.Fix (MonadFix) + + +-------------------------------------------------------------------------------- +-- * Exception handling +-------------------------------------------------------------------------------- + + +handleTopExceptions :: IO a -> IO a +handleTopExceptions = + handleNormalExceptions . handleHaddockExceptions . handleGhcExceptions + + +-- | Either returns normally or throws an ExitCode exception; +-- all other exceptions are turned into exit exceptions. +handleNormalExceptions :: IO a -> IO a +handleNormalExceptions inner = + (inner `onException` hFlush stdout) + `catches` + [ Handler (\(code :: ExitCode) -> exitWith code) + + , Handler (\(ex :: AsyncException) -> + case ex of + StackOverflow -> do + putStrLn "stack overflow: use -g +RTS -K to increase it" + exitFailure + _ -> do + putStrLn ("haddock: " ++ show ex) + exitFailure) + + , Handler (\(ex :: SomeException) -> do + putStrLn ("haddock: internal error: " ++ show ex) + exitFailure) + ] + + +handleHaddockExceptions :: IO a -> IO a +handleHaddockExceptions inner = + catches inner [Handler handler] + where + handler (e::HaddockException) = do + putStrLn $ "haddock: " ++ show e + exitFailure + + +handleGhcExceptions :: IO a -> IO a +handleGhcExceptions = + -- error messages propagated as exceptions + handleGhcException $ \e -> do + hFlush stdout + case e of + PhaseFailed _ code -> exitWith code + _ -> do + print (e :: GhcException) + exitFailure + + +------------------------------------------------------------------------------- +-- * Top level +------------------------------------------------------------------------------- + + +-- | Run Haddock with given list of arguments. +-- +-- Haddock's own main function is defined in terms of this: +-- +-- > main = getArgs >>= haddock +haddock :: [String] -> IO () +haddock args = handleTopExceptions $ do + + -- Parse command-line flags and handle some of them initially. + -- TODO: unify all of this (and some of what's in the 'render' function), + -- into one function that returns a record with a field for each option, + -- or which exits with an error or help message. + (flags, files) <- parseHaddockOpts args + shortcutFlags flags + qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q} + + withGhc' flags $ do + + dflags <- getDynFlags + + if not (null files) then do + (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files + + -- Dump an "interface file" (.haddock file), if requested. + case optDumpInterfaceFile flags of + Just f -> liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks + Nothing -> return () + + -- Render the interfaces. + liftIO $ renderStep dflags flags qual packages ifaces + + else do + when (any (`elem` [Flag_Html, Flag_Hoogle, Flag_LaTeX]) flags) $ + throwE "No input file(s)." + + -- Get packages supplied with --read-interface. + packages <- liftIO $ readInterfaceFiles freshNameCache (readIfaceArgs flags) + + -- Render even though there are no input files (usually contents/index). + liftIO $ renderStep dflags flags qual packages [] + + +withGhc' :: [Flag] -> Ghc a -> IO a +withGhc' flags action = do + libDir <- fmap snd (getGhcDirs flags) + + -- Catches all GHC source errors, then prints and re-throws them. + let handleSrcErrors action' = flip handleSourceError action' $ \err -> do + printException err + liftIO exitFailure + + withGhc libDir (ghcFlags flags) (\_ -> handleSrcErrors action) + + +readPackagesAndProcessModules :: [Flag] -> [String] + -> Ghc ([(DocPaths, InterfaceFile)], [Interface], LinkEnv) +readPackagesAndProcessModules flags files = do + -- Get packages supplied with --read-interface. + packages <- readInterfaceFiles nameCacheFromGhc (readIfaceArgs flags) + + -- Create the interfaces -- this is the core part of Haddock. + let ifaceFiles = map snd packages + (ifaces, homeLinks) <- processModules (verbosity flags) files flags ifaceFiles + + return (packages, ifaces, homeLinks) + + +renderStep :: DynFlags -> [Flag] -> QualOption -> [(DocPaths, InterfaceFile)] -> [Interface] -> IO () +renderStep dflags flags qual pkgs interfaces = do + updateHTMLXRefs pkgs + let + ifaceFiles = map snd pkgs + installedIfaces = concatMap ifInstalledIfaces ifaceFiles + srcMap = Map.fromList [ (ifPackageId if_, x) | ((_, Just x), if_) <- pkgs ] + render dflags flags qual interfaces installedIfaces srcMap + + +-- | Render the interfaces with whatever backend is specified in the flags. +render :: DynFlags -> [Flag] -> QualOption -> [Interface] -> [InstalledInterface] -> SrcMap -> IO () +render dflags flags qual ifaces installedIfaces srcMap = do + + let + title = fromMaybe "" (optTitle flags) + unicode = Flag_UseUnicode `elem` flags + pretty = Flag_PrettyHtml `elem` flags + opt_wiki_urls = wikiUrls flags + opt_contents_url = optContentsUrl flags + opt_index_url = optIndexUrl flags + odir = outputDir flags + opt_latex_style = optLaTeXStyle flags + + visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ] + + -- /All/ visible interfaces including external package modules. + allIfaces = map toInstalledIface ifaces ++ installedIfaces + allVisibleIfaces = [ i | i <- allIfaces, OptHide `notElem` instOptions i ] + + pkgMod = ifaceMod (head ifaces) + pkgId = modulePackageId pkgMod + pkgStr = Just (packageIdString pkgId) + (pkgName,pkgVer) = modulePackageInfo pkgMod + + (srcBase, srcModule, srcEntity) = sourceUrls flags + srcMap' = maybe srcMap (\path -> Map.insert pkgId path srcMap) srcEntity + sourceUrls' = (srcBase, srcModule, srcMap') + + libDir <- getHaddockLibDir flags + prologue <- getPrologue flags + themes <- getThemes libDir flags >>= either bye return + + when (Flag_GenIndex `elem` flags) $ do + ppHtmlIndex odir title pkgStr + themes opt_contents_url sourceUrls' opt_wiki_urls + allVisibleIfaces pretty + copyHtmlBits odir libDir themes + + when (Flag_GenContents `elem` flags) $ do + ppHtmlContents odir title pkgStr + themes opt_index_url sourceUrls' opt_wiki_urls + allVisibleIfaces True prologue pretty + (makeContentsQual qual) + copyHtmlBits odir libDir themes + + when (Flag_Html `elem` flags) $ do + ppHtml title pkgStr visibleIfaces odir + prologue + themes sourceUrls' opt_wiki_urls + opt_contents_url opt_index_url unicode qual + pretty + copyHtmlBits odir libDir themes + + when (Flag_Hoogle `elem` flags) $ do + let pkgName2 = if pkgName == "main" && title /= [] then title else pkgName + ppHoogle dflags pkgName2 pkgVer title prologue visibleIfaces odir + + when (Flag_LaTeX `elem` flags) $ do + ppLaTeX title pkgStr visibleIfaces odir prologue opt_latex_style + libDir + + +------------------------------------------------------------------------------- +-- * Reading and dumping interface files +------------------------------------------------------------------------------- + + +readInterfaceFiles :: (MonadFix m, MonadIO m) => + NameCacheAccessor m + -> [(DocPaths, FilePath)] -> + m [(DocPaths, InterfaceFile)] +readInterfaceFiles name_cache_accessor pairs = do + mbPackages <- mapM tryReadIface pairs + return (catMaybes mbPackages) + where + -- try to read an interface, warn if we can't + tryReadIface (paths, file) = do + eIface <- readInterfaceFile name_cache_accessor file + case eIface of + Left err -> liftIO $ do + putStrLn ("Warning: Cannot read " ++ file ++ ":") + putStrLn (" " ++ err) + putStrLn "Skipping this interface." + return Nothing + Right f -> return $ Just (paths, f) + + +dumpInterfaceFile :: FilePath -> [InstalledInterface] -> LinkEnv -> IO () +dumpInterfaceFile path ifaces homeLinks = writeInterfaceFile path ifaceFile + where + ifaceFile = InterfaceFile { + ifInstalledIfaces = ifaces, + ifLinkEnv = homeLinks + } + + +------------------------------------------------------------------------------- +-- * Creating a GHC session +------------------------------------------------------------------------------- + + +-- | Start a GHC session with the -haddock flag set. Also turn off +-- compilation and linking. Then run the given 'Ghc' action. +withGhc :: String -> [String] -> (DynFlags -> Ghc a) -> IO a +withGhc libDir flags ghcActs = saveStaticFlagGlobals >>= \savedFlags -> do + -- TODO: handle warnings? + (restFlags, _) <- parseStaticFlags (map noLoc flags) + runGhc (Just libDir) $ do + dynflags <- getSessionDynFlags + let dynflags' = dopt_set dynflags Opt_Haddock + let dynflags'' = dynflags' { + hscTarget = HscNothing, + ghcMode = CompManager, + ghcLink = NoLink + } + dynflags''' <- parseGhcFlags dynflags'' restFlags flags + defaultCleanupHandler dynflags''' $ do + -- ignore the following return-value, which is a list of packages + -- that may need to be re-linked: Haddock doesn't do any + -- dynamic or static linking at all! + _ <- setSessionDynFlags dynflags''' + ghcActs dynflags''' + `finally` restoreStaticFlagGlobals savedFlags + where + parseGhcFlags :: Monad m => DynFlags -> [Located String] + -> [String] -> m DynFlags + parseGhcFlags dynflags flags_ origFlags = do + -- TODO: handle warnings? + (dynflags', rest, _) <- parseDynamicFlags dynflags flags_ + if not (null rest) + then throwE ("Couldn't parse GHC options: " ++ unwords origFlags) + else return dynflags' + + +------------------------------------------------------------------------------- +-- * Misc +------------------------------------------------------------------------------- + + +getHaddockLibDir :: [Flag] -> IO String +getHaddockLibDir flags = + case [str | Flag_Lib str <- flags] of + [] -> +#ifdef IN_GHC_TREE + getInTreeDir +#else + getDataDir -- provided by Cabal +#endif + fs -> return (last fs) + + +getGhcDirs :: [Flag] -> IO (String, String) +getGhcDirs flags = do + case [ dir | Flag_GhcLibDir dir <- flags ] of + [] -> do +#ifdef IN_GHC_TREE + libDir <- getInTreeDir + return (ghcPath, libDir) +#else + return (ghcPath, GhcPaths.libdir) +#endif + xs -> return (ghcPath, last xs) + where +#ifdef IN_GHC_TREE + ghcPath = "not available" +#else + ghcPath = GhcPaths.ghc +#endif + + +shortcutFlags :: [Flag] -> IO () +shortcutFlags flags = do + usage <- getUsage + + when (Flag_Help `elem` flags) (bye usage) + when (Flag_Version `elem` flags) byeVersion + when (Flag_InterfaceVersion `elem` flags) (bye (show binaryInterfaceVersion ++ "\n")) + when (Flag_GhcVersion `elem` flags) (bye (cProjectVersion ++ "\n")) + + when (Flag_PrintGhcPath `elem` flags) $ do + dir <- fmap fst (getGhcDirs flags) + bye $ dir ++ "\n" + + when (Flag_PrintGhcLibDir `elem` flags) $ do + dir <- fmap snd (getGhcDirs flags) + bye $ dir ++ "\n" + + when (Flag_UseUnicode `elem` flags && Flag_Html `notElem` flags) $ + throwE "Unicode can only be enabled for HTML output." + + when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) + && Flag_Html `elem` flags) $ + throwE "-h cannot be used with --gen-index or --gen-contents" + + when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) + && Flag_Hoogle `elem` flags) $ + throwE "--hoogle cannot be used with --gen-index or --gen-contents" + + when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) + && Flag_LaTeX `elem` flags) $ + throwE "--latex cannot be used with --gen-index or --gen-contents" + where + byeVersion = bye $ + "Haddock version " ++ projectVersion ++ ", (c) Simon Marlow 2006\n" + ++ "Ported to use the GHC API by David Waern 2006-2008\n" + + +updateHTMLXRefs :: [(DocPaths, InterfaceFile)] -> IO () +updateHTMLXRefs packages = do + writeIORef html_xrefs_ref (Map.fromList mapping) + writeIORef html_xrefs_ref' (Map.fromList mapping') + where + mapping = [ (instMod iface, html) | ((html, _), ifaces) <- packages + , iface <- ifInstalledIfaces ifaces ] + mapping' = [ (moduleName m, html) | (m, html) <- mapping ] + + +getPrologue :: [Flag] -> IO (Maybe (Doc RdrName)) +getPrologue flags = + case [filename | Flag_Prologue filename <- flags ] of + [] -> return Nothing + [filename] -> do + str <- readFile filename + case parseParas (tokenise (defaultDynFlags (panic "No settings")) str + (1,0) {- TODO: real position -}) of + Nothing -> throwE $ "failed to parse haddock prologue from file: " ++ filename + Just doc -> return (Just doc) + _otherwise -> throwE "multiple -p/--prologue options" + + +#ifdef IN_GHC_TREE + +getInTreeDir :: IO String +getInTreeDir = do + m <- getExecDir + case m of + Nothing -> error "No GhcDir found" + Just d -> return (d ".." "lib") + + +getExecDir :: IO (Maybe String) +#if defined(mingw32_HOST_OS) +getExecDir = try_size 2048 -- plenty, PATH_MAX is 512 under Win32. + where + try_size size = allocaArray (fromIntegral size) $ \buf -> do + ret <- c_GetModuleFileName nullPtr buf size + case ret of + 0 -> return Nothing + _ | ret < size -> fmap (Just . dropFileName) $ peekCWString buf + | otherwise -> try_size (size * 2) + +foreign import stdcall unsafe "windows.h GetModuleFileNameW" + c_GetModuleFileName :: Ptr () -> CWString -> Word32 -> IO Word32 +#else +getExecDir = return Nothing +#endif + +#endif + diff --git a/src/Main.hs b/src/Main.hs deleted file mode 100644 index abeda77f..00000000 --- a/src/Main.hs +++ /dev/null @@ -1,458 +0,0 @@ -{-# OPTIONS_GHC -Wwarn #-} -{-# LANGUAGE CPP, ScopedTypeVariables #-} ------------------------------------------------------------------------------ --- | --- Module : Main --- Copyright : (c) Simon Marlow 2003-2006, --- David Waern 2006-2010 --- License : BSD-like --- --- Maintainer : haddock@projects.haskell.org --- Stability : experimental --- Portability : portable --- --- Haddock - A Haskell Documentation Tool --- --- Program entry point and top-level code. ------------------------------------------------------------------------------ -module Main (main, readPackagesAndProcessModules, withGhc') where - - -import Haddock.Backends.Xhtml -import Haddock.Backends.Xhtml.Themes (getThemes) -import Haddock.Backends.LaTeX -import Haddock.Backends.Hoogle -import Haddock.Interface -import Haddock.Lex -import Haddock.Parse -import Haddock.Types -import Haddock.Version -import Haddock.InterfaceFile -import Haddock.Options -import Haddock.Utils -import Haddock.GhcUtils hiding (pretty) - -import Control.Monad -import Control.Exception -import Data.Maybe -import Data.IORef -import qualified Data.Map as Map -import System.IO -import System.Exit -import System.Environment - -#if defined(mingw32_HOST_OS) -import Foreign -import Foreign.C -import Data.Int -#endif - -#ifdef IN_GHC_TREE -import System.FilePath -#else -import qualified GHC.Paths as GhcPaths -import Paths_haddock -#endif - -import GHC hiding (flags, verbosity) -import Config -import DynFlags hiding (flags, verbosity) -import StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals) -import Panic (panic, handleGhcException) -import Module - -import Control.Monad.Fix (MonadFix) - - --------------------------------------------------------------------------------- --- * Exception handling --------------------------------------------------------------------------------- - - -handleTopExceptions :: IO a -> IO a -handleTopExceptions = - handleNormalExceptions . handleHaddockExceptions . handleGhcExceptions - - --- | Either returns normally or throws an ExitCode exception; --- all other exceptions are turned into exit exceptions. -handleNormalExceptions :: IO a -> IO a -handleNormalExceptions inner = - (inner `onException` hFlush stdout) - `catches` - [ Handler (\(code :: ExitCode) -> exitWith code) - - , Handler (\(ex :: AsyncException) -> - case ex of - StackOverflow -> do - putStrLn "stack overflow: use -g +RTS -K to increase it" - exitFailure - _ -> do - putStrLn ("haddock: " ++ show ex) - exitFailure) - - , Handler (\(ex :: SomeException) -> do - putStrLn ("haddock: internal error: " ++ show ex) - exitFailure) - ] - - -handleHaddockExceptions :: IO a -> IO a -handleHaddockExceptions inner = - catches inner [Handler handler] - where - handler (e::HaddockException) = do - putStrLn $ "haddock: " ++ show e - exitFailure - - -handleGhcExceptions :: IO a -> IO a -handleGhcExceptions = - -- error messages propagated as exceptions - handleGhcException $ \e -> do - hFlush stdout - case e of - PhaseFailed _ code -> exitWith code - _ -> do - print (e :: GhcException) - exitFailure - - -------------------------------------------------------------------------------- --- * Top level -------------------------------------------------------------------------------- - - -main :: IO () -main = handleTopExceptions $ do - - -- Parse command-line flags and handle some of them initially. - -- TODO: unify all of this (and some of what's in the 'render' function), - -- into one function that returns a record with a field for each option, - -- or which exits with an error or help message. - args <- getArgs - (flags, files) <- parseHaddockOpts args - shortcutFlags flags - qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q} - - withGhc' flags $ do - - dflags <- getDynFlags - - if not (null files) then do - (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files - - -- Dump an "interface file" (.haddock file), if requested. - case optDumpInterfaceFile flags of - Just f -> liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks - Nothing -> return () - - -- Render the interfaces. - liftIO $ renderStep dflags flags qual packages ifaces - - else do - when (any (`elem` [Flag_Html, Flag_Hoogle, Flag_LaTeX]) flags) $ - throwE "No input file(s)." - - -- Get packages supplied with --read-interface. - packages <- liftIO $ readInterfaceFiles freshNameCache (readIfaceArgs flags) - - -- Render even though there are no input files (usually contents/index). - liftIO $ renderStep dflags flags qual packages [] - - -withGhc' :: [Flag] -> Ghc a -> IO a -withGhc' flags action = do - libDir <- fmap snd (getGhcDirs flags) - - -- Catches all GHC source errors, then prints and re-throws them. - let handleSrcErrors action' = flip handleSourceError action' $ \err -> do - printException err - liftIO exitFailure - - withGhc libDir (ghcFlags flags) (\_ -> handleSrcErrors action) - - -readPackagesAndProcessModules :: [Flag] -> [String] - -> Ghc ([(DocPaths, InterfaceFile)], [Interface], LinkEnv) -readPackagesAndProcessModules flags files = do - -- Get packages supplied with --read-interface. - packages <- readInterfaceFiles nameCacheFromGhc (readIfaceArgs flags) - - -- Create the interfaces -- this is the core part of Haddock. - let ifaceFiles = map snd packages - (ifaces, homeLinks) <- processModules (verbosity flags) files flags ifaceFiles - - return (packages, ifaces, homeLinks) - - -renderStep :: DynFlags -> [Flag] -> QualOption -> [(DocPaths, InterfaceFile)] -> [Interface] -> IO () -renderStep dflags flags qual pkgs interfaces = do - updateHTMLXRefs pkgs - let - ifaceFiles = map snd pkgs - installedIfaces = concatMap ifInstalledIfaces ifaceFiles - srcMap = Map.fromList [ (ifPackageId if_, x) | ((_, Just x), if_) <- pkgs ] - render dflags flags qual interfaces installedIfaces srcMap - - --- | Render the interfaces with whatever backend is specified in the flags. -render :: DynFlags -> [Flag] -> QualOption -> [Interface] -> [InstalledInterface] -> SrcMap -> IO () -render dflags flags qual ifaces installedIfaces srcMap = do - - let - title = fromMaybe "" (optTitle flags) - unicode = Flag_UseUnicode `elem` flags - pretty = Flag_PrettyHtml `elem` flags - opt_wiki_urls = wikiUrls flags - opt_contents_url = optContentsUrl flags - opt_index_url = optIndexUrl flags - odir = outputDir flags - opt_latex_style = optLaTeXStyle flags - - visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ] - - -- /All/ visible interfaces including external package modules. - allIfaces = map toInstalledIface ifaces ++ installedIfaces - allVisibleIfaces = [ i | i <- allIfaces, OptHide `notElem` instOptions i ] - - pkgMod = ifaceMod (head ifaces) - pkgId = modulePackageId pkgMod - pkgStr = Just (packageIdString pkgId) - (pkgName,pkgVer) = modulePackageInfo pkgMod - - (srcBase, srcModule, srcEntity) = sourceUrls flags - srcMap' = maybe srcMap (\path -> Map.insert pkgId path srcMap) srcEntity - sourceUrls' = (srcBase, srcModule, srcMap') - - libDir <- getHaddockLibDir flags - prologue <- getPrologue flags - themes <- getThemes libDir flags >>= either bye return - - when (Flag_GenIndex `elem` flags) $ do - ppHtmlIndex odir title pkgStr - themes opt_contents_url sourceUrls' opt_wiki_urls - allVisibleIfaces pretty - copyHtmlBits odir libDir themes - - when (Flag_GenContents `elem` flags) $ do - ppHtmlContents odir title pkgStr - themes opt_index_url sourceUrls' opt_wiki_urls - allVisibleIfaces True prologue pretty - (makeContentsQual qual) - copyHtmlBits odir libDir themes - - when (Flag_Html `elem` flags) $ do - ppHtml title pkgStr visibleIfaces odir - prologue - themes sourceUrls' opt_wiki_urls - opt_contents_url opt_index_url unicode qual - pretty - copyHtmlBits odir libDir themes - - when (Flag_Hoogle `elem` flags) $ do - let pkgName2 = if pkgName == "main" && title /= [] then title else pkgName - ppHoogle dflags pkgName2 pkgVer title prologue visibleIfaces odir - - when (Flag_LaTeX `elem` flags) $ do - ppLaTeX title pkgStr visibleIfaces odir prologue opt_latex_style - libDir - - -------------------------------------------------------------------------------- --- * Reading and dumping interface files -------------------------------------------------------------------------------- - - -readInterfaceFiles :: (MonadFix m, MonadIO m) => - NameCacheAccessor m - -> [(DocPaths, FilePath)] -> - m [(DocPaths, InterfaceFile)] -readInterfaceFiles name_cache_accessor pairs = do - mbPackages <- mapM tryReadIface pairs - return (catMaybes mbPackages) - where - -- try to read an interface, warn if we can't - tryReadIface (paths, file) = do - eIface <- readInterfaceFile name_cache_accessor file - case eIface of - Left err -> liftIO $ do - putStrLn ("Warning: Cannot read " ++ file ++ ":") - putStrLn (" " ++ err) - putStrLn "Skipping this interface." - return Nothing - Right f -> return $ Just (paths, f) - - -dumpInterfaceFile :: FilePath -> [InstalledInterface] -> LinkEnv -> IO () -dumpInterfaceFile path ifaces homeLinks = writeInterfaceFile path ifaceFile - where - ifaceFile = InterfaceFile { - ifInstalledIfaces = ifaces, - ifLinkEnv = homeLinks - } - - -------------------------------------------------------------------------------- --- * Creating a GHC session -------------------------------------------------------------------------------- - - --- | Start a GHC session with the -haddock flag set. Also turn off --- compilation and linking. Then run the given 'Ghc' action. -withGhc :: String -> [String] -> (DynFlags -> Ghc a) -> IO a -withGhc libDir flags ghcActs = saveStaticFlagGlobals >>= \savedFlags -> do - -- TODO: handle warnings? - (restFlags, _) <- parseStaticFlags (map noLoc flags) - runGhc (Just libDir) $ do - dynflags <- getSessionDynFlags - let dynflags' = dopt_set dynflags Opt_Haddock - let dynflags'' = dynflags' { - hscTarget = HscNothing, - ghcMode = CompManager, - ghcLink = NoLink - } - dynflags''' <- parseGhcFlags dynflags'' restFlags flags - defaultCleanupHandler dynflags''' $ do - -- ignore the following return-value, which is a list of packages - -- that may need to be re-linked: Haddock doesn't do any - -- dynamic or static linking at all! - _ <- setSessionDynFlags dynflags''' - ghcActs dynflags''' - `finally` restoreStaticFlagGlobals savedFlags - where - parseGhcFlags :: Monad m => DynFlags -> [Located String] - -> [String] -> m DynFlags - parseGhcFlags dynflags flags_ origFlags = do - -- TODO: handle warnings? - (dynflags', rest, _) <- parseDynamicFlags dynflags flags_ - if not (null rest) - then throwE ("Couldn't parse GHC options: " ++ unwords origFlags) - else return dynflags' - - -------------------------------------------------------------------------------- --- * Misc -------------------------------------------------------------------------------- - - -getHaddockLibDir :: [Flag] -> IO String -getHaddockLibDir flags = - case [str | Flag_Lib str <- flags] of - [] -> -#ifdef IN_GHC_TREE - getInTreeDir -#else - getDataDir -- provided by Cabal -#endif - fs -> return (last fs) - - -getGhcDirs :: [Flag] -> IO (String, String) -getGhcDirs flags = do - case [ dir | Flag_GhcLibDir dir <- flags ] of - [] -> do -#ifdef IN_GHC_TREE - libDir <- getInTreeDir - return (ghcPath, libDir) -#else - return (ghcPath, GhcPaths.libdir) -#endif - xs -> return (ghcPath, last xs) - where -#ifdef IN_GHC_TREE - ghcPath = "not available" -#else - ghcPath = GhcPaths.ghc -#endif - - -shortcutFlags :: [Flag] -> IO () -shortcutFlags flags = do - usage <- getUsage - - when (Flag_Help `elem` flags) (bye usage) - when (Flag_Version `elem` flags) byeVersion - when (Flag_InterfaceVersion `elem` flags) (bye (show binaryInterfaceVersion ++ "\n")) - when (Flag_GhcVersion `elem` flags) (bye (cProjectVersion ++ "\n")) - - when (Flag_PrintGhcPath `elem` flags) $ do - dir <- fmap fst (getGhcDirs flags) - bye $ dir ++ "\n" - - when (Flag_PrintGhcLibDir `elem` flags) $ do - dir <- fmap snd (getGhcDirs flags) - bye $ dir ++ "\n" - - when (Flag_UseUnicode `elem` flags && Flag_Html `notElem` flags) $ - throwE "Unicode can only be enabled for HTML output." - - when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) - && Flag_Html `elem` flags) $ - throwE "-h cannot be used with --gen-index or --gen-contents" - - when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) - && Flag_Hoogle `elem` flags) $ - throwE "--hoogle cannot be used with --gen-index or --gen-contents" - - when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) - && Flag_LaTeX `elem` flags) $ - throwE "--latex cannot be used with --gen-index or --gen-contents" - where - byeVersion = bye $ - "Haddock version " ++ projectVersion ++ ", (c) Simon Marlow 2006\n" - ++ "Ported to use the GHC API by David Waern 2006-2008\n" - - -updateHTMLXRefs :: [(DocPaths, InterfaceFile)] -> IO () -updateHTMLXRefs packages = do - writeIORef html_xrefs_ref (Map.fromList mapping) - writeIORef html_xrefs_ref' (Map.fromList mapping') - where - mapping = [ (instMod iface, html) | ((html, _), ifaces) <- packages - , iface <- ifInstalledIfaces ifaces ] - mapping' = [ (moduleName m, html) | (m, html) <- mapping ] - - -getPrologue :: [Flag] -> IO (Maybe (Doc RdrName)) -getPrologue flags = - case [filename | Flag_Prologue filename <- flags ] of - [] -> return Nothing - [filename] -> do - str <- readFile filename - case parseParas (tokenise (defaultDynFlags (panic "No settings")) str - (1,0) {- TODO: real position -}) of - Nothing -> throwE $ "failed to parse haddock prologue from file: " ++ filename - Just doc -> return (Just doc) - _otherwise -> throwE "multiple -p/--prologue options" - - -#ifdef IN_GHC_TREE - -getInTreeDir :: IO String -getInTreeDir = do - m <- getExecDir - case m of - Nothing -> error "No GhcDir found" - Just d -> return (d ".." "lib") - - -getExecDir :: IO (Maybe String) -#if defined(mingw32_HOST_OS) -getExecDir = try_size 2048 -- plenty, PATH_MAX is 512 under Win32. - where - try_size size = allocaArray (fromIntegral size) $ \buf -> do - ret <- c_GetModuleFileName nullPtr buf size - case ret of - 0 -> return Nothing - _ | ret < size -> fmap (Just . dropFileName) $ peekCWString buf - | otherwise -> try_size (size * 2) - -foreign import stdcall unsafe "windows.h GetModuleFileNameW" - c_GetModuleFileName :: Ptr () -> CWString -> Word32 -> IO Word32 -#else -getExecDir = return Nothing -#endif - -#endif - -- cgit v1.2.3 From 11710479a4219024ba80416b385091bafab4da82 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 4 Oct 2012 16:12:44 +0200 Subject: Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. --- haddock.cabal | 98 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 42dc9771..ec274445 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -74,61 +74,57 @@ flag in-ghc-tree executable haddock default-language: Haskell2010 - -- In a GHC tree - in particular, in a source tarball - we don't - -- require alex or happy - if !flag(in-ghc-tree) - build-tools: alex >= 2.3, happy >= 1.18 - build-depends: - base >= 4.3 && < 4.7, - filepath, - directory, - containers, - deepseq, - array, - xhtml >= 3000.2 && < 3000.3, - Cabal >= 1.10, - ghc >= 7.4 && < 7.8 + main-is: Main.hs + hs-source-dirs: driver + ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs + build-depends: + base >= 4.3 && < 4.7 if flag(in-ghc-tree) + hs-source-dirs: src cpp-options: -DIN_GHC_TREE + build-depends: + filepath, + directory, + containers, + deepseq, + array, + xhtml >= 3000.2 && < 3000.3, + Cabal >= 1.10, + ghc >= 7.4 && < 7.8 + other-modules: + Documentation.Haddock + Haddock + Haddock.Interface + Haddock.Interface.Rename + Haddock.Interface.Create + Haddock.Interface.AttachInstances + Haddock.Interface.LexParseRn + Haddock.Interface.ParseModuleHeader + Haddock.Lex + Haddock.Parse + Haddock.Utils + Haddock.Backends.Xhtml + Haddock.Backends.Xhtml.Decl + Haddock.Backends.Xhtml.DocMarkup + Haddock.Backends.Xhtml.Layout + Haddock.Backends.Xhtml.Names + Haddock.Backends.Xhtml.Themes + Haddock.Backends.Xhtml.Types + Haddock.Backends.Xhtml.Utils + Haddock.Backends.LaTeX + Haddock.Backends.HaddockDB + Haddock.Backends.Hoogle + Haddock.ModuleTree + Haddock.Types + Haddock.Doc + Haddock.Version + Haddock.InterfaceFile + Haddock.Options + Haddock.GhcUtils + Haddock.Convert else - build-depends: ghc-paths - - main-is: Main.hs - hs-source-dirs: src, driver - ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs - - other-modules: - Documentation.Haddock - Haddock - Haddock.Interface - Haddock.Interface.Rename - Haddock.Interface.Create - Haddock.Interface.AttachInstances - Haddock.Interface.LexParseRn - Haddock.Interface.ParseModuleHeader - Haddock.Lex - Haddock.Parse - Haddock.Utils - Haddock.Backends.Xhtml - Haddock.Backends.Xhtml.Decl - Haddock.Backends.Xhtml.DocMarkup - Haddock.Backends.Xhtml.Layout - Haddock.Backends.Xhtml.Names - Haddock.Backends.Xhtml.Themes - Haddock.Backends.Xhtml.Types - Haddock.Backends.Xhtml.Utils - Haddock.Backends.LaTeX - Haddock.Backends.HaddockDB - Haddock.Backends.Hoogle - Haddock.ModuleTree - Haddock.Types - Haddock.Doc - Haddock.Version - Haddock.InterfaceFile - Haddock.Options - Haddock.GhcUtils - Haddock.Convert + build-depends: haddock library default-language: Haskell2010 -- cgit v1.2.3 From 2319833e9d96a78ba041a0041abc9bfffb523702 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 5 Oct 2012 00:32:57 +0200 Subject: Set executable flag for Setup.lhs --- Setup.lhs | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Setup.lhs diff --git a/Setup.lhs b/Setup.lhs old mode 100644 new mode 100755 -- cgit v1.2.3 From dd6209a0a1adf9f2817075173cca99ac2379db2e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 16:44:06 +0200 Subject: Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. --- tests/html-tests/runtests.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 25e53d1a..fc9477ca 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -43,15 +43,19 @@ test = do _ -> filter ((==) ".hs" . takeExtension) contents let mods' = map (testDir ) mods + + env_ <- getEnvironment + let env = Just (("haddock_datadir", packageRoot) : env_) + putStrLn "" putStrLn "Haddock version: " h1 <- runProcess haddockPath ["--version"] Nothing - (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing + env Nothing Nothing Nothing waitForProcess h1 putStrLn "" putStrLn "GHC version: " h2 <- runProcess haddockPath ["--ghc-version"] Nothing - (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing + env Nothing Nothing Nothing waitForProcess h2 putStrLn "" @@ -77,7 +81,7 @@ test = do handle <- runProcess haddockPath (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing (Just [("haddock_datadir", packageRoot)]) Nothing + Nothing env Nothing Nothing Nothing code <- waitForProcess handle -- cgit v1.2.3 From 5e746fa9e5dc4b210dab3b1fe1b120760b96f305 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 17:05:45 +0200 Subject: cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. --- tests/html-tests/tests/CrossPackageDocs.hs | 3 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 204 ++------------------- .../tests/mini_CrossPackageDocs.html.ref | 4 +- 3 files changed, 24 insertions(+), 187 deletions(-) diff --git a/tests/html-tests/tests/CrossPackageDocs.hs b/tests/html-tests/tests/CrossPackageDocs.hs index de55060e..4d529f79 100644 --- a/tests/html-tests/tests/CrossPackageDocs.hs +++ b/tests/html-tests/tests/CrossPackageDocs.hs @@ -1,3 +1,4 @@ -module CrossPackageDocs (map, Monad(..), runInteractiveProcess) where +module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where import System.Process +import Data.String diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index 39353720..d0a306af 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -53,28 +53,16 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html" >class Monad m IsString a where
  • class Monad m IsString a where

    The Monad class defines the basic operations over a monad, -a concept from a branch of mathematics known as category theory. -From the perspective of a Haskell programmer, however, it is best to -think of a monad as an abstract datatype of actions. -Haskell's do expressions provide a convenient syntax for writing -monadic expressions. -

    Minimal complete definition: >>= and return. -

    Instances of Monad should satisfy the following laws: -

     return a >>= k  ==  k a
    - m >>= return  ==  m
    - m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h
    -

    Instances of both Monad and Functor should additionally satisfy the law: -

     fmap f xs  ==  xs >>= return . f
    -

    The instances of Monad for lists, Maybe and IO -defined in the Prelude satisfy these laws. + >Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC).

    Methods

    (>>=) :: m a -> (a -> m b) -> m b

    Sequentially compose two actions, passing any value produced - by the first as an argument to the second. -

    (>>) :: m a -> m b -> m b

    Sequentially compose two actions, discarding any value produced - by the first, like sequencing operators (such as the semicolon) - in imperative languages. -

    return :: a -> m a

    Inject a value into the monadic type. -

    fail :: fromString :: String -> m a

    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 do expression. -

    -> a

    Instances

    IsString [Char]classMonad m

    IsString a

    Date: Sun, 7 Oct 2012 17:46:08 +0200 Subject: runtests.hs: Fix some warnings --- tests/html-tests/runtests.hs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index fc9477ca..9d5d0502 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -1,8 +1,9 @@ +import Prelude hiding (mod) import Control.Monad import Data.List import Data.Maybe import Distribution.InstalledPackageInfo -import Distribution.Package +import Distribution.Package (PackageName (..)) import Distribution.Simple.Compiler import Distribution.Simple.GHC import Distribution.Simple.PackageIndex @@ -14,10 +15,10 @@ import System.Directory import System.Environment import System.Exit import System.FilePath -import System.Process -import Text.Printf +import System.Process (runProcess, waitForProcess) +packageRoot, haddockPath, testSuiteRoot, testDir, outDir :: FilePath packageRoot = "." haddockPath = packageRoot "dist" "build" "haddock" "haddock" testSuiteRoot = packageRoot "tests" "html-tests" @@ -25,11 +26,13 @@ testDir = testSuiteRoot "tests" outDir = testSuiteRoot "output" +main :: IO () main = do test putStrLn "All tests passed!" +test :: IO () test = do x <- doesFileExist haddockPath unless x $ die "you need to run 'cabal build' successfully first" @@ -39,7 +42,7 @@ test = do let (opts, spec) = span ("-" `isPrefixOf`) args let mods = case spec of - x:_ | x /= "all" -> [x ++ ".hs"] + y:_ | y /= "all" -> [y ++ ".hs"] _ -> filter ((==) ".hs" . takeExtension) contents let mods' = map (testDir ) mods @@ -63,7 +66,6 @@ test = do ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf - let safeHead xs = case xs of x : _ -> Just x; [] -> Nothing let mkDep pkgName = maybe (error "Couldn't find test dependencies") id $ do let pkgs = lookupPackageName pkgIndex (PackageName pkgName) @@ -87,8 +89,11 @@ test = do code <- waitForProcess handle when (code /= ExitSuccess) $ error "Haddock run failed! Exiting." check mods (if not (null args) && args !! 0 == "all" then False else True) + where + safeHead xs = case xs of x : _ -> Just x; [] -> Nothing +check :: [FilePath] -> Bool -> IO () check modules strict = do forM_ modules $ \mod -> do let outfile = outDir dropExtension mod ++ ".html" @@ -108,8 +113,8 @@ check modules strict = do outfile' = outDir takeFileName outfile ++ ".nolinks" writeFile reffile' ref' writeFile outfile' out' - b <- programOnPath "colordiff" - if b + r <- programOnPath "colordiff" + if r then system $ "colordiff " ++ reffile' ++ " " ++ outfile' else system $ "diff " ++ reffile' ++ " " ++ outfile' if strict then exitFailure else return () @@ -119,8 +124,10 @@ check modules strict = do putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" +haddockEq :: String -> String -> Bool haddockEq file1 file2 = stripLinks file1 == stripLinks file2 +stripLinks :: String -> String stripLinks str = let prefix = " [] x : xs -> x : stripLinks xs +programOnPath :: FilePath -> IO Bool programOnPath p = do result <- findProgramLocation silent p return (isJust result) - -- cgit v1.2.3 From 13e5da9d435168a81060e6cc6a262a4fe5315934 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 17:57:11 +0200 Subject: runtests.hs: Make -Wall proof --- tests/html-tests/runtests.hs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 9d5d0502..2f218d17 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -10,12 +10,13 @@ import Distribution.Simple.PackageIndex import Distribution.Simple.Program import Distribution.Simple.Utils import Distribution.Verbosity +import System.IO import System.Cmd import System.Directory import System.Environment import System.Exit import System.FilePath -import System.Process (runProcess, waitForProcess) +import System.Process (ProcessHandle, runProcess, waitForProcess) packageRoot, haddockPath, testSuiteRoot, testDir, outDir :: FilePath @@ -54,12 +55,12 @@ test = do putStrLn "Haddock version: " h1 <- runProcess haddockPath ["--version"] Nothing env Nothing Nothing Nothing - waitForProcess h1 + wait h1 "*** Running `haddock --version' failed!" putStrLn "" putStrLn "GHC version: " h2 <- runProcess haddockPath ["--ghc-version"] Nothing env Nothing Nothing Nothing - waitForProcess h2 + wait h2 "*** Running `haddock --ghc-version' failed!" putStrLn "" -- TODO: maybe do something more clever here using haddock.cabal @@ -86,12 +87,19 @@ test = do Nothing env Nothing Nothing Nothing - code <- waitForProcess handle - when (code /= ExitSuccess) $ error "Haddock run failed! Exiting." + wait handle "*** Haddock run failed! Exiting." check mods (if not (null args) && args !! 0 == "all" then False else True) where + + safeHead :: [a] -> Maybe a safeHead xs = case xs of x : _ -> Just x; [] -> Nothing + wait :: ProcessHandle -> String -> IO () + wait h msg = do + r <- waitForProcess h + unless (r == ExitSuccess) $ do + hPutStrLn stderr msg + exitFailure check :: [FilePath] -> Bool -> IO () check modules strict = do @@ -114,10 +122,13 @@ check modules strict = do writeFile reffile' ref' writeFile outfile' out' r <- programOnPath "colordiff" - if r + code <- if r then system $ "colordiff " ++ reffile' ++ " " ++ outfile' else system $ "diff " ++ reffile' ++ " " ++ outfile' if strict then exitFailure else return () + unless (code == ExitSuccess) $ do + hPutStrLn stderr "*** Running diff failed!" + exitFailure else do putStrLn $ "Pass: " ++ mod else do -- cgit v1.2.3 From bfaff48e91dd9f2f3d94739851ab18e7d872c7ff Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 18:06:08 +0200 Subject: runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe --- tests/html-tests/runtests.hs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 2f218d17..28bf2f7e 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -68,12 +68,12 @@ test = do (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf let mkDep pkgName = - maybe (error "Couldn't find test dependencies") id $ do + fromMaybe (error "Couldn't find test dependencies") $ do let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- safeHead pkgs - pkg <- safeHead pkgs' - ifacePath <- safeHead (haddockInterfaces pkg) - htmlPath <- safeHead (haddockHTMLs pkg) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) return ("-i " ++ htmlPath ++ "," ++ ifacePath) let base = mkDep "base" @@ -90,10 +90,6 @@ test = do wait handle "*** Haddock run failed! Exiting." check mods (if not (null args) && args !! 0 == "all" then False else True) where - - safeHead :: [a] -> Maybe a - safeHead xs = case xs of x : _ -> Just x; [] -> Nothing - wait :: ProcessHandle -> String -> IO () wait h msg = do r <- waitForProcess h -- cgit v1.2.3 From ac8417bd0e947d81713a8ec31fe048aa43e34c03 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 11:16:19 +0200 Subject: Update .ghci --- .ghci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ghci b/.ghci index ff2b6637..afdd26a8 100644 --- a/.ghci +++ b/.ghci @@ -1 +1 @@ -:set -isrc -idist/build/autogen -idist/build/haddock/haddock-tmp/ -packageghc -optP-include -optPdist/build/autogen/cabal_macros.h +:set -isrc -idist/build -idist/build/autogen -packageghc -optP-include -optPdist/build/autogen/cabal_macros.h -- cgit v1.2.3 From 72675c1bf281b81041a19014b1b7df03a0de9488 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 9 Apr 2012 15:45:57 +0900 Subject: Add markup support for properties --- src/Haddock/Backends/Hoogle.hs | 1 + src/Haddock/Backends/LaTeX.hs | 1 + src/Haddock/Backends/Xhtml/DocMarkup.hs | 1 + src/Haddock/Interface/LexParseRn.hs | 1 + src/Haddock/Interface/Rename.hs | 1 + src/Haddock/InterfaceFile.hs | 6 ++++++ src/Haddock/Lex.x | 8 ++++++++ src/Haddock/Parse.y | 6 ++++++ src/Haddock/Types.hs | 2 ++ src/Haddock/Utils.hs | 2 ++ 10 files changed, 29 insertions(+) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 4949daa1..28d35aca 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -256,6 +256,7 @@ markupTag dflags = Markup { markupCodeBlock = box TagPre, markupHyperlink = \(Hyperlink url mLabel) -> (box (TagInline "a") . str) (fromMaybe url mLabel), markupAName = const $ str "", + markupProperty = box TagPre . str, markupExample = box TagPre . str . unlines . map exampleToString } diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 68cf715a..bf1e6ac3 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -1003,6 +1003,7 @@ parLatexMarkup ppId = Markup { markupCodeBlock = \p _ -> quote (verb (p Verb)) $$ text "", markupHyperlink = \l _ -> markupLink l, markupAName = \_ _ -> empty, + markupProperty = \p _ -> quote $ verb $ text p, markupExample = \e _ -> quote $ verb $ text $ unlines $ map exampleToString e } where diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs index e75cfaba..aa4ba377 100644 --- a/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -50,6 +50,7 @@ parHtmlMarkup qual ppId = Markup { markupHyperlink = \(Hyperlink url mLabel) -> anchor ! [href url] << fromMaybe url mLabel, markupAName = \aname -> namedAnchor aname << "", markupPic = \path -> image ! [src path], + markupProperty = pre . toHtml, markupExample = examplesToHtml } where diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs index 3ad9719e..ced12d8d 100644 --- a/src/Haddock/Interface/LexParseRn.hs +++ b/src/Haddock/Interface/LexParseRn.hs @@ -121,6 +121,7 @@ rename dflags gre = rn DocHyperlink l -> DocHyperlink l DocPic str -> DocPic str DocAName str -> DocAName str + DocProperty p -> DocProperty p DocExamples e -> DocExamples e DocEmpty -> DocEmpty DocString str -> DocString str diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 0f702683..55c9a5da 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -202,6 +202,7 @@ renameDoc d = case d of DocHyperlink l -> return (DocHyperlink l) DocPic str -> return (DocPic str) DocAName str -> return (DocAName str) + DocProperty p -> return (DocProperty p) DocExamples e -> return (DocExamples e) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 8fa8ce95..59b83c70 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -481,6 +481,9 @@ instance (Binary id) => Binary (Doc id) where put_ bh (DocWarning ag) = do putByte bh 17 put_ bh ag + put_ bh (DocProperty x) = do + putByte bh 18 + put_ bh x get bh = do h <- getByte bh case h of @@ -538,6 +541,9 @@ instance (Binary id) => Binary (Doc id) where 17 -> do ag <- get bh return (DocWarning ag) + 18 -> do + x <- get bh + return (DocProperty x) _ -> fail "invalid binary data found" diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index b9ebe688..35e6dd8a 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -50,6 +50,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] <0,para> { $ws* \n ; $ws* \> { begin birdtrack } + $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr } $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* [\*\-] { token TokBullet `andBegin` string } $ws* \[ { token TokDefStart `andBegin` def } @@ -61,6 +62,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] -- beginning of a line { $ws* \> { begin birdtrack } + $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr } $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* \n { token TokPara `andBegin` para } -- Here, we really want to be able to say @@ -84,6 +86,10 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] .* \n { strtokenNL TokExampleResult `andBegin` example } + .* \n { strtokenNL TokPropertyExpression `andBegin` property } + + () { token TokPara `andBegin` para } + { $special { strtoken $ \s -> TokSpecial (head s) } \<\< [^\>]* \>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) } @@ -129,6 +135,8 @@ data Token | TokEmphasis String | TokAName String | TokBirdTrack String + | TokPropertyPrompt String + | TokPropertyExpression String | TokExamplePrompt String | TokExampleExpression String | TokExampleResult String diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y index b34b14b9..c8a1a558 100644 --- a/src/Haddock/Parse.y +++ b/src/Haddock/Parse.y @@ -35,6 +35,8 @@ import Data.List (stripPrefix) '-' { (TokBullet,_) } '(n)' { (TokNumber,_) } '>..' { (TokBirdTrack $$,_) } + PPROMPT { (TokPropertyPrompt $$,_) } + PEXP { (TokPropertyExpression $$,_) } PROMPT { (TokExamplePrompt $$,_) } RESULT { (TokExampleResult $$,_) } EXP { (TokExampleExpression $$,_) } @@ -73,12 +75,16 @@ defpara :: { (Doc RdrName, Doc RdrName) } para :: { Doc RdrName } : seq { docParagraph $1 } | codepara { DocCodeBlock $1 } + | property { DocProperty $1 } | examples { DocExamples $1 } codepara :: { Doc RdrName } : '>..' codepara { docAppend (DocString $1) $2 } | '>..' { DocString $1 } +property :: { String } + : PPROMPT PEXP { strip $2 } + examples :: { [Example] } : example examples { $1 : $2 } | example { [$1] } diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index fbd05fae..05fc9747 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -306,6 +306,7 @@ data Doc id | DocHyperlink Hyperlink | DocPic String | DocAName String + | DocProperty String | DocExamples [Example] deriving (Functor) @@ -350,6 +351,7 @@ data DocMarkup id a = Markup , markupHyperlink :: Hyperlink -> a , markupAName :: String -> a , markupPic :: String -> a + , markupProperty :: String -> a , markupExample :: [Example] -> a } diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index b8f32589..4424ad73 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -432,6 +432,7 @@ markup m (DocCodeBlock d) = markupCodeBlock m (markup m d) markup m (DocHyperlink l) = markupHyperlink m l markup m (DocAName ref) = markupAName m ref markup m (DocPic img) = markupPic m img +markup m (DocProperty p) = markupProperty m p markup m (DocExamples e) = markupExample m e @@ -459,6 +460,7 @@ idMarkup = Markup { markupHyperlink = DocHyperlink, markupAName = DocAName, markupPic = DocPic, + markupProperty = DocProperty, markupExample = DocExamples } -- cgit v1.2.3 From dfbe1c45879d8ae32845c72e5ae241fb1c6fe502 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 12:41:25 +0200 Subject: Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. --- src/Haddock/Lex.x | 10 ++-------- src/Haddock/Parse.y | 16 +++++++++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index 35e6dd8a..aec4c647 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -50,7 +50,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] <0,para> { $ws* \n ; $ws* \> { begin birdtrack } - $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr } + $ws* prop \> .* \n { strtoken TokProperty } $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* [\*\-] { token TokBullet `andBegin` string } $ws* \[ { token TokDefStart `andBegin` def } @@ -62,7 +62,6 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] -- beginning of a line { $ws* \> { begin birdtrack } - $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr } $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* \n { token TokPara `andBegin` para } -- Here, we really want to be able to say @@ -86,10 +85,6 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] .* \n { strtokenNL TokExampleResult `andBegin` example } - .* \n { strtokenNL TokPropertyExpression `andBegin` property } - - () { token TokPara `andBegin` para } - { $special { strtoken $ \s -> TokSpecial (head s) } \<\< [^\>]* \>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) } @@ -135,8 +130,7 @@ data Token | TokEmphasis String | TokAName String | TokBirdTrack String - | TokPropertyPrompt String - | TokPropertyExpression String + | TokProperty String | TokExamplePrompt String | TokExampleExpression String | TokExampleResult String diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y index c8a1a558..0befe395 100644 --- a/src/Haddock/Parse.y +++ b/src/Haddock/Parse.y @@ -35,8 +35,7 @@ import Data.List (stripPrefix) '-' { (TokBullet,_) } '(n)' { (TokNumber,_) } '>..' { (TokBirdTrack $$,_) } - PPROMPT { (TokPropertyPrompt $$,_) } - PEXP { (TokPropertyExpression $$,_) } + PROP { (TokProperty $$,_) } PROMPT { (TokExamplePrompt $$,_) } RESULT { (TokExampleResult $$,_) } EXP { (TokExampleExpression $$,_) } @@ -75,15 +74,15 @@ defpara :: { (Doc RdrName, Doc RdrName) } para :: { Doc RdrName } : seq { docParagraph $1 } | codepara { DocCodeBlock $1 } - | property { DocProperty $1 } + | property { $1 } | examples { DocExamples $1 } codepara :: { Doc RdrName } : '>..' codepara { docAppend (DocString $1) $2 } | '>..' { DocString $1 } -property :: { String } - : PPROMPT PEXP { strip $2 } +property :: { Doc RdrName } + : PROP { makeProperty $1 } examples :: { [Example] } : example examples { $1 : $2 } @@ -136,6 +135,13 @@ makeHyperlink input = case break isSpace $ strip input of (url, "") -> Hyperlink url Nothing (url, label) -> Hyperlink url (Just . dropWhile isSpace $ label) +makeProperty :: String -> Doc RdrName +makeProperty s = case strip s of + 'p':'r':'o':'p':'>':xs -> + DocProperty (dropWhile isSpace xs) + xs -> + error $ "makeProperty: invalid input " ++ show xs + -- | Create an 'Example', stripping superfluous characters as appropriate makeExample :: String -> String -> [String] -> Example makeExample prompt expression result = -- cgit v1.2.3 From 0cf6d611f3af05c7b54d83747847d372a3ebf017 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 28 Aug 2012 08:51:57 +0200 Subject: Add HTML test for properties --- tests/html-tests/tests/Properties.hs | 9 +++ tests/html-tests/tests/Properties.html.ref | 92 +++++++++++++++++++++++++ tests/html-tests/tests/mini_Properties.html.ref | 31 +++++++++ 3 files changed, 132 insertions(+) create mode 100644 tests/html-tests/tests/Properties.hs create mode 100644 tests/html-tests/tests/Properties.html.ref create mode 100644 tests/html-tests/tests/mini_Properties.html.ref diff --git a/tests/html-tests/tests/Properties.hs b/tests/html-tests/tests/Properties.hs new file mode 100644 index 00000000..05930ece --- /dev/null +++ b/tests/html-tests/tests/Properties.hs @@ -0,0 +1,9 @@ +module Properties where + +-- | Fibonacci number of given 'Integer'. +-- +-- prop> fib n <= fib (n + 1) +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/html-tests/tests/Properties.html.ref b/tests/html-tests/tests/Properties.html.ref new file mode 100644 index 00000000..8fd918bf --- /dev/null +++ b/tests/html-tests/tests/Properties.html.ref @@ -0,0 +1,92 @@ + +Properties

    Monad [] 
    Monad IO 
    Monad Q 
    Monad Maybe 
    Monad PprM 
    Monad ((->) r) 
    Safe HaskellNone

    Properties

    Synopsis

    Documentation

    fib :: Integer -> Integer

    Fibonacci number of given Integer. +

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

    Properties

    -- cgit v1.2.3 From 48a078a6f3158470abbb2746a71d4659c768949e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 12:04:20 +0200 Subject: Add unit tests for properties --- tests/unit-tests/parsetests.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 4a6c8d90..1f923aa0 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -63,6 +63,17 @@ spec = do it "accepts an optional label" $ do parse "" `shouldBe` (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + + it "can parse a multiple subsequent properties" $ do + let input = unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") where hyperlink :: String -> Maybe String -> Doc RdrName hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3 From d9c5e0eea99dccf85bfa6f29b70b64ddd916d86c Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 12:50:39 +0200 Subject: Bump interface version --- src/Haddock/InterfaceFile.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 59b83c70..78ab892b 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -66,15 +66,15 @@ binaryInterfaceMagic = 0xD0Cface -- we version our interface files accordingly. binaryInterfaceVersion :: Word16 #if __GLASGOW_HASKELL__ == 702 -binaryInterfaceVersion = 21 +binaryInterfaceVersion = 22 #elif __GLASGOW_HASKELL__ == 703 -binaryInterfaceVersion = 21 +binaryInterfaceVersion = 22 #elif __GLASGOW_HASKELL__ == 704 -binaryInterfaceVersion = 21 +binaryInterfaceVersion = 22 #elif __GLASGOW_HASKELL__ == 705 -binaryInterfaceVersion = 21 +binaryInterfaceVersion = 22 #elif __GLASGOW_HASKELL__ == 706 -binaryInterfaceVersion = 21 +binaryInterfaceVersion = 22 #else #error Unknown GHC version #endif -- cgit v1.2.3 From 9d46da45a53678469d5fe4ef33f37bba45294633 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 15:15:04 +0200 Subject: Fix parser bug --- src/Haddock/Lex.x | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index aec4c647..0d8dd954 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -50,7 +50,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] <0,para> { $ws* \n ; $ws* \> { begin birdtrack } - $ws* prop \> .* \n { strtoken TokProperty } + $ws* prop \> .* \n { strtoken TokProperty `andBegin` property} $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* [\*\-] { token TokBullet `andBegin` string } $ws* \[ { token TokDefStart `andBegin` def } @@ -75,6 +75,8 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] .* \n? { strtokenNL TokBirdTrack `andBegin` line } + () { token TokPara `andBegin` para } + { $ws* \n { token TokPara `andBegin` para } $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } -- cgit v1.2.3 From 409b25a0e9821687eeffde3d6bdb87f0fd9c73f9 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 15:31:06 +0200 Subject: Allow to load interface files with compatible versions --- src/Haddock/InterfaceFile.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 78ab892b..1f6b489d 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -79,6 +79,9 @@ binaryInterfaceVersion = 22 #error Unknown GHC version #endif +binaryInterfaceVersionCompatibility :: [Word16] +binaryInterfaceVersionCompatibility = [21, 22] + initBinMemSize :: Int initBinMemSize = 1024*1024 @@ -187,7 +190,7 @@ readInterfaceFile (get_name_cache, set_name_cache) filename = do case () of _ | magic /= binaryInterfaceMagic -> return . Left $ "Magic number mismatch: couldn't load interface file: " ++ filename - | version /= binaryInterfaceVersion -> return . Left $ + | version `notElem` binaryInterfaceVersionCompatibility -> return . Left $ "Interface file is of wrong version: " ++ filename | otherwise -> with_name_cache $ \update_nc -> do -- cgit v1.2.3 From 59fe0a2dcd1b816ab66802d18239dc88f335f6c8 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Oct 2012 10:30:42 +0200 Subject: Export more types from Documentation.Haddock (fixes #216) --- src/Documentation/Haddock.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index 855cdc79..e8ff9160 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -35,7 +35,9 @@ module Documentation.Haddock ( -- * Documentation comments Doc(..), Example(..), + Hyperlink(..), DocMarkup(..), + Documentation(..), HaddockModInfo(..), markup, -- cgit v1.2.3 From ce09f353cab60e990f6d6b795da5a2db3aeb100d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Oct 2012 11:15:19 +0200 Subject: Update ANNOUNCE and CHANGES --- ANNOUNCE | 43 +++++++++---------------------------------- CHANGES | 10 ++++++++++ 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 36df3765..6ff63399 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,41 +1,20 @@ -------------------------------------------- --- Haddock 2.10.0 and 2.11.0 +-- Haddock 2.13.0 -------------------------------------------- -Two new versions of Haddock have been uploaded to Hackage: version -2.10.0 which comes with GHC 7.4.2 and 2.11.0 which comes with the new -GHC 7.6.1! +A new versions of Haddock has been uploaded to Hackage. -------------------------------------------- -- Changes in version 2.12.0 -------------------------------------------- - * Labeled URLs (e.g ) + * Hide instances that are "internal" to a module - * Improved memory usage (new dependency: deepseq) + * Add support for properties in documentation --------------------------------------------- --- Changes in version 2.11.0 --------------------------------------------- - - * Show deprecation messages for identifiers - - * List identifiers declared on the same line (with a common type) separately - - * Don't crash on unicode strings in doc comments - - * Fix reporting of modules safe haskell mode + * Fix a bug with spurious superclass constraints - * Fix a case where we were generating invalid xhtml - - * Improved --qual option (no crashes, proper error messages) - - * A new --qual option "aliased" which qualifies identifers by the module alias - used in the source code - - * The Haddock API restores GHC's static flags after invocation - - * Access to unexported identifiers through the Haddock API again + * Fix and extend the Haddock API -------------------------------------------- -- Links @@ -62,14 +41,10 @@ Code repository: The following people contributed patches to this release: -Paolo Capriotti -Simon Hengel -Ian Lynagh -Simon Peyton Jones -Iavor S. Diatchki -David Terei -Henning Thielemann +Kazu Yamamoto +Roman Cheplyaka David Waern +Simon Hengel -------------------------------------------- -- Get Involved diff --git a/CHANGES b/CHANGES index fdd5f43c..6c4d7137 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +Changes in version 2.13.0 + + * Hide instances that are "internal" to a module + + * Add support for properties in documentation + + * Fix a bug with spurious superclass constraints + + * Fix and extend the Haddock API + Changes in version 2.12.0 * Labeled URLs (e.g ) -- cgit v1.2.3 From 48a391729e2d00caf0b86d3612e34135a7379200 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Oct 2012 11:16:01 +0200 Subject: Bump version --- doc/haddock.xml | 2 +- haddock.cabal | 2 +- haddock.spec | 2 +- tests/html-tests/tests/A.html.ref | 2 +- tests/html-tests/tests/B.html.ref | 2 +- tests/html-tests/tests/Bug1.html.ref | 2 +- tests/html-tests/tests/Bug2.html.ref | 2 +- tests/html-tests/tests/Bug3.html.ref | 2 +- tests/html-tests/tests/Bug4.html.ref | 2 +- tests/html-tests/tests/Bug6.html.ref | 2 +- tests/html-tests/tests/Bug7.html.ref | 2 +- tests/html-tests/tests/Bug8.html.ref | 2 +- tests/html-tests/tests/BugDeprecated.html.ref | 2 +- tests/html-tests/tests/BugExportHeadings.html.ref | 2 +- tests/html-tests/tests/Bugs.html.ref | 2 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 2 +- tests/html-tests/tests/DeprecatedClass.html.ref | 2 +- tests/html-tests/tests/DeprecatedData.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction2.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction3.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule2.html.ref | 2 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 2 +- tests/html-tests/tests/DeprecatedRecord.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeFamily.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeSynonym.html.ref | 2 +- tests/html-tests/tests/Examples.html.ref | 2 +- tests/html-tests/tests/FunArgs.html.ref | 2 +- tests/html-tests/tests/GADTRecords.html.ref | 2 +- tests/html-tests/tests/Hash.html.ref | 2 +- tests/html-tests/tests/HiddenInstances.html.ref | 2 +- tests/html-tests/tests/HiddenInstancesB.html.ref | 2 +- tests/html-tests/tests/Hyperlinks.html.ref | 2 +- tests/html-tests/tests/IgnoreExports.html.ref | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 2 +- tests/html-tests/tests/NamedDoc.html.ref | 2 +- tests/html-tests/tests/NoLayout.html.ref | 2 +- tests/html-tests/tests/NonGreedy.html.ref | 2 +- tests/html-tests/tests/Properties.html.ref | 2 +- tests/html-tests/tests/PruneWithWarning.html.ref | 2 +- tests/html-tests/tests/QuasiExpr.html.ref | 2 +- tests/html-tests/tests/QuasiQuote.html.ref | 2 +- tests/html-tests/tests/TH.html.ref | 2 +- tests/html-tests/tests/TH2.html.ref | 2 +- tests/html-tests/tests/Test.html.ref | 2 +- tests/html-tests/tests/Ticket112.html.ref | 2 +- tests/html-tests/tests/Ticket61.html.ref | 2 +- tests/html-tests/tests/Ticket75.html.ref | 2 +- tests/html-tests/tests/TypeFamilies.html.ref | 2 +- tests/html-tests/tests/TypeOperators.html.ref | 2 +- tests/html-tests/tests/Unicode.html.ref | 2 +- tests/html-tests/tests/Visible.html.ref | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index a38b70cf..90946e12 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.12.0, a Haskell + This document describes Haddock version 2.13.0, a Haskell documentation tool. diff --git a/haddock.cabal b/haddock.cabal index ec274445..d6864f85 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.12.0 +version: 2.13.0 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries diff --git a/haddock.spec b/haddock.spec index d8821a4a..594d87b1 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.12.0 +%define version 2.13.0 %define release 1 Name: %{name} diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index ec9dc975..17765b50 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Date: Wed, 10 Oct 2012 13:56:04 +0200 Subject: Fix typo in documentation --- doc/haddock.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 90946e12..7a2f1e8e 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1658,7 +1658,7 @@ module A where by zero or more result lines: --- | Two examples are given bellow: +-- | Two examples are given below: -- -- >>> fib 10 -- 55 -- cgit v1.2.3 From 98dcade7ac447886c9e39ae3f7ce0f2094db5e74 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Oct 2012 14:28:35 +0200 Subject: Add documentation for properties --- doc/haddock.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index 7a2f1e8e..4620fc89 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1672,6 +1672,18 @@ module A where generated documenation. +
    + Properties + + Haddock provides markup for properties: + +-- | Addition is commutative: +-- +-- prop> a + b = b + a + + This allows third-party applications to extract and verify them. + +
    Hyperlinked Identifiers -- cgit v1.2.3 From 6d490e93ec83dd5ee0fae86724f62c54801f4053 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 11 Oct 2012 10:49:04 +0200 Subject: Remove redundant if-defs, more source documentation --- src/Haddock/InterfaceFile.hs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 1f6b489d..79818625 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -61,27 +61,28 @@ binaryInterfaceMagic :: Word32 binaryInterfaceMagic = 0xD0Cface --- Since datatypes in the GHC API might change between major versions, and --- because we store GHC datatypes in our interface files, we need to make sure --- we version our interface files accordingly. +#if __GLASGOW_HASKELL__ == 706 +-- IMPORTANT: Since datatypes in the GHC API might change between major +-- versions, and because we store GHC datatypes in our interface files, we need +-- to make sure we version our interface files accordingly. +-- +-- If you adapt this code to work with a newer versions of GHC *you* need to +-- follow those steps: +-- +-- (1) increase `binaryInterfaceVersion` +-- +-- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion] +-- binaryInterfaceVersion :: Word16 -#if __GLASGOW_HASKELL__ == 702 -binaryInterfaceVersion = 22 -#elif __GLASGOW_HASKELL__ == 703 -binaryInterfaceVersion = 22 -#elif __GLASGOW_HASKELL__ == 704 -binaryInterfaceVersion = 22 -#elif __GLASGOW_HASKELL__ == 705 binaryInterfaceVersion = 22 -#elif __GLASGOW_HASKELL__ == 706 -binaryInterfaceVersion = 22 -#else -#error Unknown GHC version -#endif binaryInterfaceVersionCompatibility :: [Word16] binaryInterfaceVersionCompatibility = [21, 22] +#else +#error Unsupported GHC version +#endif + initBinMemSize :: Int initBinMemSize = 1024*1024 -- cgit v1.2.3 From 93410d53e8eb07da95f4dfb8cb7d2e4488f0ef5c Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 11 Oct 2012 12:32:51 +0200 Subject: Adapt cabal file --- haddock.cabal | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index d6864f85..37b8acb9 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -26,26 +26,6 @@ extra-source-files: doc/docbook-xml.mk doc/fptools.css doc/haddock.xml - examples/A.hs - examples/B.hs - examples/Bug1.hs - examples/Bug2.hs - examples/Bug3.hs - examples/Bug4.hs - examples/Bug6.hs - examples/Bug7.hs - examples/Bug8.hs - examples/Bug9.hs - examples/Hash.hs - examples/Hidden.hs - examples/Makefile - examples/NoLayout.hs - examples/Test.hs - examples/Visible.hs - examples/hide-bug/A.hs - examples/hide-bug/B.hs - examples/hide-bug/C.hs - examples/hide-bug/D.hs haddock.spec haskell.vim src/haddock.sh -- cgit v1.2.3 From ca0646c8c7131da78fa3ba5e5409d37444b042c2 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 11 Oct 2012 12:41:58 +0200 Subject: Require ghc 7.6 --- haddock.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 37b8acb9..3df153a2 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -71,7 +71,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.4 && < 7.8 + ghc == 7.6.* other-modules: Documentation.Haddock Haddock @@ -121,7 +121,7 @@ library array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.4 && < 7.8 + ghc == 7.6.* if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE -- cgit v1.2.3 From f3706c58e07ea615796dcbe0d91a565188980c9c Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 11 Oct 2012 12:50:24 +0200 Subject: Bump version --- haddock.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock.cabal b/haddock.cabal index 3df153a2..c0d77a10 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.13.0 +version: 2.13.1 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries -- cgit v1.2.3 From d31b961cef67c12349a39d90d6afa7fb3cba18af Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 11 Oct 2012 12:54:38 +0200 Subject: Update ANNOUNCE and CHANGES --- ANNOUNCE | 6 +++--- CHANGES | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 6ff63399..8069437f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,11 +1,11 @@ -------------------------------------------- --- Haddock 2.13.0 +-- Haddock 2.13.1 -------------------------------------------- A new versions of Haddock has been uploaded to Hackage. -------------------------------------------- --- Changes in version 2.12.0 +-- Changes in version 2.13.1 -------------------------------------------- * Hide instances that are "internal" to a module @@ -24,7 +24,7 @@ Homepage: http://www.haskell.org/haddock Hackage page: - http://hackage.haskell.org/package/haddock-2.12.0 + http://hackage.haskell.org/package/haddock Bugtracker and wiki: http://trac.haskell.org/haddock diff --git a/CHANGES b/CHANGES index 6c4d7137..e68c8f9b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -Changes in version 2.13.0 +Changes in version 2.13.1 * Hide instances that are "internal" to a module -- cgit v1.2.3 From 36c2c37136ac26b19c6e869a537abbd990ebbc46 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 12 Oct 2012 09:49:31 +0200 Subject: Improve note about `binaryInterfaceVersion` (thanks David) --- src/Haddock/InterfaceFile.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 79818625..a25b734a 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -66,8 +66,9 @@ binaryInterfaceMagic = 0xD0Cface -- versions, and because we store GHC datatypes in our interface files, we need -- to make sure we version our interface files accordingly. -- --- If you adapt this code to work with a newer versions of GHC *you* need to --- follow those steps: +-- If you change the interface file format or adapt Haddock to work with a new +-- major version of GHC (so that the format changes indirectly) *you* need to +-- follow these steps: -- -- (1) increase `binaryInterfaceVersion` -- -- cgit v1.2.3 From 4c3ac64baa1117f127b1f3d620dec7276495cdb4 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 13:40:59 +0200 Subject: Update version in html tests, rpm spec file, and user manual --- doc/haddock.xml | 2 +- haddock.spec | 2 +- tests/html-tests/tests/A.html.ref | 2 +- tests/html-tests/tests/B.html.ref | 2 +- tests/html-tests/tests/Bug1.html.ref | 2 +- tests/html-tests/tests/Bug2.html.ref | 2 +- tests/html-tests/tests/Bug3.html.ref | 2 +- tests/html-tests/tests/Bug4.html.ref | 2 +- tests/html-tests/tests/Bug6.html.ref | 2 +- tests/html-tests/tests/Bug7.html.ref | 2 +- tests/html-tests/tests/Bug8.html.ref | 2 +- tests/html-tests/tests/BugDeprecated.html.ref | 2 +- tests/html-tests/tests/BugExportHeadings.html.ref | 2 +- tests/html-tests/tests/Bugs.html.ref | 2 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 2 +- tests/html-tests/tests/DeprecatedClass.html.ref | 2 +- tests/html-tests/tests/DeprecatedData.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction2.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction3.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule2.html.ref | 2 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 2 +- tests/html-tests/tests/DeprecatedRecord.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeFamily.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeSynonym.html.ref | 2 +- tests/html-tests/tests/Examples.html.ref | 2 +- tests/html-tests/tests/FunArgs.html.ref | 2 +- tests/html-tests/tests/GADTRecords.html.ref | 2 +- tests/html-tests/tests/Hash.html.ref | 2 +- tests/html-tests/tests/HiddenInstances.html.ref | 2 +- tests/html-tests/tests/HiddenInstancesB.html.ref | 2 +- tests/html-tests/tests/Hyperlinks.html.ref | 2 +- tests/html-tests/tests/IgnoreExports.html.ref | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 2 +- tests/html-tests/tests/NamedDoc.html.ref | 2 +- tests/html-tests/tests/NoLayout.html.ref | 2 +- tests/html-tests/tests/NonGreedy.html.ref | 2 +- tests/html-tests/tests/Properties.html.ref | 2 +- tests/html-tests/tests/PruneWithWarning.html.ref | 2 +- tests/html-tests/tests/QuasiExpr.html.ref | 2 +- tests/html-tests/tests/QuasiQuote.html.ref | 2 +- tests/html-tests/tests/TH.html.ref | 2 +- tests/html-tests/tests/TH2.html.ref | 2 +- tests/html-tests/tests/Test.html.ref | 2 +- tests/html-tests/tests/Ticket112.html.ref | 2 +- tests/html-tests/tests/Ticket61.html.ref | 2 +- tests/html-tests/tests/Ticket75.html.ref | 2 +- tests/html-tests/tests/TypeFamilies.html.ref | 2 +- tests/html-tests/tests/TypeOperators.html.ref | 2 +- tests/html-tests/tests/Unicode.html.ref | 2 +- tests/html-tests/tests/Visible.html.ref | 2 +- 52 files changed, 52 insertions(+), 52 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 4620fc89..4e4447dc 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.13.0, a Haskell + This document describes Haddock version 2.13.1, a Haskell documentation tool. diff --git a/haddock.spec b/haddock.spec index 594d87b1..401f1e8a 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.13.0 +%define version 2.13.1 %define release 1 Name: %{name} diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index 17765b50..328fec02 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Date: Sat, 13 Oct 2012 14:40:33 +0200 Subject: Remove unused MonadFix constraint --- src/Haddock.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index f53e01a9..3ac2115d 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -60,9 +60,6 @@ import StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals) import Panic (panic, handleGhcException) import Module -import Control.Monad.Fix (MonadFix) - - -------------------------------------------------------------------------------- -- * Exception handling -------------------------------------------------------------------------------- @@ -267,10 +264,10 @@ render dflags flags qual ifaces installedIfaces srcMap = do ------------------------------------------------------------------------------- -readInterfaceFiles :: (MonadFix m, MonadIO m) => - NameCacheAccessor m - -> [(DocPaths, FilePath)] -> - m [(DocPaths, InterfaceFile)] +readInterfaceFiles :: MonadIO m + => NameCacheAccessor m + -> [(DocPaths, FilePath)] + -> m [(DocPaths, InterfaceFile)] readInterfaceFiles name_cache_accessor pairs = do mbPackages <- mapM tryReadIface pairs return (catMaybes mbPackages) -- cgit v1.2.3 From 4dc9c211ccb6274b6663d71cf6f768d09ae76d66 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 15:15:38 +0200 Subject: Minor code simplification --- src/Haddock.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index 3ac2115d..f3535fb1 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -32,7 +32,8 @@ import Haddock.Options import Haddock.Utils import Haddock.GhcUtils hiding (pretty) -import Control.Monad +import Control.Monad hiding (forM_) +import Data.Foldable (forM_) import Control.Exception import Data.Maybe import Data.IORef @@ -143,9 +144,8 @@ haddock args = handleTopExceptions $ do (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files -- Dump an "interface file" (.haddock file), if requested. - case optDumpInterfaceFile flags of - Just f -> liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks - Nothing -> return () + forM_ (optDumpInterfaceFile flags) $ \f -> do + liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks -- Render the interfaces. liftIO $ renderStep dflags flags qual packages ifaces -- cgit v1.2.3 From fa3a688967255a5d7f7dba8430de467dc0b9e57b Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 15:33:43 +0200 Subject: Increase code locality --- src/Haddock.hs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index f3535fb1..c53b4543 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -144,8 +144,11 @@ haddock args = handleTopExceptions $ do (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files -- Dump an "interface file" (.haddock file), if requested. - forM_ (optDumpInterfaceFile flags) $ \f -> do - liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks + forM_ (optDumpInterfaceFile flags) $ \path -> liftIO $ do + writeInterfaceFile path InterfaceFile { + ifInstalledIfaces = map toInstalledIface ifaces + , ifLinkEnv = homeLinks + } -- Render the interfaces. liftIO $ renderStep dflags flags qual packages ifaces @@ -284,15 +287,6 @@ readInterfaceFiles name_cache_accessor pairs = do Right f -> return $ Just (paths, f) -dumpInterfaceFile :: FilePath -> [InstalledInterface] -> LinkEnv -> IO () -dumpInterfaceFile path ifaces homeLinks = writeInterfaceFile path ifaceFile - where - ifaceFile = InterfaceFile { - ifInstalledIfaces = ifaces, - ifLinkEnv = homeLinks - } - - ------------------------------------------------------------------------------- -- * Creating a GHC session ------------------------------------------------------------------------------- -- cgit v1.2.3 From e8c6e9beca2564016cacc4e85921f5ae99fa3dfd Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 16:03:12 +0200 Subject: Minor code simplification --- src/Haddock.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index c53b4543..f79f3470 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -272,8 +272,7 @@ readInterfaceFiles :: MonadIO m -> [(DocPaths, FilePath)] -> m [(DocPaths, InterfaceFile)] readInterfaceFiles name_cache_accessor pairs = do - mbPackages <- mapM tryReadIface pairs - return (catMaybes mbPackages) + catMaybes `liftM` mapM tryReadIface pairs where -- try to read an interface, warn if we can't tryReadIface (paths, file) = do -- cgit v1.2.3 From 2107860036788651c8286f9e1435472b3e799736 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 19:02:16 +0200 Subject: Handle HsExplicitListTy in renameer (fixes #213) --- src/Haddock/Interface/Rename.hs | 2 + tests/html-tests/tests/AdvanceTypes.hs | 9 +++ tests/html-tests/tests/AdvanceTypes.html.ref | 97 +++++++++++++++++++++++ tests/html-tests/tests/mini_AdvanceTypes.html.ref | 33 ++++++++ 4 files changed, 141 insertions(+) create mode 100644 tests/html-tests/tests/AdvanceTypes.hs create mode 100644 tests/html-tests/tests/AdvanceTypes.html.ref create mode 100644 tests/html-tests/tests/mini_AdvanceTypes.html.ref diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 55c9a5da..4bdbcb76 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -271,6 +271,8 @@ renameType t = case t of HsTyLit x -> return (HsTyLit x) + HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b + _ -> error "renameType" diff --git a/tests/html-tests/tests/AdvanceTypes.hs b/tests/html-tests/tests/AdvanceTypes.hs new file mode 100644 index 00000000..939fdf07 --- /dev/null +++ b/tests/html-tests/tests/AdvanceTypes.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE TypeOperators #-} +module AdvanceTypes where + +data Pattern :: [*] -> * where + Nil :: Pattern '[] + Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/tests/html-tests/tests/AdvanceTypes.html.ref b/tests/html-tests/tests/AdvanceTypes.html.ref new file mode 100644 index 00000000..bac545be --- /dev/null +++ b/tests/html-tests/tests/AdvanceTypes.html.ref @@ -0,0 +1,97 @@ + +AdvanceTypes
    Safe HaskellNone

    AdvanceTypes

    Documentation

    data Pattern where

    Constructors

    Nil :: Pattern `[]` 
    Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
    diff --git a/tests/html-tests/tests/mini_AdvanceTypes.html.ref b/tests/html-tests/tests/mini_AdvanceTypes.html.ref new file mode 100644 index 00000000..59d8dcb1 --- /dev/null +++ b/tests/html-tests/tests/mini_AdvanceTypes.html.ref @@ -0,0 +1,33 @@ + +AdvanceTypes

    AdvanceTypes

    data Pattern

    -- cgit v1.2.3 From 401dd8302ddc3c1716762278f2d23fd354e1d1d4 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 20:46:31 +0200 Subject: Better error messages --- src/Haddock/Interface/Rename.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 4bdbcb76..358fb964 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -273,8 +273,12 @@ renameType t = case t of HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b - _ -> error "renameType" - + HsQuasiQuoteTy _ -> error "renameType: HsQuasiQuoteTy" + HsSpliceTy _ _ _ -> error "renameType: HsSpliceTy" + HsRecTy _ -> error "renameType: HsRecTy" + HsCoreTy _ -> error "renameType: HsCoreTy" + HsExplicitTupleTy _ _ -> error "renameType: HsExplicitTupleTy" + HsWrapTy _ _ -> error "renameType: HsWrapTy" renameLTyVarBndrs :: LHsTyVarBndrs Name -> RnM (LHsTyVarBndrs DocName) renameLTyVarBndrs (HsQTvs { hsq_kvs = _, hsq_tvs = tvs }) -- cgit v1.2.3 From 80666e9b384277eb208fa99476634ee1559b3a7c Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 00:21:07 +0200 Subject: Simplify RnM type --- src/Haddock/Interface/Rename.hs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 358fb964..792e571a 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -82,33 +82,32 @@ renameInterface dflags renamingEnv warnings iface = -------------------------------------------------------------------------------- -newtype GenRnM n a = - RnM { unRn :: (n -> (Bool, DocName)) -- name lookup function - -> (a,[n]) +newtype RnM a = + RnM { unRn :: (Name -> (Bool, DocName)) -- name lookup function + -> (a,[Name]) } -type RnM a = GenRnM Name a - -instance Monad (GenRnM n) where +instance Monad RnM where (>>=) = thenRn return = returnRn -instance Functor (GenRnM n) where +instance Functor RnM where fmap f x = do a <- x; return (f a) -instance Applicative (GenRnM n) where +instance Applicative RnM where pure = return (<*>) = ap -returnRn :: a -> GenRnM n a +returnRn :: a -> RnM a returnRn a = RnM (const (a,[])) -thenRn :: GenRnM n a -> (a -> GenRnM n b) -> GenRnM n b +thenRn :: RnM a -> (a -> RnM b) -> RnM b m `thenRn` k = RnM (\lkp -> case unRn m lkp of (a,out1) -> case unRn (k a) lkp of (b,out2) -> (b,out1++out2)) getLookupRn :: RnM (Name -> (Bool, DocName)) getLookupRn = RnM (\lkp -> (lkp,[])) + outRn :: Name -> RnM () outRn name = RnM (const ((),[name])) -- cgit v1.2.3 From 3ba97f8470f401c968a2ea6f5fd1e7cae1c69028 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 00:23:35 +0200 Subject: Simplify lookupRn --- src/Haddock/Interface/Rename.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 792e571a..6e80da86 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -111,12 +111,12 @@ getLookupRn = RnM (\lkp -> (lkp,[])) outRn :: Name -> RnM () outRn name = RnM (const ((),[name])) -lookupRn :: (DocName -> a) -> Name -> RnM a -lookupRn and_then name = do +lookupRn :: Name -> RnM DocName +lookupRn name = do lkp <- getLookupRn case lkp name of - (False,maps_to) -> do outRn name; return (and_then maps_to) - (True, maps_to) -> return (and_then maps_to) + (False,maps_to) -> do outRn name; return maps_to + (True, maps_to) -> return maps_to runRnFM :: LinkEnv -> RnM a -> (a,[Name]) @@ -133,7 +133,7 @@ runRnFM env rn = unRn rn lkp rename :: Name -> RnM DocName -rename = lookupRn id +rename = lookupRn renameL :: Located Name -> RnM (Located DocName) @@ -476,8 +476,8 @@ renameExportItem item = case item of return (inst', idoc') return (ExportDecl decl' doc' subs' instances') ExportNoDecl x subs -> do - x' <- lookupRn id x - subs' <- mapM (lookupRn id) subs + x' <- lookupRn x + subs' <- mapM lookupRn subs return (ExportNoDecl x' subs') ExportDoc doc -> do doc' <- renameDoc doc -- cgit v1.2.3 From 6fafde62449fa8a5cb8405d6270caa5e1ddac613 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 01:51:32 +0200 Subject: Organize unite tests hierarchically --- haddock.cabal | 2 +- tests/unit-tests/Haddock/ParseSpec.hs | 79 +++++++++++++++++++++++++++++++++++ tests/unit-tests/Spec.hs | 9 ++++ tests/unit-tests/parsetests.hs | 79 ----------------------------------- 4 files changed, 89 insertions(+), 80 deletions(-) create mode 100644 tests/unit-tests/Haddock/ParseSpec.hs create mode 100644 tests/unit-tests/Spec.hs delete mode 100644 tests/unit-tests/parsetests.hs diff --git a/haddock.cabal b/haddock.cabal index c0d77a10..b77fc5ac 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -179,7 +179,7 @@ test-suite html-tests test-suite spec type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: parsetests.hs + main-is: Spec.hs hs-source-dirs: tests/unit-tests , tests/nanospec diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs new file mode 100644 index 00000000..0c959982 --- /dev/null +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -0,0 +1,79 @@ +{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +module Haddock.ParseSpec (main, spec) where + +import Test.Hspec +import RdrName (RdrName) +import DynFlags (DynFlags, defaultDynFlags) +import Haddock.Lex (tokenise) +import Haddock.Parse (parseParas) +import Haddock.Types +import Outputable +import Data.Monoid + +dynFlags :: DynFlags +dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") + +instance Outputable a => Show a where + show = showSDoc dynFlags . ppr + +deriving instance Show a => Show (Doc a) +deriving instance Eq a =>Eq (Doc a) + +parse :: String -> Maybe (Doc RdrName) +parse s = parseParas $ tokenise dynFlags s (0,0) + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parseParas" $ do + + it "parses a paragraph" $ do + parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" + + context "when parsing an example" $ do + + it "requires an example to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n>>> fib 10\n55" `shouldBe` + (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) + + -- parse error + parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing + + it "parses a result line that only contains as an emptly line" $ do + parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` + (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) + + context "when parsing a code block" $ do + it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n> some code" `shouldBe` + Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) + + -- parse error + parse "foobar\n> some code" `shouldBe` Nothing + + + context "when parsing a URL" $ do + it "parses a URL" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") + + it "accepts an optional label" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + + it "can parse a multiple subsequent properties" $ do + let input = unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") + where + hyperlink :: String -> Maybe String -> Doc RdrName + hyperlink url = DocHyperlink . Hyperlink url diff --git a/tests/unit-tests/Spec.hs b/tests/unit-tests/Spec.hs new file mode 100644 index 00000000..68521c03 --- /dev/null +++ b/tests/unit-tests/Spec.hs @@ -0,0 +1,9 @@ +module Main where + +import Test.Hspec + +import qualified Haddock.ParseSpec + +main :: IO () +main = hspec $ do + describe "Haddock.Parse" Haddock.ParseSpec.spec diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs deleted file mode 100644 index 1f923aa0..00000000 --- a/tests/unit-tests/parsetests.hs +++ /dev/null @@ -1,79 +0,0 @@ -{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -module Main (main, spec) where - -import Test.Hspec -import RdrName (RdrName) -import DynFlags (DynFlags, defaultDynFlags) -import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) -import Haddock.Types -import Outputable -import Data.Monoid - -dynFlags :: DynFlags -dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") - -instance Outputable a => Show a where - show = showSDoc dynFlags . ppr - -deriving instance Show a => Show (Doc a) -deriving instance Eq a =>Eq (Doc a) - -parse :: String -> Maybe (Doc RdrName) -parse s = parseParas $ tokenise dynFlags s (0,0) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "parseParas" $ do - - it "parses a paragraph" $ do - parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" - - context "when parsing an example" $ do - - it "requires an example to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n>>> fib 10\n55" `shouldBe` - (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) - - -- parse error - parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing - - it "parses a result line that only contains as an emptly line" $ do - parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` - (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) - - context "when parsing a code block" $ do - it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n> some code" `shouldBe` - Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) - - -- parse error - parse "foobar\n> some code" `shouldBe` Nothing - - - context "when parsing a URL" $ do - it "parses a URL" $ do - parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") - - it "accepts an optional label" $ do - parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") - - context "when parsing properties" $ do - it "can parse a single property" $ do - parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") - - it "can parse a multiple subsequent properties" $ do - let input = unlines [ - "prop> 23 == 23" - , "prop> 42 == 42" - ] - parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") - where - hyperlink :: String -> Maybe String -> Doc RdrName - hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3 From 91335e5044b6c09bbe8d28e2e9443378e5ddbd90 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 10:34:58 +0200 Subject: Handle more cases in renameType --- src/Haddock/Interface/Rename.hs | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 6e80da86..9f3a4155 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -270,14 +270,16 @@ renameType t = case t of HsTyLit x -> return (HsTyLit x) - HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b - - HsQuasiQuoteTy _ -> error "renameType: HsQuasiQuoteTy" + HsWrapTy a b -> HsWrapTy a <$> renameType b + HsRecTy a -> HsRecTy <$> mapM renameConDeclFieldField a + HsCoreTy a -> pure (HsCoreTy a) + HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b + HsExplicitTupleTy a b -> HsExplicitTupleTy a <$> mapM renameLType b + HsQuasiQuoteTy a -> HsQuasiQuoteTy <$> renameHsQuasiQuote a HsSpliceTy _ _ _ -> error "renameType: HsSpliceTy" - HsRecTy _ -> error "renameType: HsRecTy" - HsCoreTy _ -> error "renameType: HsCoreTy" - HsExplicitTupleTy _ _ -> error "renameType: HsExplicitTupleTy" - HsWrapTy _ _ -> error "renameType: HsWrapTy" + +renameHsQuasiQuote :: HsQuasiQuote Name -> RnM (HsQuasiQuote DocName) +renameHsQuasiQuote (HsQuasiQuote a b c) = HsQuasiQuote <$> rename a <*> pure b <*> pure c renameLTyVarBndrs :: LHsTyVarBndrs Name -> RnM (LHsTyVarBndrs DocName) renameLTyVarBndrs (HsQTvs { hsq_kvs = _, hsq_tvs = tvs }) @@ -403,22 +405,25 @@ renameCon decl@(ConDecl { con_name = lname, con_qvars = ltyvars return (decl { con_name = lname', con_qvars = ltyvars', con_cxt = lcontext' , con_details = details', con_res = restype', con_doc = mbldoc' }) where - renameDetails (RecCon fields) = return . RecCon =<< mapM renameField fields + renameDetails (RecCon fields) = return . RecCon =<< mapM renameConDeclFieldField fields renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps renameDetails (InfixCon a b) = do a' <- renameLType a b' <- renameLType b return (InfixCon a' b') - renameField (ConDeclField name t doc) = do - name' <- renameL name - t' <- renameLType t - doc' <- mapM renameLDocHsSyn doc - return (ConDeclField name' t' doc') - renameResType (ResTyH98) = return ResTyH98 renameResType (ResTyGADT t) = return . ResTyGADT =<< renameLType t + +renameConDeclFieldField :: ConDeclField Name -> RnM (ConDeclField DocName) +renameConDeclFieldField (ConDeclField name t doc) = do + name' <- renameL name + t' <- renameLType t + doc' <- mapM renameLDocHsSyn doc + return (ConDeclField name' t' doc') + + renameSig :: Sig Name -> RnM (Sig DocName) renameSig sig = case sig of TypeSig lnames ltype -> do -- cgit v1.2.3 From 58c89fae6eabd7e190cbf64488b03b82a899029b Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 11:47:59 +0200 Subject: Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref --- .../html-tests/tests/mini_HiddenInstances.html.ref | 41 ++++++++++++++++++++++ .../tests/mini_HiddenInstancesB.html.ref | 41 ++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 tests/html-tests/tests/mini_HiddenInstances.html.ref create mode 100644 tests/html-tests/tests/mini_HiddenInstancesB.html.ref diff --git a/tests/html-tests/tests/mini_HiddenInstances.html.ref b/tests/html-tests/tests/mini_HiddenInstances.html.ref new file mode 100644 index 00000000..0f1a2e04 --- /dev/null +++ b/tests/html-tests/tests/mini_HiddenInstances.html.ref @@ -0,0 +1,41 @@ + +HiddenInstances

    HiddenInstances

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

    HiddenInstancesB

    class Foo a

    data Bar

    -- cgit v1.2.3 From 6c4bdbc92048cb4369c43de0d1b35b2105595958 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 11:49:28 +0200 Subject: Add /tests/html-tests/output/ to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7fcbdc38..4e8faa60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /dist/ +/tests/html-tests/output/ /doc/haddock -- cgit v1.2.3 From dfc2cb4e31d6756b2d6ca7f87e80d8913751a4b7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 11:58:13 +0200 Subject: Allow haddock markup in deprecation messages --- haddock.cabal | 1 + src/Haddock/Interface/Create.hs | 49 +++++++++++++--------- src/Haddock/Parse.y | 2 +- src/Haddock/Types.hs | 39 ++++++++++++++++- tests/html-tests/tests/BugDeprecated.html.ref | 18 +++++--- tests/html-tests/tests/BugExportHeadings.html.ref | 9 ++-- tests/html-tests/tests/DeprecatedClass.html.ref | 12 ++++-- tests/html-tests/tests/DeprecatedData.html.ref | 18 +++++--- tests/html-tests/tests/DeprecatedFunction.hs | 8 +++- tests/html-tests/tests/DeprecatedFunction.html.ref | 28 ++++++++++++- .../html-tests/tests/DeprecatedFunction2.html.ref | 3 +- .../html-tests/tests/DeprecatedFunction3.html.ref | 3 +- tests/html-tests/tests/DeprecatedModule.hs | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 5 ++- tests/html-tests/tests/DeprecatedModule2.html.ref | 3 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 12 ++++-- tests/html-tests/tests/DeprecatedRecord.html.ref | 3 +- .../html-tests/tests/DeprecatedTypeFamily.html.ref | 6 ++- .../tests/DeprecatedTypeSynonym.html.ref | 6 ++- tests/html-tests/tests/ModuleWithWarning.hs | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 5 ++- .../tests/mini_DeprecatedFunction.html.ref | 6 +++ 22 files changed, 179 insertions(+), 61 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index b77fc5ac..88c18cd3 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -189,6 +189,7 @@ test-suite spec base , ghc , containers + , deepseq , array -- NOTE: As of this writing, Cabal does not properly handle alex/happy for diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 32f287f5..fca1a00e 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -41,7 +41,7 @@ import Name import Bag import RdrName import TcRnTypes -import FastString (unpackFS) +import FastString (concatFS) -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -90,7 +90,8 @@ createInterface tm flags modMap instIfaceMap = do liftErrMsg $ warnAboutFilteredDecls dflags mdl decls - let warningMap = mkWarningMap warnings gre exportedNames + warningMap <- liftErrMsg $ mkWarningMap dflags warnings gre exportedNames + exportItems <- mkExportItems modMap mdl warningMap gre exportedNames decls maps exports instances instIfaceMap dflags @@ -112,11 +113,13 @@ createInterface tm flags modMap instIfaceMap = do let !aliases = mkAliasMap dflags $ tm_renamed_source tm + modWarn <- liftErrMsg $ moduleWarning dflags gre warnings + return $! Interface { ifaceMod = mdl, ifaceOrigFilename = msHsFilePath ms, ifaceInfo = info, - ifaceDoc = Documentation mbDoc (moduleWarning warnings), + ifaceDoc = Documentation mbDoc modWarn, ifaceRnDoc = Documentation Nothing Nothing, ifaceOptions = opts, ifaceDocMap = docMap, @@ -169,29 +172,35 @@ lookupModuleDyn dflags Nothing mdlName = type WarningMap = DocMap Name -mkWarningMap :: Warnings -> GlobalRdrEnv -> [Name] -> WarningMap -mkWarningMap NoWarnings _ _ = M.empty -mkWarningMap (WarnAll _) _ _ = M.empty -mkWarningMap (WarnSome ws) gre exps = M.fromList - [ (n, warnToDoc w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ - , let n = gre_name elt, n `elem` exps ] +mkWarningMap :: DynFlags -> Warnings -> GlobalRdrEnv -> [Name] -> ErrMsgM WarningMap +mkWarningMap dflags warnings gre exps = case warnings of + NoWarnings -> return M.empty + WarnAll _ -> return M.empty + WarnSome ws -> do + let ws' = [ (n, w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ + , let n = gre_name elt, n `elem` exps ] + M.fromList . catMaybes <$> mapM parse ws' + where + parse (n, w) = (fmap $ (,) n) <$> parseWarning dflags gre w -moduleWarning :: Warnings -> Maybe (Doc id) -moduleWarning ws = +moduleWarning :: DynFlags -> GlobalRdrEnv -> Warnings -> ErrMsgM (Maybe (Doc Name)) +moduleWarning dflags gre ws = case ws of - NoWarnings -> Nothing - WarnSome _ -> Nothing - WarnAll w -> Just $! warnToDoc w + NoWarnings -> return Nothing + WarnSome _ -> return Nothing + WarnAll w -> parseWarning dflags gre w -warnToDoc :: WarningTxt -> Doc id -warnToDoc w = case w of - (DeprecatedTxt msg) -> format "Deprecated: " msg - (WarningTxt msg) -> format "Warning: " msg +parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Maybe (Doc Name)) +parseWarning dflags gre w = do + r <- case w of + (DeprecatedTxt msg) -> format "Deprecated: " msg + (WarningTxt msg) -> format "Warning: " msg + r `deepseq` return r where - format x xs = let !str = force $ concat (x : map unpackFS xs) - in DocWarning $ DocParagraph $ DocString str + format x xs = fmap (DocWarning . DocParagraph . DocAppend (DocString x)) + <$> processDocString dflags gre (HsDocString $ concatFS xs) ------------------------------------------------------------------------------- diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y index 0befe395..f40ff521 100644 --- a/src/Haddock/Parse.y +++ b/src/Haddock/Parse.y @@ -7,7 +7,7 @@ -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details -module Haddock.Parse where +module Haddock.Parse (parseString, parseParas) where import Haddock.Lex import Haddock.Types (Doc(..), Example(Example), Hyperlink(..)) diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 05fc9747..9be46748 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -1,5 +1,5 @@ -{-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE DeriveDataTypeable, DeriveFunctor #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Types @@ -22,6 +22,7 @@ module Haddock.Types ( import Control.Exception import Control.Arrow +import Control.DeepSeq import Data.Typeable import Data.Map (Map) import Data.Maybe @@ -316,18 +317,54 @@ instance Monoid (Doc id) where mappend = DocAppend +instance NFData a => NFData (Doc a) where + rnf doc = case doc of + DocEmpty -> () + DocAppend a b -> a `deepseq` b `deepseq` () + DocString a -> a `deepseq` () + DocParagraph a -> a `deepseq` () + DocIdentifier a -> a `deepseq` () + DocIdentifierUnchecked a -> a `deepseq` () + DocModule a -> a `deepseq` () + DocWarning a -> a `deepseq` () + DocEmphasis a -> a `deepseq` () + DocMonospaced a -> a `deepseq` () + DocUnorderedList a -> a `deepseq` () + DocOrderedList a -> a `deepseq` () + DocDefList a -> a `deepseq` () + DocCodeBlock a -> a `deepseq` () + DocHyperlink a -> a `deepseq` () + DocPic a -> a `deepseq` () + DocAName a -> a `deepseq` () + DocProperty a -> a `deepseq` () + DocExamples a -> a `deepseq` () + + +instance NFData Name +instance NFData OccName +instance NFData ModuleName + + data Hyperlink = Hyperlink { hyperlinkUrl :: String , hyperlinkLabel :: Maybe String } deriving (Eq, Show) +instance NFData Hyperlink where + rnf (Hyperlink a b) = a `deepseq` b `deepseq` () + + data Example = Example { exampleExpression :: String , exampleResult :: [String] } deriving (Eq, Show) +instance NFData Example where + rnf (Example a b) = a `deepseq` b `deepseq` () + + exampleToString :: Example -> String exampleToString (Example expression result) = ">>> " ++ expression ++ "\n" ++ unlines result diff --git a/tests/html-tests/tests/BugDeprecated.html.ref b/tests/html-tests/tests/BugDeprecated.html.ref index f632d670..913b189d 100644 --- a/tests/html-tests/tests/BugDeprecated.html.ref +++ b/tests/html-tests/tests/BugDeprecated.html.ref @@ -96,7 +96,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");} >

    Deprecated: for foo

    Deprecated: for foo +

    Deprecated: for baz

    Deprecated: for baz +

    Deprecated: for bar

    Deprecated: for bar +

    Deprecated: for one

    Deprecated: for one +

    some documentation for one, two and three @@ -155,7 +159,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");} >

    Deprecated: for three

    Deprecated: for three +

    some documentation for one, two and three @@ -172,7 +177,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");} >

    Deprecated: for two

    Deprecated: for two +

    some documentation for one, two and three diff --git a/tests/html-tests/tests/BugExportHeadings.html.ref b/tests/html-tests/tests/BugExportHeadings.html.ref index d3298b2e..457e2c50 100644 --- a/tests/html-tests/tests/BugExportHeadings.html.ref +++ b/tests/html-tests/tests/BugExportHeadings.html.ref @@ -166,7 +166,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugExportHeadings.html >

    Deprecated: for one

    Deprecated: for one +

    Deprecated: for two

    Deprecated: for two +

    Deprecated: for three

    Deprecated: for three +

    Deprecated: SomeClass

    Deprecated: SomeClass +

    some class @@ -106,7 +107,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html") >

    Deprecated: foo

    Deprecated: foo +

    documentation for foo @@ -126,7 +128,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html") >

    Deprecated: SomeOtherClass

    Deprecated: SomeOtherClass +

    Deprecated: bar

    Deprecated: bar +

    Deprecated: Foo

    Deprecated: Foo +

    type Foo @@ -110,7 +111,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html"); >

    Deprecated: Foo

    Deprecated: Foo +

    constructor Foo @@ -125,7 +127,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html"); >

    Deprecated: Bar

    Deprecated: Bar +

    constructor Bar @@ -145,7 +148,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html"); >

    Deprecated: One

    Deprecated: One +

    Deprecated: One

    Deprecated: One +

    Deprecated: Two

    Deprecated: Two +

    :: Int
  • bar :: Int
  • Deprecated: use bar instead

    Deprecated: use bar instead +

    some documentation foo + >some documentation for foo +

    bar :: Int

    some documentation for bar

    Deprecated: use bar instead

    Deprecated: use bar instead +

    Deprecated: use bar instead

    Deprecated: use bar instead +

    Deprecated: Use Foo instead

    Deprecated: Use Foo instead +

    Documentation for

    some documentation @@ -100,7 +101,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html >

    constructor docu @@ -120,7 +122,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html >

    Date: Sun, 14 Oct 2012 13:55:09 +0200 Subject: If parsing of deprecation message fails, include it verbatim --- src/Haddock/Interface/Create.hs | 19 ++-- .../tests/DeprecationMessageParseError.hs | 12 +++ .../tests/DeprecationMessageParseError.html.ref | 101 +++++++++++++++++++++ .../mini_DeprecationMessageParseError.html.ref | 31 +++++++ 4 files changed, 154 insertions(+), 9 deletions(-) create mode 100644 tests/html-tests/tests/DeprecationMessageParseError.hs create mode 100644 tests/html-tests/tests/DeprecationMessageParseError.html.ref create mode 100644 tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index fca1a00e..3eb5205c 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -41,7 +41,7 @@ import Name import Bag import RdrName import TcRnTypes -import FastString (concatFS) +import FastString (unpackFS, concatFS) -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -179,9 +179,9 @@ mkWarningMap dflags warnings gre exps = case warnings of WarnSome ws -> do let ws' = [ (n, w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ , let n = gre_name elt, n `elem` exps ] - M.fromList . catMaybes <$> mapM parse ws' + M.fromList <$> mapM parse ws' where - parse (n, w) = (fmap $ (,) n) <$> parseWarning dflags gre w + parse (n, w) = (,) n <$> parseWarning dflags gre w moduleWarning :: DynFlags -> GlobalRdrEnv -> Warnings -> ErrMsgM (Maybe (Doc Name)) @@ -189,18 +189,19 @@ moduleWarning dflags gre ws = case ws of NoWarnings -> return Nothing WarnSome _ -> return Nothing - WarnAll w -> parseWarning dflags gre w + WarnAll w -> Just <$> parseWarning dflags gre w -parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Maybe (Doc Name)) +parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Doc Name) parseWarning dflags gre w = do r <- case w of - (DeprecatedTxt msg) -> format "Deprecated: " msg - (WarningTxt msg) -> format "Warning: " msg + (DeprecatedTxt msg) -> format "Deprecated: " (concatFS msg) + (WarningTxt msg) -> format "Warning: " (concatFS msg) r `deepseq` return r where - format x xs = fmap (DocWarning . DocParagraph . DocAppend (DocString x)) - <$> processDocString dflags gre (HsDocString $ concatFS xs) + format x xs = DocWarning . DocParagraph . DocAppend (DocString x) + . fromMaybe (DocString . unpackFS $ xs) + <$> processDocString dflags gre (HsDocString xs) ------------------------------------------------------------------------------- diff --git a/tests/html-tests/tests/DeprecationMessageParseError.hs b/tests/html-tests/tests/DeprecationMessageParseError.hs new file mode 100644 index 00000000..5f0b8713 --- /dev/null +++ b/tests/html-tests/tests/DeprecationMessageParseError.hs @@ -0,0 +1,12 @@ +-- | +-- What is tested here: +-- +-- * if parsing of a deprecation message fails, the message is included +-- verbatim +-- +module DeprecationMessageParseError where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use @bar instead" #-} diff --git a/tests/html-tests/tests/DeprecationMessageParseError.html.ref b/tests/html-tests/tests/DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..b4ea426e --- /dev/null +++ b/tests/html-tests/tests/DeprecationMessageParseError.html.ref @@ -0,0 +1,101 @@ + +DeprecationMessageParseError
    Safe HaskellNone

    DeprecationMessageParseError

    Description

    What is tested here: +

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

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use @bar instead

    some documentation for foo +

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

    DeprecationMessageParseError

    -- cgit v1.2.3 From ab6e43c21e9eb22a4538303c1728c4e8d2f35f24 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 14:13:24 +0200 Subject: Add description for PruneWithWarning test --- tests/html-tests/tests/DeprecationMessageParseError.hs | 4 ++-- .../tests/DeprecationMessageParseError.html.ref | 4 ++-- tests/html-tests/tests/PruneWithWarning.hs | 6 ++++++ tests/html-tests/tests/PruneWithWarning.html.ref | 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/tests/html-tests/tests/DeprecationMessageParseError.hs b/tests/html-tests/tests/DeprecationMessageParseError.hs index 5f0b8713..2f8fb492 100644 --- a/tests/html-tests/tests/DeprecationMessageParseError.hs +++ b/tests/html-tests/tests/DeprecationMessageParseError.hs @@ -1,8 +1,8 @@ -- | -- What is tested here: -- --- * if parsing of a deprecation message fails, the message is included --- verbatim +-- * If parsing of a deprecation message fails, the message is included +-- verbatim. -- module DeprecationMessageParseError where diff --git a/tests/html-tests/tests/DeprecationMessageParseError.html.ref b/tests/html-tests/tests/DeprecationMessageParseError.html.ref index b4ea426e..75f9bf54 100644 --- a/tests/html-tests/tests/DeprecationMessageParseError.html.ref +++ b/tests/html-tests/tests/DeprecationMessageParseError.html.ref @@ -50,8 +50,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecationMessagePars

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

    PruneWithWarning

    Description

    What is tested here: +

    • If a binding has a deprecation message but no documentation, it is pruned + when OPTIONS_HADDOCK prune is used. +
    Date: Sun, 14 Oct 2012 15:40:53 +0200 Subject: Minor formatting change --- src/Haddock/Interface/Create.hs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 3eb5205c..2ffe8de8 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -116,25 +116,25 @@ createInterface tm flags modMap instIfaceMap = do modWarn <- liftErrMsg $ moduleWarning dflags gre warnings return $! Interface { - ifaceMod = mdl, - ifaceOrigFilename = msHsFilePath ms, - ifaceInfo = info, - ifaceDoc = Documentation mbDoc modWarn, - ifaceRnDoc = Documentation Nothing Nothing, - ifaceOptions = opts, - ifaceDocMap = docMap, - ifaceArgMap = argMap, - ifaceRnDocMap = M.empty, - ifaceRnArgMap = M.empty, - ifaceExportItems = prunedExportItems, - ifaceRnExportItems = [], - ifaceExports = exportedNames, - ifaceVisibleExports = visibleNames, - ifaceDeclMap = declMap, - ifaceSubMap = subMap, - ifaceModuleAliases = aliases, - ifaceInstances = instances, - ifaceHaddockCoverage = coverage + ifaceMod = mdl + , ifaceOrigFilename = msHsFilePath ms + , ifaceInfo = info + , ifaceDoc = Documentation mbDoc modWarn + , ifaceRnDoc = Documentation Nothing Nothing + , ifaceOptions = opts + , ifaceDocMap = docMap + , ifaceArgMap = argMap + , ifaceRnDocMap = M.empty + , ifaceRnArgMap = M.empty + , ifaceExportItems = prunedExportItems + , ifaceRnExportItems = [] + , ifaceExports = exportedNames + , ifaceVisibleExports = visibleNames + , ifaceDeclMap = declMap + , ifaceSubMap = subMap + , ifaceModuleAliases = aliases + , ifaceInstances = instances + , ifaceHaddockCoverage = coverage } mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName -- cgit v1.2.3 From 37a4e2c3b71280fdee7b217dd9ddff090ed34873 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 16:03:43 +0200 Subject: Properly handle deprecation messages for re-exported things (fixes #220) --- src/Haddock/Interface/Create.hs | 7 +- src/Haddock/Types.hs | 5 ++ tests/html-tests/tests/DeprecatedReExport.hs | 3 + tests/html-tests/tests/DeprecatedReExport.html.ref | 91 ++++++++++++++++++++++ .../tests/mini_DeprecatedReExport.html.ref | 31 ++++++++ 5 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 tests/html-tests/tests/DeprecatedReExport.hs create mode 100644 tests/html-tests/tests/DeprecatedReExport.html.ref create mode 100644 tests/html-tests/tests/mini_DeprecatedReExport.html.ref diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 2ffe8de8..6c121ad4 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -92,7 +92,9 @@ createInterface tm flags modMap instIfaceMap = do warningMap <- liftErrMsg $ mkWarningMap dflags warnings gre exportedNames - exportItems <- mkExportItems modMap mdl warningMap gre exportedNames decls maps exports + let allWarnings = M.unions (warningMap : map ifaceWarningMap (M.elems modMap)) + + exportItems <- mkExportItems modMap mdl allWarnings gre exportedNames decls maps exports instances instIfaceMap dflags let !visibleNames = mkVisibleNames exportItems opts @@ -135,6 +137,7 @@ createInterface tm flags modMap instIfaceMap = do , ifaceModuleAliases = aliases , ifaceInstances = instances , ifaceHaddockCoverage = coverage + , ifaceWarningMap = warningMap } mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName @@ -170,8 +173,6 @@ lookupModuleDyn dflags Nothing mdlName = -- Warnings ------------------------------------------------------------------------------- -type WarningMap = DocMap Name - mkWarningMap :: DynFlags -> Warnings -> GlobalRdrEnv -> [Name] -> ErrMsgM WarningMap mkWarningMap dflags warnings gre exps = case warnings of NoWarnings -> return M.empty diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 9be46748..181ea026 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -114,8 +114,13 @@ data Interface = Interface -- | The number of haddockable and haddocked items in the module, as a -- tuple. Haddockable items are the exports and the module itself. , ifaceHaddockCoverage :: !(Int, Int) + + -- | Warnings for things defined in this module. + , ifaceWarningMap :: !WarningMap } +type WarningMap = DocMap Name + -- | A subset of the fields of 'Interface' that we store in the interface -- files. diff --git a/tests/html-tests/tests/DeprecatedReExport.hs b/tests/html-tests/tests/DeprecatedReExport.hs new file mode 100644 index 00000000..10a8c6a2 --- /dev/null +++ b/tests/html-tests/tests/DeprecatedReExport.hs @@ -0,0 +1,3 @@ +module DeprecatedReExport (foo) where + +import DeprecatedFunction diff --git a/tests/html-tests/tests/DeprecatedReExport.html.ref b/tests/html-tests/tests/DeprecatedReExport.html.ref new file mode 100644 index 00000000..17988951 --- /dev/null +++ b/tests/html-tests/tests/DeprecatedReExport.html.ref @@ -0,0 +1,91 @@ + +DeprecatedReExport
    Safe HaskellNone

    DeprecatedReExport

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

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

    DeprecatedReExport

    -- cgit v1.2.3 From 55ebcbbbbdc7b527a1a033958fa4e34d667f19f0 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 17:30:28 +0200 Subject: Add build artifacts for documentation to .gitignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 4e8faa60..ba90347e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ /dist/ /tests/html-tests/output/ + /doc/haddock +/doc/autom4te.cache/ +/doc/config.log +/doc/config.mk +/doc/config.status +/doc/configure -- cgit v1.2.3 From b892eed5336993c3196fb411f6e91dbe90e152c7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 23:20:26 +0200 Subject: unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. --- tests/unit-tests/Haddock/ParseSpec.hs | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs index 0c959982..f7b32fb8 100644 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} +{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Haddock.ParseSpec (main, spec) where @@ -8,8 +8,9 @@ import DynFlags (DynFlags, defaultDynFlags) import Haddock.Lex (tokenise) import Haddock.Parse (parseParas) import Haddock.Types -import Outputable +import Outputable (Outputable, showSDoc, ppr) import Data.Monoid +import Data.String dynFlags :: DynFlags dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") @@ -20,6 +21,9 @@ instance Outputable a => Show a where deriving instance Show a => Show (Doc a) deriving instance Eq a =>Eq (Doc a) +instance IsString (Doc RdrName) where + fromString = DocString + parse :: String -> Maybe (Doc RdrName) parse s = parseParas $ tokenise dynFlags s (0,0) @@ -29,27 +33,25 @@ main = hspec spec spec :: Spec spec = do describe "parseParas" $ do - it "parses a paragraph" $ do - parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" + parse "foobar" `shouldBe` Just (DocParagraph "foobar\n") context "when parsing an example" $ do - it "requires an example to be separated from a previous paragrap by an empty line" $ do parse "foobar\n\n>>> fib 10\n55" `shouldBe` - (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) + Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) -- parse error parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing it "parses a result line that only contains as an emptly line" $ do parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` - (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) + Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) context "when parsing a code block" $ do it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do parse "foobar\n\n> some code" `shouldBe` - Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) + Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") -- parse error parse "foobar\n> some code" `shouldBe` Nothing @@ -58,22 +60,22 @@ spec = do context "when parsing a URL" $ do it "parses a URL" $ do parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") + Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") it "accepts an optional label" $ do parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") context "when parsing properties" $ do it "can parse a single property" $ do - parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + parse "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") it "can parse a multiple subsequent properties" $ do - let input = unlines [ - "prop> 23 == 23" - , "prop> 42 == 42" - ] - parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") + parse $ unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42") where hyperlink :: String -> Maybe String -> Doc RdrName hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3 From a9de80ea72421837848cbdca01745e2a5b9920a7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 23:37:21 +0200 Subject: unit-tests: Minor refactoring Rename parse to parseParas. --- tests/unit-tests/Haddock/ParseSpec.hs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs index f7b32fb8..adaca3f7 100644 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -6,7 +6,7 @@ import Test.Hspec import RdrName (RdrName) import DynFlags (DynFlags, defaultDynFlags) import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) +import qualified Haddock.Parse as Parse import Haddock.Types import Outputable (Outputable, showSDoc, ppr) import Data.Monoid @@ -24,8 +24,8 @@ deriving instance Eq a =>Eq (Doc a) instance IsString (Doc RdrName) where fromString = DocString -parse :: String -> Maybe (Doc RdrName) -parse s = parseParas $ tokenise dynFlags s (0,0) +parseParas :: String -> Maybe (Doc RdrName) +parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0) main :: IO () main = hspec spec @@ -34,44 +34,44 @@ spec :: Spec spec = do describe "parseParas" $ do it "parses a paragraph" $ do - parse "foobar" `shouldBe` Just (DocParagraph "foobar\n") + parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n") context "when parsing an example" $ do it "requires an example to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n>>> fib 10\n55" `shouldBe` + parseParas "foobar\n\n>>> fib 10\n55" `shouldBe` Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) -- parse error - parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing + parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing it "parses a result line that only contains as an emptly line" $ do - parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` + parseParas ">>> putFooBar\nfoo\n\nbar" `shouldBe` Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) context "when parsing a code block" $ do it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n> some code" `shouldBe` + parseParas "foobar\n\n> some code" `shouldBe` Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") -- parse error - parse "foobar\n> some code" `shouldBe` Nothing + parseParas "foobar\n> some code" `shouldBe` Nothing context "when parsing a URL" $ do it "parses a URL" $ do - parse "" `shouldBe` + parseParas "" `shouldBe` Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") it "accepts an optional label" $ do - parse "" `shouldBe` + parseParas "" `shouldBe` Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") context "when parsing properties" $ do it "can parse a single property" $ do - parse "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") + parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") it "can parse a multiple subsequent properties" $ do - parse $ unlines [ + parseParas $ unlines [ "prop> 23 == 23" , "prop> 42 == 42" ] -- cgit v1.2.3 From 6b294a1b19bbda6124b0dc7e7929c58225c35733 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 00:36:42 +0200 Subject: Fix typo --- tests/unit-tests/Haddock/ParseSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs index adaca3f7..d692cb0c 100644 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -70,7 +70,7 @@ spec = do it "can parse a single property" $ do parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") - it "can parse a multiple subsequent properties" $ do + it "can parse multiple subsequent properties" $ do parseParas $ unlines [ "prop> 23 == 23" , "prop> 42 == 42" -- cgit v1.2.3 From 89b52831f24e6ad94b2d763e704119829e1ddc6c Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 10:30:07 +0200 Subject: Add description for DeprecatedReExport test --- tests/html-tests/tests/DeprecatedReExport.hs | 15 ++++++- tests/html-tests/tests/DeprecatedReExport.html.ref | 46 +++++++++++++++++++++- .../tests/mini_DeprecatedReExport.html.ref | 8 +++- 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/tests/html-tests/tests/DeprecatedReExport.hs b/tests/html-tests/tests/DeprecatedReExport.hs index 10a8c6a2..f851e2ff 100644 --- a/tests/html-tests/tests/DeprecatedReExport.hs +++ b/tests/html-tests/tests/DeprecatedReExport.hs @@ -1,3 +1,16 @@ -module DeprecatedReExport (foo) where +-- | +-- What is tested here: +-- +-- * Deprecation messages are shown for re-exported items. +-- +module DeprecatedReExport ( +-- * Re-exported from an other module + foo +-- * Re-exported from an other package +-- | Not yet working, see +-- , isEmptyChan +, +) where import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/tests/html-tests/tests/DeprecatedReExport.html.ref b/tests/html-tests/tests/DeprecatedReExport.html.ref index 17988951..611c181d 100644 --- a/tests/html-tests/tests/DeprecatedReExport.html.ref +++ b/tests/html-tests/tests/DeprecatedReExport.html.ref @@ -41,6 +41,36 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedReExport.htm >

    DeprecatedReExport

    Description

    What is tested here: +

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

    Synopsis

    Documentation

    Re-exported from an other module +

    Re-exported from an other package +

    Re-exported from an other module +

    Re-exported from an other package +

    Date: Mon, 15 Oct 2012 11:38:42 +0200 Subject: Move resources to /resources directory --- ghc.mk | 8 +- haddock.cabal | 26 +- html/Classic.theme/haskell_icon.gif | Bin 911 -> 0 bytes html/Classic.theme/minus.gif | Bin 56 -> 0 bytes html/Classic.theme/plus.gif | Bin 59 -> 0 bytes html/Classic.theme/xhaddock.css | 493 ----------------------- html/Ocean.std-theme/hslogo-16.png | Bin 1684 -> 0 bytes html/Ocean.std-theme/minus.gif | Bin 56 -> 0 bytes html/Ocean.std-theme/ocean.css | 546 -------------------------- html/Ocean.std-theme/plus.gif | Bin 59 -> 0 bytes html/Ocean.std-theme/synopsis.png | Bin 11327 -> 0 bytes html/frames.html | 30 -- html/haddock-util.js | 344 ---------------- latex/haddock.sty | 57 --- resources/html/Classic.theme/haskell_icon.gif | Bin 0 -> 911 bytes resources/html/Classic.theme/minus.gif | Bin 0 -> 56 bytes resources/html/Classic.theme/plus.gif | Bin 0 -> 59 bytes resources/html/Classic.theme/xhaddock.css | 493 +++++++++++++++++++++++ resources/html/Ocean.std-theme/hslogo-16.png | Bin 0 -> 1684 bytes resources/html/Ocean.std-theme/minus.gif | Bin 0 -> 56 bytes resources/html/Ocean.std-theme/ocean.css | 546 ++++++++++++++++++++++++++ resources/html/Ocean.std-theme/plus.gif | Bin 0 -> 59 bytes resources/html/Ocean.std-theme/synopsis.png | Bin 0 -> 11327 bytes resources/html/frames.html | 30 ++ resources/html/haddock-util.js | 344 ++++++++++++++++ resources/latex/haddock.sty | 57 +++ tests/html-tests/runtests.hs | 8 +- 27 files changed, 1492 insertions(+), 1490 deletions(-) delete mode 100644 html/Classic.theme/haskell_icon.gif delete mode 100644 html/Classic.theme/minus.gif delete mode 100644 html/Classic.theme/plus.gif delete mode 100644 html/Classic.theme/xhaddock.css delete mode 100644 html/Ocean.std-theme/hslogo-16.png delete mode 100644 html/Ocean.std-theme/minus.gif delete mode 100644 html/Ocean.std-theme/ocean.css delete mode 100644 html/Ocean.std-theme/plus.gif delete mode 100644 html/Ocean.std-theme/synopsis.png delete mode 100644 html/frames.html delete mode 100644 html/haddock-util.js delete mode 100644 latex/haddock.sty create mode 100644 resources/html/Classic.theme/haskell_icon.gif create mode 100644 resources/html/Classic.theme/minus.gif create mode 100644 resources/html/Classic.theme/plus.gif create mode 100644 resources/html/Classic.theme/xhaddock.css create mode 100644 resources/html/Ocean.std-theme/hslogo-16.png create mode 100644 resources/html/Ocean.std-theme/minus.gif create mode 100644 resources/html/Ocean.std-theme/ocean.css create mode 100644 resources/html/Ocean.std-theme/plus.gif create mode 100644 resources/html/Ocean.std-theme/synopsis.png create mode 100644 resources/html/frames.html create mode 100644 resources/html/haddock-util.js create mode 100644 resources/latex/haddock.sty diff --git a/ghc.mk b/ghc.mk index 3742565c..3af63818 100644 --- a/ghc.mk +++ b/ghc.mk @@ -13,11 +13,11 @@ $(INPLACE_BIN)/$(utils/haddock_dist_PROG): $(INPLACE_LIB)/html $(INPLACE_LIB)/la $(INPLACE_LIB)/html: $(call removeTrees,$@) - "$(CP)" -R utils/haddock/html $@ + "$(CP)" -R utils/haddock/resources/html $@ $(INPLACE_LIB)/latex: $(call removeTrees,$@) - "$(CP)" -R utils/haddock/latex $@ + "$(CP)" -R utils/haddock/resources/latex $@ endif @@ -41,12 +41,12 @@ install_utils/haddock_data: $(foreach i,$(sort $(dir $(utils/haddock_dist_DATA_FILES))), \ $(call make-command,$(call INSTALL_DIR,"$(DESTDIR)$(ghclibdir)/$i"))) $(foreach i,$(utils/haddock_dist_DATA_FILES), \ - $(call make-command,$(call INSTALL_DATA,$(INSTALL_OPTS),utils/haddock/$i,"$(DESTDIR)$(ghclibdir)/$(dir $i)"))) + $(call make-command,$(call INSTALL_DATA,$(INSTALL_OPTS),utils/haddock/resources/$i,"$(DESTDIR)$(ghclibdir)/$(dir $i)"))) .PHONY: install_utils/haddock_link install_utils/haddock_link: $(call removeFiles,"$(DESTDIR)$(bindir)/haddock") $(LN_S) $(utils/haddock_dist_INSTALL_SHELL_WRAPPER_NAME) "$(DESTDIR)$(bindir)/haddock" -BINDIST_EXTRAS += $(addprefix utils/haddock/,$(utils/haddock_dist_DATA_FILES)) +BINDIST_EXTRAS += $(addprefix utils/haddock/resources/,$(utils/haddock_dist_DATA_FILES)) diff --git a/haddock.cabal b/haddock.cabal index 88c18cd3..846d7c6a 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -33,19 +33,19 @@ extra-source-files: -- the test-suite stanzas don't get picked up by `cabal sdist`. tests/html-tests/runtests.hs -data-files: - html/frames.html - html/haddock-util.js - html/Classic.theme/haskell_icon.gif - html/Classic.theme/minus.gif - html/Classic.theme/plus.gif - html/Classic.theme/xhaddock.css - html/Ocean.std-theme/hslogo-16.png - html/Ocean.std-theme/minus.gif - html/Ocean.std-theme/ocean.css - html/Ocean.std-theme/plus.gif - html/Ocean.std-theme/synopsis.png - latex/haddock.sty +data-dir: resources +data-files: html/frames.html + html/haddock-util.js + html/Classic.theme/haskell_icon.gif + html/Classic.theme/minus.gif + html/Classic.theme/plus.gif + html/Classic.theme/xhaddock.css + html/Ocean.std-theme/hslogo-16.png + html/Ocean.std-theme/minus.gif + html/Ocean.std-theme/ocean.css + html/Ocean.std-theme/plus.gif + html/Ocean.std-theme/synopsis.png + latex/haddock.sty flag in-ghc-tree description: Are we in a GHC tree? diff --git a/html/Classic.theme/haskell_icon.gif b/html/Classic.theme/haskell_icon.gif deleted file mode 100644 index 10589f91..00000000 Binary files a/html/Classic.theme/haskell_icon.gif and /dev/null differ diff --git a/html/Classic.theme/minus.gif b/html/Classic.theme/minus.gif deleted file mode 100644 index 1deac2fe..00000000 Binary files a/html/Classic.theme/minus.gif and /dev/null differ diff --git a/html/Classic.theme/plus.gif b/html/Classic.theme/plus.gif deleted file mode 100644 index 2d15c141..00000000 Binary files a/html/Classic.theme/plus.gif and /dev/null differ diff --git a/html/Classic.theme/xhaddock.css b/html/Classic.theme/xhaddock.css deleted file mode 100644 index 40ea0d06..00000000 --- a/html/Classic.theme/xhaddock.css +++ /dev/null @@ -1,493 +0,0 @@ -* { - margin: 0; - padding: 0; -} - -body { - background-color: #ffffff; - color: #000000; - font-size: 100%; - font-family: sans-serif; - padding: 8px; -} - -a:link { color: #0000e0; text-decoration: none } -a:visited { color: #0000a0; text-decoration: none } -a:hover { background-color: #e0e0ff; text-decoration: none } - -/* font is a little too small in MSIE */ -tt { font-size: 100%; } -pre { font-size: 100%; } -.keyword { text-decoration: underline; } -.caption { - font-weight: bold; - margin: 0; - padding: 0; -} - -h1 { - padding-top: 15px; - font-weight: bold; - font-size: 150%; -} - -h2 { - padding-top: 10px; - font-weight: bold; - font-size: 130% - } - -h3 { - padding-top: 5px; - font-weight: bold; - font-size: 110% - } - -h4, h5 { - font-weight: bold; - font-size: 100% - } - -h1, h2, h3, h4, h5 { - margin-top: 0.5em; - margin-bottom: 0.5em; -} - -p { - padding-top: 2px; - padding-left: 10px; -} - -ul, ol, dl { - padding-top: 2px; - padding-left: 10px; - margin-left: 2.5em; -} - -pre { - padding-top: 2px; - padding-left: 20px; -} - -* + p, * + pre { - margin-top: 1em; -} -.caption + p, .src + p { - margin-top: 0; -} - -.def { - font-weight: bold; -} - -ul.links { - list-style: none; - text-align: left; - float: right; - display: inline-table; - padding: 0; -} - -ul.links li { - display: inline; - border-left-width: 1px; - border-left-color: #ffffff; - border-left-style: solid; - white-space: nowrap; - padding: 1px 5px; -} - -.hide { display: none; } -.show { } -.collapser { - background: url(minus.gif) no-repeat 0 0.3em; -} -.expander { - background: url(plus.gif) no-repeat 0 0.3em; -} -.collapser, .expander { - padding-left: 14px; - cursor: pointer; -} - -#package-header { - color: #ffffff; - padding: 5px 5px 5px 31px; - margin: 0 0 1px; - background: #000099 url(haskell_icon.gif) no-repeat 5px 6px; - position: relative; -} - -#package-header .caption { - font-weight: normal; - font-style: normal; -} -#package-header a:link { color: #ffffff } -#package-header a:visited { color: #ffff00 } -#package-header a:hover { background-color: #6060ff; } -#package-header ul.links li:hover { background-color: #6060ff; } - -div#style-menu-holder { - position: relative; - z-index: 2; - display: inline; -} - -#style-menu { - position: absolute; - z-index: 1; - overflow: visible; - background-color: #000099; - margin: 0; - width: 6em; - text-align: center; - right: 0; - padding: 2px 2px 1px; -} - -#style-menu li { - display: list-item; - border-style: none; - margin: 0; - padding: 3px; - color: #000; - list-style-type: none; - border-top: 1px solid #ffffff; -} - -#module-header { - overflow: hidden; /* makes sure info float is properly contained */ - display: inline-block; /* triggers hasLayout in IE*/ -} - -#module-header { - display: block; /* back to block */ - background-color: #0077dd; - padding: 5px; -} - -#module-header .caption { - font-size: 200%; - padding: .35em 0; - font-weight: normal; - font-style: normal; -} - -table.info { - color: #ffffff; - display: block; - float: right; - max-width: 50%; -} - -.info th, .info td { - text-align: left; - padding: 0 10px 0 0; -} - - -#table-of-contents { - margin-top: 1em; - margin-bottom: 2em; -} - -#table-of-contents ul { - margin-top: 1em; - margin-bottom: 1em; - margin-left: 0; - list-style-type: none; - padding: 0; -} - -#table-of-contents ul ul { - margin-left: 2.5em; -} - -#description .caption, -#synopsis .caption, -#module-list .caption, -#index .caption { - padding-top: 15px; - font-weight: bold; - font-size: 150% -} - -#synopsis { - margin-bottom: 2em; -} - -#synopsis .expander, -#synopsis .collapser { - background: none; - padding-left: inherit; -} - -#synopsis .hide { - display: inherit; -} - -#synopsis ul { - margin: 0; - padding-top: 0; - padding-left: 20px; - list-style-type: none; -} - -#synopsis li { - margin-top: 8px; - margin-bottom: 8px; - padding: 3px; -} - -#synopsis li li { - padding: 0; - margin-top: 0; - margin-bottom: 0; -} - - -div.top { - margin-top: 1em; - clear: left; - margin-bottom: 1em; -} - -div.top h5 { - margin-left: 10px; -} - - -.src { - padding: 3px; - background-color: #f0f0f0; - font-family: monospace; - margin-bottom: 0; -} - - -.src a.link { - float: right; - border-left-width: 1px; - border-left-color: #000099; - border-left-style: solid; - white-space: nowrap; - font-size: small; - padding: 0 8px 2px 5px; - margin-right: -3px; - background-color: #f0f0f0; -} - -div.subs { - margin-left: 10px; - clear: both; - margin-top: 2px; -} - -.subs dl { - margin-left: 0; -} - -.subs dl dl { - padding-left: 0; - padding-top: 4px; -} - -.subs dd -{ - margin: 2px 0 9px 2em; -} - -.subs dd.empty { - display: none; -} - -.subs table { - margin-left: 10px; - border-spacing: 1px 1px; - margin-top: 4px; - margin-bottom: 4px; -} - -.subs table table { - margin-left: 0; -} - -.arguments .caption, -.fields .caption { - display: none; -} - -/* need extra .subs in the selector to make it override the rules for .subs and .subs table */ - -.subs.arguments { - margin: 0; -} - -.subs.arguments table { - border-spacing: 0; - margin-top: 0; - margin-bottom: 0; -} - -.subs.arguments td.src { - white-space: nowrap; -} - -.subs.arguments + p { - margin-top: 0; -} - -.subs.associated-types, -.subs.methods { - margin-left: 20px; -} - -.subs.associated-types .caption, -.subs.methods .caption { - margin-top: 0.5em; - margin-left: -10px; -} - -.subs.associated-types .src + .src, -.subs.methods .src + .src { - margin-top: 8px; -} - -p.arg { - margin-bottom: 0; -} -p.arg span { - background-color: #f0f0f0; - font-family: monospace; - white-space: nowrap; - float: none; -} - - -img.coll { - width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em -} - - -td.arg { - padding: 3px; - background-color: #f0f0f0; - font-family: monospace; - margin-bottom: 0; -} - -td.rdoc p { - margin-bottom: 0; -} - - - -#footer { - background-color: #000099; - color: #ffffff; - padding: 4px - } - -#footer p { - padding: 1px; - margin: 0; -} - -#footer a:link { - color: #ffffff; - text-decoration: underline - } -#footer a:visited { - color: #ffff00 - } -#footer a:hover { - background-color: #6060ff - } - - -#module-list ul { - list-style: none; - padding-bottom: 15px; - padding-left: 2px; - margin: 0; -} - -#module-list ul ul { - padding-bottom: 0; - padding-left: 20px; -} - -#module-list li .package { - float: right; -} -#mini #module-list .caption { - display: none; -} - -#index .caption { -} - -#alphabet ul { - list-style: none; - padding: 0; - margin: 0.5em 0 0; -} - -#alphabet li { - display: inline; - margin: 0 0.2em; -} - -#index .src { - background: none; - font-family: inherit; -} - -#index td.alt { - padding-left: 2em; -} - -#index td { - padding-top: 2px; - padding-bottom: 1px; - padding-right: 1em; -} - - -#mini h1 { font-size: 130%; } -#mini h2 { font-size: 110%; } -#mini h3 { font-size: 100%; } -#mini h1, #mini h2, #mini h3 { - margin-top: 0.5em; - margin-bottom: 0.25em; - padding: 0 0; -} - -#mini h1 { border-bottom: 1px solid #ccc; } - -#mini #module-header { - margin: 0; - padding: 0; -} -#mini #module-header .caption { - font-size: 130%; - background: #0077dd; - padding: 0.25em; - height: inherit; - margin: 0; -} - -#mini #interface .top { - margin: 0; - padding: 0; -} -#mini #interface .src { - margin: 0; - padding: 0; - font-family: inherit; - background: inherit; -} - -.warning { - color: red; -} diff --git a/html/Ocean.std-theme/hslogo-16.png b/html/Ocean.std-theme/hslogo-16.png deleted file mode 100644 index 0ff8579f..00000000 Binary files a/html/Ocean.std-theme/hslogo-16.png and /dev/null differ diff --git a/html/Ocean.std-theme/minus.gif b/html/Ocean.std-theme/minus.gif deleted file mode 100644 index 1deac2fe..00000000 Binary files a/html/Ocean.std-theme/minus.gif and /dev/null differ diff --git a/html/Ocean.std-theme/ocean.css b/html/Ocean.std-theme/ocean.css deleted file mode 100644 index 42238709..00000000 --- a/html/Ocean.std-theme/ocean.css +++ /dev/null @@ -1,546 +0,0 @@ -/* @group Fundamentals */ - -* { margin: 0; padding: 0 } - -/* Is this portable? */ -html { - background-color: white; - width: 100%; - height: 100%; -} - -body { - background: white; - color: black; - text-align: left; - min-height: 100%; - position: relative; -} - -p { - margin: 0.8em 0; -} - -ul, ol { - margin: 0.8em 0 0.8em 2em; -} - -dl { - margin: 0.8em 0; -} - -dt { - font-weight: bold; -} -dd { - margin-left: 2em; -} - -a { text-decoration: none; } -a[href]:link { color: rgb(196,69,29); } -a[href]:visited { color: rgb(171,105,84); } -a[href]:hover { text-decoration:underline; } - -/* @end */ - -/* @group Fonts & Sizes */ - -/* Basic technique & IE workarounds from YUI 3 - For reasons, see: - http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css - */ - -body { - font:13px/1.4 sans-serif; - *font-size:small; /* for IE */ - *font:x-small; /* for IE in quirks mode */ -} - -h1 { font-size: 146.5%; /* 19pt */ } -h2 { font-size: 131%; /* 17pt */ } -h3 { font-size: 116%; /* 15pt */ } -h4 { font-size: 100%; /* 13pt */ } -h5 { font-size: 100%; /* 13pt */ } - -select, input, button, textarea { - font:99% sans-serif; -} - -table { - font-size:inherit; - font:100%; -} - -pre, code, kbd, samp, tt, .src { - font-family:monospace; - *font-size:108%; - line-height: 124%; -} - -.links, .link { - font-size: 85%; /* 11pt */ -} - -#module-header .caption { - font-size: 182%; /* 24pt */ -} - -.info { - font-size: 85%; /* 11pt */ -} - -#table-of-contents, #synopsis { - /* font-size: 85%; /* 11pt */ -} - - -/* @end */ - -/* @group Common */ - -.caption, h1, h2, h3, h4, h5, h6 { - font-weight: bold; - color: rgb(78,98,114); - margin: 0.8em 0 0.4em; -} - -* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { - margin-top: 2em; -} - -h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { - margin-top: inherit; -} - -ul.links { - list-style: none; - text-align: left; - float: right; - display: inline-table; - margin: 0 0 0 1em; -} - -ul.links li { - display: inline; - border-left: 1px solid #d5d5d5; - white-space: nowrap; - padding: 0; -} - -ul.links li a { - padding: 0.2em 0.5em; -} - -.hide { display: none; } -.show { display: inherit; } -.clear { clear: both; } - -.collapser { - background-image: url(minus.gif); - background-repeat: no-repeat; -} -.expander { - background-image: url(plus.gif); - background-repeat: no-repeat; -} -p.caption.collapser, -p.caption.expander { - background-position: 0 0.4em; -} -.collapser, .expander { - padding-left: 14px; - margin-left: -14px; - cursor: pointer; -} - -pre { - padding: 0.25em; - margin: 0.8em 0; - background: rgb(229,237,244); - overflow: auto; - border-bottom: 0.25em solid white; - /* white border adds some space below the box to compensate - for visual extra space that paragraphs have between baseline - and the bounding box */ -} - -.src { - background: #f0f0f0; - padding: 0.2em 0.5em; -} - -.keyword { font-weight: normal; } -.def { font-weight: bold; } - - -/* @end */ - -/* @group Page Structure */ - -#content { - margin: 0 auto; - padding: 0 2em 6em; -} - -#package-header { - background: rgb(41,56,69); - border-top: 5px solid rgb(78,98,114); - color: #ddd; - padding: 0.2em; - position: relative; - text-align: left; -} - -#package-header .caption { - background: url(hslogo-16.png) no-repeat 0em; - color: white; - margin: 0 2em; - font-weight: normal; - font-style: normal; - padding-left: 2em; -} - -#package-header a:link, #package-header a:visited { color: white; } -#package-header a:hover { background: rgb(78,98,114); } - -#module-header .caption { - color: rgb(78,98,114); - font-weight: bold; - border-bottom: 1px solid #ddd; -} - -table.info { - float: right; - padding: 0.5em 1em; - border: 1px solid #ddd; - color: rgb(78,98,114); - background-color: #fff; - max-width: 40%; - border-spacing: 0; - position: relative; - top: -0.5em; - margin: 0 0 0 2em; -} - -.info th { - padding: 0 1em 0 0; -} - -div#style-menu-holder { - position: relative; - z-index: 2; - display: inline; -} - -#style-menu { - position: absolute; - z-index: 1; - overflow: visible; - background: #374c5e; - margin: 0; - text-align: center; - right: 0; - padding: 0; - top: 1.25em; -} - -#style-menu li { - display: list-item; - border-style: none; - margin: 0; - padding: 0; - color: #000; - list-style-type: none; -} - -#style-menu li + li { - border-top: 1px solid #919191; -} - -#style-menu a { - width: 6em; - padding: 3px; - display: block; -} - -#footer { - background: #ddd; - border-top: 1px solid #aaa; - padding: 0.5em 0; - color: #666; - text-align: center; - position: absolute; - bottom: 0; - width: 100%; - height: 3em; -} - -/* @end */ - -/* @group Front Matter */ - -#table-of-contents { - float: right; - clear: right; - background: #faf9dc; - border: 1px solid #d8d7ad; - padding: 0.5em 1em; - max-width: 20em; - margin: 0.5em 0 1em 1em; -} - -#table-of-contents .caption { - text-align: center; - margin: 0; -} - -#table-of-contents ul { - list-style: none; - margin: 0; -} - -#table-of-contents ul ul { - margin-left: 2em; -} - -#description .caption { - display: none; -} - -#synopsis { - display: none; -} - -.no-frame #synopsis { - display: block; - position: fixed; - right: 0; - height: 80%; - top: 10%; - padding: 0; -} - -#synopsis .caption { - float: left; - width: 29px; - color: rgba(255,255,255,0); - height: 110px; - margin: 0; - font-size: 1px; - padding: 0; -} - -#synopsis p.caption.collapser { - background: url(synopsis.png) no-repeat -64px -8px; -} - -#synopsis p.caption.expander { - background: url(synopsis.png) no-repeat 0px -8px; -} - -#synopsis ul { - height: 100%; - overflow: auto; - padding: 0.5em; - margin: 0; -} - -#synopsis ul ul { - overflow: hidden; -} - -#synopsis ul, -#synopsis ul li.src { - background-color: #faf9dc; - white-space: nowrap; - list-style: none; - margin-left: 0; -} - -/* @end */ - -/* @group Main Content */ - -#interface div.top { margin: 2em 0; } -#interface h1 + div.top, -#interface h2 + div.top, -#interface h3 + div.top, -#interface h4 + div.top, -#interface h5 + div.top { - margin-top: 1em; -} -#interface p.src .link { - float: right; - color: #919191; - border-left: 1px solid #919191; - background: #f0f0f0; - padding: 0 0.5em 0.2em; - margin: 0 -0.5em 0 0.5em; -} - -#interface table { border-spacing: 2px; } -#interface td { - vertical-align: top; - padding-left: 0.5em; -} -#interface td.src { - white-space: nowrap; -} -#interface td.doc p { - margin: 0; -} -#interface td.doc p + p { - margin-top: 0.8em; -} - -.subs dl { - margin: 0; -} - -.subs dt { - float: left; - clear: left; - display: block; - margin: 1px 0; -} - -.subs dd { - float: right; - width: 90%; - display: block; - padding-left: 0.5em; - margin-bottom: 0.5em; -} - -.subs dd.empty { - display: none; -} - -.subs dd p { - margin: 0; -} - -.top p.src { - border-top: 1px solid #ccc; -} - -.subs, .doc { - /* use this selector for one level of indent */ - padding-left: 2em; -} - -.warning { - color: red; -} - -.arguments { - margin-top: -0.4em; -} -.arguments .caption { - display: none; -} - -.fields { padding-left: 1em; } - -.fields .caption { display: none; } - -.fields p { margin: 0 0; } - -/* this seems bulky to me -.methods, .constructors { - background: #f8f8f8; - border: 1px solid #eee; -} -*/ - -/* @end */ - -/* @group Auxillary Pages */ - -#mini { - margin: 0 auto; - padding: 0 1em 1em; -} - -#mini > * { - font-size: 93%; /* 12pt */ -} - -#mini #module-list .caption, -#mini #module-header .caption { - font-size: 125%; /* 15pt */ -} - -#mini #interface h1, -#mini #interface h2, -#mini #interface h3, -#mini #interface h4 { - font-size: 109%; /* 13pt */ - margin: 1em 0 0; -} - -#mini #interface .top, -#mini #interface .src { - margin: 0; -} - -#mini #module-list ul { - list-style: none; - margin: 0; -} - -#alphabet ul { - list-style: none; - padding: 0; - margin: 0.5em 0 0; - text-align: center; -} - -#alphabet li { - display: inline; - margin: 0 0.25em; -} - -#alphabet a { - font-weight: bold; -} - -#index .caption, -#module-list .caption { font-size: 131%; /* 17pt */ } - -#index table { - margin-left: 2em; -} - -#index .src { - font-weight: bold; -} -#index .alt { - font-size: 77%; /* 10pt */ - font-style: italic; - padding-left: 2em; -} - -#index td + td { - padding-left: 1em; -} - -#module-list ul { - list-style: none; - margin: 0 0 0 2em; -} - -#module-list li { - clear: right; -} - -#module-list span.collapser, -#module-list span.expander { - background-position: 0 0.3em; -} - -#module-list .package { - float: right; -} - -/* @end */ diff --git a/html/Ocean.std-theme/plus.gif b/html/Ocean.std-theme/plus.gif deleted file mode 100644 index 2d15c141..00000000 Binary files a/html/Ocean.std-theme/plus.gif and /dev/null differ diff --git a/html/Ocean.std-theme/synopsis.png b/html/Ocean.std-theme/synopsis.png deleted file mode 100644 index 85fb86ec..00000000 Binary files a/html/Ocean.std-theme/synopsis.png and /dev/null differ diff --git a/html/frames.html b/html/frames.html deleted file mode 100644 index 1b4e38d4..00000000 --- a/html/frames.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/html/haddock-util.js b/html/haddock-util.js deleted file mode 100644 index 9a6fccf7..00000000 --- a/html/haddock-util.js +++ /dev/null @@ -1,344 +0,0 @@ -// Haddock JavaScript utilities - -var rspace = /\s\s+/g, - rtrim = /^\s+|\s+$/g; - -function spaced(s) { return (" " + s + " ").replace(rspace, " "); } -function trim(s) { return s.replace(rtrim, ""); } - -function hasClass(elem, value) { - var className = spaced(elem.className || ""); - return className.indexOf( " " + value + " " ) >= 0; -} - -function addClass(elem, value) { - var className = spaced(elem.className || ""); - if ( className.indexOf( " " + value + " " ) < 0 ) { - elem.className = trim(className + " " + value); - } -} - -function removeClass(elem, value) { - var className = spaced(elem.className || ""); - className = className.replace(" " + value + " ", " "); - elem.className = trim(className); -} - -function toggleClass(elem, valueOn, valueOff, bool) { - if (bool == null) { bool = ! hasClass(elem, valueOn); } - if (bool) { - removeClass(elem, valueOff); - addClass(elem, valueOn); - } - else { - removeClass(elem, valueOn); - addClass(elem, valueOff); - } - return bool; -} - - -function makeClassToggle(valueOn, valueOff) -{ - return function(elem, bool) { - return toggleClass(elem, valueOn, valueOff, bool); - } -} - -toggleShow = makeClassToggle("show", "hide"); -toggleCollapser = makeClassToggle("collapser", "expander"); - -function toggleSection(id) -{ - var b = toggleShow(document.getElementById("section." + id)); - toggleCollapser(document.getElementById("control." + id), b); - rememberCollapsed(id, b); - return b; -} - -var collapsed = {}; -function rememberCollapsed(id, b) -{ - if(b) - delete collapsed[id] - else - collapsed[id] = null; - - var sections = []; - for(var i in collapsed) - { - if(collapsed.hasOwnProperty(i)) - sections.push(i); - } - // cookie specific to this page; don't use setCookie which sets path=/ - document.cookie = "collapsed=" + escape(sections.join('+')); -} - -function restoreCollapsed() -{ - var cookie = getCookie("collapsed"); - if(!cookie) - return; - - var ids = cookie.split('+'); - for(var i in ids) - { - if(document.getElementById("section." + ids[i])) - toggleSection(ids[i]); - } -} - -function setCookie(name, value) { - document.cookie = name + "=" + escape(value) + ";path=/;"; -} - -function clearCookie(name) { - document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"; -} - -function getCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) { - return unescape(c.substring(nameEQ.length,c.length)); - } - } - return null; -} - - - -var max_results = 75; // 50 is not enough to search for map in the base libraries -var shown_range = null; -var last_search = null; - -function quick_search() -{ - perform_search(false); -} - -function full_search() -{ - perform_search(true); -} - - -function perform_search(full) -{ - var text = document.getElementById("searchbox").value.toLowerCase(); - if (text == last_search && !full) return; - last_search = text; - - var table = document.getElementById("indexlist"); - var status = document.getElementById("searchmsg"); - var children = table.firstChild.childNodes; - - // first figure out the first node with the prefix - var first = bisect(-1); - var last = (first == -1 ? -1 : bisect(1)); - - if (first == -1) - { - table.className = ""; - status.innerHTML = "No results found, displaying all"; - } - else if (first == 0 && last == children.length - 1) - { - table.className = ""; - status.innerHTML = ""; - } - else if (last - first >= max_results && !full) - { - table.className = ""; - status.innerHTML = "More than " + max_results + ", press Search to display"; - } - else - { - // decide what you need to clear/show - if (shown_range) - setclass(shown_range[0], shown_range[1], "indexrow"); - setclass(first, last, "indexshow"); - shown_range = [first, last]; - table.className = "indexsearch"; - status.innerHTML = ""; - } - - - function setclass(first, last, status) - { - for (var i = first; i <= last; i++) - { - children[i].className = status; - } - } - - - // do a binary search, treating 0 as ... - // return either -1 (no 0's found) or location of most far match - function bisect(dir) - { - var first = 0, finish = children.length - 1; - var mid, success = false; - - while (finish - first > 3) - { - mid = Math.floor((finish + first) / 2); - - var i = checkitem(mid); - if (i == 0) i = dir; - if (i == -1) - finish = mid; - else - first = mid; - } - var a = (dir == 1 ? first : finish); - var b = (dir == 1 ? finish : first); - for (var i = b; i != a - dir; i -= dir) - { - if (checkitem(i) == 0) return i; - } - return -1; - } - - - // from an index, decide what the result is - // 0 = match, -1 is lower, 1 is higher - function checkitem(i) - { - var s = getitem(i).toLowerCase().substr(0, text.length); - if (s == text) return 0; - else return (s > text ? -1 : 1); - } - - - // from an index, get its string - // this abstracts over alternates - function getitem(i) - { - for ( ; i >= 0; i--) - { - var s = children[i].firstChild.firstChild.data; - if (s.indexOf(' ') == -1) - return s; - } - return ""; // should never be reached - } -} - -function setSynopsis(filename) { - if (parent.window.synopsis) { - if (parent.window.synopsis.location.replace) { - // In Firefox this avoids adding the change to the history. - parent.window.synopsis.location.replace(filename); - } else { - parent.window.synopsis.location = filename; - } - } -} - -function addMenuItem(html) { - var menu = document.getElementById("page-menu"); - if (menu) { - var btn = menu.firstChild.cloneNode(false); - btn.innerHTML = html; - menu.appendChild(btn); - } -} - -function adjustForFrames() { - var bodyCls; - - if (parent.location.href == window.location.href) { - // not in frames, so add Frames button - addMenuItem("Frames"); - bodyCls = "no-frame"; - } - else { - bodyCls = "in-frame"; - } - addClass(document.body, bodyCls); -} - -function reframe() { - setCookie("haddock-reframe", document.URL); - window.location = "frames.html"; -} - -function postReframe() { - var s = getCookie("haddock-reframe"); - if (s) { - parent.window.main.location = s; - clearCookie("haddock-reframe"); - } -} - -function styles() { - var i, a, es = document.getElementsByTagName("link"), rs = []; - for (i = 0; a = es[i]; i++) { - if(a.rel.indexOf("style") != -1 && a.title) { - rs.push(a); - } - } - return rs; -} - -function addStyleMenu() { - var as = styles(); - var i, a, btns = ""; - for(i=0; a = as[i]; i++) { - btns += "
  • " - + a.title + "
  • " - } - if (as.length > 1) { - var h = "
    " - + "Style ▾" - + "
      " + btns + "
    " - + "
    "; - addMenuItem(h); - } -} - -function setActiveStyleSheet(title) { - var as = styles(); - var i, a, found; - for(i=0; a = as[i]; i++) { - a.disabled = true; - // need to do this always, some browsers are edge triggered - if(a.title == title) { - found = a; - } - } - if (found) { - found.disabled = false; - setCookie("haddock-style", title); - } - else { - as[0].disabled = false; - clearCookie("haddock-style"); - } - styleMenu(false); -} - -function resetStyle() { - var s = getCookie("haddock-style"); - if (s) setActiveStyleSheet(s); -} - - -function styleMenu(show) { - var m = document.getElementById('style-menu'); - if (m) toggleShow(m, show); -} - - -function pageLoad() { - addStyleMenu(); - adjustForFrames(); - resetStyle(); - restoreCollapsed(); -} - diff --git a/latex/haddock.sty b/latex/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/resources/html/Classic.theme/haskell_icon.gif b/resources/html/Classic.theme/haskell_icon.gif new file mode 100644 index 00000000..10589f91 Binary files /dev/null and b/resources/html/Classic.theme/haskell_icon.gif differ diff --git a/resources/html/Classic.theme/minus.gif b/resources/html/Classic.theme/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/resources/html/Classic.theme/minus.gif differ diff --git a/resources/html/Classic.theme/plus.gif b/resources/html/Classic.theme/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/resources/html/Classic.theme/plus.gif differ diff --git a/resources/html/Classic.theme/xhaddock.css b/resources/html/Classic.theme/xhaddock.css new file mode 100644 index 00000000..40ea0d06 --- /dev/null +++ b/resources/html/Classic.theme/xhaddock.css @@ -0,0 +1,493 @@ +* { + margin: 0; + padding: 0; +} + +body { + background-color: #ffffff; + color: #000000; + font-size: 100%; + font-family: sans-serif; + padding: 8px; +} + +a:link { color: #0000e0; text-decoration: none } +a:visited { color: #0000a0; text-decoration: none } +a:hover { background-color: #e0e0ff; text-decoration: none } + +/* font is a little too small in MSIE */ +tt { font-size: 100%; } +pre { font-size: 100%; } +.keyword { text-decoration: underline; } +.caption { + font-weight: bold; + margin: 0; + padding: 0; +} + +h1 { + padding-top: 15px; + font-weight: bold; + font-size: 150%; +} + +h2 { + padding-top: 10px; + font-weight: bold; + font-size: 130% + } + +h3 { + padding-top: 5px; + font-weight: bold; + font-size: 110% + } + +h4, h5 { + font-weight: bold; + font-size: 100% + } + +h1, h2, h3, h4, h5 { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +p { + padding-top: 2px; + padding-left: 10px; +} + +ul, ol, dl { + padding-top: 2px; + padding-left: 10px; + margin-left: 2.5em; +} + +pre { + padding-top: 2px; + padding-left: 20px; +} + +* + p, * + pre { + margin-top: 1em; +} +.caption + p, .src + p { + margin-top: 0; +} + +.def { + font-weight: bold; +} + +ul.links { + list-style: none; + text-align: left; + float: right; + display: inline-table; + padding: 0; +} + +ul.links li { + display: inline; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + padding: 1px 5px; +} + +.hide { display: none; } +.show { } +.collapser { + background: url(minus.gif) no-repeat 0 0.3em; +} +.expander { + background: url(plus.gif) no-repeat 0 0.3em; +} +.collapser, .expander { + padding-left: 14px; + cursor: pointer; +} + +#package-header { + color: #ffffff; + padding: 5px 5px 5px 31px; + margin: 0 0 1px; + background: #000099 url(haskell_icon.gif) no-repeat 5px 6px; + position: relative; +} + +#package-header .caption { + font-weight: normal; + font-style: normal; +} +#package-header a:link { color: #ffffff } +#package-header a:visited { color: #ffff00 } +#package-header a:hover { background-color: #6060ff; } +#package-header ul.links li:hover { background-color: #6060ff; } + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background-color: #000099; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 2px 2px 1px; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; + border-top: 1px solid #ffffff; +} + +#module-header { + overflow: hidden; /* makes sure info float is properly contained */ + display: inline-block; /* triggers hasLayout in IE*/ +} + +#module-header { + display: block; /* back to block */ + background-color: #0077dd; + padding: 5px; +} + +#module-header .caption { + font-size: 200%; + padding: .35em 0; + font-weight: normal; + font-style: normal; +} + +table.info { + color: #ffffff; + display: block; + float: right; + max-width: 50%; +} + +.info th, .info td { + text-align: left; + padding: 0 10px 0 0; +} + + +#table-of-contents { + margin-top: 1em; + margin-bottom: 2em; +} + +#table-of-contents ul { + margin-top: 1em; + margin-bottom: 1em; + margin-left: 0; + list-style-type: none; + padding: 0; +} + +#table-of-contents ul ul { + margin-left: 2.5em; +} + +#description .caption, +#synopsis .caption, +#module-list .caption, +#index .caption { + padding-top: 15px; + font-weight: bold; + font-size: 150% +} + +#synopsis { + margin-bottom: 2em; +} + +#synopsis .expander, +#synopsis .collapser { + background: none; + padding-left: inherit; +} + +#synopsis .hide { + display: inherit; +} + +#synopsis ul { + margin: 0; + padding-top: 0; + padding-left: 20px; + list-style-type: none; +} + +#synopsis li { + margin-top: 8px; + margin-bottom: 8px; + padding: 3px; +} + +#synopsis li li { + padding: 0; + margin-top: 0; + margin-bottom: 0; +} + + +div.top { + margin-top: 1em; + clear: left; + margin-bottom: 1em; +} + +div.top h5 { + margin-left: 10px; +} + + +.src { + padding: 3px; + background-color: #f0f0f0; + font-family: monospace; + margin-bottom: 0; +} + + +.src a.link { + float: right; + border-left-width: 1px; + border-left-color: #000099; + border-left-style: solid; + white-space: nowrap; + font-size: small; + padding: 0 8px 2px 5px; + margin-right: -3px; + background-color: #f0f0f0; +} + +div.subs { + margin-left: 10px; + clear: both; + margin-top: 2px; +} + +.subs dl { + margin-left: 0; +} + +.subs dl dl { + padding-left: 0; + padding-top: 4px; +} + +.subs dd +{ + margin: 2px 0 9px 2em; +} + +.subs dd.empty { + display: none; +} + +.subs table { + margin-left: 10px; + border-spacing: 1px 1px; + margin-top: 4px; + margin-bottom: 4px; +} + +.subs table table { + margin-left: 0; +} + +.arguments .caption, +.fields .caption { + display: none; +} + +/* need extra .subs in the selector to make it override the rules for .subs and .subs table */ + +.subs.arguments { + margin: 0; +} + +.subs.arguments table { + border-spacing: 0; + margin-top: 0; + margin-bottom: 0; +} + +.subs.arguments td.src { + white-space: nowrap; +} + +.subs.arguments + p { + margin-top: 0; +} + +.subs.associated-types, +.subs.methods { + margin-left: 20px; +} + +.subs.associated-types .caption, +.subs.methods .caption { + margin-top: 0.5em; + margin-left: -10px; +} + +.subs.associated-types .src + .src, +.subs.methods .src + .src { + margin-top: 8px; +} + +p.arg { + margin-bottom: 0; +} +p.arg span { + background-color: #f0f0f0; + font-family: monospace; + white-space: nowrap; + float: none; +} + + +img.coll { + width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em +} + + +td.arg { + padding: 3px; + background-color: #f0f0f0; + font-family: monospace; + margin-bottom: 0; +} + +td.rdoc p { + margin-bottom: 0; +} + + + +#footer { + background-color: #000099; + color: #ffffff; + padding: 4px + } + +#footer p { + padding: 1px; + margin: 0; +} + +#footer a:link { + color: #ffffff; + text-decoration: underline + } +#footer a:visited { + color: #ffff00 + } +#footer a:hover { + background-color: #6060ff + } + + +#module-list ul { + list-style: none; + padding-bottom: 15px; + padding-left: 2px; + margin: 0; +} + +#module-list ul ul { + padding-bottom: 0; + padding-left: 20px; +} + +#module-list li .package { + float: right; +} +#mini #module-list .caption { + display: none; +} + +#index .caption { +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; +} + +#alphabet li { + display: inline; + margin: 0 0.2em; +} + +#index .src { + background: none; + font-family: inherit; +} + +#index td.alt { + padding-left: 2em; +} + +#index td { + padding-top: 2px; + padding-bottom: 1px; + padding-right: 1em; +} + + +#mini h1 { font-size: 130%; } +#mini h2 { font-size: 110%; } +#mini h3 { font-size: 100%; } +#mini h1, #mini h2, #mini h3 { + margin-top: 0.5em; + margin-bottom: 0.25em; + padding: 0 0; +} + +#mini h1 { border-bottom: 1px solid #ccc; } + +#mini #module-header { + margin: 0; + padding: 0; +} +#mini #module-header .caption { + font-size: 130%; + background: #0077dd; + padding: 0.25em; + height: inherit; + margin: 0; +} + +#mini #interface .top { + margin: 0; + padding: 0; +} +#mini #interface .src { + margin: 0; + padding: 0; + font-family: inherit; + background: inherit; +} + +.warning { + color: red; +} diff --git a/resources/html/Ocean.std-theme/hslogo-16.png b/resources/html/Ocean.std-theme/hslogo-16.png new file mode 100644 index 00000000..0ff8579f Binary files /dev/null and b/resources/html/Ocean.std-theme/hslogo-16.png differ diff --git a/resources/html/Ocean.std-theme/minus.gif b/resources/html/Ocean.std-theme/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/resources/html/Ocean.std-theme/minus.gif differ diff --git a/resources/html/Ocean.std-theme/ocean.css b/resources/html/Ocean.std-theme/ocean.css new file mode 100644 index 00000000..42238709 --- /dev/null +++ b/resources/html/Ocean.std-theme/ocean.css @@ -0,0 +1,546 @@ +/* @group Fundamentals */ + +* { margin: 0; padding: 0 } + +/* Is this portable? */ +html { + background-color: white; + width: 100%; + height: 100%; +} + +body { + background: white; + color: black; + text-align: left; + min-height: 100%; + position: relative; +} + +p { + margin: 0.8em 0; +} + +ul, ol { + margin: 0.8em 0 0.8em 2em; +} + +dl { + margin: 0.8em 0; +} + +dt { + font-weight: bold; +} +dd { + margin-left: 2em; +} + +a { text-decoration: none; } +a[href]:link { color: rgb(196,69,29); } +a[href]:visited { color: rgb(171,105,84); } +a[href]:hover { text-decoration:underline; } + +/* @end */ + +/* @group Fonts & Sizes */ + +/* Basic technique & IE workarounds from YUI 3 + For reasons, see: + http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css + */ + +body { + font:13px/1.4 sans-serif; + *font-size:small; /* for IE */ + *font:x-small; /* for IE in quirks mode */ +} + +h1 { font-size: 146.5%; /* 19pt */ } +h2 { font-size: 131%; /* 17pt */ } +h3 { font-size: 116%; /* 15pt */ } +h4 { font-size: 100%; /* 13pt */ } +h5 { font-size: 100%; /* 13pt */ } + +select, input, button, textarea { + font:99% sans-serif; +} + +table { + font-size:inherit; + font:100%; +} + +pre, code, kbd, samp, tt, .src { + font-family:monospace; + *font-size:108%; + line-height: 124%; +} + +.links, .link { + font-size: 85%; /* 11pt */ +} + +#module-header .caption { + font-size: 182%; /* 24pt */ +} + +.info { + font-size: 85%; /* 11pt */ +} + +#table-of-contents, #synopsis { + /* font-size: 85%; /* 11pt */ +} + + +/* @end */ + +/* @group Common */ + +.caption, h1, h2, h3, h4, h5, h6 { + font-weight: bold; + color: rgb(78,98,114); + margin: 0.8em 0 0.4em; +} + +* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { + margin-top: 2em; +} + +h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { + margin-top: inherit; +} + +ul.links { + list-style: none; + text-align: left; + float: right; + display: inline-table; + margin: 0 0 0 1em; +} + +ul.links li { + display: inline; + border-left: 1px solid #d5d5d5; + white-space: nowrap; + padding: 0; +} + +ul.links li a { + padding: 0.2em 0.5em; +} + +.hide { display: none; } +.show { display: inherit; } +.clear { clear: both; } + +.collapser { + background-image: url(minus.gif); + background-repeat: no-repeat; +} +.expander { + background-image: url(plus.gif); + background-repeat: no-repeat; +} +p.caption.collapser, +p.caption.expander { + background-position: 0 0.4em; +} +.collapser, .expander { + padding-left: 14px; + margin-left: -14px; + cursor: pointer; +} + +pre { + padding: 0.25em; + margin: 0.8em 0; + background: rgb(229,237,244); + overflow: auto; + border-bottom: 0.25em solid white; + /* white border adds some space below the box to compensate + for visual extra space that paragraphs have between baseline + and the bounding box */ +} + +.src { + background: #f0f0f0; + padding: 0.2em 0.5em; +} + +.keyword { font-weight: normal; } +.def { font-weight: bold; } + + +/* @end */ + +/* @group Page Structure */ + +#content { + margin: 0 auto; + padding: 0 2em 6em; +} + +#package-header { + background: rgb(41,56,69); + border-top: 5px solid rgb(78,98,114); + color: #ddd; + padding: 0.2em; + position: relative; + text-align: left; +} + +#package-header .caption { + background: url(hslogo-16.png) no-repeat 0em; + color: white; + margin: 0 2em; + font-weight: normal; + font-style: normal; + padding-left: 2em; +} + +#package-header a:link, #package-header a:visited { color: white; } +#package-header a:hover { background: rgb(78,98,114); } + +#module-header .caption { + color: rgb(78,98,114); + font-weight: bold; + border-bottom: 1px solid #ddd; +} + +table.info { + float: right; + padding: 0.5em 1em; + border: 1px solid #ddd; + color: rgb(78,98,114); + background-color: #fff; + max-width: 40%; + border-spacing: 0; + position: relative; + top: -0.5em; + margin: 0 0 0 2em; +} + +.info th { + padding: 0 1em 0 0; +} + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background: #374c5e; + margin: 0; + text-align: center; + right: 0; + padding: 0; + top: 1.25em; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 0; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + +#style-menu a { + width: 6em; + padding: 3px; + display: block; +} + +#footer { + background: #ddd; + border-top: 1px solid #aaa; + padding: 0.5em 0; + color: #666; + text-align: center; + position: absolute; + bottom: 0; + width: 100%; + height: 3em; +} + +/* @end */ + +/* @group Front Matter */ + +#table-of-contents { + float: right; + clear: right; + background: #faf9dc; + border: 1px solid #d8d7ad; + padding: 0.5em 1em; + max-width: 20em; + margin: 0.5em 0 1em 1em; +} + +#table-of-contents .caption { + text-align: center; + margin: 0; +} + +#table-of-contents ul { + list-style: none; + margin: 0; +} + +#table-of-contents ul ul { + margin-left: 2em; +} + +#description .caption { + display: none; +} + +#synopsis { + display: none; +} + +.no-frame #synopsis { + display: block; + position: fixed; + right: 0; + height: 80%; + top: 10%; + padding: 0; +} + +#synopsis .caption { + float: left; + width: 29px; + color: rgba(255,255,255,0); + height: 110px; + margin: 0; + font-size: 1px; + padding: 0; +} + +#synopsis p.caption.collapser { + background: url(synopsis.png) no-repeat -64px -8px; +} + +#synopsis p.caption.expander { + background: url(synopsis.png) no-repeat 0px -8px; +} + +#synopsis ul { + height: 100%; + overflow: auto; + padding: 0.5em; + margin: 0; +} + +#synopsis ul ul { + overflow: hidden; +} + +#synopsis ul, +#synopsis ul li.src { + background-color: #faf9dc; + white-space: nowrap; + list-style: none; + margin-left: 0; +} + +/* @end */ + +/* @group Main Content */ + +#interface div.top { margin: 2em 0; } +#interface h1 + div.top, +#interface h2 + div.top, +#interface h3 + div.top, +#interface h4 + div.top, +#interface h5 + div.top { + margin-top: 1em; +} +#interface p.src .link { + float: right; + color: #919191; + border-left: 1px solid #919191; + background: #f0f0f0; + padding: 0 0.5em 0.2em; + margin: 0 -0.5em 0 0.5em; +} + +#interface table { border-spacing: 2px; } +#interface td { + vertical-align: top; + padding-left: 0.5em; +} +#interface td.src { + white-space: nowrap; +} +#interface td.doc p { + margin: 0; +} +#interface td.doc p + p { + margin-top: 0.8em; +} + +.subs dl { + margin: 0; +} + +.subs dt { + float: left; + clear: left; + display: block; + margin: 1px 0; +} + +.subs dd { + float: right; + width: 90%; + display: block; + padding-left: 0.5em; + margin-bottom: 0.5em; +} + +.subs dd.empty { + display: none; +} + +.subs dd p { + margin: 0; +} + +.top p.src { + border-top: 1px solid #ccc; +} + +.subs, .doc { + /* use this selector for one level of indent */ + padding-left: 2em; +} + +.warning { + color: red; +} + +.arguments { + margin-top: -0.4em; +} +.arguments .caption { + display: none; +} + +.fields { padding-left: 1em; } + +.fields .caption { display: none; } + +.fields p { margin: 0 0; } + +/* this seems bulky to me +.methods, .constructors { + background: #f8f8f8; + border: 1px solid #eee; +} +*/ + +/* @end */ + +/* @group Auxillary Pages */ + +#mini { + margin: 0 auto; + padding: 0 1em 1em; +} + +#mini > * { + font-size: 93%; /* 12pt */ +} + +#mini #module-list .caption, +#mini #module-header .caption { + font-size: 125%; /* 15pt */ +} + +#mini #interface h1, +#mini #interface h2, +#mini #interface h3, +#mini #interface h4 { + font-size: 109%; /* 13pt */ + margin: 1em 0 0; +} + +#mini #interface .top, +#mini #interface .src { + margin: 0; +} + +#mini #module-list ul { + list-style: none; + margin: 0; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + text-align: center; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + font-weight: bold; +} + +#index .caption, +#module-list .caption { font-size: 131%; /* 17pt */ } + +#index table { + margin-left: 2em; +} + +#index .src { + font-weight: bold; +} +#index .alt { + font-size: 77%; /* 10pt */ + font-style: italic; + padding-left: 2em; +} + +#index td + td { + padding-left: 1em; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 2em; +} + +#module-list li { + clear: right; +} + +#module-list span.collapser, +#module-list span.expander { + background-position: 0 0.3em; +} + +#module-list .package { + float: right; +} + +/* @end */ diff --git a/resources/html/Ocean.std-theme/plus.gif b/resources/html/Ocean.std-theme/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/resources/html/Ocean.std-theme/plus.gif differ diff --git a/resources/html/Ocean.std-theme/synopsis.png b/resources/html/Ocean.std-theme/synopsis.png new file mode 100644 index 00000000..85fb86ec Binary files /dev/null and b/resources/html/Ocean.std-theme/synopsis.png differ diff --git a/resources/html/frames.html b/resources/html/frames.html new file mode 100644 index 00000000..1b4e38d4 --- /dev/null +++ b/resources/html/frames.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/resources/html/haddock-util.js b/resources/html/haddock-util.js new file mode 100644 index 00000000..9a6fccf7 --- /dev/null +++ b/resources/html/haddock-util.js @@ -0,0 +1,344 @@ +// Haddock JavaScript utilities + +var rspace = /\s\s+/g, + rtrim = /^\s+|\s+$/g; + +function spaced(s) { return (" " + s + " ").replace(rspace, " "); } +function trim(s) { return s.replace(rtrim, ""); } + +function hasClass(elem, value) { + var className = spaced(elem.className || ""); + return className.indexOf( " " + value + " " ) >= 0; +} + +function addClass(elem, value) { + var className = spaced(elem.className || ""); + if ( className.indexOf( " " + value + " " ) < 0 ) { + elem.className = trim(className + " " + value); + } +} + +function removeClass(elem, value) { + var className = spaced(elem.className || ""); + className = className.replace(" " + value + " ", " "); + elem.className = trim(className); +} + +function toggleClass(elem, valueOn, valueOff, bool) { + if (bool == null) { bool = ! hasClass(elem, valueOn); } + if (bool) { + removeClass(elem, valueOff); + addClass(elem, valueOn); + } + else { + removeClass(elem, valueOn); + addClass(elem, valueOff); + } + return bool; +} + + +function makeClassToggle(valueOn, valueOff) +{ + return function(elem, bool) { + return toggleClass(elem, valueOn, valueOff, bool); + } +} + +toggleShow = makeClassToggle("show", "hide"); +toggleCollapser = makeClassToggle("collapser", "expander"); + +function toggleSection(id) +{ + var b = toggleShow(document.getElementById("section." + id)); + toggleCollapser(document.getElementById("control." + id), b); + rememberCollapsed(id, b); + return b; +} + +var collapsed = {}; +function rememberCollapsed(id, b) +{ + if(b) + delete collapsed[id] + else + collapsed[id] = null; + + var sections = []; + for(var i in collapsed) + { + if(collapsed.hasOwnProperty(i)) + sections.push(i); + } + // cookie specific to this page; don't use setCookie which sets path=/ + document.cookie = "collapsed=" + escape(sections.join('+')); +} + +function restoreCollapsed() +{ + var cookie = getCookie("collapsed"); + if(!cookie) + return; + + var ids = cookie.split('+'); + for(var i in ids) + { + if(document.getElementById("section." + ids[i])) + toggleSection(ids[i]); + } +} + +function setCookie(name, value) { + document.cookie = name + "=" + escape(value) + ";path=/;"; +} + +function clearCookie(name) { + document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"; +} + +function getCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) { + return unescape(c.substring(nameEQ.length,c.length)); + } + } + return null; +} + + + +var max_results = 75; // 50 is not enough to search for map in the base libraries +var shown_range = null; +var last_search = null; + +function quick_search() +{ + perform_search(false); +} + +function full_search() +{ + perform_search(true); +} + + +function perform_search(full) +{ + var text = document.getElementById("searchbox").value.toLowerCase(); + if (text == last_search && !full) return; + last_search = text; + + var table = document.getElementById("indexlist"); + var status = document.getElementById("searchmsg"); + var children = table.firstChild.childNodes; + + // first figure out the first node with the prefix + var first = bisect(-1); + var last = (first == -1 ? -1 : bisect(1)); + + if (first == -1) + { + table.className = ""; + status.innerHTML = "No results found, displaying all"; + } + else if (first == 0 && last == children.length - 1) + { + table.className = ""; + status.innerHTML = ""; + } + else if (last - first >= max_results && !full) + { + table.className = ""; + status.innerHTML = "More than " + max_results + ", press Search to display"; + } + else + { + // decide what you need to clear/show + if (shown_range) + setclass(shown_range[0], shown_range[1], "indexrow"); + setclass(first, last, "indexshow"); + shown_range = [first, last]; + table.className = "indexsearch"; + status.innerHTML = ""; + } + + + function setclass(first, last, status) + { + for (var i = first; i <= last; i++) + { + children[i].className = status; + } + } + + + // do a binary search, treating 0 as ... + // return either -1 (no 0's found) or location of most far match + function bisect(dir) + { + var first = 0, finish = children.length - 1; + var mid, success = false; + + while (finish - first > 3) + { + mid = Math.floor((finish + first) / 2); + + var i = checkitem(mid); + if (i == 0) i = dir; + if (i == -1) + finish = mid; + else + first = mid; + } + var a = (dir == 1 ? first : finish); + var b = (dir == 1 ? finish : first); + for (var i = b; i != a - dir; i -= dir) + { + if (checkitem(i) == 0) return i; + } + return -1; + } + + + // from an index, decide what the result is + // 0 = match, -1 is lower, 1 is higher + function checkitem(i) + { + var s = getitem(i).toLowerCase().substr(0, text.length); + if (s == text) return 0; + else return (s > text ? -1 : 1); + } + + + // from an index, get its string + // this abstracts over alternates + function getitem(i) + { + for ( ; i >= 0; i--) + { + var s = children[i].firstChild.firstChild.data; + if (s.indexOf(' ') == -1) + return s; + } + return ""; // should never be reached + } +} + +function setSynopsis(filename) { + if (parent.window.synopsis) { + if (parent.window.synopsis.location.replace) { + // In Firefox this avoids adding the change to the history. + parent.window.synopsis.location.replace(filename); + } else { + parent.window.synopsis.location = filename; + } + } +} + +function addMenuItem(html) { + var menu = document.getElementById("page-menu"); + if (menu) { + var btn = menu.firstChild.cloneNode(false); + btn.innerHTML = html; + menu.appendChild(btn); + } +} + +function adjustForFrames() { + var bodyCls; + + if (parent.location.href == window.location.href) { + // not in frames, so add Frames button + addMenuItem("Frames"); + bodyCls = "no-frame"; + } + else { + bodyCls = "in-frame"; + } + addClass(document.body, bodyCls); +} + +function reframe() { + setCookie("haddock-reframe", document.URL); + window.location = "frames.html"; +} + +function postReframe() { + var s = getCookie("haddock-reframe"); + if (s) { + parent.window.main.location = s; + clearCookie("haddock-reframe"); + } +} + +function styles() { + var i, a, es = document.getElementsByTagName("link"), rs = []; + for (i = 0; a = es[i]; i++) { + if(a.rel.indexOf("style") != -1 && a.title) { + rs.push(a); + } + } + return rs; +} + +function addStyleMenu() { + var as = styles(); + var i, a, btns = ""; + for(i=0; a = as[i]; i++) { + btns += "
  • " + + a.title + "
  • " + } + if (as.length > 1) { + var h = "
    " + + "Style ▾" + + "
      " + btns + "
    " + + "
    "; + addMenuItem(h); + } +} + +function setActiveStyleSheet(title) { + var as = styles(); + var i, a, found; + for(i=0; a = as[i]; i++) { + a.disabled = true; + // need to do this always, some browsers are edge triggered + if(a.title == title) { + found = a; + } + } + if (found) { + found.disabled = false; + setCookie("haddock-style", title); + } + else { + as[0].disabled = false; + clearCookie("haddock-style"); + } + styleMenu(false); +} + +function resetStyle() { + var s = getCookie("haddock-style"); + if (s) setActiveStyleSheet(s); +} + + +function styleMenu(show) { + var m = document.getElementById('style-menu'); + if (m) toggleShow(m, show); +} + + +function pageLoad() { + addStyleMenu(); + adjustForFrames(); + resetStyle(); + restoreCollapsed(); +} + diff --git a/resources/latex/haddock.sty b/resources/latex/haddock.sty new file mode 100644 index 00000000..6e031a98 --- /dev/null +++ b/resources/latex/haddock.sty @@ -0,0 +1,57 @@ +% Default Haddock style definitions. To use your own style, invoke +% Haddock with the option --latex-style=mystyle. + +\usepackage{tabulary} % see below + +% make hyperlinks in the PDF, and add an expandabale index +\usepackage[pdftex,bookmarks=true]{hyperref} + +\newenvironment{haddocktitle} + {\begin{center}\bgroup\large\bfseries} + {\egroup\end{center}} +\newenvironment{haddockprologue}{\vspace{1in}}{} + +\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} + +\newcommand{\haddockbeginheader}{\hrulefill} +\newcommand{\haddockendheader}{\noindent\hrulefill} + +% a little gap before the ``Methods'' header +\newcommand{\haddockpremethods}{\vspace{2ex}} + +% inserted before \\begin{verbatim} +\newcommand{\haddockverb}{\small} + +% an identifier: add an index entry +\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} + +% The tabulary environment lets us have a column that takes up ``the +% rest of the space''. Unfortunately it doesn't allow +% the \end{tabulary} to be in the expansion of a macro, it must appear +% literally in the document text, so Haddock inserts +% the \end{tabulary} itself. +\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} +\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} + +\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} +\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} + +\makeatletter +\newenvironment{haddockdesc} + {\list{}{\labelwidth\z@ \itemindent-\leftmargin + \let\makelabel\haddocklabel}} + {\endlist} +\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} +\makeatother + +% after a declaration, start a new line for the documentation. +% Otherwise, the documentation starts right after the declaration, +% because we're using the list environment and the declaration is the +% ``label''. I tried making this newline part of the label, but +% couldn't get that to work reliably (the space seemed to stretch +% sometimes). +\newcommand{\haddockbegindoc}{\hfill\\[1ex]} + +% spacing between paragraphs and no \parindent looks better +\parskip=10pt plus2pt minus2pt +\setlength{\parindent}{0cm} diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 28bf2f7e..759f7495 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -1,5 +1,6 @@ import Prelude hiding (mod) import Control.Monad +import Control.Applicative import Data.List import Data.Maybe import Distribution.InstalledPackageInfo @@ -19,8 +20,9 @@ import System.FilePath import System.Process (ProcessHandle, runProcess, waitForProcess) -packageRoot, haddockPath, testSuiteRoot, testDir, outDir :: FilePath +packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath packageRoot = "." +dataDir = packageRoot "resources" haddockPath = packageRoot "dist" "build" "haddock" "haddock" testSuiteRoot = packageRoot "tests" "html-tests" testDir = testSuiteRoot "tests" @@ -48,8 +50,8 @@ test = do let mods' = map (testDir ) mods - env_ <- getEnvironment - let env = Just (("haddock_datadir", packageRoot) : env_) + -- add haddock_datadir to environment for subprocesses + env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment putStrLn "" putStrLn "Haddock version: " -- cgit v1.2.3 From 958d64d77572c47d249965d7146ac17a23de806d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 10:34:28 +0200 Subject: Move HTML tests to directory /html-test/ --- .gitignore | 2 +- haddock.cabal | 6 +- html-test/README | 24 + html-test/accept.hs | 43 + html-test/runtests.hs | 152 ++ html-test/tests/A.hs | 17 + html-test/tests/A.html.ref | 183 ++ html-test/tests/AdvanceTypes.hs | 9 + html-test/tests/AdvanceTypes.html.ref | 97 + html-test/tests/B.hs | 8 + html-test/tests/B.html.ref | 175 ++ html-test/tests/Bug1.hs | 6 + html-test/tests/Bug1.html.ref | 103 + html-test/tests/Bug2.hs | 4 + html-test/tests/Bug2.html.ref | 65 + html-test/tests/Bug3.hs | 6 + html-test/tests/Bug3.html.ref | 83 + html-test/tests/Bug4.hs | 5 + html-test/tests/Bug4.html.ref | 82 + html-test/tests/Bug6.hs | 23 + html-test/tests/Bug6.html.ref | 335 +++ html-test/tests/Bug7.hs | 12 + html-test/tests/Bug7.html.ref | 173 ++ html-test/tests/Bug8.hs | 14 + html-test/tests/Bug8.html.ref | 131 ++ html-test/tests/BugDeprecated.hs | 18 + html-test/tests/BugDeprecated.html.ref | 198 ++ html-test/tests/BugExportHeadings.hs | 29 + html-test/tests/BugExportHeadings.html.ref | 220 ++ html-test/tests/Bugs.hs | 3 + html-test/tests/Bugs.html.ref | 81 + html-test/tests/CrossPackageDocs.hs | 4 + html-test/tests/CrossPackageDocs.html.ref | 298 +++ html-test/tests/DeprecatedClass.hs | 15 + html-test/tests/DeprecatedClass.html.ref | 161 ++ html-test/tests/DeprecatedData.hs | 15 + html-test/tests/DeprecatedData.html.ref | 198 ++ html-test/tests/DeprecatedFunction.hs | 10 + html-test/tests/DeprecatedFunction.html.ref | 110 + html-test/tests/DeprecatedFunction2.hs | 6 + html-test/tests/DeprecatedFunction2.html.ref | 84 + html-test/tests/DeprecatedFunction3.hs | 6 + html-test/tests/DeprecatedFunction3.html.ref | 84 + html-test/tests/DeprecatedModule.hs | 5 + html-test/tests/DeprecatedModule.html.ref | 83 + html-test/tests/DeprecatedModule2.hs | 4 + html-test/tests/DeprecatedModule2.html.ref | 76 + html-test/tests/DeprecatedNewtype.hs | 10 + html-test/tests/DeprecatedNewtype.html.ref | 161 ++ html-test/tests/DeprecatedReExport.hs | 16 + html-test/tests/DeprecatedReExport.html.ref | 133 ++ html-test/tests/DeprecatedRecord.hs | 9 + html-test/tests/DeprecatedRecord.html.ref | 151 ++ html-test/tests/DeprecatedTypeFamily.hs | 9 + html-test/tests/DeprecatedTypeFamily.html.ref | 108 + html-test/tests/DeprecatedTypeSynonym.hs | 9 + html-test/tests/DeprecatedTypeSynonym.html.ref | 116 + html-test/tests/DeprecationMessageParseError.hs | 12 + .../tests/DeprecationMessageParseError.html.ref | 101 + html-test/tests/Examples.hs | 39 + html-test/tests/Examples.html.ref | 179 ++ html-test/tests/FunArgs.hs | 16 + html-test/tests/FunArgs.html.ref | 176 ++ html-test/tests/GADTRecords.hs | 12 + html-test/tests/GADTRecords.html.ref | 234 ++ html-test/tests/Hash.hs | 51 + html-test/tests/Hash.html.ref | 337 +++ html-test/tests/Hidden.hs | 6 + html-test/tests/HiddenInstances.hs | 35 + html-test/tests/HiddenInstances.html.ref | 169 ++ html-test/tests/HiddenInstancesA.hs | 17 + html-test/tests/HiddenInstancesB.hs | 2 + html-test/tests/HiddenInstancesB.html.ref | 143 ++ html-test/tests/Hyperlinks.hs | 8 + html-test/tests/Hyperlinks.html.ref | 89 + html-test/tests/IgnoreExports.hs | 10 + html-test/tests/IgnoreExports.html.ref | 101 + html-test/tests/ModuleWithWarning.hs | 5 + html-test/tests/ModuleWithWarning.html.ref | 83 + html-test/tests/NamedDoc.hs | 4 + html-test/tests/NamedDoc.html.ref | 68 + html-test/tests/NoLayout.hs | 12 + html-test/tests/NoLayout.html.ref | 86 + html-test/tests/NonGreedy.hs | 5 + html-test/tests/NonGreedy.html.ref | 82 + html-test/tests/Properties.hs | 9 + html-test/tests/Properties.html.ref | 92 + html-test/tests/PruneWithWarning.hs | 15 + html-test/tests/PruneWithWarning.html.ref | 72 + html-test/tests/QuasiExpr.hs | 34 + html-test/tests/QuasiExpr.html.ref | 221 ++ html-test/tests/QuasiQuote.hs | 9 + html-test/tests/QuasiQuote.html.ref | 65 + html-test/tests/TH.hs | 8 + html-test/tests/TH.html.ref | 63 + html-test/tests/TH2.hs | 7 + html-test/tests/TH2.html.ref | 63 + html-test/tests/Test.hs | 422 ++++ html-test/tests/Test.html.ref | 2245 ++++++++++++++++++++ html-test/tests/Ticket112.hs | 9 + html-test/tests/Ticket112.html.ref | 82 + html-test/tests/Ticket61.hs | 3 + html-test/tests/Ticket61.html.ref | 80 + html-test/tests/Ticket61_Hidden.hs | 7 + html-test/tests/Ticket75.hs | 7 + html-test/tests/Ticket75.html.ref | 116 + html-test/tests/TypeFamilies.hs | 28 + html-test/tests/TypeFamilies.html.ref | 212 ++ html-test/tests/TypeOperators.hs | 20 + html-test/tests/TypeOperators.html.ref | 185 ++ html-test/tests/Unicode.hs.disabled | 6 + html-test/tests/Unicode.html.ref | 82 + html-test/tests/Visible.hs | 3 + html-test/tests/Visible.html.ref | 67 + html-test/tests/frames.html.ref | 30 + html-test/tests/mini_A.html.ref | 59 + html-test/tests/mini_AdvanceTypes.html.ref | 33 + html-test/tests/mini_B.html.ref | 45 + html-test/tests/mini_Bug1.html.ref | 33 + html-test/tests/mini_Bug2.html.ref | 31 + html-test/tests/mini_Bug3.html.ref | 31 + html-test/tests/mini_Bug4.html.ref | 31 + html-test/tests/mini_Bug6.html.ref | 65 + html-test/tests/mini_Bug7.html.ref | 41 + html-test/tests/mini_Bug8.html.ref | 63 + html-test/tests/mini_BugDeprecated.html.ref | 61 + html-test/tests/mini_BugExportHeadings.html.ref | 79 + html-test/tests/mini_Bugs.html.ref | 33 + html-test/tests/mini_CrossPackageDocs.html.ref | 45 + html-test/tests/mini_DeprecatedClass.html.ref | 41 + html-test/tests/mini_DeprecatedData.html.ref | 41 + html-test/tests/mini_DeprecatedFunction.html.ref | 37 + html-test/tests/mini_DeprecatedFunction2.html.ref | 31 + html-test/tests/mini_DeprecatedFunction3.html.ref | 31 + html-test/tests/mini_DeprecatedModule.html.ref | 31 + html-test/tests/mini_DeprecatedModule2.html.ref | 31 + html-test/tests/mini_DeprecatedNewtype.html.ref | 41 + html-test/tests/mini_DeprecatedReExport.html.ref | 37 + html-test/tests/mini_DeprecatedRecord.html.ref | 33 + html-test/tests/mini_DeprecatedTypeFamily.html.ref | 41 + .../tests/mini_DeprecatedTypeSynonym.html.ref | 41 + .../mini_DeprecationMessageParseError.html.ref | 31 + html-test/tests/mini_Examples.html.ref | 31 + html-test/tests/mini_FunArgs.html.ref | 37 + html-test/tests/mini_GADTRecords.html.ref | 33 + html-test/tests/mini_Hash.html.ref | 74 + html-test/tests/mini_HiddenInstances.html.ref | 41 + html-test/tests/mini_HiddenInstancesB.html.ref | 41 + html-test/tests/mini_Hyperlinks.html.ref | 31 + html-test/tests/mini_IgnoreExports.html.ref | 37 + html-test/tests/mini_ModuleWithWarning.html.ref | 31 + html-test/tests/mini_NamedDoc.html.ref | 25 + html-test/tests/mini_NoLayout.html.ref | 31 + html-test/tests/mini_NonGreedy.html.ref | 31 + html-test/tests/mini_Properties.html.ref | 31 + html-test/tests/mini_PruneWithWarning.html.ref | 25 + html-test/tests/mini_QuasiExpr.html.ref | 59 + html-test/tests/mini_QuasiQuote.html.ref | 31 + html-test/tests/mini_TH.html.ref | 31 + html-test/tests/mini_TH2.html.ref | 31 + html-test/tests/mini_Test.html.ref | 269 +++ html-test/tests/mini_Ticket112.html.ref | 31 + html-test/tests/mini_Ticket61.html.ref | 33 + html-test/tests/mini_Ticket75.html.ref | 39 + html-test/tests/mini_TypeFamilies.html.ref | 55 + html-test/tests/mini_TypeOperators.html.ref | 66 + html-test/tests/mini_Unicode.html.ref | 31 + html-test/tests/mini_Visible.html.ref | 31 + tests/html-tests/README | 24 - tests/html-tests/accept.hs | 43 - tests/html-tests/runtests.hs | 152 -- tests/html-tests/tests/A.hs | 17 - tests/html-tests/tests/A.html.ref | 183 -- tests/html-tests/tests/AdvanceTypes.hs | 9 - tests/html-tests/tests/AdvanceTypes.html.ref | 97 - tests/html-tests/tests/B.hs | 8 - tests/html-tests/tests/B.html.ref | 175 -- tests/html-tests/tests/Bug1.hs | 6 - tests/html-tests/tests/Bug1.html.ref | 103 - tests/html-tests/tests/Bug2.hs | 4 - tests/html-tests/tests/Bug2.html.ref | 65 - tests/html-tests/tests/Bug3.hs | 6 - tests/html-tests/tests/Bug3.html.ref | 83 - tests/html-tests/tests/Bug4.hs | 5 - tests/html-tests/tests/Bug4.html.ref | 82 - tests/html-tests/tests/Bug6.hs | 23 - tests/html-tests/tests/Bug6.html.ref | 335 --- tests/html-tests/tests/Bug7.hs | 12 - tests/html-tests/tests/Bug7.html.ref | 173 -- tests/html-tests/tests/Bug8.hs | 14 - tests/html-tests/tests/Bug8.html.ref | 131 -- tests/html-tests/tests/BugDeprecated.hs | 18 - tests/html-tests/tests/BugDeprecated.html.ref | 198 -- tests/html-tests/tests/BugExportHeadings.hs | 29 - tests/html-tests/tests/BugExportHeadings.html.ref | 220 -- tests/html-tests/tests/Bugs.hs | 3 - tests/html-tests/tests/Bugs.html.ref | 81 - tests/html-tests/tests/CrossPackageDocs.hs | 4 - tests/html-tests/tests/CrossPackageDocs.html.ref | 298 --- tests/html-tests/tests/DeprecatedClass.hs | 15 - tests/html-tests/tests/DeprecatedClass.html.ref | 161 -- tests/html-tests/tests/DeprecatedData.hs | 15 - tests/html-tests/tests/DeprecatedData.html.ref | 198 -- tests/html-tests/tests/DeprecatedFunction.hs | 10 - tests/html-tests/tests/DeprecatedFunction.html.ref | 110 - tests/html-tests/tests/DeprecatedFunction2.hs | 6 - .../html-tests/tests/DeprecatedFunction2.html.ref | 84 - tests/html-tests/tests/DeprecatedFunction3.hs | 6 - .../html-tests/tests/DeprecatedFunction3.html.ref | 84 - tests/html-tests/tests/DeprecatedModule.hs | 5 - tests/html-tests/tests/DeprecatedModule.html.ref | 83 - tests/html-tests/tests/DeprecatedModule2.hs | 4 - tests/html-tests/tests/DeprecatedModule2.html.ref | 76 - tests/html-tests/tests/DeprecatedNewtype.hs | 10 - tests/html-tests/tests/DeprecatedNewtype.html.ref | 161 -- tests/html-tests/tests/DeprecatedReExport.hs | 16 - tests/html-tests/tests/DeprecatedReExport.html.ref | 133 -- tests/html-tests/tests/DeprecatedRecord.hs | 9 - tests/html-tests/tests/DeprecatedRecord.html.ref | 151 -- tests/html-tests/tests/DeprecatedTypeFamily.hs | 9 - .../html-tests/tests/DeprecatedTypeFamily.html.ref | 108 - tests/html-tests/tests/DeprecatedTypeSynonym.hs | 9 - .../tests/DeprecatedTypeSynonym.html.ref | 116 - .../tests/DeprecationMessageParseError.hs | 12 - .../tests/DeprecationMessageParseError.html.ref | 101 - tests/html-tests/tests/Examples.hs | 39 - tests/html-tests/tests/Examples.html.ref | 179 -- tests/html-tests/tests/FunArgs.hs | 16 - tests/html-tests/tests/FunArgs.html.ref | 176 -- tests/html-tests/tests/GADTRecords.hs | 12 - tests/html-tests/tests/GADTRecords.html.ref | 234 -- tests/html-tests/tests/Hash.hs | 51 - tests/html-tests/tests/Hash.html.ref | 337 --- tests/html-tests/tests/Hidden.hs | 6 - tests/html-tests/tests/HiddenInstances.hs | 35 - tests/html-tests/tests/HiddenInstances.html.ref | 169 -- tests/html-tests/tests/HiddenInstancesA.hs | 17 - tests/html-tests/tests/HiddenInstancesB.hs | 2 - tests/html-tests/tests/HiddenInstancesB.html.ref | 143 -- tests/html-tests/tests/Hyperlinks.hs | 8 - tests/html-tests/tests/Hyperlinks.html.ref | 89 - tests/html-tests/tests/IgnoreExports.hs | 10 - tests/html-tests/tests/IgnoreExports.html.ref | 101 - tests/html-tests/tests/ModuleWithWarning.hs | 5 - tests/html-tests/tests/ModuleWithWarning.html.ref | 83 - tests/html-tests/tests/NamedDoc.hs | 4 - tests/html-tests/tests/NamedDoc.html.ref | 68 - tests/html-tests/tests/NoLayout.hs | 12 - tests/html-tests/tests/NoLayout.html.ref | 86 - tests/html-tests/tests/NonGreedy.hs | 5 - tests/html-tests/tests/NonGreedy.html.ref | 82 - tests/html-tests/tests/Properties.hs | 9 - tests/html-tests/tests/Properties.html.ref | 92 - tests/html-tests/tests/PruneWithWarning.hs | 15 - tests/html-tests/tests/PruneWithWarning.html.ref | 72 - tests/html-tests/tests/QuasiExpr.hs | 34 - tests/html-tests/tests/QuasiExpr.html.ref | 221 -- tests/html-tests/tests/QuasiQuote.hs | 9 - tests/html-tests/tests/QuasiQuote.html.ref | 65 - tests/html-tests/tests/TH.hs | 8 - tests/html-tests/tests/TH.html.ref | 63 - tests/html-tests/tests/TH2.hs | 7 - tests/html-tests/tests/TH2.html.ref | 63 - tests/html-tests/tests/Test.hs | 422 ---- tests/html-tests/tests/Test.html.ref | 2245 -------------------- tests/html-tests/tests/Ticket112.hs | 9 - tests/html-tests/tests/Ticket112.html.ref | 82 - tests/html-tests/tests/Ticket61.hs | 3 - tests/html-tests/tests/Ticket61.html.ref | 80 - tests/html-tests/tests/Ticket61_Hidden.hs | 7 - tests/html-tests/tests/Ticket75.hs | 7 - tests/html-tests/tests/Ticket75.html.ref | 116 - tests/html-tests/tests/TypeFamilies.hs | 28 - tests/html-tests/tests/TypeFamilies.html.ref | 212 -- tests/html-tests/tests/TypeOperators.hs | 20 - tests/html-tests/tests/TypeOperators.html.ref | 185 -- tests/html-tests/tests/Unicode.hs.disabled | 6 - tests/html-tests/tests/Unicode.html.ref | 82 - tests/html-tests/tests/Visible.hs | 3 - tests/html-tests/tests/Visible.html.ref | 67 - tests/html-tests/tests/frames.html.ref | 30 - tests/html-tests/tests/mini_A.html.ref | 59 - tests/html-tests/tests/mini_AdvanceTypes.html.ref | 33 - tests/html-tests/tests/mini_B.html.ref | 45 - tests/html-tests/tests/mini_Bug1.html.ref | 33 - tests/html-tests/tests/mini_Bug2.html.ref | 31 - tests/html-tests/tests/mini_Bug3.html.ref | 31 - tests/html-tests/tests/mini_Bug4.html.ref | 31 - tests/html-tests/tests/mini_Bug6.html.ref | 65 - tests/html-tests/tests/mini_Bug7.html.ref | 41 - tests/html-tests/tests/mini_Bug8.html.ref | 63 - tests/html-tests/tests/mini_BugDeprecated.html.ref | 61 - .../tests/mini_BugExportHeadings.html.ref | 79 - tests/html-tests/tests/mini_Bugs.html.ref | 33 - .../tests/mini_CrossPackageDocs.html.ref | 45 - .../html-tests/tests/mini_DeprecatedClass.html.ref | 41 - .../html-tests/tests/mini_DeprecatedData.html.ref | 41 - .../tests/mini_DeprecatedFunction.html.ref | 37 - .../tests/mini_DeprecatedFunction2.html.ref | 31 - .../tests/mini_DeprecatedFunction3.html.ref | 31 - .../tests/mini_DeprecatedModule.html.ref | 31 - .../tests/mini_DeprecatedModule2.html.ref | 31 - .../tests/mini_DeprecatedNewtype.html.ref | 41 - .../tests/mini_DeprecatedReExport.html.ref | 37 - .../tests/mini_DeprecatedRecord.html.ref | 33 - .../tests/mini_DeprecatedTypeFamily.html.ref | 41 - .../tests/mini_DeprecatedTypeSynonym.html.ref | 41 - .../mini_DeprecationMessageParseError.html.ref | 31 - tests/html-tests/tests/mini_Examples.html.ref | 31 - tests/html-tests/tests/mini_FunArgs.html.ref | 37 - tests/html-tests/tests/mini_GADTRecords.html.ref | 33 - tests/html-tests/tests/mini_Hash.html.ref | 74 - .../html-tests/tests/mini_HiddenInstances.html.ref | 41 - .../tests/mini_HiddenInstancesB.html.ref | 41 - tests/html-tests/tests/mini_Hyperlinks.html.ref | 31 - tests/html-tests/tests/mini_IgnoreExports.html.ref | 37 - .../tests/mini_ModuleWithWarning.html.ref | 31 - tests/html-tests/tests/mini_NamedDoc.html.ref | 25 - tests/html-tests/tests/mini_NoLayout.html.ref | 31 - tests/html-tests/tests/mini_NonGreedy.html.ref | 31 - tests/html-tests/tests/mini_Properties.html.ref | 31 - .../tests/mini_PruneWithWarning.html.ref | 25 - tests/html-tests/tests/mini_QuasiExpr.html.ref | 59 - tests/html-tests/tests/mini_QuasiQuote.html.ref | 31 - tests/html-tests/tests/mini_TH.html.ref | 31 - tests/html-tests/tests/mini_TH2.html.ref | 31 - tests/html-tests/tests/mini_Test.html.ref | 269 --- tests/html-tests/tests/mini_Ticket112.html.ref | 31 - tests/html-tests/tests/mini_Ticket61.html.ref | 33 - tests/html-tests/tests/mini_Ticket75.html.ref | 39 - tests/html-tests/tests/mini_TypeFamilies.html.ref | 55 - tests/html-tests/tests/mini_TypeOperators.html.ref | 66 - tests/html-tests/tests/mini_Unicode.html.ref | 31 - tests/html-tests/tests/mini_Visible.html.ref | 31 - 334 files changed, 12851 insertions(+), 12851 deletions(-) create mode 100644 html-test/README create mode 100644 html-test/accept.hs create mode 100644 html-test/runtests.hs create mode 100644 html-test/tests/A.hs create mode 100644 html-test/tests/A.html.ref create mode 100644 html-test/tests/AdvanceTypes.hs create mode 100644 html-test/tests/AdvanceTypes.html.ref create mode 100644 html-test/tests/B.hs create mode 100644 html-test/tests/B.html.ref create mode 100644 html-test/tests/Bug1.hs create mode 100644 html-test/tests/Bug1.html.ref create mode 100644 html-test/tests/Bug2.hs create mode 100644 html-test/tests/Bug2.html.ref create mode 100644 html-test/tests/Bug3.hs create mode 100644 html-test/tests/Bug3.html.ref create mode 100644 html-test/tests/Bug4.hs create mode 100644 html-test/tests/Bug4.html.ref create mode 100644 html-test/tests/Bug6.hs create mode 100644 html-test/tests/Bug6.html.ref create mode 100644 html-test/tests/Bug7.hs create mode 100644 html-test/tests/Bug7.html.ref create mode 100644 html-test/tests/Bug8.hs create mode 100644 html-test/tests/Bug8.html.ref create mode 100644 html-test/tests/BugDeprecated.hs create mode 100644 html-test/tests/BugDeprecated.html.ref create mode 100644 html-test/tests/BugExportHeadings.hs create mode 100644 html-test/tests/BugExportHeadings.html.ref create mode 100644 html-test/tests/Bugs.hs create mode 100644 html-test/tests/Bugs.html.ref create mode 100644 html-test/tests/CrossPackageDocs.hs create mode 100644 html-test/tests/CrossPackageDocs.html.ref create mode 100644 html-test/tests/DeprecatedClass.hs create mode 100644 html-test/tests/DeprecatedClass.html.ref create mode 100644 html-test/tests/DeprecatedData.hs create mode 100644 html-test/tests/DeprecatedData.html.ref create mode 100644 html-test/tests/DeprecatedFunction.hs create mode 100644 html-test/tests/DeprecatedFunction.html.ref create mode 100644 html-test/tests/DeprecatedFunction2.hs create mode 100644 html-test/tests/DeprecatedFunction2.html.ref create mode 100644 html-test/tests/DeprecatedFunction3.hs create mode 100644 html-test/tests/DeprecatedFunction3.html.ref create mode 100644 html-test/tests/DeprecatedModule.hs create mode 100644 html-test/tests/DeprecatedModule.html.ref create mode 100644 html-test/tests/DeprecatedModule2.hs create mode 100644 html-test/tests/DeprecatedModule2.html.ref create mode 100644 html-test/tests/DeprecatedNewtype.hs create mode 100644 html-test/tests/DeprecatedNewtype.html.ref create mode 100644 html-test/tests/DeprecatedReExport.hs create mode 100644 html-test/tests/DeprecatedReExport.html.ref create mode 100644 html-test/tests/DeprecatedRecord.hs create mode 100644 html-test/tests/DeprecatedRecord.html.ref create mode 100644 html-test/tests/DeprecatedTypeFamily.hs create mode 100644 html-test/tests/DeprecatedTypeFamily.html.ref create mode 100644 html-test/tests/DeprecatedTypeSynonym.hs create mode 100644 html-test/tests/DeprecatedTypeSynonym.html.ref create mode 100644 html-test/tests/DeprecationMessageParseError.hs create mode 100644 html-test/tests/DeprecationMessageParseError.html.ref create mode 100644 html-test/tests/Examples.hs create mode 100644 html-test/tests/Examples.html.ref create mode 100644 html-test/tests/FunArgs.hs create mode 100644 html-test/tests/FunArgs.html.ref create mode 100644 html-test/tests/GADTRecords.hs create mode 100644 html-test/tests/GADTRecords.html.ref create mode 100644 html-test/tests/Hash.hs create mode 100644 html-test/tests/Hash.html.ref create mode 100644 html-test/tests/Hidden.hs create mode 100644 html-test/tests/HiddenInstances.hs create mode 100644 html-test/tests/HiddenInstances.html.ref create mode 100644 html-test/tests/HiddenInstancesA.hs create mode 100644 html-test/tests/HiddenInstancesB.hs create mode 100644 html-test/tests/HiddenInstancesB.html.ref create mode 100644 html-test/tests/Hyperlinks.hs create mode 100644 html-test/tests/Hyperlinks.html.ref create mode 100644 html-test/tests/IgnoreExports.hs create mode 100644 html-test/tests/IgnoreExports.html.ref create mode 100644 html-test/tests/ModuleWithWarning.hs create mode 100644 html-test/tests/ModuleWithWarning.html.ref create mode 100644 html-test/tests/NamedDoc.hs create mode 100644 html-test/tests/NamedDoc.html.ref create mode 100644 html-test/tests/NoLayout.hs create mode 100644 html-test/tests/NoLayout.html.ref create mode 100644 html-test/tests/NonGreedy.hs create mode 100644 html-test/tests/NonGreedy.html.ref create mode 100644 html-test/tests/Properties.hs create mode 100644 html-test/tests/Properties.html.ref create mode 100644 html-test/tests/PruneWithWarning.hs create mode 100644 html-test/tests/PruneWithWarning.html.ref create mode 100644 html-test/tests/QuasiExpr.hs create mode 100644 html-test/tests/QuasiExpr.html.ref create mode 100644 html-test/tests/QuasiQuote.hs create mode 100644 html-test/tests/QuasiQuote.html.ref create mode 100644 html-test/tests/TH.hs create mode 100644 html-test/tests/TH.html.ref create mode 100644 html-test/tests/TH2.hs create mode 100644 html-test/tests/TH2.html.ref create mode 100644 html-test/tests/Test.hs create mode 100644 html-test/tests/Test.html.ref create mode 100644 html-test/tests/Ticket112.hs create mode 100644 html-test/tests/Ticket112.html.ref create mode 100644 html-test/tests/Ticket61.hs create mode 100644 html-test/tests/Ticket61.html.ref create mode 100644 html-test/tests/Ticket61_Hidden.hs create mode 100644 html-test/tests/Ticket75.hs create mode 100644 html-test/tests/Ticket75.html.ref create mode 100644 html-test/tests/TypeFamilies.hs create mode 100644 html-test/tests/TypeFamilies.html.ref create mode 100644 html-test/tests/TypeOperators.hs create mode 100644 html-test/tests/TypeOperators.html.ref create mode 100644 html-test/tests/Unicode.hs.disabled create mode 100644 html-test/tests/Unicode.html.ref create mode 100644 html-test/tests/Visible.hs create mode 100644 html-test/tests/Visible.html.ref create mode 100644 html-test/tests/frames.html.ref create mode 100644 html-test/tests/mini_A.html.ref create mode 100644 html-test/tests/mini_AdvanceTypes.html.ref create mode 100644 html-test/tests/mini_B.html.ref create mode 100644 html-test/tests/mini_Bug1.html.ref create mode 100644 html-test/tests/mini_Bug2.html.ref create mode 100644 html-test/tests/mini_Bug3.html.ref create mode 100644 html-test/tests/mini_Bug4.html.ref create mode 100644 html-test/tests/mini_Bug6.html.ref create mode 100644 html-test/tests/mini_Bug7.html.ref create mode 100644 html-test/tests/mini_Bug8.html.ref create mode 100644 html-test/tests/mini_BugDeprecated.html.ref create mode 100644 html-test/tests/mini_BugExportHeadings.html.ref create mode 100644 html-test/tests/mini_Bugs.html.ref create mode 100644 html-test/tests/mini_CrossPackageDocs.html.ref create mode 100644 html-test/tests/mini_DeprecatedClass.html.ref create mode 100644 html-test/tests/mini_DeprecatedData.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction2.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction3.html.ref create mode 100644 html-test/tests/mini_DeprecatedModule.html.ref create mode 100644 html-test/tests/mini_DeprecatedModule2.html.ref create mode 100644 html-test/tests/mini_DeprecatedNewtype.html.ref create mode 100644 html-test/tests/mini_DeprecatedReExport.html.ref create mode 100644 html-test/tests/mini_DeprecatedRecord.html.ref create mode 100644 html-test/tests/mini_DeprecatedTypeFamily.html.ref create mode 100644 html-test/tests/mini_DeprecatedTypeSynonym.html.ref create mode 100644 html-test/tests/mini_DeprecationMessageParseError.html.ref create mode 100644 html-test/tests/mini_Examples.html.ref create mode 100644 html-test/tests/mini_FunArgs.html.ref create mode 100644 html-test/tests/mini_GADTRecords.html.ref create mode 100644 html-test/tests/mini_Hash.html.ref create mode 100644 html-test/tests/mini_HiddenInstances.html.ref create mode 100644 html-test/tests/mini_HiddenInstancesB.html.ref create mode 100644 html-test/tests/mini_Hyperlinks.html.ref create mode 100644 html-test/tests/mini_IgnoreExports.html.ref create mode 100644 html-test/tests/mini_ModuleWithWarning.html.ref create mode 100644 html-test/tests/mini_NamedDoc.html.ref create mode 100644 html-test/tests/mini_NoLayout.html.ref create mode 100644 html-test/tests/mini_NonGreedy.html.ref create mode 100644 html-test/tests/mini_Properties.html.ref create mode 100644 html-test/tests/mini_PruneWithWarning.html.ref create mode 100644 html-test/tests/mini_QuasiExpr.html.ref create mode 100644 html-test/tests/mini_QuasiQuote.html.ref create mode 100644 html-test/tests/mini_TH.html.ref create mode 100644 html-test/tests/mini_TH2.html.ref create mode 100644 html-test/tests/mini_Test.html.ref create mode 100644 html-test/tests/mini_Ticket112.html.ref create mode 100644 html-test/tests/mini_Ticket61.html.ref create mode 100644 html-test/tests/mini_Ticket75.html.ref create mode 100644 html-test/tests/mini_TypeFamilies.html.ref create mode 100644 html-test/tests/mini_TypeOperators.html.ref create mode 100644 html-test/tests/mini_Unicode.html.ref create mode 100644 html-test/tests/mini_Visible.html.ref delete mode 100644 tests/html-tests/README delete mode 100644 tests/html-tests/accept.hs delete mode 100644 tests/html-tests/runtests.hs delete mode 100644 tests/html-tests/tests/A.hs delete mode 100644 tests/html-tests/tests/A.html.ref delete mode 100644 tests/html-tests/tests/AdvanceTypes.hs delete mode 100644 tests/html-tests/tests/AdvanceTypes.html.ref delete mode 100644 tests/html-tests/tests/B.hs delete mode 100644 tests/html-tests/tests/B.html.ref delete mode 100644 tests/html-tests/tests/Bug1.hs delete mode 100644 tests/html-tests/tests/Bug1.html.ref delete mode 100644 tests/html-tests/tests/Bug2.hs delete mode 100644 tests/html-tests/tests/Bug2.html.ref delete mode 100644 tests/html-tests/tests/Bug3.hs delete mode 100644 tests/html-tests/tests/Bug3.html.ref delete mode 100644 tests/html-tests/tests/Bug4.hs delete mode 100644 tests/html-tests/tests/Bug4.html.ref delete mode 100644 tests/html-tests/tests/Bug6.hs delete mode 100644 tests/html-tests/tests/Bug6.html.ref delete mode 100644 tests/html-tests/tests/Bug7.hs delete mode 100644 tests/html-tests/tests/Bug7.html.ref delete mode 100644 tests/html-tests/tests/Bug8.hs delete mode 100644 tests/html-tests/tests/Bug8.html.ref delete mode 100644 tests/html-tests/tests/BugDeprecated.hs delete mode 100644 tests/html-tests/tests/BugDeprecated.html.ref delete mode 100644 tests/html-tests/tests/BugExportHeadings.hs delete mode 100644 tests/html-tests/tests/BugExportHeadings.html.ref delete mode 100644 tests/html-tests/tests/Bugs.hs delete mode 100644 tests/html-tests/tests/Bugs.html.ref delete mode 100644 tests/html-tests/tests/CrossPackageDocs.hs delete mode 100644 tests/html-tests/tests/CrossPackageDocs.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedClass.hs delete mode 100644 tests/html-tests/tests/DeprecatedClass.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedData.hs delete mode 100644 tests/html-tests/tests/DeprecatedData.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedFunction.hs delete mode 100644 tests/html-tests/tests/DeprecatedFunction.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedFunction2.hs delete mode 100644 tests/html-tests/tests/DeprecatedFunction2.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedFunction3.hs delete mode 100644 tests/html-tests/tests/DeprecatedFunction3.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedModule.hs delete mode 100644 tests/html-tests/tests/DeprecatedModule.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedModule2.hs delete mode 100644 tests/html-tests/tests/DeprecatedModule2.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedNewtype.hs delete mode 100644 tests/html-tests/tests/DeprecatedNewtype.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedReExport.hs delete mode 100644 tests/html-tests/tests/DeprecatedReExport.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedRecord.hs delete mode 100644 tests/html-tests/tests/DeprecatedRecord.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedTypeFamily.hs delete mode 100644 tests/html-tests/tests/DeprecatedTypeFamily.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedTypeSynonym.hs delete mode 100644 tests/html-tests/tests/DeprecatedTypeSynonym.html.ref delete mode 100644 tests/html-tests/tests/DeprecationMessageParseError.hs delete mode 100644 tests/html-tests/tests/DeprecationMessageParseError.html.ref delete mode 100644 tests/html-tests/tests/Examples.hs delete mode 100644 tests/html-tests/tests/Examples.html.ref delete mode 100644 tests/html-tests/tests/FunArgs.hs delete mode 100644 tests/html-tests/tests/FunArgs.html.ref delete mode 100644 tests/html-tests/tests/GADTRecords.hs delete mode 100644 tests/html-tests/tests/GADTRecords.html.ref delete mode 100644 tests/html-tests/tests/Hash.hs delete mode 100644 tests/html-tests/tests/Hash.html.ref delete mode 100644 tests/html-tests/tests/Hidden.hs delete mode 100644 tests/html-tests/tests/HiddenInstances.hs delete mode 100644 tests/html-tests/tests/HiddenInstances.html.ref delete mode 100644 tests/html-tests/tests/HiddenInstancesA.hs delete mode 100644 tests/html-tests/tests/HiddenInstancesB.hs delete mode 100644 tests/html-tests/tests/HiddenInstancesB.html.ref delete mode 100644 tests/html-tests/tests/Hyperlinks.hs delete mode 100644 tests/html-tests/tests/Hyperlinks.html.ref delete mode 100644 tests/html-tests/tests/IgnoreExports.hs delete mode 100644 tests/html-tests/tests/IgnoreExports.html.ref delete mode 100644 tests/html-tests/tests/ModuleWithWarning.hs delete mode 100644 tests/html-tests/tests/ModuleWithWarning.html.ref delete mode 100644 tests/html-tests/tests/NamedDoc.hs delete mode 100644 tests/html-tests/tests/NamedDoc.html.ref delete mode 100644 tests/html-tests/tests/NoLayout.hs delete mode 100644 tests/html-tests/tests/NoLayout.html.ref delete mode 100644 tests/html-tests/tests/NonGreedy.hs delete mode 100644 tests/html-tests/tests/NonGreedy.html.ref delete mode 100644 tests/html-tests/tests/Properties.hs delete mode 100644 tests/html-tests/tests/Properties.html.ref delete mode 100644 tests/html-tests/tests/PruneWithWarning.hs delete mode 100644 tests/html-tests/tests/PruneWithWarning.html.ref delete mode 100644 tests/html-tests/tests/QuasiExpr.hs delete mode 100644 tests/html-tests/tests/QuasiExpr.html.ref delete mode 100644 tests/html-tests/tests/QuasiQuote.hs delete mode 100644 tests/html-tests/tests/QuasiQuote.html.ref delete mode 100644 tests/html-tests/tests/TH.hs delete mode 100644 tests/html-tests/tests/TH.html.ref delete mode 100644 tests/html-tests/tests/TH2.hs delete mode 100644 tests/html-tests/tests/TH2.html.ref delete mode 100644 tests/html-tests/tests/Test.hs delete mode 100644 tests/html-tests/tests/Test.html.ref delete mode 100644 tests/html-tests/tests/Ticket112.hs delete mode 100644 tests/html-tests/tests/Ticket112.html.ref delete mode 100644 tests/html-tests/tests/Ticket61.hs delete mode 100644 tests/html-tests/tests/Ticket61.html.ref delete mode 100644 tests/html-tests/tests/Ticket61_Hidden.hs delete mode 100644 tests/html-tests/tests/Ticket75.hs delete mode 100644 tests/html-tests/tests/Ticket75.html.ref delete mode 100644 tests/html-tests/tests/TypeFamilies.hs delete mode 100644 tests/html-tests/tests/TypeFamilies.html.ref delete mode 100644 tests/html-tests/tests/TypeOperators.hs delete mode 100644 tests/html-tests/tests/TypeOperators.html.ref delete mode 100644 tests/html-tests/tests/Unicode.hs.disabled delete mode 100644 tests/html-tests/tests/Unicode.html.ref delete mode 100644 tests/html-tests/tests/Visible.hs delete mode 100644 tests/html-tests/tests/Visible.html.ref delete mode 100644 tests/html-tests/tests/frames.html.ref delete mode 100644 tests/html-tests/tests/mini_A.html.ref delete mode 100644 tests/html-tests/tests/mini_AdvanceTypes.html.ref delete mode 100644 tests/html-tests/tests/mini_B.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug1.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug2.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug3.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug4.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug6.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug7.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug8.html.ref delete mode 100644 tests/html-tests/tests/mini_BugDeprecated.html.ref delete mode 100644 tests/html-tests/tests/mini_BugExportHeadings.html.ref delete mode 100644 tests/html-tests/tests/mini_Bugs.html.ref delete mode 100644 tests/html-tests/tests/mini_CrossPackageDocs.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedClass.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedData.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedFunction.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedFunction2.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedFunction3.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedModule.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedModule2.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedNewtype.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedReExport.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedRecord.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref delete mode 100644 tests/html-tests/tests/mini_Examples.html.ref delete mode 100644 tests/html-tests/tests/mini_FunArgs.html.ref delete mode 100644 tests/html-tests/tests/mini_GADTRecords.html.ref delete mode 100644 tests/html-tests/tests/mini_Hash.html.ref delete mode 100644 tests/html-tests/tests/mini_HiddenInstances.html.ref delete mode 100644 tests/html-tests/tests/mini_HiddenInstancesB.html.ref delete mode 100644 tests/html-tests/tests/mini_Hyperlinks.html.ref delete mode 100644 tests/html-tests/tests/mini_IgnoreExports.html.ref delete mode 100644 tests/html-tests/tests/mini_ModuleWithWarning.html.ref delete mode 100644 tests/html-tests/tests/mini_NamedDoc.html.ref delete mode 100644 tests/html-tests/tests/mini_NoLayout.html.ref delete mode 100644 tests/html-tests/tests/mini_NonGreedy.html.ref delete mode 100644 tests/html-tests/tests/mini_Properties.html.ref delete mode 100644 tests/html-tests/tests/mini_PruneWithWarning.html.ref delete mode 100644 tests/html-tests/tests/mini_QuasiExpr.html.ref delete mode 100644 tests/html-tests/tests/mini_QuasiQuote.html.ref delete mode 100644 tests/html-tests/tests/mini_TH.html.ref delete mode 100644 tests/html-tests/tests/mini_TH2.html.ref delete mode 100644 tests/html-tests/tests/mini_Test.html.ref delete mode 100644 tests/html-tests/tests/mini_Ticket112.html.ref delete mode 100644 tests/html-tests/tests/mini_Ticket61.html.ref delete mode 100644 tests/html-tests/tests/mini_Ticket75.html.ref delete mode 100644 tests/html-tests/tests/mini_TypeFamilies.html.ref delete mode 100644 tests/html-tests/tests/mini_TypeOperators.html.ref delete mode 100644 tests/html-tests/tests/mini_Unicode.html.ref delete mode 100644 tests/html-tests/tests/mini_Visible.html.ref diff --git a/.gitignore b/.gitignore index ba90347e..3d242029 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /dist/ -/tests/html-tests/output/ +/html-test/output/ /doc/haddock /doc/autom4te.cache/ diff --git a/haddock.cabal b/haddock.cabal index 846d7c6a..36c016e9 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -31,7 +31,7 @@ extra-source-files: src/haddock.sh -- The test files shouldn't have to go here, but the source files for -- the test-suite stanzas don't get picked up by `cabal sdist`. - tests/html-tests/runtests.hs + tests/html-test/runtests.hs data-dir: resources data-files: html/frames.html @@ -169,11 +169,11 @@ library if flag(in-ghc-tree) buildable: False -test-suite html-tests +test-suite html-test type: exitcode-stdio-1.0 default-language: Haskell2010 main-is: runtests.hs - hs-source-dirs: tests/html-tests + hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal test-suite spec diff --git a/html-test/README b/html-test/README new file mode 100644 index 00000000..9afb10e7 --- /dev/null +++ b/html-test/README @@ -0,0 +1,24 @@ +This is a testsuite for Haddock that uses the concept of "golden files". That +is, it compares output files against a set of reference files. + +To add a new test: + + 1) Create a module in the "tests" directory. + + 2) Run "cabal test". You should now have output/.html. The test + passes since there is no reference file to compare with. + + 3) To make a reference file from the output file, do + runhaskell accept.hs + +Tips and tricks: + +To "accept" all output files (copy them to reference files), run + runhaskell accept.hs + +You can run all tests despite failing tests, like so + cabal test --test-option=all + +You can pass extra options to haddock like so + cabal test --test-options='all --title="All Tests"' + diff --git a/html-test/accept.hs b/html-test/accept.hs new file mode 100644 index 00000000..45b32078 --- /dev/null +++ b/html-test/accept.hs @@ -0,0 +1,43 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import Data.List +import Control.Monad +import Control.Applicative + + +main = do + args <- getArgs + dir <- getCurrentDirectory + contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") + if not $ null args + then + mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + where + ignore = [ + "doc-index.html" + , "index-frames.html" + , "index.html" + ] + + +copy file = do + let new = "tests" takeFileName file <.> ".ref" + print file + print new + contents <- readFile file + writeFile new (stripLinks contents) + + +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs diff --git a/html-test/runtests.hs b/html-test/runtests.hs new file mode 100644 index 00000000..292deb8b --- /dev/null +++ b/html-test/runtests.hs @@ -0,0 +1,152 @@ +import Prelude hiding (mod) +import Control.Monad +import Control.Applicative +import Data.List +import Data.Maybe +import Distribution.InstalledPackageInfo +import Distribution.Package (PackageName (..)) +import Distribution.Simple.Compiler +import Distribution.Simple.GHC +import Distribution.Simple.PackageIndex +import Distribution.Simple.Program +import Distribution.Simple.Utils +import Distribution.Verbosity +import System.IO +import System.Cmd +import System.Directory +import System.Environment +import System.Exit +import System.FilePath +import System.Process (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath +packageRoot = "." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" +testSuiteRoot = packageRoot "html-test" +testDir = testSuiteRoot "tests" +outDir = testSuiteRoot "output" + + +main :: IO () +main = do + test + putStrLn "All tests passed!" + + +test :: IO () +test = do + x <- doesFileExist haddockPath + unless x $ die "you need to run 'cabal build' successfully first" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + y:_ | y /= "all" -> [y ++ ".hs"] + _ -> filter ((==) ".hs" . takeExtension) contents + + let mods' = map (testDir ) mods + + -- add haddock_datadir to environment for subprocesses + env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment + + putStrLn "" + putStrLn "Haddock version: " + h1 <- runProcess haddockPath ["--version"] Nothing + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + env Nothing Nothing Nothing + wait h2 "*** Running `haddock --ghc-version' failed!" + putStrLn "" + + -- TODO: maybe do something more clever here using haddock.cabal + ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] + (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration + pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf + let mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + wait handle "*** Haddock run failed! Exiting." + check mods (if not (null args) && args !! 0 == "all" then False else True) + where + wait :: ProcessHandle -> String -> IO () + wait h msg = do + r <- waitForProcess h + unless (r == ExitSuccess) $ do + hPutStrLn stderr msg + exitFailure + +check :: [FilePath] -> Bool -> IO () +check modules strict = do + forM_ modules $ \mod -> do + let outfile = outDir dropExtension mod ++ ".html" + let reffile = testDir dropExtension mod ++ ".html.ref" + b <- doesFileExist reffile + if b + then do + copyFile reffile (outDir takeFileName reffile) + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".nolinks" + writeFile reffile' ref' + writeFile outfile' out' + r <- programOnPath "colordiff" + code <- if r + then system $ "colordiff " ++ reffile' ++ " " ++ outfile' + else system $ "diff " ++ reffile' ++ " " ++ outfile' + if strict then exitFailure else return () + unless (code == ExitSuccess) $ do + hPutStrLn stderr "*** Running diff failed!" + exitFailure + else do + putStrLn $ "Pass: " ++ mod + else do + putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" + + +haddockEq :: String -> String -> Bool +haddockEq file1 file2 = stripLinks file1 == stripLinks file2 + +stripLinks :: String -> String +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) diff --git a/html-test/tests/A.hs b/html-test/tests/A.hs new file mode 100644 index 00000000..606b0865 --- /dev/null +++ b/html-test/tests/A.hs @@ -0,0 +1,17 @@ +module A where + +data A = A + +other :: Int +other = 2 + +-- | Doc for test2 +test2 :: Bool +test2 = False + +-- | Should show up on the page for both modules A and B +data X = X -- ^ Doc for consructor + +-- | Should show up on the page for both modules A and B +reExport :: Int +reExport = 1 diff --git a/html-test/tests/A.html.ref b/html-test/tests/A.html.ref new file mode 100644 index 00000000..328fec02 --- /dev/null +++ b/html-test/tests/A.html.ref @@ -0,0 +1,183 @@ + +A
    Safe HaskellNone

    A

    Synopsis

    Documentation

    data A

    Constructors

    A 

    test2 :: Bool

    Doc for test2 +

    data X

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

    Constructors

    X

    Doc for consructor +

    reExport :: Int

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

    diff --git a/html-test/tests/AdvanceTypes.hs b/html-test/tests/AdvanceTypes.hs new file mode 100644 index 00000000..939fdf07 --- /dev/null +++ b/html-test/tests/AdvanceTypes.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE TypeOperators #-} +module AdvanceTypes where + +data Pattern :: [*] -> * where + Nil :: Pattern '[] + Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/html-test/tests/AdvanceTypes.html.ref b/html-test/tests/AdvanceTypes.html.ref new file mode 100644 index 00000000..bac545be --- /dev/null +++ b/html-test/tests/AdvanceTypes.html.ref @@ -0,0 +1,97 @@ + +AdvanceTypes
    Safe HaskellNone

    AdvanceTypes

    Documentation

    data Pattern where

    Constructors

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

    B

    Synopsis

    Documentation

    module A

    test :: Int

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

    reExport :: Int

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

    data X

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

    Constructors

    X

    Doc for consructor +

    diff --git a/html-test/tests/Bug1.hs b/html-test/tests/Bug1.hs new file mode 100644 index 00000000..af1ed4d3 --- /dev/null +++ b/html-test/tests/Bug1.hs @@ -0,0 +1,6 @@ +module Bug1 where + +-- | We should have different anchors for constructors and types\/classes. This +-- hyperlink should point to the type constructor by default: 'T'. +data T = T + diff --git a/html-test/tests/Bug1.html.ref b/html-test/tests/Bug1.html.ref new file mode 100644 index 00000000..f8a86948 --- /dev/null +++ b/html-test/tests/Bug1.html.ref @@ -0,0 +1,103 @@ + +Bug1
    Safe HaskellNone

    Bug1

    Synopsis

    • data T = T

    Documentation

    data T

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

    Constructors

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

    Bug2

    Documentation

    x :: A

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

    Bug3

    Synopsis

    Documentation

    foo :: Int

    /multi-line + emphasis/ +

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

    Bug4

    Synopsis

    Documentation

    foo :: Int

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

    diff --git a/html-test/tests/Bug6.hs b/html-test/tests/Bug6.hs new file mode 100644 index 00000000..17411f31 --- /dev/null +++ b/html-test/tests/Bug6.hs @@ -0,0 +1,23 @@ +-- | Exporting records. +module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where + +-- | +-- This record is exported without its field +data A = A { a :: Int } + +-- | +-- .. with its field, but the field is named separately in the export list +-- (the field isn't documented separately since it is already documented here) +data B = B { b :: Int } + +-- | +-- .. with fields names as subordinate names in the export +data C = C { c1 :: Int, c2 :: Int } + +-- | +-- .. with only some of the fields exported (we can't handle this one - +-- how do we render the declaration?) +data D = D { d1 :: Int, d2 :: Int } + +-- | a newtype with a field +newtype E = E { e :: Int } diff --git a/html-test/tests/Bug6.html.ref b/html-test/tests/Bug6.html.ref new file mode 100644 index 00000000..606e45e3 --- /dev/null +++ b/html-test/tests/Bug6.html.ref @@ -0,0 +1,335 @@ + +Bug6
    Safe HaskellNone

    Bug6

    Description

    Exporting records. +

    Synopsis

    Documentation

    data A

    This record is exported without its field +

    Constructors

    A Int 

    data B

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

    Constructors

    B 

    Fields

    b :: Int
     

    data C

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

    Constructors

    C 

    Fields

    c1 :: Int
     
    c2 :: Int
     

    data D

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

    Constructors

    D Int Int 

    newtype E

    a newtype with a field +

    Constructors

    E Int 
    diff --git a/html-test/tests/Bug7.hs b/html-test/tests/Bug7.hs new file mode 100644 index 00000000..8cf57914 --- /dev/null +++ b/html-test/tests/Bug7.hs @@ -0,0 +1,12 @@ +-- | This module caused a duplicate instance in the documentation for the Foo +-- type. +module Bug7 where + +-- | The Foo datatype +data Foo = Foo + +-- | The Bar class +class Bar x y + +-- | Just one instance +instance Bar Foo Foo diff --git a/html-test/tests/Bug7.html.ref b/html-test/tests/Bug7.html.ref new file mode 100644 index 00000000..8ac72b16 --- /dev/null +++ b/html-test/tests/Bug7.html.ref @@ -0,0 +1,173 @@ + +Bug7
    Safe HaskellNone

    Bug7

    Description

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

    Synopsis

    Documentation

    data Foo

    The Foo datatype +

    Constructors

    Foo 

    Instances

    Bar Foo Foo

    Just one instance +

    class Bar x y

    The Bar class +

    Instances

    Bar Foo Foo

    Just one instance +

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

    Bug8

    Documentation

    data Typ

    Constructors

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

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

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

    s :: a

    t :: a

    main :: a

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

    BugDeprecated

    Synopsis

    Documentation

    foo :: Int

    Deprecated: for foo +

    baz :: Int

    Deprecated: for baz +

    bar :: Int

    Deprecated: for bar +

    one :: Int

    Deprecated: for one +

    some documentation for one, two and three +

    three :: Int

    Deprecated: for three +

    some documentation for one, two and three +

    two :: Int

    Deprecated: for two +

    some documentation for one, two and three +

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

    BugExportHeadings

    Synopsis

    Foo +

    foo :: Int

    Bar +

    bar :: Int

    Baz +

    baz :: Int

    One +

    one :: Int

    Deprecated: for one +

    Two +

    two :: Int

    Deprecated: for two +

    Three +

    three :: Int

    Deprecated: for three +

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

    Bugs

    Documentation

    data A a

    Constructors

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

    CrossPackageDocs

    Synopsis

    Documentation

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

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

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

    class IsString a where

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

    Methods

    fromString :: String -> a

    Instances

    runInteractiveProcess

    Arguments

    :: FilePath

    Filename of the executable (see proc for details) +

    -> [String]

    Arguments to pass to the executable +

    -> Maybe FilePath

    Optional path to the working directory +

    -> Maybe [(String, String)]

    Optional environment (otherwise inherit) +

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

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

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

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

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

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

    DeprecatedClass

    Synopsis

    Documentation

    class SomeClass a where

    Deprecated: SomeClass +

    some class +

    Methods

    foo :: a -> a

    Deprecated: foo +

    documentation for foo +

    class SomeOtherClass a where

    Deprecated: SomeOtherClass +

    Methods

    bar :: a -> a

    Deprecated: bar +

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

    DeprecatedData

    Synopsis

    Documentation

    data Foo

    Deprecated: Foo +

    type Foo +

    Constructors

    Foo

    Deprecated: Foo +

    constructor Foo +

    Bar

    Deprecated: Bar +

    constructor Bar +

    data One

    Deprecated: One +

    Constructors

    One

    Deprecated: One +

    Two

    Deprecated: Two +

    diff --git a/html-test/tests/DeprecatedFunction.hs b/html-test/tests/DeprecatedFunction.hs new file mode 100644 index 00000000..8d626435 --- /dev/null +++ b/html-test/tests/DeprecatedFunction.hs @@ -0,0 +1,10 @@ +module DeprecatedFunction where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use `bar` instead" #-} + +-- | some documentation for bar +bar :: Int +bar = 42 diff --git a/html-test/tests/DeprecatedFunction.html.ref b/html-test/tests/DeprecatedFunction.html.ref new file mode 100644 index 00000000..1fc678bb --- /dev/null +++ b/html-test/tests/DeprecatedFunction.html.ref @@ -0,0 +1,110 @@ + +DeprecatedFunction
    Safe HaskellNone

    DeprecatedFunction

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    bar :: Int

    some documentation for bar +

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

    DeprecatedFunction2

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

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

    DeprecatedFunction3

    Synopsis

    Documentation

    foo :: Integer

    Deprecated: use bar instead +

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

    DeprecatedModule

    Description

    Deprecated: Use Foo instead +

    Documentation for DeprecatedModule. +

    Documentation

    foo :: Int

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

    DeprecatedModule2

    Description

    Deprecated: Use Foo instead +

    Documentation

    foo :: Int

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

    DeprecatedNewtype

    Documentation

    newtype SomeNewType

    Deprecated: SomeNewType +

    some documentation +

    Constructors

    SomeNewTypeConst String

    Deprecated: SomeNewTypeConst +

    constructor docu +

    newtype SomeOtherNewType

    Deprecated: SomeOtherNewType +

    Constructors

    SomeOtherNewTypeConst String

    Deprecated: SomeOtherNewTypeConst +

    diff --git a/html-test/tests/DeprecatedReExport.hs b/html-test/tests/DeprecatedReExport.hs new file mode 100644 index 00000000..f851e2ff --- /dev/null +++ b/html-test/tests/DeprecatedReExport.hs @@ -0,0 +1,16 @@ +-- | +-- What is tested here: +-- +-- * Deprecation messages are shown for re-exported items. +-- +module DeprecatedReExport ( +-- * Re-exported from an other module + foo +-- * Re-exported from an other package +-- | Not yet working, see +-- , isEmptyChan +, +) where + +import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/html-test/tests/DeprecatedReExport.html.ref b/html-test/tests/DeprecatedReExport.html.ref new file mode 100644 index 00000000..611c181d --- /dev/null +++ b/html-test/tests/DeprecatedReExport.html.ref @@ -0,0 +1,133 @@ + +DeprecatedReExport
    Safe HaskellNone

    DeprecatedReExport

    Description

    What is tested here: +

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

    Synopsis

    Re-exported from an other module +

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    Re-exported from an other package +

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

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

    DeprecatedRecord

    Synopsis

    Documentation

    data Foo

    type Foo +

    Constructors

    Foo 

    Fields

    fooName :: String

    some name +

    fooValue :: Int

    Deprecated: do not use this +

    some value +

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

    DeprecatedTypeFamily

    Synopsis

    Documentation

    data family SomeTypeFamily k :: * -> *

    Deprecated: SomeTypeFamily +

    some documentation +

    data family SomeOtherTypeFamily k :: * -> *

    Deprecated: SomeOtherTypeFamily +

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

    DeprecatedTypeSynonym

    Synopsis

    Documentation

    type TypeSyn = String

    Deprecated: TypeSyn +

    some documentation +

    type OtherTypeSyn = String

    Deprecated: OtherTypeSyn +

    diff --git a/html-test/tests/DeprecationMessageParseError.hs b/html-test/tests/DeprecationMessageParseError.hs new file mode 100644 index 00000000..2f8fb492 --- /dev/null +++ b/html-test/tests/DeprecationMessageParseError.hs @@ -0,0 +1,12 @@ +-- | +-- What is tested here: +-- +-- * If parsing of a deprecation message fails, the message is included +-- verbatim. +-- +module DeprecationMessageParseError where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use @bar instead" #-} diff --git a/html-test/tests/DeprecationMessageParseError.html.ref b/html-test/tests/DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..75f9bf54 --- /dev/null +++ b/html-test/tests/DeprecationMessageParseError.html.ref @@ -0,0 +1,101 @@ + +DeprecationMessageParseError
    Safe HaskellNone

    DeprecationMessageParseError

    Description

    What is tested here: +

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

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use @bar instead

    some documentation for foo +

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

    Examples

    Synopsis

    Documentation

    fib :: Integer -> Integer

    Fibonacci number of given Integer. +

    Examples: +

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

    One more Example: +

    >>> fib 5
    +5
    +

    One more Example: +

    >>> fib 5
    +5
    +

    Example with an import: +

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

    FunArgs

    Documentation

    f

    Arguments

    :: forall a . Ord a 
    => Int

    First argument +

    -> a

    Second argument +

    -> Bool

    Third argument +

    -> (a -> a)

    Fourth argument +

    -> ()

    Result +

    g

    Arguments

    :: a

    First argument +

    -> b

    Second argument +

    -> c

    Third argument +

    -> d

    Result +

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

    GADTRecords

    Synopsis

    Documentation

    data H1 a b where

    h1 +

    Constructors

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

    Fields

    field :: Int

    hello docs +

    C4 :: a -> H1 Int a 

    Fields

    field2 :: a

    hello2 docs +

    diff --git a/html-test/tests/Hash.hs b/html-test/tests/Hash.hs new file mode 100644 index 00000000..343b69e9 --- /dev/null +++ b/html-test/tests/Hash.hs @@ -0,0 +1,51 @@ +{- | + Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +-} +module Hash ( + -- * The @HashTable@ type + HashTable, + + -- ** Operations on @HashTable@s + new, insert, lookup, + + -- * The @Hash@ class + Hash(..), + ) where + +import Data.Array +import Prelude hiding (lookup) + +-- | A hash table with keys of type @key@ and values of type @val@. +-- The type @key@ should be an instance of 'Eq'. +data HashTable key val = HashTable Int (Array Int [(key,val)]) + +-- | Builds a new hash table with a given size +new :: (Eq key, Hash key) => Int -> IO (HashTable key val) +new = undefined + +-- | Inserts a new element into the hash table +insert :: (Eq key, Hash key) => key -> val -> IO () +insert = undefined + +-- | Looks up a key in the hash table, returns @'Just' val@ if the key +-- was found, or 'Nothing' otherwise. +lookup :: Hash key => key -> IO (Maybe val) +lookup = undefined + +-- | A class of types which can be hashed. +class Hash a where + -- | hashes the value of type @a@ into an 'Int' + hash :: a -> Int + +instance Hash Int where + hash = id + +instance Hash Float where + hash = trunc + +instance (Hash a, Hash b) => Hash (a,b) where + hash (a,b) = hash a `xor` hash b + +trunc = undefined +xor = undefined diff --git a/html-test/tests/Hash.html.ref b/html-test/tests/Hash.html.ref new file mode 100644 index 00000000..b0cd183c --- /dev/null +++ b/html-test/tests/Hash.html.ref @@ -0,0 +1,337 @@ + +Hash
    Safe HaskellNone

    Hash

    Description

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

    Synopsis

    The HashTable type +

    data HashTable key val

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

    Operations on HashTables +

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

    Builds a new hash table with a given size +

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

    Inserts a new element into the hash table +

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

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

    The Hash class +

    class Hash a where

    A class of types which can be hashed. +

    Methods

    hash :: a -> Int

    hashes the value of type a into an Int +

    Instances

    Hash Float 
    Hash Int 
    (Hash a, Hash b) => Hash (a, b) 
    diff --git a/html-test/tests/Hidden.hs b/html-test/tests/Hidden.hs new file mode 100644 index 00000000..896da648 --- /dev/null +++ b/html-test/tests/Hidden.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Hidden where + +hidden :: Int -> Int +hidden a = a diff --git a/html-test/tests/HiddenInstances.hs b/html-test/tests/HiddenInstances.hs new file mode 100644 index 00000000..99a6c2fd --- /dev/null +++ b/html-test/tests/HiddenInstances.hs @@ -0,0 +1,35 @@ +-- http://trac.haskell.org/haddock/ticket/37 +module HiddenInstances (VisibleClass, VisibleData) where + +-- | Should be visible +class VisibleClass a + +-- | Should *not* be visible +class HiddenClass a + +-- | Should *not* be visible +data HiddenData = HiddenData + +-- | Should be visible +data VisibleData = VisibleData + +-- | Should be visible +instance VisibleClass Int + +-- | Should be visible +instance VisibleClass VisibleData + +-- | Should be visible +instance Num VisibleData + +-- | Should *not* be visible +instance VisibleClass HiddenData + +-- | Should *not* be visible +instance HiddenClass Int + +-- | Should *not* be visible +instance HiddenClass VisibleData + +-- | Should *not* be visible +instance HiddenClass HiddenData diff --git a/html-test/tests/HiddenInstances.html.ref b/html-test/tests/HiddenInstances.html.ref new file mode 100644 index 00000000..999c114d --- /dev/null +++ b/html-test/tests/HiddenInstances.html.ref @@ -0,0 +1,169 @@ + +HiddenInstances
    Safe HaskellNone

    HiddenInstances

    Synopsis

    Documentation

    class VisibleClass a

    Should be visible +

    Instances

    VisibleClass Int

    Should be visible +

    VisibleClass VisibleData

    Should be visible +

    data VisibleData

    Should be visible +

    Instances

    Num VisibleData

    Should be visible +

    VisibleClass VisibleData

    Should be visible +

    diff --git a/html-test/tests/HiddenInstancesA.hs b/html-test/tests/HiddenInstancesA.hs new file mode 100644 index 00000000..f1775208 --- /dev/null +++ b/html-test/tests/HiddenInstancesA.hs @@ -0,0 +1,17 @@ +{-# OPTIONS_HADDOCK hide #-} +module HiddenInstancesA where + +-- | Should be visible +class Foo a + +-- | Should be visible +data Bar + +-- | Should be visible +instance Foo Bar + +-- | Should *not* be visible +data Baz + +-- | Should *not* be visible +instance Foo Baz diff --git a/html-test/tests/HiddenInstancesB.hs b/html-test/tests/HiddenInstancesB.hs new file mode 100644 index 00000000..eabf0637 --- /dev/null +++ b/html-test/tests/HiddenInstancesB.hs @@ -0,0 +1,2 @@ +module HiddenInstancesB (Foo, Bar) where +import HiddenInstancesA diff --git a/html-test/tests/HiddenInstancesB.html.ref b/html-test/tests/HiddenInstancesB.html.ref new file mode 100644 index 00000000..207a5146 --- /dev/null +++ b/html-test/tests/HiddenInstancesB.html.ref @@ -0,0 +1,143 @@ + +HiddenInstancesB
    Safe HaskellNone

    HiddenInstancesB

    Synopsis

    Documentation

    class Foo a

    Should be visible +

    Instances

    Foo Bar

    Should be visible +

    data Bar

    Should be visible +

    Instances

    Foo Bar

    Should be visible +

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

    Hyperlinks

    Synopsis

    Documentation

    foo :: Int

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

    A URL with a label: some link +

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

    IgnoreExports

    Synopsis

    Documentation

    foo :: Int

    documentation for foo +

    bar :: Int

    documentation for bar +

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

    ModuleWithWarning

    Description

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

    Documentation for ModuleWithWarning. +

    Documentation

    foo :: Int

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

    NamedDoc

    Synopsis

      Documentation

      bar +

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

      NoLayout

      Synopsis

      Documentation

      g :: Int

      the function g +

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

      NonGreedy

      Synopsis

      • f :: a

      Documentation

      f :: a

      diff --git a/html-test/tests/Properties.hs b/html-test/tests/Properties.hs new file mode 100644 index 00000000..05930ece --- /dev/null +++ b/html-test/tests/Properties.hs @@ -0,0 +1,9 @@ +module Properties where + +-- | Fibonacci number of given 'Integer'. +-- +-- prop> fib n <= fib (n + 1) +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/Properties.html.ref b/html-test/tests/Properties.html.ref new file mode 100644 index 00000000..1c4ce893 --- /dev/null +++ b/html-test/tests/Properties.html.ref @@ -0,0 +1,92 @@ + +Properties
      Safe HaskellNone

      Properties

      Synopsis

      Documentation

      fib :: Integer -> Integer

      Fibonacci number of given Integer. +

      fib n <= fib (n + 1)
      diff --git a/html-test/tests/PruneWithWarning.hs b/html-test/tests/PruneWithWarning.hs new file mode 100644 index 00000000..bfa55ea2 --- /dev/null +++ b/html-test/tests/PruneWithWarning.hs @@ -0,0 +1,15 @@ +{-# OPTIONS_HADDOCK prune #-} +-- | +-- What is tested here: +-- +-- * If a binding has a deprecation message but no documentation, it is pruned +-- when @OPTIONS_HADDOCK prune@ is used. +-- +module PruneWithWarning (foo, bar) where + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} + +bar :: Int +bar = 42 diff --git a/html-test/tests/PruneWithWarning.html.ref b/html-test/tests/PruneWithWarning.html.ref new file mode 100644 index 00000000..3c31fbdf --- /dev/null +++ b/html-test/tests/PruneWithWarning.html.ref @@ -0,0 +1,72 @@ + +PruneWithWarning
      Safe HaskellNone

      PruneWithWarning

      Description

      What is tested here: +

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

      QuasiExpr

      Documentation

      data BinOp

      Constructors

      AddOp 
      SubOp 
      MulOp 
      DivOp 

      Instances

      expr :: QuasiQuoter

      parseExprExp :: String -> Q Exp

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

      QuasiQuote

      Documentation

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

      TH

      Documentation

      decl :: Q [Dec]

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

      TH2

      Documentation

      f :: t -> t

      diff --git a/html-test/tests/Test.hs b/html-test/tests/Test.hs new file mode 100644 index 00000000..d352f029 --- /dev/null +++ b/html-test/tests/Test.hs @@ -0,0 +1,422 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Test +-- Copyright : (c) Simon Marlow 2002 +-- License : BSD-style +-- +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- This module illustrates & tests most of the features of Haddock. +-- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. +-- +----------------------------------------------------------------------------- + +-- This is plain comment, ignored by Haddock. + +module Test ( + + -- Section headings are introduced with '-- *': + -- * Type declarations + + -- Subsection headings are introduced with '-- **' and so on. + -- ** Data types + T(..), T2, T3(..), T4(..), T5(..), T6(..), + N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), + + -- ** Records + R(..), R1(..), + + -- | test that we can export record selectors on their own: + p, q, u, + + -- * Class declarations + C(a,b), D(..), E, F(..), + + -- | Test that we can export a class method on its own: + a, + + -- * Function types + f, g, + + -- * Auxiliary stuff + + -- $aux1 + + -- $aux2 + + -- $aux3 + + -- $aux4 + + -- $aux5 + + -- $aux6 + + -- $aux7 + + -- $aux8 + + -- $aux9 + + -- $aux10 + + -- $aux11 + + -- $aux12 + + -- | This is some inline documentation in the export list + -- + -- > a code block using bird-tracks + -- > each line must begin with > (which isn't significant unless it + -- > is at the beginning of the line). + + -- * A hidden module + module Hidden, + + -- * A visible module + module Visible, + + {-| nested-style doc comments -} + + -- * Existential \/ Universal types + Ex(..), + + -- * Type signatures with argument docs + k, l, m, o, + + -- * A section + -- and without an intervening comma: + -- ** A subsection + +{-| + > a literal line + + $ a non /literal/ line $ +-} + + f', + + withType, withoutType + ) where + +import Hidden +import Visible +import Data.Maybe + +bla = Nothing + +-- | This comment applies to the /following/ declaration +-- and it continues until the next non-comment line +data T a b + = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor + | -- | This comment describes the 'B' constructor + B (T a b, T Int Float) -- ^ + +-- | An abstract data declaration +data T2 a b = T2 a b + +-- | A data declaration with no documentation annotations on the constructors +data T3 a b = A1 a | B1 b + +-- A data declaration with no documentation annotations at all +data T4 a b = A2 a | B2 b + +-- A data declaration documentation on the constructors only +data T5 a b + = A3 a -- ^ documents 'A3' + | B3 b -- ^ documents 'B3' + +-- | Testing alternative comment styles +data T6 + -- | This is the doc for 'A4' + = A4 + | B4 + | -- ^ This is the doc for 'B4' + + -- | This is the doc for 'C4' + C4 + +-- | A newtype +newtype N1 a = N1 a + +-- | A newtype with a fieldname +newtype N2 a b = N2 {n :: a b} + +-- | A newtype with a fieldname, documentation on the field +newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field + } + +-- | An abstract newtype - we show this one as data rather than newtype because +-- the difference isn\'t visible to the programmer for an abstract type. +newtype N4 a b = N4 a + +newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor + } + +newtype N6 a b = N6 {n6 :: a b + } + -- ^ docs on the constructor only + +-- | docs on the newtype and the constructor +newtype N7 a b = N7 {n7 :: a b + } + -- ^ The 'N7' constructor + + +class (D a) => C a where + -- |this is a description of the 'a' method + a :: IO a + b :: [a] + -- ^ this is a description of the 'b' method + c :: a -- c is hidden in the export list + +-- ^ This comment applies to the /previous/ declaration (the 'C' class) + +class D a where + d :: T a b + e :: (a,a) +-- ^ This is a class declaration with no separate docs for the methods + +instance D Int where + d = undefined + e = undefined + +-- instance with a qualified class name +instance Test.D Float where + d = undefined + e = undefined + +class E a where + ee :: a +-- ^ This is a class declaration with no methods (or no methods exported) + +-- This is a class declaration with no documentation at all +class F a where + ff :: a + +-- | This is the documentation for the 'R' record, which has four fields, +-- 'p', 'q', 'r', and 's'. +data R = + -- | This is the 'C1' record constructor, with the following fields: + C1 { p :: Int -- ^ This comment applies to the 'p' field + , q :: forall a . a->a -- ^ This comment applies to the 'q' field + , -- | This comment applies to both 'r' and 's' + r,s :: Int + } + | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), + u,v :: Int + } + -- ^ This is the 'C2' record constructor, also with some fields: + +-- | Testing different record commenting styles +data R1 + -- | This is the 'C3' record constructor + = C3 { + -- | The 's1' record selector + s1 :: Int + -- | The 's2' record selector + , s2 :: Int + , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. + -- Since GHC doesn't allow that, I have removed it in this file. + -- ^ The 's3' record selector + } + +-- These section headers are only used when there is no export list to +-- give the structure of the documentation: + +-- * This is a section header (level 1) +-- ** This is a section header (level 2) +-- *** This is a section header (level 3) + +{-| +In a comment string we can refer to identifiers in scope with +single quotes like this: 'T', and we can refer to modules by +using double quotes: "Foo". We can add emphasis /like this/. + + * This is a bulleted list + + - This is the next item (different kind of bullet) + + (1) This is an ordered list + + 2. This is the next item (different kind of bullet) + + [cat] a small, furry, domesticated mammal + + [pineapple] a fruit grown in the tropics + +@ + This is a block of code, which can include other markup: 'R' + formatting + is + significant +@ + +> this is another block of code + +We can also include URLs in documentation: . +-} + +f :: C a => a -> Int + +-- | we can export foreign declarations too +foreign import ccall g :: Int -> IO CInt + +-- | this doc string has a parse error in it: \' +h :: Int +h = 42 + + +-- $aux1 This is some documentation that is attached to a name ($aux1) +-- rather than a source declaration. The documentation may be +-- referred to in the export list using its name. +-- +-- @ code block in named doc @ + +-- $aux2 This is some documentation that is attached to a name ($aux2) + +-- $aux3 +-- @ code block on its own in named doc @ + +-- $aux4 +-- +-- @ code block on its own in named doc (after newline) @ + +{- $aux5 a nested, named doc comment + + with a paragraph, + + @ and a code block @ +-} + +-- some tests for various arrangements of code blocks: + +{- $aux6 +>test +>test1 + +@ test2 + test3 +@ +-} + +{- $aux7 +@ +test1 +test2 +@ +-} + +{- $aux8 +>test3 +>test4 +-} + +{- $aux9 +@ +test1 +test2 +@ + +>test3 +>test4 +-} + +{- $aux10 +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- This one is currently wrong (Haddock 0.4). The @...@ part is +-- interpreted as part of the bird-tracked code block. +{- $aux11 +aux11: + +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- $aux12 +-- > foo +-- +-- > bar +-- + +-- | A data-type using existential\/universal types +data Ex a + = forall b . C b => Ex1 b + | forall b . Ex2 b + | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file + | Ex4 (forall a . a -> a) + +-- | This is a function with documentation for each argument +k :: T () () -- ^ This argument has type 'T' + -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' + -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ + -> T5 () () -- ^ This argument has a very long description that should + -- hopefully cause some wrapping to happen when it is finally + -- rendered by Haddock in the generated HTML page. + -> IO () -- ^ This is the result type + +-- This function has arg docs but no docs for the function itself +l :: (Int, Int, Float) -- ^ takes a triple + -> Int -- ^ returns an 'Int' + +-- | This function has some arg docs +m :: R + -> N1 () -- ^ one of the arguments + -> IO Int -- ^ and the return value + +-- | This function has some arg docs but not a return value doc + +-- can't use the original name ('n') with GHC +newn :: R -- ^ one of the arguments, an 'R' + -> N1 () -- ^ one of the arguments + -> IO Int +newn = undefined + + +-- | A foreign import with argument docs +foreign import ccall unsafe + o :: Float -- ^ The input float + -> IO Float -- ^ The output float + +-- | We should be able to escape this: \#\#\# + +-- p :: Int +-- can't use the above original definition with GHC +newp :: Int +newp = undefined + +-- | a function with a prime can be referred to as 'f'' +-- but f' doesn't get link'd 'f\'' +f' :: Int + +-- | Comment on a definition without type signature +withoutType = undefined + +-- | Comment on a definition with type signature +withType :: Int +withType = 1 + +-- Add some definitions here so that this file can be compiled with GHC + +data T1 +f = undefined +f' = undefined +type CInt = Int +k = undefined +l = undefined +m = undefined diff --git a/html-test/tests/Test.html.ref b/html-test/tests/Test.html.ref new file mode 100644 index 00000000..f2ef2b28 --- /dev/null +++ b/html-test/tests/Test.html.ref @@ -0,0 +1,2245 @@ + +Test
      Portabilityportable
      Stabilityprovisional
      Maintainerlibraries@haskell.org
      Safe HaskellNone

      Test

      Description

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

      Synopsis

      Type declarations +

      Data types +

      data T a b

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

      Constructors

      A Int (Maybe Float)

      This comment describes the A constructor +

      B (T a b, T Int Float)

      This comment describes the B constructor +

      data T2 a b

      An abstract data declaration +

      data T3 a b

      A data declaration with no documentation annotations on the constructors +

      Constructors

      A1 a 
      B1 b 

      data T4 a b

      Constructors

      A2 a 
      B2 b 

      data T5 a b

      Constructors

      A3 a

      documents A3 +

      B3 b

      documents B3 +

      data T6

      Testing alternative comment styles +

      Constructors

      A4

      This is the doc for A4 +

      B4

      This is the doc for B4 +

      C4

      This is the doc for C4 +

      newtype N1 a

      A newtype +

      Constructors

      N1 a 

      newtype N2 a b

      A newtype with a fieldname +

      Constructors

      N2 

      Fields

      n :: a b
       

      newtype N3 a b

      A newtype with a fieldname, documentation on the field +

      Constructors

      N3 

      Fields

      n3 :: a b

      this is the n3 field +

      data N4 a b

      An abstract newtype - we show this one as data rather than newtype because + the difference isn't visible to the programmer for an abstract type. +

      newtype N5 a b

      Constructors

      N5 

      Fields

      n5 :: a b

      no docs on the datatype or the constructor +

      newtype N6 a b

      Constructors

      N6

      docs on the constructor only +

      Fields

      n6 :: a b
       

      newtype N7 a b

      docs on the newtype and the constructor +

      Constructors

      N7

      The N7 constructor +

      Fields

      n7 :: a b
       

      Records +

      data R

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

      Constructors

      C1

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

      Fields

      p :: Int

      This comment applies to the p field +

      q :: forall a. a -> a

      This comment applies to the q field +

      r :: Int

      This comment applies to both r and s +

      s :: Int

      This comment applies to both r and s +

      C2

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

      Fields

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

      data R1

      Testing different record commenting styles +

      Constructors

      C3

      This is the C3 record constructor +

      Fields

      s1 :: Int

      The s1 record selector +

      s2 :: Int

      The s2 record selector +

      s3 :: Int

      The s3 record selector +

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

      Class declarations +

      class D a => C a where

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

      Methods

      a :: IO a

      this is a description of the a method +

      b :: [a]

      this is a description of the b method +

      class D a where

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

      Methods

      d :: T a b

      e :: (a, a)

      Instances

      class E a

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

      class F a where

      Methods

      ff :: a

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

      Function types +

      f :: C a => a -> Int

      In a comment string we can refer to identifiers in scope with +single quotes like this: T, and we can refer to modules by +using double quotes: Foo. We can add emphasis like this. +

      • This is a bulleted list +
      • This is the next item (different kind of bullet) +
      1. This is an ordered list +
      2. This is the next item (different kind of bullet) +
      cat
      a small, furry, domesticated mammal +
      pineapple
      a fruit grown in the tropics +
      +     This is a block of code, which can include other markup: R
      +     formatting
      +               is
      +                 significant
      +
       this is another block of code
      +

      We can also include URLs in documentation: http://www.haskell.org/. +

      g :: Int -> IO CInt

      we can export foreign declarations too +

      Auxiliary stuff +

      This is some documentation that is attached to a name ($aux1) + rather than a source declaration. The documentation may be + referred to in the export list using its name. +

       code block in named doc

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

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

      a nested, named doc comment +

      with a paragraph, +

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

      aux11: +

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

      This is some inline documentation in the export list +

       a code block using bird-tracks
      + each line must begin with > (which isn't significant unless it
      + is at the beginning of the line).
      +

      A hidden module +

      hidden :: Int -> Int

      A visible module +

      module Visible

      nested-style doc comments +

      Existential / Universal types +

      data Ex a

      A data-type using existential/universal types +

      Constructors

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

      Type signatures with argument docs +

      k

      Arguments

      :: T () ()

      This argument has type T +

      -> T2 Int Int

      This argument has type 'T2 Int Int' +

      -> (T3 Bool Bool -> T4 Float Float)

      This argument has type T3 Bool Bool -> T4 Float Float +

      -> T5 () ()

      This argument has a very long description that should + hopefully cause some wrapping to happen when it is finally + rendered by Haddock in the generated HTML page. +

      -> IO ()

      This is the result type +

      This is a function with documentation for each argument +

      l

      Arguments

      :: (Int, Int, Float)

      takes a triple +

      -> Int

      returns an Int +

      m

      Arguments

      :: R 
      -> N1 ()

      one of the arguments +

      -> IO Int

      and the return value +

      This function has some arg docs +

      o

      Arguments

      :: Float

      The input float +

      -> IO Float

      The output float +

      A foreign import with argument docs +

      A section +

      A subsection +

       a literal line
      +

      $ a non literal line $ +

      f' :: Int

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

      withType :: Int

      Comment on a definition with type signature +

      withoutType :: a

      Comment on a definition without type signature +

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

      Ticket112

      Synopsis

      • f :: a

      Documentation

      f :: a

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

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

      Ticket61

      Documentation

      class C a where

      Methods

      f :: a

      A comment about f +

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

      Ticket75

      Synopsis

      Documentation

      data a :- b

      Constructors

      Q 

      f :: Int

      A reference to :- +

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

      TypeFamilies

      Synopsis

      Documentation

      type family G a :: *

      Type family G +

      class A a where

      A class with an associated type +

      Associated Types

      data B a :: * -> *

      An associated type +

      Methods

      f :: B a Int

      A method +

      Instances

      A Int 

      type family F a

      Doc for family +

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

      TypeOperators

      Contents

      Synopsis

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

      stuff +

      data a :-: b

      data (a :+: b) c

      data Op a b

      newtype O g f a

      Constructors

      O 

      Fields

      unO :: g (f a)
       

      biO :: (g `O` f) a

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

      Unicode

      Synopsis

      Documentation

      x :: Int

      γλώσσα +

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

      Visible

      Documentation

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

      A

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

      AdvanceTypes

      data Pattern

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

      B

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

      Bug1

      data T

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

      Bug2

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

      Bug3

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

      Bug4

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

      Bug6

      data A

      data B

      data C

      data D

      data E

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

      Bug7

      data Foo

      class Bar x y

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

      Bug8

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

      BugDeprecated

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

      BugExportHeadings

      Foo +

      Bar +

      Baz +

      One +

      Two +

      Three +

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

      Bugs

      data A a

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

      CrossPackageDocs

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

      DeprecatedClass

      class SomeClass a

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

      DeprecatedData

      data Foo

      data One

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

      DeprecatedFunction

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

      DeprecatedFunction2

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

      DeprecatedFunction3

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

      DeprecatedModule

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

      DeprecatedModule2

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

      DeprecatedNewtype

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

      DeprecatedReExport

      Re-exported from an other module +

      Re-exported from an other package +

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

      DeprecatedRecord

      data Foo

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

      DeprecatedTypeFamily

      data family SomeTypeFamily k :: * -> *

      data family SomeOtherTypeFamily k :: * -> *

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

      DeprecatedTypeSynonym

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

      DeprecationMessageParseError

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

      Examples

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

      FunArgs

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

      GADTRecords

      data H1 a b

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

      Hash

      The HashTable type +

      data HashTable key val

      Operations on HashTables +

      The Hash class +

      class Hash a

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

      HiddenInstances

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

      HiddenInstancesB

      class Foo a

      data Bar

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

      Hyperlinks

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

      IgnoreExports

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

      ModuleWithWarning

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

      NamedDoc

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

      NoLayout

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

      NonGreedy

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

      Properties

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

      PruneWithWarning

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

      QuasiExpr

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

      QuasiQuote

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

      TH

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

      TH2

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

      Test

      Type declarations +

      Data types +

      data T a b

      data T2 a b

      data T3 a b

      data T4 a b

      data T5 a b

      data T6

      data N1 a

      data N2 a b

      data N3 a b

      data N4 a b

      data N5 a b

      data N6 a b

      data N7 a b

      Records +

      data R

      data R1

      Class declarations +

      class C a

      class D a

      class E a

      class F a

      Function types +

      Auxiliary stuff +

      A hidden module +

      A visible module +

      Existential / Universal types +

      data Ex a

      Type signatures with argument docs +

      A section +

      A subsection +

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

      Ticket112

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

      Ticket61

      class C a

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

      Ticket75

      data a :- b

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

      TypeFamilies

      type family G a :: *

      class A a

      type family F a

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

      TypeOperators

      stuff +

      data a :-: b

      data (a :+: b) c

      data Op a b

      data O g f a

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

      Unicode

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

      Visible

      diff --git a/tests/html-tests/README b/tests/html-tests/README deleted file mode 100644 index 9afb10e7..00000000 --- a/tests/html-tests/README +++ /dev/null @@ -1,24 +0,0 @@ -This is a testsuite for Haddock that uses the concept of "golden files". That -is, it compares output files against a set of reference files. - -To add a new test: - - 1) Create a module in the "tests" directory. - - 2) Run "cabal test". You should now have output/.html. The test - passes since there is no reference file to compare with. - - 3) To make a reference file from the output file, do - runhaskell accept.hs - -Tips and tricks: - -To "accept" all output files (copy them to reference files), run - runhaskell accept.hs - -You can run all tests despite failing tests, like so - cabal test --test-option=all - -You can pass extra options to haddock like so - cabal test --test-options='all --title="All Tests"' - diff --git a/tests/html-tests/accept.hs b/tests/html-tests/accept.hs deleted file mode 100644 index 45b32078..00000000 --- a/tests/html-tests/accept.hs +++ /dev/null @@ -1,43 +0,0 @@ -import System.Cmd -import System.Environment -import System.FilePath -import System.Exit -import System.Directory -import Data.List -import Control.Monad -import Control.Applicative - - -main = do - args <- getArgs - dir <- getCurrentDirectory - contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") - if not $ null args - then - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] - else - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] - where - ignore = [ - "doc-index.html" - , "index-frames.html" - , "index.html" - ] - - -copy file = do - let new = "tests" takeFileName file <.> ".ref" - print file - print new - contents <- readFile file - writeFile new (stripLinks contents) - - -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs deleted file mode 100644 index 759f7495..00000000 --- a/tests/html-tests/runtests.hs +++ /dev/null @@ -1,152 +0,0 @@ -import Prelude hiding (mod) -import Control.Monad -import Control.Applicative -import Data.List -import Data.Maybe -import Distribution.InstalledPackageInfo -import Distribution.Package (PackageName (..)) -import Distribution.Simple.Compiler -import Distribution.Simple.GHC -import Distribution.Simple.PackageIndex -import Distribution.Simple.Program -import Distribution.Simple.Utils -import Distribution.Verbosity -import System.IO -import System.Cmd -import System.Directory -import System.Environment -import System.Exit -import System.FilePath -import System.Process (ProcessHandle, runProcess, waitForProcess) - - -packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath -packageRoot = "." -dataDir = packageRoot "resources" -haddockPath = packageRoot "dist" "build" "haddock" "haddock" -testSuiteRoot = packageRoot "tests" "html-tests" -testDir = testSuiteRoot "tests" -outDir = testSuiteRoot "output" - - -main :: IO () -main = do - test - putStrLn "All tests passed!" - - -test :: IO () -test = do - x <- doesFileExist haddockPath - unless x $ die "you need to run 'cabal build' successfully first" - - contents <- getDirectoryContents testDir - args <- getArgs - let (opts, spec) = span ("-" `isPrefixOf`) args - let mods = - case spec of - y:_ | y /= "all" -> [y ++ ".hs"] - _ -> filter ((==) ".hs" . takeExtension) contents - - let mods' = map (testDir ) mods - - -- add haddock_datadir to environment for subprocesses - env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment - - putStrLn "" - putStrLn "Haddock version: " - h1 <- runProcess haddockPath ["--version"] Nothing - env Nothing Nothing Nothing - wait h1 "*** Running `haddock --version' failed!" - putStrLn "" - putStrLn "GHC version: " - h2 <- runProcess haddockPath ["--ghc-version"] Nothing - env Nothing Nothing Nothing - wait h2 "*** Running `haddock --ghc-version' failed!" - putStrLn "" - - -- TODO: maybe do something more clever here using haddock.cabal - ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] - (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration - pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf - let mkDep pkgName = - fromMaybe (error "Couldn't find test dependencies") $ do - let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- listToMaybe pkgs - pkg <- listToMaybe pkgs' - ifacePath <- listToMaybe (haddockInterfaces pkg) - htmlPath <- listToMaybe (haddockHTMLs pkg) - return ("-i " ++ htmlPath ++ "," ++ ifacePath) - - let base = mkDep "base" - process = mkDep "process" - ghcprim = mkDep "ghc-prim" - - putStrLn "Running tests..." - handle <- runProcess haddockPath - (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" - , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing env Nothing - Nothing Nothing - - wait handle "*** Haddock run failed! Exiting." - check mods (if not (null args) && args !! 0 == "all" then False else True) - where - wait :: ProcessHandle -> String -> IO () - wait h msg = do - r <- waitForProcess h - unless (r == ExitSuccess) $ do - hPutStrLn stderr msg - exitFailure - -check :: [FilePath] -> Bool -> IO () -check modules strict = do - forM_ modules $ \mod -> do - let outfile = outDir dropExtension mod ++ ".html" - let reffile = testDir dropExtension mod ++ ".html.ref" - b <- doesFileExist reffile - if b - then do - copyFile reffile (outDir takeFileName reffile) - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq out ref - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = stripLinks ref - out' = stripLinks out - let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".nolinks" - writeFile reffile' ref' - writeFile outfile' out' - r <- programOnPath "colordiff" - code <- if r - then system $ "colordiff " ++ reffile' ++ " " ++ outfile' - else system $ "diff " ++ reffile' ++ " " ++ outfile' - if strict then exitFailure else return () - unless (code == ExitSuccess) $ do - hPutStrLn stderr "*** Running diff failed!" - exitFailure - else do - putStrLn $ "Pass: " ++ mod - else do - putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" - - -haddockEq :: String -> String -> Bool -haddockEq file1 file2 = stripLinks file1 == stripLinks file2 - -stripLinks :: String -> String -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) diff --git a/tests/html-tests/tests/A.hs b/tests/html-tests/tests/A.hs deleted file mode 100644 index 606b0865..00000000 --- a/tests/html-tests/tests/A.hs +++ /dev/null @@ -1,17 +0,0 @@ -module A where - -data A = A - -other :: Int -other = 2 - --- | Doc for test2 -test2 :: Bool -test2 = False - --- | Should show up on the page for both modules A and B -data X = X -- ^ Doc for consructor - --- | Should show up on the page for both modules A and B -reExport :: Int -reExport = 1 diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref deleted file mode 100644 index 328fec02..00000000 --- a/tests/html-tests/tests/A.html.ref +++ /dev/null @@ -1,183 +0,0 @@ - -A
      Safe HaskellNone

      A

      Synopsis

      Documentation

      data A

      Constructors

      A 

      test2 :: Bool

      Doc for test2 -

      data X

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

      Constructors

      X

      Doc for consructor -

      reExport :: Int

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

      diff --git a/tests/html-tests/tests/AdvanceTypes.hs b/tests/html-tests/tests/AdvanceTypes.hs deleted file mode 100644 index 939fdf07..00000000 --- a/tests/html-tests/tests/AdvanceTypes.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE TypeOperators #-} -module AdvanceTypes where - -data Pattern :: [*] -> * where - Nil :: Pattern '[] - Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/tests/html-tests/tests/AdvanceTypes.html.ref b/tests/html-tests/tests/AdvanceTypes.html.ref deleted file mode 100644 index bac545be..00000000 --- a/tests/html-tests/tests/AdvanceTypes.html.ref +++ /dev/null @@ -1,97 +0,0 @@ - -AdvanceTypes
      Safe HaskellNone

      AdvanceTypes

      Documentation

      data Pattern where

      Constructors

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

      B

      Synopsis

      Documentation

      module A

      test :: Int

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

      reExport :: Int

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

      data X

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

      Constructors

      X

      Doc for consructor -

      diff --git a/tests/html-tests/tests/Bug1.hs b/tests/html-tests/tests/Bug1.hs deleted file mode 100644 index af1ed4d3..00000000 --- a/tests/html-tests/tests/Bug1.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug1 where - --- | We should have different anchors for constructors and types\/classes. This --- hyperlink should point to the type constructor by default: 'T'. -data T = T - diff --git a/tests/html-tests/tests/Bug1.html.ref b/tests/html-tests/tests/Bug1.html.ref deleted file mode 100644 index f8a86948..00000000 --- a/tests/html-tests/tests/Bug1.html.ref +++ /dev/null @@ -1,103 +0,0 @@ - -Bug1
      Safe HaskellNone

      Bug1

      Synopsis

      • data T = T

      Documentation

      data T

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

      Constructors

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

      Bug2

      Documentation

      x :: A

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

      Bug3

      Synopsis

      Documentation

      foo :: Int

      /multi-line - emphasis/ -

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

      Bug4

      Synopsis

      Documentation

      foo :: Int

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

      diff --git a/tests/html-tests/tests/Bug6.hs b/tests/html-tests/tests/Bug6.hs deleted file mode 100644 index 17411f31..00000000 --- a/tests/html-tests/tests/Bug6.hs +++ /dev/null @@ -1,23 +0,0 @@ --- | Exporting records. -module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where - --- | --- This record is exported without its field -data A = A { a :: Int } - --- | --- .. with its field, but the field is named separately in the export list --- (the field isn't documented separately since it is already documented here) -data B = B { b :: Int } - --- | --- .. with fields names as subordinate names in the export -data C = C { c1 :: Int, c2 :: Int } - --- | --- .. with only some of the fields exported (we can't handle this one - --- how do we render the declaration?) -data D = D { d1 :: Int, d2 :: Int } - --- | a newtype with a field -newtype E = E { e :: Int } diff --git a/tests/html-tests/tests/Bug6.html.ref b/tests/html-tests/tests/Bug6.html.ref deleted file mode 100644 index 606e45e3..00000000 --- a/tests/html-tests/tests/Bug6.html.ref +++ /dev/null @@ -1,335 +0,0 @@ - -Bug6
      Safe HaskellNone

      Bug6

      Description

      Exporting records. -

      Synopsis

      Documentation

      data A

      This record is exported without its field -

      Constructors

      A Int 

      data B

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

      Constructors

      B 

      Fields

      b :: Int
       

      data C

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

      Constructors

      C 

      Fields

      c1 :: Int
       
      c2 :: Int
       

      data D

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

      Constructors

      D Int Int 

      newtype E

      a newtype with a field -

      Constructors

      E Int 
      diff --git a/tests/html-tests/tests/Bug7.hs b/tests/html-tests/tests/Bug7.hs deleted file mode 100644 index 8cf57914..00000000 --- a/tests/html-tests/tests/Bug7.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | This module caused a duplicate instance in the documentation for the Foo --- type. -module Bug7 where - --- | The Foo datatype -data Foo = Foo - --- | The Bar class -class Bar x y - --- | Just one instance -instance Bar Foo Foo diff --git a/tests/html-tests/tests/Bug7.html.ref b/tests/html-tests/tests/Bug7.html.ref deleted file mode 100644 index 8ac72b16..00000000 --- a/tests/html-tests/tests/Bug7.html.ref +++ /dev/null @@ -1,173 +0,0 @@ - -Bug7
      Safe HaskellNone

      Bug7

      Description

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

      Synopsis

      Documentation

      data Foo

      The Foo datatype -

      Constructors

      Foo 

      Instances

      Bar Foo Foo

      Just one instance -

      class Bar x y

      The Bar class -

      Instances

      Bar Foo Foo

      Just one instance -

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

      Bug8

      Documentation

      data Typ

      Constructors

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

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

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

      s :: a

      t :: a

      main :: a

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

      BugDeprecated

      Synopsis

      Documentation

      foo :: Int

      Deprecated: for foo -

      baz :: Int

      Deprecated: for baz -

      bar :: Int

      Deprecated: for bar -

      one :: Int

      Deprecated: for one -

      some documentation for one, two and three -

      three :: Int

      Deprecated: for three -

      some documentation for one, two and three -

      two :: Int

      Deprecated: for two -

      some documentation for one, two and three -

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

      BugExportHeadings

      Synopsis

      Foo -

      foo :: Int

      Bar -

      bar :: Int

      Baz -

      baz :: Int

      One -

      one :: Int

      Deprecated: for one -

      Two -

      two :: Int

      Deprecated: for two -

      Three -

      three :: Int

      Deprecated: for three -

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

      Bugs

      Documentation

      data A a

      Constructors

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

      CrossPackageDocs

      Synopsis

      Documentation

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

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

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

      class IsString a where

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

      Methods

      fromString :: String -> a

      Instances

      runInteractiveProcess

      Arguments

      :: FilePath

      Filename of the executable (see proc for details) -

      -> [String]

      Arguments to pass to the executable -

      -> Maybe FilePath

      Optional path to the working directory -

      -> Maybe [(String, String)]

      Optional environment (otherwise inherit) -

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

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

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

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

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

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

      DeprecatedClass

      Synopsis

      Documentation

      class SomeClass a where

      Deprecated: SomeClass -

      some class -

      Methods

      foo :: a -> a

      Deprecated: foo -

      documentation for foo -

      class SomeOtherClass a where

      Deprecated: SomeOtherClass -

      Methods

      bar :: a -> a

      Deprecated: bar -

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

      DeprecatedData

      Synopsis

      Documentation

      data Foo

      Deprecated: Foo -

      type Foo -

      Constructors

      Foo

      Deprecated: Foo -

      constructor Foo -

      Bar

      Deprecated: Bar -

      constructor Bar -

      data One

      Deprecated: One -

      Constructors

      One

      Deprecated: One -

      Two

      Deprecated: Two -

      diff --git a/tests/html-tests/tests/DeprecatedFunction.hs b/tests/html-tests/tests/DeprecatedFunction.hs deleted file mode 100644 index 8d626435..00000000 --- a/tests/html-tests/tests/DeprecatedFunction.hs +++ /dev/null @@ -1,10 +0,0 @@ -module DeprecatedFunction where - --- | some documentation for foo -foo :: Int -foo = 23 -{-# DEPRECATED foo "use `bar` instead" #-} - --- | some documentation for bar -bar :: Int -bar = 42 diff --git a/tests/html-tests/tests/DeprecatedFunction.html.ref b/tests/html-tests/tests/DeprecatedFunction.html.ref deleted file mode 100644 index 1fc678bb..00000000 --- a/tests/html-tests/tests/DeprecatedFunction.html.ref +++ /dev/null @@ -1,110 +0,0 @@ - -DeprecatedFunction
      Safe HaskellNone

      DeprecatedFunction

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use bar instead -

      some documentation for foo -

      bar :: Int

      some documentation for bar -

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

      DeprecatedFunction2

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use bar instead -

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

      DeprecatedFunction3

      Synopsis

      Documentation

      foo :: Integer

      Deprecated: use bar instead -

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

      DeprecatedModule

      Description

      Deprecated: Use Foo instead -

      Documentation for DeprecatedModule. -

      Documentation

      foo :: Int

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

      DeprecatedModule2

      Description

      Deprecated: Use Foo instead -

      Documentation

      foo :: Int

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

      DeprecatedNewtype

      Documentation

      newtype SomeNewType

      Deprecated: SomeNewType -

      some documentation -

      Constructors

      SomeNewTypeConst String

      Deprecated: SomeNewTypeConst -

      constructor docu -

      newtype SomeOtherNewType

      Deprecated: SomeOtherNewType -

      Constructors

      SomeOtherNewTypeConst String

      Deprecated: SomeOtherNewTypeConst -

      diff --git a/tests/html-tests/tests/DeprecatedReExport.hs b/tests/html-tests/tests/DeprecatedReExport.hs deleted file mode 100644 index f851e2ff..00000000 --- a/tests/html-tests/tests/DeprecatedReExport.hs +++ /dev/null @@ -1,16 +0,0 @@ --- | --- What is tested here: --- --- * Deprecation messages are shown for re-exported items. --- -module DeprecatedReExport ( --- * Re-exported from an other module - foo --- * Re-exported from an other package --- | Not yet working, see --- , isEmptyChan -, -) where - -import DeprecatedFunction -import Control.Concurrent.Chan diff --git a/tests/html-tests/tests/DeprecatedReExport.html.ref b/tests/html-tests/tests/DeprecatedReExport.html.ref deleted file mode 100644 index 611c181d..00000000 --- a/tests/html-tests/tests/DeprecatedReExport.html.ref +++ /dev/null @@ -1,133 +0,0 @@ - -DeprecatedReExport
      Safe HaskellNone

      DeprecatedReExport

      Description

      What is tested here: -

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

      Synopsis

      Re-exported from an other module -

      foo :: Int

      Deprecated: use bar instead -

      some documentation for foo -

      Re-exported from an other package -

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

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

      DeprecatedRecord

      Synopsis

      Documentation

      data Foo

      type Foo -

      Constructors

      Foo 

      Fields

      fooName :: String

      some name -

      fooValue :: Int

      Deprecated: do not use this -

      some value -

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

      DeprecatedTypeFamily

      Synopsis

      Documentation

      data family SomeTypeFamily k :: * -> *

      Deprecated: SomeTypeFamily -

      some documentation -

      data family SomeOtherTypeFamily k :: * -> *

      Deprecated: SomeOtherTypeFamily -

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

      DeprecatedTypeSynonym

      Synopsis

      Documentation

      type TypeSyn = String

      Deprecated: TypeSyn -

      some documentation -

      type OtherTypeSyn = String

      Deprecated: OtherTypeSyn -

      diff --git a/tests/html-tests/tests/DeprecationMessageParseError.hs b/tests/html-tests/tests/DeprecationMessageParseError.hs deleted file mode 100644 index 2f8fb492..00000000 --- a/tests/html-tests/tests/DeprecationMessageParseError.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | --- What is tested here: --- --- * If parsing of a deprecation message fails, the message is included --- verbatim. --- -module DeprecationMessageParseError where - --- | some documentation for foo -foo :: Int -foo = 23 -{-# DEPRECATED foo "use @bar instead" #-} diff --git a/tests/html-tests/tests/DeprecationMessageParseError.html.ref b/tests/html-tests/tests/DeprecationMessageParseError.html.ref deleted file mode 100644 index 75f9bf54..00000000 --- a/tests/html-tests/tests/DeprecationMessageParseError.html.ref +++ /dev/null @@ -1,101 +0,0 @@ - -DeprecationMessageParseError
      Safe HaskellNone

      DeprecationMessageParseError

      Description

      What is tested here: -

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

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use @bar instead

      some documentation for foo -

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

      Examples

      Synopsis

      Documentation

      fib :: Integer -> Integer

      Fibonacci number of given Integer. -

      Examples: -

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

      One more Example: -

      >>> fib 5
      -5
      -

      One more Example: -

      >>> fib 5
      -5
      -

      Example with an import: -

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

      FunArgs

      Documentation

      f

      Arguments

      :: forall a . Ord a 
      => Int

      First argument -

      -> a

      Second argument -

      -> Bool

      Third argument -

      -> (a -> a)

      Fourth argument -

      -> ()

      Result -

      g

      Arguments

      :: a

      First argument -

      -> b

      Second argument -

      -> c

      Third argument -

      -> d

      Result -

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

      GADTRecords

      Synopsis

      Documentation

      data H1 a b where

      h1 -

      Constructors

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

      Fields

      field :: Int

      hello docs -

      C4 :: a -> H1 Int a 

      Fields

      field2 :: a

      hello2 docs -

      diff --git a/tests/html-tests/tests/Hash.hs b/tests/html-tests/tests/Hash.hs deleted file mode 100644 index 343b69e9..00000000 --- a/tests/html-tests/tests/Hash.hs +++ /dev/null @@ -1,51 +0,0 @@ -{- | - Implementation of fixed-size hash tables, with a type - class for constructing hash values for structured types. --} -module Hash ( - -- * The @HashTable@ type - HashTable, - - -- ** Operations on @HashTable@s - new, insert, lookup, - - -- * The @Hash@ class - Hash(..), - ) where - -import Data.Array -import Prelude hiding (lookup) - --- | A hash table with keys of type @key@ and values of type @val@. --- The type @key@ should be an instance of 'Eq'. -data HashTable key val = HashTable Int (Array Int [(key,val)]) - --- | Builds a new hash table with a given size -new :: (Eq key, Hash key) => Int -> IO (HashTable key val) -new = undefined - --- | Inserts a new element into the hash table -insert :: (Eq key, Hash key) => key -> val -> IO () -insert = undefined - --- | Looks up a key in the hash table, returns @'Just' val@ if the key --- was found, or 'Nothing' otherwise. -lookup :: Hash key => key -> IO (Maybe val) -lookup = undefined - --- | A class of types which can be hashed. -class Hash a where - -- | hashes the value of type @a@ into an 'Int' - hash :: a -> Int - -instance Hash Int where - hash = id - -instance Hash Float where - hash = trunc - -instance (Hash a, Hash b) => Hash (a,b) where - hash (a,b) = hash a `xor` hash b - -trunc = undefined -xor = undefined diff --git a/tests/html-tests/tests/Hash.html.ref b/tests/html-tests/tests/Hash.html.ref deleted file mode 100644 index b0cd183c..00000000 --- a/tests/html-tests/tests/Hash.html.ref +++ /dev/null @@ -1,337 +0,0 @@ - -Hash
      Safe HaskellNone

      Hash

      Description

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

      Synopsis

      The HashTable type -

      data HashTable key val

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

      Operations on HashTables -

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

      Builds a new hash table with a given size -

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

      Inserts a new element into the hash table -

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

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

      The Hash class -

      class Hash a where

      A class of types which can be hashed. -

      Methods

      hash :: a -> Int

      hashes the value of type a into an Int -

      Instances

      Hash Float 
      Hash Int 
      (Hash a, Hash b) => Hash (a, b) 
      diff --git a/tests/html-tests/tests/Hidden.hs b/tests/html-tests/tests/Hidden.hs deleted file mode 100644 index 896da648..00000000 --- a/tests/html-tests/tests/Hidden.hs +++ /dev/null @@ -1,6 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Hidden where - -hidden :: Int -> Int -hidden a = a diff --git a/tests/html-tests/tests/HiddenInstances.hs b/tests/html-tests/tests/HiddenInstances.hs deleted file mode 100644 index 99a6c2fd..00000000 --- a/tests/html-tests/tests/HiddenInstances.hs +++ /dev/null @@ -1,35 +0,0 @@ --- http://trac.haskell.org/haddock/ticket/37 -module HiddenInstances (VisibleClass, VisibleData) where - --- | Should be visible -class VisibleClass a - --- | Should *not* be visible -class HiddenClass a - --- | Should *not* be visible -data HiddenData = HiddenData - --- | Should be visible -data VisibleData = VisibleData - --- | Should be visible -instance VisibleClass Int - --- | Should be visible -instance VisibleClass VisibleData - --- | Should be visible -instance Num VisibleData - --- | Should *not* be visible -instance VisibleClass HiddenData - --- | Should *not* be visible -instance HiddenClass Int - --- | Should *not* be visible -instance HiddenClass VisibleData - --- | Should *not* be visible -instance HiddenClass HiddenData diff --git a/tests/html-tests/tests/HiddenInstances.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref deleted file mode 100644 index 999c114d..00000000 --- a/tests/html-tests/tests/HiddenInstances.html.ref +++ /dev/null @@ -1,169 +0,0 @@ - -HiddenInstances
      Safe HaskellNone

      HiddenInstances

      Synopsis

      Documentation

      class VisibleClass a

      Should be visible -

      Instances

      VisibleClass Int

      Should be visible -

      VisibleClass VisibleData

      Should be visible -

      data VisibleData

      Should be visible -

      Instances

      Num VisibleData

      Should be visible -

      VisibleClass VisibleData

      Should be visible -

      diff --git a/tests/html-tests/tests/HiddenInstancesA.hs b/tests/html-tests/tests/HiddenInstancesA.hs deleted file mode 100644 index f1775208..00000000 --- a/tests/html-tests/tests/HiddenInstancesA.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} -module HiddenInstancesA where - --- | Should be visible -class Foo a - --- | Should be visible -data Bar - --- | Should be visible -instance Foo Bar - --- | Should *not* be visible -data Baz - --- | Should *not* be visible -instance Foo Baz diff --git a/tests/html-tests/tests/HiddenInstancesB.hs b/tests/html-tests/tests/HiddenInstancesB.hs deleted file mode 100644 index eabf0637..00000000 --- a/tests/html-tests/tests/HiddenInstancesB.hs +++ /dev/null @@ -1,2 +0,0 @@ -module HiddenInstancesB (Foo, Bar) where -import HiddenInstancesA diff --git a/tests/html-tests/tests/HiddenInstancesB.html.ref b/tests/html-tests/tests/HiddenInstancesB.html.ref deleted file mode 100644 index 207a5146..00000000 --- a/tests/html-tests/tests/HiddenInstancesB.html.ref +++ /dev/null @@ -1,143 +0,0 @@ - -HiddenInstancesB
      Safe HaskellNone

      HiddenInstancesB

      Synopsis

      Documentation

      class Foo a

      Should be visible -

      Instances

      Foo Bar

      Should be visible -

      data Bar

      Should be visible -

      Instances

      Foo Bar

      Should be visible -

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

      Hyperlinks

      Synopsis

      Documentation

      foo :: Int

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

      A URL with a label: some link -

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

      IgnoreExports

      Synopsis

      Documentation

      foo :: Int

      documentation for foo -

      bar :: Int

      documentation for bar -

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

      ModuleWithWarning

      Description

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

      Documentation for ModuleWithWarning. -

      Documentation

      foo :: Int

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

      NamedDoc

      Synopsis

        Documentation

        bar -

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

        NoLayout

        Synopsis

        Documentation

        g :: Int

        the function g -

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

        NonGreedy

        Synopsis

        • f :: a

        Documentation

        f :: a

        diff --git a/tests/html-tests/tests/Properties.hs b/tests/html-tests/tests/Properties.hs deleted file mode 100644 index 05930ece..00000000 --- a/tests/html-tests/tests/Properties.hs +++ /dev/null @@ -1,9 +0,0 @@ -module Properties where - --- | Fibonacci number of given 'Integer'. --- --- prop> fib n <= fib (n + 1) -fib :: Integer -> Integer -fib 0 = 0 -fib 1 = 1 -fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/html-tests/tests/Properties.html.ref b/tests/html-tests/tests/Properties.html.ref deleted file mode 100644 index 1c4ce893..00000000 --- a/tests/html-tests/tests/Properties.html.ref +++ /dev/null @@ -1,92 +0,0 @@ - -Properties
        Safe HaskellNone

        Properties

        Synopsis

        Documentation

        fib :: Integer -> Integer

        Fibonacci number of given Integer. -

        fib n <= fib (n + 1)
        diff --git a/tests/html-tests/tests/PruneWithWarning.hs b/tests/html-tests/tests/PruneWithWarning.hs deleted file mode 100644 index bfa55ea2..00000000 --- a/tests/html-tests/tests/PruneWithWarning.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# OPTIONS_HADDOCK prune #-} --- | --- What is tested here: --- --- * If a binding has a deprecation message but no documentation, it is pruned --- when @OPTIONS_HADDOCK prune@ is used. --- -module PruneWithWarning (foo, bar) where - -foo :: Int -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} - -bar :: Int -bar = 42 diff --git a/tests/html-tests/tests/PruneWithWarning.html.ref b/tests/html-tests/tests/PruneWithWarning.html.ref deleted file mode 100644 index 3c31fbdf..00000000 --- a/tests/html-tests/tests/PruneWithWarning.html.ref +++ /dev/null @@ -1,72 +0,0 @@ - -PruneWithWarning
        Safe HaskellNone

        PruneWithWarning

        Description

        What is tested here: -

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

        QuasiExpr

        Documentation

        data BinOp

        Constructors

        AddOp 
        SubOp 
        MulOp 
        DivOp 

        Instances

        expr :: QuasiQuoter

        parseExprExp :: String -> Q Exp

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

        QuasiQuote

        Documentation

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

        TH

        Documentation

        decl :: Q [Dec]

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

        TH2

        Documentation

        f :: t -> t

        diff --git a/tests/html-tests/tests/Test.hs b/tests/html-tests/tests/Test.hs deleted file mode 100644 index d352f029..00000000 --- a/tests/html-tests/tests/Test.hs +++ /dev/null @@ -1,422 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Test --- Copyright : (c) Simon Marlow 2002 --- License : BSD-style --- --- Maintainer : libraries@haskell.org --- Stability : provisional --- Portability : portable --- --- This module illustrates & tests most of the features of Haddock. --- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. --- ------------------------------------------------------------------------------ - --- This is plain comment, ignored by Haddock. - -module Test ( - - -- Section headings are introduced with '-- *': - -- * Type declarations - - -- Subsection headings are introduced with '-- **' and so on. - -- ** Data types - T(..), T2, T3(..), T4(..), T5(..), T6(..), - N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), - - -- ** Records - R(..), R1(..), - - -- | test that we can export record selectors on their own: - p, q, u, - - -- * Class declarations - C(a,b), D(..), E, F(..), - - -- | Test that we can export a class method on its own: - a, - - -- * Function types - f, g, - - -- * Auxiliary stuff - - -- $aux1 - - -- $aux2 - - -- $aux3 - - -- $aux4 - - -- $aux5 - - -- $aux6 - - -- $aux7 - - -- $aux8 - - -- $aux9 - - -- $aux10 - - -- $aux11 - - -- $aux12 - - -- | This is some inline documentation in the export list - -- - -- > a code block using bird-tracks - -- > each line must begin with > (which isn't significant unless it - -- > is at the beginning of the line). - - -- * A hidden module - module Hidden, - - -- * A visible module - module Visible, - - {-| nested-style doc comments -} - - -- * Existential \/ Universal types - Ex(..), - - -- * Type signatures with argument docs - k, l, m, o, - - -- * A section - -- and without an intervening comma: - -- ** A subsection - -{-| - > a literal line - - $ a non /literal/ line $ --} - - f', - - withType, withoutType - ) where - -import Hidden -import Visible -import Data.Maybe - -bla = Nothing - --- | This comment applies to the /following/ declaration --- and it continues until the next non-comment line -data T a b - = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor - | -- | This comment describes the 'B' constructor - B (T a b, T Int Float) -- ^ - --- | An abstract data declaration -data T2 a b = T2 a b - --- | A data declaration with no documentation annotations on the constructors -data T3 a b = A1 a | B1 b - --- A data declaration with no documentation annotations at all -data T4 a b = A2 a | B2 b - --- A data declaration documentation on the constructors only -data T5 a b - = A3 a -- ^ documents 'A3' - | B3 b -- ^ documents 'B3' - --- | Testing alternative comment styles -data T6 - -- | This is the doc for 'A4' - = A4 - | B4 - | -- ^ This is the doc for 'B4' - - -- | This is the doc for 'C4' - C4 - --- | A newtype -newtype N1 a = N1 a - --- | A newtype with a fieldname -newtype N2 a b = N2 {n :: a b} - --- | A newtype with a fieldname, documentation on the field -newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field - } - --- | An abstract newtype - we show this one as data rather than newtype because --- the difference isn\'t visible to the programmer for an abstract type. -newtype N4 a b = N4 a - -newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor - } - -newtype N6 a b = N6 {n6 :: a b - } - -- ^ docs on the constructor only - --- | docs on the newtype and the constructor -newtype N7 a b = N7 {n7 :: a b - } - -- ^ The 'N7' constructor - - -class (D a) => C a where - -- |this is a description of the 'a' method - a :: IO a - b :: [a] - -- ^ this is a description of the 'b' method - c :: a -- c is hidden in the export list - --- ^ This comment applies to the /previous/ declaration (the 'C' class) - -class D a where - d :: T a b - e :: (a,a) --- ^ This is a class declaration with no separate docs for the methods - -instance D Int where - d = undefined - e = undefined - --- instance with a qualified class name -instance Test.D Float where - d = undefined - e = undefined - -class E a where - ee :: a --- ^ This is a class declaration with no methods (or no methods exported) - --- This is a class declaration with no documentation at all -class F a where - ff :: a - --- | This is the documentation for the 'R' record, which has four fields, --- 'p', 'q', 'r', and 's'. -data R = - -- | This is the 'C1' record constructor, with the following fields: - C1 { p :: Int -- ^ This comment applies to the 'p' field - , q :: forall a . a->a -- ^ This comment applies to the 'q' field - , -- | This comment applies to both 'r' and 's' - r,s :: Int - } - | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), - u,v :: Int - } - -- ^ This is the 'C2' record constructor, also with some fields: - --- | Testing different record commenting styles -data R1 - -- | This is the 'C3' record constructor - = C3 { - -- | The 's1' record selector - s1 :: Int - -- | The 's2' record selector - , s2 :: Int - , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. - -- Since GHC doesn't allow that, I have removed it in this file. - -- ^ The 's3' record selector - } - --- These section headers are only used when there is no export list to --- give the structure of the documentation: - --- * This is a section header (level 1) --- ** This is a section header (level 2) --- *** This is a section header (level 3) - -{-| -In a comment string we can refer to identifiers in scope with -single quotes like this: 'T', and we can refer to modules by -using double quotes: "Foo". We can add emphasis /like this/. - - * This is a bulleted list - - - This is the next item (different kind of bullet) - - (1) This is an ordered list - - 2. This is the next item (different kind of bullet) - - [cat] a small, furry, domesticated mammal - - [pineapple] a fruit grown in the tropics - -@ - This is a block of code, which can include other markup: 'R' - formatting - is - significant -@ - -> this is another block of code - -We can also include URLs in documentation: . --} - -f :: C a => a -> Int - --- | we can export foreign declarations too -foreign import ccall g :: Int -> IO CInt - --- | this doc string has a parse error in it: \' -h :: Int -h = 42 - - --- $aux1 This is some documentation that is attached to a name ($aux1) --- rather than a source declaration. The documentation may be --- referred to in the export list using its name. --- --- @ code block in named doc @ - --- $aux2 This is some documentation that is attached to a name ($aux2) - --- $aux3 --- @ code block on its own in named doc @ - --- $aux4 --- --- @ code block on its own in named doc (after newline) @ - -{- $aux5 a nested, named doc comment - - with a paragraph, - - @ and a code block @ --} - --- some tests for various arrangements of code blocks: - -{- $aux6 ->test ->test1 - -@ test2 - test3 -@ --} - -{- $aux7 -@ -test1 -test2 -@ --} - -{- $aux8 ->test3 ->test4 --} - -{- $aux9 -@ -test1 -test2 -@ - ->test3 ->test4 --} - -{- $aux10 ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- This one is currently wrong (Haddock 0.4). The @...@ part is --- interpreted as part of the bird-tracked code block. -{- $aux11 -aux11: - ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- $aux12 --- > foo --- --- > bar --- - --- | A data-type using existential\/universal types -data Ex a - = forall b . C b => Ex1 b - | forall b . Ex2 b - | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file - | Ex4 (forall a . a -> a) - --- | This is a function with documentation for each argument -k :: T () () -- ^ This argument has type 'T' - -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' - -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ - -> T5 () () -- ^ This argument has a very long description that should - -- hopefully cause some wrapping to happen when it is finally - -- rendered by Haddock in the generated HTML page. - -> IO () -- ^ This is the result type - --- This function has arg docs but no docs for the function itself -l :: (Int, Int, Float) -- ^ takes a triple - -> Int -- ^ returns an 'Int' - --- | This function has some arg docs -m :: R - -> N1 () -- ^ one of the arguments - -> IO Int -- ^ and the return value - --- | This function has some arg docs but not a return value doc - --- can't use the original name ('n') with GHC -newn :: R -- ^ one of the arguments, an 'R' - -> N1 () -- ^ one of the arguments - -> IO Int -newn = undefined - - --- | A foreign import with argument docs -foreign import ccall unsafe - o :: Float -- ^ The input float - -> IO Float -- ^ The output float - --- | We should be able to escape this: \#\#\# - --- p :: Int --- can't use the above original definition with GHC -newp :: Int -newp = undefined - --- | a function with a prime can be referred to as 'f'' --- but f' doesn't get link'd 'f\'' -f' :: Int - --- | Comment on a definition without type signature -withoutType = undefined - --- | Comment on a definition with type signature -withType :: Int -withType = 1 - --- Add some definitions here so that this file can be compiled with GHC - -data T1 -f = undefined -f' = undefined -type CInt = Int -k = undefined -l = undefined -m = undefined diff --git a/tests/html-tests/tests/Test.html.ref b/tests/html-tests/tests/Test.html.ref deleted file mode 100644 index f2ef2b28..00000000 --- a/tests/html-tests/tests/Test.html.ref +++ /dev/null @@ -1,2245 +0,0 @@ - -Test
        Portabilityportable
        Stabilityprovisional
        Maintainerlibraries@haskell.org
        Safe HaskellNone

        Test

        Description

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

        Synopsis

        Type declarations -

        Data types -

        data T a b

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

        Constructors

        A Int (Maybe Float)

        This comment describes the A constructor -

        B (T a b, T Int Float)

        This comment describes the B constructor -

        data T2 a b

        An abstract data declaration -

        data T3 a b

        A data declaration with no documentation annotations on the constructors -

        Constructors

        A1 a 
        B1 b 

        data T4 a b

        Constructors

        A2 a 
        B2 b 

        data T5 a b

        Constructors

        A3 a

        documents A3 -

        B3 b

        documents B3 -

        data T6

        Testing alternative comment styles -

        Constructors

        A4

        This is the doc for A4 -

        B4

        This is the doc for B4 -

        C4

        This is the doc for C4 -

        newtype N1 a

        A newtype -

        Constructors

        N1 a 

        newtype N2 a b

        A newtype with a fieldname -

        Constructors

        N2 

        Fields

        n :: a b
         

        newtype N3 a b

        A newtype with a fieldname, documentation on the field -

        Constructors

        N3 

        Fields

        n3 :: a b

        this is the n3 field -

        data N4 a b

        An abstract newtype - we show this one as data rather than newtype because - the difference isn't visible to the programmer for an abstract type. -

        newtype N5 a b

        Constructors

        N5 

        Fields

        n5 :: a b

        no docs on the datatype or the constructor -

        newtype N6 a b

        Constructors

        N6

        docs on the constructor only -

        Fields

        n6 :: a b
         

        newtype N7 a b

        docs on the newtype and the constructor -

        Constructors

        N7

        The N7 constructor -

        Fields

        n7 :: a b
         

        Records -

        data R

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

        Constructors

        C1

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

        Fields

        p :: Int

        This comment applies to the p field -

        q :: forall a. a -> a

        This comment applies to the q field -

        r :: Int

        This comment applies to both r and s -

        s :: Int

        This comment applies to both r and s -

        C2

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

        Fields

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

        data R1

        Testing different record commenting styles -

        Constructors

        C3

        This is the C3 record constructor -

        Fields

        s1 :: Int

        The s1 record selector -

        s2 :: Int

        The s2 record selector -

        s3 :: Int

        The s3 record selector -

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

        Class declarations -

        class D a => C a where

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

        Methods

        a :: IO a

        this is a description of the a method -

        b :: [a]

        this is a description of the b method -

        class D a where

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

        Methods

        d :: T a b

        e :: (a, a)

        Instances

        class E a

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

        class F a where

        Methods

        ff :: a

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

        Function types -

        f :: C a => a -> Int

        In a comment string we can refer to identifiers in scope with -single quotes like this: T, and we can refer to modules by -using double quotes: Foo. We can add emphasis like this. -

        • This is a bulleted list -
        • This is the next item (different kind of bullet) -
        1. This is an ordered list -
        2. This is the next item (different kind of bullet) -
        cat
        a small, furry, domesticated mammal -
        pineapple
        a fruit grown in the tropics -
        -     This is a block of code, which can include other markup: R
        -     formatting
        -               is
        -                 significant
        -
         this is another block of code
        -

        We can also include URLs in documentation: http://www.haskell.org/. -

        g :: Int -> IO CInt

        we can export foreign declarations too -

        Auxiliary stuff -

        This is some documentation that is attached to a name ($aux1) - rather than a source declaration. The documentation may be - referred to in the export list using its name. -

         code block in named doc

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

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

        a nested, named doc comment -

        with a paragraph, -

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

        aux11: -

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

        This is some inline documentation in the export list -

         a code block using bird-tracks
        - each line must begin with > (which isn't significant unless it
        - is at the beginning of the line).
        -

        A hidden module -

        hidden :: Int -> Int

        A visible module -

        module Visible

        nested-style doc comments -

        Existential / Universal types -

        data Ex a

        A data-type using existential/universal types -

        Constructors

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

        Type signatures with argument docs -

        k

        Arguments

        :: T () ()

        This argument has type T -

        -> T2 Int Int

        This argument has type 'T2 Int Int' -

        -> (T3 Bool Bool -> T4 Float Float)

        This argument has type T3 Bool Bool -> T4 Float Float -

        -> T5 () ()

        This argument has a very long description that should - hopefully cause some wrapping to happen when it is finally - rendered by Haddock in the generated HTML page. -

        -> IO ()

        This is the result type -

        This is a function with documentation for each argument -

        l

        Arguments

        :: (Int, Int, Float)

        takes a triple -

        -> Int

        returns an Int -

        m

        Arguments

        :: R 
        -> N1 ()

        one of the arguments -

        -> IO Int

        and the return value -

        This function has some arg docs -

        o

        Arguments

        :: Float

        The input float -

        -> IO Float

        The output float -

        A foreign import with argument docs -

        A section -

        A subsection -

         a literal line
        -

        $ a non literal line $ -

        f' :: Int

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

        withType :: Int

        Comment on a definition with type signature -

        withoutType :: a

        Comment on a definition without type signature -

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

        Ticket112

        Synopsis

        • f :: a

        Documentation

        f :: a

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

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

        Ticket61

        Documentation

        class C a where

        Methods

        f :: a

        A comment about f -

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

        Ticket75

        Synopsis

        Documentation

        data a :- b

        Constructors

        Q 

        f :: Int

        A reference to :- -

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

        TypeFamilies

        Synopsis

        Documentation

        type family G a :: *

        Type family G -

        class A a where

        A class with an associated type -

        Associated Types

        data B a :: * -> *

        An associated type -

        Methods

        f :: B a Int

        A method -

        Instances

        A Int 

        type family F a

        Doc for family -

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

        TypeOperators

        Contents

        Synopsis

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

        stuff -

        data a :-: b

        data (a :+: b) c

        data Op a b

        newtype O g f a

        Constructors

        O 

        Fields

        unO :: g (f a)
         

        biO :: (g `O` f) a

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

        Unicode

        Synopsis

        Documentation

        x :: Int

        γλώσσα -

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

        Visible

        Documentation

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

        A

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

        AdvanceTypes

        data Pattern

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

        B

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

        Bug1

        data T

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

        Bug2

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

        Bug3

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

        Bug4

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

        Bug6

        data A

        data B

        data C

        data D

        data E

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

        Bug7

        data Foo

        class Bar x y

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

        Bug8

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

        BugDeprecated

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

        BugExportHeadings

        Foo -

        Bar -

        Baz -

        One -

        Two -

        Three -

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

        Bugs

        data A a

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

        CrossPackageDocs

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

        DeprecatedClass

        class SomeClass a

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

        DeprecatedData

        data Foo

        data One

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

        DeprecatedFunction

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

        DeprecatedFunction2

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

        DeprecatedFunction3

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

        DeprecatedModule

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

        DeprecatedModule2

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

        DeprecatedNewtype

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

        DeprecatedReExport

        Re-exported from an other module -

        Re-exported from an other package -

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

        DeprecatedRecord

        data Foo

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

        DeprecatedTypeFamily

        data family SomeTypeFamily k :: * -> *

        data family SomeOtherTypeFamily k :: * -> *

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

        DeprecatedTypeSynonym

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

        DeprecationMessageParseError

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

        Examples

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

        FunArgs

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

        GADTRecords

        data H1 a b

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

        Hash

        The HashTable type -

        data HashTable key val

        Operations on HashTables -

        The Hash class -

        class Hash a

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

        HiddenInstances

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

        HiddenInstancesB

        class Foo a

        data Bar

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

        Hyperlinks

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

        IgnoreExports

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

        ModuleWithWarning

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

        NamedDoc

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

        NoLayout

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

        NonGreedy

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

        Properties

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

        PruneWithWarning

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

        QuasiExpr

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

        QuasiQuote

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

        TH

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

        TH2

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

        Test

        Type declarations -

        Data types -

        data T a b

        data T2 a b

        data T3 a b

        data T4 a b

        data T5 a b

        data T6

        data N1 a

        data N2 a b

        data N3 a b

        data N4 a b

        data N5 a b

        data N6 a b

        data N7 a b

        Records -

        data R

        data R1

        Class declarations -

        class C a

        class D a

        class E a

        class F a

        Function types -

        Auxiliary stuff -

        A hidden module -

        A visible module -

        Existential / Universal types -

        data Ex a

        Type signatures with argument docs -

        A section -

        A subsection -

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

        Ticket112

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

        Ticket61

        class C a

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

        Ticket75

        data a :- b

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

        TypeFamilies

        type family G a :: *

        class A a

        type family F a

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

        TypeOperators

        stuff -

        data a :-: b

        data (a :+: b) c

        data Op a b

        data O g f a

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

        Unicode

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

        Visible

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

        A

        Synopsis

        Documentation

        data A

        Constructors

        A 

        test2 :: Bool

        Doc for test2 +

        data X

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

        Constructors

        X

        Doc for consructor +

        reExport :: Int

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

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

        AdvanceTypes

        Documentation

        data Pattern where

        Constructors

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

        B

        Synopsis

        Documentation

        module A

        test :: Int

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

        reExport :: Int

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

        data X

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

        Constructors

        X

        Doc for consructor +

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

        Bug1

        Synopsis

        • data T = T

        Documentation

        data T

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

        Constructors

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

        Bug2

        Documentation

        x :: A

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

        Bug3

        Synopsis

        Documentation

        foo :: Int

        /multi-line + emphasis/ +

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

        Bug4

        Synopsis

        Documentation

        foo :: Int

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

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

        Bug6

        Description

        Exporting records. +

        Synopsis

        Documentation

        data A

        This record is exported without its field +

        Constructors

        A Int 

        data B

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

        Constructors

        B 

        Fields

        b :: Int
         

        data C

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

        Constructors

        C 

        Fields

        c1 :: Int
         
        c2 :: Int
         

        data D

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

        Constructors

        D Int Int 

        newtype E

        a newtype with a field +

        Constructors

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

        Bug7

        Description

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

        Synopsis

        Documentation

        data Foo

        The Foo datatype +

        Constructors

        Foo 

        Instances

        Bar Foo Foo

        Just one instance +

        class Bar x y

        The Bar class +

        Instances

        Bar Foo Foo

        Just one instance +

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

        Bug8

        Documentation

        data Typ

        Constructors

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

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

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

        s :: a

        t :: a

        main :: a

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

        BugDeprecated

        Synopsis

        Documentation

        foo :: Int

        Deprecated: for foo +

        baz :: Int

        Deprecated: for baz +

        bar :: Int

        Deprecated: for bar +

        one :: Int

        Deprecated: for one +

        some documentation for one, two and three +

        three :: Int

        Deprecated: for three +

        some documentation for one, two and three +

        two :: Int

        Deprecated: for two +

        some documentation for one, two and three +

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

        BugExportHeadings

        Synopsis

        Foo +

        foo :: Int

        Bar +

        bar :: Int

        Baz +

        baz :: Int

        One +

        one :: Int

        Deprecated: for one +

        Two +

        two :: Int

        Deprecated: for two +

        Three +

        three :: Int

        Deprecated: for three +

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

        Bugs

        Documentation

        data A a

        Constructors

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

        CrossPackageDocs

        Synopsis

        Documentation

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

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

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

        class IsString a where

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

        Methods

        fromString :: String -> a

        Instances

        runInteractiveProcess

        Arguments

        :: FilePath

        Filename of the executable (see proc for details) +

        -> [String]

        Arguments to pass to the executable +

        -> Maybe FilePath

        Optional path to the working directory +

        -> Maybe [(String, String)]

        Optional environment (otherwise inherit) +

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

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

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

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

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

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

        DeprecatedClass

        Synopsis

        Documentation

        class SomeClass a where

        Deprecated: SomeClass +

        some class +

        Methods

        foo :: a -> a

        Deprecated: foo +

        documentation for foo +

        class SomeOtherClass a where

        Deprecated: SomeOtherClass +

        Methods

        bar :: a -> a

        Deprecated: bar +

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

        DeprecatedData

        Synopsis

        Documentation

        data Foo

        Deprecated: Foo +

        type Foo +

        Constructors

        Foo

        Deprecated: Foo +

        constructor Foo +

        Bar

        Deprecated: Bar +

        constructor Bar +

        data One

        Deprecated: One +

        Constructors

        One

        Deprecated: One +

        Two

        Deprecated: Two +

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

        DeprecatedFunction

        Synopsis

        Documentation

        foo :: Int

        Deprecated: use bar instead +

        some documentation for foo +

        bar :: Int

        some documentation for bar +

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

        DeprecatedFunction2

        Synopsis

        Documentation

        foo :: Int

        Deprecated: use bar instead +

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

        DeprecatedFunction3

        Synopsis

        Documentation

        foo :: Integer

        Deprecated: use bar instead +

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

        DeprecatedModule

        Description

        Deprecated: Use Foo instead +

        Documentation for DeprecatedModule. +

        Documentation

        foo :: Int

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

        DeprecatedModule2

        Description

        Deprecated: Use Foo instead +

        Documentation

        foo :: Int

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

        DeprecatedNewtype

        Documentation

        newtype SomeNewType

        Deprecated: SomeNewType +

        some documentation +

        Constructors

        SomeNewTypeConst String

        Deprecated: SomeNewTypeConst +

        constructor docu +

        newtype SomeOtherNewType

        Deprecated: SomeOtherNewType +

        Constructors

        SomeOtherNewTypeConst String

        Deprecated: SomeOtherNewTypeConst +

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

        DeprecatedReExport

        Description

        What is tested here: +

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

        Synopsis

        Re-exported from an other module +

        foo :: Int

        Deprecated: use bar instead +

        some documentation for foo +

        Re-exported from an other package +

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

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

        DeprecatedRecord

        Synopsis

        Documentation

        data Foo

        type Foo +

        Constructors

        Foo 

        Fields

        fooName :: String

        some name +

        fooValue :: Int

        Deprecated: do not use this +

        some value +

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

        DeprecatedTypeFamily

        Synopsis

        Documentation

        data family SomeTypeFamily k :: * -> *

        Deprecated: SomeTypeFamily +

        some documentation +

        data family SomeOtherTypeFamily k :: * -> *

        Deprecated: SomeOtherTypeFamily +

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

        DeprecatedTypeSynonym

        Synopsis

        Documentation

        type TypeSyn = String

        Deprecated: TypeSyn +

        some documentation +

        type OtherTypeSyn = String

        Deprecated: OtherTypeSyn +

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

        DeprecationMessageParseError

        Description

        What is tested here: +

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

        Synopsis

        Documentation

        foo :: Int

        Deprecated: use @bar instead

        some documentation for foo +

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

        Examples

        Synopsis

        Documentation

        fib :: Integer -> Integer

        Fibonacci number of given Integer. +

        Examples: +

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

        One more Example: +

        >>> fib 5
        +5
        +

        One more Example: +

        >>> fib 5
        +5
        +

        Example with an import: +

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

        FunArgs

        Documentation

        f

        Arguments

        :: forall a . Ord a 
        => Int

        First argument +

        -> a

        Second argument +

        -> Bool

        Third argument +

        -> (a -> a)

        Fourth argument +

        -> ()

        Result +

        g

        Arguments

        :: a

        First argument +

        -> b

        Second argument +

        -> c

        Third argument +

        -> d

        Result +

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

        GADTRecords

        Synopsis

        Documentation

        data H1 a b where

        h1 +

        Constructors

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

        Fields

        field :: Int

        hello docs +

        C4 :: a -> H1 Int a 

        Fields

        field2 :: a

        hello2 docs +

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

        Hash

        Description

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

        Synopsis

        The HashTable type +

        data HashTable key val

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

        Operations on HashTables +

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

        Builds a new hash table with a given size +

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

        Inserts a new element into the hash table +

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

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

        The Hash class +

        class Hash a where

        A class of types which can be hashed. +

        Methods

        hash :: a -> Int

        hashes the value of type a into an Int +

        Instances

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

        HiddenInstances

        Synopsis

        Documentation

        class VisibleClass a

        Should be visible +

        Instances

        VisibleClass Int

        Should be visible +

        VisibleClass VisibleData

        Should be visible +

        data VisibleData

        Should be visible +

        Instances

        Num VisibleData

        Should be visible +

        VisibleClass VisibleData

        Should be visible +

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

        HiddenInstancesB

        Synopsis

        Documentation

        class Foo a

        Should be visible +

        Instances

        Foo Bar

        Should be visible +

        data Bar

        Should be visible +

        Instances

        Foo Bar

        Should be visible +

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

        Hyperlinks

        Synopsis

        Documentation

        foo :: Int

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

        A URL with a label: some link +

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

        IgnoreExports

        Synopsis

        Documentation

        foo :: Int

        documentation for foo +

        bar :: Int

        documentation for bar +

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

        ModuleWithWarning

        Description

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

        Documentation for ModuleWithWarning. +

        Documentation

        foo :: Int

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

        NamedDoc

        Synopsis

          Documentation

          bar +

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

          NoLayout

          Synopsis

          Documentation

          g :: Int

          the function g +

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

          NonGreedy

          Synopsis

          • f :: a

          Documentation

          f :: a

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

          Properties

          Synopsis

          Documentation

          fib :: Integer -> Integer

          Fibonacci number of given Integer. +

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

          PruneWithWarning

          Description

          What is tested here: +

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

          QuasiExpr

          Documentation

          data BinOp

          Constructors

          AddOp 
          SubOp 
          MulOp 
          DivOp 

          Instances

          expr :: QuasiQuoter

          parseExprExp :: String -> Q Exp

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

          QuasiQuote

          Documentation

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

          TH

          Documentation

          decl :: Q [Dec]

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

          TH2

          Documentation

          f :: t -> t

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

          Test

          Description

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

          Synopsis

          Type declarations +

          Data types +

          data T a b

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

          Constructors

          A Int (Maybe Float)

          This comment describes the A constructor +

          B (T a b, T Int Float)

          This comment describes the B constructor +

          data T2 a b

          An abstract data declaration +

          data T3 a b

          A data declaration with no documentation annotations on the constructors +

          Constructors

          A1 a 
          B1 b 

          data T4 a b

          Constructors

          A2 a 
          B2 b 

          data T5 a b

          Constructors

          A3 a

          documents A3 +

          B3 b

          documents B3 +

          data T6

          Testing alternative comment styles +

          Constructors

          A4

          This is the doc for A4 +

          B4

          This is the doc for B4 +

          C4

          This is the doc for C4 +

          newtype N1 a

          A newtype +

          Constructors

          N1 a 

          newtype N2 a b

          A newtype with a fieldname +

          Constructors

          N2 

          Fields

          n :: a b
           

          newtype N3 a b

          A newtype with a fieldname, documentation on the field +

          Constructors

          N3 

          Fields

          n3 :: a b

          this is the n3 field +

          data N4 a b

          An abstract newtype - we show this one as data rather than newtype because + the difference isn't visible to the programmer for an abstract type. +

          newtype N5 a b

          Constructors

          N5 

          Fields

          n5 :: a b

          no docs on the datatype or the constructor +

          newtype N6 a b

          Constructors

          N6

          docs on the constructor only +

          Fields

          n6 :: a b
           

          newtype N7 a b

          docs on the newtype and the constructor +

          Constructors

          N7

          The N7 constructor +

          Fields

          n7 :: a b
           

          Records +

          data R

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

          Constructors

          C1

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

          Fields

          p :: Int

          This comment applies to the p field +

          q :: forall a. a -> a

          This comment applies to the q field +

          r :: Int

          This comment applies to both r and s +

          s :: Int

          This comment applies to both r and s +

          C2

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

          Fields

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

          data R1

          Testing different record commenting styles +

          Constructors

          C3

          This is the C3 record constructor +

          Fields

          s1 :: Int

          The s1 record selector +

          s2 :: Int

          The s2 record selector +

          s3 :: Int

          The s3 record selector +

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

          Class declarations +

          class D a => C a where

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

          Methods

          a :: IO a

          this is a description of the a method +

          b :: [a]

          this is a description of the b method +

          class D a where

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

          Methods

          d :: T a b

          e :: (a, a)

          Instances

          class E a

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

          class F a where

          Methods

          ff :: a

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

          Function types +

          f :: C a => a -> Int

          In a comment string we can refer to identifiers in scope with +single quotes like this: T, and we can refer to modules by +using double quotes: Foo. We can add emphasis like this. +

          • This is a bulleted list +
          • This is the next item (different kind of bullet) +
          1. This is an ordered list +
          2. This is the next item (different kind of bullet) +
          cat
          a small, furry, domesticated mammal +
          pineapple
          a fruit grown in the tropics +
          +     This is a block of code, which can include other markup: R
          +     formatting
          +               is
          +                 significant
          +
           this is another block of code
          +

          We can also include URLs in documentation: http://www.haskell.org/. +

          g :: Int -> IO CInt

          we can export foreign declarations too +

          Auxiliary stuff +

          This is some documentation that is attached to a name ($aux1) + rather than a source declaration. The documentation may be + referred to in the export list using its name. +

           code block in named doc

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

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

          a nested, named doc comment +

          with a paragraph, +

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

          aux11: +

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

          This is some inline documentation in the export list +

           a code block using bird-tracks
          + each line must begin with > (which isn't significant unless it
          + is at the beginning of the line).
          +

          A hidden module +

          hidden :: Int -> Int

          A visible module +

          module Visible

          nested-style doc comments +

          Existential / Universal types +

          data Ex a

          A data-type using existential/universal types +

          Constructors

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

          Type signatures with argument docs +

          k

          Arguments

          :: T () ()

          This argument has type T +

          -> T2 Int Int

          This argument has type 'T2 Int Int' +

          -> (T3 Bool Bool -> T4 Float Float)

          This argument has type T3 Bool Bool -> T4 Float Float +

          -> T5 () ()

          This argument has a very long description that should + hopefully cause some wrapping to happen when it is finally + rendered by Haddock in the generated HTML page. +

          -> IO ()

          This is the result type +

          This is a function with documentation for each argument +

          l

          Arguments

          :: (Int, Int, Float)

          takes a triple +

          -> Int

          returns an Int +

          m

          Arguments

          :: R 
          -> N1 ()

          one of the arguments +

          -> IO Int

          and the return value +

          This function has some arg docs +

          o

          Arguments

          :: Float

          The input float +

          -> IO Float

          The output float +

          A foreign import with argument docs +

          A section +

          A subsection +

           a literal line
          +

          $ a non literal line $ +

          f' :: Int

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

          withType :: Int

          Comment on a definition with type signature +

          withoutType :: a

          Comment on a definition without type signature +

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

          Ticket112

          Synopsis

          • f :: a

          Documentation

          f :: a

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

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

          Ticket61

          Documentation

          class C a where

          Methods

          f :: a

          A comment about f +

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

          Ticket75

          Synopsis

          Documentation

          data a :- b

          Constructors

          Q 

          f :: Int

          A reference to :- +

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

          TypeFamilies

          Synopsis

          Documentation

          type family G a :: *

          Type family G +

          class A a where

          A class with an associated type +

          Associated Types

          data B a :: * -> *

          An associated type +

          Methods

          f :: B a Int

          A method +

          Instances

          A Int 

          type family F a

          Doc for family +

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

          TypeOperators

          Contents

          Synopsis

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

          stuff +

          data a :-: b

          data (a :+: b) c

          data Op a b

          newtype O g f a

          Constructors

          O 

          Fields

          unO :: g (f a)
           

          biO :: (g `O` f) a

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

          Unicode

          Synopsis

          Documentation

          x :: Int

          γλώσσα +

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

          Visible

          Documentation

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

          A

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

          AdvanceTypes

          data Pattern

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

          B

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

          Bug1

          data T

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

          Bug2

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

          Bug3

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

          Bug4

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

          Bug6

          data A

          data B

          data C

          data D

          data E

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

          Bug7

          data Foo

          class Bar x y

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

          Bug8

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

          BugDeprecated

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

          BugExportHeadings

          Foo +

          Bar +

          Baz +

          One +

          Two +

          Three +

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

          Bugs

          data A a

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

          CrossPackageDocs

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

          DeprecatedClass

          class SomeClass a

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

          DeprecatedData

          data Foo

          data One

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

          DeprecatedFunction

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

          DeprecatedFunction2

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

          DeprecatedFunction3

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

          DeprecatedModule

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

          DeprecatedModule2

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

          DeprecatedNewtype

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

          DeprecatedReExport

          Re-exported from an other module +

          Re-exported from an other package +

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

          DeprecatedRecord

          data Foo

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

          DeprecatedTypeFamily

          data family SomeTypeFamily k :: * -> *

          data family SomeOtherTypeFamily k :: * -> *

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

          DeprecatedTypeSynonym

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

          DeprecationMessageParseError

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

          Examples

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

          FunArgs

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

          GADTRecords

          data H1 a b

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

          Hash

          The HashTable type +

          data HashTable key val

          Operations on HashTables +

          The Hash class +

          class Hash a

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

          HiddenInstances

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

          HiddenInstancesB

          class Foo a

          data Bar

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

          Hyperlinks

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

          IgnoreExports

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

          ModuleWithWarning

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

          NamedDoc

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

          NoLayout

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

          NonGreedy

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

          Properties

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

          PruneWithWarning

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

          QuasiExpr

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

          QuasiQuote

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

          TH

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

          TH2

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

          Test

          Type declarations +

          Data types +

          data T a b

          data T2 a b

          data T3 a b

          data T4 a b

          data T5 a b

          data T6

          data N1 a

          data N2 a b

          data N3 a b

          data N4 a b

          data N5 a b

          data N6 a b

          data N7 a b

          Records +

          data R

          data R1

          Class declarations +

          class C a

          class D a

          class E a

          class F a

          Function types +

          Auxiliary stuff +

          A hidden module +

          A visible module +

          Existential / Universal types +

          data Ex a

          Type signatures with argument docs +

          A section +

          A subsection +

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

          Ticket112

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

          Ticket61

          class C a

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

          Ticket75

          data a :- b

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

          TypeFamilies

          type family G a :: *

          class A a

          type family F a

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

          TypeOperators

          stuff +

          data a :-: b

          data (a :+: b) c

          data Op a b

          data O g f a

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

          Unicode

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

          Visible

          diff --git a/html-test/runtests.hs b/html-test/runtests.hs index 292deb8b..1898cde3 100644 --- a/html-test/runtests.hs +++ b/html-test/runtests.hs @@ -26,6 +26,7 @@ dataDir = packageRoot "resources" haddockPath = packageRoot "dist" "build" "haddock" "haddock" testSuiteRoot = packageRoot "html-test" testDir = testSuiteRoot "tests" +refDir = testSuiteRoot "ref" outDir = testSuiteRoot "output" @@ -102,12 +103,11 @@ test = do check :: [FilePath] -> Bool -> IO () check modules strict = do forM_ modules $ \mod -> do - let outfile = outDir dropExtension mod ++ ".html" - let reffile = testDir dropExtension mod ++ ".html.ref" + let outfile = outDir dropExtension mod ++ ".html" + let reffile = refDir dropExtension mod ++ ".html" b <- doesFileExist reffile if b then do - copyFile reffile (outDir takeFileName reffile) out <- readFile outfile ref <- readFile reffile if not $ haddockEq out ref @@ -116,7 +116,7 @@ check modules strict = do let ref' = stripLinks ref out' = stripLinks out let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".ref.nolinks" writeFile reffile' ref' writeFile outfile' out' r <- programOnPath "colordiff" diff --git a/html-test/tests/A.html.ref b/html-test/tests/A.html.ref deleted file mode 100644 index 328fec02..00000000 --- a/html-test/tests/A.html.ref +++ /dev/null @@ -1,183 +0,0 @@ - -A
          Safe HaskellNone

          A

          Synopsis

          Documentation

          data A

          Constructors

          A 

          test2 :: Bool

          Doc for test2 -

          data X

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

          Constructors

          X

          Doc for consructor -

          reExport :: Int

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

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

          AdvanceTypes

          Documentation

          data Pattern where

          Constructors

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

          B

          Synopsis

          Documentation

          module A

          test :: Int

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

          reExport :: Int

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

          data X

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

          Constructors

          X

          Doc for consructor -

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

          Bug1

          Synopsis

          • data T = T

          Documentation

          data T

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

          Constructors

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

          Bug2

          Documentation

          x :: A

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

          Bug3

          Synopsis

          Documentation

          foo :: Int

          /multi-line - emphasis/ -

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

          Bug4

          Synopsis

          Documentation

          foo :: Int

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

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

          Bug6

          Description

          Exporting records. -

          Synopsis

          Documentation

          data A

          This record is exported without its field -

          Constructors

          A Int 

          data B

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

          Constructors

          B 

          Fields

          b :: Int
           

          data C

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

          Constructors

          C 

          Fields

          c1 :: Int
           
          c2 :: Int
           

          data D

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

          Constructors

          D Int Int 

          newtype E

          a newtype with a field -

          Constructors

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

          Bug7

          Description

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

          Synopsis

          Documentation

          data Foo

          The Foo datatype -

          Constructors

          Foo 

          Instances

          Bar Foo Foo

          Just one instance -

          class Bar x y

          The Bar class -

          Instances

          Bar Foo Foo

          Just one instance -

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

          Bug8

          Documentation

          data Typ

          Constructors

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

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

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

          s :: a

          t :: a

          main :: a

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

          BugDeprecated

          Synopsis

          Documentation

          foo :: Int

          Deprecated: for foo -

          baz :: Int

          Deprecated: for baz -

          bar :: Int

          Deprecated: for bar -

          one :: Int

          Deprecated: for one -

          some documentation for one, two and three -

          three :: Int

          Deprecated: for three -

          some documentation for one, two and three -

          two :: Int

          Deprecated: for two -

          some documentation for one, two and three -

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

          BugExportHeadings

          Synopsis

          Foo -

          foo :: Int

          Bar -

          bar :: Int

          Baz -

          baz :: Int

          One -

          one :: Int

          Deprecated: for one -

          Two -

          two :: Int

          Deprecated: for two -

          Three -

          three :: Int

          Deprecated: for three -

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

          Bugs

          Documentation

          data A a

          Constructors

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

          CrossPackageDocs

          Synopsis

          Documentation

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

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

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

          class IsString a where

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

          Methods

          fromString :: String -> a

          Instances

          runInteractiveProcess

          Arguments

          :: FilePath

          Filename of the executable (see proc for details) -

          -> [String]

          Arguments to pass to the executable -

          -> Maybe FilePath

          Optional path to the working directory -

          -> Maybe [(String, String)]

          Optional environment (otherwise inherit) -

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

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

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

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

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

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

          DeprecatedClass

          Synopsis

          Documentation

          class SomeClass a where

          Deprecated: SomeClass -

          some class -

          Methods

          foo :: a -> a

          Deprecated: foo -

          documentation for foo -

          class SomeOtherClass a where

          Deprecated: SomeOtherClass -

          Methods

          bar :: a -> a

          Deprecated: bar -

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

          DeprecatedData

          Synopsis

          Documentation

          data Foo

          Deprecated: Foo -

          type Foo -

          Constructors

          Foo

          Deprecated: Foo -

          constructor Foo -

          Bar

          Deprecated: Bar -

          constructor Bar -

          data One

          Deprecated: One -

          Constructors

          One

          Deprecated: One -

          Two

          Deprecated: Two -

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

          DeprecatedFunction

          Synopsis

          Documentation

          foo :: Int

          Deprecated: use bar instead -

          some documentation for foo -

          bar :: Int

          some documentation for bar -

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

          DeprecatedFunction2

          Synopsis

          Documentation

          foo :: Int

          Deprecated: use bar instead -

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

          DeprecatedFunction3

          Synopsis

          Documentation

          foo :: Integer

          Deprecated: use bar instead -

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

          DeprecatedModule

          Description

          Deprecated: Use Foo instead -

          Documentation for DeprecatedModule. -

          Documentation

          foo :: Int

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

          DeprecatedModule2

          Description

          Deprecated: Use Foo instead -

          Documentation

          foo :: Int

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

          DeprecatedNewtype

          Documentation

          newtype SomeNewType

          Deprecated: SomeNewType -

          some documentation -

          Constructors

          SomeNewTypeConst String

          Deprecated: SomeNewTypeConst -

          constructor docu -

          newtype SomeOtherNewType

          Deprecated: SomeOtherNewType -

          Constructors

          SomeOtherNewTypeConst String

          Deprecated: SomeOtherNewTypeConst -

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

          DeprecatedReExport

          Description

          What is tested here: -

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

          Synopsis

          Re-exported from an other module -

          foo :: Int

          Deprecated: use bar instead -

          some documentation for foo -

          Re-exported from an other package -

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

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

          DeprecatedRecord

          Synopsis

          Documentation

          data Foo

          type Foo -

          Constructors

          Foo 

          Fields

          fooName :: String

          some name -

          fooValue :: Int

          Deprecated: do not use this -

          some value -

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

          DeprecatedTypeFamily

          Synopsis

          Documentation

          data family SomeTypeFamily k :: * -> *

          Deprecated: SomeTypeFamily -

          some documentation -

          data family SomeOtherTypeFamily k :: * -> *

          Deprecated: SomeOtherTypeFamily -

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

          DeprecatedTypeSynonym

          Synopsis

          Documentation

          type TypeSyn = String

          Deprecated: TypeSyn -

          some documentation -

          type OtherTypeSyn = String

          Deprecated: OtherTypeSyn -

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

          DeprecationMessageParseError

          Description

          What is tested here: -

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

          Synopsis

          Documentation

          foo :: Int

          Deprecated: use @bar instead

          some documentation for foo -

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

          Examples

          Synopsis

          Documentation

          fib :: Integer -> Integer

          Fibonacci number of given Integer. -

          Examples: -

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

          One more Example: -

          >>> fib 5
          -5
          -

          One more Example: -

          >>> fib 5
          -5
          -

          Example with an import: -

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

          FunArgs

          Documentation

          f

          Arguments

          :: forall a . Ord a 
          => Int

          First argument -

          -> a

          Second argument -

          -> Bool

          Third argument -

          -> (a -> a)

          Fourth argument -

          -> ()

          Result -

          g

          Arguments

          :: a

          First argument -

          -> b

          Second argument -

          -> c

          Third argument -

          -> d

          Result -

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

          GADTRecords

          Synopsis

          Documentation

          data H1 a b where

          h1 -

          Constructors

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

          Fields

          field :: Int

          hello docs -

          C4 :: a -> H1 Int a 

          Fields

          field2 :: a

          hello2 docs -

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

          Hash

          Description

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

          Synopsis

          The HashTable type -

          data HashTable key val

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

          Operations on HashTables -

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

          Builds a new hash table with a given size -

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

          Inserts a new element into the hash table -

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

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

          The Hash class -

          class Hash a where

          A class of types which can be hashed. -

          Methods

          hash :: a -> Int

          hashes the value of type a into an Int -

          Instances

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

          HiddenInstances

          Synopsis

          Documentation

          class VisibleClass a

          Should be visible -

          Instances

          VisibleClass Int

          Should be visible -

          VisibleClass VisibleData

          Should be visible -

          data VisibleData

          Should be visible -

          Instances

          Num VisibleData

          Should be visible -

          VisibleClass VisibleData

          Should be visible -

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

          HiddenInstancesB

          Synopsis

          Documentation

          class Foo a

          Should be visible -

          Instances

          Foo Bar

          Should be visible -

          data Bar

          Should be visible -

          Instances

          Foo Bar

          Should be visible -

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

          Hyperlinks

          Synopsis

          Documentation

          foo :: Int

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

          A URL with a label: some link -

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

          IgnoreExports

          Synopsis

          Documentation

          foo :: Int

          documentation for foo -

          bar :: Int

          documentation for bar -

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

          ModuleWithWarning

          Description

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

          Documentation for ModuleWithWarning. -

          Documentation

          foo :: Int

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

          NamedDoc

          Synopsis

            Documentation

            bar -

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

            NoLayout

            Synopsis

            Documentation

            g :: Int

            the function g -

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

            NonGreedy

            Synopsis

            • f :: a

            Documentation

            f :: a

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

            Properties

            Synopsis

            Documentation

            fib :: Integer -> Integer

            Fibonacci number of given Integer. -

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

            PruneWithWarning

            Description

            What is tested here: -

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

            QuasiExpr

            Documentation

            data BinOp

            Constructors

            AddOp 
            SubOp 
            MulOp 
            DivOp 

            Instances

            expr :: QuasiQuoter

            parseExprExp :: String -> Q Exp

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

            QuasiQuote

            Documentation

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

            TH

            Documentation

            decl :: Q [Dec]

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

            TH2

            Documentation

            f :: t -> t

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

            Test

            Description

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

            Synopsis

            Type declarations -

            Data types -

            data T a b

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

            Constructors

            A Int (Maybe Float)

            This comment describes the A constructor -

            B (T a b, T Int Float)

            This comment describes the B constructor -

            data T2 a b

            An abstract data declaration -

            data T3 a b

            A data declaration with no documentation annotations on the constructors -

            Constructors

            A1 a 
            B1 b 

            data T4 a b

            Constructors

            A2 a 
            B2 b 

            data T5 a b

            Constructors

            A3 a

            documents A3 -

            B3 b

            documents B3 -

            data T6

            Testing alternative comment styles -

            Constructors

            A4

            This is the doc for A4 -

            B4

            This is the doc for B4 -

            C4

            This is the doc for C4 -

            newtype N1 a

            A newtype -

            Constructors

            N1 a 

            newtype N2 a b

            A newtype with a fieldname -

            Constructors

            N2 

            Fields

            n :: a b
             

            newtype N3 a b

            A newtype with a fieldname, documentation on the field -

            Constructors

            N3 

            Fields

            n3 :: a b

            this is the n3 field -

            data N4 a b

            An abstract newtype - we show this one as data rather than newtype because - the difference isn't visible to the programmer for an abstract type. -

            newtype N5 a b

            Constructors

            N5 

            Fields

            n5 :: a b

            no docs on the datatype or the constructor -

            newtype N6 a b

            Constructors

            N6

            docs on the constructor only -

            Fields

            n6 :: a b
             

            newtype N7 a b

            docs on the newtype and the constructor -

            Constructors

            N7

            The N7 constructor -

            Fields

            n7 :: a b
             

            Records -

            data R

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

            Constructors

            C1

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

            Fields

            p :: Int

            This comment applies to the p field -

            q :: forall a. a -> a

            This comment applies to the q field -

            r :: Int

            This comment applies to both r and s -

            s :: Int

            This comment applies to both r and s -

            C2

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

            Fields

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

            data R1

            Testing different record commenting styles -

            Constructors

            C3

            This is the C3 record constructor -

            Fields

            s1 :: Int

            The s1 record selector -

            s2 :: Int

            The s2 record selector -

            s3 :: Int

            The s3 record selector -

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

            Class declarations -

            class D a => C a where

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

            Methods

            a :: IO a

            this is a description of the a method -

            b :: [a]

            this is a description of the b method -

            class D a where

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

            Methods

            d :: T a b

            e :: (a, a)

            Instances

            class E a

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

            class F a where

            Methods

            ff :: a

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

            Function types -

            f :: C a => a -> Int

            In a comment string we can refer to identifiers in scope with -single quotes like this: T, and we can refer to modules by -using double quotes: Foo. We can add emphasis like this. -

            • This is a bulleted list -
            • This is the next item (different kind of bullet) -
            1. This is an ordered list -
            2. This is the next item (different kind of bullet) -
            cat
            a small, furry, domesticated mammal -
            pineapple
            a fruit grown in the tropics -
            -     This is a block of code, which can include other markup: R
            -     formatting
            -               is
            -                 significant
            -
             this is another block of code
            -

            We can also include URLs in documentation: http://www.haskell.org/. -

            g :: Int -> IO CInt

            we can export foreign declarations too -

            Auxiliary stuff -

            This is some documentation that is attached to a name ($aux1) - rather than a source declaration. The documentation may be - referred to in the export list using its name. -

             code block in named doc

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

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

            a nested, named doc comment -

            with a paragraph, -

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

            aux11: -

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

            This is some inline documentation in the export list -

             a code block using bird-tracks
            - each line must begin with > (which isn't significant unless it
            - is at the beginning of the line).
            -

            A hidden module -

            hidden :: Int -> Int

            A visible module -

            module Visible

            nested-style doc comments -

            Existential / Universal types -

            data Ex a

            A data-type using existential/universal types -

            Constructors

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

            Type signatures with argument docs -

            k

            Arguments

            :: T () ()

            This argument has type T -

            -> T2 Int Int

            This argument has type 'T2 Int Int' -

            -> (T3 Bool Bool -> T4 Float Float)

            This argument has type T3 Bool Bool -> T4 Float Float -

            -> T5 () ()

            This argument has a very long description that should - hopefully cause some wrapping to happen when it is finally - rendered by Haddock in the generated HTML page. -

            -> IO ()

            This is the result type -

            This is a function with documentation for each argument -

            l

            Arguments

            :: (Int, Int, Float)

            takes a triple -

            -> Int

            returns an Int -

            m

            Arguments

            :: R 
            -> N1 ()

            one of the arguments -

            -> IO Int

            and the return value -

            This function has some arg docs -

            o

            Arguments

            :: Float

            The input float -

            -> IO Float

            The output float -

            A foreign import with argument docs -

            A section -

            A subsection -

             a literal line
            -

            $ a non literal line $ -

            f' :: Int

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

            withType :: Int

            Comment on a definition with type signature -

            withoutType :: a

            Comment on a definition without type signature -

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

            Ticket112

            Synopsis

            • f :: a

            Documentation

            f :: a

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

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

            Ticket61

            Documentation

            class C a where

            Methods

            f :: a

            A comment about f -

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

            Ticket75

            Synopsis

            Documentation

            data a :- b

            Constructors

            Q 

            f :: Int

            A reference to :- -

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

            TypeFamilies

            Synopsis

            Documentation

            type family G a :: *

            Type family G -

            class A a where

            A class with an associated type -

            Associated Types

            data B a :: * -> *

            An associated type -

            Methods

            f :: B a Int

            A method -

            Instances

            A Int 

            type family F a

            Doc for family -

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

            TypeOperators

            Contents

            Synopsis

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

            stuff -

            data a :-: b

            data (a :+: b) c

            data Op a b

            newtype O g f a

            Constructors

            O 

            Fields

            unO :: g (f a)
             

            biO :: (g `O` f) a

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

            Unicode

            Synopsis

            Documentation

            x :: Int

            γλώσσα -

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

            Visible

            Documentation

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

            A

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

            AdvanceTypes

            data Pattern

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

            B

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

            Bug1

            data T

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

            Bug2

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

            Bug3

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

            Bug4

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

            Bug6

            data A

            data B

            data C

            data D

            data E

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

            Bug7

            data Foo

            class Bar x y

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

            Bug8

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

            BugDeprecated

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

            BugExportHeadings

            Foo -

            Bar -

            Baz -

            One -

            Two -

            Three -

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

            Bugs

            data A a

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

            CrossPackageDocs

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

            DeprecatedClass

            class SomeClass a

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

            DeprecatedData

            data Foo

            data One

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

            DeprecatedFunction

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

            DeprecatedFunction2

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

            DeprecatedFunction3

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

            DeprecatedModule

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

            DeprecatedModule2

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

            DeprecatedNewtype

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

            DeprecatedReExport

            Re-exported from an other module -

            Re-exported from an other package -

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

            DeprecatedRecord

            data Foo

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

            DeprecatedTypeFamily

            data family SomeTypeFamily k :: * -> *

            data family SomeOtherTypeFamily k :: * -> *

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

            DeprecatedTypeSynonym

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

            DeprecationMessageParseError

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

            Examples

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

            FunArgs

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

            GADTRecords

            data H1 a b

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

            Hash

            The HashTable type -

            data HashTable key val

            Operations on HashTables -

            The Hash class -

            class Hash a

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

            HiddenInstances

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

            HiddenInstancesB

            class Foo a

            data Bar

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

            Hyperlinks

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

            IgnoreExports

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

            ModuleWithWarning

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

            NamedDoc

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

            NoLayout

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

            NonGreedy

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

            Properties

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

            PruneWithWarning

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

            QuasiExpr

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

            QuasiQuote

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

            TH

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

            TH2

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

            Test

            Type declarations -

            Data types -

            data T a b

            data T2 a b

            data T3 a b

            data T4 a b

            data T5 a b

            data T6

            data N1 a

            data N2 a b

            data N3 a b

            data N4 a b

            data N5 a b

            data N6 a b

            data N7 a b

            Records -

            data R

            data R1

            Class declarations -

            class C a

            class D a

            class E a

            class F a

            Function types -

            Auxiliary stuff -

            A hidden module -

            A visible module -

            Existential / Universal types -

            data Ex a

            Type signatures with argument docs -

            A section -

            A subsection -

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

            Ticket112

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

            Ticket61

            class C a

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

            Ticket75

            data a :- b

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

            TypeFamilies

            type family G a :: *

            class A a

            type family F a

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

            TypeOperators

            stuff -

            data a :-: b

            data (a :+: b) c

            data Op a b

            data O g f a

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

            Unicode

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

            Visible

            -- cgit v1.2.3 From 8be6dc23701dcc1387fd56d61ad05df76a88f790 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 11:24:57 +0200 Subject: Copy css, images, etc. on accept --- html-test/accept.hs | 31 +-- html-test/ref/haddock-util.js | 344 ++++++++++++++++++++++++++ html-test/ref/hslogo-16.png | Bin 0 -> 1684 bytes html-test/ref/minus.gif | Bin 0 -> 56 bytes html-test/ref/ocean.css | 546 ++++++++++++++++++++++++++++++++++++++++++ html-test/ref/plus.gif | Bin 0 -> 59 bytes html-test/ref/synopsis.png | Bin 0 -> 11327 bytes 7 files changed, 906 insertions(+), 15 deletions(-) create mode 100644 html-test/ref/haddock-util.js create mode 100644 html-test/ref/hslogo-16.png create mode 100644 html-test/ref/minus.gif create mode 100644 html-test/ref/ocean.css create mode 100644 html-test/ref/plus.gif create mode 100644 html-test/ref/synopsis.png diff --git a/html-test/accept.hs b/html-test/accept.hs index 82eb3c65..4722dbf9 100644 --- a/html-test/accept.hs +++ b/html-test/accept.hs @@ -1,38 +1,39 @@ import System.Cmd import System.Environment import System.FilePath -import System.Exit import System.Directory import Data.List -import Control.Monad import Control.Applicative - +main :: IO () main = do args <- getArgs dir <- getCurrentDirectory contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") - if not $ null args - then - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] - else - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + if not $ null args then + mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM_ copy [ "output" file | file <- contents] where ignore = [ - "doc-index.html" + "." + , ".." + , "doc-index.html" , "index-frames.html" , "index.html" ] - +copy :: FilePath -> IO () copy file = do let new = "ref" takeFileName file - print file - print new - contents <- readFile file - writeFile new (stripLinks contents) - + if ".html" `isSuffixOf` file then do + putStrLn (file ++ " -> " ++ new) + stripLinks <$> readFile file >>= writeFile new + else do + -- copy css, images, etc. + copyFile file new +stripLinks :: String -> String stripLinks str = let prefix = "= 0; +} + +function addClass(elem, value) { + var className = spaced(elem.className || ""); + if ( className.indexOf( " " + value + " " ) < 0 ) { + elem.className = trim(className + " " + value); + } +} + +function removeClass(elem, value) { + var className = spaced(elem.className || ""); + className = className.replace(" " + value + " ", " "); + elem.className = trim(className); +} + +function toggleClass(elem, valueOn, valueOff, bool) { + if (bool == null) { bool = ! hasClass(elem, valueOn); } + if (bool) { + removeClass(elem, valueOff); + addClass(elem, valueOn); + } + else { + removeClass(elem, valueOn); + addClass(elem, valueOff); + } + return bool; +} + + +function makeClassToggle(valueOn, valueOff) +{ + return function(elem, bool) { + return toggleClass(elem, valueOn, valueOff, bool); + } +} + +toggleShow = makeClassToggle("show", "hide"); +toggleCollapser = makeClassToggle("collapser", "expander"); + +function toggleSection(id) +{ + var b = toggleShow(document.getElementById("section." + id)); + toggleCollapser(document.getElementById("control." + id), b); + rememberCollapsed(id, b); + return b; +} + +var collapsed = {}; +function rememberCollapsed(id, b) +{ + if(b) + delete collapsed[id] + else + collapsed[id] = null; + + var sections = []; + for(var i in collapsed) + { + if(collapsed.hasOwnProperty(i)) + sections.push(i); + } + // cookie specific to this page; don't use setCookie which sets path=/ + document.cookie = "collapsed=" + escape(sections.join('+')); +} + +function restoreCollapsed() +{ + var cookie = getCookie("collapsed"); + if(!cookie) + return; + + var ids = cookie.split('+'); + for(var i in ids) + { + if(document.getElementById("section." + ids[i])) + toggleSection(ids[i]); + } +} + +function setCookie(name, value) { + document.cookie = name + "=" + escape(value) + ";path=/;"; +} + +function clearCookie(name) { + document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"; +} + +function getCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) { + return unescape(c.substring(nameEQ.length,c.length)); + } + } + return null; +} + + + +var max_results = 75; // 50 is not enough to search for map in the base libraries +var shown_range = null; +var last_search = null; + +function quick_search() +{ + perform_search(false); +} + +function full_search() +{ + perform_search(true); +} + + +function perform_search(full) +{ + var text = document.getElementById("searchbox").value.toLowerCase(); + if (text == last_search && !full) return; + last_search = text; + + var table = document.getElementById("indexlist"); + var status = document.getElementById("searchmsg"); + var children = table.firstChild.childNodes; + + // first figure out the first node with the prefix + var first = bisect(-1); + var last = (first == -1 ? -1 : bisect(1)); + + if (first == -1) + { + table.className = ""; + status.innerHTML = "No results found, displaying all"; + } + else if (first == 0 && last == children.length - 1) + { + table.className = ""; + status.innerHTML = ""; + } + else if (last - first >= max_results && !full) + { + table.className = ""; + status.innerHTML = "More than " + max_results + ", press Search to display"; + } + else + { + // decide what you need to clear/show + if (shown_range) + setclass(shown_range[0], shown_range[1], "indexrow"); + setclass(first, last, "indexshow"); + shown_range = [first, last]; + table.className = "indexsearch"; + status.innerHTML = ""; + } + + + function setclass(first, last, status) + { + for (var i = first; i <= last; i++) + { + children[i].className = status; + } + } + + + // do a binary search, treating 0 as ... + // return either -1 (no 0's found) or location of most far match + function bisect(dir) + { + var first = 0, finish = children.length - 1; + var mid, success = false; + + while (finish - first > 3) + { + mid = Math.floor((finish + first) / 2); + + var i = checkitem(mid); + if (i == 0) i = dir; + if (i == -1) + finish = mid; + else + first = mid; + } + var a = (dir == 1 ? first : finish); + var b = (dir == 1 ? finish : first); + for (var i = b; i != a - dir; i -= dir) + { + if (checkitem(i) == 0) return i; + } + return -1; + } + + + // from an index, decide what the result is + // 0 = match, -1 is lower, 1 is higher + function checkitem(i) + { + var s = getitem(i).toLowerCase().substr(0, text.length); + if (s == text) return 0; + else return (s > text ? -1 : 1); + } + + + // from an index, get its string + // this abstracts over alternates + function getitem(i) + { + for ( ; i >= 0; i--) + { + var s = children[i].firstChild.firstChild.data; + if (s.indexOf(' ') == -1) + return s; + } + return ""; // should never be reached + } +} + +function setSynopsis(filename) { + if (parent.window.synopsis) { + if (parent.window.synopsis.location.replace) { + // In Firefox this avoids adding the change to the history. + parent.window.synopsis.location.replace(filename); + } else { + parent.window.synopsis.location = filename; + } + } +} + +function addMenuItem(html) { + var menu = document.getElementById("page-menu"); + if (menu) { + var btn = menu.firstChild.cloneNode(false); + btn.innerHTML = html; + menu.appendChild(btn); + } +} + +function adjustForFrames() { + var bodyCls; + + if (parent.location.href == window.location.href) { + // not in frames, so add Frames button + addMenuItem("Frames"); + bodyCls = "no-frame"; + } + else { + bodyCls = "in-frame"; + } + addClass(document.body, bodyCls); +} + +function reframe() { + setCookie("haddock-reframe", document.URL); + window.location = "frames.html"; +} + +function postReframe() { + var s = getCookie("haddock-reframe"); + if (s) { + parent.window.main.location = s; + clearCookie("haddock-reframe"); + } +} + +function styles() { + var i, a, es = document.getElementsByTagName("link"), rs = []; + for (i = 0; a = es[i]; i++) { + if(a.rel.indexOf("style") != -1 && a.title) { + rs.push(a); + } + } + return rs; +} + +function addStyleMenu() { + var as = styles(); + var i, a, btns = ""; + for(i=0; a = as[i]; i++) { + btns += "
          • " + + a.title + "
          • " + } + if (as.length > 1) { + var h = "
            " + + "Style ▾" + + "
              " + btns + "
            " + + "
            "; + addMenuItem(h); + } +} + +function setActiveStyleSheet(title) { + var as = styles(); + var i, a, found; + for(i=0; a = as[i]; i++) { + a.disabled = true; + // need to do this always, some browsers are edge triggered + if(a.title == title) { + found = a; + } + } + if (found) { + found.disabled = false; + setCookie("haddock-style", title); + } + else { + as[0].disabled = false; + clearCookie("haddock-style"); + } + styleMenu(false); +} + +function resetStyle() { + var s = getCookie("haddock-style"); + if (s) setActiveStyleSheet(s); +} + + +function styleMenu(show) { + var m = document.getElementById('style-menu'); + if (m) toggleShow(m, show); +} + + +function pageLoad() { + addStyleMenu(); + adjustForFrames(); + resetStyle(); + restoreCollapsed(); +} + diff --git a/html-test/ref/hslogo-16.png b/html-test/ref/hslogo-16.png new file mode 100644 index 00000000..0ff8579f Binary files /dev/null and b/html-test/ref/hslogo-16.png differ diff --git a/html-test/ref/minus.gif b/html-test/ref/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/html-test/ref/minus.gif differ diff --git a/html-test/ref/ocean.css b/html-test/ref/ocean.css new file mode 100644 index 00000000..42238709 --- /dev/null +++ b/html-test/ref/ocean.css @@ -0,0 +1,546 @@ +/* @group Fundamentals */ + +* { margin: 0; padding: 0 } + +/* Is this portable? */ +html { + background-color: white; + width: 100%; + height: 100%; +} + +body { + background: white; + color: black; + text-align: left; + min-height: 100%; + position: relative; +} + +p { + margin: 0.8em 0; +} + +ul, ol { + margin: 0.8em 0 0.8em 2em; +} + +dl { + margin: 0.8em 0; +} + +dt { + font-weight: bold; +} +dd { + margin-left: 2em; +} + +a { text-decoration: none; } +a[href]:link { color: rgb(196,69,29); } +a[href]:visited { color: rgb(171,105,84); } +a[href]:hover { text-decoration:underline; } + +/* @end */ + +/* @group Fonts & Sizes */ + +/* Basic technique & IE workarounds from YUI 3 + For reasons, see: + http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css + */ + +body { + font:13px/1.4 sans-serif; + *font-size:small; /* for IE */ + *font:x-small; /* for IE in quirks mode */ +} + +h1 { font-size: 146.5%; /* 19pt */ } +h2 { font-size: 131%; /* 17pt */ } +h3 { font-size: 116%; /* 15pt */ } +h4 { font-size: 100%; /* 13pt */ } +h5 { font-size: 100%; /* 13pt */ } + +select, input, button, textarea { + font:99% sans-serif; +} + +table { + font-size:inherit; + font:100%; +} + +pre, code, kbd, samp, tt, .src { + font-family:monospace; + *font-size:108%; + line-height: 124%; +} + +.links, .link { + font-size: 85%; /* 11pt */ +} + +#module-header .caption { + font-size: 182%; /* 24pt */ +} + +.info { + font-size: 85%; /* 11pt */ +} + +#table-of-contents, #synopsis { + /* font-size: 85%; /* 11pt */ +} + + +/* @end */ + +/* @group Common */ + +.caption, h1, h2, h3, h4, h5, h6 { + font-weight: bold; + color: rgb(78,98,114); + margin: 0.8em 0 0.4em; +} + +* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { + margin-top: 2em; +} + +h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { + margin-top: inherit; +} + +ul.links { + list-style: none; + text-align: left; + float: right; + display: inline-table; + margin: 0 0 0 1em; +} + +ul.links li { + display: inline; + border-left: 1px solid #d5d5d5; + white-space: nowrap; + padding: 0; +} + +ul.links li a { + padding: 0.2em 0.5em; +} + +.hide { display: none; } +.show { display: inherit; } +.clear { clear: both; } + +.collapser { + background-image: url(minus.gif); + background-repeat: no-repeat; +} +.expander { + background-image: url(plus.gif); + background-repeat: no-repeat; +} +p.caption.collapser, +p.caption.expander { + background-position: 0 0.4em; +} +.collapser, .expander { + padding-left: 14px; + margin-left: -14px; + cursor: pointer; +} + +pre { + padding: 0.25em; + margin: 0.8em 0; + background: rgb(229,237,244); + overflow: auto; + border-bottom: 0.25em solid white; + /* white border adds some space below the box to compensate + for visual extra space that paragraphs have between baseline + and the bounding box */ +} + +.src { + background: #f0f0f0; + padding: 0.2em 0.5em; +} + +.keyword { font-weight: normal; } +.def { font-weight: bold; } + + +/* @end */ + +/* @group Page Structure */ + +#content { + margin: 0 auto; + padding: 0 2em 6em; +} + +#package-header { + background: rgb(41,56,69); + border-top: 5px solid rgb(78,98,114); + color: #ddd; + padding: 0.2em; + position: relative; + text-align: left; +} + +#package-header .caption { + background: url(hslogo-16.png) no-repeat 0em; + color: white; + margin: 0 2em; + font-weight: normal; + font-style: normal; + padding-left: 2em; +} + +#package-header a:link, #package-header a:visited { color: white; } +#package-header a:hover { background: rgb(78,98,114); } + +#module-header .caption { + color: rgb(78,98,114); + font-weight: bold; + border-bottom: 1px solid #ddd; +} + +table.info { + float: right; + padding: 0.5em 1em; + border: 1px solid #ddd; + color: rgb(78,98,114); + background-color: #fff; + max-width: 40%; + border-spacing: 0; + position: relative; + top: -0.5em; + margin: 0 0 0 2em; +} + +.info th { + padding: 0 1em 0 0; +} + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background: #374c5e; + margin: 0; + text-align: center; + right: 0; + padding: 0; + top: 1.25em; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 0; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + +#style-menu a { + width: 6em; + padding: 3px; + display: block; +} + +#footer { + background: #ddd; + border-top: 1px solid #aaa; + padding: 0.5em 0; + color: #666; + text-align: center; + position: absolute; + bottom: 0; + width: 100%; + height: 3em; +} + +/* @end */ + +/* @group Front Matter */ + +#table-of-contents { + float: right; + clear: right; + background: #faf9dc; + border: 1px solid #d8d7ad; + padding: 0.5em 1em; + max-width: 20em; + margin: 0.5em 0 1em 1em; +} + +#table-of-contents .caption { + text-align: center; + margin: 0; +} + +#table-of-contents ul { + list-style: none; + margin: 0; +} + +#table-of-contents ul ul { + margin-left: 2em; +} + +#description .caption { + display: none; +} + +#synopsis { + display: none; +} + +.no-frame #synopsis { + display: block; + position: fixed; + right: 0; + height: 80%; + top: 10%; + padding: 0; +} + +#synopsis .caption { + float: left; + width: 29px; + color: rgba(255,255,255,0); + height: 110px; + margin: 0; + font-size: 1px; + padding: 0; +} + +#synopsis p.caption.collapser { + background: url(synopsis.png) no-repeat -64px -8px; +} + +#synopsis p.caption.expander { + background: url(synopsis.png) no-repeat 0px -8px; +} + +#synopsis ul { + height: 100%; + overflow: auto; + padding: 0.5em; + margin: 0; +} + +#synopsis ul ul { + overflow: hidden; +} + +#synopsis ul, +#synopsis ul li.src { + background-color: #faf9dc; + white-space: nowrap; + list-style: none; + margin-left: 0; +} + +/* @end */ + +/* @group Main Content */ + +#interface div.top { margin: 2em 0; } +#interface h1 + div.top, +#interface h2 + div.top, +#interface h3 + div.top, +#interface h4 + div.top, +#interface h5 + div.top { + margin-top: 1em; +} +#interface p.src .link { + float: right; + color: #919191; + border-left: 1px solid #919191; + background: #f0f0f0; + padding: 0 0.5em 0.2em; + margin: 0 -0.5em 0 0.5em; +} + +#interface table { border-spacing: 2px; } +#interface td { + vertical-align: top; + padding-left: 0.5em; +} +#interface td.src { + white-space: nowrap; +} +#interface td.doc p { + margin: 0; +} +#interface td.doc p + p { + margin-top: 0.8em; +} + +.subs dl { + margin: 0; +} + +.subs dt { + float: left; + clear: left; + display: block; + margin: 1px 0; +} + +.subs dd { + float: right; + width: 90%; + display: block; + padding-left: 0.5em; + margin-bottom: 0.5em; +} + +.subs dd.empty { + display: none; +} + +.subs dd p { + margin: 0; +} + +.top p.src { + border-top: 1px solid #ccc; +} + +.subs, .doc { + /* use this selector for one level of indent */ + padding-left: 2em; +} + +.warning { + color: red; +} + +.arguments { + margin-top: -0.4em; +} +.arguments .caption { + display: none; +} + +.fields { padding-left: 1em; } + +.fields .caption { display: none; } + +.fields p { margin: 0 0; } + +/* this seems bulky to me +.methods, .constructors { + background: #f8f8f8; + border: 1px solid #eee; +} +*/ + +/* @end */ + +/* @group Auxillary Pages */ + +#mini { + margin: 0 auto; + padding: 0 1em 1em; +} + +#mini > * { + font-size: 93%; /* 12pt */ +} + +#mini #module-list .caption, +#mini #module-header .caption { + font-size: 125%; /* 15pt */ +} + +#mini #interface h1, +#mini #interface h2, +#mini #interface h3, +#mini #interface h4 { + font-size: 109%; /* 13pt */ + margin: 1em 0 0; +} + +#mini #interface .top, +#mini #interface .src { + margin: 0; +} + +#mini #module-list ul { + list-style: none; + margin: 0; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + text-align: center; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + font-weight: bold; +} + +#index .caption, +#module-list .caption { font-size: 131%; /* 17pt */ } + +#index table { + margin-left: 2em; +} + +#index .src { + font-weight: bold; +} +#index .alt { + font-size: 77%; /* 10pt */ + font-style: italic; + padding-left: 2em; +} + +#index td + td { + padding-left: 1em; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 2em; +} + +#module-list li { + clear: right; +} + +#module-list span.collapser, +#module-list span.expander { + background-position: 0 0.3em; +} + +#module-list .package { + float: right; +} + +/* @end */ diff --git a/html-test/ref/plus.gif b/html-test/ref/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/html-test/ref/plus.gif differ diff --git a/html-test/ref/synopsis.png b/html-test/ref/synopsis.png new file mode 100644 index 00000000..85fb86ec Binary files /dev/null and b/html-test/ref/synopsis.png differ -- cgit v1.2.3 From d63c49537da8c2a3ee20e6153e2471087054730d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 14:25:39 +0200 Subject: Move unit tests to /test directory --- haddock.cabal | 4 +- test/Haddock/ParseSpec.hs | 81 ++++++++++++++++++++++ test/Spec.hs | 9 +++ test/nanospec/README | 6 ++ test/nanospec/Test/Hspec.hs | 126 ++++++++++++++++++++++++++++++++++ tests/nanospec/README | 6 -- tests/nanospec/Test/Hspec.hs | 126 ---------------------------------- tests/unit-tests/Haddock/ParseSpec.hs | 81 ---------------------- tests/unit-tests/Spec.hs | 9 --- 9 files changed, 224 insertions(+), 224 deletions(-) create mode 100644 test/Haddock/ParseSpec.hs create mode 100644 test/Spec.hs create mode 100644 test/nanospec/README create mode 100644 test/nanospec/Test/Hspec.hs delete mode 100644 tests/nanospec/README delete mode 100644 tests/nanospec/Test/Hspec.hs delete mode 100644 tests/unit-tests/Haddock/ParseSpec.hs delete mode 100644 tests/unit-tests/Spec.hs diff --git a/haddock.cabal b/haddock.cabal index 36c016e9..8f655d83 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -181,8 +181,8 @@ test-suite spec default-language: Haskell2010 main-is: Spec.hs hs-source-dirs: - tests/unit-tests - , tests/nanospec + test + , test/nanospec , src build-depends: diff --git a/test/Haddock/ParseSpec.hs b/test/Haddock/ParseSpec.hs new file mode 100644 index 00000000..d692cb0c --- /dev/null +++ b/test/Haddock/ParseSpec.hs @@ -0,0 +1,81 @@ +{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +module Haddock.ParseSpec (main, spec) where + +import Test.Hspec +import RdrName (RdrName) +import DynFlags (DynFlags, defaultDynFlags) +import Haddock.Lex (tokenise) +import qualified Haddock.Parse as Parse +import Haddock.Types +import Outputable (Outputable, showSDoc, ppr) +import Data.Monoid +import Data.String + +dynFlags :: DynFlags +dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") + +instance Outputable a => Show a where + show = showSDoc dynFlags . ppr + +deriving instance Show a => Show (Doc a) +deriving instance Eq a =>Eq (Doc a) + +instance IsString (Doc RdrName) where + fromString = DocString + +parseParas :: String -> Maybe (Doc RdrName) +parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0) + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parseParas" $ do + it "parses a paragraph" $ do + parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n") + + context "when parsing an example" $ do + it "requires an example to be separated from a previous paragrap by an empty line" $ do + parseParas "foobar\n\n>>> fib 10\n55" `shouldBe` + Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) + + -- parse error + parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing + + it "parses a result line that only contains as an emptly line" $ do + parseParas ">>> putFooBar\nfoo\n\nbar" `shouldBe` + Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) + + context "when parsing a code block" $ do + it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do + parseParas "foobar\n\n> some code" `shouldBe` + Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") + + -- parse error + parseParas "foobar\n> some code" `shouldBe` Nothing + + + context "when parsing a URL" $ do + it "parses a URL" $ do + parseParas "" `shouldBe` + Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") + + it "accepts an optional label" $ do + parseParas "" `shouldBe` + Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") + + it "can parse multiple subsequent properties" $ do + parseParas $ unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42") + where + hyperlink :: String -> Maybe String -> Doc RdrName + hyperlink url = DocHyperlink . Hyperlink url diff --git a/test/Spec.hs b/test/Spec.hs new file mode 100644 index 00000000..68521c03 --- /dev/null +++ b/test/Spec.hs @@ -0,0 +1,9 @@ +module Main where + +import Test.Hspec + +import qualified Haddock.ParseSpec + +main :: IO () +main = hspec $ do + describe "Haddock.Parse" Haddock.ParseSpec.spec diff --git a/test/nanospec/README b/test/nanospec/README new file mode 100644 index 00000000..ffce7c74 --- /dev/null +++ b/test/nanospec/README @@ -0,0 +1,6 @@ +A lightweight implementation of a subset of Hspec's API with minimal +dependencies. + +http://hackage.haskell.org/package/nanospec + +This is a copy of version 0.1.0. diff --git a/test/nanospec/Test/Hspec.hs b/test/nanospec/Test/Hspec.hs new file mode 100644 index 00000000..904ce2e0 --- /dev/null +++ b/test/nanospec/Test/Hspec.hs @@ -0,0 +1,126 @@ +{-# LANGUAGE DeriveDataTypeable, CPP #-} +-- | A lightweight implementation of a subset of Hspec's API. +module Test.Hspec ( +-- * Types + SpecM +, Spec + +-- * Defining a spec +, describe +, context +, it + +-- ** Setting expectations +, Expectation +, expect +, shouldBe +, shouldReturn + +-- * Running a spec +, hspec +) where + +import Control.Applicative +import Control.Monad +import Data.Monoid +import Data.List (intercalate) +import Data.Typeable +import qualified Control.Exception as E +import System.Exit + +-- a writer monad +data SpecM a = SpecM a [SpecTree] + +add :: SpecTree -> SpecM () +add s = SpecM () [s] + +instance Monad SpecM where + return a = SpecM a [] + SpecM a xs >>= f = case f a of + SpecM b ys -> SpecM b (xs ++ ys) + +data SpecTree = SpecGroup String Spec + | SpecExample String (IO Result) + +data Result = Success | Failure String + deriving (Eq, Show) + +type Spec = SpecM () + +describe :: String -> Spec -> Spec +describe label = add . SpecGroup label + +context :: String -> Spec -> Spec +context = describe + +it :: String -> Expectation -> Spec +it label = add . SpecExample label . evaluateExpectation + +-- | Summary of a test run. +data Summary = Summary Int Int + +instance Monoid Summary where + mempty = Summary 0 0 + (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2) + +runSpec :: Spec -> IO Summary +runSpec = runForrest [] + where + runForrest :: [String] -> Spec -> IO Summary + runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs + + runTree :: [String] -> SpecTree -> IO Summary + runTree labels spec = case spec of + SpecExample label x -> do + putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ " + r <- x + case r of + Success -> do + putStrLn "OK" + return (Summary 1 0) + Failure err -> do + putStrLn "FAILED" + putStrLn err + return (Summary 1 1) + SpecGroup label xs -> do + runForrest (label:labels) xs + +hspec :: Spec -> IO () +hspec spec = do + Summary total failures <- runSpec spec + putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)") + when (failures /= 0) exitFailure + +type Expectation = IO () + +infix 1 `shouldBe`, `shouldReturn` + +shouldBe :: (Show a, Eq a) => a -> a -> Expectation +actual `shouldBe` expected = + expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected) + +shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation +action `shouldReturn` expected = action >>= (`shouldBe` expected) + +expect :: String -> Bool -> Expectation +expect label f + | f = return () + | otherwise = E.throwIO (ExpectationFailure label) + +data ExpectationFailure = ExpectationFailure String + deriving (Show, Eq, Typeable) + +instance E.Exception ExpectationFailure + +evaluateExpectation :: Expectation -> IO Result +evaluateExpectation action = (action >> return Success) + `E.catches` [ + -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT + -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt) + -- because all of them indicate severe conditions and should not occur during + -- normal operation. + E.Handler $ \e -> E.throw (e :: E.AsyncException) + + , E.Handler $ \(ExpectationFailure err) -> return (Failure err) + , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException)) + ] diff --git a/tests/nanospec/README b/tests/nanospec/README deleted file mode 100644 index ffce7c74..00000000 --- a/tests/nanospec/README +++ /dev/null @@ -1,6 +0,0 @@ -A lightweight implementation of a subset of Hspec's API with minimal -dependencies. - -http://hackage.haskell.org/package/nanospec - -This is a copy of version 0.1.0. diff --git a/tests/nanospec/Test/Hspec.hs b/tests/nanospec/Test/Hspec.hs deleted file mode 100644 index 904ce2e0..00000000 --- a/tests/nanospec/Test/Hspec.hs +++ /dev/null @@ -1,126 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable, CPP #-} --- | A lightweight implementation of a subset of Hspec's API. -module Test.Hspec ( --- * Types - SpecM -, Spec - --- * Defining a spec -, describe -, context -, it - --- ** Setting expectations -, Expectation -, expect -, shouldBe -, shouldReturn - --- * Running a spec -, hspec -) where - -import Control.Applicative -import Control.Monad -import Data.Monoid -import Data.List (intercalate) -import Data.Typeable -import qualified Control.Exception as E -import System.Exit - --- a writer monad -data SpecM a = SpecM a [SpecTree] - -add :: SpecTree -> SpecM () -add s = SpecM () [s] - -instance Monad SpecM where - return a = SpecM a [] - SpecM a xs >>= f = case f a of - SpecM b ys -> SpecM b (xs ++ ys) - -data SpecTree = SpecGroup String Spec - | SpecExample String (IO Result) - -data Result = Success | Failure String - deriving (Eq, Show) - -type Spec = SpecM () - -describe :: String -> Spec -> Spec -describe label = add . SpecGroup label - -context :: String -> Spec -> Spec -context = describe - -it :: String -> Expectation -> Spec -it label = add . SpecExample label . evaluateExpectation - --- | Summary of a test run. -data Summary = Summary Int Int - -instance Monoid Summary where - mempty = Summary 0 0 - (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2) - -runSpec :: Spec -> IO Summary -runSpec = runForrest [] - where - runForrest :: [String] -> Spec -> IO Summary - runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs - - runTree :: [String] -> SpecTree -> IO Summary - runTree labels spec = case spec of - SpecExample label x -> do - putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ " - r <- x - case r of - Success -> do - putStrLn "OK" - return (Summary 1 0) - Failure err -> do - putStrLn "FAILED" - putStrLn err - return (Summary 1 1) - SpecGroup label xs -> do - runForrest (label:labels) xs - -hspec :: Spec -> IO () -hspec spec = do - Summary total failures <- runSpec spec - putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)") - when (failures /= 0) exitFailure - -type Expectation = IO () - -infix 1 `shouldBe`, `shouldReturn` - -shouldBe :: (Show a, Eq a) => a -> a -> Expectation -actual `shouldBe` expected = - expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected) - -shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation -action `shouldReturn` expected = action >>= (`shouldBe` expected) - -expect :: String -> Bool -> Expectation -expect label f - | f = return () - | otherwise = E.throwIO (ExpectationFailure label) - -data ExpectationFailure = ExpectationFailure String - deriving (Show, Eq, Typeable) - -instance E.Exception ExpectationFailure - -evaluateExpectation :: Expectation -> IO Result -evaluateExpectation action = (action >> return Success) - `E.catches` [ - -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT - -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt) - -- because all of them indicate severe conditions and should not occur during - -- normal operation. - E.Handler $ \e -> E.throw (e :: E.AsyncException) - - , E.Handler $ \(ExpectationFailure err) -> return (Failure err) - , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException)) - ] diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs deleted file mode 100644 index d692cb0c..00000000 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ /dev/null @@ -1,81 +0,0 @@ -{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -module Haddock.ParseSpec (main, spec) where - -import Test.Hspec -import RdrName (RdrName) -import DynFlags (DynFlags, defaultDynFlags) -import Haddock.Lex (tokenise) -import qualified Haddock.Parse as Parse -import Haddock.Types -import Outputable (Outputable, showSDoc, ppr) -import Data.Monoid -import Data.String - -dynFlags :: DynFlags -dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") - -instance Outputable a => Show a where - show = showSDoc dynFlags . ppr - -deriving instance Show a => Show (Doc a) -deriving instance Eq a =>Eq (Doc a) - -instance IsString (Doc RdrName) where - fromString = DocString - -parseParas :: String -> Maybe (Doc RdrName) -parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "parseParas" $ do - it "parses a paragraph" $ do - parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n") - - context "when parsing an example" $ do - it "requires an example to be separated from a previous paragrap by an empty line" $ do - parseParas "foobar\n\n>>> fib 10\n55" `shouldBe` - Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) - - -- parse error - parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing - - it "parses a result line that only contains as an emptly line" $ do - parseParas ">>> putFooBar\nfoo\n\nbar" `shouldBe` - Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) - - context "when parsing a code block" $ do - it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do - parseParas "foobar\n\n> some code" `shouldBe` - Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") - - -- parse error - parseParas "foobar\n> some code" `shouldBe` Nothing - - - context "when parsing a URL" $ do - it "parses a URL" $ do - parseParas "" `shouldBe` - Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") - - it "accepts an optional label" $ do - parseParas "" `shouldBe` - Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") - - context "when parsing properties" $ do - it "can parse a single property" $ do - parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") - - it "can parse multiple subsequent properties" $ do - parseParas $ unlines [ - "prop> 23 == 23" - , "prop> 42 == 42" - ] - `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42") - where - hyperlink :: String -> Maybe String -> Doc RdrName - hyperlink url = DocHyperlink . Hyperlink url diff --git a/tests/unit-tests/Spec.hs b/tests/unit-tests/Spec.hs deleted file mode 100644 index 68521c03..00000000 --- a/tests/unit-tests/Spec.hs +++ /dev/null @@ -1,9 +0,0 @@ -module Main where - -import Test.Hspec - -import qualified Haddock.ParseSpec - -main :: IO () -main = hspec $ do - describe "Haddock.Parse" Haddock.ParseSpec.spec -- cgit v1.2.3 From e251a5e26ca9ad3f783a251e2cac04b83a7f696f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 15:49:35 +0200 Subject: Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. --- Setup.lhs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Setup.lhs b/Setup.lhs index fe12b5be..5bde0de9 100755 --- a/Setup.lhs +++ b/Setup.lhs @@ -1,5 +1,3 @@ -#! /usr/bin/runhaskell -\begin{code} -import Distribution.Simple -main = defaultMain -\end{code} +#!/usr/bin/env runhaskell +> import Distribution.Simple +> main = defaultMain -- cgit v1.2.3 From 3c5efc1361484f55d9e40b6be4618b2ff8aded26 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 16:10:24 +0200 Subject: Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts --- haddock.cabal | 4 +- html-test/README | 4 +- html-test/accept.hs | 44 -------------- html-test/accept.lhs | 49 ++++++++++++++++ html-test/runtests.hs | 152 ----------------------------------------------- html-test/runtests.lhs | 156 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 209 insertions(+), 200 deletions(-) delete mode 100644 html-test/accept.hs create mode 100755 html-test/accept.lhs delete mode 100644 html-test/runtests.hs create mode 100755 html-test/runtests.lhs diff --git a/haddock.cabal b/haddock.cabal index 8f655d83..67e86452 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -31,7 +31,7 @@ extra-source-files: src/haddock.sh -- The test files shouldn't have to go here, but the source files for -- the test-suite stanzas don't get picked up by `cabal sdist`. - tests/html-test/runtests.hs + tests/html-test/runtests.lhs data-dir: resources data-files: html/frames.html @@ -172,7 +172,7 @@ library test-suite html-test type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: runtests.hs + main-is: runtests.lhs hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal diff --git a/html-test/README b/html-test/README index 9afb10e7..d261888c 100644 --- a/html-test/README +++ b/html-test/README @@ -9,12 +9,12 @@ To add a new test: passes since there is no reference file to compare with. 3) To make a reference file from the output file, do - runhaskell accept.hs + runhaskell accept.lhs Tips and tricks: To "accept" all output files (copy them to reference files), run - runhaskell accept.hs + runhaskell accept.lhs You can run all tests despite failing tests, like so cabal test --test-option=all diff --git a/html-test/accept.hs b/html-test/accept.hs deleted file mode 100644 index 4722dbf9..00000000 --- a/html-test/accept.hs +++ /dev/null @@ -1,44 +0,0 @@ -import System.Cmd -import System.Environment -import System.FilePath -import System.Directory -import Data.List -import Control.Applicative - -main :: IO () -main = do - args <- getArgs - dir <- getCurrentDirectory - contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") - if not $ null args then - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] - else - mapM_ copy [ "output" file | file <- contents] - where - ignore = [ - "." - , ".." - , "doc-index.html" - , "index-frames.html" - , "index.html" - ] - -copy :: FilePath -> IO () -copy file = do - let new = "ref" takeFileName file - if ".html" `isSuffixOf` file then do - putStrLn (file ++ " -> " ++ new) - stripLinks <$> readFile file >>= writeFile new - else do - -- copy css, images, etc. - copyFile file new - -stripLinks :: String -> String -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs diff --git a/html-test/accept.lhs b/html-test/accept.lhs new file mode 100755 index 00000000..3dfc099b --- /dev/null +++ b/html-test/accept.lhs @@ -0,0 +1,49 @@ +#!/usr/bin/env runhaskell +\begin{code} +{-# LANGUAGE CPP #-} +import System.Cmd +import System.Environment +import System.FilePath +import System.Directory +import Data.List +import Control.Applicative + +baseDir = takeDirectory __FILE__ + +main :: IO () +main = do + contents <- filter (`notElem` ignore) <$> getDirectoryContents (baseDir "output") + args <- getArgs + if not $ null args then + mapM_ copy [ baseDir "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM_ copy [ baseDir "output" file | file <- contents] + where + ignore = [ + "." + , ".." + , "doc-index.html" + , "index-frames.html" + , "index.html" + ] + +copy :: FilePath -> IO () +copy file = do + let new = baseDir "ref" takeFileName file + if ".html" `isSuffixOf` file then do + putStrLn (file ++ " -> " ++ new) + stripLinks <$> readFile file >>= writeFile new + else do + -- copy css, images, etc. + copyFile file new + +stripLinks :: String -> String +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs +\end{code} diff --git a/html-test/runtests.hs b/html-test/runtests.hs deleted file mode 100644 index 1898cde3..00000000 --- a/html-test/runtests.hs +++ /dev/null @@ -1,152 +0,0 @@ -import Prelude hiding (mod) -import Control.Monad -import Control.Applicative -import Data.List -import Data.Maybe -import Distribution.InstalledPackageInfo -import Distribution.Package (PackageName (..)) -import Distribution.Simple.Compiler -import Distribution.Simple.GHC -import Distribution.Simple.PackageIndex -import Distribution.Simple.Program -import Distribution.Simple.Utils -import Distribution.Verbosity -import System.IO -import System.Cmd -import System.Directory -import System.Environment -import System.Exit -import System.FilePath -import System.Process (ProcessHandle, runProcess, waitForProcess) - - -packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath -packageRoot = "." -dataDir = packageRoot "resources" -haddockPath = packageRoot "dist" "build" "haddock" "haddock" -testSuiteRoot = packageRoot "html-test" -testDir = testSuiteRoot "tests" -refDir = testSuiteRoot "ref" -outDir = testSuiteRoot "output" - - -main :: IO () -main = do - test - putStrLn "All tests passed!" - - -test :: IO () -test = do - x <- doesFileExist haddockPath - unless x $ die "you need to run 'cabal build' successfully first" - - contents <- getDirectoryContents testDir - args <- getArgs - let (opts, spec) = span ("-" `isPrefixOf`) args - let mods = - case spec of - y:_ | y /= "all" -> [y ++ ".hs"] - _ -> filter ((==) ".hs" . takeExtension) contents - - let mods' = map (testDir ) mods - - -- add haddock_datadir to environment for subprocesses - env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment - - putStrLn "" - putStrLn "Haddock version: " - h1 <- runProcess haddockPath ["--version"] Nothing - env Nothing Nothing Nothing - wait h1 "*** Running `haddock --version' failed!" - putStrLn "" - putStrLn "GHC version: " - h2 <- runProcess haddockPath ["--ghc-version"] Nothing - env Nothing Nothing Nothing - wait h2 "*** Running `haddock --ghc-version' failed!" - putStrLn "" - - -- TODO: maybe do something more clever here using haddock.cabal - ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] - (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration - pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf - let mkDep pkgName = - fromMaybe (error "Couldn't find test dependencies") $ do - let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- listToMaybe pkgs - pkg <- listToMaybe pkgs' - ifacePath <- listToMaybe (haddockInterfaces pkg) - htmlPath <- listToMaybe (haddockHTMLs pkg) - return ("-i " ++ htmlPath ++ "," ++ ifacePath) - - let base = mkDep "base" - process = mkDep "process" - ghcprim = mkDep "ghc-prim" - - putStrLn "Running tests..." - handle <- runProcess haddockPath - (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" - , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing env Nothing - Nothing Nothing - - wait handle "*** Haddock run failed! Exiting." - check mods (if not (null args) && args !! 0 == "all" then False else True) - where - wait :: ProcessHandle -> String -> IO () - wait h msg = do - r <- waitForProcess h - unless (r == ExitSuccess) $ do - hPutStrLn stderr msg - exitFailure - -check :: [FilePath] -> Bool -> IO () -check modules strict = do - forM_ modules $ \mod -> do - let outfile = outDir dropExtension mod ++ ".html" - let reffile = refDir dropExtension mod ++ ".html" - b <- doesFileExist reffile - if b - then do - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq out ref - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = stripLinks ref - out' = stripLinks out - let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".ref.nolinks" - writeFile reffile' ref' - writeFile outfile' out' - r <- programOnPath "colordiff" - code <- if r - then system $ "colordiff " ++ reffile' ++ " " ++ outfile' - else system $ "diff " ++ reffile' ++ " " ++ outfile' - if strict then exitFailure else return () - unless (code == ExitSuccess) $ do - hPutStrLn stderr "*** Running diff failed!" - exitFailure - else do - putStrLn $ "Pass: " ++ mod - else do - putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" - - -haddockEq :: String -> String -> Bool -haddockEq file1 file2 = stripLinks file1 == stripLinks file2 - -stripLinks :: String -> String -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) diff --git a/html-test/runtests.lhs b/html-test/runtests.lhs new file mode 100755 index 00000000..c8671a76 --- /dev/null +++ b/html-test/runtests.lhs @@ -0,0 +1,156 @@ +#!/usr/bin/env runhaskell +\begin{code} +{-# LANGUAGE CPP #-} +import Prelude hiding (mod) +import Control.Monad +import Control.Applicative +import Data.List +import Data.Maybe +import Distribution.InstalledPackageInfo +import Distribution.Package (PackageName (..)) +import Distribution.Simple.Compiler +import Distribution.Simple.GHC +import Distribution.Simple.PackageIndex +import Distribution.Simple.Program +import Distribution.Simple.Utils +import Distribution.Verbosity +import System.IO +import System.Cmd +import System.Directory +import System.Environment +import System.Exit +import System.FilePath +import System.Process (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath +baseDir = takeDirectory __FILE__ +testDir = baseDir "tests" +refDir = baseDir "ref" +outDir = baseDir "output" +packageRoot = baseDir ".." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" + + +main :: IO () +main = do + test + putStrLn "All tests passed!" + + +test :: IO () +test = do + x <- doesFileExist haddockPath + unless x $ die "you need to run 'cabal build' successfully first" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + y:_ | y /= "all" -> [y ++ ".hs"] + _ -> filter ((==) ".hs" . takeExtension) contents + + let mods' = map (testDir ) mods + + -- add haddock_datadir to environment for subprocesses + env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment + + putStrLn "" + putStrLn "Haddock version: " + h1 <- runProcess haddockPath ["--version"] Nothing + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + env Nothing Nothing Nothing + wait h2 "*** Running `haddock --ghc-version' failed!" + putStrLn "" + + -- TODO: maybe do something more clever here using haddock.cabal + ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] + (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration + pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf + let mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + wait handle "*** Haddock run failed! Exiting." + check mods (if not (null args) && args !! 0 == "all" then False else True) + where + wait :: ProcessHandle -> String -> IO () + wait h msg = do + r <- waitForProcess h + unless (r == ExitSuccess) $ do + hPutStrLn stderr msg + exitFailure + +check :: [FilePath] -> Bool -> IO () +check modules strict = do + forM_ modules $ \mod -> do + let outfile = outDir dropExtension mod ++ ".html" + let reffile = refDir dropExtension mod ++ ".html" + b <- doesFileExist reffile + if b + then do + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".ref.nolinks" + writeFile reffile' ref' + writeFile outfile' out' + r <- programOnPath "colordiff" + code <- if r + then system $ "colordiff " ++ reffile' ++ " " ++ outfile' + else system $ "diff " ++ reffile' ++ " " ++ outfile' + if strict then exitFailure else return () + unless (code == ExitSuccess) $ do + hPutStrLn stderr "*** Running diff failed!" + exitFailure + else do + putStrLn $ "Pass: " ++ mod + else do + putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" + + +haddockEq :: String -> String -> Bool +haddockEq file1 file2 = stripLinks file1 == stripLinks file2 + +stripLinks :: String -> String +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) +\end{code} -- cgit v1.2.3 From fbaa58ba1c62e3087f3fdb3c1c295d1d797d62ec Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 19:48:23 +0200 Subject: Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. --- haddock.cabal | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 67e86452..78a6ed73 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -52,11 +52,22 @@ flag in-ghc-tree default: False manual: True +-- Using this disables -O2, and hence allows to use --disable-optimization, +-- which is about twice as fast. This should probably be the default, but we +-- need some benchmarks first.. +flag dev + default: False + manual: True + executable haddock default-language: Haskell2010 main-is: Main.hs hs-source-dirs: driver - ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs + + if flag(dev) + ghc-options: -funbox-strict-fields -Wall -fwarn-tabs + else + ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 build-depends: base >= 4.3 && < 4.7 @@ -129,7 +140,10 @@ library build-depends: ghc-paths hs-source-dirs: src - ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs + if flag(dev) + ghc-options: -funbox-strict-fields -Wall -fwarn-tabs + else + ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 exposed-modules: Documentation.Haddock -- cgit v1.2.3 From 0007a5adc2460ec3bca4b86eda670a93bf91c3c3 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:03:43 +0200 Subject: Add test case for "spurious superclass constraints bug" --- html-test/ref/SpuriousSuperclassConstraints.html | 128 +++++++++++++++++++++ .../ref/mini_SpuriousSuperclassConstraints.html | 33 ++++++ html-test/tests/SpuriousSuperclassConstraints.hs | 30 +++++ 3 files changed, 191 insertions(+) create mode 100644 html-test/ref/SpuriousSuperclassConstraints.html create mode 100644 html-test/ref/mini_SpuriousSuperclassConstraints.html create mode 100644 html-test/tests/SpuriousSuperclassConstraints.hs diff --git a/html-test/ref/SpuriousSuperclassConstraints.html b/html-test/ref/SpuriousSuperclassConstraints.html new file mode 100644 index 00000000..26b30d24 --- /dev/null +++ b/html-test/ref/SpuriousSuperclassConstraints.html @@ -0,0 +1,128 @@ + +SpuriousSuperclassConstraints
            Safe HaskellNone

            SpuriousSuperclassConstraints

            Description

            What is tested here: +

            Due to a change in GHC 7.6.1 we had a bug that superclass contraints were + included in the instances list. Edward K. repported it here: +

            http://www.haskell.org/pipermail/haskell-cafe/2012-September/103600.html +

            And here is the corresponding theard on glasgow-haskell-users: +

            http://www.haskell.org/pipermail/glasgow-haskell-users/2012-September/022914.html +

            It has been fixed in: +

             6ccf78e15a525282fef61bc4f58a279aa9c21771
            + Fix spurious superclass constraints bug.
            +

            Documentation

            data SomeType f a

            diff --git a/html-test/ref/mini_SpuriousSuperclassConstraints.html b/html-test/ref/mini_SpuriousSuperclassConstraints.html new file mode 100644 index 00000000..22079a4e --- /dev/null +++ b/html-test/ref/mini_SpuriousSuperclassConstraints.html @@ -0,0 +1,33 @@ + +SpuriousSuperclassConstraints

            SpuriousSuperclassConstraints

            data SomeType f a

            diff --git a/html-test/tests/SpuriousSuperclassConstraints.hs b/html-test/tests/SpuriousSuperclassConstraints.hs new file mode 100644 index 00000000..d9e43e1c --- /dev/null +++ b/html-test/tests/SpuriousSuperclassConstraints.hs @@ -0,0 +1,30 @@ +{-# LANGUAGE EmptyDataDecls, KindSignatures #-} +-- | +-- What is tested here: +-- +-- Due to a change in GHC 7.6.1 we had a bug that superclass contraints were +-- included in the instances list. Edward K. repported it here: +-- +-- +-- +-- And here is the corresponding theard on glasgow-haskell-users: +-- +-- +-- +-- It has been fixed in: +-- +-- > 6ccf78e15a525282fef61bc4f58a279aa9c21771 +-- > Fix spurious superclass constraints bug. +-- +module SpuriousSuperclassConstraints where + +import Control.Applicative + +data SomeType (f :: * -> *) a + +instance Functor (SomeType f) where + fmap = undefined + +instance Applicative f => Applicative (SomeType f) where + pure = undefined + (<*>) = undefined -- cgit v1.2.3 From 18fd9f5a0a1debe23bef4ba813143b886d586740 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:28:26 +0200 Subject: Adapt accept.lhs, so that it ignores more index files --- html-test/accept.lhs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/html-test/accept.lhs b/html-test/accept.lhs index 3dfc099b..ea55c35c 100755 --- a/html-test/accept.lhs +++ b/html-test/accept.lhs @@ -12,19 +12,19 @@ baseDir = takeDirectory __FILE__ main :: IO () main = do - contents <- filter (`notElem` ignore) <$> getDirectoryContents (baseDir "output") + contents <- filter (not . ignore) <$> getDirectoryContents (baseDir "output") args <- getArgs if not $ null args then mapM_ copy [ baseDir "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] else mapM_ copy [ baseDir "output" file | file <- contents] where - ignore = [ - "." - , ".." - , "doc-index.html" - , "index-frames.html" - , "index.html" + ignore = + foldr (liftA2 (||)) (const False) [ + (== ".") + , (== "..") + , (isPrefixOf "index") + , (isPrefixOf "doc-index") ] copy :: FilePath -> IO () -- cgit v1.2.3 From a4fb9cb0a44101d858d69281a3ee0aa0dbf7ddda Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:29:43 +0200 Subject: Rename html-test/runtests.lhs to html-test/run.lhs --- haddock.cabal | 4 +- html-test/run.lhs | 156 +++++++++++++++++++++++++++++++++++++++++++++++++ html-test/runtests.lhs | 156 ------------------------------------------------- 3 files changed, 158 insertions(+), 158 deletions(-) create mode 100755 html-test/run.lhs delete mode 100755 html-test/runtests.lhs diff --git a/haddock.cabal b/haddock.cabal index 78a6ed73..99bf5e4a 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -31,7 +31,7 @@ extra-source-files: src/haddock.sh -- The test files shouldn't have to go here, but the source files for -- the test-suite stanzas don't get picked up by `cabal sdist`. - tests/html-test/runtests.lhs + tests/html-test/run.lhs data-dir: resources data-files: html/frames.html @@ -186,7 +186,7 @@ library test-suite html-test type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: runtests.lhs + main-is: run.lhs hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal diff --git a/html-test/run.lhs b/html-test/run.lhs new file mode 100755 index 00000000..c8671a76 --- /dev/null +++ b/html-test/run.lhs @@ -0,0 +1,156 @@ +#!/usr/bin/env runhaskell +\begin{code} +{-# LANGUAGE CPP #-} +import Prelude hiding (mod) +import Control.Monad +import Control.Applicative +import Data.List +import Data.Maybe +import Distribution.InstalledPackageInfo +import Distribution.Package (PackageName (..)) +import Distribution.Simple.Compiler +import Distribution.Simple.GHC +import Distribution.Simple.PackageIndex +import Distribution.Simple.Program +import Distribution.Simple.Utils +import Distribution.Verbosity +import System.IO +import System.Cmd +import System.Directory +import System.Environment +import System.Exit +import System.FilePath +import System.Process (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath +baseDir = takeDirectory __FILE__ +testDir = baseDir "tests" +refDir = baseDir "ref" +outDir = baseDir "output" +packageRoot = baseDir ".." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" + + +main :: IO () +main = do + test + putStrLn "All tests passed!" + + +test :: IO () +test = do + x <- doesFileExist haddockPath + unless x $ die "you need to run 'cabal build' successfully first" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + y:_ | y /= "all" -> [y ++ ".hs"] + _ -> filter ((==) ".hs" . takeExtension) contents + + let mods' = map (testDir ) mods + + -- add haddock_datadir to environment for subprocesses + env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment + + putStrLn "" + putStrLn "Haddock version: " + h1 <- runProcess haddockPath ["--version"] Nothing + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + env Nothing Nothing Nothing + wait h2 "*** Running `haddock --ghc-version' failed!" + putStrLn "" + + -- TODO: maybe do something more clever here using haddock.cabal + ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] + (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration + pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf + let mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + wait handle "*** Haddock run failed! Exiting." + check mods (if not (null args) && args !! 0 == "all" then False else True) + where + wait :: ProcessHandle -> String -> IO () + wait h msg = do + r <- waitForProcess h + unless (r == ExitSuccess) $ do + hPutStrLn stderr msg + exitFailure + +check :: [FilePath] -> Bool -> IO () +check modules strict = do + forM_ modules $ \mod -> do + let outfile = outDir dropExtension mod ++ ".html" + let reffile = refDir dropExtension mod ++ ".html" + b <- doesFileExist reffile + if b + then do + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".ref.nolinks" + writeFile reffile' ref' + writeFile outfile' out' + r <- programOnPath "colordiff" + code <- if r + then system $ "colordiff " ++ reffile' ++ " " ++ outfile' + else system $ "diff " ++ reffile' ++ " " ++ outfile' + if strict then exitFailure else return () + unless (code == ExitSuccess) $ do + hPutStrLn stderr "*** Running diff failed!" + exitFailure + else do + putStrLn $ "Pass: " ++ mod + else do + putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" + + +haddockEq :: String -> String -> Bool +haddockEq file1 file2 = stripLinks file1 == stripLinks file2 + +stripLinks :: String -> String +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) +\end{code} diff --git a/html-test/runtests.lhs b/html-test/runtests.lhs deleted file mode 100755 index c8671a76..00000000 --- a/html-test/runtests.lhs +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env runhaskell -\begin{code} -{-# LANGUAGE CPP #-} -import Prelude hiding (mod) -import Control.Monad -import Control.Applicative -import Data.List -import Data.Maybe -import Distribution.InstalledPackageInfo -import Distribution.Package (PackageName (..)) -import Distribution.Simple.Compiler -import Distribution.Simple.GHC -import Distribution.Simple.PackageIndex -import Distribution.Simple.Program -import Distribution.Simple.Utils -import Distribution.Verbosity -import System.IO -import System.Cmd -import System.Directory -import System.Environment -import System.Exit -import System.FilePath -import System.Process (ProcessHandle, runProcess, waitForProcess) - - -packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath -baseDir = takeDirectory __FILE__ -testDir = baseDir "tests" -refDir = baseDir "ref" -outDir = baseDir "output" -packageRoot = baseDir ".." -dataDir = packageRoot "resources" -haddockPath = packageRoot "dist" "build" "haddock" "haddock" - - -main :: IO () -main = do - test - putStrLn "All tests passed!" - - -test :: IO () -test = do - x <- doesFileExist haddockPath - unless x $ die "you need to run 'cabal build' successfully first" - - contents <- getDirectoryContents testDir - args <- getArgs - let (opts, spec) = span ("-" `isPrefixOf`) args - let mods = - case spec of - y:_ | y /= "all" -> [y ++ ".hs"] - _ -> filter ((==) ".hs" . takeExtension) contents - - let mods' = map (testDir ) mods - - -- add haddock_datadir to environment for subprocesses - env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment - - putStrLn "" - putStrLn "Haddock version: " - h1 <- runProcess haddockPath ["--version"] Nothing - env Nothing Nothing Nothing - wait h1 "*** Running `haddock --version' failed!" - putStrLn "" - putStrLn "GHC version: " - h2 <- runProcess haddockPath ["--ghc-version"] Nothing - env Nothing Nothing Nothing - wait h2 "*** Running `haddock --ghc-version' failed!" - putStrLn "" - - -- TODO: maybe do something more clever here using haddock.cabal - ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] - (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration - pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf - let mkDep pkgName = - fromMaybe (error "Couldn't find test dependencies") $ do - let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- listToMaybe pkgs - pkg <- listToMaybe pkgs' - ifacePath <- listToMaybe (haddockInterfaces pkg) - htmlPath <- listToMaybe (haddockHTMLs pkg) - return ("-i " ++ htmlPath ++ "," ++ ifacePath) - - let base = mkDep "base" - process = mkDep "process" - ghcprim = mkDep "ghc-prim" - - putStrLn "Running tests..." - handle <- runProcess haddockPath - (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" - , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing env Nothing - Nothing Nothing - - wait handle "*** Haddock run failed! Exiting." - check mods (if not (null args) && args !! 0 == "all" then False else True) - where - wait :: ProcessHandle -> String -> IO () - wait h msg = do - r <- waitForProcess h - unless (r == ExitSuccess) $ do - hPutStrLn stderr msg - exitFailure - -check :: [FilePath] -> Bool -> IO () -check modules strict = do - forM_ modules $ \mod -> do - let outfile = outDir dropExtension mod ++ ".html" - let reffile = refDir dropExtension mod ++ ".html" - b <- doesFileExist reffile - if b - then do - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq out ref - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = stripLinks ref - out' = stripLinks out - let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".ref.nolinks" - writeFile reffile' ref' - writeFile outfile' out' - r <- programOnPath "colordiff" - code <- if r - then system $ "colordiff " ++ reffile' ++ " " ++ outfile' - else system $ "diff " ++ reffile' ++ " " ++ outfile' - if strict then exitFailure else return () - unless (code == ExitSuccess) $ do - hPutStrLn stderr "*** Running diff failed!" - exitFailure - else do - putStrLn $ "Pass: " ++ mod - else do - putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" - - -haddockEq :: String -> String -> Bool -haddockEq file1 file2 = stripLinks file1 == stripLinks file2 - -stripLinks :: String -> String -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) -\end{code} -- cgit v1.2.3 From 7e1fed4da8bb913d25f447afd1f1e485d428e37f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:32:03 +0200 Subject: Move source files for HTML tests to html-test/src --- html-test/README | 2 +- html-test/run.lhs | 2 +- html-test/src/A.hs | 17 + html-test/src/AdvanceTypes.hs | 9 + html-test/src/B.hs | 8 + html-test/src/Bug1.hs | 6 + html-test/src/Bug2.hs | 4 + html-test/src/Bug3.hs | 6 + html-test/src/Bug4.hs | 5 + html-test/src/Bug6.hs | 23 ++ html-test/src/Bug7.hs | 12 + html-test/src/Bug8.hs | 14 + html-test/src/BugDeprecated.hs | 18 + html-test/src/BugExportHeadings.hs | 29 ++ html-test/src/Bugs.hs | 3 + html-test/src/CrossPackageDocs.hs | 4 + html-test/src/DeprecatedClass.hs | 15 + html-test/src/DeprecatedData.hs | 15 + html-test/src/DeprecatedFunction.hs | 10 + html-test/src/DeprecatedFunction2.hs | 6 + html-test/src/DeprecatedFunction3.hs | 6 + html-test/src/DeprecatedModule.hs | 5 + html-test/src/DeprecatedModule2.hs | 4 + html-test/src/DeprecatedNewtype.hs | 10 + html-test/src/DeprecatedReExport.hs | 16 + html-test/src/DeprecatedRecord.hs | 9 + html-test/src/DeprecatedTypeFamily.hs | 9 + html-test/src/DeprecatedTypeSynonym.hs | 9 + html-test/src/DeprecationMessageParseError.hs | 12 + html-test/src/Examples.hs | 39 +++ html-test/src/FunArgs.hs | 16 + html-test/src/GADTRecords.hs | 12 + html-test/src/Hash.hs | 51 +++ html-test/src/Hidden.hs | 6 + html-test/src/HiddenInstances.hs | 35 ++ html-test/src/HiddenInstancesA.hs | 17 + html-test/src/HiddenInstancesB.hs | 2 + html-test/src/Hyperlinks.hs | 8 + html-test/src/IgnoreExports.hs | 10 + html-test/src/ModuleWithWarning.hs | 5 + html-test/src/NamedDoc.hs | 4 + html-test/src/NoLayout.hs | 12 + html-test/src/NonGreedy.hs | 5 + html-test/src/Properties.hs | 9 + html-test/src/PruneWithWarning.hs | 15 + html-test/src/QuasiExpr.hs | 34 ++ html-test/src/QuasiQuote.hs | 9 + html-test/src/SpuriousSuperclassConstraints.hs | 30 ++ html-test/src/TH.hs | 8 + html-test/src/TH2.hs | 7 + html-test/src/Test.hs | 422 +++++++++++++++++++++++ html-test/src/Ticket112.hs | 9 + html-test/src/Ticket61.hs | 3 + html-test/src/Ticket61_Hidden.hs | 7 + html-test/src/Ticket75.hs | 7 + html-test/src/TypeFamilies.hs | 28 ++ html-test/src/TypeOperators.hs | 20 ++ html-test/src/Unicode.hs.disabled | 6 + html-test/src/Visible.hs | 3 + html-test/tests/A.hs | 17 - html-test/tests/AdvanceTypes.hs | 9 - html-test/tests/B.hs | 8 - html-test/tests/Bug1.hs | 6 - html-test/tests/Bug2.hs | 4 - html-test/tests/Bug3.hs | 6 - html-test/tests/Bug4.hs | 5 - html-test/tests/Bug6.hs | 23 -- html-test/tests/Bug7.hs | 12 - html-test/tests/Bug8.hs | 14 - html-test/tests/BugDeprecated.hs | 18 - html-test/tests/BugExportHeadings.hs | 29 -- html-test/tests/Bugs.hs | 3 - html-test/tests/CrossPackageDocs.hs | 4 - html-test/tests/DeprecatedClass.hs | 15 - html-test/tests/DeprecatedData.hs | 15 - html-test/tests/DeprecatedFunction.hs | 10 - html-test/tests/DeprecatedFunction2.hs | 6 - html-test/tests/DeprecatedFunction3.hs | 6 - html-test/tests/DeprecatedModule.hs | 5 - html-test/tests/DeprecatedModule2.hs | 4 - html-test/tests/DeprecatedNewtype.hs | 10 - html-test/tests/DeprecatedReExport.hs | 16 - html-test/tests/DeprecatedRecord.hs | 9 - html-test/tests/DeprecatedTypeFamily.hs | 9 - html-test/tests/DeprecatedTypeSynonym.hs | 9 - html-test/tests/DeprecationMessageParseError.hs | 12 - html-test/tests/Examples.hs | 39 --- html-test/tests/FunArgs.hs | 16 - html-test/tests/GADTRecords.hs | 12 - html-test/tests/Hash.hs | 51 --- html-test/tests/Hidden.hs | 6 - html-test/tests/HiddenInstances.hs | 35 -- html-test/tests/HiddenInstancesA.hs | 17 - html-test/tests/HiddenInstancesB.hs | 2 - html-test/tests/Hyperlinks.hs | 8 - html-test/tests/IgnoreExports.hs | 10 - html-test/tests/ModuleWithWarning.hs | 5 - html-test/tests/NamedDoc.hs | 4 - html-test/tests/NoLayout.hs | 12 - html-test/tests/NonGreedy.hs | 5 - html-test/tests/Properties.hs | 9 - html-test/tests/PruneWithWarning.hs | 15 - html-test/tests/QuasiExpr.hs | 34 -- html-test/tests/QuasiQuote.hs | 9 - html-test/tests/SpuriousSuperclassConstraints.hs | 30 -- html-test/tests/TH.hs | 8 - html-test/tests/TH2.hs | 7 - html-test/tests/Test.hs | 422 ----------------------- html-test/tests/Ticket112.hs | 9 - html-test/tests/Ticket61.hs | 3 - html-test/tests/Ticket61_Hidden.hs | 7 - html-test/tests/Ticket75.hs | 7 - html-test/tests/TypeFamilies.hs | 28 -- html-test/tests/TypeOperators.hs | 20 -- html-test/tests/Unicode.hs.disabled | 6 - html-test/tests/Visible.hs | 3 - 116 files changed, 1125 insertions(+), 1125 deletions(-) create mode 100644 html-test/src/A.hs create mode 100644 html-test/src/AdvanceTypes.hs create mode 100644 html-test/src/B.hs create mode 100644 html-test/src/Bug1.hs create mode 100644 html-test/src/Bug2.hs create mode 100644 html-test/src/Bug3.hs create mode 100644 html-test/src/Bug4.hs create mode 100644 html-test/src/Bug6.hs create mode 100644 html-test/src/Bug7.hs create mode 100644 html-test/src/Bug8.hs create mode 100644 html-test/src/BugDeprecated.hs create mode 100644 html-test/src/BugExportHeadings.hs create mode 100644 html-test/src/Bugs.hs create mode 100644 html-test/src/CrossPackageDocs.hs create mode 100644 html-test/src/DeprecatedClass.hs create mode 100644 html-test/src/DeprecatedData.hs create mode 100644 html-test/src/DeprecatedFunction.hs create mode 100644 html-test/src/DeprecatedFunction2.hs create mode 100644 html-test/src/DeprecatedFunction3.hs create mode 100644 html-test/src/DeprecatedModule.hs create mode 100644 html-test/src/DeprecatedModule2.hs create mode 100644 html-test/src/DeprecatedNewtype.hs create mode 100644 html-test/src/DeprecatedReExport.hs create mode 100644 html-test/src/DeprecatedRecord.hs create mode 100644 html-test/src/DeprecatedTypeFamily.hs create mode 100644 html-test/src/DeprecatedTypeSynonym.hs create mode 100644 html-test/src/DeprecationMessageParseError.hs create mode 100644 html-test/src/Examples.hs create mode 100644 html-test/src/FunArgs.hs create mode 100644 html-test/src/GADTRecords.hs create mode 100644 html-test/src/Hash.hs create mode 100644 html-test/src/Hidden.hs create mode 100644 html-test/src/HiddenInstances.hs create mode 100644 html-test/src/HiddenInstancesA.hs create mode 100644 html-test/src/HiddenInstancesB.hs create mode 100644 html-test/src/Hyperlinks.hs create mode 100644 html-test/src/IgnoreExports.hs create mode 100644 html-test/src/ModuleWithWarning.hs create mode 100644 html-test/src/NamedDoc.hs create mode 100644 html-test/src/NoLayout.hs create mode 100644 html-test/src/NonGreedy.hs create mode 100644 html-test/src/Properties.hs create mode 100644 html-test/src/PruneWithWarning.hs create mode 100644 html-test/src/QuasiExpr.hs create mode 100644 html-test/src/QuasiQuote.hs create mode 100644 html-test/src/SpuriousSuperclassConstraints.hs create mode 100644 html-test/src/TH.hs create mode 100644 html-test/src/TH2.hs create mode 100644 html-test/src/Test.hs create mode 100644 html-test/src/Ticket112.hs create mode 100644 html-test/src/Ticket61.hs create mode 100644 html-test/src/Ticket61_Hidden.hs create mode 100644 html-test/src/Ticket75.hs create mode 100644 html-test/src/TypeFamilies.hs create mode 100644 html-test/src/TypeOperators.hs create mode 100644 html-test/src/Unicode.hs.disabled create mode 100644 html-test/src/Visible.hs delete mode 100644 html-test/tests/A.hs delete mode 100644 html-test/tests/AdvanceTypes.hs delete mode 100644 html-test/tests/B.hs delete mode 100644 html-test/tests/Bug1.hs delete mode 100644 html-test/tests/Bug2.hs delete mode 100644 html-test/tests/Bug3.hs delete mode 100644 html-test/tests/Bug4.hs delete mode 100644 html-test/tests/Bug6.hs delete mode 100644 html-test/tests/Bug7.hs delete mode 100644 html-test/tests/Bug8.hs delete mode 100644 html-test/tests/BugDeprecated.hs delete mode 100644 html-test/tests/BugExportHeadings.hs delete mode 100644 html-test/tests/Bugs.hs delete mode 100644 html-test/tests/CrossPackageDocs.hs delete mode 100644 html-test/tests/DeprecatedClass.hs delete mode 100644 html-test/tests/DeprecatedData.hs delete mode 100644 html-test/tests/DeprecatedFunction.hs delete mode 100644 html-test/tests/DeprecatedFunction2.hs delete mode 100644 html-test/tests/DeprecatedFunction3.hs delete mode 100644 html-test/tests/DeprecatedModule.hs delete mode 100644 html-test/tests/DeprecatedModule2.hs delete mode 100644 html-test/tests/DeprecatedNewtype.hs delete mode 100644 html-test/tests/DeprecatedReExport.hs delete mode 100644 html-test/tests/DeprecatedRecord.hs delete mode 100644 html-test/tests/DeprecatedTypeFamily.hs delete mode 100644 html-test/tests/DeprecatedTypeSynonym.hs delete mode 100644 html-test/tests/DeprecationMessageParseError.hs delete mode 100644 html-test/tests/Examples.hs delete mode 100644 html-test/tests/FunArgs.hs delete mode 100644 html-test/tests/GADTRecords.hs delete mode 100644 html-test/tests/Hash.hs delete mode 100644 html-test/tests/Hidden.hs delete mode 100644 html-test/tests/HiddenInstances.hs delete mode 100644 html-test/tests/HiddenInstancesA.hs delete mode 100644 html-test/tests/HiddenInstancesB.hs delete mode 100644 html-test/tests/Hyperlinks.hs delete mode 100644 html-test/tests/IgnoreExports.hs delete mode 100644 html-test/tests/ModuleWithWarning.hs delete mode 100644 html-test/tests/NamedDoc.hs delete mode 100644 html-test/tests/NoLayout.hs delete mode 100644 html-test/tests/NonGreedy.hs delete mode 100644 html-test/tests/Properties.hs delete mode 100644 html-test/tests/PruneWithWarning.hs delete mode 100644 html-test/tests/QuasiExpr.hs delete mode 100644 html-test/tests/QuasiQuote.hs delete mode 100644 html-test/tests/SpuriousSuperclassConstraints.hs delete mode 100644 html-test/tests/TH.hs delete mode 100644 html-test/tests/TH2.hs delete mode 100644 html-test/tests/Test.hs delete mode 100644 html-test/tests/Ticket112.hs delete mode 100644 html-test/tests/Ticket61.hs delete mode 100644 html-test/tests/Ticket61_Hidden.hs delete mode 100644 html-test/tests/Ticket75.hs delete mode 100644 html-test/tests/TypeFamilies.hs delete mode 100644 html-test/tests/TypeOperators.hs delete mode 100644 html-test/tests/Unicode.hs.disabled delete mode 100644 html-test/tests/Visible.hs diff --git a/html-test/README b/html-test/README index d261888c..b5fff14b 100644 --- a/html-test/README +++ b/html-test/README @@ -3,7 +3,7 @@ is, it compares output files against a set of reference files. To add a new test: - 1) Create a module in the "tests" directory. + 1) Create a module in the "html-test/src" directory. 2) Run "cabal test". You should now have output/.html. The test passes since there is no reference file to compare with. diff --git a/html-test/run.lhs b/html-test/run.lhs index c8671a76..c543e020 100755 --- a/html-test/run.lhs +++ b/html-test/run.lhs @@ -25,7 +25,7 @@ import System.Process (ProcessHandle, runProcess, waitForProcess) packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath baseDir = takeDirectory __FILE__ -testDir = baseDir "tests" +testDir = baseDir "src" refDir = baseDir "ref" outDir = baseDir "output" packageRoot = baseDir ".." diff --git a/html-test/src/A.hs b/html-test/src/A.hs new file mode 100644 index 00000000..606b0865 --- /dev/null +++ b/html-test/src/A.hs @@ -0,0 +1,17 @@ +module A where + +data A = A + +other :: Int +other = 2 + +-- | Doc for test2 +test2 :: Bool +test2 = False + +-- | Should show up on the page for both modules A and B +data X = X -- ^ Doc for consructor + +-- | Should show up on the page for both modules A and B +reExport :: Int +reExport = 1 diff --git a/html-test/src/AdvanceTypes.hs b/html-test/src/AdvanceTypes.hs new file mode 100644 index 00000000..939fdf07 --- /dev/null +++ b/html-test/src/AdvanceTypes.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE TypeOperators #-} +module AdvanceTypes where + +data Pattern :: [*] -> * where + Nil :: Pattern '[] + Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/html-test/src/B.hs b/html-test/src/B.hs new file mode 100644 index 00000000..5fd69acd --- /dev/null +++ b/html-test/src/B.hs @@ -0,0 +1,8 @@ +module B ( module A, test, reExport, X(..) ) where +import A ( A(..), test2, reExport, X(..) ) + +-- | This link shouldn't work: 'other'. +-- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. +-- Module link: "Prelude". +test :: Int +test = 1 diff --git a/html-test/src/Bug1.hs b/html-test/src/Bug1.hs new file mode 100644 index 00000000..af1ed4d3 --- /dev/null +++ b/html-test/src/Bug1.hs @@ -0,0 +1,6 @@ +module Bug1 where + +-- | We should have different anchors for constructors and types\/classes. This +-- hyperlink should point to the type constructor by default: 'T'. +data T = T + diff --git a/html-test/src/Bug2.hs b/html-test/src/Bug2.hs new file mode 100644 index 00000000..9121922e --- /dev/null +++ b/html-test/src/Bug2.hs @@ -0,0 +1,4 @@ +module Bug2 ( x ) where +import B +x :: A +x = A diff --git a/html-test/src/Bug3.hs b/html-test/src/Bug3.hs new file mode 100644 index 00000000..67e57892 --- /dev/null +++ b/html-test/src/Bug3.hs @@ -0,0 +1,6 @@ +module Bug3 where + +-- | /multi-line +-- emphasis/ +foo :: Int +foo = undefined diff --git a/html-test/src/Bug4.hs b/html-test/src/Bug4.hs new file mode 100644 index 00000000..425a77aa --- /dev/null +++ b/html-test/src/Bug4.hs @@ -0,0 +1,5 @@ +module Bug4 where +-- | don't use apostrophe's in the wrong place's +foo :: Int +foo = undefined + diff --git a/html-test/src/Bug6.hs b/html-test/src/Bug6.hs new file mode 100644 index 00000000..17411f31 --- /dev/null +++ b/html-test/src/Bug6.hs @@ -0,0 +1,23 @@ +-- | Exporting records. +module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where + +-- | +-- This record is exported without its field +data A = A { a :: Int } + +-- | +-- .. with its field, but the field is named separately in the export list +-- (the field isn't documented separately since it is already documented here) +data B = B { b :: Int } + +-- | +-- .. with fields names as subordinate names in the export +data C = C { c1 :: Int, c2 :: Int } + +-- | +-- .. with only some of the fields exported (we can't handle this one - +-- how do we render the declaration?) +data D = D { d1 :: Int, d2 :: Int } + +-- | a newtype with a field +newtype E = E { e :: Int } diff --git a/html-test/src/Bug7.hs b/html-test/src/Bug7.hs new file mode 100644 index 00000000..8cf57914 --- /dev/null +++ b/html-test/src/Bug7.hs @@ -0,0 +1,12 @@ +-- | This module caused a duplicate instance in the documentation for the Foo +-- type. +module Bug7 where + +-- | The Foo datatype +data Foo = Foo + +-- | The Bar class +class Bar x y + +-- | Just one instance +instance Bar Foo Foo diff --git a/html-test/src/Bug8.hs b/html-test/src/Bug8.hs new file mode 100644 index 00000000..18df63c8 --- /dev/null +++ b/html-test/src/Bug8.hs @@ -0,0 +1,14 @@ +module Bug8 where + +infix --> +infix ---> + +data Typ = Type (String,[Typ]) + | TFree (String, [String]) + +x --> y = Type("fun",[s,t]) +(--->) = flip $ foldr (-->) + +s = undefined +t = undefined +main = undefined diff --git a/html-test/src/BugDeprecated.hs b/html-test/src/BugDeprecated.hs new file mode 100644 index 00000000..0f7ac2eb --- /dev/null +++ b/html-test/src/BugDeprecated.hs @@ -0,0 +1,18 @@ +module BugDeprecated where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 +{-# DEPRECATED foo "for foo" #-} +{-# DEPRECATED bar "for bar" #-} +{-# DEPRECATED baz "for baz" #-} + +-- | some documentation for one, two and three +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/src/BugExportHeadings.hs b/html-test/src/BugExportHeadings.hs new file mode 100644 index 00000000..a5493a08 --- /dev/null +++ b/html-test/src/BugExportHeadings.hs @@ -0,0 +1,29 @@ +-- test for #192 +module BugExportHeadings ( +-- * Foo + foo +-- * Bar +, bar +-- * Baz +, baz + +-- * One +, one +-- * Two +, two +-- * Three +, three +) where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 + +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/src/Bugs.hs b/html-test/src/Bugs.hs new file mode 100644 index 00000000..8e1f0079 --- /dev/null +++ b/html-test/src/Bugs.hs @@ -0,0 +1,3 @@ +module Bugs where + +data A a = A a (a -> Int) diff --git a/html-test/src/CrossPackageDocs.hs b/html-test/src/CrossPackageDocs.hs new file mode 100644 index 00000000..4d529f79 --- /dev/null +++ b/html-test/src/CrossPackageDocs.hs @@ -0,0 +1,4 @@ +module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where + +import System.Process +import Data.String diff --git a/html-test/src/DeprecatedClass.hs b/html-test/src/DeprecatedClass.hs new file mode 100644 index 00000000..018904ab --- /dev/null +++ b/html-test/src/DeprecatedClass.hs @@ -0,0 +1,15 @@ +module DeprecatedClass where + +-- | some class +class SomeClass a where + -- | documentation for foo + foo :: a -> a + +{-# DEPRECATED SomeClass "SomeClass" #-} +{-# DEPRECATED foo "foo" #-} + +class SomeOtherClass a where + bar :: a -> a + +{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} +{-# DEPRECATED bar "bar" #-} diff --git a/html-test/src/DeprecatedData.hs b/html-test/src/DeprecatedData.hs new file mode 100644 index 00000000..c40ba122 --- /dev/null +++ b/html-test/src/DeprecatedData.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedData where + +-- | type Foo +data Foo = Foo -- ^ constructor Foo + | Bar -- ^ constructor Bar + +{-# DEPRECATED Foo "Foo" #-} +{-# DEPRECATED Bar "Bar" #-} + +data One = One + | Two + +{-# DEPRECATED One "One" #-} +{-# DEPRECATED Two "Two" #-} diff --git a/html-test/src/DeprecatedFunction.hs b/html-test/src/DeprecatedFunction.hs new file mode 100644 index 00000000..8d626435 --- /dev/null +++ b/html-test/src/DeprecatedFunction.hs @@ -0,0 +1,10 @@ +module DeprecatedFunction where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use `bar` instead" #-} + +-- | some documentation for bar +bar :: Int +bar = 42 diff --git a/html-test/src/DeprecatedFunction2.hs b/html-test/src/DeprecatedFunction2.hs new file mode 100644 index 00000000..bdbbf95c --- /dev/null +++ b/html-test/src/DeprecatedFunction2.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction2 where + + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/src/DeprecatedFunction3.hs b/html-test/src/DeprecatedFunction3.hs new file mode 100644 index 00000000..ca719bda --- /dev/null +++ b/html-test/src/DeprecatedFunction3.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction3 where + + + +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/src/DeprecatedModule.hs b/html-test/src/DeprecatedModule.hs new file mode 100644 index 00000000..369dba4f --- /dev/null +++ b/html-test/src/DeprecatedModule.hs @@ -0,0 +1,5 @@ +-- | Documentation for "DeprecatedModule". +module DeprecatedModule {-# DEPRECATED "Use \"Foo\" instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/src/DeprecatedModule2.hs b/html-test/src/DeprecatedModule2.hs new file mode 100644 index 00000000..94185297 --- /dev/null +++ b/html-test/src/DeprecatedModule2.hs @@ -0,0 +1,4 @@ +module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/src/DeprecatedNewtype.hs b/html-test/src/DeprecatedNewtype.hs new file mode 100644 index 00000000..254f1f55 --- /dev/null +++ b/html-test/src/DeprecatedNewtype.hs @@ -0,0 +1,10 @@ +module DeprecatedNewtype where + +-- | some documentation +newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} +{-# DEPRECATED SomeNewType "SomeNewType" #-} +{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} + +newtype SomeOtherNewType = SomeOtherNewTypeConst String +{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} +{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} diff --git a/html-test/src/DeprecatedReExport.hs b/html-test/src/DeprecatedReExport.hs new file mode 100644 index 00000000..f851e2ff --- /dev/null +++ b/html-test/src/DeprecatedReExport.hs @@ -0,0 +1,16 @@ +-- | +-- What is tested here: +-- +-- * Deprecation messages are shown for re-exported items. +-- +module DeprecatedReExport ( +-- * Re-exported from an other module + foo +-- * Re-exported from an other package +-- | Not yet working, see +-- , isEmptyChan +, +) where + +import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/html-test/src/DeprecatedRecord.hs b/html-test/src/DeprecatedRecord.hs new file mode 100644 index 00000000..d44499e7 --- /dev/null +++ b/html-test/src/DeprecatedRecord.hs @@ -0,0 +1,9 @@ +module DeprecatedRecord where + +-- | type Foo +data Foo = Foo { + fooName :: String -- ^ some name +, fooValue :: Int -- ^ some value +} + +{-# DEPRECATED fooValue "do not use this" #-} diff --git a/html-test/src/DeprecatedTypeFamily.hs b/html-test/src/DeprecatedTypeFamily.hs new file mode 100644 index 00000000..70473bb8 --- /dev/null +++ b/html-test/src/DeprecatedTypeFamily.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedTypeFamily where + +-- | some documentation +data family SomeTypeFamily k :: * -> * +{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} + +data family SomeOtherTypeFamily k :: * -> * +{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/html-test/src/DeprecatedTypeSynonym.hs b/html-test/src/DeprecatedTypeSynonym.hs new file mode 100644 index 00000000..34df47da --- /dev/null +++ b/html-test/src/DeprecatedTypeSynonym.hs @@ -0,0 +1,9 @@ + +module DeprecatedTypeSynonym where + +-- | some documentation +type TypeSyn = String +{-# DEPRECATED TypeSyn "TypeSyn" #-} + +type OtherTypeSyn = String +{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} diff --git a/html-test/src/DeprecationMessageParseError.hs b/html-test/src/DeprecationMessageParseError.hs new file mode 100644 index 00000000..2f8fb492 --- /dev/null +++ b/html-test/src/DeprecationMessageParseError.hs @@ -0,0 +1,12 @@ +-- | +-- What is tested here: +-- +-- * If parsing of a deprecation message fails, the message is included +-- verbatim. +-- +module DeprecationMessageParseError where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use @bar instead" #-} diff --git a/html-test/src/Examples.hs b/html-test/src/Examples.hs new file mode 100644 index 00000000..c8c450f1 --- /dev/null +++ b/html-test/src/Examples.hs @@ -0,0 +1,39 @@ +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- >>> fib 5 +-- 5 +-- >>> fib 10 +-- 55 +-- +-- >>> fib 10 +-- 55 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- >>> import Data.Char +-- >>> isSpace 'a' +-- False +-- +-- >>> putStrLn "foo\n\nbar" +-- foo +-- +-- bar +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/src/FunArgs.hs b/html-test/src/FunArgs.hs new file mode 100644 index 00000000..b34d84b7 --- /dev/null +++ b/html-test/src/FunArgs.hs @@ -0,0 +1,16 @@ +module FunArgs where + +f :: forall a. Ord a + => Int -- ^ First argument + -> a -- ^ Second argument + -> Bool -- ^ Third argument + -> (a -> a) -- ^ Fourth argument + -> () -- ^ Result +f = undefined + + +g :: a -- ^ First argument + -> b -- ^ Second argument + -> c -- ^ Third argument + -> d -- ^ Result +g = undefined diff --git a/html-test/src/GADTRecords.hs b/html-test/src/GADTRecords.hs new file mode 100644 index 00000000..c77810ad --- /dev/null +++ b/html-test/src/GADTRecords.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE GADTs #-} +module GADTRecords (H1(..)) where + +-- | h1 +data H1 a b where + C1 :: H1 a b + C2 :: Ord a => [a] -> H1 a a + C3 { field :: Int -- ^ hello docs + } :: H1 Int Int + C4 { field2 :: a -- ^ hello2 docs + } :: H1 Int a + diff --git a/html-test/src/Hash.hs b/html-test/src/Hash.hs new file mode 100644 index 00000000..343b69e9 --- /dev/null +++ b/html-test/src/Hash.hs @@ -0,0 +1,51 @@ +{- | + Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +-} +module Hash ( + -- * The @HashTable@ type + HashTable, + + -- ** Operations on @HashTable@s + new, insert, lookup, + + -- * The @Hash@ class + Hash(..), + ) where + +import Data.Array +import Prelude hiding (lookup) + +-- | A hash table with keys of type @key@ and values of type @val@. +-- The type @key@ should be an instance of 'Eq'. +data HashTable key val = HashTable Int (Array Int [(key,val)]) + +-- | Builds a new hash table with a given size +new :: (Eq key, Hash key) => Int -> IO (HashTable key val) +new = undefined + +-- | Inserts a new element into the hash table +insert :: (Eq key, Hash key) => key -> val -> IO () +insert = undefined + +-- | Looks up a key in the hash table, returns @'Just' val@ if the key +-- was found, or 'Nothing' otherwise. +lookup :: Hash key => key -> IO (Maybe val) +lookup = undefined + +-- | A class of types which can be hashed. +class Hash a where + -- | hashes the value of type @a@ into an 'Int' + hash :: a -> Int + +instance Hash Int where + hash = id + +instance Hash Float where + hash = trunc + +instance (Hash a, Hash b) => Hash (a,b) where + hash (a,b) = hash a `xor` hash b + +trunc = undefined +xor = undefined diff --git a/html-test/src/Hidden.hs b/html-test/src/Hidden.hs new file mode 100644 index 00000000..896da648 --- /dev/null +++ b/html-test/src/Hidden.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Hidden where + +hidden :: Int -> Int +hidden a = a diff --git a/html-test/src/HiddenInstances.hs b/html-test/src/HiddenInstances.hs new file mode 100644 index 00000000..99a6c2fd --- /dev/null +++ b/html-test/src/HiddenInstances.hs @@ -0,0 +1,35 @@ +-- http://trac.haskell.org/haddock/ticket/37 +module HiddenInstances (VisibleClass, VisibleData) where + +-- | Should be visible +class VisibleClass a + +-- | Should *not* be visible +class HiddenClass a + +-- | Should *not* be visible +data HiddenData = HiddenData + +-- | Should be visible +data VisibleData = VisibleData + +-- | Should be visible +instance VisibleClass Int + +-- | Should be visible +instance VisibleClass VisibleData + +-- | Should be visible +instance Num VisibleData + +-- | Should *not* be visible +instance VisibleClass HiddenData + +-- | Should *not* be visible +instance HiddenClass Int + +-- | Should *not* be visible +instance HiddenClass VisibleData + +-- | Should *not* be visible +instance HiddenClass HiddenData diff --git a/html-test/src/HiddenInstancesA.hs b/html-test/src/HiddenInstancesA.hs new file mode 100644 index 00000000..f1775208 --- /dev/null +++ b/html-test/src/HiddenInstancesA.hs @@ -0,0 +1,17 @@ +{-# OPTIONS_HADDOCK hide #-} +module HiddenInstancesA where + +-- | Should be visible +class Foo a + +-- | Should be visible +data Bar + +-- | Should be visible +instance Foo Bar + +-- | Should *not* be visible +data Baz + +-- | Should *not* be visible +instance Foo Baz diff --git a/html-test/src/HiddenInstancesB.hs b/html-test/src/HiddenInstancesB.hs new file mode 100644 index 00000000..eabf0637 --- /dev/null +++ b/html-test/src/HiddenInstancesB.hs @@ -0,0 +1,2 @@ +module HiddenInstancesB (Foo, Bar) where +import HiddenInstancesA diff --git a/html-test/src/Hyperlinks.hs b/html-test/src/Hyperlinks.hs new file mode 100644 index 00000000..34e64448 --- /dev/null +++ b/html-test/src/Hyperlinks.hs @@ -0,0 +1,8 @@ +module Hyperlinks where + +-- | +-- A plain URL: +-- +-- A URL with a label: +foo :: Int +foo = 23 diff --git a/html-test/src/IgnoreExports.hs b/html-test/src/IgnoreExports.hs new file mode 100644 index 00000000..0321ad02 --- /dev/null +++ b/html-test/src/IgnoreExports.hs @@ -0,0 +1,10 @@ +{-# OPTIONS_HADDOCK ignore-exports #-} +module IgnoreExports (foo) where + +-- | documentation for foo +foo :: Int +foo = 23 + +-- | documentation for bar +bar :: Int +bar = 23 diff --git a/html-test/src/ModuleWithWarning.hs b/html-test/src/ModuleWithWarning.hs new file mode 100644 index 00000000..e64d9d7e --- /dev/null +++ b/html-test/src/ModuleWithWarning.hs @@ -0,0 +1,5 @@ +-- | Documentation for "ModuleWithWarning". +module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/src/NamedDoc.hs b/html-test/src/NamedDoc.hs new file mode 100644 index 00000000..7c04ba72 --- /dev/null +++ b/html-test/src/NamedDoc.hs @@ -0,0 +1,4 @@ +module NamedDoc where + +-- $foo bar + diff --git a/html-test/src/NoLayout.hs b/html-test/src/NoLayout.hs new file mode 100644 index 00000000..19b38b1d --- /dev/null +++ b/html-test/src/NoLayout.hs @@ -0,0 +1,12 @@ + +-- Haddock comments are parsed as separate declarations so we +-- need to insert a ';' when using them with explicit layout. +-- This should probably be changed. + +module NoLayout where { + -- | the function 'g' + ; + g :: Int; + g = undefined + } + diff --git a/html-test/src/NonGreedy.hs b/html-test/src/NonGreedy.hs new file mode 100644 index 00000000..f51b55f5 --- /dev/null +++ b/html-test/src/NonGreedy.hs @@ -0,0 +1,5 @@ +module NonGreedy where + +-- | +f :: a +f = undefined diff --git a/html-test/src/Properties.hs b/html-test/src/Properties.hs new file mode 100644 index 00000000..05930ece --- /dev/null +++ b/html-test/src/Properties.hs @@ -0,0 +1,9 @@ +module Properties where + +-- | Fibonacci number of given 'Integer'. +-- +-- prop> fib n <= fib (n + 1) +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/src/PruneWithWarning.hs b/html-test/src/PruneWithWarning.hs new file mode 100644 index 00000000..bfa55ea2 --- /dev/null +++ b/html-test/src/PruneWithWarning.hs @@ -0,0 +1,15 @@ +{-# OPTIONS_HADDOCK prune #-} +-- | +-- What is tested here: +-- +-- * If a binding has a deprecation message but no documentation, it is pruned +-- when @OPTIONS_HADDOCK prune@ is used. +-- +module PruneWithWarning (foo, bar) where + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} + +bar :: Int +bar = 42 diff --git a/html-test/src/QuasiExpr.hs b/html-test/src/QuasiExpr.hs new file mode 100644 index 00000000..970759ba --- /dev/null +++ b/html-test/src/QuasiExpr.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE TemplateHaskell #-} + +-- Used by QuasiQuote. Example taken from the GHC documentation. +module QuasiExpr where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote + +data Expr = IntExpr Integer + | AntiIntExpr String + | BinopExpr BinOp Expr Expr + | AntiExpr String + deriving Show + +data BinOp = AddOp + | SubOp + | MulOp + | DivOp + deriving Show + +eval :: Expr -> Integer +eval (IntExpr n) = n +eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) + where + opToFun AddOp = (+) + opToFun SubOp = (-) + opToFun MulOp = (*) + opToFun DivOp = div + +expr = QuasiQuoter parseExprExp undefined undefined undefined + +-- cheating... +parseExprExp :: String -> Q Exp +parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/html-test/src/QuasiQuote.hs b/html-test/src/QuasiQuote.hs new file mode 100644 index 00000000..06762cf9 --- /dev/null +++ b/html-test/src/QuasiQuote.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} + +-- example taken from the GHC documentation +module QuasiQuote where + +import QuasiExpr + +val :: Integer +val = eval [expr|1 + 2|] diff --git a/html-test/src/SpuriousSuperclassConstraints.hs b/html-test/src/SpuriousSuperclassConstraints.hs new file mode 100644 index 00000000..d9e43e1c --- /dev/null +++ b/html-test/src/SpuriousSuperclassConstraints.hs @@ -0,0 +1,30 @@ +{-# LANGUAGE EmptyDataDecls, KindSignatures #-} +-- | +-- What is tested here: +-- +-- Due to a change in GHC 7.6.1 we had a bug that superclass contraints were +-- included in the instances list. Edward K. repported it here: +-- +-- +-- +-- And here is the corresponding theard on glasgow-haskell-users: +-- +-- +-- +-- It has been fixed in: +-- +-- > 6ccf78e15a525282fef61bc4f58a279aa9c21771 +-- > Fix spurious superclass constraints bug. +-- +module SpuriousSuperclassConstraints where + +import Control.Applicative + +data SomeType (f :: * -> *) a + +instance Functor (SomeType f) where + fmap = undefined + +instance Applicative f => Applicative (SomeType f) where + pure = undefined + (<*>) = undefined diff --git a/html-test/src/TH.hs b/html-test/src/TH.hs new file mode 100644 index 00000000..f8178bcb --- /dev/null +++ b/html-test/src/TH.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH where + +import Language.Haskell.TH + +decl :: Q [Dec] +decl = [d| f x = x|] diff --git a/html-test/src/TH2.hs b/html-test/src/TH2.hs new file mode 100644 index 00000000..ea85e547 --- /dev/null +++ b/html-test/src/TH2.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH2 where + +import TH + +$( decl ) diff --git a/html-test/src/Test.hs b/html-test/src/Test.hs new file mode 100644 index 00000000..d352f029 --- /dev/null +++ b/html-test/src/Test.hs @@ -0,0 +1,422 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Test +-- Copyright : (c) Simon Marlow 2002 +-- License : BSD-style +-- +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- This module illustrates & tests most of the features of Haddock. +-- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. +-- +----------------------------------------------------------------------------- + +-- This is plain comment, ignored by Haddock. + +module Test ( + + -- Section headings are introduced with '-- *': + -- * Type declarations + + -- Subsection headings are introduced with '-- **' and so on. + -- ** Data types + T(..), T2, T3(..), T4(..), T5(..), T6(..), + N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), + + -- ** Records + R(..), R1(..), + + -- | test that we can export record selectors on their own: + p, q, u, + + -- * Class declarations + C(a,b), D(..), E, F(..), + + -- | Test that we can export a class method on its own: + a, + + -- * Function types + f, g, + + -- * Auxiliary stuff + + -- $aux1 + + -- $aux2 + + -- $aux3 + + -- $aux4 + + -- $aux5 + + -- $aux6 + + -- $aux7 + + -- $aux8 + + -- $aux9 + + -- $aux10 + + -- $aux11 + + -- $aux12 + + -- | This is some inline documentation in the export list + -- + -- > a code block using bird-tracks + -- > each line must begin with > (which isn't significant unless it + -- > is at the beginning of the line). + + -- * A hidden module + module Hidden, + + -- * A visible module + module Visible, + + {-| nested-style doc comments -} + + -- * Existential \/ Universal types + Ex(..), + + -- * Type signatures with argument docs + k, l, m, o, + + -- * A section + -- and without an intervening comma: + -- ** A subsection + +{-| + > a literal line + + $ a non /literal/ line $ +-} + + f', + + withType, withoutType + ) where + +import Hidden +import Visible +import Data.Maybe + +bla = Nothing + +-- | This comment applies to the /following/ declaration +-- and it continues until the next non-comment line +data T a b + = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor + | -- | This comment describes the 'B' constructor + B (T a b, T Int Float) -- ^ + +-- | An abstract data declaration +data T2 a b = T2 a b + +-- | A data declaration with no documentation annotations on the constructors +data T3 a b = A1 a | B1 b + +-- A data declaration with no documentation annotations at all +data T4 a b = A2 a | B2 b + +-- A data declaration documentation on the constructors only +data T5 a b + = A3 a -- ^ documents 'A3' + | B3 b -- ^ documents 'B3' + +-- | Testing alternative comment styles +data T6 + -- | This is the doc for 'A4' + = A4 + | B4 + | -- ^ This is the doc for 'B4' + + -- | This is the doc for 'C4' + C4 + +-- | A newtype +newtype N1 a = N1 a + +-- | A newtype with a fieldname +newtype N2 a b = N2 {n :: a b} + +-- | A newtype with a fieldname, documentation on the field +newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field + } + +-- | An abstract newtype - we show this one as data rather than newtype because +-- the difference isn\'t visible to the programmer for an abstract type. +newtype N4 a b = N4 a + +newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor + } + +newtype N6 a b = N6 {n6 :: a b + } + -- ^ docs on the constructor only + +-- | docs on the newtype and the constructor +newtype N7 a b = N7 {n7 :: a b + } + -- ^ The 'N7' constructor + + +class (D a) => C a where + -- |this is a description of the 'a' method + a :: IO a + b :: [a] + -- ^ this is a description of the 'b' method + c :: a -- c is hidden in the export list + +-- ^ This comment applies to the /previous/ declaration (the 'C' class) + +class D a where + d :: T a b + e :: (a,a) +-- ^ This is a class declaration with no separate docs for the methods + +instance D Int where + d = undefined + e = undefined + +-- instance with a qualified class name +instance Test.D Float where + d = undefined + e = undefined + +class E a where + ee :: a +-- ^ This is a class declaration with no methods (or no methods exported) + +-- This is a class declaration with no documentation at all +class F a where + ff :: a + +-- | This is the documentation for the 'R' record, which has four fields, +-- 'p', 'q', 'r', and 's'. +data R = + -- | This is the 'C1' record constructor, with the following fields: + C1 { p :: Int -- ^ This comment applies to the 'p' field + , q :: forall a . a->a -- ^ This comment applies to the 'q' field + , -- | This comment applies to both 'r' and 's' + r,s :: Int + } + | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), + u,v :: Int + } + -- ^ This is the 'C2' record constructor, also with some fields: + +-- | Testing different record commenting styles +data R1 + -- | This is the 'C3' record constructor + = C3 { + -- | The 's1' record selector + s1 :: Int + -- | The 's2' record selector + , s2 :: Int + , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. + -- Since GHC doesn't allow that, I have removed it in this file. + -- ^ The 's3' record selector + } + +-- These section headers are only used when there is no export list to +-- give the structure of the documentation: + +-- * This is a section header (level 1) +-- ** This is a section header (level 2) +-- *** This is a section header (level 3) + +{-| +In a comment string we can refer to identifiers in scope with +single quotes like this: 'T', and we can refer to modules by +using double quotes: "Foo". We can add emphasis /like this/. + + * This is a bulleted list + + - This is the next item (different kind of bullet) + + (1) This is an ordered list + + 2. This is the next item (different kind of bullet) + + [cat] a small, furry, domesticated mammal + + [pineapple] a fruit grown in the tropics + +@ + This is a block of code, which can include other markup: 'R' + formatting + is + significant +@ + +> this is another block of code + +We can also include URLs in documentation: . +-} + +f :: C a => a -> Int + +-- | we can export foreign declarations too +foreign import ccall g :: Int -> IO CInt + +-- | this doc string has a parse error in it: \' +h :: Int +h = 42 + + +-- $aux1 This is some documentation that is attached to a name ($aux1) +-- rather than a source declaration. The documentation may be +-- referred to in the export list using its name. +-- +-- @ code block in named doc @ + +-- $aux2 This is some documentation that is attached to a name ($aux2) + +-- $aux3 +-- @ code block on its own in named doc @ + +-- $aux4 +-- +-- @ code block on its own in named doc (after newline) @ + +{- $aux5 a nested, named doc comment + + with a paragraph, + + @ and a code block @ +-} + +-- some tests for various arrangements of code blocks: + +{- $aux6 +>test +>test1 + +@ test2 + test3 +@ +-} + +{- $aux7 +@ +test1 +test2 +@ +-} + +{- $aux8 +>test3 +>test4 +-} + +{- $aux9 +@ +test1 +test2 +@ + +>test3 +>test4 +-} + +{- $aux10 +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- This one is currently wrong (Haddock 0.4). The @...@ part is +-- interpreted as part of the bird-tracked code block. +{- $aux11 +aux11: + +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- $aux12 +-- > foo +-- +-- > bar +-- + +-- | A data-type using existential\/universal types +data Ex a + = forall b . C b => Ex1 b + | forall b . Ex2 b + | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file + | Ex4 (forall a . a -> a) + +-- | This is a function with documentation for each argument +k :: T () () -- ^ This argument has type 'T' + -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' + -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ + -> T5 () () -- ^ This argument has a very long description that should + -- hopefully cause some wrapping to happen when it is finally + -- rendered by Haddock in the generated HTML page. + -> IO () -- ^ This is the result type + +-- This function has arg docs but no docs for the function itself +l :: (Int, Int, Float) -- ^ takes a triple + -> Int -- ^ returns an 'Int' + +-- | This function has some arg docs +m :: R + -> N1 () -- ^ one of the arguments + -> IO Int -- ^ and the return value + +-- | This function has some arg docs but not a return value doc + +-- can't use the original name ('n') with GHC +newn :: R -- ^ one of the arguments, an 'R' + -> N1 () -- ^ one of the arguments + -> IO Int +newn = undefined + + +-- | A foreign import with argument docs +foreign import ccall unsafe + o :: Float -- ^ The input float + -> IO Float -- ^ The output float + +-- | We should be able to escape this: \#\#\# + +-- p :: Int +-- can't use the above original definition with GHC +newp :: Int +newp = undefined + +-- | a function with a prime can be referred to as 'f'' +-- but f' doesn't get link'd 'f\'' +f' :: Int + +-- | Comment on a definition without type signature +withoutType = undefined + +-- | Comment on a definition with type signature +withType :: Int +withType = 1 + +-- Add some definitions here so that this file can be compiled with GHC + +data T1 +f = undefined +f' = undefined +type CInt = Int +k = undefined +l = undefined +m = undefined diff --git a/html-test/src/Ticket112.hs b/html-test/src/Ticket112.hs new file mode 100644 index 00000000..c9cd5117 --- /dev/null +++ b/html-test/src/Ticket112.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE MagicHash #-} + +module Ticket112 where + +import GHC.Prim + +-- | ...given a raw 'Addr#' to the string, and the length of the string. +f :: a +f = undefined diff --git a/html-test/src/Ticket61.hs b/html-test/src/Ticket61.hs new file mode 100644 index 00000000..26ca287f --- /dev/null +++ b/html-test/src/Ticket61.hs @@ -0,0 +1,3 @@ +module Ticket61 (module Ticket61_Hidden) where + +import Ticket61_Hidden diff --git a/html-test/src/Ticket61_Hidden.hs b/html-test/src/Ticket61_Hidden.hs new file mode 100644 index 00000000..583c10cd --- /dev/null +++ b/html-test/src/Ticket61_Hidden.hs @@ -0,0 +1,7 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Ticket61_Hidden where + +class C a where + -- | A comment about f + f :: a diff --git a/html-test/src/Ticket75.hs b/html-test/src/Ticket75.hs new file mode 100644 index 00000000..94a2f115 --- /dev/null +++ b/html-test/src/Ticket75.hs @@ -0,0 +1,7 @@ +module Ticket75 where + +data a :- b = Q + +-- | A reference to ':-' +f :: Int +f = undefined diff --git a/html-test/src/TypeFamilies.hs b/html-test/src/TypeFamilies.hs new file mode 100644 index 00000000..561f95fd --- /dev/null +++ b/html-test/src/TypeFamilies.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TypeFamilies #-} + +module TypeFamilies where + +-- | Type family G +type family G a :: * + +-- | A class with an associated type +class A a where + -- | An associated type + data B a :: * -> * + -- | A method + f :: B a Int + +-- | Doc for family +type family F a + + +-- | Doc for G Int +type instance G Int = Bool +type instance G Float = Int + + +instance A Int where + data B Int x = Con x + f = Con 3 + +g = Con 5 diff --git a/html-test/src/TypeOperators.hs b/html-test/src/TypeOperators.hs new file mode 100644 index 00000000..edbb9344 --- /dev/null +++ b/html-test/src/TypeOperators.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TypeOperators #-} +module TypeOperators ( + -- * stuff + (:-:), + (:+:), + Op, + O(..), + biO, +) where + +data a :-: b + +data (a :+: b) c + +data a `Op` b + +newtype (g `O` f) a = O { unO :: g (f a) } + +biO :: (g `O` f) a +biO = undefined diff --git a/html-test/src/Unicode.hs.disabled b/html-test/src/Unicode.hs.disabled new file mode 100644 index 00000000..d5bbf445 --- /dev/null +++ b/html-test/src/Unicode.hs.disabled @@ -0,0 +1,6 @@ +module Unicode where + +-- | γλώσσα +x :: Int +x = 1 + diff --git a/html-test/src/Visible.hs b/html-test/src/Visible.hs new file mode 100644 index 00000000..cad71931 --- /dev/null +++ b/html-test/src/Visible.hs @@ -0,0 +1,3 @@ +module Visible where +visible :: Int -> Int +visible a = a diff --git a/html-test/tests/A.hs b/html-test/tests/A.hs deleted file mode 100644 index 606b0865..00000000 --- a/html-test/tests/A.hs +++ /dev/null @@ -1,17 +0,0 @@ -module A where - -data A = A - -other :: Int -other = 2 - --- | Doc for test2 -test2 :: Bool -test2 = False - --- | Should show up on the page for both modules A and B -data X = X -- ^ Doc for consructor - --- | Should show up on the page for both modules A and B -reExport :: Int -reExport = 1 diff --git a/html-test/tests/AdvanceTypes.hs b/html-test/tests/AdvanceTypes.hs deleted file mode 100644 index 939fdf07..00000000 --- a/html-test/tests/AdvanceTypes.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE TypeOperators #-} -module AdvanceTypes where - -data Pattern :: [*] -> * where - Nil :: Pattern '[] - Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/html-test/tests/B.hs b/html-test/tests/B.hs deleted file mode 100644 index 5fd69acd..00000000 --- a/html-test/tests/B.hs +++ /dev/null @@ -1,8 +0,0 @@ -module B ( module A, test, reExport, X(..) ) where -import A ( A(..), test2, reExport, X(..) ) - --- | This link shouldn't work: 'other'. --- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. --- Module link: "Prelude". -test :: Int -test = 1 diff --git a/html-test/tests/Bug1.hs b/html-test/tests/Bug1.hs deleted file mode 100644 index af1ed4d3..00000000 --- a/html-test/tests/Bug1.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug1 where - --- | We should have different anchors for constructors and types\/classes. This --- hyperlink should point to the type constructor by default: 'T'. -data T = T - diff --git a/html-test/tests/Bug2.hs b/html-test/tests/Bug2.hs deleted file mode 100644 index 9121922e..00000000 --- a/html-test/tests/Bug2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Bug2 ( x ) where -import B -x :: A -x = A diff --git a/html-test/tests/Bug3.hs b/html-test/tests/Bug3.hs deleted file mode 100644 index 67e57892..00000000 --- a/html-test/tests/Bug3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug3 where - --- | /multi-line --- emphasis/ -foo :: Int -foo = undefined diff --git a/html-test/tests/Bug4.hs b/html-test/tests/Bug4.hs deleted file mode 100644 index 425a77aa..00000000 --- a/html-test/tests/Bug4.hs +++ /dev/null @@ -1,5 +0,0 @@ -module Bug4 where --- | don't use apostrophe's in the wrong place's -foo :: Int -foo = undefined - diff --git a/html-test/tests/Bug6.hs b/html-test/tests/Bug6.hs deleted file mode 100644 index 17411f31..00000000 --- a/html-test/tests/Bug6.hs +++ /dev/null @@ -1,23 +0,0 @@ --- | Exporting records. -module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where - --- | --- This record is exported without its field -data A = A { a :: Int } - --- | --- .. with its field, but the field is named separately in the export list --- (the field isn't documented separately since it is already documented here) -data B = B { b :: Int } - --- | --- .. with fields names as subordinate names in the export -data C = C { c1 :: Int, c2 :: Int } - --- | --- .. with only some of the fields exported (we can't handle this one - --- how do we render the declaration?) -data D = D { d1 :: Int, d2 :: Int } - --- | a newtype with a field -newtype E = E { e :: Int } diff --git a/html-test/tests/Bug7.hs b/html-test/tests/Bug7.hs deleted file mode 100644 index 8cf57914..00000000 --- a/html-test/tests/Bug7.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | This module caused a duplicate instance in the documentation for the Foo --- type. -module Bug7 where - --- | The Foo datatype -data Foo = Foo - --- | The Bar class -class Bar x y - --- | Just one instance -instance Bar Foo Foo diff --git a/html-test/tests/Bug8.hs b/html-test/tests/Bug8.hs deleted file mode 100644 index 18df63c8..00000000 --- a/html-test/tests/Bug8.hs +++ /dev/null @@ -1,14 +0,0 @@ -module Bug8 where - -infix --> -infix ---> - -data Typ = Type (String,[Typ]) - | TFree (String, [String]) - -x --> y = Type("fun",[s,t]) -(--->) = flip $ foldr (-->) - -s = undefined -t = undefined -main = undefined diff --git a/html-test/tests/BugDeprecated.hs b/html-test/tests/BugDeprecated.hs deleted file mode 100644 index 0f7ac2eb..00000000 --- a/html-test/tests/BugDeprecated.hs +++ /dev/null @@ -1,18 +0,0 @@ -module BugDeprecated where - -foo, bar, baz :: Int -foo = 23 -bar = 23 -baz = 23 -{-# DEPRECATED foo "for foo" #-} -{-# DEPRECATED bar "for bar" #-} -{-# DEPRECATED baz "for baz" #-} - --- | some documentation for one, two and three -one, two, three :: Int -one = 23 -two = 23 -three = 23 -{-# DEPRECATED one "for one" #-} -{-# DEPRECATED two "for two" #-} -{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/BugExportHeadings.hs b/html-test/tests/BugExportHeadings.hs deleted file mode 100644 index a5493a08..00000000 --- a/html-test/tests/BugExportHeadings.hs +++ /dev/null @@ -1,29 +0,0 @@ --- test for #192 -module BugExportHeadings ( --- * Foo - foo --- * Bar -, bar --- * Baz -, baz - --- * One -, one --- * Two -, two --- * Three -, three -) where - -foo, bar, baz :: Int -foo = 23 -bar = 23 -baz = 23 - -one, two, three :: Int -one = 23 -two = 23 -three = 23 -{-# DEPRECATED one "for one" #-} -{-# DEPRECATED two "for two" #-} -{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/Bugs.hs b/html-test/tests/Bugs.hs deleted file mode 100644 index 8e1f0079..00000000 --- a/html-test/tests/Bugs.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Bugs where - -data A a = A a (a -> Int) diff --git a/html-test/tests/CrossPackageDocs.hs b/html-test/tests/CrossPackageDocs.hs deleted file mode 100644 index 4d529f79..00000000 --- a/html-test/tests/CrossPackageDocs.hs +++ /dev/null @@ -1,4 +0,0 @@ -module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where - -import System.Process -import Data.String diff --git a/html-test/tests/DeprecatedClass.hs b/html-test/tests/DeprecatedClass.hs deleted file mode 100644 index 018904ab..00000000 --- a/html-test/tests/DeprecatedClass.hs +++ /dev/null @@ -1,15 +0,0 @@ -module DeprecatedClass where - --- | some class -class SomeClass a where - -- | documentation for foo - foo :: a -> a - -{-# DEPRECATED SomeClass "SomeClass" #-} -{-# DEPRECATED foo "foo" #-} - -class SomeOtherClass a where - bar :: a -> a - -{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} -{-# DEPRECATED bar "bar" #-} diff --git a/html-test/tests/DeprecatedData.hs b/html-test/tests/DeprecatedData.hs deleted file mode 100644 index c40ba122..00000000 --- a/html-test/tests/DeprecatedData.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} -module DeprecatedData where - --- | type Foo -data Foo = Foo -- ^ constructor Foo - | Bar -- ^ constructor Bar - -{-# DEPRECATED Foo "Foo" #-} -{-# DEPRECATED Bar "Bar" #-} - -data One = One - | Two - -{-# DEPRECATED One "One" #-} -{-# DEPRECATED Two "Two" #-} diff --git a/html-test/tests/DeprecatedFunction.hs b/html-test/tests/DeprecatedFunction.hs deleted file mode 100644 index 8d626435..00000000 --- a/html-test/tests/DeprecatedFunction.hs +++ /dev/null @@ -1,10 +0,0 @@ -module DeprecatedFunction where - --- | some documentation for foo -foo :: Int -foo = 23 -{-# DEPRECATED foo "use `bar` instead" #-} - --- | some documentation for bar -bar :: Int -bar = 42 diff --git a/html-test/tests/DeprecatedFunction2.hs b/html-test/tests/DeprecatedFunction2.hs deleted file mode 100644 index bdbbf95c..00000000 --- a/html-test/tests/DeprecatedFunction2.hs +++ /dev/null @@ -1,6 +0,0 @@ -module DeprecatedFunction2 where - - -foo :: Int -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedFunction3.hs b/html-test/tests/DeprecatedFunction3.hs deleted file mode 100644 index ca719bda..00000000 --- a/html-test/tests/DeprecatedFunction3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module DeprecatedFunction3 where - - - -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedModule.hs b/html-test/tests/DeprecatedModule.hs deleted file mode 100644 index 369dba4f..00000000 --- a/html-test/tests/DeprecatedModule.hs +++ /dev/null @@ -1,5 +0,0 @@ --- | Documentation for "DeprecatedModule". -module DeprecatedModule {-# DEPRECATED "Use \"Foo\" instead" #-} where - -foo :: Int -foo = 23 diff --git a/html-test/tests/DeprecatedModule2.hs b/html-test/tests/DeprecatedModule2.hs deleted file mode 100644 index 94185297..00000000 --- a/html-test/tests/DeprecatedModule2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where - -foo :: Int -foo = 23 diff --git a/html-test/tests/DeprecatedNewtype.hs b/html-test/tests/DeprecatedNewtype.hs deleted file mode 100644 index 254f1f55..00000000 --- a/html-test/tests/DeprecatedNewtype.hs +++ /dev/null @@ -1,10 +0,0 @@ -module DeprecatedNewtype where - --- | some documentation -newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} -{-# DEPRECATED SomeNewType "SomeNewType" #-} -{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} - -newtype SomeOtherNewType = SomeOtherNewTypeConst String -{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} -{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} diff --git a/html-test/tests/DeprecatedReExport.hs b/html-test/tests/DeprecatedReExport.hs deleted file mode 100644 index f851e2ff..00000000 --- a/html-test/tests/DeprecatedReExport.hs +++ /dev/null @@ -1,16 +0,0 @@ --- | --- What is tested here: --- --- * Deprecation messages are shown for re-exported items. --- -module DeprecatedReExport ( --- * Re-exported from an other module - foo --- * Re-exported from an other package --- | Not yet working, see --- , isEmptyChan -, -) where - -import DeprecatedFunction -import Control.Concurrent.Chan diff --git a/html-test/tests/DeprecatedRecord.hs b/html-test/tests/DeprecatedRecord.hs deleted file mode 100644 index d44499e7..00000000 --- a/html-test/tests/DeprecatedRecord.hs +++ /dev/null @@ -1,9 +0,0 @@ -module DeprecatedRecord where - --- | type Foo -data Foo = Foo { - fooName :: String -- ^ some name -, fooValue :: Int -- ^ some value -} - -{-# DEPRECATED fooValue "do not use this" #-} diff --git a/html-test/tests/DeprecatedTypeFamily.hs b/html-test/tests/DeprecatedTypeFamily.hs deleted file mode 100644 index 70473bb8..00000000 --- a/html-test/tests/DeprecatedTypeFamily.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} -module DeprecatedTypeFamily where - --- | some documentation -data family SomeTypeFamily k :: * -> * -{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} - -data family SomeOtherTypeFamily k :: * -> * -{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/html-test/tests/DeprecatedTypeSynonym.hs b/html-test/tests/DeprecatedTypeSynonym.hs deleted file mode 100644 index 34df47da..00000000 --- a/html-test/tests/DeprecatedTypeSynonym.hs +++ /dev/null @@ -1,9 +0,0 @@ - -module DeprecatedTypeSynonym where - --- | some documentation -type TypeSyn = String -{-# DEPRECATED TypeSyn "TypeSyn" #-} - -type OtherTypeSyn = String -{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} diff --git a/html-test/tests/DeprecationMessageParseError.hs b/html-test/tests/DeprecationMessageParseError.hs deleted file mode 100644 index 2f8fb492..00000000 --- a/html-test/tests/DeprecationMessageParseError.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | --- What is tested here: --- --- * If parsing of a deprecation message fails, the message is included --- verbatim. --- -module DeprecationMessageParseError where - --- | some documentation for foo -foo :: Int -foo = 23 -{-# DEPRECATED foo "use @bar instead" #-} diff --git a/html-test/tests/Examples.hs b/html-test/tests/Examples.hs deleted file mode 100644 index c8c450f1..00000000 --- a/html-test/tests/Examples.hs +++ /dev/null @@ -1,39 +0,0 @@ -module Examples where - --- | Fibonacci number of given 'Integer'. --- --- Examples: --- --- >>> fib 5 --- 5 --- >>> fib 10 --- 55 --- --- >>> fib 10 --- 55 --- --- One more Example: --- --- >>> fib 5 --- 5 --- --- One more Example: --- --- >>> fib 5 --- 5 --- --- Example with an import: --- --- >>> import Data.Char --- >>> isSpace 'a' --- False --- --- >>> putStrLn "foo\n\nbar" --- foo --- --- bar --- -fib :: Integer -> Integer -fib 0 = 0 -fib 1 = 1 -fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/FunArgs.hs b/html-test/tests/FunArgs.hs deleted file mode 100644 index b34d84b7..00000000 --- a/html-test/tests/FunArgs.hs +++ /dev/null @@ -1,16 +0,0 @@ -module FunArgs where - -f :: forall a. Ord a - => Int -- ^ First argument - -> a -- ^ Second argument - -> Bool -- ^ Third argument - -> (a -> a) -- ^ Fourth argument - -> () -- ^ Result -f = undefined - - -g :: a -- ^ First argument - -> b -- ^ Second argument - -> c -- ^ Third argument - -> d -- ^ Result -g = undefined diff --git a/html-test/tests/GADTRecords.hs b/html-test/tests/GADTRecords.hs deleted file mode 100644 index c77810ad..00000000 --- a/html-test/tests/GADTRecords.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE GADTs #-} -module GADTRecords (H1(..)) where - --- | h1 -data H1 a b where - C1 :: H1 a b - C2 :: Ord a => [a] -> H1 a a - C3 { field :: Int -- ^ hello docs - } :: H1 Int Int - C4 { field2 :: a -- ^ hello2 docs - } :: H1 Int a - diff --git a/html-test/tests/Hash.hs b/html-test/tests/Hash.hs deleted file mode 100644 index 343b69e9..00000000 --- a/html-test/tests/Hash.hs +++ /dev/null @@ -1,51 +0,0 @@ -{- | - Implementation of fixed-size hash tables, with a type - class for constructing hash values for structured types. --} -module Hash ( - -- * The @HashTable@ type - HashTable, - - -- ** Operations on @HashTable@s - new, insert, lookup, - - -- * The @Hash@ class - Hash(..), - ) where - -import Data.Array -import Prelude hiding (lookup) - --- | A hash table with keys of type @key@ and values of type @val@. --- The type @key@ should be an instance of 'Eq'. -data HashTable key val = HashTable Int (Array Int [(key,val)]) - --- | Builds a new hash table with a given size -new :: (Eq key, Hash key) => Int -> IO (HashTable key val) -new = undefined - --- | Inserts a new element into the hash table -insert :: (Eq key, Hash key) => key -> val -> IO () -insert = undefined - --- | Looks up a key in the hash table, returns @'Just' val@ if the key --- was found, or 'Nothing' otherwise. -lookup :: Hash key => key -> IO (Maybe val) -lookup = undefined - --- | A class of types which can be hashed. -class Hash a where - -- | hashes the value of type @a@ into an 'Int' - hash :: a -> Int - -instance Hash Int where - hash = id - -instance Hash Float where - hash = trunc - -instance (Hash a, Hash b) => Hash (a,b) where - hash (a,b) = hash a `xor` hash b - -trunc = undefined -xor = undefined diff --git a/html-test/tests/Hidden.hs b/html-test/tests/Hidden.hs deleted file mode 100644 index 896da648..00000000 --- a/html-test/tests/Hidden.hs +++ /dev/null @@ -1,6 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Hidden where - -hidden :: Int -> Int -hidden a = a diff --git a/html-test/tests/HiddenInstances.hs b/html-test/tests/HiddenInstances.hs deleted file mode 100644 index 99a6c2fd..00000000 --- a/html-test/tests/HiddenInstances.hs +++ /dev/null @@ -1,35 +0,0 @@ --- http://trac.haskell.org/haddock/ticket/37 -module HiddenInstances (VisibleClass, VisibleData) where - --- | Should be visible -class VisibleClass a - --- | Should *not* be visible -class HiddenClass a - --- | Should *not* be visible -data HiddenData = HiddenData - --- | Should be visible -data VisibleData = VisibleData - --- | Should be visible -instance VisibleClass Int - --- | Should be visible -instance VisibleClass VisibleData - --- | Should be visible -instance Num VisibleData - --- | Should *not* be visible -instance VisibleClass HiddenData - --- | Should *not* be visible -instance HiddenClass Int - --- | Should *not* be visible -instance HiddenClass VisibleData - --- | Should *not* be visible -instance HiddenClass HiddenData diff --git a/html-test/tests/HiddenInstancesA.hs b/html-test/tests/HiddenInstancesA.hs deleted file mode 100644 index f1775208..00000000 --- a/html-test/tests/HiddenInstancesA.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} -module HiddenInstancesA where - --- | Should be visible -class Foo a - --- | Should be visible -data Bar - --- | Should be visible -instance Foo Bar - --- | Should *not* be visible -data Baz - --- | Should *not* be visible -instance Foo Baz diff --git a/html-test/tests/HiddenInstancesB.hs b/html-test/tests/HiddenInstancesB.hs deleted file mode 100644 index eabf0637..00000000 --- a/html-test/tests/HiddenInstancesB.hs +++ /dev/null @@ -1,2 +0,0 @@ -module HiddenInstancesB (Foo, Bar) where -import HiddenInstancesA diff --git a/html-test/tests/Hyperlinks.hs b/html-test/tests/Hyperlinks.hs deleted file mode 100644 index 34e64448..00000000 --- a/html-test/tests/Hyperlinks.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Hyperlinks where - --- | --- A plain URL: --- --- A URL with a label: -foo :: Int -foo = 23 diff --git a/html-test/tests/IgnoreExports.hs b/html-test/tests/IgnoreExports.hs deleted file mode 100644 index 0321ad02..00000000 --- a/html-test/tests/IgnoreExports.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# OPTIONS_HADDOCK ignore-exports #-} -module IgnoreExports (foo) where - --- | documentation for foo -foo :: Int -foo = 23 - --- | documentation for bar -bar :: Int -bar = 23 diff --git a/html-test/tests/ModuleWithWarning.hs b/html-test/tests/ModuleWithWarning.hs deleted file mode 100644 index e64d9d7e..00000000 --- a/html-test/tests/ModuleWithWarning.hs +++ /dev/null @@ -1,5 +0,0 @@ --- | Documentation for "ModuleWithWarning". -module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where - -foo :: Int -foo = 23 diff --git a/html-test/tests/NamedDoc.hs b/html-test/tests/NamedDoc.hs deleted file mode 100644 index 7c04ba72..00000000 --- a/html-test/tests/NamedDoc.hs +++ /dev/null @@ -1,4 +0,0 @@ -module NamedDoc where - --- $foo bar - diff --git a/html-test/tests/NoLayout.hs b/html-test/tests/NoLayout.hs deleted file mode 100644 index 19b38b1d..00000000 --- a/html-test/tests/NoLayout.hs +++ /dev/null @@ -1,12 +0,0 @@ - --- Haddock comments are parsed as separate declarations so we --- need to insert a ';' when using them with explicit layout. --- This should probably be changed. - -module NoLayout where { - -- | the function 'g' - ; - g :: Int; - g = undefined - } - diff --git a/html-test/tests/NonGreedy.hs b/html-test/tests/NonGreedy.hs deleted file mode 100644 index f51b55f5..00000000 --- a/html-test/tests/NonGreedy.hs +++ /dev/null @@ -1,5 +0,0 @@ -module NonGreedy where - --- | -f :: a -f = undefined diff --git a/html-test/tests/Properties.hs b/html-test/tests/Properties.hs deleted file mode 100644 index 05930ece..00000000 --- a/html-test/tests/Properties.hs +++ /dev/null @@ -1,9 +0,0 @@ -module Properties where - --- | Fibonacci number of given 'Integer'. --- --- prop> fib n <= fib (n + 1) -fib :: Integer -> Integer -fib 0 = 0 -fib 1 = 1 -fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/PruneWithWarning.hs b/html-test/tests/PruneWithWarning.hs deleted file mode 100644 index bfa55ea2..00000000 --- a/html-test/tests/PruneWithWarning.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# OPTIONS_HADDOCK prune #-} --- | --- What is tested here: --- --- * If a binding has a deprecation message but no documentation, it is pruned --- when @OPTIONS_HADDOCK prune@ is used. --- -module PruneWithWarning (foo, bar) where - -foo :: Int -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} - -bar :: Int -bar = 42 diff --git a/html-test/tests/QuasiExpr.hs b/html-test/tests/QuasiExpr.hs deleted file mode 100644 index 970759ba..00000000 --- a/html-test/tests/QuasiExpr.hs +++ /dev/null @@ -1,34 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - --- Used by QuasiQuote. Example taken from the GHC documentation. -module QuasiExpr where - -import Language.Haskell.TH -import Language.Haskell.TH.Quote - -data Expr = IntExpr Integer - | AntiIntExpr String - | BinopExpr BinOp Expr Expr - | AntiExpr String - deriving Show - -data BinOp = AddOp - | SubOp - | MulOp - | DivOp - deriving Show - -eval :: Expr -> Integer -eval (IntExpr n) = n -eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) - where - opToFun AddOp = (+) - opToFun SubOp = (-) - opToFun MulOp = (*) - opToFun DivOp = div - -expr = QuasiQuoter parseExprExp undefined undefined undefined - --- cheating... -parseExprExp :: String -> Q Exp -parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/html-test/tests/QuasiQuote.hs b/html-test/tests/QuasiQuote.hs deleted file mode 100644 index 06762cf9..00000000 --- a/html-test/tests/QuasiQuote.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} - --- example taken from the GHC documentation -module QuasiQuote where - -import QuasiExpr - -val :: Integer -val = eval [expr|1 + 2|] diff --git a/html-test/tests/SpuriousSuperclassConstraints.hs b/html-test/tests/SpuriousSuperclassConstraints.hs deleted file mode 100644 index d9e43e1c..00000000 --- a/html-test/tests/SpuriousSuperclassConstraints.hs +++ /dev/null @@ -1,30 +0,0 @@ -{-# LANGUAGE EmptyDataDecls, KindSignatures #-} --- | --- What is tested here: --- --- Due to a change in GHC 7.6.1 we had a bug that superclass contraints were --- included in the instances list. Edward K. repported it here: --- --- --- --- And here is the corresponding theard on glasgow-haskell-users: --- --- --- --- It has been fixed in: --- --- > 6ccf78e15a525282fef61bc4f58a279aa9c21771 --- > Fix spurious superclass constraints bug. --- -module SpuriousSuperclassConstraints where - -import Control.Applicative - -data SomeType (f :: * -> *) a - -instance Functor (SomeType f) where - fmap = undefined - -instance Applicative f => Applicative (SomeType f) where - pure = undefined - (<*>) = undefined diff --git a/html-test/tests/TH.hs b/html-test/tests/TH.hs deleted file mode 100644 index f8178bcb..00000000 --- a/html-test/tests/TH.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TH where - -import Language.Haskell.TH - -decl :: Q [Dec] -decl = [d| f x = x|] diff --git a/html-test/tests/TH2.hs b/html-test/tests/TH2.hs deleted file mode 100644 index ea85e547..00000000 --- a/html-test/tests/TH2.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TH2 where - -import TH - -$( decl ) diff --git a/html-test/tests/Test.hs b/html-test/tests/Test.hs deleted file mode 100644 index d352f029..00000000 --- a/html-test/tests/Test.hs +++ /dev/null @@ -1,422 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Test --- Copyright : (c) Simon Marlow 2002 --- License : BSD-style --- --- Maintainer : libraries@haskell.org --- Stability : provisional --- Portability : portable --- --- This module illustrates & tests most of the features of Haddock. --- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. --- ------------------------------------------------------------------------------ - --- This is plain comment, ignored by Haddock. - -module Test ( - - -- Section headings are introduced with '-- *': - -- * Type declarations - - -- Subsection headings are introduced with '-- **' and so on. - -- ** Data types - T(..), T2, T3(..), T4(..), T5(..), T6(..), - N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), - - -- ** Records - R(..), R1(..), - - -- | test that we can export record selectors on their own: - p, q, u, - - -- * Class declarations - C(a,b), D(..), E, F(..), - - -- | Test that we can export a class method on its own: - a, - - -- * Function types - f, g, - - -- * Auxiliary stuff - - -- $aux1 - - -- $aux2 - - -- $aux3 - - -- $aux4 - - -- $aux5 - - -- $aux6 - - -- $aux7 - - -- $aux8 - - -- $aux9 - - -- $aux10 - - -- $aux11 - - -- $aux12 - - -- | This is some inline documentation in the export list - -- - -- > a code block using bird-tracks - -- > each line must begin with > (which isn't significant unless it - -- > is at the beginning of the line). - - -- * A hidden module - module Hidden, - - -- * A visible module - module Visible, - - {-| nested-style doc comments -} - - -- * Existential \/ Universal types - Ex(..), - - -- * Type signatures with argument docs - k, l, m, o, - - -- * A section - -- and without an intervening comma: - -- ** A subsection - -{-| - > a literal line - - $ a non /literal/ line $ --} - - f', - - withType, withoutType - ) where - -import Hidden -import Visible -import Data.Maybe - -bla = Nothing - --- | This comment applies to the /following/ declaration --- and it continues until the next non-comment line -data T a b - = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor - | -- | This comment describes the 'B' constructor - B (T a b, T Int Float) -- ^ - --- | An abstract data declaration -data T2 a b = T2 a b - --- | A data declaration with no documentation annotations on the constructors -data T3 a b = A1 a | B1 b - --- A data declaration with no documentation annotations at all -data T4 a b = A2 a | B2 b - --- A data declaration documentation on the constructors only -data T5 a b - = A3 a -- ^ documents 'A3' - | B3 b -- ^ documents 'B3' - --- | Testing alternative comment styles -data T6 - -- | This is the doc for 'A4' - = A4 - | B4 - | -- ^ This is the doc for 'B4' - - -- | This is the doc for 'C4' - C4 - --- | A newtype -newtype N1 a = N1 a - --- | A newtype with a fieldname -newtype N2 a b = N2 {n :: a b} - --- | A newtype with a fieldname, documentation on the field -newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field - } - --- | An abstract newtype - we show this one as data rather than newtype because --- the difference isn\'t visible to the programmer for an abstract type. -newtype N4 a b = N4 a - -newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor - } - -newtype N6 a b = N6 {n6 :: a b - } - -- ^ docs on the constructor only - --- | docs on the newtype and the constructor -newtype N7 a b = N7 {n7 :: a b - } - -- ^ The 'N7' constructor - - -class (D a) => C a where - -- |this is a description of the 'a' method - a :: IO a - b :: [a] - -- ^ this is a description of the 'b' method - c :: a -- c is hidden in the export list - --- ^ This comment applies to the /previous/ declaration (the 'C' class) - -class D a where - d :: T a b - e :: (a,a) --- ^ This is a class declaration with no separate docs for the methods - -instance D Int where - d = undefined - e = undefined - --- instance with a qualified class name -instance Test.D Float where - d = undefined - e = undefined - -class E a where - ee :: a --- ^ This is a class declaration with no methods (or no methods exported) - --- This is a class declaration with no documentation at all -class F a where - ff :: a - --- | This is the documentation for the 'R' record, which has four fields, --- 'p', 'q', 'r', and 's'. -data R = - -- | This is the 'C1' record constructor, with the following fields: - C1 { p :: Int -- ^ This comment applies to the 'p' field - , q :: forall a . a->a -- ^ This comment applies to the 'q' field - , -- | This comment applies to both 'r' and 's' - r,s :: Int - } - | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), - u,v :: Int - } - -- ^ This is the 'C2' record constructor, also with some fields: - --- | Testing different record commenting styles -data R1 - -- | This is the 'C3' record constructor - = C3 { - -- | The 's1' record selector - s1 :: Int - -- | The 's2' record selector - , s2 :: Int - , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. - -- Since GHC doesn't allow that, I have removed it in this file. - -- ^ The 's3' record selector - } - --- These section headers are only used when there is no export list to --- give the structure of the documentation: - --- * This is a section header (level 1) --- ** This is a section header (level 2) --- *** This is a section header (level 3) - -{-| -In a comment string we can refer to identifiers in scope with -single quotes like this: 'T', and we can refer to modules by -using double quotes: "Foo". We can add emphasis /like this/. - - * This is a bulleted list - - - This is the next item (different kind of bullet) - - (1) This is an ordered list - - 2. This is the next item (different kind of bullet) - - [cat] a small, furry, domesticated mammal - - [pineapple] a fruit grown in the tropics - -@ - This is a block of code, which can include other markup: 'R' - formatting - is - significant -@ - -> this is another block of code - -We can also include URLs in documentation: . --} - -f :: C a => a -> Int - --- | we can export foreign declarations too -foreign import ccall g :: Int -> IO CInt - --- | this doc string has a parse error in it: \' -h :: Int -h = 42 - - --- $aux1 This is some documentation that is attached to a name ($aux1) --- rather than a source declaration. The documentation may be --- referred to in the export list using its name. --- --- @ code block in named doc @ - --- $aux2 This is some documentation that is attached to a name ($aux2) - --- $aux3 --- @ code block on its own in named doc @ - --- $aux4 --- --- @ code block on its own in named doc (after newline) @ - -{- $aux5 a nested, named doc comment - - with a paragraph, - - @ and a code block @ --} - --- some tests for various arrangements of code blocks: - -{- $aux6 ->test ->test1 - -@ test2 - test3 -@ --} - -{- $aux7 -@ -test1 -test2 -@ --} - -{- $aux8 ->test3 ->test4 --} - -{- $aux9 -@ -test1 -test2 -@ - ->test3 ->test4 --} - -{- $aux10 ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- This one is currently wrong (Haddock 0.4). The @...@ part is --- interpreted as part of the bird-tracked code block. -{- $aux11 -aux11: - ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- $aux12 --- > foo --- --- > bar --- - --- | A data-type using existential\/universal types -data Ex a - = forall b . C b => Ex1 b - | forall b . Ex2 b - | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file - | Ex4 (forall a . a -> a) - --- | This is a function with documentation for each argument -k :: T () () -- ^ This argument has type 'T' - -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' - -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ - -> T5 () () -- ^ This argument has a very long description that should - -- hopefully cause some wrapping to happen when it is finally - -- rendered by Haddock in the generated HTML page. - -> IO () -- ^ This is the result type - --- This function has arg docs but no docs for the function itself -l :: (Int, Int, Float) -- ^ takes a triple - -> Int -- ^ returns an 'Int' - --- | This function has some arg docs -m :: R - -> N1 () -- ^ one of the arguments - -> IO Int -- ^ and the return value - --- | This function has some arg docs but not a return value doc - --- can't use the original name ('n') with GHC -newn :: R -- ^ one of the arguments, an 'R' - -> N1 () -- ^ one of the arguments - -> IO Int -newn = undefined - - --- | A foreign import with argument docs -foreign import ccall unsafe - o :: Float -- ^ The input float - -> IO Float -- ^ The output float - --- | We should be able to escape this: \#\#\# - --- p :: Int --- can't use the above original definition with GHC -newp :: Int -newp = undefined - --- | a function with a prime can be referred to as 'f'' --- but f' doesn't get link'd 'f\'' -f' :: Int - --- | Comment on a definition without type signature -withoutType = undefined - --- | Comment on a definition with type signature -withType :: Int -withType = 1 - --- Add some definitions here so that this file can be compiled with GHC - -data T1 -f = undefined -f' = undefined -type CInt = Int -k = undefined -l = undefined -m = undefined diff --git a/html-test/tests/Ticket112.hs b/html-test/tests/Ticket112.hs deleted file mode 100644 index c9cd5117..00000000 --- a/html-test/tests/Ticket112.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE MagicHash #-} - -module Ticket112 where - -import GHC.Prim - --- | ...given a raw 'Addr#' to the string, and the length of the string. -f :: a -f = undefined diff --git a/html-test/tests/Ticket61.hs b/html-test/tests/Ticket61.hs deleted file mode 100644 index 26ca287f..00000000 --- a/html-test/tests/Ticket61.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Ticket61 (module Ticket61_Hidden) where - -import Ticket61_Hidden diff --git a/html-test/tests/Ticket61_Hidden.hs b/html-test/tests/Ticket61_Hidden.hs deleted file mode 100644 index 583c10cd..00000000 --- a/html-test/tests/Ticket61_Hidden.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Ticket61_Hidden where - -class C a where - -- | A comment about f - f :: a diff --git a/html-test/tests/Ticket75.hs b/html-test/tests/Ticket75.hs deleted file mode 100644 index 94a2f115..00000000 --- a/html-test/tests/Ticket75.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Ticket75 where - -data a :- b = Q - --- | A reference to ':-' -f :: Int -f = undefined diff --git a/html-test/tests/TypeFamilies.hs b/html-test/tests/TypeFamilies.hs deleted file mode 100644 index 561f95fd..00000000 --- a/html-test/tests/TypeFamilies.hs +++ /dev/null @@ -1,28 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} - -module TypeFamilies where - --- | Type family G -type family G a :: * - --- | A class with an associated type -class A a where - -- | An associated type - data B a :: * -> * - -- | A method - f :: B a Int - --- | Doc for family -type family F a - - --- | Doc for G Int -type instance G Int = Bool -type instance G Float = Int - - -instance A Int where - data B Int x = Con x - f = Con 3 - -g = Con 5 diff --git a/html-test/tests/TypeOperators.hs b/html-test/tests/TypeOperators.hs deleted file mode 100644 index edbb9344..00000000 --- a/html-test/tests/TypeOperators.hs +++ /dev/null @@ -1,20 +0,0 @@ -{-# LANGUAGE TypeOperators #-} -module TypeOperators ( - -- * stuff - (:-:), - (:+:), - Op, - O(..), - biO, -) where - -data a :-: b - -data (a :+: b) c - -data a `Op` b - -newtype (g `O` f) a = O { unO :: g (f a) } - -biO :: (g `O` f) a -biO = undefined diff --git a/html-test/tests/Unicode.hs.disabled b/html-test/tests/Unicode.hs.disabled deleted file mode 100644 index d5bbf445..00000000 --- a/html-test/tests/Unicode.hs.disabled +++ /dev/null @@ -1,6 +0,0 @@ -module Unicode where - --- | γλώσσα -x :: Int -x = 1 - diff --git a/html-test/tests/Visible.hs b/html-test/tests/Visible.hs deleted file mode 100644 index cad71931..00000000 --- a/html-test/tests/Visible.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Visible where -visible :: Int -> Int -visible a = a -- cgit v1.2.3 From 410d8a4f7cfe3b45b98719f75bffc9ac06626fbc Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 20:34:40 +0200 Subject: Adapt output directory for HTML tests --- .gitignore | 2 +- html-test/accept.lhs | 6 +++--- html-test/run.lhs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3d242029..b516bcf8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /dist/ -/html-test/output/ +/html-test/out/ /doc/haddock /doc/autom4te.cache/ diff --git a/html-test/accept.lhs b/html-test/accept.lhs index ea55c35c..f6dfc4cd 100755 --- a/html-test/accept.lhs +++ b/html-test/accept.lhs @@ -12,12 +12,12 @@ baseDir = takeDirectory __FILE__ main :: IO () main = do - contents <- filter (not . ignore) <$> getDirectoryContents (baseDir "output") + contents <- filter (not . ignore) <$> getDirectoryContents (baseDir "out") args <- getArgs if not $ null args then - mapM_ copy [ baseDir "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + mapM_ copy [ baseDir "out" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] else - mapM_ copy [ baseDir "output" file | file <- contents] + mapM_ copy [ baseDir "out" file | file <- contents] where ignore = foldr (liftA2 (||)) (const False) [ diff --git a/html-test/run.lhs b/html-test/run.lhs index c543e020..7d3b805b 100755 --- a/html-test/run.lhs +++ b/html-test/run.lhs @@ -27,7 +27,7 @@ packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath baseDir = takeDirectory __FILE__ testDir = baseDir "src" refDir = baseDir "ref" -outDir = baseDir "output" +outDir = baseDir "out" packageRoot = baseDir ".." dataDir = packageRoot "resources" haddockPath = packageRoot "dist" "build" "haddock" "haddock" -- cgit v1.2.3 From cbc8e789b8b6308144ebdaf866ec202fe608647d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 18 Oct 2012 08:42:48 +0200 Subject: Update html-test/README --- html-test/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html-test/README b/html-test/README index b5fff14b..082104b0 100644 --- a/html-test/README +++ b/html-test/README @@ -5,8 +5,8 @@ To add a new test: 1) Create a module in the "html-test/src" directory. - 2) Run "cabal test". You should now have output/.html. The test - passes since there is no reference file to compare with. + 2) Run "cabal test". You should now have "html-test/out/.html". + The test passes since there is no reference file to compare with. 3) To make a reference file from the output file, do runhaskell accept.lhs -- cgit v1.2.3 From a20efa02eef21b70c2cc3183217b55ce470b2826 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 18 Oct 2012 08:48:02 +0200 Subject: Use markdown for html-test/README --- html-test/README | 24 ------------------------ html-test/README.markdown | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) delete mode 100644 html-test/README create mode 100644 html-test/README.markdown diff --git a/html-test/README b/html-test/README deleted file mode 100644 index 082104b0..00000000 --- a/html-test/README +++ /dev/null @@ -1,24 +0,0 @@ -This is a testsuite for Haddock that uses the concept of "golden files". That -is, it compares output files against a set of reference files. - -To add a new test: - - 1) Create a module in the "html-test/src" directory. - - 2) Run "cabal test". You should now have "html-test/out/.html". - The test passes since there is no reference file to compare with. - - 3) To make a reference file from the output file, do - runhaskell accept.lhs - -Tips and tricks: - -To "accept" all output files (copy them to reference files), run - runhaskell accept.lhs - -You can run all tests despite failing tests, like so - cabal test --test-option=all - -You can pass extra options to haddock like so - cabal test --test-options='all --title="All Tests"' - diff --git a/html-test/README.markdown b/html-test/README.markdown new file mode 100644 index 00000000..8d57acab --- /dev/null +++ b/html-test/README.markdown @@ -0,0 +1,27 @@ +This is a testsuite for Haddock that uses the concept of "golden files". That +is, it compares output files against a set of reference files. + +To add a new test: + + 1. Create a module in the `html-test/src` directory. + + 2. Run `cabal test`. You should now have `html-test/out/.html`. + The test passes since there is no reference file to compare with. + + 3. To make a reference file from the output file, run + + html-test/accept.lhs + +Tips and tricks: + +To "accept" all output files (copy them to reference files), run + + runhaskell accept.lhs + +You can run all tests despite failing tests, like so + + cabal test --test-option=all + +You can pass extra options to haddock like so + + cabal test --test-options='all --title="All Tests"' -- cgit v1.2.3 From 1d480b49a2d9098993889ca29dd82ef228ae5c0d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 28 Nov 2012 09:54:35 +0100 Subject: Export missing types from Documentation.Haddock --- src/Documentation/Haddock.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index e8ff9160..36115a2a 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -38,6 +38,10 @@ module Documentation.Haddock ( Hyperlink(..), DocMarkup(..), Documentation(..), + ArgMap, + AliasMap, + WarningMap, + DocMap, HaddockModInfo(..), markup, -- cgit v1.2.3 From e2c75d48f4dfd4140e977d097a95aa06b614fa24 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 7 Dec 2012 19:52:58 +0100 Subject: Bump version --- doc/haddock.xml | 2 +- haddock.cabal | 2 +- haddock.spec | 2 +- html-test/ref/A.html | 2 +- html-test/ref/AdvanceTypes.html | 2 +- html-test/ref/B.html | 2 +- html-test/ref/Bug1.html | 2 +- html-test/ref/Bug2.html | 2 +- html-test/ref/Bug3.html | 2 +- html-test/ref/Bug4.html | 2 +- html-test/ref/Bug6.html | 2 +- html-test/ref/Bug7.html | 2 +- html-test/ref/Bug8.html | 2 +- html-test/ref/BugDeprecated.html | 2 +- html-test/ref/BugExportHeadings.html | 2 +- html-test/ref/Bugs.html | 2 +- html-test/ref/CrossPackageDocs.html | 2 +- html-test/ref/DeprecatedClass.html | 2 +- html-test/ref/DeprecatedData.html | 2 +- html-test/ref/DeprecatedFunction.html | 2 +- html-test/ref/DeprecatedFunction2.html | 2 +- html-test/ref/DeprecatedFunction3.html | 2 +- html-test/ref/DeprecatedModule.html | 2 +- html-test/ref/DeprecatedModule2.html | 2 +- html-test/ref/DeprecatedNewtype.html | 2 +- html-test/ref/DeprecatedReExport.html | 2 +- html-test/ref/DeprecatedRecord.html | 2 +- html-test/ref/DeprecatedTypeFamily.html | 2 +- html-test/ref/DeprecatedTypeSynonym.html | 2 +- html-test/ref/DeprecationMessageParseError.html | 2 +- html-test/ref/Examples.html | 2 +- html-test/ref/FunArgs.html | 2 +- html-test/ref/GADTRecords.html | 2 +- html-test/ref/Hash.html | 2 +- html-test/ref/HiddenInstances.html | 2 +- html-test/ref/HiddenInstancesB.html | 2 +- html-test/ref/Hyperlinks.html | 2 +- html-test/ref/IgnoreExports.html | 2 +- html-test/ref/ModuleWithWarning.html | 2 +- html-test/ref/NamedDoc.html | 2 +- html-test/ref/NoLayout.html | 2 +- html-test/ref/NonGreedy.html | 2 +- html-test/ref/Properties.html | 2 +- html-test/ref/PruneWithWarning.html | 2 +- html-test/ref/QuasiExpr.html | 2 +- html-test/ref/QuasiQuote.html | 2 +- html-test/ref/SpuriousSuperclassConstraints.html | 2 +- html-test/ref/TH.html | 2 +- html-test/ref/TH2.html | 2 +- html-test/ref/Test.html | 2 +- html-test/ref/Ticket112.html | 2 +- html-test/ref/Ticket61.html | 2 +- html-test/ref/Ticket75.html | 2 +- html-test/ref/TypeFamilies.html | 2 +- html-test/ref/TypeOperators.html | 2 +- html-test/ref/Unicode.html | 2 +- html-test/ref/Visible.html | 2 +- 57 files changed, 57 insertions(+), 57 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 4e4447dc..139b2830 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.13.1, a Haskell + This document describes Haddock version 2.13.2, a Haskell documentation tool. diff --git a/haddock.cabal b/haddock.cabal index 99bf5e4a..06a85364 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.13.1 +version: 2.13.2 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries diff --git a/haddock.spec b/haddock.spec index 401f1e8a..9d6ea8f6 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.13.1 +%define version 2.13.2 %define release 1 Name: %{name} diff --git a/html-test/ref/A.html b/html-test/ref/A.html index 328fec02..9a60933e 100644 --- a/html-test/ref/A.html +++ b/html-test/ref/A.html @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Produced by Haddock version 2.13.1

            version 2.13.2

            Date: Fri, 7 Dec 2012 20:19:31 +0100 Subject: Add missing test files to cabal file (fixes #230) --- haddock.cabal | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 06a85364..2c102bc0 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -29,9 +29,8 @@ extra-source-files: haddock.spec haskell.vim src/haddock.sh --- The test files shouldn't have to go here, but the source files for --- the test-suite stanzas don't get picked up by `cabal sdist`. - tests/html-test/run.lhs + html-test/src/*.hs + html-test/ref/*.html data-dir: resources data-files: html/frames.html @@ -199,6 +198,10 @@ test-suite spec , test/nanospec , src + other-modules: + Test.Hspec + Haddock.ParseSpec + build-depends: base , ghc -- cgit v1.2.3 From 3d25ea2929a9a9bd0768339b8ac5fd1b7c4670ad Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 7 Dec 2012 20:28:52 +0100 Subject: Update CHANGES --- CHANGES | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index e68c8f9b..51bb9290 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,14 @@ +Changes in version 2.13.2 + + * Handle HsExplicitListTy in renameer (#213) + + * Allow haddock markup in deprecation messages + + * Export more types from Documentation.Haddock + + * Include everything that is required to run the test suite with the cabal + package (#230) + Changes in version 2.13.1 * Hide instances that are "internal" to a module -- cgit v1.2.3