... | ... | @@ -149,10 +149,31 @@ type UnliftedRep = 'BoxedRep 'Unlifted |
|
|
|
|
|
### `GHC2021`
|
|
|
|
|
|
When GHC or GHCi is invoked, it will now enable the language extensions included as a part of `GHC2021`. See [here](https://github.com/ghc-proposals/ghc-proposals/blob/f0b86694de131a89a26e12253d922fba186654f2/proposals/0380-ghc2021.rst#id2) for the full list of language extensions. If your project no longer compiles with `GHC2021`, you can disable the appropriate language extensions as needed (e.g., use `{-# LANGUAGE NoPolyKinds #-}` to disable `PolyKinds`).
|
|
|
When GHC or GHCi is invoked, it will now enable the language extensions included as a part of `GHC2021`. See [here](https://github.com/ghc-proposals/ghc-proposals/blob/f0b86694de131a89a26e12253d922fba186654f2/proposals/0380-ghc2021.rst#id2) for the full list of language extensions. If your project no longer compiles with `GHC2021`, you can disable the appropriate language extensions as needed.
|
|
|
|
|
|
Note that this is unlikely to affect projects with `.cabal` files, as they typically use the `Haskell98` or `Haskell2010` sets of language extensions.
|
|
|
|
|
|
#### PolyKinds
|
|
|
|
|
|
One source of breakages is that `-XPolyKinds` is now enabled by default, as it is included in `GHC2021`. This means that GHC will introduce kind variables instead of defaulting them to `Type`. For example, in
|
|
|
|
|
|
```hs
|
|
|
data D a = MkD
|
|
|
```
|
|
|
|
|
|
without `-XPolyKinds` we infer `D :: Type -> Type`, but with `-XPolyKinds` we infer `D :: forall (k :: Type). k -> Type`. This can cause further problems, e.g. no longer being able to solve an instance for `D a`. You can fix this by disabling `-XPolyKinds` (e.g., use `{-# LANGUAGE NoPolyKinds #-}`), but a more forward-looking solution is to add a kind signature to specify the intended kinds. For example, you can use a [standalone kind signature](https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/poly_kinds.html?highlight=standalonekindsignatures#extension-StandaloneKindSignatures):
|
|
|
|
|
|
```hs
|
|
|
type D :: Type -> Type
|
|
|
data D a = MkD
|
|
|
```
|
|
|
|
|
|
or simply directly annotate the type variable with the intended kind:
|
|
|
|
|
|
```hs
|
|
|
data D (a :: Type) = MkD
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
## Library changes
|
... | ... | |