Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / typecheck / should_compile / T13651.hs
1 {-# LANGUAGE TypeFamilies, TypeFamilyDependencies #-}
2 module T13651 where
3
4 type family F r s = f | f -> r s
5
6 type instance F (Bar h (Foo r)) (Bar h (Foo s)) = Bar h (Bar r s)
7
8 data Bar s b
9 data Foo a
10
11 foo :: (F cr cu ~ Bar h (Bar r u),
12 F cu cs ~ Bar (Foo h) (Bar u s))
13 => Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs)
14 foo = undefined
15
16 {- Typechecking this program used to /just/ succeed in GHC 8.2,
17 (see #14745 for why), but doesn't in 8.4.
18
19 [G] F cr cu ~ Bar h (Bar r u),
20 F cu cs ~ Bar (Foo h) (Bar u s))
21
22
23 [W] F cr cu0 ~ Bar h (Bar r u)
24 --> (top-level fundeps) cr ~ Bar h (Foo r)
25 cu0 ~ Bar h (Foo u)
26 (local fundeps) cu ~ cu0
27
28 [W] F cu0 cs ~ Bar (Foo h) (Bar u s)
29 --> (top-level fundeps) cu0 ~ Bar (Foo h) (Foo u)
30 cs ~ Bar (Foo h) (Foo s)
31 (local fundeps) cu0 ~ cu
32
33 [W] F cr (Bar (Foo h) (Fo u)) ~ Bar h (Bar r u)
34
35 -}