... | ... | @@ -230,6 +230,23 @@ This is because under `NoPolyKinds`, GHC 9.2 will now always default any argumen |
|
|
```
|
|
|
2. Enable `PolyKinds` rather than `NoPolyKinds`, which prevents the `Type` defaulting from occurring.
|
|
|
|
|
|
#### Polymorphic recursion
|
|
|
|
|
|
Another impact of the `GHC2021` extension set is that it enables `-XStandaloneKindSignatures` which disables `-XCUSKs`. This means that data declarations that rely on polymorphic recursion will need an standalone kind signature to typecheck. For example:
|
|
|
|
|
|
```haskell
|
|
|
data P (f :: k) = MkP (P Int) (P Maybe)
|
|
|
```
|
|
|
|
|
|
In the definition of `MkP`, we are using `P` at two different kinds, namely `Type` and `Type -> Type`. This is accepted with `-XCUSKs`, but for this same program to be accepted with `-XNoCUSKS` we require a standalone kind signature:
|
|
|
|
|
|
```haskell
|
|
|
data P :: k -> Type
|
|
|
data P f = MkP (P Int) (P Maybe)
|
|
|
```
|
|
|
|
|
|
Refer to the section of the user's guide on [standalone kind signatures and polymorphic recursion](https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/poly_kinds.html#standalone-kind-signatures-and-polymorphic-recursion) for more information.
|
|
|
|
|
|
### Improved Pattern-Match Coverage checker
|
|
|
|
|
|
GHC 9.2 has a more accurate pattern-match coverage checker, continuing work that was started in 9.0. As a consequence, GHC 9.2 may produce coverage-checking warnings that earlier versions did not. Some examples include:
|
... | ... | |