From 6ed6c110c874a746b002aca148192c3cbc819d7f Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Fri, 5 Jan 2018 09:59:59 -0800 Subject: Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for #679 and #710 --- html-test/ref/Bug679.html | 196 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 html-test/ref/Bug679.html (limited to 'html-test/ref/Bug679.html') diff --git a/html-test/ref/Bug679.html b/html-test/ref/Bug679.html new file mode 100644 index 00000000..ddec7a12 --- /dev/null +++ b/html-test/ref/Bug679.html @@ -0,0 +1,196 @@ +Bug679

Safe HaskellNone

Bug679

Documentation

data Bar a #

Constructors

Bar
Instances
Foo (Bar a) #
Instance details

Methods

foo :: Bar a -> Bar a #

class Foo a where #

Minimal complete definition

foo

Methods

foo :: a -> a #

Instances
Foo (Bar a) #
Instance details

Methods

foo :: Bar a -> Bar a #

\ No newline at end of file -- cgit v1.2.3 From 69b98a99ce4de93ea0e6082bd11edb3baaf2fa6e Mon Sep 17 00:00:00 2001 From: Alexander Biehl Date: Fri, 2 Mar 2018 15:43:21 +0100 Subject: Make testsuite work with haddock-1.19.0 release (#766) --- html-test/Main.hs | 15 + html-test/ref/A.html | 12 +- html-test/ref/Bug1.html | 2 +- html-test/ref/Bug2.html | 2 +- html-test/ref/Bug253.html | 2 +- html-test/ref/Bug26.html | 4 +- html-test/ref/Bug280.html | 2 +- html-test/ref/Bug294.html | 154 +++++- html-test/ref/Bug298.html | 8 +- html-test/ref/Bug3.html | 4 +- html-test/ref/Bug310.html | 16 +- html-test/ref/Bug387.html | 8 +- html-test/ref/Bug4.html | 4 +- html-test/ref/Bug546.html | 12 +- html-test/ref/Bug548.html | 244 +++++----- html-test/ref/Bug6.html | 78 ++-- html-test/ref/Bug613.html | 26 +- html-test/ref/Bug647.html | 2 +- html-test/ref/Bug679.html | 18 +- html-test/ref/Bug7.html | 12 +- html-test/ref/Bug8.html | 16 +- html-test/ref/Bug85.html | 16 +- html-test/ref/BugDeprecated.html | 24 +- html-test/ref/BugExportHeadings.html | 24 +- html-test/ref/Bugs.html | 2 +- html-test/ref/BundledPatterns.html | 64 +-- html-test/ref/BundledPatterns2.html | 98 ++-- html-test/ref/ConstructorPatternExport.html | 18 +- html-test/ref/DeprecatedClass.html | 4 +- html-test/ref/DeprecatedFunction.html | 10 +- html-test/ref/DeprecatedFunction2.html | 4 +- html-test/ref/DeprecatedFunction3.html | 4 +- html-test/ref/DeprecatedModule.html | 2 +- html-test/ref/DeprecatedModule2.html | 2 +- html-test/ref/DeprecatedNewtype.html | 8 +- html-test/ref/DeprecatedReExport.html | 6 +- html-test/ref/DeprecatedRecord.html | 8 +- html-test/ref/DeprecatedTypeFamily.html | 16 +- html-test/ref/DeprecatedTypeSynonym.html | 8 +- html-test/ref/Examples.html | 10 +- html-test/ref/FunArgs.html | 8 +- html-test/ref/GADTRecords.html | 34 +- html-test/ref/Hash.html | 80 ++-- html-test/ref/HiddenInstances.html | 50 +- html-test/ref/HiddenInstancesB.html | 8 +- html-test/ref/Hyperlinks.html | 4 +- html-test/ref/ImplicitParams.html | 14 +- html-test/ref/Instances.html | 566 +++++++++++------------ html-test/ref/Math.html | 4 +- html-test/ref/Minimal.html | 24 +- html-test/ref/ModuleWithWarning.html | 2 +- html-test/ref/NoLayout.html | 6 +- html-test/ref/Operators.html | 40 +- html-test/ref/OrphanInstances.html | 18 +- html-test/ref/OrphanInstancesClass.html | 52 ++- html-test/ref/OrphanInstancesType.html | 50 +- html-test/ref/PatternSyns.html | 72 +-- html-test/ref/PromotedTypes.html | 40 +- html-test/ref/Properties.html | 10 +- html-test/ref/QuasiExpr.html | 54 +-- html-test/ref/QuasiQuote.html | 2 +- html-test/ref/SpuriousSuperclassConstraints.html | 48 +- html-test/ref/Table.html | 2 +- html-test/ref/Test.html | 424 ++++++++++------- html-test/ref/Threaded.html | 4 +- html-test/ref/Ticket112.html | 2 +- html-test/ref/Ticket61.html | 2 +- html-test/ref/Ticket75.html | 6 +- html-test/ref/TitledPicture.html | 12 +- html-test/ref/TypeFamilies.html | 544 +++++++++------------- html-test/ref/TypeFamilies2.html | 50 +- html-test/ref/TypeOperators.html | 14 +- html-test/ref/Unicode.html | 4 +- html-test/ref/Visible.html | 4 +- 74 files changed, 1687 insertions(+), 1536 deletions(-) (limited to 'html-test/ref/Bug679.html') diff --git a/html-test/Main.hs b/html-test/Main.hs index 67dbeec6..d65a5087 100755 --- a/html-test/Main.hs +++ b/html-test/Main.hs @@ -47,7 +47,22 @@ stripIfRequired mdl = preserveLinksModules :: [String] preserveLinksModules = ["Bug253"] +ingoredTests :: [FilePath] +ingoredTests = + [ + -- Currently some declarations are exported twice + -- we need a reliable way to deduplicate here. + -- Happens since PR #688. + "B" + + -- ignore-exports flag broke with PR #688. We use + -- the Avails calculated by GHC now. Probably + -- requires a change to GHC to "ignore" a modules + -- export list reliably. + , "IgnoreExports" + ] checkIgnore :: FilePath -> Bool +checkIgnore file | takeBaseName file `elem` ingoredTests = True checkIgnore file@(c:_) | takeExtension file == ".html" && isUpper c = False checkIgnore _ = True diff --git a/html-test/ref/A.html b/html-test/ref/A.html index 1fbfb371..e4802966 100644 --- a/html-test/ref/A.html +++ b/html-test/ref/A.html @@ -54,13 +54,13 @@ >
  • other :: :: Int
  • test2 :: :: Bool
  • reExport :: :: Int
  • other :: :: Int #

    test2 :: :: Bool #

    reExport :: :: Int #

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

    x :: :: A #This link should generate #v anchor: fakeFakeFake

    Minimal complete definition

    c_f

    C ()

    x :: [ :: [Char] # data DP A

    data TP TP A

    problemField :: TO :: TO A -> -> A #

    problemField' :: DO :: DO A -> -> A #

    gadtField :: ({..} -> GADT :: ({..} -> GADT A) -> ) -> A #

    data family TP t :: * #

    Instances
    data TP A #
    Instance details
    data TP A = ProblemCtor A

    data family DP t :: t :: * # data DP A

    data family TO' t :: * #

    Instances
    data TO' a #
    Instance details
    data TO' a = PolyCtor
  • test1 :: :: Int
  • test2 :: :: Int
  • test1 :: :: Int #

    test2 :: :: Int #

  • foo :: :: Int
  • foo :: :: Int #

  • x :: :: Integer
  • compile :: :: String -> -> String
  • x :: :: Integer #

    compile :: :: String -> -> String #newtype WrappedArrow (a :: (a :: * -> -> * -> -> *) b c # Generic1 * ( (WrappedArrow a b) a b :: * -> *)

    type Rep1 (WrappedArrow a b) (f :: (WrappedArrow a b -> *) :: k -> a b) :: k -> * #

    from1 :: f a0 -> :: WrappedArrow a b a0 -> Rep1 ( (WrappedArrow a b) f a0 a b) a0 #

    to1 :: :: Rep1 ( (WrappedArrow a b) a0 -> WrappedArrow a b) f a0 -> f a0 a b a0 #

    Arrow a => a => Functor ( (WrappedArrow a b)

    fmap :: (a0 -> b0) -> :: (a0 -> b0) -> WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b b0 #

    (<$) :: a0 -> :: a0 -> WrappedArrow a b b0 -> a b b0 -> WrappedArrow a b a0 # Arrow a => a => Applicative ( (WrappedArrow a b)

    pure :: a0 -> :: a0 -> WrappedArrow a b a0 #

    (<*>) :: :: WrappedArrow a b (a0 -> b0) -> a b (a0 -> b0) -> WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b b0 #

    liftA2 :: (a0 -> b0 -> c) -> :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b b0 -> a b b0 -> WrappedArrow a b c #

    (*>) :: :: WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b b0 -> a b b0 -> WrappedArrow a b b0 #

    (<*) :: :: WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b b0 -> a b b0 -> WrappedArrow a b a0 # ( (ArrowZero a, a, ArrowPlus a) => a) => Alternative ( (WrappedArrow a b)

    empty :: :: WrappedArrow a b a0 #

    (<|>) :: :: WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b a0 #

    some :: :: WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b [a0] #

    many :: :: WrappedArrow a b a0 -> a b a0 -> WrappedArrow a b [a0] # Generic ( (WrappedArrow a b c)

    type Rep ( (WrappedArrow a b c) :: a b c) :: * -> -> * #

    from :: :: WrappedArrow a b c -> a b c -> Rep ( (WrappedArrow a b c) x #

    to :: :: Rep ( (WrappedArrow a b c) x -> a b c) x -> WrappedArrow a b c # type Rep1 * ( (WrappedArrow a b) a b :: * -> *)

    type Rep ( (WrappedArrow a b c)A = A Int
  • B = B {}
  • Int
  • b :: B -> Int
  • data
  • c1 :: :: Int
  • c2 :: :: Int
  • D = D Int Int
  • E = E Int
  • A IntB Int

    Fields

    b :: B -> Int #

    datac1 :: :: Int

    c2 :: :: Int
    D Int IntE Int

    Minimal complete definition

    fmap

    Functor ( (Either a)

    fmap :: (a0 -> b) -> :: (a0 -> b) -> Either a a0 -> a a0 -> Either a b # Functor ( (ThreeVars a0 a)

    fmap :: (a1 -> b) -> :: (a1 -> b) -> ThreeVars a0 a a1 -> a0 a a1 -> ThreeVars a0 a b # Functor ( (ThreeVars a0 a)

    fmap :: (a1 -> b) -> :: (a1 -> b) -> ThreeVars a0 a a1 -> a0 a a1 -> ThreeVars a0 a b #

    Minimal complete definition

    f

    Foo ( (Bar a)

    foo :: :: Bar a -> a -> Bar a #

    Minimal complete definition

    foo

    Foo ( (Bar a)

    foo :: :: Bar a -> a -> Bar a # Bar Foo Foo Bar Foo Foo Type ( (Typ, [, [Typ])TFree ( (Typ, [, [Typ])

    (-->) :: p1 -> p2 -> :: p1 -> p2 -> Typ infix 9

    (--->) :: :: Foldable t0 => t0 t -> t0 => t0 t -> Typ -> -> Typ infix 9data Foo :: ( :: (* -> -> *) -> ) -> * -> -> * whereBar :: f x -> :: f x -> Foo f (f x)data Baz :: :: * whereBaz' :: :: BazQuux :: :: Qux

  • foo :: :: Int
  • bar :: :: Int
  • baz :: :: Int
  • one :: :: Int
  • two :: :: Int
  • three :: :: Int
  • foo :: :: Int #

    bar :: :: Int #

    baz :: :: Int #

    one :: :: Int #

    two :: :: Int #

    three :: :: Int #

  • foo :: :: Int
  • bar :: :: Int
  • baz :: :: Int
  • one :: :: Int
  • two :: :: Int
  • three :: :: Int
  • foo :: :: Int #

    bar :: :: Int #

    baz :: :: Int #

    one :: :: Int #

    two :: :: Int #

    three :: :: Int #A a (a -> a (a -> Int)data Vec :: :: Nat -> -> * -> -> * where

  • Nil :: :: Vec 0 a
  • pattern (:>) :: a -> :: a -> Vec n a -> n a -> Vec (n (n + 1) a
  • data RTree :: :: Nat -> -> * -> -> * wherepattern LR :: a -> :: a -> RTree 0 a
  • pattern BR :: :: RTree d a -> d a -> RTree d a -> d a -> RTree (d (d + 1) a
  • data Vec :: :: Nat -> -> * -> -> * whereLists with their length encoded in their type
  • Vector elements have an subscript starting from 0 and ending at length - 1Nil :: :: Vec 0 apattern (:>) :: a -> :: a -> Vec n a -> n a -> Vec (n (n + 1) a infixr 5data RTree :: :: Nat -> -> * -> -> * wherepattern LR :: a -> :: a -> RTree 0 apattern BR :: :: RTree d a -> d a -> RTree d a -> d a -> RTree (d (d + 1) adata Vec :: :: Nat -> -> * -> -> * wherepattern Empty :: (:>) :: a -> Vec 0 a
  • n a -> Vec (n + 1) a
  • pattern (:>) :: a -> Vec n a -> Empty :: Vec (n + 1) a
  • 0 a
  • data RTree :: :: Nat -> -> * -> -> * wherepattern LR :: a -> :: a -> RTree 0 a
  • pattern BR :: :: RTree d a -> d a -> RTree d a -> d a -> RTree (d (d + 1) a
  • data Vec :: :: Nat -> -> * -> -> * whereLists with their length encoded in their type
  • Vector elements have an subscript starting from 0 and ending at length - 1Bundled Patterns

    pattern Empty :: Vec 0 a
    pattern (:>) :: a -> :: a -> Vec n a -> n a -> Vec (n (n + 1) a infixr 5
    pattern Empty :: Vec 0 a
    data RTree :: :: Nat -> -> * -> -> * wherepattern LR :: a -> :: a -> RTree 0 apattern BR :: :: RTree d a -> d a -> RTree d a -> d a -> RTree (d (d + 1) apattern FooCons :: :: String -> a -> Foo a #pattern MyRecCons :: :: Bool -> -> Int -> MyRec #pattern (:+) :: :: String -> a -> MyInfix a #pattern BlubCons :: () => :: () => Show b => b -> Blub #MyGADTCons :: () => forall a. a. Eq a => a -> a => a -> Int -> MyGADT ( -> MyGADT (Maybe String) #

    Minimal complete definition

    foo

    Minimal complete definition

    bar

  • foo :: :: Int
  • bar :: :: Int
  • foo :: :: Int #

    Deprecated: use bar instead

    bar :: :: Int #

  • foo :: :: Int
  • foo :: :: Int #

  • foo :: :: Integer
  • foo :: :: Integer #

    foo :: :: Int #

    foo :: :: Int #SomeNewType = SomeNewTypeConst String

  • SomeOtherNewType = SomeOtherNewTypeConst String
  • SomeNewTypeConst StringSomeOtherNewTypeConst String
  • foo :: :: Int
  • foo :: :: Int #

    Deprecated: use bar instead

  • fooName :: :: String
  • fooValue :: :: Int
  • fooName :: :: String
    fooValue :: :: Int
    data family SomeTypeFamily k :: k :: * -> -> *
  • data family SomeOtherTypeFamily k :: k :: * -> -> *
  • data family SomeTypeFamily k :: k :: * -> -> * #data family SomeOtherTypeFamily k :: k :: * -> -> * #type TypeSyn = = String
  • type OtherTypeSyn = = String
  • type TypeSyn = = String #type OtherTypeSyn = = String #
  • fib :: :: Integer -> -> Integer
  • fib :: :: Integer -> -> Integer #

    Fibonacci number of given Integer.

    foo :: (LiftedRep -> LiftedRep) a :: (a -> Int -> a0 -> (LiftedRep -> LiftedRep) a a0 ) -> a0 -> a -> a0 #

    foo' :: (LiftedRep -> LiftedRep) a ((LiftedRep -> LiftedRep) a a0) -> :: (a -> a -> a0) -> Int -> (LiftedRep -> LiftedRep) a ((LiftedRep -> LiftedRep) a -> a -> a -> Int) #

    class Foo f => Bar

    bar :: f a -> f :: f a -> f Bool -> a # Bar Maybe Bool

    bar :: :: Maybe Bool -> -> Maybe Bool -> -> Bool #

    bar' :: :: Maybe ( (Maybe Bool) -> ) -> Maybe ( (Maybe ( (Maybe b)) #

    bar0 :: ( :: (Maybe Bool, , Maybe Bool) -> () -> (Maybe b, b, Maybe c) #

    bar1 :: ( :: (Maybe Bool, , Maybe Bool) -> () -> (Maybe b, b, Maybe c) # Bar Maybe [a]

    bar :: :: Maybe [a] -> [a] -> Maybe Bool -> [a] #

    bar' :: :: Maybe ( (Maybe [a]) -> [a]) -> Maybe ( (Maybe ( (Maybe b)) #

    bar0 :: ( :: (Maybe [a], [a], Maybe [a]) -> ( [a]) -> (Maybe b, b, Maybe c) #

    bar1 :: ( :: (Maybe [a], [a], Maybe [a]) -> ( [a]) -> (Maybe b, b, Maybe c) # Bar [] (a, a)

    bar :: [(a, a)] -> [ :: [(a, a)] -> [Bool] -> (a, a) # Foo f => f => Bar ( (Either a) (f a)

    bar :: :: Either a (f a) -> a (f a) -> Either a a Bool -> f a #

    bar' :: :: Either a ( a (Either a (f a)) -> a (f a)) -> Either a ( a (Either a ( a (Either a b)) #

    bar0 :: ( :: (Either a (f a), a (f a), Either a (f a)) -> ( a (f a)) -> (Either a b, a b, Either a c) #

    bar1 :: ( :: (Either a (f a), a (f a), Either a (f a)) -> ( a (f a)) -> (Either a b, a b, Either a c) # Foo ( ((,,) a b) => a b) => Bar ( ((,,) a b) (a, b, a)

    bar :: (a, b, (a, b, a)) -> (a, b, :: (a, b, (a, b, a)) -> (a, b, Bool) -> (a, b, a) # Bar ( (Quux a c) ( a c) (Quux a b c)

    bar :: :: Quux a c ( a c (Quux a b c) -> a b c) -> Quux a c a c Bool -> -> Quux a b c #

    bar' :: :: Quux a c ( a c (Quux a c ( a c (Quux a b c)) -> a b c)) -> Quux a c ( a c (Quux a c ( a c (Quux a c b0)) #

    bar0 :: ( :: (Quux a c ( a c (Quux a b c), a b c), Quux a c ( a c (Quux a b c)) -> ( a b c)) -> (Quux a c b0, a c b0, Quux a c c0) #

    bar1 :: ( :: (Quux a c ( a c (Quux a b c), a b c), Quux a c ( a c (Quux a b c)) -> ( a b c)) -> (Quux a c b0, a c b0, Quux a c c0) # Baz [c] Baz (a -> b) Baz (a, b, c) Baz ( (Quux a b c)

    baz :: :: Quux a b c -> (forall a0. a0 -> a0) -> (b0, forall c0. c0 -> c0. c0 -> Quux a b c) -> (b0, c1) #baz' :: b0 -> (forall b1. b1 -> b1. b1 -> Quux a b c) -> (forall b2. b2 -> b2. b2 -> Quux a b c) -> [(b0, a b c) -> [(b0, Quux a b c)] #forall b1. (forall b2. b2 -> b2. b2 -> Quux a b c) -> c0) -> forall Baz (a, [b], b, a) Foo ( (Quux a b)

    foo :: :: Quux a b a b Int -> a0 -> -> a0 -> Quux a b a0 #

    foo' :: :: Quux a b ( a b (Quux a b a0) -> a b a0) -> Int -> -> Quux a b ( a b (Quux a b a b Int) # Bar ( (Quux a c) ( a c) (Quux a b c)

    bar :: :: Quux a c ( a c (Quux a b c) -> a b c) -> Quux a c a c Bool -> -> Quux a b c #

    bar' :: :: Quux a c ( a c (Quux a c ( a c (Quux a b c)) -> a b c)) -> Quux a c ( a c (Quux a c ( a c (Quux a c b0)) #

    bar0 :: ( :: (Quux a c ( a c (Quux a b c), a b c), Quux a c ( a c (Quux a b c)) -> ( a b c)) -> (Quux a c b0, a c b0, Quux a c c0) #

    bar1 :: ( :: (Quux a c ( a c (Quux a b c), a b c), Quux a c ( a c (Quux a b c)) -> ( a b c)) -> (Quux a c b0, a c b0, Quux a c c0) # Baz ( (Quux a b c)

    baz :: :: Quux a b c -> (forall a0. a0 -> a0) -> (b0, forall c0. c0 -> c0. c0 -> Quux a b c) -> (b0, c1) #baz' :: b0 -> (forall b1. b1 -> b1. b1 -> Quux a b c) -> (forall b2. b2 -> b2. b2 -> Quux a b c) -> [(b0, a b c) -> [(b0, Quux a b c)] #forall b1. (forall b2. b2 -> b2. b2 -> Quux a b c) -> c0) -> forall data Thud Int ( (Quux a [a] c)

    data Thud Int ( (Quux a [a] c)

    norf :: :: Plugh a c b -> a -> (a -> c) -> b # Norf Int Bool

    type Plugh Int c c Bool :: :: * #

    data Thud Int c :: c :: * #

    norf :: :: Plugh Int c c Bool -> -> Int -> ( -> (Int -> c) -> -> c) -> Bool # Norf [a] [b]

    type Plugh [a] c [b] :: [a] c [b] :: * #

    data Thud [a] c :: [a] c :: * #

    norf :: :: Plugh [a] c [b] -> [a] -> ([a] -> c) -> [b] #

  • f :: :: Integer
  • f :: :: Integer #

    Minimal complete definition

    foo, , bar | | bar, , bat | | foo, , bat | | fooBarBat

    Minimal complete definition

    x, , y

    Minimal complete definition

    aaa, , bbb

    Minimal complete definition

    ccc, ddd

    foo :: :: Int #

  • g :: :: Int
  • g :: :: Int #

    the function g

    Foo
  • (:<->) :: a -> b -> a :: a -> b -> a <-> b
  • type a <>< b :: b :: *
  • type (>-<) a b = a a b = a <-> b
  • :: :: Ord a
    => => Int
    -> -> Bool:: forall (b :: ()). d ~ (b :: ()). d ~ ()
  • C1 :: :: H1 a b
  • C2 :: :: Ord a => [a] -> a => [a] -> H1 a a
  • C3 :: {..} -> :: {..} -> H1 Int Int
  • C4 :: {..} -> :: {..} -> H1 Int a
  • C1 :: :: H1 a bC2 :: :: Ord a => [a] -> a => [a] -> H1 a aC3 :: {..} -> :: {..} -> H1 Int Intfield :: :: Int
    C4 :: {..} -> :: {..} -> H1 Int a
  • new :: ( :: (Eq key, key, Hash key) => key) => Int -> -> IO ( (HashTable key val)
  • insert :: ( :: (Eq key, key, Hash key) => key -> val -> key) => key -> val -> IO ()
  • lookup :: :: Hash key => key -> key => key -> IO ( (Maybe val)
  • key should be an instance of Eq.

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

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

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

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

    Minimal complete definition

    hash

    hash :: a -> :: a -> Int #hashes the value of type a into an Int

    Hash Float

    hash :: :: Float -> -> Int # Hash Int

    hash :: :: Int -> -> Int # ( (Hash a, a, Hash b) => b) => Hash (a, b)

    hash :: (a, b) -> :: (a, b) -> Int # VisibleClass Int VisibleClass VisibleData Num VisibleData

    (+) :: :: VisibleData -> -> VisibleData -> -> VisibleData #

    (-) :: :: VisibleData -> -> VisibleData -> -> VisibleData #

    (*) :: :: VisibleData -> -> VisibleData -> -> VisibleData #

    negate :: :: VisibleData -> -> VisibleData #

    abs :: :: VisibleData -> -> VisibleData #

    signum :: :: VisibleData -> -> VisibleData #

    fromInteger :: :: Integer -> -> VisibleData # VisibleClass VisibleData Foo Bar Foo Bar

  • foo :: :: Int
  • foo :: :: Int #

    c :: (?x :: :: (?x :: X) => ) => X #

    d :: (?x :: :: (?x :: X, ?y :: , ?y :: X) => () => (X, , X) #

    f :: ((?x :: :: ((?x :: X) => a) -> a # Foo ( ((<~~) a)

    foo :: (a :: (a <~~ Int) -> a0 -> a ) -> a0 -> a <~~ a0 #

    foo' :: (a :: (a <~~ (a (a <~~ a0)) -> a0)) -> Int -> a -> a <~~ (a (a <~~ Int) #

    foo :: f :: f Int -> a -> f a #

    foo' :: f (f a) -> :: f (f a) -> Int -> f (f -> f (f Int) # Foo []

    foo :: [ :: [Int] -> a -> [a] #

    foo' :: [[a]] -> :: [[a]] -> Int -> [[ -> [[Int]] # Foo Maybe

    foo :: :: Maybe Int -> a -> -> a -> Maybe a #

    foo' :: :: Maybe ( (Maybe a) -> a) -> Int -> -> Maybe ( (Maybe Int) # Foo ( (Either a)

    foo :: :: Either a a Int -> a0 -> -> a0 -> Either a a0 #

    foo' :: :: Either a ( a (Either a a0) -> a a0) -> Int -> -> Either a ( a (Either a a Int) # ( (Eq a, a, Foo f) => f) => Foo ( ((,) (f a))

    foo :: (f a, :: (f a, Int) -> a0 -> (f a, a0) #

    foo' :: (f a, (f a, a0)) -> :: (f a, (f a, a0)) -> Int -> (f a, (f a, -> (f a, (f a, Int)) # Foo ( ((<~~) a)

    foo :: (a :: (a <~~ Int) -> a0 -> a ) -> a0 -> a <~~ a0 #

    foo' :: (a :: (a <~~ (a (a <~~ a0)) -> a0)) -> Int -> a -> a <~~ (a (a <~~ Int) # Foo ( ((,,) a a)

    foo :: (a, a, :: (a, a, Int) -> a0 -> (a, a, a0) #

    foo' :: (a, a, (a, a, a0)) -> :: (a, a, (a, a, a0)) -> Int -> (a, a, (a, a, -> (a, a, (a, a, Int)) # Foo ( (Quux a b)

    foo :: :: Quux a b a b Int -> a0 -> -> a0 -> Quux a b a0 #

    foo' :: :: Quux a b ( a b (Quux a b a0) -> a b a0) -> Int -> -> Quux a b ( a b (Quux a b a b Int) # Foo ((->) LiftedRep LiftedRep a) ((->) a :: * -> *) #

    Foo `Bar` Foo infixl 3
    Foo :- Foo infixr 5(:<->) :: a -> b -> a :: a -> b -> a <-> b infixr 6

    Minimal complete definition

    (>><), , (<<>), , (**>), , (**<), , (>**), , (<**)

    type a <>< b :: b :: * infixl 2type (>-<) a b = a a b = a <-> b infixl 6
    Synopsis

      Documentation

      Orphan instances

      AClass AType

      aClass :: :: AType -> -> Int #

      Minimal complete definition

      aClass

      aClass :: a -> :: a -> Int #

      Instances
      AClass AType #

      This is an orphan instance.

      Instance details

      Methods

      aClass :: AType -> Int #

      AType Int
      Instances
      AClass AType #

      This is an orphan instance.

      Instance details

      Methods

      aClass :: AType -> Int #

      Foo :: forall x. x -> x. x -> FooType x
    • Bar :: forall x. x -> x. x -> FooType ( (FooType x)
    • (:<->) :: forall x x1. x -> x1 -> ( x x1. x -> x1 -> (FooType x, x, FooType ( (FooType x1))
    • data BlubType = = Show x => BlubCtorBlub :: () => forall x. x. Show x => x -> x => x -> BlubType
    • data (a :: (a :: *) ><E :: forall k a (b :: k). (><) k a b
    • k a (b :: k). a >< b
    • pattern PatWithExplicitSig :: :: Eq somex => somex -> somex => somex -> FooType somex
    • Foo :: forall x. x -> x. x -> FooType x #

      Pattern synonym for Foo x

      Bar :: forall x. x -> x. x -> FooType ( (FooType x) #

      Pattern synonym for Bar x

      (:<->) :: forall x x1. x -> x1 -> ( x x1. x -> x1 -> (FooType x, x, FooType ( (FooType x1)) #

      Pattern synonym for (:<->)

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

    • = A Int ( (Maybe Float)
    • | B ( (T a b, a b, T Int Float)
    • p :: :: Int
    • r, s :: :: Int
    • t :: T1 -> :: T1 -> T2 Int Int -> -> T3 Bool Bool -> -> T4 Float Float -> -> T5 () ()
    • u, v :: :: Int
    • s1 :: :: Int
    • s2 :: :: Int
    • s3 :: :: Int
    • }
    • p :: R -> Int
    • q :: R -> forall a. a -> a
    • u :: R -> Int
    • class D a => C
    • a :: :: C a => a => IO a
    • f :: :: C a => a -> a => a -> Int
    • g :: :: Int -> -> IO CInt
    • hidden :: :: Int -> -> Int
    • Ex a
    • Show x => BlubCtorBlub :: () => forall x. x. Show x => x -> x => x -> BlubType #

      Pattern synonym for Blub x

      data (a :: (a :: *) ><

      Doc for (><)

      E :: forall k a (b :: k). (><) k a b k a (b :: k). a >< b #

      Pattern for Empty

      pattern PatWithExplicitSig :: :: Eq somex => somex -> somex => somex -> FooType somex #
      ((RevList a) :>data Pattern :: [ :: [*] -> ] -> * whereNil :: :: Pattern '[]Cons :: :: Maybe h -> h -> Pattern t -> t -> Pattern (h ': t)data RevPattern :: :: RevList * -> -> * whereRevNil :: :: RevPattern RNilRevCons :: :: Maybe h -> h -> RevPattern t -> t -> RevPattern (t (t :> h)data Tuple :: ( :: (*, , *) -> ) -> * whereTuple :: a -> b -> :: a -> b -> Tuple '(a, b)
    • fib :: :: Integer -> -> Integer
    • fib :: :: Integer -> -> Integer #

      Fibonacci number of given Integer.

      IntExpr IntegerAntiIntExpr StringBinopExpr BinOp Expr ExprAntiExpr String Show Expr

      showsPrec :: :: Int -> -> Expr -> -> ShowS #

      show :: :: Expr -> -> String #

      showList :: [ :: [Expr] -> ] -> ShowS # Show BinOp

      showsPrec :: :: Int -> -> BinOp -> -> ShowS #

      show :: :: BinOp -> -> String #

      showList :: [ :: [BinOp] -> ] -> ShowS #

      eval :: :: Expr -> -> Integer #

      parseExprExp :: :: String -> Q Exp #

      val :: :: Integer #data SomeType (f :: (f :: * -> -> *) a # Functor ( (SomeType f)

      fmap :: (a -> b) -> :: (a -> b) -> SomeType f a -> f a -> SomeType f b #

      (<$) :: a -> :: a -> SomeType f b -> f b -> SomeType f a # Applicative f => f => Applicative ( (SomeType f)

      pure :: a -> :: a -> SomeType f a #

      (<*>) :: :: SomeType f (a -> b) -> f (a -> b) -> SomeType f a -> f a -> SomeType f b #

      liftA2 :: (a -> b -> c) -> :: (a -> b -> c) -> SomeType f a -> f a -> SomeType f b -> f b -> SomeType f c #

      (*>) :: :: SomeType f a -> f a -> SomeType f b -> f b -> SomeType f b #

      (<*) :: :: SomeType f a -> f a -> SomeType f b -> f b -> SomeType f a #

      tableWithHeader A Int ( (Maybe Float)

      This comment describes the A constructor

      B ( (T a b, a b, T Int Float)

      This comment describes the B constructor

      documents A3

      documents B3

      This is the doc for A4

      This is the doc for B4

      This is the doc for C4

      this is the n3 field

      The N7 constructor

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

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

      p :: :: Int

      This comment applies to the p field

      This comment applies to the q field

      r, s :: :: Int

      This comment applies to both r and s

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

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

      This is the C3 record constructor

      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:

      p :: R -> Int #

      This comment applies to the p field

      q :: R -> forall a. a -> a #

      This comment applies to the q field

      u :: R -> Int #

      Class declarations

      class D a => CThis comment applies to the previous declaration (the C class)

      Minimal complete definition

      a, , b

      a :: :: IO a #

      this is a description of the a method

      this is a description of the b method

      Minimal complete definition

      d, , e

      d :: :: T a b # D Float

      d :: :: T Float b #

      e :: ( :: (Float, , Float) # D Int

      d :: :: T Int b #

      e :: ( :: (Int, , Int) #

      Minimal complete definition

      ff

      a :: :: C a => a => IO a #

      this is a description of the a method

      f :: :: C a => a -> 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 @@ -1801,7 +1877,7 @@ using double quotes:

           This is a block of code, which can include other markup: R
      @@ -1821,9 +1897,9 @@ using double quotes: 

      g :: :: Int -> -> IO CInt #

      hidden :: :: Int -> -> Int #
      C b => Ex1
      C a => Ex3
      :: :: T () ()

      This argument has type T

      -> -> T2 Int Int
      -> (-> (T3 Bool Bool -> -> T4 Float Float)
      -> -> T5 () ()
      -> -> IO ()
      :: (:: (Int, , Int, , Float)
      -> -> Int

      returns an Int

      :: :: R
      -> -> N1 ()
      -> -> IO Intdata Bat* X
      :: :: Float
      -> -> IO Float

      f' :: :: Int #

      a function with a prime can be referred to as f' @@ -2283,7 +2359,7 @@ is at the beginning of the line).

      withType :: :: Int #

    • f :: :: Integer
    • f :: :: Integer #

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

      Minimal complete definition

      f

    • f :: :: Int
    • f :: :: Int #

      type (<>) * Y a = a
      <> (a :: *) = atype(<>)* X a<> (a :: *)#
      type (<>) * X a = <> (a :: *) = X
      (><) X XX >< XXX data Bar W
      data Bar W = BarX type Foo W type Foo W type Foo X data Bar W
      data Bar W = BarX data Bar Y

      biO :: (g :: (g `O` f) a #

      x :: (a :: (a :-: a) a) <=> (a (a `Op` a) => a #

      y :: (a :: (a <=> a, (a a, (a `Op` a) a) <=> a) => a #

    • x :: :: Int
    • x :: :: Int #

      visible :: :: Int -> -> Int # Date: Wed, 21 Mar 2018 01:16:57 -0700 Subject: Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests --- haddock-api/src/Haddock/Backends/LaTeX.hs | 4 +- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 18 ++- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 12 +- .../src/Haddock/Interface/AttachInstances.hs | 18 ++- haddock-api/src/Haddock/Interface/Rename.hs | 4 +- haddock-api/src/Haddock/Types.hs | 2 +- html-test/ref/Bug26.html | 6 +- html-test/ref/Bug294.html | 30 +++- html-test/ref/Bug548.html | 42 ++++- html-test/ref/Bug613.html | 18 ++- html-test/ref/Bug679.html | 12 +- html-test/ref/Bug7.html | 8 + html-test/ref/Hash.html | 18 ++- html-test/ref/HiddenInstances.html | 18 ++- html-test/ref/HiddenInstancesB.html | 8 + html-test/ref/Instances.html | 156 +++++++++++++++--- html-test/ref/OrphanInstances.html | 4 +- html-test/ref/OrphanInstancesClass.html | 6 +- html-test/ref/OrphanInstancesType.html | 6 +- html-test/ref/QuasiExpr.html | 12 +- html-test/ref/SpuriousSuperclassConstraints.html | 12 +- html-test/ref/Test.html | 12 +- html-test/ref/TypeFamilies.html | 180 ++++++++++++++++++--- html-test/ref/TypeFamilies2.html | 36 ++++- 24 files changed, 530 insertions(+), 112 deletions(-) (limited to 'html-test/ref/Bug679.html') diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 1043453d..38fccf0c 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -530,14 +530,14 @@ ppDocInstances unicode (i : rest) (is, rest') = spanWith isUndocdInstance rest isUndocdInstance :: DocInstance a -> Maybe (InstHead a) -isUndocdInstance (i,Nothing,_) = Just i +isUndocdInstance (i,Nothing,_,_) = Just i isUndocdInstance _ = Nothing -- | Print a possibly commented instance. The instance header is printed inside -- an 'argBox'. The comment is printed to the right of the box in normal comment -- style. ppDocInstance :: Bool -> DocInstance DocNameI -> LaTeX -ppDocInstance unicode (instHead, doc, _) = +ppDocInstance unicode (instHead, doc, _, _) = declWithDoc (ppInstDecl unicode instHead) (fmap docToLaTeX $ fmap _doc doc) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 6e733373..d92bdd3a 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -566,8 +566,8 @@ ppInstances links origin instances splice unicode qual where instName = getOccString origin instDecl :: Int -> DocInstance DocNameI -> (SubDecl,Located DocName) - instDecl no (inst, mdoc, loc) = - ((ppInstHead links splice unicode qual mdoc origin False no inst), loc) + instDecl no (inst, mdoc, loc, mdl) = + ((ppInstHead links splice unicode qual mdoc origin False no inst mdl), loc) ppOrphanInstances :: LinksInfo @@ -581,8 +581,8 @@ ppOrphanInstances links instances splice unicode qual instOrigin inst = OriginClass (ihdClsName inst) instDecl :: Int -> DocInstance DocNameI -> (SubDecl,Located DocName) - instDecl no (inst, mdoc, loc) = - ((ppInstHead links splice unicode qual mdoc (instOrigin inst) True no inst), loc) + instDecl no (inst, mdoc, loc, mdl) = + ((ppInstHead links splice unicode qual mdoc (instOrigin inst) True no inst mdl), loc) ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification @@ -591,13 +591,14 @@ ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification -> Bool -- ^ Is instance orphan -> Int -- ^ Normal -> InstHead DocNameI + -> Maybe Module -> SubDecl -ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) = +ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) mdl = case ihdInstType of ClassInst { .. } -> ( subInstHead iid $ ppContextNoLocs clsiCtx unicode qual HideEmptyContexts <+> typ , mdoc - , [subInstDetails iid ats sigs] + , [subInstDetails iid ats sigs mname] ) where sigs = ppInstanceSigs links splice unicode qual clsiSigs @@ -605,7 +606,7 @@ ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) = TypeInst rhs -> ( subInstHead iid ptype , mdoc - , [subFamInstDetails iid prhs] + , [subFamInstDetails iid prhs mname] ) where ptype = keyword "type" <+> typ @@ -614,11 +615,12 @@ ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) = DataInst dd -> ( subInstHead iid pdata , mdoc - , [subFamInstDetails iid pdecl]) + , [subFamInstDetails iid pdecl mname]) where pdata = keyword "data" <+> typ pdecl = pdata <+> ppShortDataDecl False True dd [] unicode qual where + mname = maybe noHtml (\m -> toHtml "Defined in" <+> ppModule m) mdl iid = instanceId origin no orphan ihd typ = ppAppNameTypes ihdClsName ihdTypes unicode qual diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index e020b909..217ca2af 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -47,7 +47,7 @@ import Haddock.Backends.Xhtml.Utils import Haddock.Types import Haddock.Utils (makeAnchorId, nameAnchorId) import qualified Data.Map as Map -import Text.XHtml hiding ( name, title, p, quote ) +import Text.XHtml hiding ( name, title, quote ) import FastString ( unpackFS ) import GHC @@ -228,15 +228,17 @@ subInstHead iid hdr = subInstDetails :: String -- ^ Instance unique id (for anchor generation) -> [Html] -- ^ Associated type contents -> [Html] -- ^ Method contents (pretty-printed signatures) + -> Html -- ^ Source module -> Html -subInstDetails iid ats mets = - subInstSection iid << (subAssociatedTypes ats <+> subMethods mets) +subInstDetails iid ats mets mdl = + subInstSection iid << (p mdl <+> subAssociatedTypes ats <+> subMethods mets) subFamInstDetails :: String -- ^ Instance unique id (for anchor generation) -> Html -- ^ Type or data family instance + -> Html -- ^ Source module TODO: use this -> Html -subFamInstDetails iid fi = - subInstSection iid << thediv ! [theclass "src"] << fi +subFamInstDetails iid fi mdl = + subInstSection iid << (p mdl <+> (thediv ! [theclass "src"] << fi)) subInstSection :: String -- ^ Instance unique id (for anchor generation) -> Html diff --git a/haddock-api/src/Haddock/Interface/AttachInstances.hs b/haddock-api/src/Haddock/Interface/AttachInstances.hs index ec8b98c8..d0ed1698 100644 --- a/haddock-api/src/Haddock/Interface/AttachInstances.hs +++ b/haddock-api/src/Haddock/Interface/AttachInstances.hs @@ -69,7 +69,7 @@ attachInstances expInfo ifaces instIfaceMap = do attachOrphanInstances :: ExportInfo -> Interface -> IfaceMap -> InstIfaceMap -> [ClsInst] -> [DocInstance GhcRn] attachOrphanInstances expInfo iface ifaceMap instIfaceMap cls_instances = - [ (synifyInstHead i, instLookup instDocMap n iface ifaceMap instIfaceMap, (L (getSrcSpan n) n)) + [ (synifyInstHead i, instLookup instDocMap n iface ifaceMap instIfaceMap, (L (getSrcSpan n) n), Nothing) | let is = [ (instanceSig i, getName i) | i <- cls_instances, isOrphan (is_orphan i) ] , (i@(_,_,cls,tys), n) <- sortBy (comparing $ first instHead) is , not $ isInstanceHidden expInfo cls tys @@ -91,7 +91,11 @@ attachToExportItem index expInfo iface ifaceMap instIfaceMap export = let mb_instances = lookupNameEnv index (tcdName d) cls_instances = maybeToList mb_instances >>= fst fam_instances = maybeToList mb_instances >>= snd - fam_insts = [ (synifyFamInst i opaque, doc,spanNameE n (synifyFamInst i opaque) (L eSpan (tcdName d)) ) + fam_insts = [ ( synifyFamInst i opaque + , doc + , spanNameE n (synifyFamInst i opaque) (L eSpan (tcdName d)) + , nameModule_maybe n + ) | i <- sortBy (comparing instFam) fam_instances , let n = getName i , let doc = instLookup instDocMap n iface ifaceMap instIfaceMap @@ -99,14 +103,18 @@ attachToExportItem index expInfo iface ifaceMap instIfaceMap export = , not $ any (isTypeHidden expInfo) (fi_tys i) , let opaque = isTypeHidden expInfo (fi_rhs i) ] - cls_insts = [ (synifyInstHead i, instLookup instDocMap n iface ifaceMap instIfaceMap, spanName n (synifyInstHead i) (L eSpan (tcdName d))) + cls_insts = [ ( synifyInstHead i + , instLookup instDocMap n iface ifaceMap instIfaceMap + , spanName n (synifyInstHead i) (L eSpan (tcdName d)) + , nameModule_maybe n + ) | let is = [ (instanceSig i, getName i) | i <- cls_instances ] , (i@(_,_,cls,tys), n) <- sortBy (comparing $ first instHead) is , not $ isInstanceHidden expInfo cls tys ] -- fam_insts but with failing type fams filtered out - cleanFamInsts = [ (fi, n, L l r) | (Right fi, n, L l (Right r)) <- fam_insts ] - famInstErrs = [ errm | (Left errm, _, _) <- fam_insts ] + cleanFamInsts = [ (fi, n, L l r, m) | (Right fi, n, L l (Right r), m) <- fam_insts ] + famInstErrs = [ errm | (Left errm, _, _, _) <- fam_insts ] in do dfs <- getDynFlags let mkBug = (text "haddock-bug:" <+>) . text diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index df25e6a7..b2d0e1e1 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -627,11 +627,11 @@ renameWc rn_thing (HsWC { hswc_body = thing }) , hswc_wcs = PlaceHolder }) } renameDocInstance :: DocInstance GhcRn -> RnM (DocInstance DocNameI) -renameDocInstance (inst, idoc, L l n) = do +renameDocInstance (inst, idoc, L l n, m) = do inst' <- renameInstHead inst n' <- rename n idoc' <- mapM renameDoc idoc - return (inst', idoc',L l n') + return (inst', idoc', L l n', m) renameExportItem :: ExportItem GhcRn -> RnM (ExportItem DocNameI) renameExportItem item = case item of diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 725606b2..2810862f 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -388,7 +388,7 @@ mkPseudoFamilyDecl (FamilyDecl { .. }) = PseudoFamilyDecl -- | An instance head that may have documentation and a source location. -type DocInstance name = (InstHead name, Maybe (MDoc (IdP name)), Located (IdP name)) +type DocInstance name = (InstHead name, Maybe (MDoc (IdP name)), Located (IdP name), Maybe Module) -- | The head of an instance. Consists of a class name, a list of type -- parameters (which may be annotated with kinds), and an instance type diff --git a/html-test/ref/Bug26.html b/html-test/ref/Bug26.html index 820fde3f..e50169ba 100644 --- a/html-test/ref/Bug26.html +++ b/html-test/ref/Bug26.html @@ -180,7 +180,11 @@ >

      Instance details

      Defined in Bug26

      Methods

      Instance details

      Defined in Bug294

      data
      Instance details

      Defined in Bug294

      data
      Instance details

      Defined in Bug294

      data
      Instance details

      Defined in Bug294

      data
      Instance details

      Defined in Bug294

      data
      Instance details

      Defined in Control.Applicative

      Associated Types

      Instance details

      Defined in Control.Applicative

      Methods

      Instance details

      Defined in Control.Applicative

      Methods

      Instance details

      Defined in Control.Applicative

      Methods

      Instance details

      Defined in Control.Applicative

      Associated Types

      Instance details

      Defined in Control.Applicative

      type
      Instance details

      Defined in Control.Applicative

      type
      Instance details

      Defined in Bug613

      Methods

      Instance details

      Defined in Bug613

      Methods

      Instance details

      Defined in Bug613

      Methods

      Instance details

      Defined in Bug679

      Methods

      Instance details

      Defined in Bug679

      Methods

      Instance details

      Defined in Bug7

      Instance details

      Defined in Bug7

      Instance details

      Defined in Hash

      Methods

      Instance details

      Defined in Hash

      Methods

      Instance details

      Defined in Hash

      Methods

      Instance details

      Defined in HiddenInstances

      Instance details

      Defined in HiddenInstances

      Instance details

      Defined in HiddenInstances

      Methods

      Instance details

      Defined in HiddenInstances

      Instance details

      Defined in HiddenInstancesA

      Instance details

      Defined in HiddenInstancesA

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      Methods

      Instance details

      Defined in Instances

      data
      Instance details

      Defined in Instances

      Associated Types

      Instance details

      Defined in Instances

      Associated Types

      Instance details

      Methods

      Instance details

      Defined in OrphanInstances

      Methods

      Instance details

      Defined in OrphanInstances

      Methods

      Instance details

      Defined in QuasiExpr

      Methods

      Instance details

      Defined in QuasiExpr

      Methods

      Instance details

      Defined in SpuriousSuperclassConstraints

      Methods

      Instance details

      Defined in SpuriousSuperclassConstraints

      Methods

      Instance details

      Defined in Test

      Methods

      Instance details

      Defined in Test

      Methods

      Instance details

      Defined in TypeFamilies

      Instance details

      Defined in TypeFamilies

      Associated Types

      Instance details

      Defined in TypeFamilies

      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      Associated Types

      Instance details

      Defined in TypeFamilies

      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      Instance details

      Defined in TypeFamilies

      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      data
      Instance details

      Defined in TypeFamilies

      Associated Types

      Instance details

      Defined in TypeFamilies

      Associated Types

      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies

      Instance details

      Defined in TypeFamilies2

      data
      Instance details

      Defined in TypeFamilies2

      type
      Instance details

      Defined in TypeFamilies2

      type
      Instance details

      Defined in TypeFamilies

      type
      Instance details

      Defined in TypeFamilies2

      data
      Instance details

      Defined in TypeFamilies

      data Date: Wed, 23 May 2018 02:29:05 -0700 Subject: Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix #834. * Accept html-test output --- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 8 ++-- html-test/ref/Bug26.html | 14 +++---- html-test/ref/Bug613.html | 14 +++---- html-test/ref/Bug647.html | 8 ---- html-test/ref/Bug679.html | 8 ---- html-test/ref/DeprecatedClass.html | 28 +++++-------- html-test/ref/Hash.html | 16 ++++--- html-test/ref/Instances.html | 24 +++++++++++ html-test/ref/Minimal.html | 36 +++++++++++----- html-test/ref/Operators.html | 34 +++++++-------- html-test/ref/OrphanInstancesClass.html | 8 ---- html-test/ref/Test.html | 58 ++++++++++++-------------- html-test/ref/Ticket61.html | 8 ---- 13 files changed, 124 insertions(+), 140 deletions(-) (limited to 'html-test/ref/Bug679.html') diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index d4f6db0e..819c9aa6 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -523,9 +523,9 @@ ppShortClassDecl summary links (ClassDecl { tcdCtxt = lctxt, tcdLName = lname, t -- ToDo: add associated type defaults - [ ppFunSig summary links loc doc names (hsSigWcType typ) + [ ppFunSig summary links loc doc names (hsSigType typ) [] splice unicode pkg qual - | L _ (TypeSig _ lnames typ) <- sigs + | L _ (ClassOpSig _ False lnames typ) <- sigs , let doc = lookupAnySubdoc (head names) subdocs names = map unLoc lnames ] -- FIXME: is taking just the first name ok? Is it possible that @@ -585,12 +585,12 @@ ppClassDecl summary links instances fixities loc d subdocs minimalBit = case [ s | MinimalSig _ _ (L _ s) <- sigs ] of -- Miminal complete definition = every shown method And xs : _ | sort [getName n | L _ (Var (L _ n)) <- xs] == - sort [getName n | TypeSig _ ns _ <- sigs, L _ n <- ns] + sort [getName n | ClassOpSig _ _ ns _ <- sigs, L _ n <- ns] -> noHtml -- Minimal complete definition = the only shown method Var (L _ n) : _ | [getName n] == - [getName n' | L _ (TypeSig _ ns _) <- lsigs, L _ n' <- ns] + [getName n' | L _ (ClassOpSig _ _ ns _) <- lsigs, L _ n' <- ns] -> noHtml -- Minimal complete definition = nothing diff --git a/html-test/ref/Bug26.html b/html-test/ref/Bug26.html index e50169ba..a363fef3 100644 --- a/html-test/ref/Bug26.html +++ b/html-test/ref/Bug26.html @@ -71,7 +71,11 @@ > a where
      • c_f :: a
      • Since: 1.0

        Minimal complete definition

        c_f

        Methods

        f where
        • fmap :: (a -> b) -> f a -> f b
        • #

          Minimal complete definition

          fmap

          Methods

          #

          Minimal complete definition

          f

          Methods

          #

          Minimal complete definition

          foo

          Methods

          a where
          • foo :: a -> a
          • a where
            • bar :: a -> a
            • some class

              Minimal complete definition

              foo

              Methods

              Deprecated: SomeOtherClass

              Minimal complete definition

              bar

              Methods

              a where
              • hash :: a -> Int
              • A class of types which can be hashed.

                Minimal complete definition

                hash

                Methods

                #

                Minimal complete definition

                Nothing

                Methods

                #

                Minimal complete definition

                Nothing

                Methods

                #

                Minimal complete definition

                Nothing

                Methods

                #

                Minimal complete definition

                Nothing

                Associated Types

                #

                Minimal complete definition

                (a, b, c | (d | e, (f | g)))

                Methods

                #

                Minimal complete definition

                aaa, bbb

                Methods

                #

                Minimal complete definition

                Nothing

                Methods

                a ><< b
              • (>><), (<<>) :: a -> b -> ()
              • (**>), (**<), (>**), (<**) :: a -> a -> ()
              • Class with fixity, including associated types

              • Minimal complete definition

                (>><), (<<>), (**>), (**<), (>**), (<**)

                Associated Types

                #

                Minimal complete definition

                aClass

                Methods

                a where
                • a :: IO a
                • b :: [a]
                • a where
                  • d :: T a b
                  • e :: (a, a)
                  • a where
                    • ff :: a
                    • class)

                    • Methods

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

                      Minimal complete definition

                      d, e

                      Methods

                      #

                      Minimal complete definition

                      ff

                      Methods

                      #

                      Minimal complete definition

                      f

                      Methods

                      Bar X = = X
                      Bar y = y = Y type (<>) X XXX <> XX type (<>) * Y a <> (a :: *) #