... | ... | @@ -11,7 +11,7 @@ This guide summarises the changes you may need to make to your code to migrate f |
|
|
|
|
|
|
|
|
Note that the `-XImpredicativeTypes` extension, which has been
|
|
|
[known](impredicative-polymorphism) to be broken for many years. It has now at long last been removed. **RGS**: is this really true?
|
|
|
[known](impredicative-polymorphism) to be broken for many years. It has now at long last been removed. TODO**RGS**: is this really true?
|
|
|
|
|
|
### `DefaultSignatures` is pickier
|
|
|
|
... | ... | @@ -99,6 +99,28 @@ To fix this instance, simply use the same type variables in the `Bar` instance a |
|
|
instanceFoo(Either a b)wheretypeBar(Either a b)= b -> a
|
|
|
```
|
|
|
|
|
|
### Instances for class synonyms are now disallowed
|
|
|
|
|
|
|
|
|
Previously, GHC silently accepted nonsense instance declarations like this:
|
|
|
|
|
|
```
|
|
|
typeReadShow a =(Read a,Show a)instanceReadFooinstanceShowFooinstanceReadShowFoo
|
|
|
```
|
|
|
|
|
|
|
|
|
It's not even clear what this is supposed to mean, since `ReadShow` isn't a class in and of itself. To disallow this, GHC now prevents all instances of the form `instance (...) => Syn (...)`, where `Syn` is a type synonym.
|
|
|
|
|
|
|
|
|
This check is a bit conservative, as it bars you from writing this as well:
|
|
|
|
|
|
```
|
|
|
typeMyShow=ShowinstanceMyShowFoo
|
|
|
```
|
|
|
|
|
|
|
|
|
The workaround is to define the instance using `Show` instead of `MyShow`.
|
|
|
|
|
|
---
|
|
|
|
|
|
## Library changes
|
... | ... | |