[project @ 2003-06-03 09:41:48 by ross]
[ghc-hetmet.git] / ghc / compiler / utils / FastTypes.lhs
index 07df3c3..9f9d903 100644 (file)
@@ -9,13 +9,15 @@ module FastTypes (
     (+#), (-#), (*#), quotFastInt, negateFastInt,
     (==#), (<#), (<=#), (>=#), (>#),
 
-    FastBool, fastBool, _IS_TRUE_
+    FastBool, fastBool, isFastTrue, fastOr
   ) where
 
+#include "HsVersions.h"
+
 #if defined(__GLASGOW_HASKELL__)
 
 -- Import the beggars
-import GlaExts
+import GLAEXTS
        ( Int(..), Int#, (+#), (-#), (*#), 
          quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
        )
@@ -30,9 +32,15 @@ negateFastInt = negateInt#
 type FastBool = Int#
 fastBool True  = 1#
 fastBool False = 0#
-_IS_TRUE_ x = x ==# 1#
+isFastTrue x = x ==# 1#
+
+fastOr 1# _ = 1#
+fastOr 0# x = x
+
+fastAnd 0# x = 0#
+fastAnd 1# x = x
 
-#else {- ! __GLASGOW_HASKELL__ -}
+#else /* ! __GLASGOW_HASKELL__ */
 
 type FastInt = Int
 _ILIT x = x
@@ -53,5 +61,5 @@ type FastBool = Bool
 fastBool x = x
 _IS_TRUE_ x = x
 
-#endif  {- ! __GLASGOW_HASKELL__ -}
+#endif /* ! __GLASGOW_HASKELL__ */
 \end{code}