6 IMPORTANT! If you put extra tabs/spaces in these macro definitions,
7 you will screw up the layout where they are used in case expressions!
9 (This is cpp-dependent, of course)
16 #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
17 #define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
20 #define ASSERT2(e,msg)
26 #define CAT2(a,b)a/**/b
29 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 202
30 # define REALLY_HASKELL_1_3
32 # define EXP_MODULE(a) module a
33 # define IMPORT_DELOOPER(mod) import mod
34 # define IMPORT_1_3(mod) import mod
36 # define _ByteArray GlaExts.ByteArray
37 # define _MutableByteArray GlaExts.MutableByteArray
38 # define _MutableArray GlaExts.MutableArray
39 # define _RealWorld GlaExts.RealWorld
40 # define _ST GlaExts.ST
41 # define _ForeignObj Foreign.ForeignObj
42 # define _runST ST.runST
43 # define seqStrictlyST seqST
44 # define thenStrictlyST thenST
45 # define returnStrictlyST return
46 # define _readHandle IOHandle.readHandle
47 # define _writeHandle IOHandle.writeHandle
48 # define _newHandle IOHandle.newdHandle
50 # if __GLASGOW_HASKELL__ >= 209
51 # define STATE_TOK(x) x
52 # define ST_RET(x,y) STret (y) (x)
53 # define unsafePerformST(x) runST (x)
54 # define ST_TO_PrimIO(x) (stToIO (x))
56 # define STATE_TOK(x) (S# x)
57 # define ST_RET(x,y) (x,y)
58 # define unsafePerformST(x) unsafePerformPrimIO(x)
59 # define ST_TO_PrimIO(x) x
61 # define failWith fail
62 # define MkIOError(h,errt,msg) (IOError (Just h) errt msg)
63 # define CCALL_THEN thenIO_Prim
64 # define _filePtr IOHandle.filePtr
66 # define IMP_FASTSTRING() import FastString
67 # if __GLASGOW_HASKELL__ >= 209
68 # define IMP_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString
69 # define CHK_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString
71 # define IMP_Ubiq() import GlaExts ; import FastString
72 # define CHK_Ubiq() import GlaExts ; import FastString
74 # define minInt (minBound::Int)
75 # define maxInt (maxBound::Int)
77 # define STATE_TOK(x) (S# x)
78 # define ST_RET(x,y) (x,y)
79 # define unsafePerformST(x) unsafePerformPrimIO(x)
80 # define ST_TO_PrimIO(x) x
81 # define SYN_IE(a) a(..)
82 # define EXP_MODULE(a) a..
83 # define IMPORT_DELOOPER(mod) import mod
84 # define IMPORT_1_3(mod) {--}
85 # define IMP_FASTSTRING() import FastString
86 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
87 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
89 # define CCALL_THEN thenPrimIO
90 # define MkIOError(h,errt,msg) (errt msg)
93 #if defined(__GLASGOW_HASKELL__)
96 import GlaExts ( Int(..), Int#, (+#), (-#), (*#),
97 quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
100 #define FAST_INT Int#
102 #define IBOX(x) (I# (x))
106 #define _QUOT_ `quotInt#`
107 #define _NEG_ negateInt#
114 #define FAST_BOOL Int#
117 #define _IS_TRUE_(x) ((x) _EQ_ 1#)
119 #else {- ! __GLASGOW_HASKELL__ -}
128 #define _QUOT_ `quot`
136 #define FAST_BOOL Bool
138 #define _FALSE_ False
139 #define _IS_TRUE_(x) (x)
141 #endif {- ! __GLASGOW_HASKELL__ -}
143 #if __GLASGOW_HASKELL__ >= 23
145 -- This #ifndef lets us switch off the "import FastString"
146 -- when compiling FastString itself
147 #ifndef COMPILING_FAST_STRING
149 import FastString ( FastString, mkFastString, mkFastCharString#, nullFastString,
150 consFS, headFS, tailFS, lengthFS, unpackFS, appendFS, concatFS
154 # define USE_FAST_STRINGS 1
155 # define FAST_STRING FastString
156 # define SLIT(x) (mkFastCharString# (x#))
157 # define _NULL_ nullFastString
158 # define _NIL_ (mkFastString "")
159 # define _CONS_ consFS
160 # define _HEAD_ headFS
161 # define _TAIL_ tailFS
162 # define _LENGTH_ lengthFS
163 # define _PK_ mkFastString
164 # define _UNPK_ unpackFS
165 # define _APPEND_ `appendFS`
166 # define _CONCAT_ concatFS
168 # define FAST_STRING String
170 # define _CMP_STRING_ cmpString
176 # define _LENGTH_ length
177 # define _PK_ (\x->x)
178 # define _UNPK_ (\x->x)
179 # define _SUBSTR_ substr{-from Utils-}
181 # define _CONCAT_ concat