[Haskell-cafe] parsec3 pre-release [attempt 2]

Philippa Cowderoy flippa at flippac.org
Sat Feb 2 20:49:02 EST 2008

On Sat, 2 Feb 2008, Antoine Latter wrote:

> I'm not a fan of parameterizing the "Stream" class over the monad 
> parameter `m':
> I looked through the sources and I didn't see anywhere where this
> parameterization gained anything.  As a proof of this I did a
> mechanical re-write removing the class parameter, and the library
> still seems to work.

AngloHaskell attendees may remember the quickie I did on handling the 
layout rule via a parsing monad transformer - removing this would stop me 
from generating the input stream in a particular monad and break the trick 
behind it.

The idea was to use a lexing monad which the parser would be stacked on 
top of, such that the parser could communicate with the lexer and delayout 
function. Then when the parser failed at a point where a closing brace 
would allow parsing to continue, it could backtrack in the stream, tell 
the lexer that it failed the first time and ask for the character again - 
and if the layout rule allows it at that point, the returned character 
would this time be a closing brace.

flippa at flippac.org

Performance anxiety leads to premature optimisation

More information about the Haskell-Cafe mailing list