@@ -78,17 +78,6 @@ import GHC.ST (ST(..), runST)
78
78
import GHC.Word (Word16 (.. ))
79
79
import Prelude hiding (length , read )
80
80
81
- #if MIN_VERSION_base(4,16,0)
82
- import GHC.Base ( extendWord16 #, narrowWord16 # )
83
- #else
84
- import GHC.Prim (Word #)
85
- extendWord16# , narrowWord16# :: Word # -> Word #
86
- extendWord16# w = w
87
- narrowWord16# w = w
88
- {-# INLINE narrowWord16# #-}
89
- {-# INLINE extendWord16# #-}
90
- #endif
91
-
92
81
-- | Immutable array type.
93
82
--
94
83
-- The 'Array' constructor is exposed since @text-1.1.1.3@
@@ -164,15 +153,15 @@ bytesInArray n = n `shiftL` 1
164
153
unsafeIndex :: Array -> Int -> Word16
165
154
unsafeIndex Array {.. } i@ (I # i# ) =
166
155
CHECK_BOUNDS (" unsafeIndex" ,aLen,i)
167
- case indexWord16Array# aBA i# of r# -> (W16 # (narrowWord16 # r # ) )
156
+ case indexWord16Array# aBA i# of r# -> (W16 # r # )
168
157
{-# INLINE unsafeIndex #-}
169
158
170
159
-- | Unchecked write of a mutable array. May return garbage or crash
171
160
-- on an out-of-bounds access.
172
161
unsafeWrite :: MArray s -> Int -> Word16 -> ST s ()
173
162
unsafeWrite MArray {.. } i@ (I # i# ) (W16 # e# ) = ST $ \ s1# ->
174
163
CHECK_BOUNDS (" unsafeWrite" ,maLen,i)
175
- case writeWord16Array# maBA i# (extendWord16 # e # ) s1# of
164
+ case writeWord16Array# maBA i# e # s1# of
176
165
s2# -> (# s2# , () # )
177
166
{-# INLINE unsafeWrite #-}
178
167
0 commit comments