on master help sign in
Fix a nasty bug.

--HG-- extra : convert_revision : b314be9e9a67cc249cd6c492112279108b7286eb

commit07d114eb2d0cf3d2ce9a764c3c1f4e0ef780c1bd authorBryan O'Sullivan <bos@serpentine.com> dateSun 27 Sep 2009, 08:08 (17 years ago) parent78714d4
1 file changed+2−1
Data/Text/Fusion/Common.hs+2−1
Data/Text/Fusion/Common.hs+2−1
@@ -637,7 +637,8 @@ unfoldrNI n f s0 | n < 0 = empty
637637-- stream of length @n@, or the stream itself if @n@ is greater than the
638638-- length of the stream.
639639take :: Integral a => a -> Stream Char -> Stream Char
640−take n0 (Stream next0 s0 len) = Stream next (n0 :!: s0) (min 0 (len - fromIntegral n0)) -- HINT maybe too high
640+take n0 (Stream next0 s0 len) =
641+ Stream next (n0 :!: s0) (max 0 (len - fromIntegral n0)) -- HINT maybe too high
641642 where
642643 {-# INLINE next #-}
643644 next (n :!: s) | n <= 0 = Done