1.5. 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.

1.5.1. Highlights

Considerably improved support for parallel execution. GHC 6.10
would execute parallel Haskell programs, but performance was
often not very good. Simon Marlow has done lots of performance
tuning in 6.12, removing many of the accidental (and largely
invisible) gotchas that made parallel programs run slowly.

As part of this parallel-performance tuning, Satnam Singh and
Simon Marlow have developed ThreadScope, a GUI that lets you
see what is going on inside your parallel program. It's a huge
step forward from "It takes 4 seconds with 1 processor, and 3
seconds with 8 processors; now what?". ThreadScope will be
released separately from GHC, but at more or less the same
time as GHC 6.12.

Dynamic linking is now supported on Linux, and support for
other platforms will follow. Thanks for this most recently go
to the Industrial Haskell Group who pushed it into a
fully-working state; dynamic linking is the culmination of the
work of several people over recent years. One effect of
dynamic linking is that binaries shrink dramatically, because
the run-time system and libraries are shared. Perhaps more
importantly, it is possible to make dynamic plugins from
Haskell code that can be used from other applications.

The I/O libraries are now Unicode-aware, so your Haskell
programs should now handle text files containing non-ascii
characters, without special effort.

The package system has been made more robust, by associating
each installed package with a unique identifier based on its
exposed ABI. Now, cases where the user re-installs a package
without recompiling packages that depend on it will be
detected, and the packages with broken dependencies will be
disabled. Previously, this would lead to obscure compilation
errors, or worse, segfaulting programs.

This change involved a lot of internal restructuring, but it
paves the way for future improvements to the way packages are
handled. For instance, in the future we expect to track
profiled packages independently of non-profiled ones, and we
hope to make it possible to upgrade a package in an
ABI-compatible way, without recompiling the packages that
depend on it. This latter facility will be especially
important as we move towards using more shared libraries.

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, and
has been deprecated.

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.

1.5.3. 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 Section 4.7, “Warnings and sanity-checking”).

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.

1.5.4. Runtime system

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 Section 4.15.6, “Tracing”). 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.

1.5.5. 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.

1.5.6. 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.

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.

1.5.7. 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.

1.5.8. Template Haskell

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

1.5.9. Package Handling

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 Section 4.8.5, “Package IDs, dependencies, and broken packages”). 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.

1.5.10. Libraries

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

1.5.10.1. array

Version number 0.3.0.0 (was 0.2.0.0)

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

1.5.10.2. 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.

1.5.10.3. bytestring

Version number 0.9.1.5 (was 0.9.1.4)

1.5.10.4. Cabal

Version number 1.8.0.2 (was 1.6.0.3)

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

1.5.10.5. 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