@@ -200,15 +200,15 @@ restreamUtf8 (Stream next0 s0 len) =
200200
201201restreamUtf16BE :: Stream Char -> Stream Word8
202202restreamUtf16BE (Stream next0 s0 len) =
203− Stream next (T4 (Just s0) Nothing Nothing Nothing) (len*2)
203+ Stream next (T4 s0 N N N) (len*2)
204204 where
205205 {-# INLINE next #-}
206− next (T4 (Just s) Nothing Nothing Nothing) = case next0 s of
206+ next (T4 s N N N) = case next0 s of
207207 Done -> Done
208− Skip s' -> Skip (T4 (Just s') Nothing Nothing Nothing)
208+ Skip s' -> Skip (T4 s' N N N)
209209 Yield x xs
210− | n < 0x10000 -> Yield (fromIntegral $ shiftR n 8) (T4 (Just xs) (Just (fromIntegral n)) Nothing Nothing)
211− | otherwise -> Yield c1 (T4 (Just xs) (Just c2) (Just c3) (Just c4))
210+ | n < 0x10000 -> Yield (fromIntegral $ shiftR n 8) (T4 xs (J (fromIntegral n)) N N)
211+ | otherwise -> Yield c1 (T4 xs (J c2) (J c3) (J c4))
212212 where
213213 n = ord x
214214 n1 = n - 0x10000
@@ -217,9 +217,9 @@ restreamUtf16BE (Stream next0 s0 len) =
217217 n2 = n1 .&. 0x3FF
218218 c3 = fromIntegral (shiftR n2 8 + 0xDC)
219219 c4 = fromIntegral n2
220− next (T4 (Just s) (Just x2) Nothing Nothing) = Yield x2 (T4 (Just s) Nothing Nothing Nothing)
221− next (T4 (Just s) (Just x2) x3 Nothing) = Yield x2 (T4 (Just s) x3 Nothing Nothing)
222− next (T4 (Just s) (Just x2) x3 x4) = Yield x2 (T4 (Just s) x3 x4 Nothing)
220+ next (T4 s (J x2) N N) = Yield x2 (T4 s N N N)
221+ next (T4 s (J x2) x3 N) = Yield x2 (T4 s x3 N N)
222+ next (T4 s (J x2) x3 x4) = Yield x2 (T4 s x3 x4 N)
223223 next _ = internalError "restreamUtf16BE"
224224{-# INLINE restreamUtf16BE #-}
225225