1.6. Release notes for version 6.8.1

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

The major changes in this release are adding
Haskell Program Coverage (hpc) support to the compiler,
adding a debugger to GHCi, the first phase of the base package
split, and pointer tagging in the code generator (which should mean
most code improves by 10-15%, and as a result the compiler is also
faster).

While older releases did mostly work on Windows Vista, 6.8.1
fixes some issues, e.g. Windows used to think that cabal Setup
programs were installers and refused to run them. However,
Win9x support has now officially been dropped, as we are not
able to test on that platform.

Haskell Program Coverage
Adding hpc tools, as a single program
GHC now comes with “Haskell Program Coverage”,
a code coverage tool. This is in the form of a new
-fhpc flag and an hpc
program. See Section 6.6, “Observing Code Coverage” for more details.

There is the beginnings of support for
“associated types”
in GHC. However, this is incomplete and not a supported
feature.

There is the beginnings of support for
“nested data parallelism”
in GHC. However, this is incomplete and not a supported
feature.

It is now possible to derive class instances with standalone
top-level declarations, rather than having to attach a
deriving clause to the datatype declaration. The syntax is

will now work. Don't rely on this, though, as it is subject
to change in the future!

A new extension OverloadedStrings means that
string literals have type

Data.String.IsString t => t

where Data.String.IsString is a new class
with a single method

fromString :: String -> a

There is a new record field disambiguation extension, enabled
by -fdisambiguate-record-fields, which
allows normally-ambiguous field names to be used when it is
clear which is meant due to the use of a constructor.
See Section 8.3.7, “Record field disambiguation” for more details.

There are also new flags
-frecord-puns and
-frecord-dot-dot for record punninng, but
these do not work correctly yet, and so are not supported.

GHC now has an --info flag which prints
information about the settings used to build the compiler.
The information is in a machine-parsable (Haskell) format.
For example,

GHC now accepts -XFoo and
-XNoFoo
flags, where
Foo is any extension that can be listed
in a LANGUAGE pragma. As a result the
following flags are now deprecated:

-fth
(use -XTemplateHaskell)

-ffi, -fffi
(use -XForeignFunctionInterface)

-farrows
(use -XArrows)

-fgenerics
(use -XGenerics)

-fimplicit-prelude
(use -XImplicitPrelude)

-fbang-patterns
(use -XBangPatterns)

-fmonomorphism-restriction
(use -XMonomorphismRestriction)

-fmono-pat-binds
(use -XMonoPatBinds)

-fextended-default-rules
(use -XExtendedDefaultRules)

-fimplicit-params
(use -XImplicitParams)

-fscoped-type-variables
(use -XScopedTypeVariables)

-fparr
(use -XPArr)

-fallow-overlapping-instances
(use -XOverlappingInstances)

-fallow-undecidable-instances
(use -XUndecidableInstances)

-fallow-incoherent-instances
(use -XIncoherentInstances)

GHC now has a --supported-languages flag
which lists the strings it understands as a -X
flag and in a LANGUAGE pragma.
You can prepend NO to any of the strings.
LANGUAGE pragmas also only turn on exactly
what you asked for now; many of them used to just enable
-fglasgow-exts before.

GHC now understands GENERATED pragmas, which
are used to
indicate to tools like HPC where some tool-generated code
came from. They look like

