on master help sign in
Trim unneeded type signatures
0140615Bryan O'Sullivan
Data/Text/Fusion.hs+1−5
@@ -159,9 +159,7 @@ stream_bs Utf16LE bs = Stream next 0 l
159 | i+3 < l && U16.validate2 x1 x2 = Yield (U16.chr2 x1 x2) (i+4)
159 | i+3 < l && U16.validate2 x1 x2 = Yield (U16.chr2 x1 x2) (i+4)
160 | otherwise = error $ "bsStream: bad UTF-16LE stream"
160 | otherwise = error $ "bsStream: bad UTF-16LE stream"
161 where
161 where
162− x1 :: Word16
163 x1 = (shiftL (index (i + 1)) 8) + (index i)
162 x1 = (shiftL (index (i + 1)) 8) + (index i)
164− x2 :: Word16
165 x2 = (shiftL (index (i + 3)) 8) + (index (i + 2))
163 x2 = (shiftL (index (i + 3)) 8) + (index (i + 2))
166 index = fromIntegral . B.unsafeIndex bs :: Int -> Word16
164 index = fromIntegral . B.unsafeIndex bs :: Int -> Word16
167stream_bs Utf16BE bs = Stream next 0 l
165stream_bs Utf16BE bs = Stream next 0 l
@@ -174,11 +172,9 @@ stream_bs Utf16BE bs = Stream next 0 l
174 | i+3 < l && U16.validate2 x1 x2 = Yield (U16.chr2 x1 x2) (i+4)
172 | i+3 < l && U16.validate2 x1 x2 = Yield (U16.chr2 x1 x2) (i+4)
175 | otherwise = error $ "bsStream: bad UTF16-BE stream "
173 | otherwise = error $ "bsStream: bad UTF16-BE stream "
176 where
174 where
177− x1 :: Word16
178 x1 = (shiftL (index i) 8) + (index (i + 1))
175 x1 = (shiftL (index i) 8) + (index (i + 1))
179− x2 :: Word16
180 x2 = (shiftL (index (i + 2)) 8) + (index (i + 3))
176 x2 = (shiftL (index (i + 2)) 8) + (index (i + 3))
181− index = fromIntegral . B.unsafeIndex bs
177+ index = fromIntegral . B.unsafeIndex bs :: Int -> Word16
182stream_bs Utf32BE bs = Stream next 0 l
178stream_bs Utf32BE bs = Stream next 0 l
183 where
179 where
184 l = B.length bs
180 l = B.length bs