[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / typecheck / should_succeed / tc043.hs
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc043.hs b/ghc/compiler/tests/typecheck/should_succeed/tc043.hs
new file mode 100644 (file)
index 0000000..727f288
--- /dev/null
@@ -0,0 +1,18 @@
+module ShouldSucceed where
+
+--!!! another simple test of class and instance code.
+
+class A a where
+ op1 :: a
+
+instance A Int where
+ op1 = 2
+
+f x = op1
+
+class B b where
+ op2 :: b -> Int
+
+instance (B a) => B [a] where
+ op2 [] = 0
+ op2 (x:xs) = 1 + op2 xs