| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Unwitch.Convert.Int64
Contents
Description
Conversions from Int64.
Synopsis
- toInt8 :: Int64 -> Maybe Int8
- toInt16 :: Int64 -> Maybe Int16
- toInt32 :: Int64 -> Maybe Int32
- toInt :: Int64 -> Maybe Int
- toInteger :: Int64 -> Integer
- toWord8 :: Int64 -> Maybe Word8
- toWord16 :: Int64 -> Maybe Word16
- toWord32 :: Int64 -> Maybe Word32
- toWord64 :: Int64 -> Maybe Word64
- toWord :: Int64 -> Maybe Word
- toNatural :: Int64 -> Either Overflows Natural
- toFloat :: Int64 -> Either Overflows Float
- toDouble :: Int64 -> Either Overflows Double
- toCInt :: Int64 -> Maybe CInt
- toInt8# :: Int64 -> (# Int8 | (# #) #)
- toInt16# :: Int64 -> (# Int16 | (# #) #)
- toInt32# :: Int64 -> (# Int32 | (# #) #)
- toInt# :: Int64 -> (# Int | (# #) #)
- toWord8# :: Int64 -> (# Word8 | (# #) #)
- toWord16# :: Int64 -> (# Word16 | (# #) #)
- toWord32# :: Int64 -> (# Word32 | (# #) #)
- toWord64# :: Int64 -> (# Word64 | (# #) #)
- toWord# :: Int64 -> (# Word | (# #) #)
- toNatural# :: Int64 -> (# Overflows | Natural #)
- toFloat# :: Int64 -> (# Overflows | Float #)
- toDouble# :: Int64 -> (# Overflows | Double #)
Conversions
toFloat :: Int64 -> Either Overflows Float Source #
Checked conversion, fails if outside exact float integer range (+-16777215).
toDouble :: Int64 -> Either Overflows Double Source #
Checked conversion, fails if outside exact double integer range (+-9007199254740991).
Unboxed conversions
These use GHC unboxed types and unboxed sums for zero-allocation
failure handling. Requires the MagicHash, UnboxedSums and
UnboxedTuples language extensions.
See the GHC manual on unboxed types.
toWord64# :: Int64 -> (# Word64 | (# #) #) Source #
Signed->unsigned, check non-negative at Int64# level
toWord# :: Int64 -> (# Word | (# #) #) Source #
Signed->unsigned, check non-negative at Int64# then roundtrip