From c19deeb7a4a8e5d369934bba9a829dedbc502a4c Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Tue, 23 Aug 2011 13:48:16 +0100 Subject: Wibbles to accommodate TH changes (Trac #4429, #5406) --- .../haddock/haddock_examples/haddock.Test.stderr | 330 +++++++++++---------- testsuite/tests/th/T1835.hs | 18 +- 2 files changed, 175 insertions(+), 173 deletions(-) diff --git a/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr b/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr index 4c8c718d70..48cae1cf83 100644 --- a/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr +++ b/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr @@ -1,164 +1,166 @@ -[1 of 3] Compiling Visible ( Visible.hs, Visible.o ) - -==================== Parser ==================== -module Visible where -visible :: Int -> Int -visible a = a - - -[2 of 3] Compiling Hidden ( Hidden.hs, Hidden.o ) - -==================== Parser ==================== -module Hidden where -hidden :: Int -> Int -hidden a = a - - -[3 of 3] Compiling Test ( Test.hs, Test.o ) - -==================== Parser ==================== - -module Test ( - , , T(..), T2, T3(..), T4(..), T5(..), - T6(..), N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), - , R(..), R1(..), , p, q, u, - , C(a, b), D(..), E, F(..), , a, - , f, g, , , - , , , - , , , - , , , - , , , - , module Hidden, , module Visible, - , , Ex(..), , k, l, m, o, - , , , f' - ) where -import Hidden -import Visible - -data T a b - = A Int Maybe Float | - B (T a b, T Int Float) - -data T2 a b = T2 a b - -data T3 a b = A1 a | B1 b -data T4 a b = A2 a | B2 b -data T5 a b = A3 a | B3 b - -data T6 - = A4 | - B4 | - C4 - -newtype N1 a = N1 a - -newtype N2 a b = N2 {n :: a b} - -newtype N3 a b = N3 {n3 :: a b } - -newtype N4 a b = N4 a -newtype N5 a b = N5 {n5 :: a b } -newtype N6 a b = N6 {n6 :: a b} - -newtype N7 a b = N7 {n7 :: a b} -class D a => C a where - { a :: IO a - b :: [a] - c :: a } - -class D a where - { d :: T a b - e :: (a, a) } - -instance D Int where - { d = undefined - e = undefined } -instance Test.D Float where - { d = undefined - e = undefined } -class E a where { ee :: a } - -class F a where { ff :: a } - -data R - = - C1 {p :: Int , - q :: forall a. a -> a , - r :: Int , - s :: Int } | - - C2 {t :: T1 - -> (T2 Int Int) -> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), - u :: Int, - v :: Int} - -data R1 - = - C3 {s1 :: Int , - s2 :: Int , - s3 :: Int } - - - - -f :: C a => a -> Int - -foreign import ccall safe "static header.h g" g :: Int -> IO CInt - -h :: Int -h = 42 - - - - - - - - - - - - - -data Ex a - = forall b. C b => Ex1 b | - forall b. Ex2 b | - forall b. C a => Ex3 b | - Ex4 forall a. a -> a - -k :: - T () () - -> (T2 Int Int) - -> (T3 Bool Bool -> T4 Float Float) - -> T5 () () -> IO () -l :: (Int, Int, Float) -> Int - -m :: R -> N1 () -> IO Int - -newn :: R -> N1 () -> IO Int -newn = undefined - -foreign import ccall unsafe "static header.h o" o - :: Float -> IO Float - -newp :: Int -newp = undefined - -f' :: Int -data T1 = -f = undefined -f' = undefined -type CInt = Int -k = undefined -l = undefined -m = undefined - - - -Test.hs:32:9: Warning: `p' is exported by `p' and `R(..)' - -Test.hs:32:12: Warning: `q' is exported by `q' and `R(..)' - -Test.hs:32:15: Warning: `u' is exported by `u' and `R(..)' - -Test.hs:38:9: Warning: `a' is exported by `a' and `C(a, b)' +[1 of 3] Compiling Visible ( Visible.hs, Visible.o ) + +==================== Parser ==================== +module Visible where +visible :: Int -> Int +visible a = a + + +[2 of 3] Compiling Hidden ( Hidden.hs, Hidden.o ) + +==================== Parser ==================== +module Hidden where +hidden :: Int -> Int +hidden a = a + + +[3 of 3] Compiling Test ( Test.hs, Test.o ) + +==================== Parser ==================== + +module Test ( + , , T(..), T2, T3(..), T4(..), T5(..), + T6(..), N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), + , R(..), R1(..), , p, q, u, + , C(a, b), D(..), E, F(..), , a, + , f, g, , , + , , , + , , , + , , , + , , , + , module Hidden, , module Visible, + , , Ex(..), , k, l, m, o, + , , , f' + ) where +import Hidden +import Visible + +data T a b + = A Int Maybe Float | + B (T a b, T Int Float) + +data T2 a b = T2 a b + +data T3 a b = A1 a | B1 b +data T4 a b = A2 a | B2 b +data T5 a b = A3 a | B3 b + +data T6 + = A4 | + B4 | + C4 + +newtype N1 a = N1 a + +newtype N2 a b = N2 {n :: a b} + +newtype N3 a b = N3 {n3 :: a b } + +newtype N4 a b = N4 a +newtype N5 a b = N5 {n5 :: a b } +newtype N6 a b = N6 {n6 :: a b} + +newtype N7 a b = N7 {n7 :: a b} +class D a => C a where + a :: IO a + b :: [a] + c :: a + +class D a where + d :: T a b + e :: (a, a) + +instance D Int where + d = undefined + e = undefined +instance Test.D Float where + d = undefined + e = undefined +class E a where + ee :: a + +class F a where + ff :: a + +data R + = + C1 {p :: Int , + q :: forall a. a -> a , + r :: Int , + s :: Int } | + + C2 {t :: T1 + -> (T2 Int Int) -> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), + u :: Int, + v :: Int} + +data R1 + = + C3 {s1 :: Int , + s2 :: Int , + s3 :: Int } + + + + +f :: C a => a -> Int + +foreign import ccall safe "static header.h g" g :: Int -> IO CInt + +h :: Int +h = 42 + + + + + + + + + + + + + +data Ex a + = forall b. C b => Ex1 b | + forall b. Ex2 b | + forall b. C a => Ex3 b | + Ex4 forall a. a -> a + +k :: + T () () + -> (T2 Int Int) + -> (T3 Bool Bool -> T4 Float Float) + -> T5 () () -> IO () +l :: (Int, Int, Float) -> Int + +m :: R -> N1 () -> IO Int + +newn :: R -> N1 () -> IO Int +newn = undefined + +foreign import ccall unsafe "static header.h o" o + :: Float -> IO Float + +newp :: Int +newp = undefined + +f' :: Int +data T1 = +f = undefined +f' = undefined +type CInt = Int +k = undefined +l = undefined +m = undefined + + + +Test.hs:32:9: Warning: `p' is exported by `p' and `R(..)' + +Test.hs:32:12: Warning: `q' is exported by `q' and `R(..)' + +Test.hs:32:15: Warning: `u' is exported by `u' and `R(..)' + +Test.hs:38:9: Warning: `a' is exported by `a' and `C(a, b)' diff --git a/testsuite/tests/th/T1835.hs b/testsuite/tests/th/T1835.hs index 296bf907ab..e9bda365fc 100644 --- a/testsuite/tests/th/T1835.hs +++ b/testsuite/tests/th/T1835.hs @@ -26,12 +26,12 @@ instance MyClass2 Int Bool main = do putStrLn $(do { info <- reify ''MyClass; lift (pprint info) }) - print $(isClassInstance ''Eq [ConT ''Foo] >>= lift) - print $(isClassInstance ''MyClass [ConT ''Foo] >>= lift) - print $ not $(isClassInstance ''Show [ConT ''Foo] >>= lift) - print $(isClassInstance ''MyClass [ConT ''Bar] >>= lift) -- this one - print $(isClassInstance ''MyClass [ConT ''Baz] >>= lift) - print $(isClassInstance ''MyClass [AppT (ConT ''Quux) (ConT ''Int)] >>= lift) --this one - print $(isClassInstance ''MyClass [AppT (ConT ''Quux2) (ConT ''Int)] >>= lift) -- this one - print $(isClassInstance ''MyClass2 [ConT ''Int, ConT ''Bool] >>= lift) - print $(isClassInstance ''MyClass2 [ConT ''Bool, ConT ''Bool] >>= lift) + print $(isInstance ''Eq [ConT ''Foo] >>= lift) + print $(isInstance ''MyClass [ConT ''Foo] >>= lift) + print $ not $(isInstance ''Show [ConT ''Foo] >>= lift) + print $(isInstance ''MyClass [ConT ''Bar] >>= lift) -- this one + print $(isInstance ''MyClass [ConT ''Baz] >>= lift) + print $(isInstance ''MyClass [AppT (ConT ''Quux) (ConT ''Int)] >>= lift) --this one + print $(isInstance ''MyClass [AppT (ConT ''Quux2) (ConT ''Int)] >>= lift) -- this one + print $(isInstance ''MyClass2 [ConT ''Int, ConT ''Bool] >>= lift) + print $(isInstance ''MyClass2 [ConT ''Bool, ConT ''Bool] >>= lift) -- cgit v1.2.1