[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / typecheck / should_succeed / tc059.hs
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc059.hs b/ghc/compiler/tests/typecheck/should_succeed/tc059.hs
new file mode 100644 (file)
index 0000000..f0faac8
--- /dev/null
@@ -0,0 +1,15 @@
+module ShouldSucceed where
+
+class Eq2 a where
+ deq :: a -> a -> Bool
+ foo :: a -> a
+
+instance Eq2 Int where
+ deq x y = True
+ foo x = x
+
+instance (Eq2 a) => Eq2 [a] where
+ deq (a:as) (b:bs) = if (deq a (foo b)) then (deq as (foo bs)) else False
+ foo x = x
+
+f x = deq x [1]