-- | Type conversion.
module Sound.OSC.Coding.Convert where

import Data.Int {- base -}
import Data.Word {- base -}

-- * Int -> N

-- | Type specialised 'fromIntegral'
int_to_word8 :: Int -> Word8
int_to_word8 :: Int -> Word8
int_to_word8 = Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int_to_word32 :: Int -> Word32
int_to_word32 :: Int -> Word32
int_to_word32 = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'.
int_to_word16 :: Int -> Word16
int_to_word16 :: Int -> Word16
int_to_word16 = Int -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int_to_int8 :: Int -> Int8
int_to_int8 :: Int -> Int8
int_to_int8 = Int -> Int8
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int_to_int16 :: Int -> Int16
int_to_int16 :: Int -> Int16
int_to_int16 = Int -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int_to_int32 :: Int -> Int32
int_to_int32 :: Int -> Int32
int_to_int32 = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int_to_int64 :: Int -> Int64
int_to_int64 :: Int -> Int64
int_to_int64 = Int -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- * N -> Int

-- | Type specialised 'fromIntegral'
int8_to_int :: Int8 -> Int
int8_to_int :: Int8 -> Int
int8_to_int = Int8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int16_to_int :: Int16 -> Int
int16_to_int :: Int16 -> Int
int16_to_int = Int16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int32_to_int :: Int32 -> Int
int32_to_int :: Int32 -> Int
int32_to_int = Int32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int64_to_int :: Int64 -> Int
int64_to_int :: Int64 -> Int
int64_to_int = Int64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word8_to_int :: Word8 -> Int
word8_to_int :: Word8 -> Int
word8_to_int = Word8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word16_to_int :: Word16 -> Int
word16_to_int :: Word16 -> Int
word16_to_int = Word16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word32_to_int :: Word32 -> Int
word32_to_int :: Word32 -> Int
word32_to_int = Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- * N -> N

-- | Type specialised 'fromIntegral'
word16_to_word32 :: Word16 -> Word32
word16_to_word32 :: Word16 -> Word32
word16_to_word32 = Word16 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word32_to_word16 :: Word32 -> Word16
word32_to_word16 :: Word32 -> Word16
word32_to_word16 = Word32 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word32_to_int32 :: Word32 -> Int32
word32_to_int32 :: Word32 -> Int32
word32_to_int32 = Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word32_to_int64 :: Word32 -> Int64
word32_to_int64 :: Word32 -> Int64
word32_to_int64 = Word32 -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
word64_to_int64 :: Word64 -> Int64
word64_to_int64 :: Word64 -> Int64
word64_to_int64 = Word64 -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int64_to_int32 :: Int64 -> Int32
int64_to_int32 :: Int64 -> Int32
int64_to_int32 = Int64 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type specialised 'fromIntegral'
int64_to_word32 :: Int64 -> Word32
int64_to_word32 :: Int64 -> Word32
int64_to_word32 = Int64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- * N -> Real

-- | Type specialised 'fromIntegral'
word64_to_double :: Word64 -> Double
word64_to_double :: Word64 -> Double
word64_to_double = Word64 -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- * Enum

-- | Type-specialised 'toEnum' of 'fromIntegral'
word8_to_enum :: Enum e => Word8 -> e
word8_to_enum :: Word8 -> e
word8_to_enum = Int -> e
forall a. Enum a => Int -> a
toEnum (Int -> e) -> (Word8 -> Int) -> Word8 -> e
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type-specialised 'toEnum' of 'fromIntegral'
word16_to_enum :: Enum e => Word16 -> e
word16_to_enum :: Word16 -> e
word16_to_enum = Int -> e
forall a. Enum a => Int -> a
toEnum (Int -> e) -> (Word16 -> Int) -> Word16 -> e
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral

-- | Type-specialised 'fromIntegral' of 'fromEnum'.
enum_to_word8 :: Enum e => e -> Word8
enum_to_word8 :: e -> Word8
enum_to_word8 = Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word8) -> (e -> Int) -> e -> Word8
forall b c a. (b -> c) -> (a -> b) -> a -> c
. e -> Int
forall a. Enum a => a -> Int
fromEnum

-- | Type-specialised 'fromIntegral' of 'fromEnum'.
enum_to_word16 :: Enum e => e -> Word16
enum_to_word16 :: e -> Word16
enum_to_word16 = Int -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word16) -> (e -> Int) -> e -> Word16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. e -> Int
forall a. Enum a => a -> Int
fromEnum

-- * Enum/Char

-- | Type-specialised 'word8_to_enum'.
word8_to_char :: Word8 -> Char
word8_to_char :: Word8 -> Char
word8_to_char = Word8 -> Char
forall e. Enum e => Word8 -> e
word8_to_enum

-- | Type-specialised 'enum_to_word8'.
char_to_word8 :: Char -> Word8
char_to_word8 :: Char -> Word8
char_to_word8 = Char -> Word8
forall e. Enum e => e -> Word8
enum_to_word8