2 % (c) The University of Glasgow, 2000-2006
4 \section{Fast integers and booleans}
8 FastInt, _ILIT, iBox, iUnbox,
9 (+#), (-#), (*#), quotFastInt, negateFastInt,
10 (==#), (<#), (<=#), (>=#), (>#),
12 FastBool, fastBool, isFastTrue, fastOr, fastAnd
15 #include "HsVersions.h"
17 #if defined(__GLASGOW_HASKELL__)
21 ( Int(..), Int#, (+#), (-#), (*#),
22 quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
29 quotFastInt = quotInt#
30 negateFastInt = negateInt#
35 isFastTrue x = x ==# 1#
43 #else /* ! __GLASGOW_HASKELL__ */
53 negateFastInt = negate
66 --These are among the type-signatures necessary for !ghc to compile
67 -- but break ghc (can't give a signature for an import...)
68 (+#) :: FastInt -> FastInt -> FastInt
69 (-#) :: FastInt -> FastInt -> FastInt
70 (*#) :: FastInt -> FastInt -> FastInt
71 (==#) :: FastInt -> FastInt -> Bool
72 (<#) :: FastInt -> FastInt -> Bool
73 (<=#) :: FastInt -> FastInt -> Bool
74 (>=#) :: FastInt -> FastInt -> Bool
75 (>#) :: FastInt -> FastInt -> Bool
77 #endif /* ! __GLASGOW_HASKELL__ */
78 -- however it's still possible to check that these are
79 -- valid signatures nonetheless (e.g., ==# returns Bool
80 -- not FastBool/Int# !)
82 ( (+#) :: FastInt -> FastInt -> FastInt
83 , (-#) :: FastInt -> FastInt -> FastInt
84 , (*#) :: FastInt -> FastInt -> FastInt
85 , (==#) :: FastInt -> FastInt -> Bool
86 , (<#) :: FastInt -> FastInt -> Bool
87 , (<=#) :: FastInt -> FastInt -> Bool
88 , (>=#) :: FastInt -> FastInt -> Bool
89 , (>#) :: FastInt -> FastInt -> Bool
92 -- type-signatures will improve the non-ghc-specific versions
93 -- and keep things accurate (and ABLE to compile!)
94 _ILIT :: Int -> FastInt
95 iBox :: FastInt -> Int
96 iUnbox :: Int -> FastInt
98 quotFastInt :: FastInt -> FastInt -> FastInt
99 negateFastInt :: FastInt -> FastInt
101 fastBool :: Bool -> FastBool
102 isFastTrue :: FastBool -> Bool
103 fastOr :: FastBool -> FastBool -> FastBool
104 fastAnd :: FastBool -> FastBool -> FastBool