Partially applied type family allowed but unusable
I was playing around with the following code, which tries to map a type family over a type (something I thought would not be allowed):
```hs
{-# LANGUAGE
TypeFamilies
, KindSignatures
#-}
type family Id x :: *
type instance Id a = a
type family Map (f :: * -> *) x :: *
type instance Map f [a] = [f a]
x :: Map Id [Bool]
x = []
```
Both GHC 7.8.3 and the current HEAD (7.9.20140811) accept this program! However, changing the definition of `x` to `[True]` gives an error:
```
Couldn't match type ‘Id Bool’ with ‘Bool’
Expected type: Map Id [Bool]
Actual type: [Bool]
In the expression: [True]
In an equation for ‘x’: x = [True]
```
If I define `y :: Id Bool` with value `True` (which works fine) and define `x = [y]`, I even get this error:
```
Couldn't match type ‘Bool’ with ‘Id Bool’
Expected type: Id Bool
Actual type: Id Bool
In the expression: y
In the expression: [y]
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 7.9 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Partially applied type family allowed but unusable","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I was playing around with the following code, which tries to map a type family over a type (something I thought would not be allowed):\r\n\r\n{{{#!hs\r\n{-# LANGUAGE\r\n TypeFamilies\r\n , KindSignatures\r\n #-}\r\n\r\ntype family Id x :: *\r\ntype instance Id a = a\r\n\r\ntype family Map (f :: * -> *) x :: *\r\ntype instance Map f [a] = [f a]\r\n\r\nx :: Map Id [Bool]\r\nx = []\r\n}}}\r\n\r\nBoth GHC 7.8.3 and the current HEAD (7.9.20140811) accept this program! However, changing the definition of `x` to `[True]` gives an error:\r\n\r\n{{{\r\n Couldn't match type ‘Id Bool’ with ‘Bool’\r\n Expected type: Map Id [Bool]\r\n Actual type: [Bool]\r\n In the expression: [True]\r\n In an equation for ‘x’: x = [True]\r\n}}}\r\n\r\nIf I define `y :: Id Bool` with value `True` (which works fine) and define `x = [y]`, I even get this error:\r\n\r\n{{{\r\n Couldn't match type ‘Bool’ with ‘Id Bool’\r\n Expected type: Id Bool\r\n Actual type: Id Bool\r\n In the expression: y\r\n In the expression: [y]\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->
issue