3. Release notes for version 8.6.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.4.1 release.
3.1. Highlights¶
The highlights, since the 8.4.1 release, are:
- Support for QuantifiedConstraints.
- A new flexible deriving scheme, DerivingVia.
- A new plugin mechanism and support for plugins to modify their effect on GHC’s recompilation checking logic.
- Valid hole fits in error messages.
- A number of syntactic language extensions.
- Programs are no longer constrained by the Windows MAX_PATHfile path length limit. The file path limit is now approximately 32,767 characters. Note that GHC itself is still somewhat limited due to GCC not supporting file namespaced paths. Paths that are passed directly to the compiler, linker or other GNU tools are currently still constrained. See File paths under Windows for details.
- Many, many bug fixes.
3.2. Full details¶
3.2.1. Language¶
- Use of quantified type variables in constraints is now allowed via the - QuantifiedConstraintslanguage extension. This long-awaited feature enables users to encode significantly more precision in their types. For instance, the common- MonadTranstypeclass could now make the expectation that an applied transformer is must be a- Monad- class (forall m. Monad m => Monad (t m)) => MonadTrans t where {- ... -} - Additionally, quantification can enable terminating instance resolution where this previously was not possible. See Quantified constraints for details. 
- A new - DerivingVialanguage extension has been added which allows the use of the- viaderiving strategy. For instance:- newtype T = MkT Int deriving Monoid via (Sum Int) - See Deriving via for more information. 
- A new - StarIsTypelanguage extension has been added which controls whether- *is parsed as- Data.Kind.Typeor a regular type operator.- StarIsTypeis enabled by default.
- GHC now permits the use of a wildcard type as the context of a standalone - derivingdeclaration with the use of the- PartialTypeSignatureslanguage extension. For instance, this declaration:- deriving instance _ => Eq (Foo a) - Denotes a derived - Eq (Foo a)instance, where the context is inferred in much the same way as ordinary- derivingclauses do. See Partial Type Signatures.
- Data declarations with empty - whereclauses are no longer valid without the extension- GADTSyntaxenabled. For instance, consider the following,- data T where - The grammar is invalid in Haskell2010. Previously it could be compiled successfully without - GADTs. As of GHC 8.6.1, this is a parse error.
- Incomplete patterns warning - -Wincomplete-patternsis extended to guards in pattern bindings and- ifalternatives of- MultiWayIf. For instance, consider the following,- foo :: Bool -> Int foo b = if | b -> 1 - In GHC 8.6.1, it will raise the warning: - <interactive>:2:12: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a multi-way if alternative: Guards do not cover entire pattern space - See Trac #14773. 
- Scoped type variables now work in default methods of class declarations and in pattern synonyms in Template Haskell. See Trac #14885. 
- doexpressions, lambda expressions, etc. to be directly used as a function argument, enabled with- BlockArguments. See More liberal syntax for function arguments for the full details.
- Underscores in numeric literals (e.g. - 1_000_000), enabled with- NumericUnderscores. See Numeric underscores for the full details.
- CUSKs now require all kind variables to be explicitly quantified. This was already the case with - TypeInType, but now- PolyKindsalso exhibits this behavior. This means that the following example is no longer considered to have a CUSK:- data T1 :: k -> Type -- No CUSK: `k` is not explicitly quantified 
- Functionality of - TypeInTypehas been subsumed by- PolyKinds, and it is now merely a shorthand for- PolyKinds,- DataKinds, and- NoStarIsType. The users are advised to avoid- TypeInTypedue to its misleading name: the- Type :: Typeaxiom holds regardless of whether it is enabled.
- GHC has become more diligent about catching illegal uses of kind polymorphism. For instance, GHC 8.4 would accept the following without the use of - PolyKinds:- f :: forall k (a :: k). Proxy a f = Proxy - This is now an error unless - PolyKindsis enabled.
- Type literals now could be used in type class instances without the extension - FlexibleInstances.- See Trac #13833. 
- MonadFailDesugaringis now enabled by default. See MonadFail Proposal (MFP) for more details.
3.2.2. Compiler¶
- GHC now no longer adds the current file’s directory as a general include path
calling the C compiler. Instead we use -iquoteto only add it as an include path for #include “”. See Trac #14312.
- GHC now supports British spelling of GeneralizedNewtypeDeriving.
- GHC now does significantly more constant folding in its core-to-core optimiser. This will result in significantly better code being generated for some programs. See Trac #9136.
- GHC now offers significantly more information about typed holes such as valid hole fits and refinement hole fits. See Valid Hole Fits for more information.
- The code-generation effects of -dynamiccan now be enabled independently by the flag-fexternal-dynamic-refs. If you don’t know why you might need this, you don’t need it.
- -Wcompatnow includes- -Wimplicit-kind-varsto provide early detection of breakage that will be caused by implementation of GHC proposal #24 in a future release.
- The -package-env ⟨file⟩|⟨name⟩flag andGHC_ENVIRONMENTenvironment variable now accept the-value, which instructs GHC to ignore any package environment files.
3.2.3. Plugins¶
- GHC’s plugin mechanism now offers plugin authors control over their plugin’s effect on recompilation checking. Specifically the - Pluginrecord name has a new field- data Plugin = Plugin { pluginRecompile :: [CommandLineOption] -> IO PluginRecompile , {- ... -} } data PluginRecompile = ForceRecompile | NoForceRecompile | MaybeRecompile Fingerprint - Plugin based on - defaultPluginwill have their previous recompilation behavior (- ForceRecompile) preserved. However, plugins that are “pure” are encouraged to override this to either- NoForceRecompileor- MaybeRecompile. See Controlling Recompilation for details.
- GHC now provides a class of new plugins: source plugins. These plugins can inspect and modify a variety of intermediate representations used by the compiler’s frontend. These include: - The ability to modify the parser output
- The ability to inspect the renamer output
- The ability to modify the typechecked AST
- The ability to modify Template Haskell splices
- The ability to modify interface files as they are loaded
 - See Source plugins for details. 
