[Haskell-cafe] monadic DSL for compile-time parser generator, not possible?

Dominique Devriese dominique.devriese at cs.kuleuven.be
Wed Mar 13 10:11:51 CET 2013


2013/3/13 Dominique Devriese <dominique.devriese at cs.kuleuven.be>:
> class ProductionRule p => LiftableProductionRule p where
>   epsilonL :: a -> Q Exp -> p aSource
>
> and associated
>   epsilonLS :: (Lift v, LiftableProductionRule p) => v -> p v
>   epsilonLS v = epsilonL v $ lift v

Note that the point of providing epsilonL as primitive and not just
epsilonLS is that I can then still lift most functions I use:

  epsilonL (,) [| (,) |]

Even though functions are not necessarily liftable. This is an
alternative to Oleg's adding of e.g. pair etc. as DSL primitives.

Dominique



More information about the Haskell-Cafe mailing list