# Release notes for version 6.12.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 6.10 branch.

## Language changes

- The new `TupleSections` language extension enables tuple sections, such as `(, True)`. See for more information.

- The new `MonoLocalBinds` language extension disables type variable generalisation for bindings in `let` and `where` clauses.

- The new `DeriveFunctor`, `DeriveFoldable` and `DeriveTraversable` language extensions enable deriving for the respective type classes. See for more information.

- The new `NoNPlusKPatterns` language extension disables `n+k` patterns. See for more information.

- Some improvements have been made to record puns:

  - `C { A.a }` now works, expanding to `C { A.a = a }`.

  - `-fwarn-unused-matches` no longer warns about bindings introduced by `f (C {..}) = x`.

  - The `RecordWildCards` language extension implies `DisambiguateRecordFields`.

- Declarations such as

      data T a where
          MkT :: forall a. Eq a => { x,y :: !a } -> T a

  are now only accepted if the extension `TypeOperators` is on.

- It is now possible to define GADT records with class constraints. The syntax is:

      data T a where
          MkT :: forall a. Eq a => { x,y :: !a } -> T a

- You can now list multiple GADT constructors with the same type, e.g.:

      data T where
          A, B :: T
          C :: Int -> T

- It is now possible to use GADT syntax for data families:

      data instance T [a] where
          T1 :: a -> T [a]

  and make data instances be GADTs:

      data instance T [a] where
          T1 :: Int -> T [Int]
          T2 :: a -> b -> T [(a,b)]

- Record updates can now be used with datatypes containing existential type variables, provided the fields being altered do not mention the existential types.

- The `ImpredicativeTypes` extension now imples the `RankNTypes` extension.

- The `ImpredicativeTypes` extension is no longer enabled by `-fglasgow-exts`.

