| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Unwitch.Convert.Word64
Contents
Description
Conversions from Word64.
Synopsis
- toWord8 :: Word64 -> Maybe Word8
- toWord16 :: Word64 -> Maybe Word16
- toWord32 :: Word64 -> Maybe Word32
- toWord :: Word64 -> Maybe Word
- toNatural :: Word64 -> Natural
- toInt8 :: Word64 -> Maybe Int8
- toInt16 :: Word64 -> Maybe Int16
- toInt32 :: Word64 -> Maybe Int32
- toInt64 :: Word64 -> Maybe Int64
- toInt :: Word64 -> Maybe Int
- toInteger :: Word64 -> Integer
- toFloat :: Word64 -> Either Overflows Float
- toDouble :: Word64 -> Either Overflows Double
- toCInt :: Word64 -> Maybe CInt
- toWord8# :: Word64 -> (# Word8 | (# #) #)
- toWord16# :: Word64 -> (# Word16 | (# #) #)
- toWord32# :: Word64 -> (# Word32 | (# #) #)
- toWord# :: Word64 -> (# Word | (# #) #)
- toInt8# :: Word64 -> (# Int8 | (# #) #)
- toInt16# :: Word64 -> (# Int16 | (# #) #)
- toInt32# :: Word64 -> (# Int32 | (# #) #)
- toInt64# :: Word64 -> (# Int64 | (# #) #)
- toInt# :: Word64 -> (# Int | (# #) #)
- toFloat# :: Word64 -> (# Overflows | Float #)
- toDouble# :: Word64 -> (# Overflows | Double #)
Conversions
toFloat :: Word64 -> Either Overflows Float Source #
Checked conversion, fails with Overflow if outside exact float integer range.
toDouble :: Word64 -> Either Overflows Double Source #
Checked conversion, fails with Overflow if outside exact double integer range.
toCInt :: Word64 -> Maybe CInt Source #
Narrowing conversion via Int32, fails if outside Int32 range.
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.