/
7.6.1-notes.xml
789 lines (743 loc) · 24.5 KB
/
7.6.1-notes.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
<?xml version="1.0" encoding="iso-8859-1"?>
<sect1 id="release-7-6-1">
<title>Release notes for version 7.6.1</title>
<para>
The significant changes to the various parts of the compiler are
listed in the following sections. There have also been numerous bug
fixes and performance improvements over the 7.4 branch.
</para>
<sect2>
<title>Highlights</title>
<para>
The highlights, since the 7.4 branch, are:
</para>
<itemizedlist>
<listitem>
<para>
Polymorphic kinds and data promotion are now fully implemented and
supported features: <xref linkend="kind-polymorphism" />.
</para>
</listitem>
<listitem>
<para>
Windows 64bit is now a supported platform.
</para>
</listitem>
<listitem>
<para>
It is now possible to defer type errors until runtime using the
<literal>-fdefer-type-errors</literal> flag.
</para>
</listitem>
<listitem>
<para>
The RTS now supports changing the number of capabilities at runtime
with <literal>Control.Concurrent.setNumCapabilities</literal>: <xref
linkend="parallel-options" />.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Full details</title>
<sect3>
<title>Language</title>
<itemizedlist>
<listitem>
<para>
There is a new extension <literal>ExplicitNamespaces</literal>
that allows to qualify the export of a type with the
<literal>type</literal> keyword.
</para>
</listitem>
<listitem>
<para>
The behavior of the <literal>TypeOperator</literal> extension has
changed: previously, only type operators starting with ":" were
considered type constructors, and other operators were treated as
type variables. Now type operators are always constructors.
</para>
</listitem>
<listitem>
<para>
It is now possible to explicitly annotate types with kind
variables (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/5862">#5862</ulink>).
You can now write, for example:
<programlisting>
class Category (c :: k -> k -> *) where
type Ob c :: k -> Constraint
id :: Ob c a => c a a
(.) :: (Ob c a, Ob c b, Ob c c) => c b c -> c a b -> c a c
</programlisting>
and the variable <literal>k</literal>, ranging over kinds, is in scope within the
class declaration.
</para>
</listitem>
<listitem>
<para>
It is now possible to derive instances of
<literal>Generic1</literal> automatically. See <xref
linkend="generic-programming" /> for more information.
</para>
</listitem>
<listitem>
<para>
There is a new FFI calling convention <literal>capi</literal>,
enabled by the <literal>CAPI</literal> extension. For example,
given the following declaration:
<programlisting>
foreign import capi "header.h f" f :: CInt -> IO CInt
</programlisting>
GHC will generate code to call <literal>f</literal> using the C
API defined in the header <literal>header.h</literal>. Thus
<literal>f</literal> can be called even if it may be defined as a
CPP <literal>#define</literal>, rather than a proper function.
</para>
</listitem>
<listitem>
<para>
There is a new pragma <literal>CTYPE</literal>, which can be used
to specify the C type that a Haskell type corresponds to, when it
is used with the <literal>capi</literal> calling convention.
</para>
</listitem>
<listitem>
<para>
Generic default methods are now allowed for multi-parameter type classes.
</para>
</listitem>
<listitem>
<para>
A constructor of a GADT is now considered infix (by a derived
<literal>Show</literal> instance) if it is a two-argument
operator with a fixity declaration (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/5712">#5712</ulink>).
</para>
</listitem>
<listitem>
<para>
There is a new extension <literal>InstanceSigs</literal>, which
allows type signatures to be specified in instance declarations.
</para>
</listitem>
<listitem>
<para>
GHC now supports numeric and string type literals (enabled by
<literal>DataKinds</literal>), of kind <literal>Nat</literal> and
<literal>Symbol</literal> respectively (see <xref
linkend="promoted-literals" />).
</para>
</listitem>
<listitem>
<para>
The type <literal>Any</literal> can now be used as an argument
for <literal>foreign prim</literal> functions.
</para>
</listitem>
<listitem>
<para>
The <literal>mdo</literal> keyword has been reintroduced. This
keyword can be used to create <literal>do</literal> expressions
with recursive bindings. The behavior of the
<literal>rec</literal> keyword has been changed, so that it does
not perform automatic segmentation in a <literal>do</literal>
expression anymore.
</para>
</listitem>
<listitem>
<para>
There is a new syntactic construct (enabled by the <literal>LambdaCase</literal> extension)
for creating an anonymous function out of a <literal>case</literal> expression. For example,
the following expression:
<programlisting>
\case
Nothing -> 0
Just n -> n
</programlisting>
is equivalent to:
<programlisting>
\x -> case x of
Nothing -> 0
Just n -> n
</programlisting>
See <xref linkend="lambda-case" /> for more details.
</para>
</listitem>
<listitem>
<para>
There is a new syntactic construct (enabled by the
<literal>MultiWayIf</literal> extension) to create conditional
expressions with multiple branches. For example, you can now
write:
<programlisting>
if | x == 0 -> [...]
| x > 1 -> [...]
| x < 0 -> [...]
| otherwise -> [...]
</programlisting>
See <xref linkend="multi-way-if" /> for more information.
</para>
</listitem>
<listitem>
<para>
Some limitations on the usage of unboxed tuples have been lifted.
For example, when the <literal>UnboxedTuples</literal> extension
is on, an unboxed tuple can now be used as the type of a
constructor, function argument, or variable:
<programlisting>
data Foo = Foo (# Int, Int #)
f :: (# Int, Int #) -> (# Int, Int #)
f x = x
g :: (# Int, Int #) -> Int
g (# a,b #) = a
h x = let y = (# x,x #) in ...
</programlisting>
</para>
<para>
Unboxed tuple can now also be nested:
<programlisting>
f :: (# Int, (# Int, Int #), Bool #)
</programlisting>
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Compiler</title>
<itemizedlist>
<listitem>
<para>
The <literal>-package</literal> flag now correctly loads only
the most recent version of a package (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/7030">#7030</ulink>).
</para>
</listitem>
<listitem>
<para>
In <literal>--make</literal> mode, GHC now gives an indication
of why a module is being recompiled.
</para>
</listitem>
<listitem>
<para>
There is a new flag <literal>-freg-liveness</literal> flag to control if
STG liveness information is used for optimisation. The flag is
enabled by default.
</para>
</listitem>
<listitem>
<para>
Package database flags have been renamed from
<literal>-package-conf*</literal> to
<literal>-package-db*</literal>.
</para>
</listitem>
<listitem>
<para>
It is now possible to hide the global package db, and specify the
order of the user and global package databases in the stack (see
<xref linkend="package-databases" />).
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>GHCi</title>
<itemizedlist>
<listitem>
<para>
Commands defined later have now precedence in the resolution of
abbreviated commands (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/3858">#3858</ulink>).
</para>
</listitem>
<listitem>
<para>
It is now possible to specify a custom pretty-printing function
for expressions evaluated at the prompt using the
<literal>-interactive-print</literal> flag.
</para>
</listitem>
<listitem>
<para>
GHCi now supports loading additional <literal>.ghci</literal>
files via the <literal>-ghci-script</literal> flag (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/5265">#5265</ulink>).
</para>
</listitem>
<listitem>
<para>
A new <literal>:seti</literal> command has been introduced,
which sets an option that applies only at the prompt.
</para>
</listitem>
<listitem>
<para>
Files are now reloaded after having been edited with the <literal>:edit</literal> command.
</para>
</listitem>
<listitem>
<para>
<literal>default</literal> declarations can now be entered at the GHCi prompt.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Template Haskell</title>
<itemizedlist>
<listitem>
<para>
Promoted kinds and kind polymorphism are now supported in
Template Haskell.
</para>
</listitem>
<listitem>
<para>
It is now possible to create fixity declarations in Template
Haskell (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/1541">#1541</ulink>).
</para>
</listitem>
<listitem>
<para>
Primitive byte-array literals can now be created with Template
Haskell (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/5877">#5877</ulink>).
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Runtime system</title>
<itemizedlist>
<listitem>
<para>
The presentation of parallel GC work balance in <literal>+RTS
-s</literal> is now expressed as a percentage value (with
100% being "perfect") instead of a number from 1 to N, with N
being the number of capabilities.
</para>
</listitem>
<listitem>
<para>
The RTS now supports changing the number of capabilities at runtime
with <literal>Control.Concurrent.setNumCapabilities</literal>: <xref
linkend="parallel-options" />.
</para>
</listitem>
<listitem>
<para>
The internal timer is now based on a monotonic clock in both
the threaded and non-threaded RTS, on all tier-1 platforms.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Build system</title>
<itemizedlist>
<listitem>
<para>
GHC >= 7.0 is now required for bootstrapping.
</para>
</listitem>
<listitem>
<para>
Windows 64bit is now a supported platform.
</para>
</listitem>
</itemizedlist>
</sect3>
</sect2>
<sect2>
<title>Libraries</title>
<sect3>
<title>array</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>base</title>
<itemizedlist>
<listitem>
<para>
Version number 4.6.0.0 (was 4.5.1.0)
</para>
</listitem>
<listitem>
<para>
The <literal>Text.Read</literal> module now exports functions
<programlisting>
readEither :: Read a => String -> Either String a
readMaybe :: Read a => String -> Maybe a
</programlisting>
</para>
</listitem>
<listitem>
<para>
An infix alias for <literal>mappend</literal> in <literal>Data.Monoid</literal> has been introduced:
<programlisting>
(<>) :: Monoid m => m -> m -> m
</programlisting>
</para>
</listitem>
<listitem>
<para>
The <literal>Bits</literal> class does not have a <literal>Num</literal> superclass anymore.
</para>
<para>
You can make code that works with both
Haskell98/Haskell2010 and GHC by:
<itemizedlist>
<listitem>
<para>
Whenever you make a <literal>Bits</literal> instance
of a type, also make <literal>Num</literal> instance, and
</para>
</listitem>
<listitem>
<para>
Whenever you give a function, instance or class a
<literal>Bits t</literal> constraint, also give it
a <literal>Num t</literal> constraint.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>
<literal>Applicative</literal> and
<literal>Alternative</literal> instances for the
<literal>ReadP</literal> and <literal>ReadPrec</literal> monads
have been added.
</para>
</listitem>
<listitem>
<para>
<literal>foldl'</literal> and <literal>foldr'</literal> in
<literal>Data.Foldable</literal> are now methods of the
<literal>Foldable</literal> class.
</para>
</listitem>
<listitem>
<para>
The deprecated <literal>Control.OldException</literal> module has now been removed.
</para>
</listitem>
<listitem>
<para>
Strict versions of <literal>modifyIORef</literal> and <literal>atomicModifyIORef</literal> have been added to the <literal>Data.IORef</literal> module:
<programlisting>
modifyIORef' :: IORef a -> (a -> a) -> IO ()
atomicModifyIORef' :: IORef a -> (a -> (a,b)) -> IO b
</programlisting>
</para>
<para>
Similarly, a strict version of <literal>modifySTRef</literal>
has been added to <literal>Data.STRef</literal>.
</para>
</listitem>
<listitem>
<para>
A bug in the fingerprint calculation for
<literal>TypeRep</literal> (<ulink
url="http://hackage.haskell.org/trac/ghc/ticket/5962">#5962</ulink>)
has been fixed.
</para>
</listitem>
<listitem>
<para>
A new function <literal>lookupEnv</literal> has been added to
<literal>System.Environment</literal>, which behaves like
<literal>getEnv</literal>, but returns
<literal>Nothing</literal> when the environment variable is
not defined, instead of throwing an exception.
</para>
</listitem>
<listitem>
<para>
There is a new function <literal>getGCStatsEnabled</literal> in
<literal>GHC.Stats</literal>, which checks whether GC stats
have been enabled (for example, via the <literal>-T</literal>
RTS flag).
</para>
</listitem>
<listitem>
<para>
<literal>QSem</literal> in
<literal>Control.Concurrent</literal> is now deprecated, and
will be removed in GHC 7.8. Please use an alternative, e.g. the
SafeSemaphore package, instead.
</para>
</listitem>
<listitem>
<para>
A new function <literal>getExecutablePath</literal> has been
added to <literal>System.Environment</literal>. This function
returns the full path of the current executable, as opposed to
<literal>getProgName</literal>, which only returns the base
name.
</para>
</listitem>
<listitem>
<para>
The <literal>Data.HashTable</literal> module is now deprecated,
and will be removed in GHC 7.8. Please use an alternative, e.g.
the hashtables package, instead.
</para>
</listitem>
<listitem>
<para>
The <literal>Data.Ord</literal> module now exports the
<literal>Down</literal> <literal>newtype</literal>, which
reverses the sort order of its argument.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>bin-package-db</title>
<itemizedlist>
<listitem>
<para>
This is an internal package, and should not be used.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>binary</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>bytestring</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Cabal</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
<listitem>
<para>
For details of the changes to the Cabal library,
plese see the Cabal changelog.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>containers</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>deepseq</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>directory</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>extensible-exceptions</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>filepath</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>ghc-prim</title>
<itemizedlist>
<listitem>
<para>
This is an internal package, and should not be used.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>haskell98</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>haskell2010</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>hoopl</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>hpc</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>integer-gmp</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>old-locale</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>old-time</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>pretty</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>process</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>template-haskell</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>time</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>unix</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Win32</title>
<itemizedlist>
<listitem>
<para>
Version number TODO (was TODO)
</para>
</listitem>
</itemizedlist>
</sect3>
</sect2>
</sect1>