diff options
author | David Terei <davidterei@gmail.com> | 2011-07-12 13:43:08 -0700 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-07-12 13:43:08 -0700 |
commit | 948c82d8f1f1698f12daf2c4f762abdb67c6804e (patch) | |
tree | 717010f3a5c8fe360f98b26970054e1d59a82f63 /testsuite/tests | |
parent | f4ce3b248794f6ffd1cb83db6d55929da993a0a3 (diff) | |
download | haskell-948c82d8f1f1698f12daf2c4f762abdb67c6804e.tar.gz |
More THREAD fixes to safe haskell tests
Diffstat (limited to 'testsuite/tests')
4 files changed, 29 insertions, 8 deletions
diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs index 07aad17f94..d092ae7a1a 100644 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs +++ b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs @@ -17,7 +17,7 @@ newMinList n = MinList n [] insertMinList :: Ord a => MinList a -> a -> MinList a insertMinList s@(MinList m xs) n | n > m = MinList m (n:xs) - | otherwise = s + | otherwise = s printIntMinList :: MinList Int -> IO () printIntMinList (MinList min xs) = putStrLn $ "MinList Int :: MinList " ++ show min ++ " " ++ show xs diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs index 77213820ca..006cd0ea08 100644 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs +++ b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs @@ -12,7 +12,7 @@ -- API of Y1. module Main where -import SafeLang06_A +import SafeLang07_A class IntIso t where intIso :: c t -> c Int @@ -39,4 +39,3 @@ main = do printIntMinList a1 printIntMinList a2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr index b1e25262af..1218b29a6d 100644 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr +++ b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr @@ -2,8 +2,6 @@ <no location info>: Warning: -XGeneralizedNewtypeDeriving is not allowed in Safe Haskell; ignoring -XGeneralizedNewtypeDeriving -SafeLang07.hs:23:45: - Can't make a derived instance of `IntIso (Down a)': - `IntIso' is not a derivable class - Try -XGeneralizedNewtypeDeriving for GHC's newtype-deriving extension - In the newtype declaration for `Down' +SafeLang07.hs:15:1: + Failed to load interface for `SafeLang07_A' + Use -v to see a list of the files searched for. diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07_A.hs new file mode 100644 index 0000000000..6ef49d5946 --- /dev/null +++ b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07_A.hs @@ -0,0 +1,24 @@ +{-# LANGUAGE Trustworthy #-} + +-- | Here we expose a MinList API that only allows elements +-- to be inserted into a list if they are at least greater +-- than an initial element the list is created with. +module SafeLang07_A ( + MinList, + newMinList, + insertMinList, + printIntMinList + ) where + +data MinList a = MinList a [a] + +newMinList :: Ord a => a -> MinList a +newMinList n = MinList n [] + +insertMinList :: Ord a => MinList a -> a -> MinList a +insertMinList s@(MinList m xs) n | n > m = MinList m (n:xs) + | otherwise = s + +printIntMinList :: MinList Int -> IO () +printIntMinList (MinList min xs) = putStrLn $ "MinList Int :: MinList " ++ show min ++ " " ++ show xs + |