Correct the type of "scan" to drop the Show constraint.
commit4507b132f6feb9f13147dedb1e1e0ce520c45185
authorBryan O'Sullivan <bos@serpentine.com>
dateWed 12 Jan 2011, 12:14 (16 years ago)
parent30fa5bb
Data/Attoparsec/Char8.hs+1−1
@@ -285,7 +285,7 @@ takeWhile p = I.takeWhile (p . w2c)
285285-- /Note/: Because this parser does not fail, do not use it with
286286-- combinators such as 'many', because such parsers loop until a
287287-- failure occurs. Careless use will thus result in an infinite loop.
288−scan :: Show s => s -> (s -> Char -> Maybe s) -> Parser B.ByteString
288+scan :: s -> (s -> Char -> Maybe s) -> Parser B.ByteString
289289scan s0 p = I.scan s0 (\s -> p s . w2c)
290290{-# INLINE scan #-}
291291
Data/Attoparsec/Internal.hs+1−1
@@ -393,7 +393,7 @@ takeWhile p = go
393393-- /Note/: Because this parser does not fail, do not use it with
394394-- combinators such as 'many', because such parsers loop until a
395395-- failure occurs. Careless use will thus result in an infinite loop.
396−scan :: Show s => s -> (s -> Word8 -> Maybe s) -> Parser B.ByteString
396+scan :: s -> (s -> Word8 -> Maybe s) -> Parser B.ByteString
397397scan s0 p = go s0
398398 where
399399 go s1 = do