@@ -63,7 +63,7 @@ unstream :: Stream Char -> Text
6363unstream (Stream next0 s0 len) = x `seq` Text (fst x) 0 (snd x)
6464 where
6565 x :: ((UArray Int Word16),Int)
66− x = runST ((unsafeNewArray_ (0,len+1) :: ST s (STUArray s Int Word16))
66+ x = runST ((unsafeNewArray_ (0,len+1) :: ST s (STUArray s Int Word16))
6767 >>= (\arr -> loop arr 0 (len+1) s0))
6868 loop arr !i !max !s
6969 | i + 1 > max = do arr' <- unsafeNewArray_ (0,max*2)
@@ -80,7 +80,7 @@ unstream (Stream next0 s0 len) = x `seq` Text (fst x) 0 (snd x)
8080 | otherwise -> do
8181 unsafeWrite arr i l
8282 unsafeWrite arr (i + 1) r
83− loop arr (i+2) max s'
83+ loop arr (i+2) max s'
8484 where
8585 n :: Int
8686 n = ord x
@@ -93,13 +93,13 @@ unstream (Stream next0 s0 len) = x `seq` Text (fst x) 0 (snd x)
9393{-# INLINE [0] unstream #-}
9494
9595
96−copy src dest = (do
96+copy src dest = (do
9797 (_,max) <- getBounds src
9898 copy_loop 0 max)
9999 where
100− copy_loop !i !max
100+ copy_loop !i !max
101101 | i > max = return ()
102− | otherwise = do v <- unsafeRead src i
102+ | otherwise = do v <- unsafeRead src i
103103 unsafeWrite dest i v
104104 copy_loop (i+1) max
105105
@@ -113,7 +113,7 @@ eq (Stream next1 s1 _) (Stream next2 s2 _) = compare (next1 s1) (next2 s2)
113113 compare (Skip s1') (Skip s2') = compare (next1 s1') (next2 s2')
114114 compare (Skip s1') x2 = compare (next1 s1') x2
115115 compare x1 (Skip s2') = compare x1 (next2 s2')
116− compare (Yield x1 s1') (Yield x2 s2') = x1 == x2 &&
116+ compare (Yield x1 s1') (Yield x2 s2') = x1 == x2 &&
117117 compare (next1 s1') (next2 s2')
118118{-# SPECIALISE eq :: Stream Char -> Stream Char -> Bool #-}
119119
@@ -123,12 +123,12 @@ stream_bs :: Encoding -> ByteString -> Stream Char
123123stream_bs ASCII bs = Stream next 0 (B.length bs)
124124 where
125125 {-# INLINE next #-}
126− next i
126+ next i
127127 | i >= l = Done
128128 | otherwise = Yield (unsafeChr8 x1) (i+1)
129129 where
130130 l = B.length bs
131− x1 = B.index bs i
131+ x1 = B.index bs i
132132stream_bs Utf8 bs = Stream next 0 (B.length bs)
133133 where
134134 {-# INLINE next #-}
@@ -145,11 +145,11 @@ stream_bs Utf8 bs = Stream next 0 (B.length bs)
145145 x2 = index (i + 1)
146146 x3 = index (i + 2)
147147 x4 = index (i + 3)
148− index = B.index bs
148+ index = B.index bs
149149stream_bs Utf16LE bs = Stream next 0 (B.length bs)
150150 where
151151 {-# INLINE next #-}
152− next i
152+ next i
153153 | i >= l = Done
154154 | i+1 < l && U16.validate1 x1 = Yield (unsafeChr x1) (i+2)
155155 | i+3 < l && U16.validate2 x1 x2 = Yield (U16.chr2 x1 x2) (i+4)
@@ -159,12 +159,12 @@ stream_bs Utf16LE bs = Stream next 0 (B.length bs)
159159 x1 = (shiftL (index (i + 1)) 8) + (index i)
160160 x2 :: Word16
161161 x2 = (shiftL (index (i + 3)) 8) + (index (i + 2))
162− l = B.length bs
162+ l = B.length bs
163163 index = fromIntegral . B.index bs :: Int -> Word16
164164stream_bs Utf16BE bs = Stream next 0 (B.length bs)
165165 where
166166 {-# INLINE next #-}
167− next i
167+ next i
168168 | i >= l = Done
169169 | i+1 < l && U16.validate1 x1 = Yield (unsafeChr x1) (i+2)
170170 | i+3 < l && U16.validate2 x1 x2 = Yield (U16.chr2 x1 x2) (i+4)
@@ -179,7 +179,7 @@ stream_bs Utf16BE bs = Stream next 0 (B.length bs)
179179stream_bs Utf32BE bs = Stream next 0 (B.length bs)
180180 where
181181 {-# INLINE next #-}
182− next i
182+ next i
183183 | i >= l = Done
184184 | i+3 < l && U32.validate x = Yield (unsafeChr32 x) (i+4)
185185 | otherwise = error "bsStream: bad UTF-32BE stream"
@@ -194,7 +194,7 @@ stream_bs Utf32BE bs = Stream next 0 (B.length bs)
194194stream_bs Utf32LE bs = Stream next 0 (B.length bs)
195195 where
196196 {-# INLINE next #-}
197− next i
197+ next i
198198 | i >= l = Done
199199 | i+3 < l && U32.validate x = Yield (unsafeChr32 x) (i+4)
200200 | otherwise = error "bsStream: bad UTF-32LE stream"
@@ -217,14 +217,14 @@ restream ASCII (Stream next0 s0 len) = Stream next s0 (len*2)
217217 Skip s' -> Skip s'
218218 Yield x xs -> Yield x' xs
219219 where x' = fromIntegral (ord x) :: Word8
220−restream Utf8 (Stream next0 s0 len) =
220+restream Utf8 (Stream next0 s0 len) =
221221 Stream next ((Just s0) :!: Nothing :!: Nothing :!: Nothing) (len*2)
222222 where
223223 {-# INLINE next #-}
224− next ((Just s) :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
224+ next ((Just s) :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
225225 Done -> Done
226226 Skip s' -> Skip ((Just s') :!: Nothing :!: Nothing :!: Nothing)
227− Yield x xs
227+ Yield x xs
228228 | n <= 0x7F -> Yield c ((Just xs) :!: Nothing :!: Nothing :!: Nothing)
229229 | n <= 0x07FF -> Yield (fst c2) ((Just xs) :!: (Just $ snd c2) :!: Nothing :!: Nothing)
230230 | n <= 0xFFFF -> Yield (fst3 c3) ((Just xs) :!: (Just $ snd3 c3) :!: (Just $ trd3 c3) :!: Nothing)
@@ -234,7 +234,7 @@ restream Utf8 (Stream next0 s0 len) =
234234 c = fromIntegral n
235235 c2 = U8.ord2 x
236236 c3 = U8.ord3 x
237− c4 = U8.ord4 x
237+ c4 = U8.ord4 x
238238 next ((Just s) :!: (Just x2) :!: Nothing :!: Nothing) = Yield x2 ((Just s) :!: Nothing :!: Nothing :!: Nothing)
239239 next ((Just s) :!: (Just x2) :!: x3 :!: Nothing) = Yield x2 ((Just s) :!: x3 :!: Nothing :!: Nothing)
240240 next ((Just s) :!: (Just x2) :!: x3 :!: x4) = Yield x2 ((Just s) :!: x3 :!: x4 :!: Nothing)
@@ -242,7 +242,7 @@ restream Utf16BE (Stream next0 s0 len) =
242242 Stream next (Just s0 :!: Nothing :!: Nothing :!: Nothing) (len*2)
243243 where
244244 {-# INLINE next #-}
245− next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
245+ next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
246246 Done -> Done
247247 Skip s' -> Skip (Just s' :!: Nothing :!: Nothing :!: Nothing)
248248 Yield x xs
@@ -250,12 +250,12 @@ restream Utf16BE (Stream next0 s0 len) =
250250 | otherwise -> Yield c1 (Just xs :!: Just c2 :!: Just c3 :!: Just c4)
251251 where
252252 n = ord x
253− n1 = n - 0x10000
253+ n1 = n - 0x10000
254254 c1 = fromIntegral (shiftR n1 18 + 0xD8)
255− c2 = fromIntegral (shiftR n1 10)
255+ c2 = fromIntegral (shiftR n1 10)
256256 n2 = n1 .&. 0x3FF
257− c3 = fromIntegral (shiftR n2 8 + 0xDC)
258− c4 = fromIntegral n2
257+ c3 = fromIntegral (shiftR n2 8 + 0xDC)
258+ c4 = fromIntegral n2
259259 next ((Just s) :!: (Just x2) :!: Nothing :!: Nothing) = Yield x2 ((Just s) :!: Nothing :!: Nothing :!: Nothing)
260260 next ((Just s) :!: (Just x2) :!: x3 :!: Nothing) = Yield x2 ((Just s) :!: x3 :!: Nothing :!: Nothing)
261261 next ((Just s) :!: (Just x2) :!: x3 :!: x4) = Yield x2 ((Just s) :!: x3 :!: x4 :!: Nothing)
@@ -263,7 +263,7 @@ restream Utf16LE (Stream next0 s0 len) =
263263 Stream next (Just s0 :!: Nothing :!: Nothing :!: Nothing) (len*2)
264264 where
265265 {-# INLINE next #-}
266− next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
266+ next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
267267 Done -> Done
268268 Skip s' -> Skip (Just s' :!: Nothing :!: Nothing :!: Nothing)
269269 Yield x xs
@@ -271,20 +271,20 @@ restream Utf16LE (Stream next0 s0 len) =
271271 | otherwise -> Yield c1 (Just xs :!: Just c2 :!: Just c3 :!: Just c4)
272272 where
273273 n = ord x
274− n1 = n - 0x10000
274+ n1 = n - 0x10000
275275 c2 = fromIntegral (shiftR n1 18 + 0xD8)
276− c1 = fromIntegral (shiftR n1 10)
276+ c1 = fromIntegral (shiftR n1 10)
277277 n2 = n1 .&. 0x3FF
278− c4 = fromIntegral (shiftR n2 8 + 0xDC)
279− c3 = fromIntegral n2
278+ c4 = fromIntegral (shiftR n2 8 + 0xDC)
279+ c3 = fromIntegral n2
280280 next ((Just s) :!: (Just x2) :!: Nothing :!: Nothing) = Yield x2 ((Just s) :!: Nothing :!: Nothing :!: Nothing)
281281 next ((Just s) :!: (Just x2) :!: x3 :!: Nothing) = Yield x2 ((Just s) :!: x3 :!: Nothing :!: Nothing)
282282 next ((Just s) :!: (Just x2) :!: x3 :!: x4) = Yield x2 ((Just s) :!: x3 :!: x4 :!: Nothing)
283−restream Utf32BE (Stream next0 s0 len) =
283+restream Utf32BE (Stream next0 s0 len) =
284284 Stream next (Just s0 :!: Nothing :!: Nothing :!: Nothing) (len*2)
285285 where
286286 {-# INLINE next #-}
287− next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
287+ next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
288288 Done -> Done
289289 Skip s' -> Skip (Just s' :!: Nothing :!: Nothing :!: Nothing)
290290 Yield x xs -> Yield c1 (Just xs :!: Just c2 :!: Just c3 :!: Just c4)
@@ -297,11 +297,11 @@ restream Utf32BE (Stream next0 s0 len) =
297297 next ((Just s) :!: (Just x2) :!: Nothing :!: Nothing) = Yield x2 ((Just s) :!: Nothing :!: Nothing :!: Nothing)
298298 next ((Just s) :!: (Just x2) :!: x3 :!: Nothing) = Yield x2 ((Just s) :!: x3 :!: Nothing :!: Nothing)
299299 next ((Just s) :!: (Just x2) :!: x3 :!: x4) = Yield x2 ((Just s) :!: x3 :!: x4 :!: Nothing)
300−restream Utf32LE (Stream next0 s0 len) =
300+restream Utf32LE (Stream next0 s0 len) =
301301 Stream next (Just s0 :!: Nothing :!: Nothing :!: Nothing) (len*2)
302302 where
303303 {-# INLINE next #-}
304− next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
304+ next (Just s :!: Nothing :!: Nothing :!: Nothing) = case next0 s of
305305 Done -> Done
306306 Skip s' -> Skip (Just s' :!: Nothing :!: Nothing :!: Nothing)
307307 Yield x xs -> Yield c1 (Just xs :!: Just c2 :!: Just c3 :!: Just c4)
@@ -315,15 +315,15 @@ restream Utf32LE (Stream next0 s0 len) =
315315 next ((Just s) :!: (Just x2) :!: x3 :!: Nothing) = Yield x2 ((Just s) :!: x3 :!: Nothing :!: Nothing)
316316 next ((Just s) :!: (Just x2) :!: x3 :!: x4) = Yield x2 ((Just s) :!: x3 :!: x4 :!: Nothing)
317317{-# INLINE restream #-}
318−
318+
319319
320320fst3 (x1,_,_) = x1
321321snd3 (_,x2,_) = x2
322322trd3 (_,_,x3) = x3
323−fst4 (x1,_,_,_) = x1
323+fst4 (x1,_,_,_) = x1
324324snd4 (_,x2,_,_) = x2
325325trd4 (_,_,x3,_) = x3
326−fth4 (_,_,_,x4) = x4
326+fth4 (_,_,_,x4) = x4
327327
328328-- | /O(n)/ Convert a Stream Word8 to a ByteString
329329unstream_bs :: Stream Word8 -> ByteString
@@ -359,13 +359,13 @@ unstream_bs (Stream next s0 len) = unsafePerformIO $ do
359359-- ----------------------------------------------------------------------------
360360-- * Basic stream functions
361361
362−-- | /O(n)/ Adds a character to the front of a Stream Char.
362+-- | /O(n)/ Adds a character to the front of a Stream Char.
363363cons :: Char -> Stream Char -> Stream Char
364364cons w (Stream next0 s0 len) = Stream next (S2 :!: s0) (len+2)
365365 where
366366 {-# INLINE next #-}
367367 next (S2 :!: s) = Yield w (S1 :!: s)
368− next (S1 :!: s) = case next0 s of
368+ next (S1 :!: s) = case next0 s of
369369 Done -> Done
370370 Skip s' -> Skip (S1 :!: s')
371371 Yield x s' -> Yield x (S1 :!: s')
@@ -385,11 +385,11 @@ snoc (Stream next0 xs0 len) w = Stream next (Just xs0) (len+2)
385385
386386-- | /O(n)/ Appends one Stream to the other.
387387append :: Stream Char -> Stream Char -> Stream Char
388−append (Stream next0 s01 len1) (Stream next1 s02 len2) =
388+append (Stream next0 s01 len1) (Stream next1 s02 len2) =
389389 Stream next (Left s01) (len1 + len2)
390390 where
391391 {-# INLINE next #-}
392− next (Left s1) = case next0 s1 of
392+ next (Left s1) = case next0 s1 of
393393 Done -> Skip (Right s02)
394394 Skip s1' -> Skip (Left s1')
395395 Yield x s1' -> Yield x (Left s1')
@@ -403,8 +403,8 @@ append (Stream next0 s01 len1) (Stream next1 s02 len2) =
403403-- Subject to array fusion.
404404head :: Stream Char -> Char
405405head (Stream next s0 len) = loop_head s0
406− where
407− loop_head !s = case next s of
406+ where
407+ loop_head !s = case next s of
408408 Yield x _ -> x
409409 Skip s' -> loop_head s'
410410 Done -> error "head: Empty list"
@@ -433,7 +433,7 @@ tail (Stream next0 s0 len) = Stream next (False :!: s0) (len-1)
433433 next (False :!: s) = case next0 s of
434434 Done -> error "tail"
435435 Skip s' -> Skip (False :!: s')
436− Yield _ s' -> Skip (True :!: s')
436+ Yield _ s' -> Skip (True :!: s')
437437 next (True :!: s) = case next0 s of
438438 Done -> Done
439439 Skip s' -> Skip (True :!: s')
@@ -441,7 +441,7 @@ tail (Stream next0 s0 len) = Stream next (False :!: s0) (len-1)
441441{-# INLINE [0] tail #-}
442442
443443
444−-- | /O(1)/ Returns all but the last character of a Stream Char, which
444+-- | /O(1)/ Returns all but the last character of a Stream Char, which
445445-- must be non-empty.
446446init :: Stream Char -> Stream Char
447447init (Stream next0 s0 len) = Stream next (Nothing :!: s0) (len-1)
@@ -472,28 +472,28 @@ length :: Stream Char -> Int
472472length (Stream next s0 len) = loop_length 0# s0
473473 where
474474
475− loop_length z# !s = case next s of
475+ loop_length z# !s = case next s of
476476 Done -> (I# z#)
477− Skip s' -> loop_length z# s'
478− Yield _ s' -> loop_length (z# +# 1#) s'
477+ Skip s' -> loop_length z# s'
478+ Yield _ s' -> loop_length (z# +# 1#) s'
479479{-# INLINE[0] length #-}
480480
481481-- ----------------------------------------------------------------------------
482482-- * Stream transformations
483483
484−-- | /O(n)/ 'map' @f @xs is the Stream Char obtained by applying @f@ to each element of
485−-- @xs@.
484+-- | /O(n)/ 'map' @f @xs is the Stream Char obtained by applying @f@ to each element of
485+-- @xs@.
486486map :: (Char -> Char) -> Stream Char -> Stream Char
487487map f (Stream next0 s0 len) = Stream next s0 len
488488 where
489489 {-# INLINE next #-}
490− next !s = case next0 s of
490+ next !s = case next0 s of
491491 Done -> Done
492492 Skip s' -> Skip s'
493− Yield x s' -> Yield (f x) s'
493+ Yield x s' -> Yield (f x) s'
494494{-# INLINE [0] map #-}
495495
496−{-#
496+{-#
497497 RULES "STREAM map/map fusion" forall f g s.
498498 map f (map g s) = map (\x -> f (g x)) s
499499 #-}
@@ -517,7 +517,7 @@ intersperse c (Stream next0 s0 len) = Stream next (s0 :!: Nothing :!: S1) len
517517-- ----------------------------------------------------------------------------
518518-- * Reducing Streams (folds)
519519
520−-- | foldl, applied to a binary operator, a starting value (typically the
520+-- | foldl, applied to a binary operator, a starting value (typically the
521521-- left-identity of the operator), and a Stream, reduces the Stream using the
522522-- binary operator, from left to right.
523523foldl :: (b -> Char -> b) -> b -> Stream Char -> b
@@ -539,7 +539,7 @@ foldl' f z0 (Stream next s0 len) = loop_foldl' z0 s0
539539 Yield x s' -> loop_foldl' (f z x) s'
540540{-# INLINE [0] foldl' #-}
541541
542−-- | foldl1 is a variant of foldl that has no starting value argument,
542+-- | foldl1 is a variant of foldl that has no starting value argument,
543543-- and thus must be applied to non-empty Streams.
544544foldl1 :: (Char -> Char -> Char) -> Stream Char -> Char
545545foldl1 f (Stream next s0 len) = loop0_foldl1 s0
@@ -568,7 +568,7 @@ foldl1' f (Stream next s0 len) = loop0_foldl1' s0
568568 Yield x s' -> loop_foldl1' (f z x) s'
569569{-# INLINE [0] foldl1' #-}
570570
571−-- | 'foldr', applied to a binary operator, a starting value (typically the
571+-- | 'foldr', applied to a binary operator, a starting value (typically the
572572-- right-identity of the operator), and a stream, reduces the stream using the
573573-- binary operator, from right to left.
574574foldr :: (Char -> b -> b) -> b -> Stream Char -> b
@@ -580,7 +580,7 @@ foldr f z (Stream next s0 len) = loop_foldr s0
580580 Yield x s' -> f x (loop_foldr s')
581581{-# INLINE [0] foldr #-}
582582
583−-- | foldr1 is a variant of 'foldr' that has no starting value argument,
583+-- | foldr1 is a variant of 'foldr' that has no starting value argument,
584584-- and thust must be applied to non-empty streams.
585585-- Subject to array fusion.
586586foldr1 :: (Char -> Char -> Char) -> Stream Char -> Char
@@ -596,7 +596,7 @@ foldr1 f (Stream next s0 len) = loop0_foldr1 s0
596596 Skip s' -> loop_foldr1 x s'
597597 Yield x' s' -> f x (loop_foldr1 x' s')
598598{-# INLINE [0] foldr1 #-}
599−
599+
600600-- ----------------------------------------------------------------------------
601601-- ** Special folds
602602
@@ -606,7 +606,7 @@ concat = L.foldr append (Stream next Done 0)
606606 where
607607 next Done = Done
608608
609−-- | Map a function over a stream that results in a steram and concatenate the
609+-- | Map a function over a stream that results in a steram and concatenate the
610610-- results.
611611concatMap :: (Char -> Stream Char) -> Stream Char -> Stream Char
612612concatMap f = foldr (append . f) (stream empty)
@@ -627,14 +627,14 @@ any p (Stream next0 s0 len) = loop_any s0
627627all :: (Char -> Bool) -> Stream Char -> Bool
628628all p (Stream next0 s0 len) = loop_all s0
629629 where
630− loop_all !s = case next0 s of
630+ loop_all !s = case next0 s of
631631 Done -> True
632632 Skip s' -> seq s' $ loop_all s'
633633 Yield x s' | p x -> seq s' $ loop_all s'
634634 | otherwise -> False
635635
636−-- | /O(n)/ maximum returns the maximum value from a stream, which must be
637−-- non-empty.
636+-- | /O(n)/ maximum returns the maximum value from a stream, which must be
637+-- non-empty.
638638maximum :: Stream Char -> Char
639639maximum (Stream next0 s0 len) = loop0_maximum s0
640640 where
@@ -648,8 +648,8 @@ maximum (Stream next0 s0 len) = loop0_maximum s0
648648 Yield x s'
649649 | x > z -> seq s' $ loop_maximum x s'
650650 | otherwise -> seq s' $ loop_maximum z s'
651−
652−-- | /O(n)/ minimum returns the minimum value from a 'Text', which must be
651+
652+-- | /O(n)/ minimum returns the minimum value from a 'Text', which must be
653653-- non-empty.
654654minimum :: Stream Char -> Char
655655minimum (Stream next0 s0 len) = loop0_minimum s0
@@ -666,8 +666,8 @@ minimum (Stream next0 s0 len) = loop0_minimum s0
666666 | otherwise -> seq s' $ loop_minimum z s'
667667
668668
669−
670−
669+
670+
671671-- -----------------------------------------------------------------------------
672672-- * Building streams
673673
@@ -694,8 +694,8 @@ unfoldr f s0 = Stream next s0 1
694694-- first argument to unfoldrN. This function is more efficient than
695695-- unfoldr when the maximum length of the result and correct,
696696-- otherwise its complexity performance is similar to 'unfoldr'
697−unfoldrN :: Int -> (a -> Maybe (Char,a)) -> a -> Stream Char
698−unfoldrN n f s0 = Stream next (0 :!: s0) (n*2)
697+unfoldrN :: Int -> (a -> Maybe (Char,a)) -> a -> Stream Char
698+unfoldrN n f s0 = Stream next (0 :!: s0) (n*2)
699699 where
700700 {-# INLINE next #-}
701701 next (z :!: s) = case f s of
@@ -718,7 +718,7 @@ take n0 (Stream next0 s0 len) = Stream next (n0 :!: s0) len
718718 Skip s' -> Skip (n :!: s')
719719 Yield x s' -> Yield x ((n-1) :!: s')
720720{-# INLINE [0] take #-}
721−
721+
722722-- | /O(n)/ drop n, applied to a stream, returns the suffix of the
723723-- stream of length @n@, or the empty stream if @n@ is greater than the
724724-- length of the stream.
@@ -768,7 +768,7 @@ dropWhile p (Stream next0 s0 len) = Stream next (S1 :!: s0) len
768768{-# INLINE [0] dropWhile #-}
769769
770770-- ----------------------------------------------------------------------------
771−-- * Searching
771+-- * Searching
772772
773773-------------------------------------------------------------------------------
774774-- ** Searching by equality
@@ -794,7 +794,7 @@ elem w (Stream next s0 len) = loop_elem s0
794794find :: (Char -> Bool) -> Stream Char -> Maybe Char
795795find p (Stream next s0 len) = loop_find s0
796796 where
797− loop_find !s = case next s of
797+ loop_find !s = case next s of
798798 Done -> Nothing
799799 Skip s' -> loop_find s'
800800 Yield x s' | p x -> Just x
@@ -851,7 +851,7 @@ findIndex p (Stream next s0 len) = loop_findIndex 0 s0
851851
852852-- | /O(n)/ The 'elemIndex' function returns the index of the first
853853-- element in the given stream which is equal to the query
854−-- element, or 'Nothing' if there is no such element.
854+-- element, or 'Nothing' if there is no such element.
855855elemIndex :: Char -> Stream Char -> Maybe Int
856856elemIndex a (Stream next s0 len) = loop_elemIndex 0 s0
857857 where
@@ -875,7 +875,7 @@ zipWith f (Stream next0 sa0 len1) (Stream next1 sb0 len2) = Stream next (sa0 :!:
875875 Done -> Done
876876 Skip sa' -> Skip (sa' :!: sb :!: Nothing)
877877 Yield a sa' -> Skip (sa' :!: sb :!: Just a)
878−
878+
879879 next (sa' :!: sb :!: Just a) = case next1 sb of
880880 Done -> Done
881881 Skip sb' -> Skip (sa' :!: sb' :!: Just a)
@@ -884,4 +884,4 @@ zipWith f (Stream next0 sa0 len1) (Stream next1 sb0 len2) = Stream next (sa0 :!:
884884
885885errorEmptyList :: String -> a
886886errorEmptyList fun =
887− error ("Prelude." ++ fun ++ ": empty list")
887+ error ("Prelude." ++ fun ++ ": empty list")