|
|
[[_TOC_]]
|
|
|
|
|
|
# GHC 8.4.x Migration Guide
|
|
|
|
|
|
|
... | ... | @@ -55,7 +57,7 @@ Similarly, this now requires `TypeInType` in GHC 8.4. |
|
|
|
|
|
Before GHC 8.4, whether or not Template Haskell would reify a data type as a `GadtC` (or `RecGadtC`) was somewhat unpredictable, as it used heuristics to determine whether a data type was declared using GADT syntax or not. While this worked for most use cases, there were nevertheless some corner cases where a GADT would not be reified as a `GadtC`, and conversely, a non-GADT would be reified as a `GadtC`. For example:
|
|
|
|
|
|
```wiki
|
|
|
```
|
|
|
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
|
|
|
λ> :set -XTemplateHaskell -XExistentialQuantification -XGADTs
|
|
|
λ> import Language.Haskell.TH
|
... | ... | @@ -238,7 +240,7 @@ instance Foldable Empty where |
|
|
|
|
|
In order to future-proof your packages for upcoming changes, add the following snippet to your `.cabal` file, and address the warnings emitted by GHC when compiling your package:
|
|
|
|
|
|
```wiki
|
|
|
```
|
|
|
if impl(ghc >= 8.0)
|
|
|
ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
|
|
|
else
|
... | ... | |