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
18 #define WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg))
21 #define ASSERT2(e,msg)
28 #define CAT2(a,b)a/**/b
31 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 202
32 # define REALLY_HASKELL_1_3
34 # define EXP_MODULE(a) module a
35 # define IMPORT_DELOOPER(mod) import mod
36 # define IMPORT_1_3(mod) import mod
38 # define _ByteArray GlaExts.ByteArray
39 # define _MutableByteArray GlaExts.MutableByteArray
40 # define _MutableArray GlaExts.MutableArray
41 # define _RealWorld GlaExts.RealWorld
42 # define _ST GlaExts.ST
43 # define _ForeignObj Foreign.ForeignObj
44 # define _runST ST.runST
45 # define seqStrictlyST seqST
46 # define thenStrictlyST thenST
47 # define returnStrictlyST return
49 # if __GLASGOW_HASKELL__ >= 209
50 # define STATE_TOK(x) x
51 # define ST_RET(x,y) STret (y) (x)
52 # define unsafePerformST(x) runST (x)
53 # define ST_TO_PrimIO(x) (stToIO (x))
55 # define STATE_TOK(x) (S# x)
56 # define ST_RET(x,y) (x,y)
57 # define unsafePerformST(x) unsafePerformPrimIO(x)
58 # define ST_TO_PrimIO(x) x
60 # define failWith fail
61 # define MkIOError(h,errt,msg) (IOError (Just h) errt msg)
62 # define CCALL_THEN thenIO_Prim
64 # define IMP_FASTSTRING() import FastString
65 # if __GLASGOW_HASKELL__ >= 209
66 # define IMP_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString
67 # define CHK_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString
69 # define IMP_Ubiq() import GlaExts ; import FastString
70 # define CHK_Ubiq() import GlaExts ; import FastString
72 # define minInt (minBound::Int)
73 # define maxInt (maxBound::Int)
75 # define STATE_TOK(x) (S# x)
76 # define ST_RET(x,y) (x,y)
77 # define unsafePerformST(x) unsafePerformPrimIO(x)
78 # define ST_TO_PrimIO(x) x
79 # define SYN_IE(a) a(..)
80 # define EXP_MODULE(a) a..
81 # define IMPORT_DELOOPER(mod) import mod
82 # define IMPORT_1_3(mod) {--}
83 # define IMP_FASTSTRING() import FastString
84 # define IMP_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
85 # define CHK_Ubiq() IMPORT_DELOOPER(Ubiq) ; import FastString
87 # define CCALL_THEN thenPrimIO
88 # define MkIOError(h,errt,msg) (errt msg)
91 #if defined(__GLASGOW_HASKELL__)
95 ( Int(..), Int#, (+#), (-#), (*#),
96 quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
101 #define IBOX(x) (I# (x))
105 #define _QUOT_ `quotInt#`
106 #define _NEG_ negateInt#
113 #define FAST_BOOL Int#
116 #define _IS_TRUE_(x) ((x) _EQ_ 1#)
118 #else {- ! __GLASGOW_HASKELL__ -}
127 #define _QUOT_ `quot`
135 #define FAST_BOOL Bool
137 #define _FALSE_ False
138 #define _IS_TRUE_(x) (x)
140 #endif {- ! __GLASGOW_HASKELL__ -}
142 #if __GLASGOW_HASKELL__ >= 23
144 -- This #ifndef lets us switch off the "import FastString"
145 -- when compiling FastString itself
146 #ifndef COMPILING_FAST_STRING
148 import qualified FastString
151 # define USE_FAST_STRINGS 1
152 # define FAST_STRING FastString.FastString
153 # define SLIT(x) (FastString.mkFastCharString# (x#))
154 # define _NULL_ FastString.nullFastString
155 # define _NIL_ (FastString.mkFastString "")
156 # define _CONS_ FastString.consFS
157 # define _HEAD_ FastString.headFS
158 # define _TAIL_ FastString.tailFS
159 # define _LENGTH_ FastString.lengthFS
160 # define _PK_ FastString.mkFastString
161 # define _UNPK_ FastString.unpackFS
162 # define _APPEND_ `FastString.appendFS`
163 # define _CONCAT_ FastString.concatFS
165 # define FAST_STRING String
167 # define _CMP_STRING_ cmpString
173 # define _LENGTH_ length
174 # define _PK_ (\x->x)
175 # define _UNPK_ (\x->x)
176 # define _SUBSTR_ substr{-from Utils-}
178 # define _CONCAT_ concat
183 #define ISALPHANUM isAlphaNum
184 #define IOERROR ioError
187 #define ISALPHANUM isAlphanum