8bc26d69d3fea0b79dece98f8fd27110266b2720
[ghc.git] / testsuite / tests / indexed-types / should_fail / T4093a.hs
1 {-# LANGUAGE TypeFamilies #-}
2 module T4093a where
3
4 type family Foo x
5 type instance Foo () = Maybe ()
6
7 hang :: (Foo e ~ Maybe e) => Foo e
8 hang = Just ()
9
10
11 {- Ambiguity check
12
13 [G] Foo e ~ Maybe e
14 [W] Foo e ~ Foo e0
15 [W] Foo e0 ~ Maybe e0
16 ---
17 [G] Foo e ~ fsk
18 [G] fsk ~ Maybe e
19
20 [W] Foo e ~ fmv1
21 [W] Foo e0 ~ fmv2
22 [W] fmv1 ~ fmv2
23 [W] fmv2 ~ Maybe e0
24
25 ---> fmv1 := fsk
26 [G] Foo e ~ fsk
27 [G] fsk ~ Maybe e
28
29 [W] Foo e0 ~ fmv2
30 [W] fsk ~ fmv2
31 [W] fmv2 ~ Maybe e0
32
33 --->
34 [G] Foo e ~ fsk
35 [G] fsk ~ Maybe e
36
37 [W] Foo e0 ~ fmv2
38 [W] fmv2 ~ Maybe e
39 [W] fmv2 ~ Maybe e0
40
41 Now the question is whether we get a derived equality e ~ e0. Currently
42 we don't, but we easily could. But then we'd need to be careful not to
43 report insoluble Int ~ Bool if we had
44 F a ~ Int, F a ~ Bool
45 -}