2.1. Version 8.12.1

The significant changes to the various parts of the compiler are listed in the following sections.

2.1.1. Highlights

  • TODO

2.1.2. Full details

2.1.2.1. Language

  • Record field selectors are now given type signatures that preserve the user-written order of quantified type variables. Moreover, field selector type signatures no longer make inferred type variables avaiable for explicit type application. See Field selectors and TypeApplications for more details.

    In certain situations, this will constitute a breaking change as this can affect TypeApplications. For instance, given the following definitions:

    {-# LANGUAGE PolyKinds #-}
    
    newtype P a = MkP { unP :: Proxy a }
    
    newtype N :: Type -> Type -> Type where
      MkN :: forall b a. { unN :: Either a b } -> N a b
    

    Previous versions of GHC would give the following types to unP and unN:

    unP :: forall k (a :: k). P a -> Proxy a
    unN :: forall a b. N a b -> Either a b
    

    GHC will now give them the following types instead:

    unP :: forall {k} (a :: k). P a -> Proxy a
    unN :: forall b a. N a b -> Either a b
    
  • In obscure scenarios, GHC now rejects programs it previously accepted, but with unhelpful types. For example, if (with -XPartialTypeSignatures) you were to write x :: forall (f :: forall a (b :: a -> Type). b _). f _, GHC previously would have accepted x, but its type would have involved the mysterious Any internal type family. Now, GHC rejects, explaining the situation.

  • GHC now more faithfully implements the instance-lookup scheme described with QuantifiedConstraints. Previous bugs meant that programs like this were accepted:

    data T (c :: Type -> Constraint)
    instance (forall h. c h => Functor h) => Functor (T c)
    instance (forall h. c h => Applicative h) => Applicative (T c)
    

    Note that in the instance declaration for Applicative (T c), we cannot prove Functor (T c), because the quantified constraint shadows the global instance. There is an easy workaround, though: just include Functor (T c) as an assumption.

    instance (forall h. c h => Applicative h, Functor (T c)) => Applicative (T c)
    

    There is a chance we will tweak the lookup scheme in the future, to make this workaround unnecessary.

  • GHC now consistently does eager instantiation during type inference. As a consequence, visible type application (VTA) now only works when the head of the application is: * A variable * An expression with a type signature For example (let x = blah in id) @Bool True no longer typechecks. You should write let x = blah in id @Bool True instead.

    This change prepares the way for Quick Look impredicativity.

2.1.2.2. Compiler

2.1.2.3. GHCi

2.1.2.4. Runtime system

2.1.2.5. Template Haskell

  • Implement the Overloaded Quotations proposal (#246). The type of all quotation forms have now been generalised in terms of a minimal interface necessary for the implementation rather than the overapproximation of the Q monad.
  • Template Haskell quotes now handle fixity declarations in let and where bindings properly. Previously, such fixity declarations would be dropped when quoted due to a Template Haskell bug.
  • The -XTemplateHaskellQuotes extension now allows nested splices as nested splices do not lead directly to compile-time evaluation. (!2288)

2.1.2.6. Arrow notation

  • When combined with Arrows, the LambdaCase extension now additionally allows \case syntax to be used as a command in proc notation.

  • When combined with Arrows, the effects of the BlockArguments extension now also apply to applications of arrow control operators in (| banana brackets |):

    (| untilA (increment -< x + y) do
         within 0.5 -< x
         ... |)
    

2.1.2.7. ghc-prim library

2.1.2.8. ghc library

  • The type of the getAnnotations function has changed to better reflect the fact that it returns two different kinds of annotations, those on names and those on modules:

    getAnnotations :: Typeable a
                   => ([Word8] -> a) -> ModGuts
                   -> CoreM (ModuleEnv [a], NameEnv [a])
    
  • The meaning of the hs_fixds field of HsGroup has changed slightly. It now only contains fixity signatures defined for top-level declarations and class methods defined outside of the class itself. Previously, hs_fixds would also contain fixity signatures for class methods defined inside the class, such as the fixity signature for m in the following example:

    class C a where
      infixl 4 `m`
      m :: a -> a -> a
    

    If you wish to attain the previous behavior of hs_fixds, use the new hsGroupTopLevelFixitySigs function, which collects all top-level fixity signatures, including those for class methods defined inside classes.

  • The Exception module was boiled down acknowledging the existence of the exceptions dependency. In particular, the ExceptionMonad class is not a proper class anymore, but a mere synonym for MonadThrow, MonadCatch, MonadMask (all from exceptions) and MonadIO. All of g*-functions from the module (gtry, gcatch, etc.) are erased, and their exceptions-alternatives are meant to be used in the GHC code instead.

2.1.2.9. base library

2.1.2.10. Build system

2.1.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.11.0.20200514 The compiler itself
Cabal 3.3.0.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.14.0.0 Core library
binary 0.8.7.0 Dependency of ghc library
bytestring 0.10.9.0 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
exceptions 0.10.4 Dependency of haskeline library
filepath 1.4.2.1 Dependency of ghc library
ghc-boot-th 8.11.0.20200514 Internal compiler library
ghc-boot 8.11.0.20200514 Internal compiler library
ghc-compact 0.1.0.0 Core library
ghc-heap 8.11.0.20200514 GHC heap-walking library
ghc-prim 0.6.1 Core library
ghci 8.11.0.20200514 The REPL interface
haskeline 0.8.0.1 Dependency of ghci executable
hpc 0.6.1.0 Dependency of hpc executable
integer-gmp 1.0.3.0 Core library
libiserv 8.11.0.20200514 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.8.2 Dependency of ghc library
stm 2.5.0.0 Dependency of haskeline library
template-haskell 2.17.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