Add Fixity info for infix types
[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 base type
50 <literal>GHC.Stack.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 base 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 A new module <literal>GHC.SrcLoc</literal> was added,
253 exporting a new type <literal>SrcLoc</literal>. A
254 <literal>SrcLoc</literal> contains package, module,
255 and file names, as well as start and end positions.
256 </para>
257 </listitem>
258 <listitem>
259 <para>
260 A new type <literal>CallStack</literal> was added for use
261 with the new implicit callstack parameters. A
262 <literal>CallStack</literal> is a
263 <literal>[(String, SrcLoc)]</literal>, sorted by most-recent
264 call.
265 </para>
266 </listitem>
267 <listitem>
268 <para>
269 A new function, <literal>interruptible</literal>, was added
270 to <literal>GHC.IO</literal> allowing an
271 <literal>IO</literal> action to be run such that it can be
272 interrupted by an asynchronous exception, even if exceptions
273 are masked (except if masked with
274 <literal>interruptibleMask</literal>).
275 </para>
276 <para>
277 This was introduced to fix the behavior of
278 <literal>allowInterrupt</literal>, which would previously
279 incorrectly allow exceptions in uninterruptible regions
280 (see Trac #9516).
281 </para>
282 </listitem>
283 </itemizedlist>
284 </sect3>
285
286 <sect3>
287 <title>bin-package-db</title>
288 <itemizedlist>
289 <listitem>
290 <para>
291 This is an internal package, and should not be used.
292 </para>
293 </listitem>
294 </itemizedlist>
295 </sect3>
296
297 <sect3>
298 <title>binary</title>
299 <itemizedlist>
300 <listitem>
301 <para>
302 Version number XXXXX (was 0.7.1.0)
303 </para>
304 </listitem>
305 </itemizedlist>
306 </sect3>
307
308 <sect3>
309 <title>bytestring</title>
310 <itemizedlist>
311 <listitem>
312 <para>
313 Version number XXXXX (was 0.10.4.0)
314 </para>
315 </listitem>
316 </itemizedlist>
317 </sect3>
318
319 <sect3>
320 <title>Cabal</title>
321 <itemizedlist>
322 <listitem>
323 <para>
324 Version number XXXXX (was 1.18.1.3)
325 </para>
326 </listitem>
327 </itemizedlist>
328 </sect3>
329
330 <sect3>
331 <title>containers</title>
332 <itemizedlist>
333 <listitem>
334 <para>
335 Version number XXXXX (was 0.5.4.0)
336 </para>
337 </listitem>
338 </itemizedlist>
339 </sect3>
340
341 <sect3>
342 <title>deepseq</title>
343 <itemizedlist>
344 <listitem>
345 <para>
346 Version number XXXXX (was 1.3.0.2)
347 </para>
348 </listitem>
349 </itemizedlist>
350 </sect3>
351
352 <sect3>
353 <title>directory</title>
354 <itemizedlist>
355 <listitem>
356 <para>
357 Version number XXXXX (was 1.2.0.2)
358 </para>
359 </listitem>
360 </itemizedlist>
361 </sect3>
362
363 <sect3>
364 <title>filepath</title>
365 <itemizedlist>
366 <listitem>
367 <para>
368 Version number XXXXX (was 1.3.0.2)
369 </para>
370 </listitem>
371 </itemizedlist>
372 </sect3>
373
374 <sect3>
375 <title>ghc</title>
376 <itemizedlist>
377 <listitem>
378 <para>
379 TODO FIXME.
380 </para>
381 </listitem>
382 </itemizedlist>
383 </sect3>
384
385 <sect3>
386 <title>ghc-prim</title>
387 <itemizedlist>
388 <listitem>
389 <para>
390 Version number XXXXX (was 0.3.1.0)
391 </para>
392 </listitem>
393 </itemizedlist>
394 </sect3>
395
396 <sect3>
397 <title>haskell98</title>
398 <itemizedlist>
399 <listitem>
400 <para>
401 Version number XXXXX (was 2.0.0.3)
402 </para>
403 </listitem>
404 </itemizedlist>
405 </sect3>
406
407 <sect3>
408 <title>haskell2010</title>
409 <itemizedlist>
410 <listitem>
411 <para>
412 Version number XXXXX (was 1.1.1.1)
413 </para>
414 </listitem>
415 </itemizedlist>
416 </sect3>
417
418 <sect3>
419 <title>hoopl</title>
420 <itemizedlist>
421 <listitem>
422 <para>
423 Version number XXXXX (was 3.10.0.0)
424 </para>
425 </listitem>
426 </itemizedlist>
427 </sect3>
428
429 <sect3>
430 <title>hpc</title>
431 <itemizedlist>
432 <listitem>
433 <para>
434 Version number XXXXX (was 0.6.0.1)
435 </para>
436 </listitem>
437 </itemizedlist>
438 </sect3>
439
440 <sect3>
441 <title>integer-gmp</title>
442 <itemizedlist>
443 <listitem>
444 <para>
445 Version number XXXXX (was 0.5.1.0)
446 </para>
447 </listitem>
448 </itemizedlist>
449 </sect3>
450
451 <sect3>
452 <title>old-locale</title>
453 <itemizedlist>
454 <listitem>
455 <para>
456 Version number XXXXX (was 1.0.0.6)
457 </para>
458 </listitem>
459 </itemizedlist>
460 </sect3>
461
462 <sect3>
463 <title>old-time</title>
464 <itemizedlist>
465 <listitem>
466 <para>
467 Version number XXXXX (was 1.1.0.2)
468 </para>
469 </listitem>
470 </itemizedlist>
471 </sect3>
472
473 <sect3>
474 <title>process</title>
475 <itemizedlist>
476 <listitem>
477 <para>
478 Version number XXXXX (was 1.2.0.0)
479 </para>
480 </listitem>
481 </itemizedlist>
482 </sect3>
483
484 <sect3>
485 <title>template-haskell</title>
486 <itemizedlist>
487 <listitem>
488 <para>
489 Version number XXXXX (was 2.9.0.0)
490 </para>
491 </listitem>
492 <listitem>
493 <para>
494 The <literal>Lift</literal> type class for lifting values
495 into Template Haskell splices now has a default signature
496 <literal>lift :: Data a => a -> Q Exp</literal>, which means
497 that you do not have to provide an explicit implementation
498 of <literal>lift</literal> for types which have a <literal>Data</literal>
499 instance. To manually use this default implementation, you
500 can use the <literal>liftData</literal> function which is
501 now exported from <literal>Language.Haskell.TH.Syntax</literal>.
502 </para>
503 </listitem>
504 <listitem>
505 <para>
506 <literal>Info</literal>'s constructors no longer have
507 <literal>Fixity</literal> fields. A <literal>qReifyFixity
508 </literal> function was added to the <literal>Quasi
509 </literal> type class (as well as the <literal>reifyFixity
510 </literal> function, specialized for <literal>Q</literal>)
511 to allow lookup of fixity information for any given
512 <literal>Name</literal>.
513 </para>
514 </listitem>
515 </itemizedlist>
516 </sect3>
517
518 <sect3>
519 <title>time</title>
520 <itemizedlist>
521 <listitem>
522 <para>
523 Version number XXXXX (was 1.4.1)
524 </para>
525 </listitem>
526 </itemizedlist>
527 </sect3>
528
529 <sect3>
530 <title>unix</title>
531 <itemizedlist>
532 <listitem>
533 <para>
534 Version number XXXXX (was 2.7.0.0)
535 </para>
536 </listitem>
537 </itemizedlist>
538 </sect3>
539
540 <sect3>
541 <title>Win32</title>
542 <itemizedlist>
543 <listitem>
544 <para>
545 Version number XXXXX (was 2.3.0.1)
546 </para>
547 </listitem>
548 </itemizedlist>
549 </sect3>
550 </sect2>
551
552 <sect2>
553 <title>Known bugs</title>
554 <itemizedlist>
555 <listitem>
556 <para>
557 TODO FIXME
558 </para>
559 </listitem>
560 </itemizedlist>
561 </sect2>
562 </sect1>