@@ -7,8 +7,6 @@ module Data.ArrayBuffer.DataView
7
7
, buffer
8
8
, byteLength
9
9
, byteOffset
10
- , class DataView
11
- , class ShowArrayViewType
12
10
, get
13
11
, getBE
14
12
, getFloat32be
@@ -48,8 +46,8 @@ module Data.ArrayBuffer.DataView
48
46
, whole
49
47
) where
50
48
51
- import Data.ArrayBuffer.Types (ArrayBuffer , ByteLength , ByteOffset , DataView , Float32 , Float64 , Int16 , Int32 , Int8 , Uint16 , Uint32 , Uint8 , Uint8Clamped , kind ArrayViewType )
52
- import Data.ArrayBuffer.ValueMapping (class BinaryValue , class BytesPerValue )
49
+ import Data.ArrayBuffer.Types (ArrayBuffer , ByteLength , ByteOffset , DataView , Float32 , Float64 , Int16 , Int32 , Int8 , Uint16 , Uint32 , Uint8 , kind ArrayViewType )
50
+ import Data.ArrayBuffer.ValueMapping (class BinaryValue , class BytesPerValue , class ShowArrayViewType )
53
51
import Data.Float32 (Float32 ) as F
54
52
import Data.Maybe (Maybe )
55
53
import Data.Nullable (Nullable , toMaybe )
@@ -96,29 +94,6 @@ instance eqEndian :: Eq Endian where
96
94
eq BE BE = true
97
95
eq _ _ = false
98
96
99
- class BinaryValue a t <= DataView (a :: ArrayViewType ) t | a -> t
100
-
101
- instance dataViewUint8Clamped :: DataView Uint8Clamped UInt
102
- instance dataViewUint32 :: DataView Uint32 UInt
103
- instance dataViewUint16 :: DataView Uint16 UInt
104
- instance dataViewUint8 :: DataView Uint8 UInt
105
- instance dataViewInt32 :: DataView Int32 Int
106
- instance dataViewInt16 :: DataView Int16 Int
107
- instance dataViewInt8 :: DataView Int8 Int
108
- instance dataViewFloat32 :: DataView Float32 F.Float32
109
- instance dataViewFloat64 :: DataView Float64 Number
110
-
111
-
112
- class ShowArrayViewType (a :: ArrayViewType ) (name :: Symbol ) | a -> name
113
- instance showArrayViewTypeUint8Clamped :: ShowArrayViewType Uint8Clamped " Uint8Clamped"
114
- instance showArrayViewTypeViewUint32 :: ShowArrayViewType Uint32 " Uint32"
115
- instance showArrayViewTypeViewUint16 :: ShowArrayViewType Uint16 " Uint16"
116
- instance showArrayViewTypeViewUint8 :: ShowArrayViewType Uint8 " Uint8"
117
- instance showArrayViewTypeViewInt32 :: ShowArrayViewType Int32 " Int32"
118
- instance showArrayViewTypeViewInt16 :: ShowArrayViewType Int16 " Int16"
119
- instance showArrayViewTypeViewInt8 :: ShowArrayViewType Int8 " Int8"
120
- instance showArrayViewTypeViewFloat32 :: ShowArrayViewType Float32 " Float32"
121
- instance showArrayViewTypeViewFloat64 :: ShowArrayViewType Float64 " Float64"
122
97
123
98
getter :: forall t .
124
99
{ functionName :: String
@@ -141,7 +116,7 @@ foreign import getterImpl :: forall t
141
116
142
117
143
118
get :: forall a name t b
144
- . DataView a t
119
+ . BinaryValue a t
145
120
=> BytesPerValue a b
146
121
=> ShowArrayViewType a name
147
122
=> IsSymbol name
@@ -157,7 +132,7 @@ get endian prx =
157
132
}
158
133
159
134
getBE :: forall a name t b
160
- . DataView a t
135
+ . BinaryValue a t
161
136
=> BytesPerValue a b
162
137
=> ShowArrayViewType a name
163
138
=> IsSymbol name
@@ -166,7 +141,7 @@ getBE :: forall a name t b
166
141
getBE = get BE
167
142
168
143
getLE :: forall a name t b
169
- . DataView a t
144
+ . BinaryValue a t
170
145
=> BytesPerValue a b
171
146
=> ShowArrayViewType a name
172
147
=> IsSymbol name
@@ -188,7 +163,7 @@ foreign import setterImpl :: forall t
188
163
189
164
190
165
set :: forall a name t b
191
- . DataView a t
166
+ . BinaryValue a t
192
167
=> BytesPerValue a b
193
168
=> ShowArrayViewType a name
194
169
=> IsSymbol name
@@ -262,7 +237,7 @@ getFloat64le = getLE (AProxy :: AProxy Float64)
262
237
263
238
-- | Store big-endian value at a certain index in a `DataView`.
264
239
setBE :: forall a name t b
265
- . DataView a t
240
+ . BinaryValue a t
266
241
=> BytesPerValue a b
267
242
=> ShowArrayViewType a name
268
243
=> IsSymbol name
@@ -272,7 +247,7 @@ setBE = set BE
272
247
273
248
-- | Store little-endian value at a certain index in a `DataView`.
274
249
setLE :: forall a name t b
275
- . DataView a t
250
+ . BinaryValue a t
276
251
=> BytesPerValue a b
277
252
=> ShowArrayViewType a name
278
253
=> IsSymbol name
0 commit comments