16 Oct
2013
16 Oct
'13
8:04 p.m.
Ryan Newton <rrnewton <at> gmail.com> writes:
Hmm, currently trying to learn how to incorporate DriFT into a cabal package. Polyparse doesn't support any other deriving mechanisms does it?
Here is some TH magic by Bertram Felgenhauer for deriving Parsers (that do what you'd expect from "deriving Read"). It allows to write data Foo = ... $(derives [makeToDoc, makeReader] [''Foo]) I find this incredibly useful, and use it heavily. As it stands, it creates code for Parsec, but certainly it could be adapted to a different backend. View source: http://autolat.imn.htwk-leipzig.de/gitweb/?p=autolib;a=tree;f=derive Get source (this is a larger repo): git clone git://autolat.imn.htwk-leipzig.de/git/autolib - J.W.