| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Unwitch.Convert.CInt
Contents
Description
Conversions from CInt.
CInt is GHC-specific (wraps Int32 in GHC, Int in MicroHs),
so this module is only available under GHC.
Synopsis
- toInt8 :: CInt -> Maybe Int8
- toInt16 :: CInt -> Maybe Int16
- toInt32 :: CInt -> Int32
- toInt64 :: CInt -> Int64
- toInt :: CInt -> Int
- toInteger :: CInt -> Integer
- toWord8 :: CInt -> Maybe Word8
- toWord16 :: CInt -> Maybe Word16
- toWord32 :: CInt -> Maybe Word32
- toWord64 :: CInt -> Maybe Word64
- toWord :: CInt -> Maybe Word
- toNatural :: CInt -> Either Overflows Natural
- toFloat :: CInt -> Either Overflows Float
- toDouble :: CInt -> Double
Conversions
toWord8 :: CInt -> Maybe Word8 Source #
Signed-to-unsigned narrowing, fails if negative or out of range.
toWord16 :: CInt -> Maybe Word16 Source #
Signed-to-unsigned narrowing, fails if negative or out of range.