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