... | ... | @@ -91,7 +91,7 @@ There may be code in the wild that previously depended on the assumption that re |
|
|
### Changes to unused import warnings
|
|
|
|
|
|
|
|
|
GHC 8.8 tightened up the implementation of its unused import warning algorithm to more closely match the specification in [wiki:Commentary/Compiler/UnusedImports](commentary/compiler/unused-imports), as GHC 8.0 inadvertently introduced a [ regression](https://gitlab.haskell.org/ghc/ghc/issues/13064) that caused it to stray from this specification. As a result, some programs which compile without warnings on GHC 8.0 through 8.6 will now produce warnings on GHC 8.8. A good example that illustrates this is this one:
|
|
|
GHC 8.8 tightened up the implementation of its unused import warning algorithm to more closely match the specification in [wiki:Commentary/Compiler/UnusedImports](commentary/compiler/unused-imports), as GHC 8.0 inadvertently introduced a [regression](https://gitlab.haskell.org/ghc/ghc/issues/13064) that caused it to stray from this specification. As a result, some programs which compile without warnings on GHC 8.0 through 8.6 will now produce warnings on GHC 8.8. A good example that illustrates this is this one:
|
|
|
|
|
|
```
|
|
|
{-# OPTIONS_GHC -Wunused-imports #-}moduleT13064whereimportControl.ApplicativeimportPrelude(IO,pure)-- Import of 'pure' is redundantfoo::IO()foo=()<$ pure ()
|
... | ... | @@ -125,7 +125,7 @@ Alternatively, one can use `pure` qualified to avoid GHC warning about it: |
|
|
### Additions to the `-Wcompat` warning group
|
|
|
|
|
|
|
|
|
As part of [ this GHC proposal](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0030-remove-star-kind.rst), the uses of `*` that rely on the `StarIsType` extension now produce a warning:
|
|
|
As part of [this GHC proposal](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0030-remove-star-kind.rst), the uses of `*` that rely on the `StarIsType` extension now produce a warning:
|
|
|
|
|
|
```wiki
|
|
|
Prelude> type M = (Maybe :: * -> *)
|
... | ... | @@ -255,7 +255,7 @@ This will no longer typecheck on GHC 8.8. Two possible ways of fixing this are: |
|
|
### `template-haskell-2.15.0.0`
|
|
|
|
|
|
|
|
|
The Template Haskell AST has changed to accommodate the [ Visible kind application](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0015-type-level-type-applications.rst) and [ More explicit foralls](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0007-instance-foralls.rst) proposals, both of which debut in GHC 8.8. At a glance, the breaking API changes are as follows:
|
|
|
The Template Haskell AST has changed to accommodate the [Visible kind application](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0015-type-level-type-applications.rst) and [More explicit foralls](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0007-instance-foralls.rst) proposals, both of which debut in GHC 8.8. At a glance, the breaking API changes are as follows:
|
|
|
|
|
|
```
|
|
|
data Dec
|
... | ... | @@ -288,8 +288,8 @@ The Template Haskell AST has changed to accommodate the [ Visible kind applicati |
|
|
|
|
|
Here are the reasons why each of these had to change, and how one can accommodate these changes:
|
|
|
|
|
|
- `DataInstD`, `NewtypeInstD`, and `TySynEqn` each gained a field of type type `Maybe [TyVarBndr]` to support the [ More explicit foralls](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0007-instance-foralls.rst) proposal, which allows writing type family instances and `RULES` with explicit `forall`s (binding type variables) at the front. (If you don't care about this feature, it's perfectly fine to use `Nothing` here, since that omits the `forall` entirely.)
|
|
|
- Because of the [ Visible kind application](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0015-type-level-type-applications.rst) proposal, type family instances can feature richer arguments than before. For example, this is an example of a type family one can write using visible kind applications:
|
|
|
- `DataInstD`, `NewtypeInstD`, and `TySynEqn` each gained a field of type type `Maybe [TyVarBndr]` to support the [More explicit foralls](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0007-instance-foralls.rst) proposal, which allows writing type family instances and `RULES` with explicit `forall`s (binding type variables) at the front. (If you don't care about this feature, it's perfectly fine to use `Nothing` here, since that omits the `forall` entirely.)
|
|
|
- Because of the [Visible kind application](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0015-type-level-type-applications.rst) proposal, type family instances can feature richer arguments than before. For example, this is an example of a type family one can write using visible kind applications:
|
|
|
|
|
|
```
|
|
|
typefamilyFoo(a :: k):: k whereFoo@Bool a = a
|
... | ... | |