Fix warnings in utils/FastTypes
[ghc-hetmet.git] / compiler / utils / FastTypes.lhs
index 9d7c276..bce98f4 100644 (file)
@@ -8,12 +8,8 @@ module FastTypes (
     FastInt, _ILIT, iBox, iUnbox,
     (+#), (-#), (*#), quotFastInt, negateFastInt,
     (==#), (<#), (<=#), (>=#), (>#),
-
-    FastBool, fastBool, isFastTrue, fastOr, fastAnd
   ) where
 
-#include "HsVersions.h"
-
 #if defined(__GLASGOW_HASKELL__)
 
 -- Import the beggars
@@ -29,19 +25,6 @@ iUnbox (I# x) = x
 quotFastInt   = quotInt#
 negateFastInt = negateInt#
 
-type FastBool = Int#
-fastBool True  = 1#
-fastBool False = 0#
-isFastTrue x = x ==# 1#
-
--- note that fastOr and fastAnd are strict in both arguments
--- since they are unboxed
-fastOr 1# _ = 1#
-fastOr 0# x = x
-
-fastAnd 0# x = 0#
-fastAnd 1# x = x
-
 #else /* ! __GLASGOW_HASKELL__ */
 
 type FastInt = Int
@@ -59,18 +42,9 @@ negateFastInt = negate
 (>=#) = (>=)
 (>#)  = (>)
 
-type FastBool = Bool
-fastBool x = x
-isFastTrue x = x
--- make sure these are as strict as the unboxed version,
--- so that the performance characteristics match
-fastOr False False = False
-fastOr _ _ = True
-fastAnd True True = True
-fastAnd _ _ = False
-
 --These are among the type-signatures necessary for !ghc to compile
 -- but break ghc (can't give a signature for an import...)
+--Note that the comparisons actually do return Bools not FastBools.
 (+#) :: FastInt -> FastInt -> FastInt
 (-#) :: FastInt -> FastInt -> FastInt
 (*#) :: FastInt -> FastInt -> FastInt
@@ -81,19 +55,6 @@ fastAnd _ _ = False
 (>#) :: FastInt -> FastInt -> Bool
 
 #endif /* ! __GLASGOW_HASKELL__ */
--- however it's still possible to check that these are
--- valid signatures nonetheless (e.g., ==# returns Bool
--- not FastBool/Int# !)
-_signatures =
- ( (+#) :: FastInt -> FastInt -> FastInt
- , (-#) :: FastInt -> FastInt -> FastInt
- , (*#) :: FastInt -> FastInt -> FastInt
- , (==#) :: FastInt -> FastInt -> Bool
- , (<#) :: FastInt -> FastInt -> Bool
- , (<=#) :: FastInt -> FastInt -> Bool
- , (>=#) :: FastInt -> FastInt -> Bool
- , (>#) :: FastInt -> FastInt -> Bool
- )
 
 -- type-signatures will improve the non-ghc-specific versions
 -- and keep things accurate (and ABLE to compile!)
@@ -104,9 +65,4 @@ iUnbox :: Int -> FastInt
 quotFastInt :: FastInt -> FastInt -> FastInt
 negateFastInt :: FastInt -> FastInt
 
-fastBool :: Bool -> FastBool
-isFastTrue :: FastBool -> Bool
-fastOr :: FastBool -> FastBool -> FastBool
-fastAnd :: FastBool -> FastBool -> FastBool
-
 \end{code}