[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / typecheck / should_fail / tcfail042.hs
1 module ShouldFail where
2
3 -- !!! weird class/instance examples off the haskell list
4 --
5
6 class Foo a          where foo :: a -> a
7 class Foo a => Bar a where bar :: a -> a
8
9
10 instance Num a => Foo [a] where
11     foo []     = []
12     foo (x:xs) = map (x+) xs
13
14
15 instance (Eq a, Show a) => Bar [a] where
16     bar []     = []
17     bar (x:xs) = foo xs where u = x==x
18                               v = show x
19
20 ------------------------------------------
21
22 {-
23 class Foo a => Bar2 a where bar2 :: a -> a
24
25 instance (Eq a, Show a) => Foo [a]
26
27 instance Num a => Bar2 [a]
28
29 data X a = X a
30 -}