Add release notes for the compiler
[ghc-hetmet.git] / docs / users_guide / 6.10.1-notes.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="release-6-10-1">
3   <title>Release notes for version 6.10.1</title>
4
5   <para>
6     The significant changes to the various parts of the compiler are
7     listed in the following sections.
8   </para>
9
10   <sect2>
11     <title>User-visible compiler changes</title>
12     <itemizedlist>
13       <listitem>
14         <para>
15           The new QuasiQuotes language extension adds
16           general quasi-quotation, as described in
17           "Nice to be Quoted: Quasiquoting for Haskell"
18           (Geoffrey Mainland, Haskell Workshop 2007).
19           See <xref linkend="th-quasiquotation" /> for more information.
20         </para>
21       </listitem>
22       <listitem>
23         <para>
24           The new ViewPatterns language extension allows
25           &quot;view patterns&quot;. The syntax for view patterns
26           is <literal>expression -> pattern</literal> in a pattern.
27           For more information, see <xref linkend="view-patterns" />.
28         </para>
29       </listitem>
30       <listitem>
31         <para>
32           GHC already supported (e op) postfix operators, but this
33           support was enabled by default. Now you need to use the
34           PostfixOperators language extension if you want it.
35           See <xref linkend="postfix-operators" /> for more information
36           on postfix operators.
37         </para>
38       </listitem>
39       <listitem>
40         <para>
41           The new TransformListComp language extension enables
42           implements generalised list comprehensions, as described in
43           the paper "Comprehensive comprehensions" (Peyton Jones &amp;
44           Wadler, Haskell Workshop 2007).
45           For more information see
46           <xref linkend="generalised-list-comprehensions" />.
47         </para>
48       </listitem>
49       <listitem>
50         <para>
51           If you want to use impredicative types then you now need to
52           enable the ImpredicativeTypes language extension.
53           See <xref linkend="impredicative-polymorphism" /> for more
54           information.
55         </para>
56       </listitem>
57       <listitem>
58         <para>
59           There is a new languages extension PackageImports which allows
60           imports to be qualified with the package they should come
61           from, e.g.
62         </para>
63 <programlisting>
64 import "network" Network.Socket
65 </programlisting>
66         <para>
67           See <xref linkend="package-imports" /> for more details.
68         </para>
69       </listitem>
70       <listitem>
71         <para>
72           In earlier versions of GHC, the recompilation checker didn't
73           notice changes in other packages meant that recompilation is
74           needed. This is now handled properly, using MD5 checksums of
75           the interface ABIs.
76         </para>
77       </listitem>
78       <listitem>
79         <para>
80           When compiling with <literal>-fvia-C</literal>, we no longer
81           use the C header files. Instead we rely on all the type
82           information being given as part of the FFI import declaration.
83           This makes it more consistent with <literal>-fasm</literal>.
84         </para>
85         <para>
86           This means that, unlike <literal>-fasm</literal>,
87           <literal>-fvia-C</literal> is no longer able to
88           call varargs functions.
89         </para>
90         <para>
91           Also, if you were using <literal>-fvia-C</literal> because
92           your program didn't work with <literal>-fasm</literal>, then
93           it probably won't work with <literal>-fvia-C</literal> either
94           now.
95         </para>
96         <para>
97           We recommend using <literal>-fasm</literal> (the default).
98           We expect to remove the <literal>-fvia-C</literal>
99           functionality in the 6.12 release.
100         </para>
101       </listitem>
102       <listitem>
103         <para>
104           GHC now treats the Unicode "Letter, Other" class as lowercase
105           letters. This is an arbitrary choice, but better than not
106           allowing them in identifiers at all. This may be revisited
107           by Haskell'.
108         </para>
109       </listitem>
110       <listitem>
111         <para>
112           In addition to the <literal>DEPRECATED</literal> pragma, you
113           can now attach arbitrary warnings to declarations with the new
114           <literal>WARNING</literal> pragma. See
115           <xref linkend="warning-deprecated-pragma" /> for more details.
116         </para>
117       </listitem>
118       <listitem>
119         <para>
120           If GHC is failing due to <literal>-Werror</literal>, then it
121           now emits a message telling you so.
122         </para>
123       </listitem>
124       <listitem>
125         <para>
126           GHC now warns about unrecognised pragmas, as they are often
127           caused by a typo. The
128           <literal>-fwarn-unrecognised-pragmas</literal> controls
129           whether this warning is emitted.
130           The warning is enabled by default.
131         </para>
132       </listitem>
133       <listitem>
134         <para>
135           There is a new flag
136           <literal>-fwarn-dodgy-foreign-imports</literal> which controls
137           a new warning about FFI delcarations of the form
138         </para>
139 <programlisting>
140 foreign import "f" f :: FunPtr t
141 </programlisting>
142         <para>
143           on the grounds that it is probably meant to be
144         </para>
145 <programlisting>
146 foreign import "&amp;f" f :: FunPtr t
147 </programlisting>
148         <para>
149           The warning is enabled by default.
150         </para>
151       </listitem>
152       <listitem>
153         <para>
154           External core (output only) is working again.
155         </para>
156       </listitem>
157       <listitem>
158         <para>
159           There is a new flag <literal>-dsuppress-uniques</literal> that
160           makes GHC's intermediate core easier to read. This flag cannot
161           be used when actually generating code.
162         </para>
163       </listitem>
164       <listitem>
165         <para>
166           There is a new flag <literal>-dno-debug-output</literal> that
167           suppresses all of the debug information when running a
168           compiler built with the <literal>DEBUG</literal> option.
169         </para>
170       </listitem>
171       <listitem>
172         <para>
173           A bug in earlier versions of GHC meant that sections didn't
174           always need to be parenthesised, e.g.
175           <literal>(+ 1, 2)</literal> was accepted. This has now been
176           fixed.
177         </para>
178       </listitem>
179       <listitem>
180         <para>
181           The <literal>-fspec-threshold</literal> flag has been replaced
182           by <literal>-fspec-constr-threshold</literal> and
183           <literal>-fliberate-case-threshold</literal> flags.
184           The thresholds can be disabled by
185           <literal>-fno-spec-constr-threshold</literal> and
186           <literal>-fno-liberate-case-threshold</literal>.
187         </para>
188       </listitem>
189       <listitem>
190         <para>
191           The new flag <literal>-fsimplifier-phases</literal>
192           controls the number of simplifier phases run during
193           optimisation. These are numbered from n to 1 (by default, n=2).
194           Phase 0 is always run regardless of this flag.
195         </para>
196       </listitem>
197       <listitem>
198         <para>
199           Simplifier phases can have an arbitrary number of tags
200           assigned to them, and multiple phases can share the same tags.
201           The tags can be used as arguments to the new flag
202           <literal>-ddump-simpl-phases</literal>
203           to specify which phases are to be dumped.
204         </para>
205
206         <para>
207           For example,
208           <literal>-ddump-simpl-phases=main</literal> will dump the
209           output of phases 2, 1 and 0 of the initial simplifier run
210           (they all share the "main" tag) while
211           <literal>-ddump-simpl-phases=main:0</literal>
212           will dump only the output of phase 0 of that run.
213         </para>
214
215         <para>
216           At the moment, the supported tags are
217           main (the main, staged simplifier run (before strictness)),
218           post-worker-wrapper (after the w/w split),
219           post-liberate-case  (after LiberateCase), and
220           final (final clean-up run)
221         </para>
222
223         <para>
224           The names are somewhat arbitrary and will change in the future.
225         </para>
226       </listitem>
227       <listitem>
228         <para>
229           The <literal>-fno-method-sharing</literal> flag is now
230           dynamic (it used to be static).
231         </para>
232       </listitem>
233     </itemizedlist>
234   </sect2>
235
236   <sect2>
237     <title>Deprecated flags</title>
238
239     <itemizedlist>
240       <listitem>
241         <para>
242           The new flag <literal>-fwarn-deprecated-flags</literal>,
243           controls whether we warn about deprecated flags and language
244           extensions. The warning is on by default.
245         </para>
246       </listitem>
247       <listitem>
248         <para>
249           The following language extensions are now marked as
250           deprecated; expect them to be removed in a future release:
251         </para>
252         <itemizedlist>
253           <listitem>
254             <para>
255               <literal>RecordPuns</literal>
256               (use <literal>NamedFieldPuns</literal> instead)
257             </para>
258           </listitem>
259           <listitem>
260             <para>
261               <literal>PatternSignatures</literal>
262               (use <literal>ScopedTypeVariables</literal> instead)
263             </para>
264           </listitem>
265         </itemizedlist>
266       </listitem>
267       <listitem>
268         <para>
269           The following flags are now marked as deprecated;
270           expect them to be removed in a future release:
271         </para>
272         <itemizedlist>
273           <listitem>
274             <para>
275               <literal>-Onot</literal>
276               (use <literal>-O0</literal> instead)
277             </para>
278           </listitem>
279           <listitem>
280             <para>
281               <literal>-Wnot</literal>
282               (use <literal>-w</literal> instead)
283             </para>
284           </listitem>
285           <listitem>
286             <para>
287               <literal>-frewrite-rules</literal>
288               (use <literal>-fenable-rewrite-rules</literal> instead)
289             </para>
290           </listitem>
291           <listitem>
292             <para>
293               <literal>-no-link</literal>
294               (use <literal>-c</literal> instead)
295             </para>
296           </listitem>
297           <listitem>
298             <para>
299               <literal>-recomp</literal>
300               (use <literal>-fno-force-recomp</literal> instead)
301             </para>
302           </listitem>
303           <listitem>
304             <para>
305               <literal>-no-recomp</literal>
306               (use <literal>-fforce-recomp</literal> instead)
307             </para>
308           </listitem>
309           <listitem>
310             <para>
311               <literal>-syslib</literal>
312               (use <literal>-package</literal> instead)
313             </para>
314           </listitem>
315           <listitem>
316             <para>
317               <literal>-fth</literal>
318               (use the <literal>TemplateHaskell</literal> language
319               extension instead)
320             </para>
321           </listitem>
322           <listitem>
323             <para>
324               <literal>-ffi</literal>, <literal>-fffi</literal>
325               (use the <literal>ForeignFunctionInterface</literal>
326               extension instead)
327             </para>
328           </listitem>
329           <listitem>
330             <para>
331               <literal>-farrows</literal>
332               (use the <literal>Arrows</literal> language
333               extension instead)
334             </para>
335           </listitem>
336           <listitem>
337             <para>
338               <literal>-fgenerics</literal>
339               (use the <literal>Generics</literal> language
340               extension instead)
341             </para>
342           </listitem>
343           <listitem>
344             <para>
345               <literal>-fno-implicit-prelude</literal>
346               (use the <literal>NoImplicitPrelude</literal> language
347               extension instead)
348             </para>
349           </listitem>
350           <listitem>
351             <para>
352               <literal>-fbang-patterns</literal>
353               (use the <literal>BangPatterns</literal> language
354               extension instead)
355             </para>
356           </listitem>
357           <listitem>
358             <para>
359               <literal>-fno-monomorphism-restriction</literal>
360               (use the <literal>NoMonomorphismRestriction</literal> language
361               extension instead)
362             </para>
363           </listitem>
364           <listitem>
365             <para>
366               <literal>-fmono-pat-binds</literal>
367               (use the <literal>MonoPatBinds</literal> language
368               extension instead)
369             </para>
370           </listitem>
371           <listitem>
372             <para>
373               <literal>-fextended-default-rules</literal>
374               (use the <literal>ExtendedDefaultRules</literal> language
375               extension instead)
376             </para>
377           </listitem>
378           <listitem>
379             <para>
380               <literal>-fimplicit-params</literal>
381               (use the <literal>ImplicitParams</literal> language
382               extension instead)
383             </para>
384           </listitem>
385           <listitem>
386             <para>
387               <literal>-fscoped-type-variables</literal>
388               (use the <literal>ScopedTypeVariables</literal> language
389               extension instead)
390             </para>
391           </listitem>
392           <listitem>
393             <para>
394               <literal>-fparr</literal>
395               (use the <literal>PArr</literal> language
396               extension instead)
397             </para>
398           </listitem>
399           <listitem>
400             <para>
401               <literal>-fallow-overlapping-instances</literal>
402               (use the <literal>OverlappingInstances</literal> language
403               extension instead)
404             </para>
405           </listitem>
406           <listitem>
407             <para>
408               <literal>-fallow-undecidable-instances</literal>
409               (use the <literal>UndecidableInstances</literal> language
410               extension instead)
411             </para>
412           </listitem>
413           <listitem>
414             <para>
415               <literal>-fallow-incoherent-instances</literal>
416               (use the <literal>IncoherentInstances</literal> language
417               extension instead)
418             </para>
419           </listitem>
420           <listitem>
421             <para>
422               <literal>-optdep-s</literal>
423               (use <literal>-dep-suffix</literal> instead)
424             </para>
425           </listitem>
426           <listitem>
427             <para>
428               <literal>-optdep-f</literal>
429               (use <literal>-dep-makefile</literal> instead)
430             </para>
431           </listitem>
432           <listitem>
433             <para>
434               <literal>-optdep-w</literal>
435               (has no effect)
436             </para>
437           </listitem>
438           <listitem>
439             <para>
440               <literal>-optdep--include-prelude</literal>
441               (use <literal>-include-pkg-deps</literal> instead)
442             </para>
443           </listitem>
444           <listitem>
445             <para>
446               <literal>-optdep--include-pkg-deps</literal>
447               (use <literal>-include-pkg-deps</literal> instead)
448             </para>
449           </listitem>
450           <listitem>
451             <para>
452               <literal>-optdep--exclude-module</literal>
453               (use <literal>-exclude-module</literal> instead)
454             </para>
455           </listitem>
456           <listitem>
457             <para>
458               <literal>-optdep-x</literal>
459               (use <literal>-exclude-module</literal> instead)
460             </para>
461           </listitem>
462         </itemizedlist>
463       </listitem>
464       <listitem>
465         <para>
466           The following flags have been removed:
467         </para>
468         <itemizedlist>
469           <listitem>
470             <para>
471               <literal>-no-link-chk</literal>
472               (has been a no-op since at least 6.0)
473             </para>
474           </listitem>
475           <listitem>
476             <para>
477               <literal>-fruntime-types</literal>
478               (has not been used for years)
479             </para>
480           </listitem>
481           <listitem>
482             <para>
483               <literal>-fhardwire-lib-paths</literal>
484               (use <literal>-dynload sysdep</literal>)
485             </para>
486           </listitem>
487         </itemizedlist>
488       </listitem>
489       <listitem>
490         <para>
491           The <literal>-unreg</literal> flag, which was used to build
492           unregisterised code with a registerised compiler, has been
493           removed. Now you need to build an unregisterised compiler
494           if you want to build unregisterised code.
495         </para>
496       </listitem>
497     </itemizedlist>
498   </sect2>
499
500   <sect2>
501     <title>GHC API changes</title>
502
503     <itemizedlist>
504       <listitem>
505         <para>
506           There is now a Ghc Monad used to carry around GHC's
507           Session data. This Monad also provides exception handling
508           functions.
509         </para>
510       </listitem>
511       <listitem>
512         <para>
513           It is now possible to get the raw characters corresponding to
514           each token the lexer outputs, and thus to reconstruct the
515           original file.
516         </para>
517       </listitem>
518       <listitem>
519         <para>
520           GHCi implicitly brings all exposed modules into scope with
521           qualified module names. There is a new flag
522           <literal>-fimplicit-import-qualified</literal>
523           that controls this behaviour, so other GHC API clients can
524           specify whether or not they want it.
525         </para>
526       </listitem>
527       <listitem>
528         <para>
529           There is now haddock documentation for much of the GHC API.
530         </para>
531       </listitem>
532     </itemizedlist>
533   </sect2>
534
535   <sect2>
536     <title>GHCi changes</title>
537
538     <itemizedlist>
539       <listitem>
540         <para>
541           You can now force GHCi to interpret a module, rather than
542           loading its compiled code, by prepending a * character to its
543           name, e.g.
544         </para>
545 <programlisting>
546 Prelude> :load *A
547 Compiling A                ( A.hs, interpreted )
548 *A>
549 </programlisting>
550       </listitem>
551       <listitem>
552         <para>
553           By default, GHCi will not print bind results, e.g.
554         </para>
555 <programlisting>
556 Prelude&gt; c &lt;- return 'c'
557 Prelude&gt; 
558 </programlisting>
559         <para>
560           does not print <literal>'c'</literal>. Use
561           <literal>-fprint-bind-result</literal> if you want the old
562           behaviour.
563         </para>
564       </listitem>
565       <listitem>
566         <para>
567           GHCi now uses editline, rather than readline, for input.
568           This shouldn't affect its behaviour.
569         </para>
570       </listitem>
571       <listitem>
572         <para>
573           The GHCi prompt history is now saved in
574           <literal>~/.ghc/ghci_history</literal>.
575         </para>
576       </listitem>
577       <listitem>
578         <para>
579           GHCi can now use libffi to make FFI calls, which means that
580           it now works on all platforms that libffi supports.
581         </para>
582       </listitem>
583     </itemizedlist>
584   </sect2>
585
586   <sect2>
587     <title>Runtime system changes</title>
588
589     <itemizedlist>
590       <listitem>
591         <para>
592           If the user presses control-C while running a Haskell program
593           then the program gets an asynchronous UserInterrupt exception.
594         </para>
595       </listitem>
596       <listitem>
597         <para>
598           We now ignore SIGPIPE by default.
599         </para>
600       </listitem>
601       <listitem>
602         <para>
603           The garbage collector can now use multiple threads in parallel.
604           The new <literal>-g<replaceable>n</replaceable></literal> RTS
605           flag controls it, e.g. run your program with
606           <literal>+RTS -g2 -RTS</literal> to use 2 threads.
607           Don't use more threads than you have CPUs.
608           Only major GCs are parallelised; minor GCs are still sequential.
609         </para>
610       </listitem>
611       <listitem>
612         <para>
613           The <literal>-S</literal> and <literal>-s</literal> RTS flags
614           now send their output to stderr, rather than
615           <literal><replaceable>prog</replaceable>.stat</literal>,
616           by default.
617         </para>
618       </listitem>
619       <listitem>
620         <para>
621           The new <literal>-vg</literal> RTS flag provides some RTS trace
622           messages even in the non-debug RTS variants.
623         </para>
624       </listitem>
625     </itemizedlist>
626   </sect2>
627
628   <sect2>
629     <title>runghc</title>
630
631     <itemizedlist>
632       <listitem>
633         <para>
634           runghc now uses the compiler that it came with to run the
635           code, rather than the first compiler that it finds on the
636           PATH.
637         </para>
638       </listitem>
639       <listitem>
640         <para>
641           If the program to run does not have a <literal>.lhs</literal>
642           extension then runghc now treats it as a <literal>.hs</literal>
643           file. In particular, this means that programs without an
644           extension now work.
645         </para>
646       </listitem>
647       <listitem>
648         <para>
649           <literal>runghc foo</literal> will now work if
650           <literal>foo.hs</literal> or <literal>foo.lhs</literal> exists.
651         </para>
652       </listitem>
653       <listitem>
654         <para>
655           runghc can now take the code to run from stdin.
656         </para>
657       </listitem>
658     </itemizedlist>
659   </sect2>
660
661   <sect2>
662     <title>ghc-pkg</title>
663
664     <itemizedlist>
665       <listitem>
666         <para>
667           ghc-pkg now has a <literal>-no-user-package-conf</literal>
668           flag which instructs it to ignore the user's personal
669           package.conf.
670         </para>
671       </listitem>
672       <listitem>
673         <para>
674           ghc-pkg no longer allows you to register two packages that
675           differ in case only.
676         </para>
677       </listitem>
678       <listitem>
679         <para>
680           ghc-pkg no longer allows you to register packages which have
681           unversioned dependencies.
682         </para>
683       </listitem>
684       <listitem>
685         <para>
686           There is a new command <literal>dump</literal> which is
687           similar to <literal>describe '*'</literal>, but in a format
688           that is designed to be parsable by other tools.
689         </para>
690       </listitem>
691     </itemizedlist>
692   </sect2>
693
694   <sect2>
695     <title>Haddock</title>
696
697     <itemizedlist>
698       <listitem>
699         <para>
700           Haddock 2 now comes with GHC.
701         </para>
702       </listitem>
703     </itemizedlist>
704   </sect2>
705
706   <sect2>
707     <title>DPH changes</title>
708
709     <itemizedlist>
710       <listitem>
711         <para>
712           DPH is now an extralib.
713         </para>
714       </listitem>
715       <listitem>
716         <para>
717           There is a new flag <literal>-Odph</literal> that sets the
718           flags recommended when using DPH. Currently it is equivalent
719           to
720           <literal>
721             -O2 -fno-method-sharing -fdicts-cheap
722             -fmax-simplifier-iterations20 -fno-spec-constr-threshold
723           </literal>
724         </para>
725       </listitem>
726       <listitem>
727         <para>
728           There are now flags <literal>-fdph-seq</literal> and
729           <literal>-fdph-par</literal> for selecting which DPH backend
730           to use.
731         </para>
732       </listitem>
733       <listitem>
734         <para>
735           The <literal>-fflatten</literal> flag has been removed. It
736           never worked and has now been superceded by vectorisation.
737         </para>
738       </listitem>
739     </itemizedlist>
740   </sect2>
741
742 </sect1>
743