[Haskell-cafe] Parsec: buildExpressionParser of a different type than parsed term

Joel Reymont joelr1 at gmail.com
Mon Apr 9 19:27:07 EDT 2007


Albert,

On Apr 10, 2007, at 12:19 AM, Albert Y. C. Lai wrote:

> As you probably suspect, one single use of buildExpressionParser  
> cannot accomplish it. It is equivalent to the problem of  
> homogeneous lists.

The issue is that I need buildExpressionParser to parse numerical  
expression but return logical ones, i.e.

data CondExpr
   = CondExpr Op NumExpr NumExpr

The way b-E-P is set up it wants NumExpr to be its return type and  
thus I cannot return a CondExpr. I'm still scratching my head but in  
all likehood I'll have to hack a custom version of b-E-P.

	Thanks, Joel

--
http://wagerlabs.com/







More information about the Haskell-Cafe mailing list