Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-generics
[ghc-hetmet.git] / docs / users_guide / debugging.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="options-debugging">
3   <title>Debugging the compiler</title>
4
5   <indexterm><primary>debugging options (for GHC)</primary></indexterm>
6
7   <para>HACKER TERRITORY. HACKER TERRITORY.  (You were warned.)</para>
8
9   <sect2 id="dumping-output">
10     <title>Dumping out compiler intermediate structures</title>
11     
12     <indexterm><primary>dumping GHC intermediates</primary></indexterm>
13     <indexterm><primary>intermediate passes, output</primary></indexterm>
14     
15     <variablelist>
16       <varlistentry>
17         <term>
18           <option>-ddump-</option><replaceable>pass</replaceable>
19           <indexterm><primary><option>-ddump</option> options</primary></indexterm>
20         </term>
21         <listitem>
22           <para>Make a debugging dump after pass
23         <literal>&lt;pass&gt;</literal> (may be common enough to need
24         a short form&hellip;).  You can get all of these at once
25         (<emphasis>lots</emphasis> of output) by using
26         <option>-v5</option>, or most of them with
27         <option>-v4</option>.  You can prevent them from clogging up
28         your standard output by passing <option>-ddump-to-file</option>.
29         Some of the most useful ones are:</para>
30
31           <variablelist>
32             <varlistentry>
33               <term>
34                 <option>-ddump-parsed</option>:
35                 <indexterm><primary><option>-ddump-parsed</option></primary></indexterm>
36               </term>
37               <listitem>
38                 <para>parser output</para>
39               </listitem>
40             </varlistentry>
41
42             <varlistentry>
43               <term>
44                 <option>-ddump-rn</option>:
45                 <indexterm><primary><option>-ddump-rn</option></primary></indexterm>
46               </term>
47               <listitem>
48                 <para>renamer output</para>
49               </listitem>
50             </varlistentry>
51
52             <varlistentry>
53               <term>
54                 <option>-ddump-tc</option>:
55                 <indexterm><primary><option>-ddump-tc</option></primary></indexterm>
56               </term>
57               <listitem>
58                 <para>typechecker output</para>
59               </listitem>
60             </varlistentry>
61
62             <varlistentry>
63               <term>
64                 <option>-ddump-splices</option>:
65                 <indexterm><primary><option>-ddump-splices</option></primary></indexterm>
66               </term>
67               <listitem>
68                 <para>Dump Template Haskell expressions that we splice in,
69                 and what Haskell code the expression evaluates to.</para>
70               </listitem>
71             </varlistentry>
72
73             <varlistentry>
74               <term>
75                 <option>-ddump-types</option>:
76                 <indexterm><primary><option>-ddump-types</option></primary></indexterm>
77               </term>
78               <listitem>
79                 <para>Dump a type signature for each value defined at
80               the top level of the module.  The list is sorted
81               alphabetically.  Using <option>-dppr-debug</option>
82               dumps a type signature for all the imported and
83               system-defined things as well; useful for debugging the
84               compiler.</para>
85               </listitem>
86             </varlistentry>
87
88             <varlistentry>
89               <term>
90                 <option>-ddump-deriv</option>:
91                 <indexterm><primary><option>-ddump-deriv</option></primary></indexterm>
92               </term>
93               <listitem>
94                 <para>derived instances</para>
95               </listitem>
96             </varlistentry>
97
98             <varlistentry>
99               <term>
100                 <option>-ddump-ds</option>:
101                 <indexterm><primary><option>-ddump-ds</option></primary></indexterm>
102               </term>
103               <listitem>
104                 <para>desugarer output</para>
105               </listitem>
106             </varlistentry>
107
108             <varlistentry>
109               <term>
110                 <option>-ddump-spec</option>:
111                 <indexterm><primary><option>-ddump-spec</option></primary></indexterm>
112               </term>
113               <listitem>
114                 <para>output of specialisation pass</para>
115               </listitem>
116             </varlistentry>
117
118             <varlistentry>
119               <term>
120                 <option>-ddump-rules</option>:
121                 <indexterm><primary><option>-ddump-rules</option></primary></indexterm>
122               </term>
123               <listitem>
124                 <para>dumps all rewrite rules specified in this module; 
125                       see <xref linkend="controlling-rules"/>.
126                 </para>
127               </listitem>
128             </varlistentry>
129
130             <varlistentry>
131               <term>
132                 <option>-ddump-rule-firings</option>:
133                 <indexterm><primary><option>-ddump-rule-firings</option></primary></indexterm>
134               </term>
135               <listitem>
136                 <para>dumps the names of all rules that fired in this module</para>
137               </listitem>
138             </varlistentry>
139
140             <varlistentry>
141               <term>
142                 <option>-ddump-rule-rewrites</option>:
143                 <indexterm><primary><option>-ddump-rule-rewrites</option></primary></indexterm>
144               </term>
145               <listitem>
146                 <para>dumps detailed information about all rules that fired in
147                       this module
148                 </para>
149               </listitem>
150             </varlistentry>
151
152             <varlistentry>
153               <term>
154                 <option>-ddump-vect</option>:
155                 <indexterm><primary><option>-ddump-vect</option></primary></indexterm>
156               </term>
157               <listitem>
158                 <para>dumps the output of the vectoriser.
159                 </para>
160               </listitem>
161             </varlistentry>
162
163             <varlistentry>
164               <term>
165                 <option>-ddump-simpl</option>:
166                 <indexterm><primary><option>-ddump-simpl</option></primary></indexterm>
167               </term>
168               <listitem>
169                 <para>simplifier output (Core-to-Core passes)</para>
170               </listitem>
171             </varlistentry>
172
173             <varlistentry>
174               <term>
175                 <option>-ddump-inlinings</option>:
176                 <indexterm><primary><option>-ddump-inlinings</option></primary></indexterm>
177               </term>
178               <listitem>
179                 <para>inlining info from the simplifier</para>
180               </listitem>
181             </varlistentry>
182
183             <varlistentry>
184               <term>
185                 <option>-ddump-cpranal</option>:
186                 <indexterm><primary><option>-ddump-cpranal</option></primary></indexterm>
187               </term>
188               <listitem>
189                 <para>CPR analyser output</para>
190               </listitem>
191             </varlistentry>
192
193             <varlistentry>
194               <term>
195                 <option>-ddump-stranal</option>:
196                 <indexterm><primary><option>-ddump-stranal</option></primary></indexterm>
197               </term>
198               <listitem>
199                 <para>strictness analyser output</para>
200               </listitem>
201             </varlistentry>
202
203             <varlistentry>
204               <term>
205                 <option>-ddump-cse</option>:
206                 <indexterm><primary><option>-ddump-cse</option></primary></indexterm>
207               </term>
208               <listitem>
209                 <para>CSE pass output</para>
210               </listitem>
211             </varlistentry>
212
213             <varlistentry>
214               <term>
215                 <option>-ddump-worker-wrapper</option>:
216                 <indexterm><primary><option>-ddump-worker-wrapper</option></primary></indexterm>
217               </term>
218               <listitem>
219                 <para>worker/wrapper split output</para>
220               </listitem>
221             </varlistentry>
222
223             <varlistentry>
224               <term>
225                 <option>-ddump-occur-anal</option>:
226                 <indexterm><primary><option>-ddump-occur-anal</option></primary></indexterm>
227               </term>
228               <listitem>
229                 <para>`occurrence analysis' output</para>
230               </listitem>
231             </varlistentry>
232
233             <varlistentry>
234               <term>
235                 <option>-ddump-prep</option>:
236                 <indexterm><primary><option>-ddump-prep</option></primary></indexterm>
237               </term>
238               <listitem>
239                 <para>output of core preparation pass</para>
240               </listitem>
241             </varlistentry>
242
243             <varlistentry>
244               <term>
245                 <option>-ddump-stg</option>:
246                 <indexterm><primary><option>-ddump-stg</option></primary></indexterm>
247               </term>
248               <listitem>
249                 <para>output of STG-to-STG passes</para>
250               </listitem>
251             </varlistentry>
252
253             <varlistentry>
254               <term>
255                 <option>-ddump-flatC</option>:
256                 <indexterm><primary><option>-ddump-flatC</option></primary></indexterm>
257               </term>
258               <listitem>
259                 <para><emphasis>flattened</emphasis> Abstract&nbsp;C</para>
260               </listitem>
261             </varlistentry>
262
263             <varlistentry>
264               <term>
265                 <option>-ddump-cmm</option>:
266                 <indexterm><primary><option>-ddump-cmm</option></primary></indexterm>
267               </term>
268               <listitem>
269                 <para>Print the C-- code out.</para>
270               </listitem>
271             </varlistentry>
272
273             <varlistentry>
274               <term>
275                 <option>-ddump-opt-cmm</option>:
276                 <indexterm><primary><option>-ddump-opt-cmm</option></primary></indexterm>
277               </term>
278               <listitem>
279                 <para>Dump the results of C-- to C-- optimising passes.</para>
280               </listitem>
281             </varlistentry>
282
283             <varlistentry>
284               <term>
285                 <option>-ddump-asm</option>:
286                 <indexterm><primary><option>-ddump-asm</option></primary></indexterm>
287               </term>
288               <listitem>
289                 <para>assembly language from the native-code generator</para>
290               </listitem>
291             </varlistentry>
292
293             <varlistentry>
294               <term>
295                 <option>-ddump-bcos</option>:
296                 <indexterm><primary><option>-ddump-bcos</option></primary></indexterm>
297               </term>
298               <listitem>
299                 <para>byte code compiler output</para>
300               </listitem>
301             </varlistentry>
302
303             <varlistentry>
304               <term>
305                 <option>-ddump-foreign</option>:
306                 <indexterm><primary><option>-ddump-foreign</option></primary></indexterm>
307               </term>
308               <listitem>
309                 <para>dump foreign export stubs</para>
310               </listitem>
311             </varlistentry>
312           </variablelist>
313         </listitem>
314       </varlistentry>
315       
316       <varlistentry>
317         <term>
318           <option>-ddump-simpl-phases</option>:
319           <indexterm><primary><option>-ddump-simpl-phases</option></primary></indexterm>
320         </term>
321         <listitem>
322           <para>Show the output of each run of the simplifier.  Used when even
323         <option>-dverbose-core2core</option> doesn't cut it.</para>
324         </listitem>
325       </varlistentry>
326
327       <varlistentry>
328         <term>
329           <option>-ddump-simpl-iterations</option>:
330           <indexterm><primary><option>-ddump-simpl-iterations</option></primary></indexterm>
331         </term>
332         <listitem>
333           <para>Show the output of each <emphasis>iteration</emphasis>
334         of the simplifier (each run of the simplifier has a maximum
335         number of iterations, normally 4).  This outputs even more information
336         than <option>-ddump-simpl-phases</option>.</para>
337         </listitem>
338       </varlistentry>
339
340       <varlistentry>
341         <term>
342           <option>-ddump-simpl-stats</option>
343           <indexterm><primary><option>-ddump-simpl-stats option</option></primary></indexterm>
344         </term>
345         <listitem>
346           <para>Dump statistics about how many of each kind of
347         transformation too place.  If you add
348         <option>-dppr-debug</option> you get more detailed
349         information.</para>
350         </listitem>
351       </varlistentry>
352
353       <varlistentry>
354         <term>
355           <option>-ddump-if-trace</option>
356           <indexterm><primary><option>-ddump-if-trace</option></primary></indexterm>
357         </term>
358         <listitem>
359           <para>Make the interface loader be *real* chatty about what it is
360         upto.</para>
361         </listitem>
362       </varlistentry>
363
364       <varlistentry>
365   <term>
366           <option>-ddump-tc-trace</option>
367           <indexterm><primary><option>-ddump-tc-trace</option></primary></indexterm>
368         </term>
369   <listitem>
370     <para>Make the type checker be *real* chatty about what it is
371   upto.</para>
372   </listitem>
373       </varlistentry>
374
375       <varlistentry>
376   <term>
377           <option>-ddump-vt-trace</option>
378           <indexterm><primary><option>-ddump-tv-trace</option></primary></indexterm>
379         </term>
380   <listitem>
381     <para>Make the vectoriser be *real* chatty about what it is
382   upto.</para>
383   </listitem>
384       </varlistentry>
385
386       <varlistentry>
387         <term>
388           <option>-ddump-rn-trace</option>
389           <indexterm><primary><option>-ddump-rn-trace</option></primary></indexterm>
390         </term>
391         <listitem>
392           <para>Make the renamer be *real* chatty about what it is
393         upto.</para>
394         </listitem>
395       </varlistentry>
396
397       <varlistentry>
398         <term>
399           <option>-ddump-rn-stats</option>
400           <indexterm><primary><option>-dshow-rn-stats</option></primary></indexterm>
401         </term>
402         <listitem>
403           <para>Print out summary of what kind of information the renamer
404         had to bring in.</para>
405         </listitem>
406       </varlistentry>
407
408       <varlistentry>
409         <term>
410           <option>-dverbose-core2core</option>
411           <indexterm><primary><option>-dverbose-core2core</option></primary></indexterm>
412         </term>
413         <term>
414           <option>-dverbose-stg2stg</option>
415           <indexterm><primary><option>-dverbose-stg2stg</option></primary></indexterm>
416         </term>
417         <listitem>
418           <para>Show the output of the intermediate Core-to-Core and
419         STG-to-STG passes, respectively.  (<emphasis>Lots</emphasis>
420         of output!) So: when we're really desperate:</para>
421
422           <screen>
423 % ghc -noC -O -ddump-simpl -dverbose-core2core -dcore-lint Foo.hs
424 </screen>
425
426         </listitem>
427       </varlistentry>
428       
429       <varlistentry>
430         <term>
431           <option>-dshow-passes</option>
432           <indexterm><primary><option>-dshow-passes</option></primary></indexterm>
433         </term>
434         <listitem>
435           <para>Print out each pass name as it happens.</para>
436         </listitem>
437       </varlistentry>
438
439       <varlistentry>
440         <term>
441           <option>-ddump-core-stats</option>
442           <indexterm><primary><option>-ddump-core-stats</option></primary></indexterm>
443         </term>
444         <listitem>
445           <para>Print a one-line summary of the size of the Core program
446                      at the end of the optimisation pipeline.</para>
447         </listitem>
448       </varlistentry>
449
450       <varlistentry>
451         <term>
452           <option>-dfaststring-stats</option>
453           <indexterm><primary><option>-dfaststring-stats</option></primary></indexterm>
454         </term>
455         <listitem>
456           <para>Show statistics for the usage of fast strings by the
457           compiler.</para>
458         </listitem>
459       </varlistentry>
460
461       <varlistentry>
462         <term>
463           <option>-dppr-debug</option>
464           <indexterm><primary><option>-dppr-debug</option></primary></indexterm>
465         </term>
466         <listitem>
467           <para>Debugging output is in one of several
468           &ldquo;styles.&rdquo; Take the printing of types, for
469           example.  In the &ldquo;user&rdquo; style (the default), the
470           compiler's internal ideas about types are presented in
471           Haskell source-level syntax, insofar as possible.  In the
472           &ldquo;debug&rdquo; style (which is the default for
473           debugging output), the types are printed in with explicit
474           foralls, and variables have their unique-id attached (so you
475           can check for things that look the same but aren't).  This
476           flag makes debugging output appear in the more verbose debug
477           style.</para>
478         </listitem>
479       </varlistentry>
480     </variablelist>
481   </sect2>
482
483   <sect2 id="formatting dumps">
484     <title>Formatting dumps</title>
485
486     <indexterm><primary>formatting dumps</primary></indexterm>
487
488      <variablelist>
489       <varlistentry>
490         <term>
491           <option>-dppr-user-length</option>
492           <indexterm><primary><option>-dppr-user-length</option></primary></indexterm>
493         </term>
494         <listitem>
495           <para>In error messages, expressions are printed to a
496           certain &ldquo;depth&rdquo;, with subexpressions beyond the
497           depth replaced by ellipses.  This flag sets the
498           depth.  Its default value is 5.</para>
499         </listitem>
500       </varlistentry>
501
502       <varlistentry>
503         <term>
504           <option>-dppr-colsNNN</option>
505           <indexterm><primary><option>-dppr-colsNNN</option></primary></indexterm>
506         </term>
507         <listitem>
508           <para>Set the width of debugging output. Use this if your code is wrapping too much.
509                 For example: <option>-dppr-cols200</option>.</para>
510         </listitem>
511       </varlistentry>
512
513       <varlistentry>
514         <term>
515           <option>-dppr-case-as-let</option>
516           <indexterm><primary><option>-dppr-case-as-let</option></primary></indexterm>
517         </term>
518         <listitem>
519           <para>Print single alternative case expressions as though they were strict 
520                 let expressions. This is helpful when your code does a lot of unboxing.</para>
521         </listitem>
522       </varlistentry>
523
524       <varlistentry>
525         <term>
526           <option>-dno-debug-output</option>
527           <indexterm><primary><option>-dno-debug-output</option></primary></indexterm>
528         </term>
529         <listitem>
530           <para>Suppress any unsolicited debugging output.  When GHC
531             has been built with the <literal>DEBUG</literal> option it
532             occasionally emits debug output of interest to developers.
533             The extra output can confuse the testing framework and
534             cause bogus test failures, so this flag is provided to
535             turn it off.</para>
536         </listitem>
537       </varlistentry>
538      </variablelist>
539
540   </sect2>
541
542   <sect2 id="supression">
543     <title>Suppressing unwanted information</title>
544
545     <indexterm><primary>suppression</primary></indexterm>
546
547     Core dumps contain a large amount of information. Depending on what you are doing, not all of it will be useful.
548     Use these flags to suppress the parts that you are not interested in.
549
550     <variablelist>
551       <varlistentry>
552         <term>
553           <option>-dsuppress-all</option>
554           <indexterm><primary><option>-dsuppress-all</option></primary></indexterm>
555         </term>
556         <listitem>
557           <para>Suppress everything that can be suppressed, except for unique ids as this often 
558                 makes the printout ambiguous. If you just want to see the overall structure of
559                 the code, then start here.</para>
560         </listitem>
561       </varlistentry>
562
563       <varlistentry>
564         <term>
565           <option>-dsuppress-uniques</option>
566           <indexterm><primary><option>-dsuppress-uniques</option></primary></indexterm>
567         </term>
568         <listitem>
569           <para>Suppress the printing of uniques. This may make 
570           the printout ambiguous (e.g. unclear where an occurrence of 'x' is bound), but
571           it makes the output of two compiler runs have many fewer gratuitous differences,
572             so you can realistically apply <command>diff</command>.  Once <command>diff</command>
573           has shown you where to look, you can try again without <option>-dsuppress-uniques</option></para>
574         </listitem>
575       </varlistentry>
576
577       <varlistentry>
578         <term>
579           <option>-dsuppress-idinfo</option>
580           <indexterm><primary><option>-dsuppress-idinfo</option></primary></indexterm>
581         </term>
582         <listitem>
583           <para>Suppress extended information about identifiers where they are bound. This includes
584                 strictness information and inliner templates. Using this flag can cut the size 
585                 of the core dump in half, due to the lack of inliner templates</para>
586         </listitem>
587       </varlistentry>
588
589       <varlistentry>
590         <term>
591           <option>-dsuppress-module-prefixes</option>
592           <indexterm><primary><option>-dsuppress-module-prefixes</option></primary></indexterm>
593         </term>
594         <listitem>
595           <para>Suppress the printing of module qualification prefixes.
596                 This is the <constant>Data.List</constant> in <constant>Data.List.length</constant>.</para>
597         </listitem>
598       </varlistentry>
599
600       <varlistentry>
601         <term>
602           <option>-dsuppress-type-signatures</option>
603           <indexterm><primary><option>-dsuppress-type-signatures</option></primary></indexterm>
604         </term>
605         <listitem>
606           <para>Suppress the printing of type signatures.</para>
607         </listitem>
608       </varlistentry>
609
610       <varlistentry>
611         <term>
612           <option>-dsuppress-type-applications</option>
613           <indexterm><primary><option>-dsuppress-type-applications</option></primary></indexterm>
614         </term>
615         <listitem>
616           <para>Suppress the printing of type applications.</para>
617         </listitem>
618       </varlistentry>
619
620       <varlistentry>
621         <term>
622           <option>-dsuppress-coercions</option>
623           <indexterm><primary><option>-dsuppress-coercions</option></primary></indexterm>
624         </term>
625         <listitem>
626           <para>Suppress the printing of type coercions.</para>
627         </listitem>
628       </varlistentry>
629     </variablelist>
630   </sect2>
631
632   <sect2 id="checking-consistency">
633     <title>Checking for consistency</title>
634
635     <indexterm><primary>consistency checks</primary></indexterm>
636     <indexterm><primary>lint</primary></indexterm>
637
638     <variablelist>
639
640       <varlistentry>
641         <term>
642           <option>-dcore-lint</option>
643           <indexterm><primary><option>-dcore-lint</option></primary></indexterm>
644         </term>
645         <listitem>
646           <para>Turn on heavyweight intra-pass sanity-checking within
647           GHC, at Core level.  (It checks GHC's sanity, not yours.)</para>
648         </listitem>
649       </varlistentry>
650
651       <varlistentry>
652         <term>
653           <option>-dstg-lint</option>:
654           <indexterm><primary><option>-dstg-lint</option></primary></indexterm>
655         </term>
656         <listitem>
657           <para>Ditto for STG level. (NOTE: currently doesn't work).</para>
658         </listitem>
659       </varlistentry>
660
661       <varlistentry>
662         <term>
663           <option>-dcmm-lint</option>:
664           <indexterm><primary><option>-dcmm-lint</option></primary></indexterm>
665         </term>
666         <listitem>
667           <para>Ditto for C-- level.</para>
668         </listitem>
669       </varlistentry>
670
671     </variablelist>
672   </sect2>
673
674   <sect2>
675     <title>How to read Core syntax (from some <option>-ddump</option>
676     flags)</title>
677
678     <indexterm><primary>reading Core syntax</primary></indexterm>
679     <indexterm><primary>Core syntax, how to read</primary></indexterm>
680
681     <para>Let's do this by commenting an example.  It's from doing
682     <option>-ddump-ds</option> on this code:
683
684 <programlisting>
685 skip2 m = m : skip2 (m+2)
686 </programlisting>
687
688     Before we jump in, a word about names of things.  Within GHC,
689     variables, type constructors, etc., are identified by their
690     &ldquo;Uniques.&rdquo; These are of the form `letter' plus
691     `number' (both loosely interpreted).  The `letter' gives some idea
692     of where the Unique came from; e.g., <literal>&lowbar;</literal>
693     means &ldquo;built-in type variable&rdquo;; <literal>t</literal>
694     means &ldquo;from the typechecker&rdquo;; <literal>s</literal>
695     means &ldquo;from the simplifier&rdquo;; and so on.  The `number'
696     is printed fairly compactly in a `base-62' format, which everyone
697     hates except me (WDP).</para>
698
699     <para>Remember, everything has a &ldquo;Unique&rdquo; and it is
700     usually printed out when debugging, in some form or another.  So
701     here we go&hellip;</para>
702
703 <programlisting>
704 Desugared:
705 Main.skip2{-r1L6-} :: _forall_ a$_4 =&#62;{{Num a$_4}} -&#62; a$_4 -&#62; [a$_4]
706
707 --# `r1L6' is the Unique for Main.skip2;
708 --# `_4' is the Unique for the type-variable (template) `a'
709 --# `{{Num a$_4}}' is a dictionary argument
710
711 _NI_
712
713 --# `_NI_' means "no (pragmatic) information" yet; it will later
714 --# evolve into the GHC_PRAGMA info that goes into interface files.
715
716 Main.skip2{-r1L6-} =
717     /\ _4 -&#62; \ d.Num.t4Gt -&#62;
718         let {
719           {- CoRec -}
720           +.t4Hg :: _4 -&#62; _4 -&#62; _4
721           _NI_
722           +.t4Hg = (+{-r3JH-} _4) d.Num.t4Gt
723
724           fromInt.t4GS :: Int{-2i-} -&#62; _4
725           _NI_
726           fromInt.t4GS = (fromInt{-r3JX-} _4) d.Num.t4Gt
727
728 --# The `+' class method (Unique: r3JH) selects the addition code
729 --# from a `Num' dictionary (now an explicit lambda'd argument).
730 --# Because Core is 2nd-order lambda-calculus, type applications
731 --# and lambdas (/\) are explicit.  So `+' is first applied to a
732 --# type (`_4'), then to a dictionary, yielding the actual addition
733 --# function that we will use subsequently...
734
735 --# We play the exact same game with the (non-standard) class method
736 --# `fromInt'.  Unsurprisingly, the type `Int' is wired into the
737 --# compiler.
738
739           lit.t4Hb :: _4
740           _NI_
741           lit.t4Hb =
742               let {
743                 ds.d4Qz :: Int{-2i-}
744                 _NI_
745                 ds.d4Qz = I#! 2#
746               } in  fromInt.t4GS ds.d4Qz
747
748 --# `I# 2#' is just the literal Int `2'; it reflects the fact that
749 --# GHC defines `data Int = I# Int#', where Int# is the primitive
750 --# unboxed type.  (see relevant info about unboxed types elsewhere...)
751
752 --# The `!' after `I#' indicates that this is a *saturated*
753 --# application of the `I#' data constructor (i.e., not partially
754 --# applied).
755
756           skip2.t3Ja :: _4 -&#62; [_4]
757           _NI_
758           skip2.t3Ja =
759               \ m.r1H4 -&#62;
760                   let { ds.d4QQ :: [_4]
761                         _NI_
762                         ds.d4QQ =
763                     let {
764                       ds.d4QY :: _4
765                       _NI_
766                       ds.d4QY = +.t4Hg m.r1H4 lit.t4Hb
767                     } in  skip2.t3Ja ds.d4QY
768                   } in
769                   :! _4 m.r1H4 ds.d4QQ
770
771           {- end CoRec -}
772         } in  skip2.t3Ja
773 </programlisting>
774
775     <para>(&ldquo;It's just a simple functional language&rdquo; is an
776     unregisterised trademark of Peyton Jones Enterprises, plc.)</para>
777
778   </sect2>
779
780   <sect2 id="unreg">
781     <title>Unregisterised compilation</title>
782     <indexterm><primary>unregisterised compilation</primary></indexterm>
783
784     <para>The term "unregisterised" really means "compile via vanilla
785     C", disabling some of the platform-specific tricks that GHC
786     normally uses to make programs go faster.  When compiling
787     unregisterised, GHC simply generates a C file which is compiled
788     via gcc.</para>
789
790     <para>Unregisterised compilation can be useful when porting GHC to
791     a new machine, since it reduces the prerequisite tools to
792     <command>gcc</command>, <command>as</command>, and
793     <command>ld</command> and nothing more, and furthermore the amount
794     of platform-specific code that needs to be written in order to get
795     unregisterised compilation going is usually fairly small.</para>
796
797    <para>Unregisterised compilation cannot be selected at
798    compile-time; you have to build GHC with the appropriate options
799    set.  Consult the GHC Building Guide for details.</para>
800   </sect2>
801
802 </sect1>
803
804 <!-- Emacs stuff:
805      ;;; Local Variables: ***
806      ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter" "sect1") ***
807      ;;; End: ***
808  -->