The significant changes to the various parts of the compiler are listed in the following sections. There have also been numerous bug fixes and performance improvements over the 8.6.1 release.
The highlights, since the 8.6.1 release, are:
GHC now supports visible kind applications, as described in GHC proposal #15. This extends the existing visible type applications feature to permit type applications at the type level (e.g., f :: Proxy ('Just @Bool 'True)) in addition to the term level (e.g., g = Just @Bool True).
GHC now allows explicitly binding type variables in type family instances and rewrite rules, as described in GHC proposal #7. For instance:
type family G a b where
forall x y. G [x] (Proxy y) = Double
forall z. G z z = Bool
{-# RULES "example" forall a. forall (x :: a). id x = x #-}
ScopedTypeVariables: The type variable that a type signature on a pattern can bring into scope can now stand for arbitrary types. Previously, they could only stand in for other type variables, but this restriction was deemed unnecessary in GHC proposal #29. Also see Issue #15050.
The pattern-match coverage checker now checks for cases that are unreachable due to constructors have strict argument types. For instance, in the following example:
data K = K1 | K2 !Void
f :: K -> ()
f K1 = ()
K2 cannot be matched on in f, since it is impossible to construct a terminating value of type Void. Accordingly, GHC will not warn about K2 (whereas previous versions of GHC would).
(!) and (.) are now valid type operators:
type family a ! b
type family a . b
forall is now always a keyword in types to provide more helpful error messages when -XExplicitForall is off.
An existential context no longer requires parenthesization:
class a + b
data D1 = forall a b. (a + b) => D1 a b
data D2 = forall a b. a + b => D2 a b -- now allowed
{-# UNPACK #-} annotation no longer requires parenthesization:
data T = MkT1 { a :: {-# UNPACK #-} (Maybe Int && Bool) }
| MkT2 { a :: {-# UNPACK #-} Maybe Int && Bool } -- now allowed
data G where
MkG1 :: {-# UNPACK #-} (Maybe Int && Bool) -> G
MkG2 :: {-# UNPACK #-} Maybe Int && Bool -> G -- now allowed
The requirement that kind signatures always be parenthesized has been relaxed. For instance, it is now permissible to write Proxy '(a :: A, b :: B) (previous GHC versions required extra parens: Proxy '((a :: A), (b :: B))).
-Woverflowed-literals checks all literals. Previously, it would only inspect boxed expression literals.
-Wempty-enumerations now also works for Numeric.Natural.
The LLVM backend of this release is compatible with LLVM 7.
Reifying type classes no longer shows redundant class type variables and contexts in the type signature of each class method. For instance, reifying the following class:
class C a where
method :: a
Used to produce the following:
class C a where
method :: forall a. C a => a
Where the forall a. C a => part is entirely redundant. This part is no longer included when reifying C. It’s possible that this may break some code which assumes the existence of forall a. C a =>.
Template Haskell has been updated to support visible kind applications and explicit foralls in type family instances and RULES. These required a couple of backwards-incompatible changes to the template-haskell API. Please refer to the GHC 8.8 Migration Guide for more details.
Template Haskell now supports implicit parameters and recursive do.
Template Haskell splices can now embed assembler source (Issue #16180)
The final phase of the MonadFail proposal has been implemented. As a result of this change:
These are breaking changes that may require you to update your code. Please refer to the GHC 8.8 Migration Guide for more details.
(see Issue #5518).
The StableName type parameter now has a phantom role instead of a representational one. There is really no reason to care about the type of the underlying object.
The functions zipWith3 and zip3 in Prelude can now fuse, together with zipWith4 to zipWith7 as well as their tuple counterparts in Data.List.
The package database provided with this distribution also contains a number of packages other than GHC itself. See the changelogs provided with these packages for further change information.
Package | Version | Reason for inclusion |
---|---|---|
ghc | 8.8.4 | The compiler itself |
Cabal | 3.0.1.0 | Dependency of ghc-pkg utility |
Win32 | 2.6.1.0 | Dependency of ghc library |
array | 0.5.4.0 | Dependency of ghc library |
base | 4.13.0.0 | Core library |
binary | 0.8.7.0 | Dependency of ghc library |
bytestring | 0.10.10.1 | Dependency of ghc library |
containers | 0.6.2.1 | Dependency of ghc library |
deepseq | 1.4.4.0 | Dependency of ghc library |
directory | 1.3.6.0 | Dependency of ghc library |
filepath | 1.4.2.1 | Dependency of ghc library |
ghc-boot-th | 8.8.4 | Internal compiler library |
ghc-boot | 8.8.4 | Internal compiler library |
ghc-compact | 0.1.0.0 | Core library |
ghc-heap | 8.8.4 | GHC heap-walking library |
ghc-prim | 0.5.3 | Core library |
ghci | 8.8.4 | The REPL interface |
haskeline | 0.7.5.0 | Dependency of ghci executable |
hpc | 0.6.0.3 | Dependency of hpc executable |
integer-gmp | 1.0.2.0 | Core library |
libiserv | 8.8.4 | Internal compiler library |
mtl | 2.2.2 | Dependency of Cabal library |
parsec | 3.1.14.0 | Dependency of Cabal library |
pretty | 1.1.3.6 | Dependency of ghc library |
process | 1.6.9.0 | Dependency of ghc library |
stm | 2.5.0.0 | Dependency of haskeline library |
template-haskell | 2.15.0.0 | Core library |
terminfo | 0.4.1.4 | Dependency of haskeline library |
text | 1.2.4.0 | Dependency of Cabal library |
time | 1.9.3 | Dependency of ghc library |
transformers | 0.5.6.2 | Dependency of ghc library |
unix | 2.7.2.2 | Dependency of ghc library |
xhtml | 3000.2.2.1 | Dependency of haddock executable |