{-# LANGUAGE CPP #-}
module Math.NumberTheory.Utils.FromIntegral
( wordToInt
, wordToInteger
, intToWord
, intToInt8
, intToInt64
, int8ToInt64
, intToWord8
, intToWord64
, int8ToInt
, int64ToInt
, word8ToInt
, word64ToInt
, intToInteger
, int16ToInteger
, int64ToInteger
, word64ToInteger
, naturalToInteger
, integerToNatural
, integerToWord
, integerToWord64
, integerToInt
, integerToInt64
, intToNatural
, naturalToInt
, intToDouble
, fromIntegral'
) where
import Data.Int
import Data.Word
import Numeric.Natural
wordToInt :: Word -> Int
wordToInt :: Word -> Int
wordToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE wordToInt #-}
wordToInteger :: Word -> Integer
wordToInteger :: Word -> Integer
wordToInteger = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE wordToInteger #-}
intToWord :: Int -> Word
intToWord :: Int -> Word
intToWord = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToWord #-}
intToInt8 :: Int -> Int8
intToInt8 :: Int -> Int8
intToInt8 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToInt8 #-}
intToInt64 :: Int -> Int64
intToInt64 :: Int -> Int64
intToInt64 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToInt64 #-}
int8ToInt64 :: Int8 -> Int64
int8ToInt64 :: Int8 -> Int64
int8ToInt64 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE int8ToInt64 #-}
intToWord8 :: Int -> Word8
intToWord8 :: Int -> Word8
intToWord8 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToWord8 #-}
intToWord64 :: Int -> Word64
intToWord64 :: Int -> Word64
intToWord64 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToWord64 #-}
int8ToInt :: Int8 -> Int
int8ToInt :: Int8 -> Int
int8ToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE int8ToInt #-}
int64ToInt :: Int64 -> Int
int64ToInt :: Int64 -> Int
int64ToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE int64ToInt #-}
word8ToInt :: Word8 -> Int
word8ToInt :: Word8 -> Int
word8ToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE word8ToInt #-}
word64ToInt :: Word64 -> Int
word64ToInt :: Word64 -> Int
word64ToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE word64ToInt #-}
intToInteger :: Int -> Integer
intToInteger :: Int -> Integer
intToInteger = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToInteger #-}
int16ToInteger :: Int16 -> Integer
int16ToInteger :: Int16 -> Integer
int16ToInteger = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE int16ToInteger #-}
int64ToInteger :: Int64 -> Integer
int64ToInteger :: Int64 -> Integer
int64ToInteger = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE int64ToInteger #-}
word64ToInteger :: Word64 -> Integer
word64ToInteger :: Word64 -> Integer
word64ToInteger = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE word64ToInteger #-}
naturalToInteger :: Natural -> Integer
naturalToInteger :: Natural -> Integer
naturalToInteger = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE naturalToInteger #-}
integerToNatural :: Integer -> Natural
integerToNatural :: Integer -> Natural
integerToNatural = forall a b. (Integral a, Num b) => a -> b
fromIntegral'
{-# INLINE integerToNatural #-}
integerToWord :: Integer -> Word
integerToWord :: Integer -> Word
integerToWord = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE integerToWord #-}
integerToWord64 :: Integer -> Word64
integerToWord64 :: Integer -> Word64
integerToWord64 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE integerToWord64 #-}
integerToInt :: Integer -> Int
integerToInt :: Integer -> Int
integerToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE integerToInt #-}
integerToInt64 :: Integer -> Int64
integerToInt64 :: Integer -> Int64
integerToInt64 = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE integerToInt64 #-}
intToNatural :: Int -> Natural
intToNatural :: Int -> Natural
intToNatural = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToNatural #-}
naturalToInt :: Natural -> Int
naturalToInt :: Natural -> Int
naturalToInt = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE naturalToInt #-}
intToDouble :: Int -> Double
intToDouble :: Int -> Double
intToDouble = forall a b. (Integral a, Num b) => a -> b
fromIntegral
{-# INLINE intToDouble #-}
fromIntegral' :: (Integral a, Num b) => a -> b
#if __GLASGOW_HASKELL__ == 900 && __GLASGOW_HASKELL_PATCHLEVEL1__ == 1
fromIntegral' = fromInteger . toInteger
#else
fromIntegral' :: forall a b. (Integral a, Num b) => a -> b
fromIntegral' = forall a b. (Integral a, Num b) => a -> b
fromIntegral
#endif
{-# INLINE fromIntegral' #-}