Release note blurb about IncoherentInstances.
[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 TODO: mention dynamic changes
151 </para>
152 </listitem>
153
154 <listitem>
155 <para>
156 TODO: mention new <literal>Typeable</literal> and
157 <literal>AutoDeriveTypeable</literal>
158 </para>
159 </listitem>
160 </itemizedlist>
161 </sect2>
162
163 <sect2>
164 <title>Full details</title>
165 <sect3>
166 <title>Language</title>
167 <itemizedlist>
168 <listitem>
169 <para>
170 There is a new extension,
171 <literal>NullaryTypeClasses</literal>, which
172 allows you to declare a type class without any
173 parameters.
174 </para>
175 </listitem>
176 </itemizedlist>
177
178 <itemizedlist>
179 <listitem>
180 <para>
181 There is a new extension,
182 <literal>NumDecimals</literal>, which allows you
183 to specify an integer using compact "floating
184 literal" syntax. This lets you say things like
185 <literal>1.2e6 :: Integer</literal> instead of
186 <literal>1200000</literal>
187 </para>
188 </listitem>
189 </itemizedlist>
190
191 <itemizedlist>
192 <listitem>
193 <para>
194 There is a new extension,
195 <literal>NegativeLiterals</literal>, which will
196 cause GHC to interpret the expression
197 <literal>-123</literal> as <literal>fromIntegral
198 (-123)</literal>. Haskell 98 and Haskell 2010 both
199 specify that it should instead desugar to
200 <literal>negate (fromIntegral 123)</literal>
201 </para>
202 </listitem>
203 </itemizedlist>
204
205 <itemizedlist>
206 <listitem>
207 <para>
208 The <literal>IncoherentInstances</literal>
209 extension has seen a behavioral change, and is
210 now 'liberated' and less conservative during
211 instance resolution. This allows more programs to
212 compile than before.
213 </para>
214 <para>
215 Now, <literal>IncoherentInstances</literal> will
216 always pick an arbitrary matching instance, if
217 multiple ones exist.
218 </para>
219 </listitem>
220 </itemizedlist>
221
222
223 </sect3>
224
225 <sect3>
226 <title>Compiler</title>
227 <itemizedlist>
228 <listitem>
229 <para>
230 GHC can now build both static and dynamic object
231 files at the same time in a single compilation
232 pass, when given the
233 <literal>-dynamic-too</literal> flag. This will
234 produce both a statically-linkable
235 <literal>.o</literal> object file, and a
236 dynamically-linkable <literal>.dyn_o</literal>
237 file. The output suffix of the dynamic objects can
238 be controlled by the flag
239 <literal>-dyno</literal>.
240 </para>
241
242 <para>
243 Note that GHC still builds statically by default.
244 </para>
245 </listitem>
246 <listitem>
247 <para>
248 GHC now supports a <literal>--show-options</literal> flag,
249 which will dump all of the flags it supports to standard out.
250 </para>
251 </listitem>
252 <listitem>
253 <para>
254 GHC now supports warning about overflow of integer
255 literals, enabled by
256 <literal>-fwarn-overflowed-literals</literal>. It
257 is enabled by default
258 </para>
259 </listitem>
260 <listitem>
261 <para>
262 It's now possible to switch the system linker on Linux
263 (between GNU gold and GNU ld) at runtime without problem.
264 </para>
265 </listitem>
266 <listitem>
267 <para>
268 The <literal>-fwarn-dodgy-imports</literal> flag now warns
269 in the case an <literal>import</literal> statement hides an
270 entity which is not exported.
271 </para>
272 </listitem>
273 <listitem>
274 <para>
275 The LLVM backend was overhauled and rewritten, and
276 should hopefully be easier to maintain and work on
277 in the future.
278 </para>
279 </listitem>
280 </itemizedlist>
281 </sect3>
282
283 <sect3>
284 <title>GHCi</title>
285 <itemizedlist>
286 <listitem>
287 <para>
288 GHCi now supports a <literal>prompt2</literal>
289 setting, which allows you to customize the
290 continuation prompt of multi-line input.
291
292 TODO FIXME: reference.
293 </para>
294 </listitem>
295 <listitem>
296 <para>
297 The new <literal>:shows paths</literal> command
298 shows the current working directory and the
299 current search path for Haskell modules.
300 </para>
301 </listitem>
302 </itemizedlist>
303 </sect3>
304
305 <sect3>
306 <title>Template Haskell</title>
307 <itemizedlist>
308 <listitem>
309 <para>
310 TODO FIXME
311 </para>
312 </listitem>
313 </itemizedlist>
314 </sect3>
315
316 <sect3>
317 <title>Runtime system</title>
318 <itemizedlist>
319 <listitem>
320 <para>
321 The performance of <literal>StablePtr</literal>s and
322 <literal>StableName</literal>s has been improved.
323 </para>
324 </listitem>
325 </itemizedlist>
326 </sect3>
327
328 <sect3>
329 <title>Build system</title>
330 <itemizedlist>
331 <listitem>
332 <para>
333 GHC >= 7.4 is now required for bootstrapping.
334 </para>
335 </listitem>
336 <listitem>
337 <para>
338 GHC can now be built with Clang, and use Clang as the
339 preprocessor for Haskell code. Only Clang version 3.4svn is
340 reliably supported.
341 </para>
342 </listitem>
343 </itemizedlist>
344 </sect3>
345 </sect2>
346
347 <sect2>
348 <title>Libraries</title>
349
350 <para>
351 There have been some changes that have effected multiple
352 libraries:
353 </para>
354
355 <itemizedlist>
356 <listitem>
357 <para>
358 TODO FIXME
359 </para>
360 </listitem>
361 </itemizedlist>
362
363 <para>
364 The following libraries have been removed from the GHC tree:
365 </para>
366
367 <itemizedlist>
368 <listitem>
369 <para>TODO FIXME</para>
370 </listitem>
371 </itemizedlist>
372
373 <para>
374 The following libraries have been added to the GHC tree:
375 </para>
376
377 <itemizedlist>
378 <listitem>
379 <para>TODO FIXME</para>
380 </listitem>
381 </itemizedlist>
382
383 <sect3>
384 <title>array</title>
385 <itemizedlist>
386 <listitem>
387 <para>
388 Version number XXXX (was XXXX)
389 </para>
390 </listitem>
391 </itemizedlist>
392 </sect3>
393
394 <sect3>
395 <title>base</title>
396 <itemizedlist>
397 <listitem>
398 <para>
399 Version number 4.7.0.0 (was 4.6.0.1)
400 </para>
401 </listitem>
402 <listitem>
403 <para>
404 The <literal>Control.Category</literal> module now has the
405 <literal>PolyKinds</literal> extension enabled, meaning
406 that instances of <literal>Category</literal> no longer
407 need be of kind <literal>* -> * -> *</literal>
408 </para>
409 </listitem>
410 <listitem>
411 <para>
412 There are now <literal>Foldable</literal> and <literal>Traversable</literal>
413 instances for <literal>Either a</literal> and <literal>(,) a</literal>
414 </para>
415 </listitem>
416 <listitem>
417 <para>
418 <literal>Control.Concurrent.MVar</literal> has a new
419 implementation of <literal>readMVar</literal>, which
420 fixes a long-standing bug where
421 <literal>readMVar</literal> is only atomic if there
422 are no other threads running
423 <literal>putMVar</literal>.
424 <literal>readMVar</literal> now is atomic, and is
425 guaranteed to return the value from the first
426 <literal>putMVar</literal>. There is also a new <literal>tryReadMVar</literal>
427 which is a non-blocking version.
428 </para>
429 </listitem>
430 <listitem>
431 <para>
432 There are now byte endian-swapping primitives
433 available in <literal>Data.Word</literal>, which
434 use optimized machine instructions when available.
435 </para>
436 </listitem>
437 </itemizedlist>
438 </sect3>
439
440 <sect3>
441 <title>bin-package-db</title>
442 <itemizedlist>
443 <listitem>
444 <para>
445 This is an internal package, and should not be used.
446 </para>
447 </listitem>
448 </itemizedlist>
449 </sect3>
450
451 <sect3>
452 <title>binary</title>
453 <itemizedlist>
454 <listitem>
455 <para>
456 Version number XXXX (was XXXX)
457 </para>
458 </listitem>
459 </itemizedlist>
460 </sect3>
461
462 <sect3>
463 <title>bytestring</title>
464 <itemizedlist>
465 <listitem>
466 <para>
467 Version number XXXX (was XXXX)
468 </para>
469 </listitem>
470 </itemizedlist>
471 </sect3>
472
473 <sect3>
474 <title>Cabal</title>
475 <itemizedlist>
476 <listitem>
477 <para>
478 Version number XXXX (was XXXX)
479 </para>
480 </listitem>
481 </itemizedlist>
482 </sect3>
483
484 <sect3>
485 <title>containers</title>
486 <itemizedlist>
487 <listitem>
488 <para>
489 Version number XXXX (was XXXX)
490 </para>
491 </listitem>
492 </itemizedlist>
493 </sect3>
494
495 <sect3>
496 <title>deepseq</title>
497 <itemizedlist>
498 <listitem>
499 <para>
500 Version number XXXX (was XXXX)
501 </para>
502 </listitem>
503 </itemizedlist>
504 </sect3>
505
506 <sect3>
507 <title>directory</title>
508 <itemizedlist>
509 <listitem>
510 <para>
511 Version number XXXX (was XXXX)
512 </para>
513 </listitem>
514 </itemizedlist>
515 </sect3>
516
517 <sect3>
518 <title>filepath</title>
519 <itemizedlist>
520 <listitem>
521 <para>
522 Version number XXXX (was XXXX)
523 </para>
524 </listitem>
525 </itemizedlist>
526 </sect3>
527
528 <sect3>
529 <title>ghc-prim</title>
530 <itemizedlist>
531 <listitem>
532 <para>
533 Version number XXXX (was XXXX)
534 </para>
535 </listitem>
536 </itemizedlist>
537 </sect3>
538
539 <sect3>
540 <title>haskell98</title>
541 <itemizedlist>
542 <listitem>
543 <para>
544 Version number XXXX (was XXXX)
545 </para>
546 </listitem>
547 </itemizedlist>
548 </sect3>
549
550 <sect3>
551 <title>haskell2010</title>
552 <itemizedlist>
553 <listitem>
554 <para>
555 Version number XXXX (was XXXX)
556 </para>
557 </listitem>
558 </itemizedlist>
559 </sect3>
560
561 <sect3>
562 <title>hoopl</title>
563 <itemizedlist>
564 <listitem>
565 <para>
566 Version number XXXX (was XXXX)
567 </para>
568 </listitem>
569 </itemizedlist>
570 </sect3>
571
572 <sect3>
573 <title>hpc</title>
574 <itemizedlist>
575 <listitem>
576 <para>
577 Version number XXXX (was XXXX)
578 </para>
579 </listitem>
580 </itemizedlist>
581 </sect3>
582
583 <sect3>
584 <title>integer-gmp</title>
585 <itemizedlist>
586 <listitem>
587 <para>
588 Version number XXXX (was XXXX)
589 </para>
590 </listitem>
591 </itemizedlist>
592 </sect3>
593
594 <sect3>
595 <title>old-locale</title>
596 <itemizedlist>
597 <listitem>
598 <para>
599 Version number XXXX (was XXXX)
600 </para>
601 </listitem>
602 </itemizedlist>
603 </sect3>
604
605 <sect3>
606 <title>old-time</title>
607 <itemizedlist>
608 <listitem>
609 <para>
610 Version number XXXX (was XXXX)
611 </para>
612 </listitem>
613 </itemizedlist>
614 </sect3>
615
616 <sect3>
617 <title>process</title>
618 <itemizedlist>
619 <listitem>
620 <para>
621 Version number XXXX (was XXXX)
622 </para>
623 </listitem>
624 </itemizedlist>
625 </sect3>
626
627 <sect3>
628 <title>template-haskell</title>
629 <itemizedlist>
630 <listitem>
631 <para>
632 Version number XXXX (was XXXX)
633 </para>
634 </listitem>
635 </itemizedlist>
636 </sect3>
637
638 <sect3>
639 <title>time</title>
640 <itemizedlist>
641 <listitem>
642 <para>
643 Version number XXXX (was XXXX)
644 </para>
645 </listitem>
646 </itemizedlist>
647 </sect3>
648
649 <sect3>
650 <title>unix</title>
651 <itemizedlist>
652 <listitem>
653 <para>
654 Version number 2.7.0.0 (was 2.6.0.0)
655 </para>
656 </listitem>
657 <listitem>
658 <para>
659 A crash in <literal>getGroupEntryForID</literal>
660 (and related functions like
661 <literal>getUserEntryForID</literal> and
662 <literal>getUserEntryForName</literal>) in
663 multi-threaded applications has been fixed.
664 </para>
665 </listitem>
666 <listitem>
667 <para>
668 The functions <literal>getGroupEntryForID</literal>
669 and <literal>getUserEntryForID</literal> now fail
670 with a <literal>isDoesNotExist</literal> error when
671 the specified ID cannot be found.
672 </para>
673 </listitem>
674 </itemizedlist>
675 </sect3>
676
677 <sect3>
678 <title>Win32</title>
679 <itemizedlist>
680 <listitem>
681 <para>
682 Version number XXXX (was XXXX)
683 </para>
684 </listitem>
685 </itemizedlist>
686 </sect3>
687 </sect2>
688 </sect1>