Use IP based CallStack in error and undefined
[ghc.git] / docs / users_guide / 7.12.1-notes.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="release-7-12-1">
3 <title>Release notes for version 7.12.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.10 branch.
9 </para>
10
11 <sect2>
12 <title>Highlights</title>
13
14 <para>
15 The highlights, since the 7.10 branch, are:
16 </para>
17
18 <itemizedlist>
19 <listitem>
20 <para>
21 TODO FIXME
22 </para>
23 </listitem>
24 </itemizedlist>
25 </sect2>
26
27 <sect2>
28 <title>Full details</title>
29 <sect3>
30 <title>Language</title>
31 <itemizedlist>
32 <listitem>
33 <para>
34 TODO FIXME.
35 </para>
36 </listitem>
37 <listitem>
38 <para>
39 The parser now supports Haddock comments on GADT data constructors. For example,
40 <programlisting>
41 data Expr a where
42 -- | Just a normal sum
43 Sum :: Int -> Int -> Expr Int
44 </programlisting>
45 </para>
46 </listitem>
47 <listitem>
48 <para>
49 Implicit parameters of the new ghc-prim type
50 <literal>GHC.Types.CallStack</literal> are treated
51 specially, and automatically solved for the current source
52 location. For example
53 <programlisting>
54 f = print (?stk :: CallStack)
55 </programlisting>
56 will print the singleton stack containing the occurrence of
57 <literal>?stk</literal>. If there is another
58 <literal>CallStack</literal> implicit in-scope, the new location
59 will be appended to the existing stack, e.g.
60 <programlisting>
61 f :: (?stk :: CallStack) => IO ()
62 f = print (?stk :: CallStack)
63 </programlisting>
64 will print the occurrence of <literal>?stk</literal> and the
65 call-site of <literal>f</literal>. The name of the implicit
66 parameter does not matter.
67 </para>
68 <para>
69 See the release notes for ghc-prim for a description of the
70 <literal>CallStack</literal> type.
71 </para>
72 </listitem>
73 <listitem>
74 <para>
75 To conform to the common case, the default role assigned to parameters
76 of datatypes declared in <literal>hs-boot</literal> files is
77 <literal>representational</literal>. However, if the constructor(s)
78 for the datatype are given, it makes sense to do normal role inference.
79 This is now implemented, effectively making the default role for
80 non-abstract datatypes in <literal>hs-boot</literal> files to be
81 <literal>phantom</literal>, like it is in regular Haskell code.
82 </para>
83 </listitem>
84 <listitem>
85 <para>
86 Wildcards can be used in the type arguments of type/data
87 family instance declarations to indicate that the name of a
88 type variable doesn't matter. They will be replaced with new
89 unique type variables. See <xref
90 linkend="data-instance-declarations"/> for more details.
91 </para>
92 </listitem>
93 </itemizedlist>
94 </sect3>
95
96 <sect3>
97 <title>Compiler</title>
98 <itemizedlist>
99 <listitem>
100 <para>
101 Added the option <option>-dth-dec-file</option>.
102
103 This dumps out a .th.hs file of all Template Haskell declarations in a corresponding .hs file. The idea is that application developers can check this into their repository so that they can grep for identifiers used elsewhere that were defined in Template Haskell.
104 This is similar to using <option>-ddump-to-file</option> with <option>-ddump-splices</option> but it always generates a file instead of being coupled to <option>-ddump-to-file</option> and only outputs code that does not exist in the .hs file and a comment for the splice location in the original file.
105 </para>
106 </listitem>
107 <listitem>
108 <para>
109 Added the option <option>-fprint-expanded-types</option>.
110
111 When enabled, GHC also prints type-synonym-expanded types in
112 type errors.
113 </para>
114 </listitem>
115 <listitem>
116 <para>
117 Added the option <option>-fcpr-anal</option>.
118
119 When enabled, the demand analyser performs CPR analysis.
120 It is implied by <option>-O</option>. Consequently,
121 <option>-fcpr-off</option> is now removed, run with
122 <option>-fno-cpr-anal</option> to get the old
123 <option>-fcpr-off</option> behaviour.
124 </para>
125 </listitem>
126 </itemizedlist>
127 </sect3>
128
129 <sect3>
130 <title>GHCi</title>
131 <itemizedlist>
132 <listitem>
133 <para>
134 <literal>Main</literal> with an explicit module header but
135 without <literal>main</literal> is now an error (#7765).
136 </para>
137 <para>
138 The <literal>:back</literal> and <literal>:forward</literal>
139 commands now take an optional count allowing the user to move forward or
140 backward in history several steps at a time.
141 </para>
142 <para>
143 Added commands <literal>:load!</literal> and <literal>:reload!</literal>,
144 effectively setting "-fdefer-type-errors" before loading a module and
145 unsetting it after loading if it has not been set before (#8353).
146 </para>
147 </listitem>
148 </itemizedlist>
149 </sect3>
150
151 <sect3>
152 <title>Template Haskell</title>
153 <itemizedlist>
154 <listitem>
155 <para>
156 The <literal>TemplateHaskell</literal> now no longer automatically
157 errors when used with a stage 1 compiler (i.e. GHC without
158 interpreter support); in particular, plain
159 Haskell quotes (not quasi-quotes) can now be compiled without erroring.
160 Splices and quasi-quotes continue to only be supported by a
161 stage 2 compiler.
162 </para>
163 </listitem>
164 <listitem>
165 <para>
166 Partial type signatures can now be used in splices, see <xref linkend="pts-where"/>.
167 </para>
168 </listitem>
169 <listitem>
170 <para>
171 <literal>Template Haskell</literal> now supports the use of
172 <literal>UInfixT</literal> in types to resolve infix
173 operator fixities, in the same vein as
174 <literal>UInfixP</literal> and <literal>UInfixE</literal>
175 in patterns and expressions. <literal>ParensT</literal>
176 and <literal>InfixT</literal> have also been introduced,
177 serving the same functions as their pattern and expression
178 counterparts.
179 </para>
180 </listitem>
181 <listitem>
182 <para>
183 Primitive chars (e.g., <literal>[| 'a'# |]</literal>) and
184 primitive strings (e.g., <literal>[| "abc"# |]</literal>)
185 can now be quoted with Template Haskell. The
186 <literal>Lit</literal> data type also has a new
187 constructor, <literal>CharPrimL</literal>, for primitive
188 char literals.
189 </para>
190 </listitem>
191 </itemizedlist>
192 </sect3>
193
194 <sect3>
195 <title>Runtime system</title>
196 <itemizedlist>
197 <listitem>
198 <para>
199 TODO FIXME.
200 </para>
201 </listitem>
202 </itemizedlist>
203 </sect3>
204
205 <sect3>
206 <title>Build system</title>
207 <itemizedlist>
208 <listitem>
209 <para>
210 TODO FIXME.
211 </para>
212 </listitem>
213 </itemizedlist>
214 </sect3>
215
216 <sect3>
217 <title>Package system</title>
218 <itemizedlist>
219 <listitem>
220 <para>
221 TODO FIXME.
222 </para>
223 </listitem>
224 </itemizedlist>
225 </sect3>
226 </sect2>
227
228 <sect2>
229 <title>Libraries</title>
230
231 <sect3>
232 <title>array</title>
233 <itemizedlist>
234 <listitem>
235 <para>
236 Version number XXXXX (was 0.5.0.0)
237 </para>
238 </listitem>
239 </itemizedlist>
240 </sect3>
241
242 <sect3>
243 <title>base</title>
244 <itemizedlist>
245 <listitem>
246 <para>
247 Version number XXXXX (was 4.7.0.0)
248 </para>
249 </listitem>
250 <listitem>
251 <para>
252 The functions <literal>error</literal>,
253 <literal>undefined</literal>, and
254 <literal>assertError</literal> now take an implicit
255 <literal>CallStack</literal> parameter, and will
256 output a formatted call stack alongside the error
257 message.
258 </para>
259 <para>
260 See <xref linkend="implicit-parameters-special"/> for a description of the
261 implicit call stack feature.
262 </para>
263 </listitem>
264 <listitem>
265 <para>
266 A new function, <literal>interruptible</literal>, was added
267 to <literal>GHC.IO</literal> allowing an
268 <literal>IO</literal> action to be run such that it can be
269 interrupted by an asynchronous exception, even if exceptions
270 are masked (except if masked with
271 <literal>interruptibleMask</literal>).
272 </para>
273 <para>
274 This was introduced to fix the behavior of
275 <literal>allowInterrupt</literal>, which would previously
276 incorrectly allow exceptions in uninterruptible regions
277 (see Trac #9516).
278 </para>
279 </listitem>
280 </itemizedlist>
281 </sect3>
282
283 <sect3>
284 <title>bin-package-db</title>
285 <itemizedlist>
286 <listitem>
287 <para>
288 This is an internal package, and should not be used.
289 </para>
290 </listitem>
291 </itemizedlist>
292 </sect3>
293
294 <sect3>
295 <title>binary</title>
296 <itemizedlist>
297 <listitem>
298 <para>
299 Version number XXXXX (was 0.7.1.0)
300 </para>
301 </listitem>
302 </itemizedlist>
303 </sect3>
304
305 <sect3>
306 <title>bytestring</title>
307 <itemizedlist>
308 <listitem>
309 <para>
310 Version number XXXXX (was 0.10.4.0)
311 </para>
312 </listitem>
313 </itemizedlist>
314 </sect3>
315
316 <sect3>
317 <title>Cabal</title>
318 <itemizedlist>
319 <listitem>
320 <para>
321 Version number XXXXX (was 1.18.1.3)
322 </para>
323 </listitem>
324 </itemizedlist>
325 </sect3>
326
327 <sect3>
328 <title>containers</title>
329 <itemizedlist>
330 <listitem>
331 <para>
332 Version number XXXXX (was 0.5.4.0)
333 </para>
334 </listitem>
335 </itemizedlist>
336 </sect3>
337
338 <sect3>
339 <title>deepseq</title>
340 <itemizedlist>
341 <listitem>
342 <para>
343 Version number XXXXX (was 1.3.0.2)
344 </para>
345 </listitem>
346 </itemizedlist>
347 </sect3>
348
349 <sect3>
350 <title>directory</title>
351 <itemizedlist>
352 <listitem>
353 <para>
354 Version number XXXXX (was 1.2.0.2)
355 </para>
356 </listitem>
357 </itemizedlist>
358 </sect3>
359
360 <sect3>
361 <title>filepath</title>
362 <itemizedlist>
363 <listitem>
364 <para>
365 Version number XXXXX (was 1.3.0.2)
366 </para>
367 </listitem>
368 </itemizedlist>
369 </sect3>
370
371 <sect3>
372 <title>ghc</title>
373 <itemizedlist>
374 <listitem>
375 <para>
376 TODO FIXME.
377 </para>
378 </listitem>
379 <listitem>
380 <para>
381 The <literal>HsBang</literal> type has been removed in
382 favour of <literal>HsSrcBang</literal> and
383 <literal>HsImplBang</literal>. Data constructors now
384 always carry around their strictness annotations as
385 the user wrote them, whether from an imported module
386 or not.
387 </para>
388 </listitem>
389 </itemizedlist>
390 </sect3>
391
392 <sect3>
393 <title>ghc-prim</title>
394 <itemizedlist>
395 <listitem>
396 <para>
397 Version number XXXXX (was 0.3.1.0)
398 </para>
399 </listitem>
400 <listitem>
401 <para>
402 A new type <literal>SrcLoc</literal> was added. A
403 <literal>SrcLoc</literal> contains package, module,
404 and file names, as well as start and end positions.
405 </para>
406 </listitem>
407 <listitem>
408 <para>
409 A new type <literal>CallStack</literal> was added for use
410 with the new implicit callstack parameters. A
411 <literal>CallStack</literal> is a
412 <literal>[(String, SrcLoc)]</literal>, sorted by most-recent
413 call.
414 </para>
415 </listitem>
416 </itemizedlist>
417 </sect3>
418
419 <sect3>
420 <title>haskell98</title>
421 <itemizedlist>
422 <listitem>
423 <para>
424 Version number XXXXX (was 2.0.0.3)
425 </para>
426 </listitem>
427 </itemizedlist>
428 </sect3>
429
430 <sect3>
431 <title>haskell2010</title>
432 <itemizedlist>
433 <listitem>
434 <para>
435 Version number XXXXX (was 1.1.1.1)
436 </para>
437 </listitem>
438 </itemizedlist>
439 </sect3>
440
441 <sect3>
442 <title>hoopl</title>
443 <itemizedlist>
444 <listitem>
445 <para>
446 Version number XXXXX (was 3.10.0.0)
447 </para>
448 </listitem>
449 </itemizedlist>
450 </sect3>
451
452 <sect3>
453 <title>hpc</title>
454 <itemizedlist>
455 <listitem>
456 <para>
457 Version number XXXXX (was 0.6.0.1)
458 </para>
459 </listitem>
460 </itemizedlist>
461 </sect3>
462
463 <sect3>
464 <title>integer-gmp</title>
465 <itemizedlist>
466 <listitem>
467 <para>
468 Version number XXXXX (was 0.5.1.0)
469 </para>
470 </listitem>
471 </itemizedlist>
472 </sect3>
473
474 <sect3>
475 <title>old-locale</title>
476 <itemizedlist>
477 <listitem>
478 <para>
479 Version number XXXXX (was 1.0.0.6)
480 </para>
481 </listitem>
482 </itemizedlist>
483 </sect3>
484
485 <sect3>
486 <title>old-time</title>
487 <itemizedlist>
488 <listitem>
489 <para>
490 Version number XXXXX (was 1.1.0.2)
491 </para>
492 </listitem>
493 </itemizedlist>
494 </sect3>
495
496 <sect3>
497 <title>process</title>
498 <itemizedlist>
499 <listitem>
500 <para>
501 Version number XXXXX (was 1.2.0.0)
502 </para>
503 </listitem>
504 </itemizedlist>
505 </sect3>
506
507 <sect3>
508 <title>template-haskell</title>
509 <itemizedlist>
510 <listitem>
511 <para>
512 Version number XXXXX (was 2.9.0.0)
513 </para>
514 </listitem>
515 <listitem>
516 <para>
517 The <literal>Lift</literal> type class for lifting values
518 into Template Haskell splices now has a default signature
519 <literal>lift :: Data a => a -> Q Exp</literal>, which means
520 that you do not have to provide an explicit implementation
521 of <literal>lift</literal> for types which have a <literal>Data</literal>
522 instance. To manually use this default implementation, you
523 can use the <literal>liftData</literal> function which is
524 now exported from <literal>Language.Haskell.TH.Syntax</literal>.
525 </para>
526 </listitem>
527 <listitem>
528 <para>
529 <literal>Info</literal>'s constructors no longer have
530 <literal>Fixity</literal> fields. A <literal>qReifyFixity
531 </literal> function was added to the <literal>Quasi
532 </literal> type class (as well as the <literal>reifyFixity
533 </literal> function, specialized for <literal>Q</literal>)
534 to allow lookup of fixity information for any given
535 <literal>Name</literal>.
536 </para>
537 </listitem>
538 </itemizedlist>
539 </sect3>
540
541 <sect3>
542 <title>time</title>
543 <itemizedlist>
544 <listitem>
545 <para>
546 Version number XXXXX (was 1.4.1)
547 </para>
548 </listitem>
549 </itemizedlist>
550 </sect3>
551
552 <sect3>
553 <title>unix</title>
554 <itemizedlist>
555 <listitem>
556 <para>
557 Version number XXXXX (was 2.7.0.0)
558 </para>
559 </listitem>
560 </itemizedlist>
561 </sect3>
562
563 <sect3>
564 <title>Win32</title>
565 <itemizedlist>
566 <listitem>
567 <para>
568 Version number XXXXX (was 2.3.0.1)
569 </para>
570 </listitem>
571 </itemizedlist>
572 </sect3>
573 </sect2>
574
575 <sect2>
576 <title>Known bugs</title>
577 <itemizedlist>
578 <listitem>
579 <para>
580 TODO FIXME
581 </para>
582 </listitem>
583 </itemizedlist>
584 </sect2>
585 </sect1>