module LLVM.FFI.Base where
import qualified Data.Bool as Bool
import Data.Int (Int32)
import Prelude
(Eq, Enum, Show, fromIntegral, show, fromEnum, toEnum, (.), (==))
newtype Bool = Bool (Int32)
deriving (Eq)
instance Enum Bool where
fromEnum (Bool b) = fromIntegral b
toEnum = Bool . fromIntegral
instance Show Bool where
show b = if b == false then "false" else "true"
false, true :: Bool
false = Bool 0; true = Bool 1
consBool :: Bool.Bool -> Bool
consBool = toEnum . fromEnum
deconsBool :: Bool -> Bool.Bool
deconsBool = toEnum . fromEnum