Commit 090f8411 authored by sof's avatar sof

[project @ 1999-03-10 14:10:47 by sof]

Some Haskell98-related regression tests
parent 7b6156ba
read014.hs:2: Warning: definition but no type signature for `ng1'
read014.hs:4: Warning: Defined but not used: x
read014.hs:8: Warning: Defined but not used: x
read014.hs:8:
Warning: No explicit method nor default method for `fromInteger'
in an instance declaration for `Num'
......@@ -24,5 +24,3 @@ read014.hs:8:
read014.hs:8:
Warning: No explicit method nor default method for `+'
in an instance declaration for `Num'
-- !!! Checking that both import lists and 'hiding' lists might
-- !!! be empty.
module ShouldSucceed where
import List ()
import List hiding ()
x :: Int
x = 1
-- !!! Checking that empty declarations are permitted.
module ShouldSucceed where
class Foo a where
class Foz a
x = 2 where
y = 3
instance Foo Int where
-- !!! Checking that empty contexts are permitted.
module ShouldSucceed where
data () => Foo a = Foo a
newtype () => Bar = Bar Int
f :: () => Int -> Int
f = (+1)
class () => Fob a where
instance () => Fob Int where
instance () => Fob Float
-- !!! Checking what's legal in the body of a class declaration.
module ShouldSucceed where
class Foo a where {
(--<>--) :: a -> a -> Int ;
infixl 5 --<>-- ;
(--<>--) _ _ = 2 ; -- empty decl at the end.
};
-- !!! Checking that qualified method names are legal in instance body.
module ShouldSucceed where
import Prelude hiding (Eq, (==))
import Prelude as P (Eq,(==))
data Foo = Foo Int Integer
instance P.Eq Foo where
(Foo a1 b1) P.== (Foo a2 b2) = a1 P.== a2 && b1 P.== b2
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