1 {-# OPTIONS -fglasgow-exts #-}
3 -- !!! Functional dependencies
7 class Foo a b | a -> b where
10 instance Foo [a] (Maybe a) where
14 instance Foo (Maybe a) [a] where
20 -- First foo must use the first instance,
21 -- second must use the second. So we should
22 -- get in effect: test3 (x:xs) = [x]
25 main = print (test3 "foo" :: [Int])