@@ -47,14 +47,14 @@ import Prelude hiding (succ)
4747--
4848-- This combinator is provided for compatibility with Parsec.
4949-- attoparsec parsers always backtrack on failure.
50−try :: Parser i t a -> Parser i t a
50+try :: Parser i a -> Parser i a
5151try p = p
5252{-# INLINE try #-}
5353
5454-- | Name the parser, in case failure occurs.
55−(<?>) :: Parser i t a
55+(<?>) :: Parser i a
5656 -> String -- ^ the name to use if parsing fails
57− -> Parser i t a
57+ -> Parser i a
5858p <?> msg0 = Parser $ \t pos more lose succ ->
5959 let lose' t' pos' more' strs msg = lose t' pos' more' (msg0:strs) msg
6060 in runParser p t pos more lose' succ
@@ -66,9 +66,9 @@ infix 0 <?>
6666-- action.
6767choice :: Alternative f => [f a] -> f a
6868choice = foldr (<|>) empty
69−{-# SPECIALIZE choice :: [Parser ByteString ByteString a]
70− -> Parser ByteString ByteString a #-}
71−{-# SPECIALIZE choice :: [Parser Text Text a] -> Parser Text Text a #-}
69+{-# SPECIALIZE choice :: [Parser ByteString a]
70+ -> Parser ByteString a #-}
71+{-# SPECIALIZE choice :: [Parser Text a] -> Parser Text a #-}
7272{-# SPECIALIZE choice :: [Z.Parser a] -> Z.Parser a #-}
7373
7474-- | @option x p@ tries to apply action @p@. If @p@ fails without
@@ -78,8 +78,8 @@ choice = foldr (<|>) empty
7878-- > priority = option 0 (digitToInt <$> digit)
7979option :: Alternative f => a -> f a -> f a
8080option x p = p <|> pure x
81−{-# SPECIALIZE option :: a -> Parser ByteString ByteString a -> Parser ByteString ByteString a #-}
82−{-# SPECIALIZE option :: a -> Parser Text Text a -> Parser Text Text a #-}
81+{-# SPECIALIZE option :: a -> Parser ByteString a -> Parser ByteString a #-}
82+{-# SPECIALIZE option :: a -> Parser Text a -> Parser Text a #-}
8383{-# SPECIALIZE option :: a -> Z.Parser a -> Z.Parser a #-}
8484
8585-- | A version of 'liftM2' that is strict in the result of its first
@@ -125,9 +125,9 @@ many1' p = liftM2' (:) p (many' p)
125125-- > commaSep p = p `sepBy` (symbol ",")
126126sepBy :: Alternative f => f a -> f s -> f [a]
127127sepBy p s = liftA2 (:) p ((s *> sepBy1 p s) <|> pure []) <|> pure []
128−{-# SPECIALIZE sepBy :: Parser ByteString ByteString a -> Parser ByteString ByteString s
129− -> Parser ByteString ByteString [a] #-}
130−{-# SPECIALIZE sepBy :: Parser Text Text a -> Parser Text Text s -> Parser Text Text [a] #-}
128+{-# SPECIALIZE sepBy :: Parser ByteString a -> Parser ByteString s
129+ -> Parser ByteString [a] #-}
130+{-# SPECIALIZE sepBy :: Parser Text a -> Parser Text s -> Parser Text [a] #-}
131131{-# SPECIALIZE sepBy :: Z.Parser a -> Z.Parser s -> Z.Parser [a] #-}
132132
133133-- | @sepBy' p sep@ applies /zero/ or more occurrences of @p@, separated
@@ -138,9 +138,9 @@ sepBy p s = liftA2 (:) p ((s *> sepBy1 p s) <|> pure []) <|> pure []
138138sepBy' :: (MonadPlus m) => m a -> m s -> m [a]
139139sepBy' p s = scan `mplus` return []
140140 where scan = liftM2' (:) p ((s >> sepBy1' p s) `mplus` return [])
141−{-# SPECIALIZE sepBy' :: Parser ByteString ByteString a -> Parser ByteString ByteString s
142− -> Parser ByteString ByteString [a] #-}
143−{-# SPECIALIZE sepBy' :: Parser Text Text a -> Parser Text Text s -> Parser Text Text [a] #-}
141+{-# SPECIALIZE sepBy' :: Parser ByteString a -> Parser ByteString s
142+ -> Parser ByteString [a] #-}
143+{-# SPECIALIZE sepBy' :: Parser Text a -> Parser Text s -> Parser Text [a] #-}
144144{-# SPECIALIZE sepBy' :: Z.Parser a -> Z.Parser s -> Z.Parser [a] #-}
145145
146146-- | @sepBy1 p sep@ applies /one/ or more occurrences of @p@, separated
@@ -150,9 +150,9 @@ sepBy' p s = scan `mplus` return []
150150sepBy1 :: Alternative f => f a -> f s -> f [a]
151151sepBy1 p s = scan
152152 where scan = liftA2 (:) p ((s *> scan) <|> pure [])
153−{-# SPECIALIZE sepBy1 :: Parser ByteString ByteString a -> Parser ByteString ByteString s
154− -> Parser ByteString ByteString [a] #-}
155−{-# SPECIALIZE sepBy1 :: Parser Text Text a -> Parser Text Text s -> Parser Text Text [a] #-}
153+{-# SPECIALIZE sepBy1 :: Parser ByteString a -> Parser ByteString s
154+ -> Parser ByteString [a] #-}
155+{-# SPECIALIZE sepBy1 :: Parser Text a -> Parser Text s -> Parser Text [a] #-}
156156{-# SPECIALIZE sepBy1 :: Z.Parser a -> Z.Parser s -> Z.Parser [a] #-}
157157
158158-- | @sepBy1' p sep@ applies /one/ or more occurrences of @p@, separated
@@ -163,9 +163,9 @@ sepBy1 p s = scan
163163sepBy1' :: (MonadPlus m) => m a -> m s -> m [a]
164164sepBy1' p s = scan
165165 where scan = liftM2' (:) p ((s >> scan) `mplus` return [])
166−{-# SPECIALIZE sepBy1' :: Parser ByteString ByteString a -> Parser ByteString ByteString s
167− -> Parser ByteString ByteString [a] #-}
168−{-# SPECIALIZE sepBy1' :: Parser Text Text a -> Parser Text Text s -> Parser Text Text [a] #-}
166+{-# SPECIALIZE sepBy1' :: Parser ByteString a -> Parser ByteString s
167+ -> Parser ByteString [a] #-}
168+{-# SPECIALIZE sepBy1' :: Parser Text a -> Parser Text s -> Parser Text [a] #-}
169169{-# SPECIALIZE sepBy1' :: Z.Parser a -> Z.Parser s -> Z.Parser [a] #-}
170170
171171-- | @manyTill p end@ applies action @p@ /zero/ or more times until
@@ -180,9 +180,9 @@ sepBy1' p s = scan
180180manyTill :: Alternative f => f a -> f b -> f [a]
181181manyTill p end = scan
182182 where scan = (end *> pure []) <|> liftA2 (:) p scan
183−{-# SPECIALIZE manyTill :: Parser ByteString ByteString a -> Parser ByteString ByteString b
184− -> Parser ByteString ByteString [a] #-}
185−{-# SPECIALIZE manyTill :: Parser Text Text a -> Parser Text Text b -> Parser Text Text [a] #-}
183+{-# SPECIALIZE manyTill :: Parser ByteString a -> Parser ByteString b
184+ -> Parser ByteString [a] #-}
185+{-# SPECIALIZE manyTill :: Parser Text a -> Parser Text b -> Parser Text [a] #-}
186186{-# SPECIALIZE manyTill :: Z.Parser a -> Z.Parser b -> Z.Parser [a] #-}
187187
188188-- | @manyTill' p end@ applies action @p@ /zero/ or more times until
@@ -199,24 +199,24 @@ manyTill p end = scan
199199manyTill' :: (MonadPlus m) => m a -> m b -> m [a]
200200manyTill' p end = scan
201201 where scan = (end >> return []) `mplus` liftM2' (:) p scan
202−{-# SPECIALIZE manyTill' :: Parser ByteString ByteString a -> Parser ByteString ByteString b
203− -> Parser ByteString ByteString [a] #-}
204−{-# SPECIALIZE manyTill' :: Parser Text Text a -> Parser Text Text b -> Parser Text Text [a] #-}
202+{-# SPECIALIZE manyTill' :: Parser ByteString a -> Parser ByteString b
203+ -> Parser ByteString [a] #-}
204+{-# SPECIALIZE manyTill' :: Parser Text a -> Parser Text b -> Parser Text [a] #-}
205205{-# SPECIALIZE manyTill' :: Z.Parser a -> Z.Parser b -> Z.Parser [a] #-}
206206
207207-- | Skip zero or more instances of an action.
208208skipMany :: Alternative f => f a -> f ()
209209skipMany p = scan
210210 where scan = (p *> scan) <|> pure ()
211−{-# SPECIALIZE skipMany :: Parser ByteString ByteString a -> Parser ByteString ByteString () #-}
212−{-# SPECIALIZE skipMany :: Parser Text Text a -> Parser Text Text () #-}
211+{-# SPECIALIZE skipMany :: Parser ByteString a -> Parser ByteString () #-}
212+{-# SPECIALIZE skipMany :: Parser Text a -> Parser Text () #-}
213213{-# SPECIALIZE skipMany :: Z.Parser a -> Z.Parser () #-}
214214
215215-- | Skip one or more instances of an action.
216216skipMany1 :: Alternative f => f a -> f ()
217217skipMany1 p = p *> skipMany p
218−{-# SPECIALIZE skipMany1 :: Parser ByteString ByteString a -> Parser ByteString ByteString () #-}
219−{-# SPECIALIZE skipMany1 :: Parser Text Text a -> Parser Text Text () #-}
218+{-# SPECIALIZE skipMany1 :: Parser ByteString a -> Parser ByteString () #-}
219+{-# SPECIALIZE skipMany1 :: Parser Text a -> Parser Text () #-}
220220{-# SPECIALIZE skipMany1 :: Z.Parser a -> Z.Parser () #-}
221221
222222-- | Apply the given action repeatedly, returning every result.