Commit 948c82d8 authored by dterei's avatar dterei
Browse files

More THREAD fixes to safe haskell tests

parent f4ce3b24
......@@ -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
......@@ -2,8 +2,6 @@
<no location info>:
Warning: -XGeneralizedNewtypeDeriving is not allowed in Safe Haskell; ignoring -XGeneralizedNewtypeDeriving
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'
Failed to load interface for `SafeLang07_A'
Use -v to see a list of the files searched for.
{-# 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 (
) 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment