@@ -7,8 +7,6 @@ module Data.ArrayBuffer.DataView
77 , buffer
88 , byteLength
99 , byteOffset
10- , class DataView
11- , class ShowArrayViewType
1210 , get
1311 , getBE
1412 , getFloat32be
@@ -48,8 +46,8 @@ module Data.ArrayBuffer.DataView
4846 , whole
4947 ) where
5048
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 )
5351import Data.Float32 (Float32 ) as F
5452import Data.Maybe (Maybe )
5553import Data.Nullable (Nullable , toMaybe )
@@ -96,29 +94,6 @@ instance eqEndian :: Eq Endian where
9694 eq BE BE = true
9795 eq _ _ = false
9896
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"
12297
12398getter :: forall t .
12499 { functionName :: String
@@ -141,7 +116,7 @@ foreign import getterImpl :: forall t
141116
142117
143118get :: forall a name t b
144- . DataView a t
119+ . BinaryValue a t
145120 => BytesPerValue a b
146121 => ShowArrayViewType a name
147122 => IsSymbol name
@@ -157,7 +132,7 @@ get endian prx =
157132 }
158133
159134getBE :: forall a name t b
160- . DataView a t
135+ . BinaryValue a t
161136 => BytesPerValue a b
162137 => ShowArrayViewType a name
163138 => IsSymbol name
@@ -166,7 +141,7 @@ getBE :: forall a name t b
166141getBE = get BE
167142
168143getLE :: forall a name t b
169- . DataView a t
144+ . BinaryValue a t
170145 => BytesPerValue a b
171146 => ShowArrayViewType a name
172147 => IsSymbol name
@@ -188,7 +163,7 @@ foreign import setterImpl :: forall t
188163
189164
190165set :: forall a name t b
191- . DataView a t
166+ . BinaryValue a t
192167 => BytesPerValue a b
193168 => ShowArrayViewType a name
194169 => IsSymbol name
@@ -262,7 +237,7 @@ getFloat64le = getLE (AProxy :: AProxy Float64)
262237
263238-- | Store big-endian value at a certain index in a `DataView`.
264239setBE :: forall a name t b
265- . DataView a t
240+ . BinaryValue a t
266241 => BytesPerValue a b
267242 => ShowArrayViewType a name
268243 => IsSymbol name
@@ -272,7 +247,7 @@ setBE = set BE
272247
273248-- | Store little-endian value at a certain index in a `DataView`.
274249setLE :: forall a name t b
275- . DataView a t
250+ . BinaryValue a t
276251 => BytesPerValue a b
277252 => ShowArrayViewType a name
278253 => IsSymbol name
0 commit comments