Merge a duplicate release note
[ghc-hetmet.git] / docs / users_guide / 6.14.1-notes.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="release-6-14-1">
3   <title>Release notes for version 6.14.1</title>
4
5   <para>
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.
9   </para>
10
11   <sect2>
12     <title>Highlights</title>
13     <itemizedlist>
14       <listitem>
15         <para>
16           Due to changes in the runtime system, version 2.0 or later
17           (preferably version 2.2 or later) of the
18           <literal>parallel</literal> library should be used, or
19           parallelism will be lost.
20         </para>
21       </listitem>
22
23       <listitem>
24         <para>
25           The full Haskell <literal>import</literal> syntax can now been
26           used to bring modules into scope in GHCi, e.g.
27         </para>
28 <programlisting>
29 Prelude> import Data.List as L
30 Prelude Data.List> L.length "foo"
31 3
32 </programlisting>
33       </listitem>
34     </itemizedlist>
35   </sect2>
36
37   <sect2>
38     <title>Language changes</title>
39     <itemizedlist>
40       <listitem>
41         <para>
42           GHC now understands the <literal>Haskell98</literal> and
43           <literal>Haskell2010</literal> languages.
44         </para>
45
46         <para>
47           These get processed before the language extension pragmas,
48           and define the default sets of extensions that are enabled.
49           If neither is specified, then the default is
50           <literal>Haskell2010</literal> plus the
51           <literal>MonoPatBinds</literal> extension.
52         </para>
53       </listitem>
54
55       <listitem>
56         <para>
57           GHC now supports the <literal>DoAndIfThenElse</literal>
58           extension, which is part of the Haskell 2010 standard.
59         </para>
60       </listitem>
61
62       <listitem>
63         <para>
64           Datatype contexts, such as the <literal>Eq a</literal> in
65         </para>
66 <programlisting>
67 data Eq a => Set a = NilSet | ConsSet a (Set a)
68 </programlisting>
69         <para>
70           are now treated as an extension
71           <literal>DatatypeContexts</literal> (on by default) by GHC.
72         </para>
73       </listitem>
74
75       <listitem>
76         <para>
77           GHC's support for unicode source has been improved, including
78           removing support for U+22EF for the <literal>..</literal>
79           symbol. See <xref linkend="unicode-syntax" /> for more details.
80         </para>
81       </listitem>
82
83       <listitem>
84         <para>
85           Pragmas are now reread after preprocessing. In particular,
86           this means that if a pragma is used to turn CPP on, then other
87           pragmas can be put in CPP conditionals.
88         </para>
89       </listitem>
90
91       <listitem>
92         <para>
93           The <literal>TypeOperators</literal> extension now allows
94           instance heads to use infix syntax.
95         </para>
96       </listitem>
97
98       <listitem>
99         <para>
100           The <literal>PackageImports</literal> extension now understands
101           <literal>this</literal> to mean the current package.
102         </para>
103       </listitem>
104
105       <listitem>
106         <para>
107           The <literal>INLINE</literal> and <literal>NOINLINE</literal>
108           pragmas can now take a <literal>CONLIKE</literal> modifier,
109           which indicates that the right hand side is cheap to compute,
110           and can thus be duplicated more freely.
111           See <xref linkend="conlike" /> for more details.
112         </para>
113       </listitem>
114
115       <listitem>
116         <para>
117           A <literal>ForceSpecConstr</literal> annotation on a type, e.g.
118         </para>
119 <programlisting>
120 import SpecConstr
121 {-# ANN type SPEC ForceSpecConstr #-}
122 </programlisting>
123         <para>
124           can be used to force GHC to fully specialise argument of that
125           type.
126         </para>
127       </listitem>
128
129       <listitem>
130         <para>
131           A <literal>NoSpecConstr</literal> annotation on a type, e.g.
132         </para>
133 <programlisting>
134 import SpecConstr
135 {-# ANN type T NoSpecConstr #-}
136 </programlisting>
137         <para>
138           can be used to prevent SpecConstr from specialising on
139           arguments of that type.
140         </para>
141       </listitem>
142
143       <listitem>
144         <para>
145           There is are two experimental new extensions
146           <literal>AlternativeLayoutRule</literal> and
147           <literal>AlternativeLayoutRuleTransitional</literal>,
148           which are for exploring alternative layout rules in Haskell'.
149           The details are subject to change, so we advise against using
150           them in real code for now.
151         </para>
152       </listitem>
153
154       <listitem>
155         <para>
156           The <literal>NewQualifiedOperators</literal> extension has
157           been deprecated, as it was rejected by the Haskell' committee.
158         </para>
159       </listitem>
160     </itemizedlist>
161   </sect2>
162
163   <sect2>
164     <title>Warnings</title>
165     <itemizedlist>
166       <listitem>
167         <para>
168           There is now a warning for missing import lists, controlled
169           by the new <literal>-fwarn-missing-import-lists</literal> flag.
170         </para>
171       </listitem>
172
173       <listitem>
174         <para>
175           GHC will now warn about <literal>SPECIALISE</literal> and
176           <literal>UNPACK</literal> pragmas that have no effect.
177         </para>
178       </listitem>
179     </itemizedlist>
180   </sect2>
181
182   <sect2>
183     <title>DLLs</title>
184     <itemizedlist>
185       <listitem>
186         <para>
187           Shared libraries are once again supported on Windows.
188         </para>
189       </listitem>
190
191       <listitem>
192         <para>
193           Shared libraries are now supported on OS X, both on x86 and on
194           PowerPC. The new <literal>-dylib-install-name</literal> GHC
195           flag is used to set the location of the dynamic library.
196           See <xref linkend="finding-shared-libs" /> for more details.
197         </para>
198       </listitem>
199     </itemizedlist>
200   </sect2>
201
202   <sect2>
203     <title>Runtime system</title>
204
205     <itemizedlist>
206       <listitem>
207         <para>
208           For security reasons, by default, the only RTS flag that
209           programs accept is <literal>+RTS --info</literal>. If you want
210           the full range of RTS flags then you need to link with the new
211           <literal>-rtsopts</literal> flag. See
212           <xref linkend="options-linker" /> for more details.
213         </para>
214       </listitem>
215
216       <listitem>
217         <para>
218           The RTS now exports a function <literal>setKeepCAFs</literal>
219           which is important when loading Haskell DLLs dynamically, as
220           a DLL may refer to CAFs that hae already been GCed.
221         </para>
222       </listitem>
223
224       <listitem>
225         <para>
226           The garbage collector no longer allows you to specify a number
227           of steps; there are now always 2. The <literal>-T</literal>
228           RTS flag has thus been removed.
229         </para>
230       </listitem>
231
232       <listitem>
233         <para>
234           A new RTS flag <literal>-H</literal> causes the RTS to use a
235           larger nursery, but without exceeding the amount of memory
236           that the application is already using. It makes some programs
237           go slower, but others go faster.
238         </para>
239       </listitem>
240
241       <listitem>
242         <para>
243           GHC now returns memory to the OS, if memory usage peaks and
244           then drops again. This is mainly useful for long running
245           processes which normally use very little memory, but
246           occasionally need a lot of memory for a short period of time.
247         </para>
248       </listitem>
249
250       <listitem>
251         <para>
252           On OS X, eventLog events are now available as DTrace probes.
253         </para>
254       </listitem>
255
256       <listitem>
257         <para>
258           The PAPI support has been improved. The new RTS flag
259           <literal>-a#0x40000000</literal> can be used to tell the RTS
260           to collect the native PAPI event <literal>0x40000000</literal>.
261         </para>
262       </listitem>
263     </itemizedlist>
264   </sect2>
265
266   <sect2>
267     <title>Compiler</title>
268     <itemizedlist>
269       <listitem>
270         <para>
271           GHC now defaults to <literal>--make</literal> mode, i.e. GHC
272           will chase dependencies for you automatically by default.
273         </para>
274       </listitem>
275
276       <listitem>
277         <para>
278           GHC now includes an LLVM code generator.
279         </para>
280         <para>
281           This includes a number of new flags:
282           a flag to tell GHC to use LLVM, <literal>-fllvm</literal>;
283           a flag to dump the LLVM input ,<literal>-ddump-llvm</literal>;
284           flags to keep the LLVM intermediate files,
285           <literal>-keep-llvm-file</literal> and
286           <literal>-keep-llvm-files</literal>;
287           flags to set the location and options for the LLVM assembler,
288           optimiser and compiler,
289           <literal>-pgmla</literal>,
290           <literal>-pgmlo</literal>,
291           <literal>-pgmlc</literal>,
292           <literal>-optla</literal>,
293           <literal>-optlo</literal> and
294           <literal>-optlc</literal>.
295         </para>
296       </listitem>
297
298       <listitem>
299         <para>
300           It is now possible to use <literal>-fno-code</literal> with
301           <literal>--make</literal>.
302         </para>
303       </listitem>
304
305       <listitem>
306         <para>
307           The new flag <literal>-dsuppress-coercions</literal> controls
308           whether GHC prints coercions in core dumps.
309         </para>
310       </listitem>
311
312       <listitem>
313         <para>
314           The inliner has been overhauled. The most significant
315           user-visible change is that only saturated functions are
316           inlined, e.g.
317         </para>
318 <programlisting>
319 (.) f g x = f (g x)
320 </programlisting>
321         <para>
322           would only be inlined if <literal>(.)</literal> is applied to 3
323           arguments, while
324         </para>
325 <programlisting>
326 (.) f g = \x -> f (g x)
327 </programlisting>
328         <para>
329           will be inlined if only applied to 2 arguments.
330         </para>
331       </listitem>
332
333       <listitem>
334         <para>
335           The <literal>-finline-if-enough-args</literal> flag is no
336           longer supported.
337         </para>
338       </listitem>
339
340       <listitem>
341         <para>
342           Column numbers in warnings and error messages now start at 1,
343           as is more standard, rather than 0.
344         </para>
345       </listitem>
346
347       <listitem>
348         <para>
349           GHCi now understands most linker scripts. In particular, this
350           means that GHCi is able to load the C pthread library.
351         </para>
352       </listitem>
353
354       <listitem>
355         <para>
356           The <literal>ghc --info</literal> output has been updated:
357         </para>
358         <para>
359           It now includes the
360           location of the global package database, in the
361           <literal>Global Package DB</literal> field.
362         </para>
363         <para>
364           It now includes the build, host and target platforms, in the
365           <literal>Build platform</literal>,
366           <literal>Host platform</literal> and
367           <literal>Target platform</literal> fields.
368         </para>
369         <para>
370           It now includes a <literal>Have llvm code generator</literal>
371           field.
372         </para>
373         <para>
374           The <literal>Win32 DLLs</literal> field has been removed.
375         </para>
376       </listitem>
377
378       <listitem>
379         <para>
380           The registerised via-C backend, and the
381           <literal>-fvia-C</literal>, have been deprecated. The poor
382           floating-point performance in the x86 native code generator
383           has now been fixed, so we don't believe there is still any
384           reason to use the via-C backend.
385         </para>
386       </listitem>
387
388       <listitem>
389         <para>
390           There is now a new flag <literal>--supported-extensions</literal>,
391           which currently behaves the same as
392           <literal>--supported-languages</literal>.
393         </para>
394       </listitem>
395
396       <listitem>
397         <para>
398           GHC progress output such as
399         </para>
400 <programlisting>
401 [ 1 of 5] Compiling Foo              ( Foo.hs, Foo.o )
402 </programlisting>
403         <para>
404           is now sent to stdout rather than stderr.
405         </para>
406       </listitem>
407
408       <listitem>
409         <para>
410           The new flag <literal>-fexpose-all-unfoldings</literal>
411           makes GHC put unfoldings for <emphasis>everything</emphasis>
412           in the interface file.
413         </para>
414       </listitem>
415
416       <listitem>
417         <para>
418           There are two new flags, <literal>-fno-specialise</literal>
419           and <literal>-fno-float-in</literal>, for disabling the
420           specialise and float-in passes.
421         </para>
422       </listitem>
423
424       <listitem>
425         <para>
426           The new flag <literal>-fstrictness-before=<replaceable>n</replaceable></literal> tells
427           GHC to run an additional strictness analysis pass
428           before simplifier phase <replaceable>n</replaceable>.
429         </para>
430       </listitem>
431
432       <listitem>
433         <para>
434           There is a new flag
435           <literal>-funfolding-dict-discount</literal>
436           for tweaking the optimiser's behaviour.
437         </para>
438       </listitem>
439
440       <listitem>
441         <para>
442           The <literal>-fspec-inline-join-points</literal> flag has been
443           removed.
444         </para>
445       </listitem>
446     </itemizedlist>
447   </sect2>
448
449   <sect2>
450     <title>GHCi</title>
451     <itemizedlist>
452       <listitem>
453         <para>
454           GHCi now understands the layout of multiline-commands, so
455           this now works:
456         </para>
457 <programlisting>
458 Prelude> :{
459 Prelude| let x = 1
460 Prelude|     y = 2 in x + y
461 Prelude| :}
462 3
463 </programlisting>
464       </listitem>
465     </itemizedlist>
466   </sect2>
467
468   <sect2>
469     <title>Template Haskell and Quasi-Quoters</title>
470     <itemizedlist>
471       <listitem>
472         <para>
473           It is now possible to quasi-quote patterns with
474           <literal>[p| ... |]</literal>.
475         </para>
476       </listitem>
477
478       <listitem>
479         <para>
480           It is no longer to use a <literal>$</literal> before the
481           name of a quasi-quoter, e.g. one can now say
482           <literal>[expr| ... |]</literal> rather than
483           <literal>[$expr| ... |]</literal>.
484         </para>
485       </listitem>
486
487       <listitem>
488         <para>
489           It is now possible to use a quasi-quoter for types, e.g.
490           <literal>f :: [$qq| ... |]</literal>
491         </para>
492       </listitem>
493
494       <listitem>
495         <para>
496           It is now possible to quasi-quote existentials and GADTs.
497         </para>
498       </listitem>
499     </itemizedlist>
500   </sect2>
501
502   <sect2>
503     <title>GHC API</title>
504     <itemizedlist>
505       <listitem>
506         <para>
507           There are now <literal>Data</literal> and
508           <literal>Typeable</literal> instances for the
509           HsSyn typed.
510         </para>
511       </listitem>
512
513       <listitem>
514         <para>
515           As language extensions are not applied until after the base
516           language (Haskell98, Haskell2010 or the default) has been
517           selected, it is now necessary to tell the GHC API the point
518           at which the extension flags should be processed. Normally
519           this is done by calling
520           <literal>DynFlags.flattenExtensionFlags</literal> once all
521           the flags and pragmas have been read.
522         </para>
523       </listitem>
524     </itemizedlist>
525   </sect2>
526
527 <!--
528   <sect2>
529     <title>Libraries</title>
530
531     <itemizedlist>
532     </itemizedlist>
533   </sect2>
534 -->
535 </sect1>
536