module Unwitch.Convert.CInt
#ifdef __GLASGOW_HASKELL__
(
toInt8
, toInt16
, toInt32
, toInt64
, toInt
, toInteger
, toWord8
, toWord16
, toWord32
, toWord64
, toWord
, toNatural
, toFloat
, toDouble
)
#endif
where
#ifdef __GLASGOW_HASKELL__
import Unwitch.Errors
import qualified Unwitch.Convert.Int32 as Int32
import Data.Word
import Data.Int
import Numeric.Natural (Natural)
import Prelude hiding (toInteger)
import Foreign.C.Types (CInt(CInt))
toInt8 :: CInt -> Maybe Int8
toInt8 :: CInt -> Maybe Int8
toInt8 (CInt Int32
x) = Int32 -> Maybe Int8
Int32.toInt8 Int32
x
toInt16 :: CInt -> Maybe Int16
toInt16 :: CInt -> Maybe Int16
toInt16 (CInt Int32
x) = Int32 -> Maybe Int16
Int32.toInt16 Int32
x
toInt32 :: CInt -> Int32
toInt32 :: CInt -> Int32
toInt32 (CInt Int32
x) = Int32
x
toInt64 :: CInt -> Int64
toInt64 :: CInt -> Int64
toInt64 (CInt Int32
x) = Int32 -> Int64
Int32.toInt64 Int32
x
toInt :: CInt -> Int
toInt :: CInt -> Int
toInt (CInt Int32
x) = Int32 -> Int
Int32.toInt Int32
x
toInteger :: CInt -> Integer
toInteger :: CInt -> Integer
toInteger (CInt Int32
x) = Int32 -> Integer
Int32.toInteger Int32
x
toWord8 :: CInt -> Maybe Word8
toWord8 :: CInt -> Maybe Word8
toWord8 (CInt Int32
x) = Int32 -> Maybe Word8
Int32.toWord8 Int32
x
toWord16 :: CInt -> Maybe Word16
toWord16 :: CInt -> Maybe Word16
toWord16 (CInt Int32
x) = Int32 -> Maybe Word16
Int32.toWord16 Int32
x
toWord32 :: CInt -> Maybe Word32
toWord32 :: CInt -> Maybe Word32
toWord32 (CInt Int32
x) = Int32 -> Maybe Word32
Int32.toWord32 Int32
x
toWord64 :: CInt -> Maybe Word64
toWord64 :: CInt -> Maybe Word64
toWord64 (CInt Int32
x) = Int32 -> Maybe Word64
Int32.toWord64 Int32
x
toWord :: CInt -> Maybe Word
toWord :: CInt -> Maybe Word
toWord (CInt Int32
x) = Int32 -> Maybe Word
Int32.toWord Int32
x
toNatural :: CInt -> Either Overflows Natural
toNatural :: CInt -> Either Overflows Natural
toNatural (CInt Int32
x) = Int32 -> Either Overflows Natural
Int32.toNatural Int32
x
toFloat :: CInt -> Either Overflows Float
toFloat :: CInt -> Either Overflows Float
toFloat (CInt Int32
x) = Int32 -> Either Overflows Float
Int32.toFloat Int32
x
toDouble :: CInt -> Double
toDouble :: CInt -> Double
toDouble (CInt Int32
x) = Int32 -> Double
Int32.toDouble Int32
x
#endif