Module

Text.Parsing.Applicative.Repetition

#until

until :: forall m f a b c. Monad m => Applicative f => Monoid (f b) => ParserT a m b -> ParserT a m c -> ParserT a m (f b)

Consumes the current parse input with a parser p until the result of a parser q is successful. Does not consume the remaining parse input with the successful result of q.

#exact

exact :: forall m a f b. Monad m => Applicative f => Monoid (f b) => Int -> ParserT a m b -> ParserT a m (f b)

Consumes the current parse input with a parser p, with n repetitions of p. Fails if the remaining parse input can be moreover be parsed with p.

#least

least :: forall m f a b. Monad m => Applicative f => Monoid (f b) => Int -> ParserT a m b -> ParserT a m (f b)

Consumes the current parse input with a parser p, with n repetitions of p. Does not check if the remaining parse input can be moreover parsed with p.

#greedy

greedy :: forall m a f b. Monad m => Applicative f => Monoid (f b) => ParserT a m b -> ParserT a m (Tuple Int (f b))

Consumes the current input with a parser p as many times as successful. Produces a pair of the number of successful repetitions of p, and the accumulated result. Not guaranteed to be stack-safe for large input.

#many

many :: forall m a f b. Monad m => Applicative f => Monoid (f b) => ParserT a m b -> ParserT a m (f b)

Consumes the current input with a parser p as many times as successful. Produces the accumulated result, without the guarantee of being stack-safe for large input.

#many1

many1 :: forall m a f b. Monad m => Applicative f => Monoid (f b) => ParserT a m b -> ParserT a m (f b)

Consumes the current input with a parser p as many times as successful, with at least one occurrence of p. Produces the accumulated result, without the guarantee of being stack-safe for large input.

#most

most :: forall m a f b. Monad m => Applicative f => Monoid (f b) => Int -> ParserT a m b -> ParserT a m (f b)

Consumes the current parse input with a parser p, with m greedy repetitions of p. Fails if m is greater than the constraint n passed to the function.

#range

range :: forall m a f b. Monad m => Applicative f => Monoid (f b) => Int -> Int -> ParserT a m b -> ParserT a m (f b)

Consumes the current parse input with a parser p, with at least min and at most max >= min repetitions of p.

Modules