80e2293f16e1b5d20c7c4f499b84bb0810f8a541
[ghc.git] / docs / users_guide / 7.8.1-notes.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="release-7-8-1">
3 <title>Release notes for version 7.8.1</title>
4
5 <para>
6 The significant changes to the various parts of the compiler are listed
7 in the following sections. There have also been numerous bug fixes and
8 performance improvements over the 7.6 branch.
9 </para>
10
11 <sect2>
12 <title>Highlights</title>
13
14 <para>
15 The highlights, since the 7.6 branch, are:
16 </para>
17
18 <itemizedlist>
19 <listitem>
20 <para>
21 GHC now supports "type holes" with the
22 <literal>TypeHoles</literal> extension. When enabled, the
23 unbound literal <literal>_</literal> may be used during
24 development in place of a regular identifier, and GHC will
25 respond with the type necessary to "fill in the hole."
26
27 TODO FIXME: reference.
28 </para>
29 </listitem>
30
31 <listitem>
32 <para>
33 It is now possible to declare a 'closed' <literal>type
34 family</literal> when using the
35 <literal>TypeFamilies</literal> extension. A closed
36 <literal>type family</literal> cannot have any
37 instances created other than the ones in its
38 definition.
39
40 TODO FIXME: reference.
41 </para>
42 </listitem>
43
44 <listitem>
45 <para>
46 Use of the <literal>GeneralizedNewtypeDeriving</literal>
47 extension is now subject to <emphasis>role checking</emphasis>,
48 to ensure type safety of the derived instances. As this change
49 increases the type safety of GHC, it is possible that some code
50 that previously compiled will no longer work.
51
52 TODO FIXME: reference.
53 </para>
54 </listitem>
55
56 <listitem>
57 <para>
58 GHC now supports overloading list literals using the new
59 <literal>OverloadedLists</literal> extension.
60
61 TODO FIXME: reference.
62 </para>
63 </listitem>
64
65 <listitem>
66 <para>
67 There has been significant overhaul of the type inference engine and
68 constraint solver.
69
70 TODO FIXME: reference.
71 </para>
72 </listitem>
73
74 <listitem>
75 <para>
76 By default, GHC will now unbox all "small" strict
77 fields in a data type. A "small" data type is one
78 whose size is equivalent to or smaller than the native
79 word size of the machine. This means you no longer
80 have to specify <literal>UNPACK</literal> pragmas for
81 e.g. strict <literal>Int</literal> fields. This also
82 applies to floating-point values.
83 </para>
84 </listitem>
85
86 <listitem>
87 <para>
88 GHC now has a brand-new I/O manager that scales significantly
89 better for larger workloads compared to the previous one. It
90 should scale linearly up to approximately 32 cores.
91 </para>
92 </listitem>
93
94 <listitem>
95 <para>
96 The LLVM backend now supports 128bit SIMD
97 operations. This is now exploited in both the
98 <literal>vector</literal> and <literal>dph</literal>
99 packages, exposing a high level interface.
100
101 TODO FIXME: reference.
102 </para>
103 <para>
104 This is only available with the LLVM backend.
105 </para>
106 </listitem>
107
108 <listitem>
109 <para>
110 The new code generator, after significant work by many
111 individuals over the past several years, is now enabled by
112 default. This is a complete rewrite of the STG to Cmm
113 transformation. In general, your programs may get slightly
114 faster.
115 </para>
116
117 <para>
118 The old code generator has been removed completely.
119 </para>
120 </listitem>
121
122 <listitem>
123 <para>
124 GHC now has substantially better support for cross
125 compilation. In particular, GHC now has all the
126 necessary patches to support cross compilation to
127 Apple iOS, using the LLVM backend.
128
129 TODO FIXME: reference.
130 </para>
131 </listitem>
132
133 <listitem>
134 <para>
135 PrimOps for comparing unboxed values now return
136 <literal>Int#</literal> instead of <literal>Bool</literal>.
137 New PrimOps' names end with <literal>$#</literal> for operators and
138 <literal>I#</literal> for ordinary names, e.g. <literal>==$#</literal>
139 compares <literal>Int#</literal>s for equality and
140 <literal>eqCharI#</literal> does the same for <literal>Char#</literal>s.
141 Old PrimOps have been removed and turned into wrappers. See
142 <ulink url="http://ghc.haskell.org/trac/ghc/wiki/NewPrimopsInGHC7.8">
143 this GHC wiki page</ulink> for instructions how to update your
144 existing code.
145 </para>
146 </listitem>
147
148 <listitem>
149 <para>
150 New PrimOps for atomic memory operations.
151 The <literal>casMutVar#</literal> PrimOp was introduced in
152 GHC 7.2 (debugged in 7.4). This release also includes additional
153 PrimOps for compare-and-swap (<literal>casArray#</literal> and
154 <literal>casIntArray#</literal>) and one for fetch-and-add
155 (<literal>fetchAddIntArray#</literal>).
156 </para>
157 </listitem>
158
159 <listitem>
160 <para>
161 TODO: mention dynamic changes
162 </para>
163 </listitem>
164
165 <listitem>
166 <para>
167 <literal>Typeable</literal> is now poly-kinded, making
168 <literal>Typeable1</literal>, <literal>Typeable2</literal>,
169 etc., obsolete, deprecated, and relegated to
170 <literal>Data.OldTypeable</literal>. Furthermore, user-written
171 instances of <literal>Typeable</literal> are now disallowed:
172 use <literal>deriving</literal> or the new extension
173 <literal>-XAutoDeriveTypeable</literal>, which will create
174 <literal>Typeable</literal> instances for every datatype
175 declared in the module.
176 </para>
177 </listitem>
178
179 <listitem>
180 <para>
181 GHC now has a parallel compilataion driver. When
182 compiling with <literal>--make</literal> (which is on
183 by default,) you may also specify
184 <literal>-jN</literal> in order to compile
185 <replaceable>N</replaceable> modules in parallel.
186 </para>
187
188 <para>
189 Note that if you wish for GHC to use multiple cores,
190 you will need to use the <literal>+RTS -N</literal>
191 flag.
192 </para>
193 </listitem>
194 </itemizedlist>
195 </sect2>
196
197 <sect2>
198 <title>Full details</title>
199 <sect3>
200 <title>Language</title>
201 <itemizedlist>
202 <listitem>
203 <para>
204 There is a new extension,
205 <literal>NullaryTypeClasses</literal>, which
206 allows you to declare a type class without any
207 parameters.
208 </para>
209 </listitem>
210 </itemizedlist>
211
212 <itemizedlist>
213 <listitem>
214 <para>
215 There is a new extension,
216 <literal>NumDecimals</literal>, which allows you
217 to specify an integer using compact "floating
218 literal" syntax. This lets you say things like
219 <literal>1.2e6 :: Integer</literal> instead of
220 <literal>1200000</literal>
221 </para>
222 </listitem>
223 </itemizedlist>
224
225 <itemizedlist>
226 <listitem>
227 <para>
228 There is a new extension,
229 <literal>NegativeLiterals</literal>, which will
230 cause GHC to interpret the expression
231 <literal>-123</literal> as <literal>fromIntegral
232 (-123)</literal>. Haskell 98 and Haskell 2010 both
233 specify that it should instead desugar to
234 <literal>negate (fromIntegral 123)</literal>
235 </para>
236 </listitem>
237 </itemizedlist>
238
239 <itemizedlist>
240 <listitem>
241 <para>
242 The <literal>IncoherentInstances</literal>
243 extension has seen a behavioral change, and is
244 now 'liberated' and less conservative during
245 instance resolution. This allows more programs to
246 compile than before.
247 </para>
248 <para>
249 Now, <literal>IncoherentInstances</literal> will
250 always pick an arbitrary matching instance, if
251 multiple ones exist.
252 </para>
253 </listitem>
254 </itemizedlist>
255
256
257 </sect3>
258
259 <sect3>
260 <title>Compiler</title>
261 <itemizedlist>
262 <listitem>
263 <para>
264 GHC can now build both static and dynamic object
265 files at the same time in a single compilation
266 pass, when given the
267 <literal>-dynamic-too</literal> flag. This will
268 produce both a statically-linkable
269 <literal>.o</literal> object file, and a
270 dynamically-linkable <literal>.dyn_o</literal>
271 file. The output suffix of the dynamic objects can
272 be controlled by the flag
273 <literal>-dynosuf</literal>.
274 </para>
275
276 <para>
277 Note that GHC still builds statically by default.
278 </para>
279 </listitem>
280 <listitem>
281 <para>
282 GHC now supports a <literal>--show-options</literal> flag,
283 which will dump all of the flags it supports to standard out.
284 </para>
285 </listitem>
286 <listitem>
287 <para>
288 GHC now supports warning about overflow of integer
289 literals, enabled by
290 <literal>-fwarn-overflowed-literals</literal>. It
291 is enabled by default
292 </para>
293 </listitem>
294 <listitem>
295 <para>
296 It's now possible to switch the system linker on Linux
297 (between GNU gold and GNU ld) at runtime without problem.
298 </para>
299 </listitem>
300 <listitem>
301 <para>
302 The <literal>-fwarn-dodgy-imports</literal> flag now warns
303 in the case an <literal>import</literal> statement hides an
304 entity which is not exported.
305 </para>
306 </listitem>
307 <listitem>
308 <para>
309 The LLVM backend was overhauled and rewritten, and
310 should hopefully be easier to maintain and work on
311 in the future.
312 </para>
313 </listitem>
314 </itemizedlist>
315 </sect3>
316
317 <sect3>
318 <title>GHCi</title>
319 <itemizedlist>
320 <listitem>
321 <para>
322 GHCi now supports a <literal>prompt2</literal>
323 setting, which allows you to customize the
324 continuation prompt of multi-line input.
325
326 TODO FIXME: reference.
327 </para>
328 </listitem>
329 <listitem>
330 <para>
331 The new <literal>:shows paths</literal> command
332 shows the current working directory and the
333 current search path for Haskell modules.
334 </para>
335 </listitem>
336 </itemizedlist>
337 </sect3>
338
339 <sect3>
340 <title>Template Haskell</title>
341 <itemizedlist>
342 <listitem>
343 <para>
344 TODO FIXME
345 </para>
346 </listitem>
347 </itemizedlist>
348 </sect3>
349
350 <sect3>
351 <title>Runtime system</title>
352 <itemizedlist>
353 <listitem>
354 <para>
355 The RTS linker can now unload object code at
356 runtime (when using the GHC API
357 <literal>ObjLink</literal> module.) Previously,
358 GHC would not unload the old object file, causing
359 a gradual memory leak as more objects were loaded
360 over time.
361 </para>
362
363 <para>
364 Note that this change in unloading behavior
365 <emphasis>only</emphasis> affects statically
366 linked binaries, and not dynamic ones.
367 </para>
368 </listitem>
369
370 <listitem>
371 <para>
372 The performance of <literal>StablePtr</literal>s and
373 <literal>StableName</literal>s has been improved.
374 </para>
375 </listitem>
376 </itemizedlist>
377 </sect3>
378
379 <sect3>
380 <title>Build system</title>
381 <itemizedlist>
382 <listitem>
383 <para>
384 GHC >= 7.4 is now required for bootstrapping.
385 </para>
386 </listitem>
387 <listitem>
388 <para>
389 GHC can now be built with Clang, and use Clang as the
390 preprocessor for Haskell code. Only Clang version 3.4svn is
391 reliably supported.
392 </para>
393 </listitem>
394 </itemizedlist>
395 </sect3>
396 </sect2>
397
398 <sect2>
399 <title>Libraries</title>
400
401 <para>
402 There have been some changes that have effected multiple
403 libraries:
404 </para>
405
406 <itemizedlist>
407 <listitem>
408 <para>
409 TODO FIXME
410 </para>
411 </listitem>
412 </itemizedlist>
413
414 <para>
415 The following libraries have been removed from the GHC tree:
416 </para>
417
418 <itemizedlist>
419 <listitem>
420 <para>TODO FIXME</para>
421 </listitem>
422 </itemizedlist>
423
424 <para>
425 The following libraries have been added to the GHC tree:
426 </para>
427
428 <itemizedlist>
429 <listitem>
430 <para>TODO FIXME</para>
431 </listitem>
432 </itemizedlist>
433
434 <sect3>
435 <title>array</title>
436 <itemizedlist>
437 <listitem>
438 <para>
439 Version number XXXX (was XXXX)
440 </para>
441 </listitem>
442 </itemizedlist>
443 </sect3>
444
445 <sect3>
446 <title>base</title>
447 <itemizedlist>
448 <listitem>
449 <para>
450 Version number 4.7.0.0 (was 4.6.0.1)
451 </para>
452 </listitem>
453 <listitem>
454 <para>
455 The <literal>Control.Category</literal> module now has the
456 <literal>PolyKinds</literal> extension enabled, meaning
457 that instances of <literal>Category</literal> no longer
458 need be of kind <literal>* -> * -> *</literal>
459 </para>
460 </listitem>
461 <listitem>
462 <para>
463 There are now <literal>Foldable</literal> and <literal>Traversable</literal>
464 instances for <literal>Either a</literal> and <literal>(,) a</literal>
465 </para>
466 </listitem>
467 <listitem>
468 <para>
469 <literal>Control.Concurrent.MVar</literal> has a new
470 implementation of <literal>readMVar</literal>, which
471 fixes a long-standing bug where
472 <literal>readMVar</literal> is only atomic if there
473 are no other threads running
474 <literal>putMVar</literal>.
475 <literal>readMVar</literal> now is atomic, and is
476 guaranteed to return the value from the first
477 <literal>putMVar</literal>. There is also a new <literal>tryReadMVar</literal>
478 which is a non-blocking version.
479 </para>
480 </listitem>
481 <listitem>
482 <para>
483 There are now byte endian-swapping primitives
484 available in <literal>Data.Word</literal>, which
485 use optimized machine instructions when available.
486 </para>
487 </listitem>
488 </itemizedlist>
489 </sect3>
490
491 <sect3>
492 <title>bin-package-db</title>
493 <itemizedlist>
494 <listitem>
495 <para>
496 This is an internal package, and should not be used.
497 </para>
498 </listitem>
499 </itemizedlist>
500 </sect3>
501
502 <sect3>
503 <title>binary</title>
504 <itemizedlist>
505 <listitem>
506 <para>
507 Version number XXXX (was XXXX)
508 </para>
509 </listitem>
510 </itemizedlist>
511 </sect3>
512
513 <sect3>
514 <title>bytestring</title>
515 <itemizedlist>
516 <listitem>
517 <para>
518 Version number XXXX (was XXXX)
519 </para>
520 </listitem>
521 </itemizedlist>
522 </sect3>
523
524 <sect3>
525 <title>Cabal</title>
526 <itemizedlist>
527 <listitem>
528 <para>
529 Version number XXXX (was XXXX)
530 </para>
531 </listitem>
532 </itemizedlist>
533 </sect3>
534
535 <sect3>
536 <title>containers</title>
537 <itemizedlist>
538 <listitem>
539 <para>
540 Version number XXXX (was XXXX)
541 </para>
542 </listitem>
543 </itemizedlist>
544 </sect3>
545
546 <sect3>
547 <title>deepseq</title>
548 <itemizedlist>
549 <listitem>
550 <para>
551 Version number XXXX (was XXXX)
552 </para>
553 </listitem>
554 </itemizedlist>
555 </sect3>
556
557 <sect3>
558 <title>directory</title>
559 <itemizedlist>
560 <listitem>
561 <para>
562 Version number XXXX (was XXXX)
563 </para>
564 </listitem>
565 </itemizedlist>
566 </sect3>
567
568 <sect3>
569 <title>filepath</title>
570 <itemizedlist>
571 <listitem>
572 <para>
573 Version number XXXX (was XXXX)
574 </para>
575 </listitem>
576 </itemizedlist>
577 </sect3>
578
579 <sect3>
580 <title>ghc-prim</title>
581 <itemizedlist>
582 <listitem>
583 <para>
584 Version number XXXX (was XXXX)
585 </para>
586 </listitem>
587 </itemizedlist>
588 </sect3>
589
590 <sect3>
591 <title>haskell98</title>
592 <itemizedlist>
593 <listitem>
594 <para>
595 Version number XXXX (was XXXX)
596 </para>
597 </listitem>
598 </itemizedlist>
599 </sect3>
600
601 <sect3>
602 <title>haskell2010</title>
603 <itemizedlist>
604 <listitem>
605 <para>
606 Version number XXXX (was XXXX)
607 </para>
608 </listitem>
609 </itemizedlist>
610 </sect3>
611
612 <sect3>
613 <title>hoopl</title>
614 <itemizedlist>
615 <listitem>
616 <para>
617 Version number XXXX (was XXXX)
618 </para>
619 </listitem>
620 </itemizedlist>
621 </sect3>
622
623 <sect3>
624 <title>hpc</title>
625 <itemizedlist>
626 <listitem>
627 <para>
628 Version number XXXX (was XXXX)
629 </para>
630 </listitem>
631 </itemizedlist>
632 </sect3>
633
634 <sect3>
635 <title>integer-gmp</title>
636 <itemizedlist>
637 <listitem>
638 <para>
639 Version number XXXX (was XXXX)
640 </para>
641 </listitem>
642 </itemizedlist>
643 </sect3>
644
645 <sect3>
646 <title>old-locale</title>
647 <itemizedlist>
648 <listitem>
649 <para>
650 Version number XXXX (was XXXX)
651 </para>
652 </listitem>
653 </itemizedlist>
654 </sect3>
655
656 <sect3>
657 <title>old-time</title>
658 <itemizedlist>
659 <listitem>
660 <para>
661 Version number XXXX (was XXXX)
662 </para>
663 </listitem>
664 </itemizedlist>
665 </sect3>
666
667 <sect3>
668 <title>process</title>
669 <itemizedlist>
670 <listitem>
671 <para>
672 Version number XXXX (was XXXX)
673 </para>
674 </listitem>
675 </itemizedlist>
676 </sect3>
677
678 <sect3>
679 <title>template-haskell</title>
680 <itemizedlist>
681 <listitem>
682 <para>
683 Version number XXXX (was XXXX)
684 </para>
685 </listitem>
686 </itemizedlist>
687 </sect3>
688
689 <sect3>
690 <title>time</title>
691 <itemizedlist>
692 <listitem>
693 <para>
694 Version number XXXX (was XXXX)
695 </para>
696 </listitem>
697 </itemizedlist>
698 </sect3>
699
700 <sect3>
701 <title>unix</title>
702 <itemizedlist>
703 <listitem>
704 <para>
705 Version number 2.7.0.0 (was 2.6.0.0)
706 </para>
707 </listitem>
708 <listitem>
709 <para>
710 A crash in <literal>getGroupEntryForID</literal>
711 (and related functions like
712 <literal>getUserEntryForID</literal> and
713 <literal>getUserEntryForName</literal>) in
714 multi-threaded applications has been fixed.
715 </para>
716 </listitem>
717 <listitem>
718 <para>
719 The functions <literal>getGroupEntryForID</literal>
720 and <literal>getUserEntryForID</literal> now fail
721 with a <literal>isDoesNotExist</literal> error when
722 the specified ID cannot be found.
723 </para>
724 </listitem>
725 </itemizedlist>
726 </sect3>
727
728 <sect3>
729 <title>Win32</title>
730 <itemizedlist>
731 <listitem>
732 <para>
733 Version number XXXX (was XXXX)
734 </para>
735 </listitem>
736 </itemizedlist>
737 </sect3>
738 </sect2>
739 </sect1>