Created
July 16, 2018 15:58
-
-
Save acowley/2f3ec7beb46b5039d51afb9d34407f54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MagicHash, UnboxedTuples #-} | |
import GHC.Prim | |
import GHC.Types | |
main :: IO () | |
main = do | |
xb@(I# x) <- fmap read getLine | |
case addWordC# 5## (int2Word# x) of | |
(# res, carryFlag #) -> | |
putStrLn ("5 + " ++ show xb ++ " = " ++ show (W# res)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment