|
|
|
|
|
|
Synopsis |
|
|
|
|
The Parse class is a replacement for the standard Read class.
|
|
The Parse class is a replacement for the standard Read class. It is a
specialisation of the (poly) Parser monad for String input.
There are instances defined for all Prelude types.
For user-defined types, you can write your own instance, or use
DrIFT to generate them automatically, e.g. {-! derive : Parse !-}
|
|
|
A synonym for Parser Char, i.e. string input (no state)
|
|
|
The class Parse is a replacement for Read, operating over String input.
Essentially, it permits better error messages for why something failed to
parse. It is rather important that parse can read back exactly what
is generated by the corresponding instance of show. To apply a parser
to some text, use runParser.
| | Methods | | | Instances | |
|
|
|
If there already exists a Read instance for a type, then we can make
a Parser for it, but with only poor error-reporting.
|
|
Combinators specific to string input, lexed haskell-style
|
|
|
One lexical chunk (Haskell-style lexing).
|
|
|
Ensure that the next input word is the given string. (Note the input
is lexed as haskell, so wordbreaks at spaces, symbols, etc.)
|
|
|
Allow true string parens around an item.
|
|
|
Deal with named field syntax. The string argument is the field name,
and the parser returns the value of the field.
|
|
|
Parse one of a bunch of alternative constructors. In the list argument,
the first element of the pair is the constructor name, and
the second is the parser for the rest of the value. The first matching
parse is returned.
|
|
|
Parse one of the given nullary constructors (an enumeration).
The string argument is the name of the type, and the list argument
should contain all of the possible enumeration values.
|
|
Re-export all the more general combinators from Poly too
|
|
module Text.ParserCombinators.Poly |
|
Produced by Haddock version 0.8 |