1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="release-7-0-1">
3 <title>Release notes for version 7.0.1</title>
6 The significant changes to the various parts of the compiler are
7 listed in the following sections. There have also been numerous bug
8 fixes and performance improvements over the 6.12 branch.
12 <title>Highlights</title>
16 GHC now defaults to the Haskell 2010 language standard.
20 Libraries are not quite so straightforward. By default, GHC
21 provides access to the <literal>base</literal> package,
22 which includes the Haskell 2010 libraries, albeit with a few
23 minor differences. For those who want to write strictly
24 standards-conforming code we also provide
25 the <literal>haskell2010</literal> package which provides
26 the precise APIs specified by Haskell 2010, but because the
27 module names in this package overlap with those in
28 the <literal>base</literal> package it is not possible to
29 use both <literal>haskell2010</literal>
30 and <literal>base</literal> at the same time (this also
31 applies to the <literal>array</literal> package). Hence to use
32 the Haskell 2010 libraries you should hide
33 the <literal>base</literal> and <literal>array</literal>
34 packages, for example with GHCi:
36 $ ghci -package haskell2010 -hide-package base -hide-package array
38 If you are using Cabal it isn't necessary to
39 hide <literal>base</literal> and <literal>array</literal>
40 explicitly, just don't include them in your <literal>build-depends</literal>.
46 On POSIX platforms, there is a new I/O manager based on
47 epoll/kqueue/poll, which allows multithreaded I/O code to
48 scale to a much larger number (100k+) of threads.
54 GHC now includes an LLVM code generator. For certain code,
55 particularly arithmetic heavy code, using the LLVM code
56 generator can bring some nice performance improvements.
62 The type checker has been overhauled, which means it is now
63 able to correctly handle interactions between the type system
70 The inliner has been overhauled, which should in general
71 give better performance while reducing unnecessary code-size
78 Large parts of the runtime system have been overhauled, in
79 particular the machinery related to blocking and wakeup of
80 threads and exception throwing (<literal>throwTo</literal>).
81 Several instances of pathological performance have been
82 fixed, especially where large numbers of threads are
89 Due to changes in the runtime system, if you are
90 using <literal>Control.Parallel.Strategies</literal> from
91 the <literal>parallel</literal> package, please upgrade to
92 at least version 2 (preferably version 3). The
93 implementation of Strategies
94 in <literal>parallel-1.x</literal> will lose parallelism
101 The full Haskell <literal>import</literal> syntax can now been
102 used to bring modules into scope in GHCi, e.g.
105 Prelude> import Data.List as L
106 Prelude Data.List> L.length "foo"
113 GHC now comes with a more recent mingw bundled on Windows,
114 which includes a fix for windres on Windows 7.
121 <title>Language changes</title>
125 GHC now understands the <literal>Haskell98</literal> and
126 <literal>Haskell2010</literal> languages.
130 These get processed before the language extension pragmas,
131 and define the default sets of extensions that are enabled.
132 If neither is specified, then the default is
133 <literal>Haskell2010</literal> plus the
134 <literal>MonoPatBinds</literal> extension.
140 GHC now supports the <literal>DoAndIfThenElse</literal>
141 extension, which is part of the Haskell 2010 standard.
147 Datatype contexts, such as the <literal>Eq a</literal> in
150 data Eq a => Set a = NilSet | ConsSet a (Set a)
153 are now treated as an extension
154 <literal>DatatypeContexts</literal> (on by default) by GHC.
160 GHC's support for unicode source has been improved, including
161 removing support for U+22EF for the <literal>..</literal>
162 symbol. See <xref linkend="unicode-syntax" /> for more details.
168 Pragmas are now reread after preprocessing. In particular,
169 this means that if a pragma is used to turn CPP on, then other
170 pragmas can be put in CPP conditionals.
176 The <literal>TypeOperators</literal> extension now allows
177 instance heads to use infix syntax.
183 The <literal>PackageImports</literal> extension now understands
184 <literal>this</literal> to mean the current package.
190 The <literal>INLINE</literal> and <literal>NOINLINE</literal>
191 pragmas can now take a <literal>CONLIKE</literal> modifier,
192 which indicates that the right hand side is cheap to compute,
193 and can thus be duplicated more freely.
194 See <xref linkend="conlike" /> for more details.
200 A <literal>ForceSpecConstr</literal> annotation on a type, e.g.
204 {-# ANN type SPEC ForceSpecConstr #-}
207 can be used to force GHC to fully specialise argument of that
214 A <literal>NoSpecConstr</literal> annotation on a type, e.g.
218 {-# ANN type T NoSpecConstr #-}
221 can be used to prevent SpecConstr from specialising on
222 arguments of that type.
228 There is are two experimental new extensions
229 <literal>AlternativeLayoutRule</literal> and
230 <literal>AlternativeLayoutRuleTransitional</literal>,
231 which are for exploring alternative layout rules in Haskell'.
232 The details are subject to change, so we advise against using
233 them in real code for now.
239 The <literal>NewQualifiedOperators</literal> extension has
240 been deprecated, as it was rejected by the Haskell' committee.
247 <title>Warnings</title>
251 There is now a warning for missing import lists, controlled
252 by the new <literal>-fwarn-missing-import-lists</literal> flag.
258 GHC will now warn about <literal>SPECIALISE</literal> and
259 <literal>UNPACK</literal> pragmas that have no effect.
270 Shared libraries are once again supported on Windows.
276 Shared libraries are now supported on OS X, both on x86 and on
277 PowerPC. The new <literal>-dylib-install-name</literal> GHC
278 flag is used to set the location of the dynamic library.
279 See <xref linkend="finding-shared-libs" /> for more details.
286 <title>Runtime system</title>
291 For security reasons, by default, the only RTS flag that
292 programs accept is <literal>+RTS --info</literal>. If you want
293 the full range of RTS flags then you need to link with the new
294 <literal>-rtsopts</literal> flag. See
295 <xref linkend="options-linker" /> for more details.
301 The RTS now exports a function <literal>setKeepCAFs</literal>
302 which is important when loading Haskell DLLs dynamically, as
303 a DLL may refer to CAFs that hae already been GCed.
309 The garbage collector no longer allows you to specify a number
310 of steps; there are now always 2. The <literal>-T</literal>
311 RTS flag has thus been removed.
317 A new RTS flag <literal>-H</literal> causes the RTS to use a
318 larger nursery, but without exceeding the amount of memory
319 that the application is already using. It makes some programs
320 go slower, but others go faster.
326 GHC now returns memory to the OS, if memory usage peaks and
327 then drops again. This is mainly useful for long running
328 processes which normally use very little memory, but
329 occasionally need a lot of memory for a short period of time.
335 On OS X, eventLog events are now available as DTrace probes.
341 The PAPI support has been improved. The new RTS flag
342 <literal>-a#0x40000000</literal> can be used to tell the RTS
343 to collect the native PAPI event <literal>0x40000000</literal>.
350 <title>Compiler</title>
354 GHC now defaults to <literal>--make</literal> mode, i.e. GHC
355 will chase dependencies for you automatically by default.
361 GHC now includes an LLVM code generator.
364 This includes a number of new flags:
365 a flag to tell GHC to use LLVM, <literal>-fllvm</literal>;
366 a flag to dump the LLVM input ,<literal>-ddump-llvm</literal>;
367 flags to keep the LLVM intermediate files,
368 <literal>-keep-llvm-file</literal> and
369 <literal>-keep-llvm-files</literal>;
370 flags to set the location and options for the LLVM optimiser
372 <literal>-pgmlo</literal>,
373 <literal>-pgmlc</literal>,
374 <literal>-optlo</literal> and
375 <literal>-optlc</literal>.
376 The LLVM code generator requires LLVM version 2.7 or later on
383 It is now possible to use <literal>-fno-code</literal> with
384 <literal>--make</literal>.
390 The new flag <literal>-dsuppress-coercions</literal> controls
391 whether GHC prints coercions in core dumps.
397 The new flag <literal>-dsuppress-module-prefixes</literal>
398 controls whether GHC prints module qualification prefixes
405 The inliner has been overhauled. The most significant
406 user-visible change is that only saturated functions are
413 would only be inlined if <literal>(.)</literal> is applied to 3
417 (.) f g = \x -> f (g x)
420 will be inlined if only applied to 2 arguments.
426 The <literal>-finline-if-enough-args</literal> flag is no
433 Column numbers in warnings and error messages now start at 1,
434 as is more standard, rather than 0.
440 GHCi now understands most linker scripts. In particular, this
441 means that GHCi is able to load the C pthread library.
447 The <literal>ghc --info</literal> output has been updated:
451 location of the global package database, in the
452 <literal>Global Package DB</literal> field.
455 It now includes the build, host and target platforms, in the
456 <literal>Build platform</literal>,
457 <literal>Host platform</literal> and
458 <literal>Target platform</literal> fields.
461 It now includes a <literal>Have llvm code generator</literal>
465 The <literal>Win32 DLLs</literal> field has been removed.
471 The registerised via-C backend, and the
472 <literal>-fvia-C</literal> flag, have been deprecated. The poor
473 floating-point performance in the x86 native code generator
474 has now been fixed, so we don't believe there is still any
475 reason to use the via-C backend.
481 There is now a new flag <literal>--supported-extensions</literal>,
482 which currently behaves the same as
483 <literal>--supported-languages</literal>.
489 GHC progress output such as
492 [ 1 of 5] Compiling Foo ( Foo.hs, Foo.o )
495 is now sent to stdout rather than stderr.
501 The new flag <literal>-fexpose-all-unfoldings</literal>
502 makes GHC put unfoldings for <emphasis>everything</emphasis>
503 in the interface file.
509 There are two new flags, <literal>-fno-specialise</literal>
510 and <literal>-fno-float-in</literal>, for disabling the
511 specialise and float-in passes.
517 The new flag <literal>-fstrictness-before=<replaceable>n</replaceable></literal> tells
518 GHC to run an additional strictness analysis pass
519 before simplifier phase <replaceable>n</replaceable>.
526 <literal>-funfolding-dict-discount</literal>
527 for tweaking the optimiser's behaviour.
533 The <literal>-fspec-inline-join-points</literal> flag has been
540 The <literal>-dynload wrapper</literal> flag has been
552 GHCi now understands layout in multi-line commands, so
558 Prelude| y = 2 in x + y
567 <title>Template Haskell and Quasi-Quoters</title>
571 It is now possible to quasi-quote patterns with
572 <literal>[p| ... |]</literal>.
578 It is no longer to use a <literal>$</literal> before the
579 name of a quasi-quoter, e.g. one can now say
580 <literal>[expr| ... |]</literal> rather than
581 <literal>[$expr| ... |]</literal>.
587 It is now possible to use a quasi-quoter for types, e.g.
588 <literal>f :: [$qq| ... |]</literal>
594 It is now possible to quasi-quote existentials and GADTs.
601 <title>GHC API</title>
605 There are now <literal>Data</literal> and
606 <literal>Typeable</literal> instances for the
613 As language extensions are not applied until after the base
614 language (Haskell98, Haskell2010 or the default) has been
615 selected, it is now necessary to tell the GHC API the point
616 at which the extension flags should be processed. Normally
617 this is done by calling
618 <literal>DynFlags.flattenExtensionFlags</literal> once all
619 the flags and pragmas have been read.
626 <title>Libraries</title>
633 Version number 0.3.0.2 (was 0.3.0.1)
644 Version number 4.3.0.0 (was 4.2.0.2)
650 There is a new asynchronous exception control API
651 in <literal>Control.Exception</literal>, using the
653 <literal>mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b</literal>
654 and <literal>mask_ :: IO a -> IO a</literal>
656 <literal>block</literal> and <literal>unblock</literal>.
657 There are also functions
658 <literal>uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b</literal>
660 <literal>getMaskingState :: IO MaskingState</literal>,
662 <literal>MaskingState</literal>, as well as
663 <literal>forkIOUnmasked :: IO () -> IO ThreadId</literal>
664 in <literal>Control.Concurrent</literal>.
670 <literal>Control.Monad</literal> exports a new function
671 <literal>void :: Functor f => f a -> f ()</literal>.
677 <literal>Data.Tuple</literal> exports a new function
678 <literal>swap :: (a,b) -> (b,a)</literal>.
684 <literal>System.IO</literal> exports a new function
685 <literal>hGetBufSome :: Handle -> Ptr a -> Int -> IO Int</literal>
686 which is like <literal>hGetBuf</literal> but can
693 There is a new function
694 <literal>mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a</literal>
696 <literal>Control.Monad</literal>.
702 The <literal>Foreign.Marshal</literal> module now
704 <literal>unsafeLocalState :: IO a -> a</literal>
705 as specified by Haskell 2010.
711 The <literal></literal>
712 module now exports four new functions specified by
714 <literal>castCUCharToChar :: CUChar -> Char</literal>,
715 <literal>castCharToCUChar :: Char -> CUChar</literal>,
716 <literal>castCSCharToChar :: CSChar -> Char</literal> and
717 <literal>castCharToCSChar :: Char -> CSChar</literal>.
723 The <literal>Foreign.Marshal.Alloc</literal>
725 <literal>allocaBytesAligned :: Int -> Int -> (Ptr a -> IO b) -> IO b</literal>
726 for allocating memory with a particular alignment.
732 There is a new function
733 <literal>numSparks :: IO Int</literal>
734 in <literal>GHC.Conc</literal>.
740 <literal>Data.Either.partitionEithers</literal>
747 There is now a <literal>Typeable</literal> instance for
748 <literal>Data.Unique.Unique</literal>.
754 <literal>Control.Concurrent.SampleVar.SampleVar</literal>
755 is now an abstract type.
762 <literal>Applicative</literal>,
763 <literal>Alternative</literal> and
764 <literal>MonadPlus</literal>
765 instances for <literal>STM</literal>.
771 There are now <literal>Applicative</literal>,
772 <literal>Monad</literal> and
773 <literal>MonadFix</literal>
774 instances for <literal>Either</literal>.
781 <literal>Ord</literal>,
782 <literal>Read</literal> and
783 <literal>Show</literal> instances for
784 <literal>Newline</literal> and
785 <literal>NewlineMode</literal>.
791 There is now a <literal>Show</literal> instance for
792 <literal>TextEncoding</literal>.
798 The <literal>unGetChan</literal> and
799 <literal>isEmptyChan</literal> functions in
800 <literal>Control.Concurrent.Chan</literal> are now
802 <literal>Control.Concurrent.STM.TChan</literal>
803 should be used instead if you need that
810 The <literal>Read Integer</literal> instance now
811 matches the standard definition.
818 <title>base 3 compat</title>
822 We no longer ship a base 3 compat package
829 <title>bin-package-db</title>
833 This is an internal package, and should not be used.
840 <title>bytestring</title>
844 Version number 0.9.1.8 (was 0.9.1.7)
855 Version number 1.10.0.0 (was 1.8.0.6)
861 Many API changes. See the Cabal docs for more information.
868 <title>containers</title>
872 Version number 0.4.0.0 (was 0.3.0.0)
878 Strictness is now more consistent, with containers
879 being strict in their elements even in singleton
886 There is a new function
887 <literal>insertLookupWithKey'</literal> in
888 <literal>Data.Map</literal>.
894 The <literal>foldWithKey</literal> function in
895 <literal>Data.Map</literal> has been deprecated in
896 favour of <literal>foldrWithKey</literal>.
903 <title>directory</title>
907 Version number 1.1.0.0 (was 1.0.1.1)
913 The <literal>System.Directory</literal> module
914 now exports the <literal>Permissions</literal> type
915 abstractly. There are also new functions
916 <literal>setOwnerReadable</literal>,
917 <literal>setOwnerWritable</literal>,
918 <literal>setOwnerExecutable</literal> and
919 <literal>setOwnerSearchable</literal>, and
920 a new value <literal>emptyPermissions</literal>.
929 (dph-base, dph-par, dph-prim-interface, dph-prim-par,
930 dph-prim-seq, dph-seq)
935 All the dph packages are version 0.4.0.
942 <title>extensible-exceptions</title>
946 Version number 0.1.1.2 (was 0.1.1.1)
953 <title>filepath</title>
957 Version number 1.2.0.0 (was 1.1.0.4)
963 The current directory is now <literal>"."</literal>
964 rather than <literal>""</literal>.
971 <title>ghc-binary</title>
975 This is an internal package, and should not be used.
982 <title>ghc-prim</title>
986 This is an internal package, and should not be used.
993 <title>haskell98</title>
997 Version number 1.1.0.0 (was 1.0.1.1)
1003 In the <literal>Directory</literal> module, the
1004 <literal>Permissions</literal> type and the
1005 <literal>getPermissions</literal> and
1006 <literal>setPermissions</literal> functions are now
1007 different to their equivalents in
1008 <literal>base:System.Directory</literal>.
1015 <title>haskell2010</title>
1019 This is a new boot package, version 1.0.0.0.
1020 It is not exposed by default.
1031 Version number 0.5.0.6 (was 0.5.0.5)
1038 <title>integer-gmp</title>
1042 Version number 0.2.0.2 (was 0.2.0.1)
1049 <title>old-locale</title>
1053 No change (version 1.0.0.2)
1060 <title>old-time</title>
1064 Version number 1.0.0.6 (was 1.0.0.5)
1071 <title>pretty</title>
1075 Version number 1.0.1.2 (was 1.0.1.1)
1082 <title>process</title>
1086 Version number 1.0.1.4 (was 1.0.1.3)
1093 <title>random</title>
1097 Version number 1.0.0.3 (was 1.0.0.2)
1108 The syb package is no longer included with GHC.
1115 <title>template-haskell</title>
1119 Version number 2.5.0.0 (was 2.4.0.1)
1125 There is a new type synonym <literal>DecsQ</literal>
1126 in <literal>Language.Haskell.TH.Lib</literal>.
1132 There is a new <literal>StringPrimL</literal>
1134 <literal>Language.Haskell.TH.Syntax.Lit</literal>,
1135 and a new helper function
1136 <literal>stringPrimL</literal> for it in
1137 <literal>Language.Haskell.TH.Lib</literal>.
1143 There is a new function <literal>quoteFile</literal>
1144 in <literal>Language.Haskell.TH.Quote</literal>.
1151 <literal>Language.Haskell.TH.Quote.QuasiQuoter</literal>
1152 type has two new fields:
1153 <literal>quoteType</literal> and
1154 <literal>quoteDec</literal>.
1160 There is a new <literal>ClassInstance</literal>
1161 type in <literal>Language.Haskell.TH.Syntax</literal>.
1163 <literal>Language.Haskell.TH.Syntax.Info.ClassI</literal>
1164 constructor now includes a value of this type, which
1165 allows instance information to be queried via the
1166 new <literal>isClassInstance</literal>
1167 and <literal>classInstances</literal> functions.
1168 There is also a new method
1169 <literal>qClassInstances</literal> in the
1170 <literal>Quasi</literal> class.
1181 Version number 1.2.0.3 (was 1.1.4)
1187 The types provided by the time package now include
1188 <literal>Data</literal> instances.
1199 Version number 2.4.1.0 (was 2.4.0.2)
1205 There are three new helper function in
1206 <literal>System.Posix.Error</literal>:
1207 <literal>throwErrnoPathIfRetry</literal>,
1208 <literal>throwErrnoPathIfNullRetry</literal> and
1209 <literal>throwErrnoPathIfMinus1Retry</literal>.
1215 There are three new functions in
1216 <literal>System.Posix.User</literal>:
1217 <literal>setEffectiveUserID</literal>,
1218 <literal>setEffectiveGroupID</literal> and
1219 <literal>setGroups</literal>.