Happy Question

Simon Marlow simonmar at microsoft.com
Mon Mar 1 11:53:25 EST 2004


 
> My hand-written S-expression parser for HScheme is very very slow. 
> Really quite a bit slower than it ought to be. So I'd like to 
> switch to 
> Happy instead.
> 
> The problem is my parser should be monadic, but the monad type is 
> generalised (basically of the form (context m) => m). Is 
> there a way of 
> switching on monadic-ness, so I can have a monadic happyError, but 
> without giving type signatures to happyThen and happyReturn? Or else 
> allowing a class context for the type signatures?

Not at the moment, but if you can describe exactly what you want to do
then I can incorporate the change:  either send me a patch for the .hs
file generated by Happy, or (better) a patch for Happy itself.  Happy's
back-end is fairly easy to modify except that it has to deal with
several different configurations (%monad, %monad+%lexer, no %monad
etc.).

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list