1 --!!! weird class/instance examples off the haskell list
4 class Foo a where foo :: a -> a
5 class Foo a => Bar a where bar :: a -> a
8 instance Num a => Foo [a] where
10 foo (x:xs) = map (x+) xs
13 instance (Eq a, Show a) => Bar [a] where
15 bar (x:xs) = foo xs where u = x==x
18 ------------------------------------------
21 class Foo a => Bar2 a where bar2 :: a -> a
23 instance (Eq a, Show a) => Foo [a]
25 instance Num a => Bar2 [a]