@@ -113,128 +113,6 @@ unpin arr@(MutableByteArray marr#) =
113113-- The Unboxed type class
114114--------------------------------------------------------------------------------
115115
116−#if !MIN_VERSION_base(4,12,0)
117−
118−#define SIZEOF_HSCHAR_PRIMITIVE 4#
119−#define SIZEOF_HSINT_PRIMITIVE 8#
120−#define SIZEOF_HSWORD_PRIMITIVE 8#
121−#define SIZEOF_WORD8_PRIMITIVE 1#
122−#define SIZEOF_WORD32_PRIMITIVE 4#
123−#define SIZEOF_WORD64_PRIMITIVE 8#
124−#define SIZEOF_HSDOUBLE_PRIMITIVE 8#
125−#define SIZEOF_INT32_PRIMITIVE 4#
126−#define SIZEOF_INT64_PRIMITIVE 8#
127−
128−#ifdef __GHCJS__
129−#define WORD64TYP Word64#
130−#else
131−#define WORD64TYP Word#
132−#endif
133−
134−#ifdef __GHCJS__
135−#define INT64TYP Int64#
136−#else
137−#define INT64TYP Int#
138−#endif
139−
140−{-# INLINE readWord8ArrayAsWideChar# #-}
141−readWord8ArrayAsWideChar# ::
142− MutableByteArray# d -> Int# -> State# d -> (# State# d, Char# #)
143−readWord8ArrayAsWideChar# arr# i# =
144− readWideCharArray# arr# (quotInt# i# SIZEOF_HSCHAR_PRIMITIVE)
145−
146−{-# INLINE writeWord8ArrayAsWideChar# #-}
147−writeWord8ArrayAsWideChar# ::
148− MutableByteArray# d -> Int# -> Char# -> State# d -> State# d
149−writeWord8ArrayAsWideChar# arr# i# =
150− writeWideCharArray# arr# (quotInt# i# SIZEOF_HSCHAR_PRIMITIVE)
151−
152−{-# INLINE readWord8ArrayAsInt# #-}
153−readWord8ArrayAsInt# ::
154− MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
155−readWord8ArrayAsInt# arr# i# =
156− readIntArray# arr# (quotInt# i# SIZEOF_HSINT_PRIMITIVE)
157−
158−{-# INLINE writeWord8ArrayAsInt# #-}
159−writeWord8ArrayAsInt# ::
160− MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
161−writeWord8ArrayAsInt# arr# i# =
162− writeIntArray# arr# (quotInt# i# SIZEOF_HSINT_PRIMITIVE)
163−
164−{-# INLINE readWord8ArrayAsInt32# #-}
165−readWord8ArrayAsInt32# ::
166− MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
167−readWord8ArrayAsInt32# arr# i# =
168− readInt32Array# arr# (quotInt# i# SIZEOF_INT32_PRIMITIVE)
169−
170−{-# INLINE writeWord8ArrayAsInt32# #-}
171−writeWord8ArrayAsInt32# ::
172− MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
173−writeWord8ArrayAsInt32# arr# i# =
174− writeInt32Array# arr# (quotInt# i# SIZEOF_INT32_PRIMITIVE)
175−
176−{-# INLINE readWord8ArrayAsInt64# #-}
177−readWord8ArrayAsInt64# ::
178− MutableByteArray# d -> Int# -> State# d -> (# State# d, INT64TYP #)
179−readWord8ArrayAsInt64# arr# i# =
180− readInt64Array# arr# (quotInt# i# SIZEOF_INT64_PRIMITIVE)
181−
182−{-# INLINE writeWord8ArrayAsInt64# #-}
183−writeWord8ArrayAsInt64# ::
184− MutableByteArray# d -> Int# -> INT64TYP -> State# d -> State# d
185−writeWord8ArrayAsInt64# arr# i# =
186− writeInt64Array# arr# (quotInt# i# SIZEOF_INT64_PRIMITIVE)
187−
188−{-# INLINE readWord8ArrayAsWord# #-}
189−readWord8ArrayAsWord# ::
190− MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
191−readWord8ArrayAsWord# arr# i# =
192− readWordArray# arr# (quotInt# i# SIZEOF_HSWORD_PRIMITIVE)
193−
194−{-# INLINE writeWord8ArrayAsWord# #-}
195−writeWord8ArrayAsWord# ::
196− MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
197−writeWord8ArrayAsWord# arr# i# =
198− writeWordArray# arr# (quotInt# i# SIZEOF_HSWORD_PRIMITIVE)
199−
200−{-# INLINE readWord8ArrayAsWord32# #-}
201−readWord8ArrayAsWord32# ::
202− MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
203−readWord8ArrayAsWord32# arr# i# =
204− readWord32Array# arr# (quotInt# i# SIZEOF_WORD32_PRIMITIVE)
205−
206−{-# INLINE writeWord8ArrayAsWord32# #-}
207−writeWord8ArrayAsWord32# ::
208− MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
209−writeWord8ArrayAsWord32# arr# i# =
210− writeWord32Array# arr# (quotInt# i# SIZEOF_WORD32_PRIMITIVE)
211−
212−{-# INLINE readWord8ArrayAsWord64# #-}
213−readWord8ArrayAsWord64# ::
214− MutableByteArray# d -> Int# -> State# d -> (# State# d, WORD64TYP #)
215−readWord8ArrayAsWord64# arr# i# =
216− readWord64Array# arr# (quotInt# i# SIZEOF_WORD64_PRIMITIVE)
217−
218−{-# INLINE writeWord8ArrayAsWord64# #-}
219−writeWord8ArrayAsWord64# ::
220− MutableByteArray# d -> Int# -> WORD64TYP -> State# d -> State# d
221−writeWord8ArrayAsWord64# arr# i# =
222− writeWord64Array# arr# (quotInt# i# SIZEOF_WORD64_PRIMITIVE)
223−
224−{-# INLINE readWord8ArrayAsDouble# #-}
225−readWord8ArrayAsDouble# ::
226− MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
227−readWord8ArrayAsDouble# arr# i# =
228− readDoubleArray# arr# (quotInt# i# SIZEOF_HSDOUBLE_PRIMITIVE)
229−
230−{-# INLINE writeWord8ArrayAsDouble# #-}
231−writeWord8ArrayAsDouble# ::
232− MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
233−writeWord8ArrayAsDouble# arr# i# =
234− writeDoubleArray# arr# (quotInt# i# SIZEOF_HSDOUBLE_PRIMITIVE)
235−
236−#endif
237−
238116-- In theory we could convert a type to and from a byte stream and use that
239117-- to implement boxing, unboxing. But that would be inefficient. This type
240118-- class allows each primitive type to have its own specific efficient