2 % (c) The AQUA Project, Glasgow University, 1996
4 \section[PprStyle]{Pretty-printing `styles'}
7 #include "HsVersions.h"
11 codeStyle, ifaceStyle,
15 CHK_Ubiq() -- debugging consistency check
16 IMP_FASTSTRING() -- cheat to force fast string dependency.
19 = PprForUser -- Pretty-print in a way that will
20 -- make sense to the ordinary user;
21 -- must be very close to Haskell
22 -- syntax, etc. ToDo: how diff is
23 -- this from what pprInterface must
25 | PprDebug -- Standard debugging output
26 | PprShowAll -- Debugging output which leaves
27 -- nothing to the imagination
28 | PprInterface -- Interface generation
29 | PprForC -- must print out C-acceptable names
30 | PprUnfolding -- for non-interface intermodule info
31 -- the compiler writes/reads
32 | PprForAsm -- must print out assembler-acceptable names
33 Bool -- prefix CLabel with underscore?
34 (String -> String) -- format AsmTempLabel
37 Orthogonal to the above printing styles are (possibly) some
38 command-line flags that affect printing (often carried with the
39 style). The most likely ones are variations on how much type info is
42 The following test decides whether or not we are actually generating
43 code (either C or assembly), or generating interface files.
45 codeStyle :: PprStyle -> Bool
47 codeStyle PprForC = True
48 codeStyle (PprForAsm _ _) = True
51 ifaceStyle :: PprStyle -> Bool
52 ifaceStyle PprInterface = True
53 ifaceStyle other = False
57 -- True means types like (Eq a, Text b) => a -> b
58 -- False means types like _forall_ a b => Eq a -> Text b -> a -> b
59 showUserishTypes PprForUser = True
60 showUserishTypes other = False