@@ -31,7 +31,6 @@ module Data.Text.Encoding.Fusion
31 -- * Restreaming
31 -- * Restreaming
32 -- Restreaming is the act of converting from one 'Stream'
32 -- Restreaming is the act of converting from one 'Stream'
33 -- representation to another.
33 -- representation to another.
35 , restreamUtf8
34 , restreamUtf8
36 , restreamUtf16LE
35 , restreamUtf16LE
37 , restreamUtf16BE
36 , restreamUtf16BE
@@ -52,9 +51,9 @@ import Foreign.Storable (pokeByteOff)
52import System.IO.Unsafe (unsafePerformIO)
51import System.IO.Unsafe (unsafePerformIO)
53import qualified Data.ByteString as B
52import qualified Data.ByteString as B
54import qualified Data.ByteString.Unsafe as B
53import qualified Data.ByteString.Unsafe as B
55−import qualified Data.Text.Utf16 as U16
54+import qualified Data.Text.Encoding.Utf8 as U8
55+import qualified Data.Text.Encoding.Utf16 as U16
56−import qualified Data.Text.Utf32 as U32
56+import qualified Data.Text.Encoding.Utf32 as U32
57−import qualified Data.Text.Utf8 as U8
59-- Specialised, strict Maybe-like type.
58-- Specialised, strict Maybe-like type.
@@ -175,16 +174,6 @@ streamUtf32LE bs = Stream next 0 l
175 idx = fromIntegral . B.unsafeIndex bs :: Int -> Word32
174 idx = fromIntegral . B.unsafeIndex bs :: Int -> Word32
176{-# INLINE [0] streamUtf32LE #-}
175{-# INLINE [0] streamUtf32LE #-}
178−restreamASCII :: Stream Char -> Stream Word8
179−restreamASCII (Stream next0 s0 len) = Stream next s0 (len*2)
181− next !s = case next0 s of
184− Yield x xs -> Yield x' xs
185− where x' = fromIntegral (ord x) :: Word8
186−{-# INLINE restreamASCII #-}
188-- | /O(n)/ Convert a Stream Char into a UTF-8 encoded Stream Word8.
177-- | /O(n)/ Convert a Stream Char into a UTF-8 encoded Stream Word8.
189restreamUtf8 :: Stream Char -> Stream Word8
178restreamUtf8 :: Stream Char -> Stream Word8
190restreamUtf8 (Stream next0 s0 len) =
179restreamUtf8 (Stream next0 s0 len) =