3. Release notes for version 8.8.1¶
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.
3.1. Highlights¶
The highlights, since the 8.6.1 release, are:
GHC now supports visible type applications at the type level.
Type variables in type family instances and rewrite rules can now be explicitly
forall-bound.A new code layout algorithm for x86.
The final phase of the
MonadFailproposal has been implemented.Many, many bug fixes.
3.2. Full details¶
3.2.1. Language¶
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 = ()
K2cannot be matched on inf, since it is impossible to construct a terminating value of typeVoid. Accordingly, GHC will not warn aboutK2(whereas previous versions of GHC would).(!)and(.)are now valid type operators:type family a ! b type family a . b
forallis now always a keyword in types to provide more helpful error messages when-XExplicitForallis 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-literalschecks all literals. Previously, it would only inspect boxed expression literals.-Wempty-enumerationsnow also works forNumeric.Natural.
3.2.2. Compiler¶
The final phase of the
MonadFailproposal has been implemented. Accordingly, theMonadFailDesugaringlanguage extension is now deprecated, as its effects are always enabled. Similarly, the-Wnoncanonical-monadfail-instancesflag is also deprecated, as there is no longer any way to define a “non-canonical”MonadorMonadFailinstance.New
-keep-hscpp-filesto keep the output of the CPP pre-processor.The
-Wcompatwarning group now includes-Wstar-is-type.The
-fllvm-pass-vectors-in-regsflag is now deprecated as vector arguments are now passed in registers by default.The
-fblock-layout-cfgflag enables a new code layout algorithm on x86. This is enabled by default at-Oand-O2.The deprecated ghc-flag
-Wamphas been removed.Add new
-Wmissing-deriving-strategiesflag that warns users when they are not taking advantage ofDerivingStrategies. The warning is supplied at eachderivingsite.When loading modules that use
UnboxedTuplesinto GHCi, it will now automatically enable -fobject-code for these modules and all modules they depend on. Before this change, attempting to load these modules into the interpreter would just fail, and the only convenient workaround was to enable -fobject-code for all modules.Add support for generating a new type of output: extended interfaces files. Generation of these files, which sport a
.hiesuffix, is enabled via the-fwrite-ide-infoflag. See Options related to extended interface files for more information.
3.2.3. LLVM backend¶
The LLVM backend of this release is compatible with LLVM 7.
3.2.4. Runtime system¶
Add and document new FFI functions
hs_lock_stable_ptr_tableandhs_unlock_stable_ptr_table. These replace the undocumented functionshs_lock_stable_tablesandhs_unlock_stable_tables, respectively. The latter should now be considered deprecated.Document the heretofore undocumented FFI function
hs_free_stable_ptr_unsafe, used in conjunction with manual locking and unlocking.The runtime linker on Windows has been overhauled to properly handle section alignment, lower the amount of wasted memory and lower the amount of in use memory. See Issue #13617. Note that committed memory may be slightly higher.
The output filename used for eventlog output can now be specified with the
-olflag.
3.2.5. Template Haskell¶
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 reifyingC. It’s possible that this may break some code which assumes the existence offorall a. C a =>.Template Haskell has been updated to support visible kind applications and explicit
forallsin type family instances andRULES. These required a couple of backwards-incompatible changes to thetemplate-haskellAPI. 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)
3.2.6. ghc-prim library¶
GHC now exposes a new primop,
traceBinaryEvent#. This primop writes eventlog events similar totraceEvent#but allows the user to pass the event payload as a binary blob instead of a zero-terminatedByteString.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.
3.2.7. ghc library¶
Continued refinemnt of Trees That Grow AST representation.
3.2.8. base library¶
The final phase of the
MonadFailproposal has been implemented. As a result of this change:The
failmethod ofMonadhas been removed in favor of the method of the same name in theMonadFailclass.MonadFail(fail)is now re-exported from thePreludeandControl.Monadmodules.
These are breaking changes that may require you to update your code. Please refer to the GHC 8.8 Migration Guide for more details.
- Support the characters from recent versions of Unicode (up to v. 12) in literals
(see Issue #5518).
The
StableNametype 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
zipWith3andzip3inPreludecan now fuse, together withzipWith4tozipWith7as well as their tuple counterparts inData.List.
3.2.9. Build system¶
Configure: Add ALEX and HAPPY variables to explicitly set the alex and happy programs to use.
Configure: Deprecate –with-ghc=ARG in favour of the GHC variable.
3.3. Included libraries¶
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.3 | The compiler itself |
Cabal |
3.0.1.0 | Dependency of |
Win32 |
2.6.1.0 | Dependency of |
array |
0.5.4.0 | Dependency of |
base |
4.13.0.0 | Core library |
binary |
0.8.7.0 | Dependency of |
bytestring |
0.10.10.0 | Dependency of |
containers |
0.6.2.1 | Dependency of |
deepseq |
1.4.4.0 | Dependency of |
directory |
1.3.6.0 | Dependency of |
filepath |
1.4.2.1 | Dependency of |
ghc-boot-th |
8.8.3 | Internal compiler library |
ghc-boot |
8.8.3 | Internal compiler library |
ghc-compact |
0.1.0.0 | Core library |
ghc-heap |
8.8.3 | GHC heap-walking library |
ghc-prim |
0.5.3 | Core library |
ghci |
8.8.3 | The REPL interface |
haskeline |
0.7.5.0 | Dependency of |
hpc |
0.6.0.3 | Dependency of |
integer-gmp |
1.0.2.0 | Core library |
libiserv |
8.8.3 | Internal compiler library |
mtl |
2.2.2 | Dependency of |
parsec |
3.1.14.0 | Dependency of |
pretty |
1.1.3.6 | Dependency of |
process |
1.6.8.0 | Dependency of |
stm |
2.5.0.0 | Dependency of |
template-haskell |
2.15.0.0 | Core library |
terminfo |
0.4.1.4 | Dependency of |
text |
1.2.4.0 | Dependency of |
time |
1.9.3 | Dependency of |
transformers |
0.5.6.2 | Dependency of |
unix |
2.7.2.2 | Dependency of |
xhtml |
3000.2.2.1 | Dependency of |