Skip to content

Commit

Permalink
Fix for sized primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyl20 committed Dec 3, 2020
1 parent f1a2e14 commit 1015d0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
15 changes: 2 additions & 13 deletions Data/Text/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,6 @@ import GHC.ST (ST(..), runST)
import GHC.Word (Word16(..))
import Prelude hiding (length, read)

#if MIN_VERSION_base(4,16,0)
import GHC.Base ( extendWord16#, narrowWord16# )
#else
import GHC.Prim (Word#)
extendWord16#, narrowWord16# :: Word# -> Word#
extendWord16# w = w
narrowWord16# w = w
{-# INLINE narrowWord16# #-}
{-# INLINE extendWord16# #-}
#endif

-- | Immutable array type.
--
-- The 'Array' constructor is exposed since @text-1.1.1.3@
Expand Down Expand Up @@ -164,15 +153,15 @@ bytesInArray n = n `shiftL` 1
unsafeIndex :: Array -> Int -> Word16
unsafeIndex Array{..} i@(I# i#) =
CHECK_BOUNDS("unsafeIndex",aLen,i)
case indexWord16Array# aBA i# of r# -> (W16# (narrowWord16# r#))
case indexWord16Array# aBA i# of r# -> (W16# r#)
{-# INLINE unsafeIndex #-}

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

Expand Down
1 change: 0 additions & 1 deletion Data/Text/Internal/Encoding/Utf8.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import GHC.Word (Word8(..))
import GHC.Exts
#else
import GHC.Exts hiding ( extendWord8# )
import GHC.Prim (Word#)
extendWord8# :: Word# -> Word#
extendWord8# w = w
{-# INLINE extendWord8# #-}
Expand Down

0 comments on commit 1015d0d

Please sign in to comment.