Portability | portable |
---|---|
Stability | stable |
Maintainer | athas@sigkill.dk |
Safe Haskell | Safe-Inferred |
This module implements a general parser class that you should
probably implement for any parsers using Parco - it encapsulates
features that cannot be expressed using other standard classes.
While some parser combinators (such as Text.Parco.Perm) can be
expressed solely through Applicative
and Alternative
, others
may need to do backtracking, which not all parser implementations
can do automatically.
Before defining your own instance of the class, check if a package
is available that does it for you. For example, parco-parsec
defines an instance for Parsec.
- class Alternative p => Parser p where
Documentation
class Alternative p => Parser p whereSource
Some parser combinators need special operations that are not captured in any of the standard typeclasses (backtracking, for example). For these, it is necessary to define an instance of this class.