summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/typecheck/should_compile/GivenOverlapping.hs
blob: 35f4b0796290c5e6c5b117f5721c8b9872d869b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE FunctionalDependencies, FlexibleContexts #-}

class C a where 

class D a where 
 dop :: a -> a    

instance C a => D [a] where 
 dop = undefined

class J a b | a -> b 
 where j :: a -> b -> () 

instance J Bool Int where 
 j = undefined
   
foo :: D [Int] => ()
foo = j True (head (dop [undefined]))

main = return ()