| 1 | {-# LANGUAGE NoImplicitPrelude #-} |
| 2 | |
| 3 | class Container c where |
| 4 | type Element c |
| 5 | type instance Element c = c |
| 6 | |
| 7 | type family Elem c |
| 8 | |
| 9 | type instance Elem [c] = c |
| 10 | |
| 11 | type family F (c :: * -> *) :: * |
| 12 | |
| 13 | type instance F [] = [Int] |
| 14 | |
| 15 | instance Container [a] where |
| 16 | type Element [a] = a |
| 17 | |
| 18 | class Asdf a b where |
| 19 | type Foo a x |
| 20 | type Foo y z = y |
| 21 | |
| 22 | instance Asdf [y] z where |
| 23 | type Foo [y] b = Int |
| 24 | |
| 25 | instance Asdf Int z |
| 26 | -- We should get Foo Int x = Int |
| 27 | |
| 28 | type family Closed a where |
| 29 | Closed Int = Int |
| 30 | Closed Double = Char |
| 31 | |
| 32 | |
| 33 | type G :: (Type -> Type) -> Type |
| 34 | type family G c |
| 35 | |
| 36 | type instance G [] = [Int] |
| 37 | type instance G ((,) a) = (a,a) |
| 38 |