summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T13651a.hs
blob: f08407b7385af1d90b1025a32e63a81b51f6d3c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies, TypeFamilyDependencies #-}
module T13651 where

type family F r s = f | f -> r s

type instance F (Bar h (Foo r)) (Bar h (Foo s)) = Bar h (Bar r s)

data Bar s b
data Foo a

foo :: (F cr cu ~ Bar h (Bar r u),
        F cu cs ~ Bar (Foo h) (Bar u s))
    => Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> cu -> Foo (cr -> cs)
    -- A variant of T13651 which fixes 'cu'
    -- as well as the other type args
foo = undefined