Quantcast

Happy Parsers and constraints

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Happy Parsers and constraints

Alan & Kim Zimmerman
Hi all

If I have a happy parser for an AST that is polymorphic, is there any way to put constraints on the individual rules?

e.g. if I have

data Foo a = Foo String a

and a rule something like

  foo :: { (Show a) => Foo a }
  foo : otherrule    { Foo (show $1) $1 }

Because of the way the tables are constructed in happy, the Show constraint is not attached to the point where the rule RHS is applied.

Is this simply impossible?

Alan

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Loading...