3.2.5. Runtime system¶
- The GHC runtime linker now prefers user shared libraries above system ones.
When extra search directories are specified these are searched before anything
else. This fixes iuucon Windows given the proper search directories (e.g-L/mingw64/lib).
- The GHC runtime linker now uses LIBRARY_PATHand the runtime loader now also searchesLD_LIBRARY_PATH.
- The GHC runtime on Windows is no longer constrained by the MAX_PATHfile path length limitation. See File paths under Windows.
- The runtime now allows use of the -hTprofiling variety on programs built with-prof.
- The STM assertions mechanism (namely the alwaysandalwaysSucceedsfunctions) has been removed. This happened a bit earlier than proposed in the deprecation pragma included in GHC 8.4, but due to community feedback we decided to move ahead with the early removal.
3.2.6. Template Haskell¶
3.2.7. ghc library¶
- The Pluginrecord now has a several new fields for the new source plugins and recompilation checking mechanisms.
3.2.8. base library¶
- ($!)is now representation-polymorphic like- ($).
- The module Data.Functor.Contravarianthas been moved from thecontravariantpackage intobase. All the other modules incontravariant(Data.Functor.Contravariant.Divisible, etc.) have not been moved tobase, and they still reside incontravariant.
3.2.9. ghc-prim library¶
- Added new addWordC#operation for unsigned addition with carry.
3.2.10. Build system¶
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.6.4 | The compiler itself | 
| Cabal | 2.4.0.1 | Dependency of ghc-pkgutility | 
| Win32 | 2.6.1.0 | Dependency of ghclibrary | 
| array | 0.5.3.0 | Dependency of ghclibrary | 
| base | 4.12.0.0 | Core library | 
| binary | 0.8.6.0 | Dependency of ghclibrary | 
| bytestring | 0.10.8.2 | Deppendency of ghclibrary | 
| containers | 0.6.0.1 | Dependency of ghclibrary | 
| deepseq | 1.4.4.0 | Dependency of ghclibrary | 
| directory | 1.3.3.0 | Dependency of ghclibrary | 
| filepath | 1.4.2.1 | Dependency of ghclibrary | 
| ghc-boot | 8.6.4 | Internal compiler library | 
| ghc-compact | 0.1.0.0 | Core library | 
| ghc-prim | 0.5.3 | Core library | 
| ghci | 8.6.4 | The REPL interface | 
| haskeline | 0.7.4.3 | Dependency of ghciexecutable | 
| hpc | 0.6.0.3 | Dependency of hpcexecutable | 
| integer-gmp | 1.0.2.0 | Core library | 
| mtl | 2.2.2 | Dependency of Caballibrary | 
| parsec | 3.1.13.0 | Dependency of Caballibrary | 
| process | 1.6.5.0 | Dependency of ghclibrary | 
| template-haskell | 2.14.0.0 | Core library | 
| text | 1.2.3.1 | Dependency of Caballibrary | 
| time | 1.8.0.2 | Dependency of ghclibrary | 
| transformers | 0.5.6.2 | Dependency of ghclibrary | 
| unix | 2.7.2.2 | Dependency of ghclibrary | 
| xhtml | 3000.2.2.1 | Dependency of haddockexecutable |