summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Dupree <id@isaac.cedarswampstudios.org>2007-04-29 19:14:22 +0000
committerIsaac Dupree <id@isaac.cedarswampstudios.org>2007-04-29 19:14:22 +0000
commitda72bd5d852ac0e01a00f5d54030a958fbcf72dc (patch)
tree7b84e0b6710b381d22ebf2a42ca4fa85dcd4781b
parentecdc15ea7813c43a4d84b7c6554a13c06f210a7e (diff)
downloadhaskell-da72bd5d852ac0e01a00f5d54030a958fbcf72dc.tar.gz
fix non-GHC-specific variant of FastTypes
I tested FastTypes.lhs with hugs (manually using cpp) as well as ghc.
-rw-r--r--compiler/utils/FastTypes.lhs43
1 files changed, 42 insertions, 1 deletions
diff --git a/compiler/utils/FastTypes.lhs b/compiler/utils/FastTypes.lhs
index c58346d3f8..bcea61de78 100644
--- a/compiler/utils/FastTypes.lhs
+++ b/compiler/utils/FastTypes.lhs
@@ -59,7 +59,48 @@ negateFastInt = negate
type FastBool = Bool
fastBool x = x
-_IS_TRUE_ x = x
+isFastTrue x = x
+fastOr = (||)
+fastAnd = (&&)
+
+--These are among the type-signatures necessary for !ghc to compile
+-- but break ghc (can't give a signature for an import...)
+(+#) :: FastInt -> FastInt -> FastInt
+(-#) :: FastInt -> FastInt -> FastInt
+(*#) :: FastInt -> FastInt -> FastInt
+(==#) :: FastInt -> FastInt -> Bool
+(<#) :: FastInt -> FastInt -> Bool
+(<=#) :: FastInt -> FastInt -> Bool
+(>=#) :: FastInt -> FastInt -> Bool
+(>#) :: 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!)
+_ILIT :: Int -> FastInt
+iBox :: FastInt -> Int
+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}