Debian Codegraph @

Sound/Osc/Coding/Convert.hs

raw symbols SCIP
1 -- | Type conversion.
2 module Sound.Osc.Coding.Convert where
3
4 import Data.Int {- base -}
5 import Data.Word {- base -}
6
7 -- * Int -> N
8
9 -- | Type specialised 'fromIntegral'
10 int_to_word8 :: Int -> Word8
11 int_to_word8 = fromIntegral
12
13 -- | Type specialised 'fromIntegral'
14 int_to_word32 :: Int -> Word32
15 int_to_word32 = fromIntegral
16
17 -- | Type specialised 'fromIntegral'.
18 int_to_word16 :: Int -> Word16
19 int_to_word16 = fromIntegral
20
21 -- | Type specialised 'fromIntegral'
22 int_to_int8 :: Int -> Int8
23 int_to_int8 = fromIntegral
24
25 -- | Type specialised 'fromIntegral'
26 int_to_int16 :: Int -> Int16
27 int_to_int16 = fromIntegral
28
29 -- | Type specialised 'fromIntegral'
30 int_to_int32 :: Int -> Int32
31 int_to_int32 = fromIntegral
32
33 -- | Type specialised 'fromIntegral'
34 int_to_int64 :: Int -> Int64
35 int_to_int64 = fromIntegral
36
37 -- * N -> Int
38
39 -- | Type specialised 'fromIntegral'
40 int8_to_int :: Int8 -> Int
41 int8_to_int = fromIntegral
42
43 -- | Type specialised 'fromIntegral'
44 int16_to_int :: Int16 -> Int
45 int16_to_int = fromIntegral
46
47 -- | Type specialised 'fromIntegral'
48 int32_to_int :: Int32 -> Int
49 int32_to_int = fromIntegral
50
51 -- | Type specialised 'fromIntegral'
52 int64_to_int :: Int64 -> Int
53 int64_to_int = fromIntegral
54
55 -- | Type specialised 'fromIntegral'
56 word8_to_int :: Word8 -> Int
57 word8_to_int = fromIntegral
58
59 -- | Type specialised 'fromIntegral'
60 word16_to_int :: Word16 -> Int
61 word16_to_int = fromIntegral
62
63 -- | Type specialised 'fromIntegral'
64 word32_to_int :: Word32 -> Int
65 word32_to_int = fromIntegral
66
67 -- * N -> N
68
69 -- | Type specialised 'fromIntegral'
70 word16_to_word32 :: Word16 -> Word32
71 word16_to_word32 = fromIntegral
72
73 -- | Type specialised 'fromIntegral'
74 word32_to_word16 :: Word32 -> Word16
75 word32_to_word16 = fromIntegral
76
77 -- | Type specialised 'fromIntegral'
78 word32_to_int32 :: Word32 -> Int32
79 word32_to_int32 = fromIntegral
80
81 -- | Type specialised 'fromIntegral'
82 word32_to_int64 :: Word32 -> Int64
83 word32_to_int64 = fromIntegral
84
85 -- | Type specialised 'fromIntegral'
86 word64_to_int64 :: Word64 -> Int64
87 word64_to_int64 = fromIntegral
88
89 -- | Type specialised 'fromIntegral'
90 int64_to_int32 :: Int64 -> Int32
91 int64_to_int32 = fromIntegral
92
93 -- | Type specialised 'fromIntegral'
94 int64_to_word32 :: Int64 -> Word32
95 int64_to_word32 = fromIntegral
96
97 -- * N -> Real
98
99 -- | Type specialised 'fromIntegral'
100 word64_to_double :: Word64 -> Double
101 word64_to_double = fromIntegral
102
103 -- * Enum
104
105 -- | Type-specialised 'toEnum' of 'fromIntegral'
106 word8_to_enum :: Enum e => Word8 -> e
107 word8_to_enum = toEnum . fromIntegral
108
109 -- | Type-specialised 'toEnum' of 'fromIntegral'
110 word16_to_enum :: Enum e => Word16 -> e
111 word16_to_enum = toEnum . fromIntegral
112
113 -- | Type-specialised 'fromIntegral' of 'fromEnum'.
114 enum_to_word8 :: Enum e => e -> Word8
115 enum_to_word8 = fromIntegral . fromEnum
116
117 -- | Type-specialised 'fromIntegral' of 'fromEnum'.
118 enum_to_word16 :: Enum e => e -> Word16
119 enum_to_word16 = fromIntegral . fromEnum
120
121 -- * Enum/Char
122
123 -- | Type-specialised 'word8_to_enum'.
124 word8_to_char :: Word8 -> Char
125 word8_to_char = word8_to_enum
126
127 -- | Type-specialised 'enum_to_word8'.
128 char_to_word8 :: Char -> Word8
129 char_to_word8 = enum_to_word8