... | ... | @@ -121,6 +121,22 @@ To fix this issue, one must give `ST` a complete, user-specified kind signature |
|
|
+data ST (a :: Type) :: T a -> Type where
|
|
|
```
|
|
|
|
|
|
### GHC is pickier about impredicative uses of constraints
|
|
|
|
|
|
Now that issue #11514 has been fixed, GHC is more stringent about impredicative uses of constraints. For example, the following program would be accepted on older versions of GHC, but not with GHC 8.10 or later:
|
|
|
|
|
|
```hs
|
|
|
foo :: forall a. (Show a => a -> a) -> ()
|
|
|
foo = undefined
|
|
|
```
|
|
|
|
|
|
`foo` is impredicative since it attempts to instantiate `undefined` at type `(Show a => a -> a) -> ()`. This can be fixed by simply adding the necessary wildcard patterns, like so:
|
|
|
|
|
|
```hs
|
|
|
foo :: forall a. (Show a => a -> a) -> ()
|
|
|
foo _ = undefined
|
|
|
```
|
|
|
|
|
|
### New RecordWildCards warnings
|
|
|
|
|
|
GHC 8.10 introduces two new flags, `-Wunused-record-wildcards` and `-Wredundant-record-wildcards`, which are implied by `-Wall`. This means that certain programs that use `RecordWildCards` will trigger warnings that did not do so previously. For instance, the following program emits no warnings on old versions of GHC, but will warn with GHC 8.10:
|
... | ... | |