git.iko.soy/typeable/attoparsec
on master help sign in
Correct the type of "scan" to drop the Show constraint.
4507b13Bryan O'Sullivan
Data/Attoparsec/Char8.hs+1−1
@@ -285,7 +285,7 @@ takeWhile p = I.takeWhile (p . w2c)
285-- /Note/: Because this parser does not fail, do not use it with
285-- /Note/: Because this parser does not fail, do not use it with
286-- combinators such as 'many', because such parsers loop until a
286-- combinators such as 'many', because such parsers loop until a
287-- failure occurs. Careless use will thus result in an infinite loop.
287-- 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
289scan s0 p = I.scan s0 (\s -> p s . w2c)
289scan s0 p = I.scan s0 (\s -> p s . w2c)
290{-# INLINE scan #-}
290{-# INLINE scan #-}
291
291
Data/Attoparsec/Internal.hs+1−1
@@ -393,7 +393,7 @@ takeWhile p = go
393-- /Note/: Because this parser does not fail, do not use it with
393-- /Note/: Because this parser does not fail, do not use it with
394-- combinators such as 'many', because such parsers loop until a
394-- combinators such as 'many', because such parsers loop until a
395-- failure occurs. Careless use will thus result in an infinite loop.
395-- 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
397scan s0 p = go s0
397scan s0 p = go s0
398 where
398 where
399 go s1 = do
399 go s1 = do