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 7.6 branch.
The highlights, since the 7.6 branch, are:
GHC now supports "type holes" with the
TypeHoles
extension. When enabled, the
unbound literal _
may be used during
development in place of a regular identifier, and GHC will
respond with the type necessary to "fill in the hole."
TODO FIXME: reference.
It is now possible to declare a 'closed' type
family
when using the
TypeFamilies
extension. A closed
type family
cannot have any
instances created other than the ones in its
definition.
TODO FIXME: reference.
Use of the GeneralizedNewtypeDeriving
extension is now subject to role checking,
to ensure type safety of the derived instances. As this change
increases the type safety of GHC, it is possible that some code
that previously compiled will no longer work.
TODO FIXME: reference.
GHC now supports overloading list literals using the new
OverloadedLists
extension.
TODO FIXME: reference.
There has been significant overhaul of the type inference engine and constraint solver. TODO FIXME: reference.
By default, GHC will now unbox all "small" strict
fields in a data type. A "small" data type is one
whose size is equivalent to or smaller than the native
word size of the machine. This means you no longer
have to specify UNPACK
pragmas for
e.g. strict Int
fields. This also
applies to floating-point values.
GHC now has a brand-new I/O manager that scales significantly better for larger workloads compared to the previous one. It should scale linearly up to approximately 32 cores.
The LLVM backend now supports 128bit SIMD operations. This is
now exploited in both the vector
and
dph
packages, exposing a high level
interface.
TODO FIXME: reference.
This is only available with the LLVM backend.
The new code generator, after significant work by many individuals over the past several years, is now enabled by default. This is a complete rewrite of the STG to Cmm transformation. In general, your programs may get slightly faster.
The old code generator has been removed completely.
PrimOps for comparing unboxed values now return
Int#
instead of Bool
.
New PrimOps' names end with $#
for operators and
I#
for ordinary names, e.g. ==$#
compares Int#
s for equality and
eqCharI#
does the same for Char#
s.
Old PrimOps have been removed and turned into wrappers. See
this GHC wiki page for instructions how to update your
existing code.
TODO: mention dynamic changes
TODO: mention new Typeable
and
AutoDeriveTypeable
There is a new extension,
NullaryTypeClasses
, which
allows you to declare a type class without any
parameters.
TODO FIXME: example?
GHC now supports a --show-options
flag,
which will dump all of the flags it supports to standard out.
It's now possible to switch the system linker on Linux (between GNU gold and GNU ld) at runtime without problem.
The -fwarn-dodgy-imports
flag now warns
in the case an import
statement hides an
entity which is not exported.
The LLVM backend was overhauled and rewritten, and should hopefully be easier to maintain and work on in the future.
GHCi now supports a prompt2
setting, which allows you to customize the
continuation prompt of multi-line input.
TODO FIXME: reference.
The new :shows paths
command
shows the current working directory and the
current search path for Haskell modules.
There have been some changes that have effected multiple libraries:
TODO FIXME
The following libraries have been removed from the GHC tree:
TODO FIXME
The following libraries have been added to the GHC tree:
TODO FIXME
Version number 4.7.0.0 (was 4.6.0.1)
The Control.Category
module now has the
PolyKinds
extension enabled, meaning
that instances of Category
no longer
need be of kind * -> * -> *
There are now Foldable
and Traversable
instances for Either a
and (,) a
Control.Concurrent.MVar
has a new
implementation of readMVar
, which
fixes a long-standing bug where
readMVar
is only atomic if there
are no other threads running
putMVar
.
readMVar
now is atomic, and is
guaranteed to return the value from the first
putMVar
. There is also a new tryReadMVar
which is a non-blocking version.
There are now byte endian-swapping primitives
available in Data.Word
, which
use optimized machine instructions when available.
Version number 2.7.0.0 (was 2.6.0.0)
A crash in getGroupEntryForID
(and related functions like
getUserEntryForID
and
getUserEntryForName
) in
multi-threaded applications has been fixed.
The functions getGroupEntryForID
and getUserEntryForID
now fail
with a isDoesNotExist
error when
the specified ID cannot be found.