[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / typecheck / should_succeed / tc057.hs
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc057.hs b/ghc/compiler/tests/typecheck/should_succeed/tc057.hs
new file mode 100644 (file)
index 0000000..cc561b9
--- /dev/null
@@ -0,0 +1,18 @@
+module ShouldSucceed where
+
+-- See also tcfail060.hs
+
+class Eq' a where
+ deq :: a -> a -> Bool
+
+instance Eq' Int where
+  deq x y = True
+
+instance (Eq' a) => Eq' [a] where
+   deq (a:as) (b:bs) = dand (f a b) (f as bs)
+
+dand True True = True
+dand x y = False
+
+f :: Eq' a => a -> a -> Bool
+f p q = dand (deq p q) (deq [1::Int] [2::Int])