Parses zero or more occurrences of the given parser.
Modulerebase-1.21.2Haskell2010
Rebase.Text.ParserCombinators.ReadP
- 2 types
- 33 values
- Packagerebase-1.21.2
- Exports35
- LanguageHaskell2010
- LicenceMIT
- SourceReadP.hs
optional p optionally parses p and always returns ().
Instances7Monad, Functor, MonadFail, Applicative, Alternative, MonadPlus, …
Monad ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPFunctor ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadFail ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPApplicative ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPAlternative ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadPlus ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPInvariant ReadPDefined in invariant-0.6.4 · Data.Functor.Invariant
Consumes and returns the next character. Fails if there is no input left.
Symmetric choice.
count n p parses n occurrences of p in sequence. A list of
results is returned.
Transforms a parser into one that does the same, but in addition returns the exact characters read. IMPORTANT NOTE: gather gives a runtime error if its first argument is built using any occurrences of readS_to_P.
Parses the first one or more characters satisfying the predicate. Fails if none, else succeeds exactly once having consumed all the characters Hence NOT the same as (many1 (satisfy p))
Converts a parser into a Haskell ReadS-style function.
This is the main way in which you can "run" a ReadP parser:
the expanded type is
readP_to_S :: ReadP a -> String -> [(a,String)]
Look-ahead: returns the part of the input that is left, without consuming it.
Always fails.
Parses and returns the specified character.
sepBy1 p sep parses one or more occurrences of p, separated by sep.
Returns a list of values returned by p.
Parses and returns the specified string.
between open close p parses open, followed by p and finally
close. Only the value of p is returned.
Local, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.
chainl p op x parses zero or more occurrences of p, separated by op.
Returns a value produced by a left associative application of all
functions returned by op. If there are no occurrences of p, x is
returned.
Like chainl, but parses one or more occurrences of p.
chainr p op x parses zero or more occurrences of p, separated by op.
Returns a value produced by a right associative application of all
functions returned by op. If there are no occurrences of p, x is
returned.
Like chainr, but parses one or more occurrences of p.
Combines all parsers in the specified list.
endBy p sep parses zero or more occurrences of p, separated and ended
by sep.
endBy p sep parses one or more occurrences of p, separated and ended
by sep.
Succeeds iff we are at the end of input
Parses one or more occurrences of the given parser.
manyTill p end parses zero or more occurrences of p, until end
succeeds. Returns a list of values returned by p.
Parses the first zero or more characters satisfying the predicate. Always succeeds, exactly once having consumed all the characters Hence NOT the same as (many (satisfy p))
option x p will either parse p or return x without consuming
any input.
Converts a Haskell ReadS-style function into a parser. Warning: This introduces local backtracking in the resulting parser, and therefore a possible inefficiency.
Consumes and returns the next character, if it satisfies the specified predicate.
sepBy p sep parses zero or more occurrences of p, separated by sep.
Returns a list of values returned by p.
Like many, but discards the result.
Like many1, but discards the result.
Skips all whitespace.