Combinators for ReadP

Martin Sjögren msjogren at
Sun Jul 25 08:02:42 EDT 2004

On Fri, 23 Jul 2004 17:21:34 -0700, John Meacham <john at> wrote:
> Any chance a couple of changes could be made to ReadP
> 1. let the type of tokens be an argument
> 2. give Fail a String argument and have it preserve the string passed to
> 'fail'.
> I don't think either will adversly affect performance, yet will make it
> possible to use ReadP as a simple standard (as in comes with the
> libraries) very lightweight parsing monad without compromising its main
> goal of implementing a faster Read.

While we're discussing changes, is there an overwhelmingly good reason
for the use of local quantification beyond making the type signatures
simpler? Writing
  newtype ReadP r a = R ((a -> P r) -> P r)
(like in ContT) would make ReadP completely Haskell98 as far as I can tell.


More information about the Libraries mailing list