Skip to content

Commit 1015d0d

Browse files
committed
Fix for sized primitives
1 parent f1a2e14 commit 1015d0d

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

Data/Text/Array.hs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,6 @@ import GHC.ST (ST(..), runST)
7878
import GHC.Word (Word16(..))
7979
import Prelude hiding (length, read)
8080

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-
9281
-- | Immutable array type.
9382
--
9483
-- The 'Array' constructor is exposed since @text-1.1.1.3@
@@ -164,15 +153,15 @@ bytesInArray n = n `shiftL` 1
164153
unsafeIndex :: Array -> Int -> Word16
165154
unsafeIndex Array{..} i@(I# i#) =
166155
CHECK_BOUNDS("unsafeIndex",aLen,i)
167-
case indexWord16Array# aBA i# of r# -> (W16# (narrowWord16# r#))
156+
case indexWord16Array# aBA i# of r# -> (W16# r#)
168157
{-# INLINE unsafeIndex #-}
169158

170159
-- | Unchecked write of a mutable array. May return garbage or crash
171160
-- on an out-of-bounds access.
172161
unsafeWrite :: MArray s -> Int -> Word16 -> ST s ()
173162
unsafeWrite MArray{..} i@(I# i#) (W16# e#) = ST $ \s1# ->
174163
CHECK_BOUNDS("unsafeWrite",maLen,i)
175-
case writeWord16Array# maBA i# (extendWord16# e#) s1# of
164+
case writeWord16Array# maBA i# e# s1# of
176165
s2# -> (# s2#, () #)
177166
{-# INLINE unsafeWrite #-}
178167

Data/Text/Internal/Encoding/Utf8.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import GHC.Word (Word8(..))
4949
import GHC.Exts
5050
#else
5151
import GHC.Exts hiding ( extendWord8# )
52-
import GHC.Prim (Word#)
5352
extendWord8# :: Word# -> Word#
5453
extendWord8# w = w
5554
{-# INLINE extendWord8# #-}

0 commit comments

Comments
 (0)