{-# GENERATED "SourceFile" 12:3-14:8 #-} expr

GHC now has a --print-docdir flag which
prints to stdout where GHC believes its documentation is
located.

The -O no longer enables
-fvia-C.

There is a new flag -fobject-code, which
uses the default of -fasm or
-fvia-C, and -fbyte-code,
which only works in GHCi and sets byte-code as the target.

The warning for importing T(..) when
T is an abstract type used to be enabled
only by -W or -Wall.
It no has its own flag -fwarn-dodgy-imports.

A new flag -fwarn-tabs warns if there are tab
characters in your source files.

A new flag -fwarn-implicit-prelude warns if
your module implicitly imports the Prelude.

A new flag -fwarn-monomorphism-restriction
warns if the monomorphism restriction applies to your code.

The “missing type-signature” warning now tells you
what type GHC inferred for the function.

The -w flag now turns off
all options,
not just those that are enabled by -Wall.

A new flag -Wwarn makes warnings just warn
(the default). It can be used to override -Werror.

The
-keep-hc-file,
-keep-s-file and
-keep-raw-s-file flags can now have an
s appended to their name (which reads better
when using --make). None of them, nor
-keep-tmp-files, can have any other suffix.

There is a new flag -fspec-threshold which
subsumes the now-deprecated
-fliberate-case-threshold.

A new flag -fprint-explicit-foralls controls
whether or not GHC prints explicit foralls
when printing types.

A new flag -ddump-to-file allows you to
specify that the output of the various ddump flags should
be put in a given file.

A new flag -ddump-rule-firings makes GHC
print out when its RULEs fire.

A new flag -ddump-mod-cycles, used with the
-M mode, make GHC print out any module import
loops.

The -fasm flag no longer takes an argument
(which it always used to ignore anyway).

The new -fhardwire-lib-paths flag means
the path to libraries are baked in, using the
-rpath linker option.

A new RTS flag
+RTS --install-signal-handlers=>yes|no<
tells the RTS whether or not to install signal handlers (default
is yes). When making a DLL you will probably want to set this to
no.

When using runghc you can now leave a space after the
-f argument telling it where to find GHC.
You can now use -- to separate the
-f argument from the GHC arguments, and the
GHC arguments from the program to run.

ghc-pkg has a new command check which
prints a list of all packages that are broken and
which dependencies they are missing. Additionally, the
list command now puts braces around broken
packages.

ghc-pkg now has a new flag --names-only,
used in conjunction with list --simple-output,
which prints package names only, i.e. without their version
numbers.

Some parts of the documentation, notably the building guide,
have been moved to the wiki.

Linear implicit parameter support has been removed.

A new RTS flag +RTS -xbXXXXX hints to the OS that
we'd like the heap to start at address 0xXXXXX. This is mainly
of use to people debugging GHC.

1.6.2. Profiling changes

It is now possible to get basic per-constructor profiling
information from programs not compiled with
-prof, by using the +RTS -hT
flag. This is possible even when running code in GHCi.

There is now support in the run-time system for using
PAPI to do CPU performance counter measurements. This is
controlled via the +RTS -aX options.
Note that it must be enabled when the compiler is built, and
is still very experimental.

It is now possible to have the key on a different page in a
graph generated by hp2ps, meaning the
graph can be larger and the cost centre names longer.
The +RTS -L flag can be used to specify the
maximum length of a cost-centre stack name.

Additionally, Control.Parallel* have been moved
to a new package “parallel” which is not a boot library.

1.6.4.1. array

Version number 0.1 (new library, split off from base).

The newArray_ method returns a
deterministic result in the ST monad, and
behaves as before in other contexts. The old
newArray_ is now called
unsafeNewArray_; the
MArray class therefore has one more
method than before.

In order to avoid problems where unusual
Ix instances could cause the array code
to access memory it shouldn't, a number of changes have been
made:

A method

numElements :: Ix i => a i e -> Int

has been added to the IArray class.

Data.Array.Base has a new function

safeRangeSize :: Ix i => (i, i) -> Int

which always returns a non-negative result.

Data.Array.Base has a new function

safeIndex :: Ix i => (i, i) -> Int -> i -> Int

which only returns a result that is non-negative
and not less than its second argument.

The
unsafeForeignPtrToStorableArray
function now has an Ix i
constraint.

1.6.4.2. base

Version number 3.0 (was 2.1.1).

A new function

System.Timeout.timeout :: Int -> IO a -> IO (Maybe a)

allows a computation to be timed out after a given number of
microseconds.

GHC.Exts no longer defines the
Splittable(split) class,
which used to be used for linear implicit parameters.

The new value GHC.Conc.numCapabilities :: Int
is the argument of the +RTS -N flag, i.e.
the number of Haskell threads that can run simultaneously.

The new function
GHC.Environment.getFullArgs returns the
complete arguments that the program was invoked with,
including any +RTS arguments etc.

GHC.Handle.openFd has been renamed to
GHC.Handle.fdToHandle'
to avoid confusion with
System.Posix.IO.openFd.

1.6.4.3. bytestring

Version number 0.9 (new library, split off from base).

Data.ByteString.packCStringLen is no
longer a pure function; its signature has changed from

packCStringLen :: Foreign.C.String.CStringLen -> ByteString

to

packCStringLen :: Foreign.C.String.CStringLen -> IO ByteString

The Data.ByteString.Base module has been
split in two. The unsafe functions are now in
Data.ByteString.Unsafe (now part of the
stable API), and the others are in
Data.ByteString.Internal (not part of the
stable API.

The internal lazy bytestring representation type has changed;
rather than

newtype ByteString = LPS [Strict.ByteString]

it is now

data ByteString = Empty | Chunk !Strict.ByteString ByteString

1.6.4.4. Cabal

Version number 1.2.2.0 (was 1.1.6.2).

Configurations have been implemented; these allow things to be
set conditionally in .cabal files.

A new --executable flag for the
haddock command also builds documentation
for executables.

A new --hyperlink-source flag for the
haddock command makes the docs link to
the source code, rendered by hscolour.

A new --html-location flag for the
haddock command allows you to say where
documentation for packages we depend on is.

A new field pkgconfig-depends allows you
to specify C libraries you use. The
pkg-config command is used to find what
C flags etc are needed to use this library.

A new field build-tools allows you to
specify tool dependencies such as cpphs.

The includes field now only specifes which
include files are automatically included when compiling the
package. A new install-includes field
determines which include files are also installed.

There are new flags --docdir and
--htmldir for the
configure command.

The configure command now has
--with-prog,
--prog-option
and
--prog-options
flags for each program prog.

The functions
throwErrnoPath,
throwErrnoPathIf,
throwErrnoPathIf_,
throwErrnoPathIfNull,
throwErrnoPathIfMinus1,
throwErrnoPathIfMinus1_
have been removed from
System.Posix.Error; they are now
available from base:Foreign.C.Error.

The System.Posix.Signals module has
been moved here from the base package.

1.6.4.19. Win32

Version number 2.2 (was 2.1.1).

There is a new module
System.Win32.Security
providing POSIX shared memory support.

1.6.5. GHC As A Library

Version number 6.8.1.

The API should now be much more usable than in previous
releases.

There is a new function

compileToCore :: Session -> FilePath -> IO (Maybe [CoreBind])

which compiles a file to core.

There is a new value defaultObjectTarget
that gives the HscTarget used by default.
This name is now preferred to defaultHscTarget.