CPS-based parser combinator library used by XMLParse. Uses function application for sequencing a la Swierstra and Duponcheel; the user interface is similar to Swierstra & Duponcheel's UU_Parsing, but the implementation is much simpler (and less powerful).
This is the only part of the code that requires an extension to Haskell 98 (rank-2 polymorphism), and that can be avoided simply by replacing newtype Parser sym res = P ... with newtype P p = P p and omitting all other type declarations involving Parser. Haskell's type inference algorithm computes workable (though incomprehensible) types for all the combinators.