- You can now give multi-line `DEPRECATED` and `WARNING` pragmas:

      {-# DEPRECATED defaultUserHooks
           ["Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2"
           , "compatibility in which case you must stick with defaultUserHooks"]
        #-}

- The `-#include` flag and `INCLUDE` pragma are now deprecated and ignored. Since version 6.10.1, GHC has generated its own C prototypes for foreign calls, rather than relying on prototypes from C header files.

- The `threadsafe` foreign import safety level is now deprecated; use `safe` instead.

- There is a new FFI calling convention called `prim`, which allows calling C-- functions (see ). Most users are not expected to need this.

## Warnings

- A warning is now emitted if an unlifted type is bound in a lazy pattern (in `let` or `where` clause, or in an irrefutable pattern) unless it is inside a bang pattern. This warning is controlled by the `-fwarn-lazy-unlifted-bindings` flag. In a future version of GHC this will be an error.

- There are two new warnings if a monadic result of type other than `m ()` is used in a `do` block, but its result is not bound. The flags `-fwarn-unused-do-bind` and `-fwarn-wrong-do-bind` control these warnings (see ).

- The new flag `-fwarn-dodgy-exports` controls whether an error is given for exporting a type synonym as `T(..)`.

- Name shadowing warnings are no longer given for variable names beginning with an underscore.

- When `-Werror` is given, we now pass `-Werror` to `cpp`.

## Runtime system

The following options are all described in .

- The flag `+RTS -N` now automatically determines how many threads to use, based on the number of CPUs in your machine.

- The parallel GC now uses the same threads as the mutator, with the consequence that you can no longer select a different number of threads to use for GC. The `-gn` RTS option has been removed, except that `-g1` is still accepted for backwards compatibility.

  The new flag `+RTS -qggen` sets the minimum generation for which parallel garbage collection is used. Defaults to 1. The flag `-qg` on its own disables parallel GC.

- The new flag `+RTS -qbgen` controls load balancing in the parallel GC.

- The new flag `+RTS -qa` uses the OS to set thread affinity (experimental).

- If you link with the `-eventlog` flag, then the new flag `+RTS -l` generates `prog.eventlog` files, which tools such as ThreadScope can use to show the behaviour of your program (see ). The `+RTS -D>x` output is also sent to the eventlog file if this option is enabled. The `+RTS -v` flag sends eventlog data to stderr instead.

- There is a new statistic in the `+RTS -s` output:

      SPARKS: 1430 (2 converted, 1427 pruned)

  This tells you how many sparks (requests for parallel execution, caused by calls to `par`) were created, how many were actually evaluated in parallel (converted), and how many were found to be already evaluated and were thus discarded (pruned). Any unaccounted for sparks are simply discarded at the end of evaluation.

## Build system

- We now require GHC >= 6.8 to build.

- We now require that gcc is >= 3.0.

- In order to generate the parsers, happy >= 1.16 is now required. The parsers are pre-generated in the source tarball, so most users will not need Happy.

- It is now possible to build GHC with a simple, BSD-licensed Haskell implementation of Integer, instead of the implementation on top of GMP. To do so, set `INTEGER_LIBRARY` to `integer-simple` in `mk/build.mk`.

- The build system has been rewritten for the 6.12 series. See the building guide for more information.

- The build system now uses variables like `bindir` compatibly with the GNU standard.

## Compiler

- The "Interface file version" field of the `ghc --info` output has been removed, as it is no longer used by GHC.

- There is a new "LibDir" field in the `ghc --info` output.

- A field f in the `ghc --info` can now be printed with `ghc --print-f`, with letters lower-cased and spaces replaced by dashes.

- GHC now works (as a 32bit application) on OS X Snow Leopard.

- The native code generator now works on Sparc Solaris.

- Haddock interface files are now portable between different architectures.

- The new linker flag `-eventlog` enables the `+RTS -l` event logging features. The `-debug` flag also enables them.

- There is a new flag `-feager-blackholing` which typically gives better performing code when running with multiple threads. See for more information.

- There is a new flag `-fbuilding-cabal-package` which signals to GHC that it is being run by a build system, rather than invoked directly. This currently means that GHC gives different error messages in certain situations.

- The following flags were static, but are now dynamic: `-fext-core`, `-fauto-sccs-on-all-toplevs`, `-auto-all`, `-no-auto-all`, `-fauto-sccs-on-exported-toplevs`, `-auto`, `-no-auto`, `-fauto-sccs-on-individual-cafs`, `-caf-all` and `-no-caf-all`.

## GHCi

- If the argument to `:set prompt` starts with a double quote then it is read with Haskell String syntax, e.g.:

      Prelude> :set prompt "Loaded: %s\n> "
      Loaded: Prelude
      >

- The arguments to `:set set` and `:set show` can now be tab completed.

- We inherit some benefits from an upgraded version of haskeline:

  - A multitude of new emacs and vi commands.

  - New preference 'historyDuplicates' to prevent storage of duplicate lines.

  - Support PageUp and PageDown keys.

## Template Haskell

- You can now omit the splice notation for top-level declaration splices, e.g.:

      data T = T1 | T2
      deriveMyStuff ''T

- Splices are now nestable, e.g. you can say `f x = $(g $(h 'x))`.

- It is now possible to splice in types.

## Package Handling

- Shared libraries are now supported on x86 and x86_64 Linux. To use shared libraries, use the `-dynamic` flag. See for more information.

- The new `-fno-shared-implib` flag can be used to stop GHC generating the `.lib` import library when making a dynamic library. This reduces the disk space used when you do not need it.

- Packages can now be identified by a "package ID", which is based on a hash of the ABIs. The new flag `-package-id` allows packages to be selected by this identifier (see ). Package IDs enable GHC to detect potential incompatibilities between packages and broken dependencies much more accurately than before.

- The new flag `--abi-hash`, used thus:

      ghc --abi-hash M1 M2 ...

  prints the combined hash of all the modules listed. It is used to make package IDs.

- You can now give `ghc-pkg` a `-v0` flag to make it be silent, `-v1` for normal verbosity (the default), or `-v2` or `-v` for verbose output.

- Rather than being a single `package.conf` file, package databases now consist of a directory containing one file per package, and a binary cache of the information. GHC should be much faster to start up when the package database grows large.

- There is a new command `ghc-pkg init` to create a package database.

- There is a new command `ghc-pkg dot` to generate a GraphViz graph of the dependencies between installed packages.

- There is a new command `ghc-pkg recache` to update the package database cache should it become out of date, or for registering packages manually.

## Libraries

GHC no longer comes with any extralibs; instead, the Haskell Platform will provide a consistent set of additional libraries.

### array

- Version number 0.3.0.0 (was 0.2.0.0)

- The `Data.Array.Diff` module has been moved to its own package.

### base

- Version number 4.2.0.0 (was 4.1.0.0)

- We also ship a base version 3.0.3.2 (was 3.0.3.1), so legacy code should continue to work. This package is now deprecated, and will be removed in a future version of GHC.

- Handle IO now supports automatic character set encoding and newline translation. For more information, see the "Unicode encoding/decoding" and "Newline conversion" sections in the `System.IO` haddock docs.

- Lazy I/O now throws an exception if an error is encountered, in a divergence from the Haskell 98 spec which requires that errors are discarded (see Section 21.2.2 of the Haskell 98 report). The exception thrown is the usual IO exception that would be thrown if the failing IO operation was performed in the IO monad, and can be caught by `System.IO.Error.catch` or `Control.Exception.catch`.

- It is now possible to create your own handles. For more information, see the `GHC.IO.Handle` haddock docs.

- `System.IO` now exports two new functions, `openTempFileWithDefaultPermissions` and `openBinaryTempFileWithDefaultPermissions`.

- `Data.Fixed` now provides `Data` and `Typeable` instances for `Fixed`, and exports a number of new types: `E0`, `Uni`, `E1`, `Deci`, `E2`, `Centi`, `E3`, `Milli`, `E9` and `Nano`.

- In `Control.Exception`, `BlockedOnDeadMVar` has been renamed to `BlockedIndefinitelyOnMVar` and `BlockedIndefinitely` has been renamed to `BlockedIndefinitelyOnSTM`.

- The `Control.OldException` module has been deprecated.

- `System.Posix.Internals.setNonBlockingFD` now takes an additional `Bool` argument, so you can turn blocking back on again.

- A new function `eof` has been added to `Text.ParserCombinators.ReadP`.

- The `Foreign.C.Types.CLDouble` type has been removed. It was never correct, but just a duplicate of `Foreign.C.Types.CDouble`.

- In `Data.Data`, the `StringRep` and `StringConstr` constructors have been removed. The `CharRep` and `CharConstr` constructors should be used instead.

- In `Data.Data`, `mkIntConstr` has been deprecated in favour of the new `mkIntegralConstr`.

- In `Data.Data`, `mkFloatConstr` has been deprecated in favour of the new `mkRealConstr`.

- In `Data.Data`, `mkNorepType` has been deprecated in favour of the new `mkNoRepType`.

### bytestring

- Version number 0.9.1.5 (was 0.9.1.4)

### Cabal

- Version number 1.8.0.0 (was 1.6.0.3)

- Many API changes. See the Cabal docs for more information.

### containers

- Version number 0.3.0.0 (was 0.2.0.1)

- `mapAccumRWithKey` has been added to `Data.IntMap`.

- A `Traversable` instance has been added to `Data.IntMap.IntMap`.

- The types of `Data.IntMap.intersectionWith` and `Data.IntMap.intersectionWithKey` have been changed from

      intersectionWith :: (a -> b -> a) -> IntMap a -> IntMap b -> IntMap a
      intersectionWithKey :: (Key -> a -> b -> a) -> IntMap a -> IntMap b -> IntMap a

  to

      intersectionWith :: (a -> b -> c) -> IntMap a -> IntMap b -> IntMap c
      intersectionWithKey :: (Key -> a -> b -> c) -> IntMap a -> IntMap b -> IntMap c

- The types of `Data.IntMap.findMin` and `Data.IntMap.findMax` have been changed from

      findMin :: IntMap a -> a
      findMax :: IntMap a -> a

  to

      findMin :: IntMap a -> (Int,a)
      findMax :: IntMap a -> (Int,a)

- `Data.Map` now exports `mapAccumRWithKey`, `foldrWithKey`, `foldlWithKey` and `toDescList`.

- `Data.Sequence` now exports `replicate`, `replicateA`, `replicateM`, `iterateN`, `unfoldr`, `unfoldl`, `scanl`, `scanl1`, `scanr`, `scanr1`, `tails`, `inits`, `takeWhileL`, `takeWhileR`, `dropWhileL`, `dropWhileR`, `spanl`, `spanr`, `breakl`, `breakr`, `partition`, `filter`, `sort`, `sortBy`, `unstableSort`, `unstableSortBy`, `elemIndexL`, `elemIndicesL`, `elemIndexR`, `elemIndicesR`, `findIndexL`, `findIndicesL`, `findIndexR`, `findIndicesR`, `foldlWithIndex`, `foldrWithIndex`, `mapWithIndex`, `zip`, `zipWith`, `zip3`, `zipWith3`, `zip4` and `zipWith4`.

### directory

- Version number 1.0.1.0 (was 1.0.0.3)

- A new function `copyPermissions` has been added to `System.Directory`.

### dph (dph-base, dph-par, dph-prim-interface, dph-prim-par, dph-prim-seq, dph-seq)

- All the dph packages are version 0.4.0.

### extensible-exceptions

- Version number 0.1.1.1 (was 0.1.1.0)

### filepath

- Version number 1.1.0.3 (was 1.1.0.2)

- The list of characters that are invalid in filenames on Windows now includes `\` (backslash).

### ghc-binary

- This is an internal package, and should not be used.

### ghc-prim

- Version number 0.2.0.0 (was 0.1.0.0)

### haskell98

- Version number 1.0.1.1 (was 1.0.1.0)

### hpc

- Version number 0.5.0.4 (was 0.5.0.3)

### integer-gmp

- Version number 0.2.0.0 (was called integer, version 0.1.0.1)

### integer-simple

- This is a new boot package, version 0.1.0.0.

### old-locale

- Version number 1.0.0.2 (was 1.0.0.1)

- Date and time in ISO8601 format are now separated by `T` rather than a space.

### old-time

- Version number 1.0.0.3 (was 1.0.0.2)

### packedstring

- This is no longer a boot package.

### pretty

- Version number 1.0.1.1 (was 1.0.1.0)

### process

- Version number 1.0.1.2 (was 1.0.1.1)

### random

- Version number 1.0.0.2 (was 1.0.0.1)

### syb

- Version number 0.1.0.2 (was 0.1.0.1)

### template-haskell

- Version number 2.4.0.0 (was 2.3.0.1)

- Support for `inline` and `specialise` pragmas has been added.

- Support for bang patterns has been added

- Support for kind annotations has been added

- Support for equality constraints has been added

- Support for type family declarations has been added

### time

- This is a new boot package, version 1.1.4.

### unix

- Version number 2.4.0.0 (was 2.3.2.0)

- `System.Posix.IO` now exports `fdReadBuf` and `fdWriteBuf`.

- `System.Posix.Process.executeFile` now returns `IO a` instead of `IO ()`.

### Win32

- Version number 2.2.0.1 (was 2.2.0.0)

- `System.Win32.File` now exports `WIN32_FIND_DATA`, `FindData`, `getFindDataFileName`, `findFirstFile`, `findNextFile` and `findClose`.

- `System.Win32.Info` now exports `getCurrentDirectory`, `getTemporaryDirectory`, `getFullPathName` and `searchPath`.

- `System.Win32.Types` now exports `HRESULT`.

- There is a new module `System.Win32.Shell`.