Add HsSyn prettyprinter tests
[ghc.git] / testsuite / tests / typecheck / should_fail / tcfail096.hs
1 {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
2 FlexibleInstances #-}
3 module ShouldFail where
4
5 class Foo f a r | f a -> r where
6 foo::f->a->r
7
8 -- These instances are incompatible because we can unify
9 -- the first two parameters, though it's rather obscure:
10 -- p -> (a,b)
11 -- t -> (,) (a,a)
12 -- c -> (,) a
13 -- r -> s
14 --
15 -- So a constraint which would sow this up is
16 -- Foo ((Int,Int)->Int)
17 -- ((Int,Int), (Int,Int))
18 -- t
19 -- This matches both. Not easy to spot, and the error
20 -- message would be improved by giving the unifier, or
21 -- a witness.
22
23 instance Foo (p->s) (t p) (t s)
24 instance Foo ((a,b)->r) (c a,c b)(c r)
25