Commit da72bd5d authored by Isaac Dupree's avatar Isaac Dupree
Browse files

fix non-GHC-specific variant of FastTypes

I tested FastTypes.lhs with hugs (manually using cpp) as well as ghc.
parent ecdc15ea
......@@ -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}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment