[Template-haskell] Lift instances of the AST-related types

Alfonso Acosta alfonso.acosta at gmail.com
Mon Oct 29 21:42:54 EDT 2007


Hi,

It has been suggested a few types in this list [1,2] that it would be
helpful to include a Lift instance of Exp, Type, Dec and friends.

Having such instances allow to store the AST in a TH-generated
structure for later processing during runtime (something curcial in
the embedded compiler I'm currently developing).

It would be great that the instances were included in the library
itself or if (even better) GHC supported automatic deriving of Lift.

Until that happens, I have used a modified version Ian's th-lift[3] to
automatically generate the instances.

Just in case anyone is interested, I attached the patch of th-lift and
the instantiation module.

Cheers,

Fons


[1] http://www.haskell.org/pipermail/template-haskell/2007-February/000593.html
[2] http://www.haskell.org/pipermail/template-haskell/2004-June/000289.html
[3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/th-lift-0.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LiftInstances.hs
Type: text/x-haskell
Size: 1522 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/template-haskell/attachments/20071030/6864e0cf/LiftInstances.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: th-lift.patch
Type: text/x-patch
Size: 1585 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/template-haskell/attachments/20071030/6864e0cf/th-lift.bin


More information about the template-haskell mailing list