summaryrefslogtreecommitdiff
path: root/ghc/compiler/tests/typecheck/should_succeed/tc057.hs
diff options
context:
space:
mode:
authorpartain <unknown>1996-01-08 20:28:12 +0000
committerpartain <unknown>1996-01-08 20:28:12 +0000
commite7d21ee4f8ac907665a7e170c71d59e13a01da09 (patch)
tree93715bf4e6e4bbe8049e4d8d4d3fbd19158a88d6 /ghc/compiler/tests/typecheck/should_succeed/tc057.hs
parente48474bff05e6cfb506660420f025f694c870d38 (diff)
downloadhaskell-e7d21ee4f8ac907665a7e170c71d59e13a01da09.tar.gz
[project @ 1996-01-08 20:28:12 by partain]
Initial revision
Diffstat (limited to 'ghc/compiler/tests/typecheck/should_succeed/tc057.hs')
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc057.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc057.hs b/ghc/compiler/tests/typecheck/should_succeed/tc057.hs
new file mode 100644
index 0000000000..cc561b95b8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc057.hs
@@ -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])