
Hi Ozgur,
Good that you consider using our rewriting libraries for your task, we hope
that they are useful. There is Rewriting [1,2] and GuardedRewriting [3,4].
Each is based on a different generic programming library (respectively
Regular and InstantGenerics), and each is described by a different paper
(you will find links on the respective webpages).
Currently there is automatic generation of instances for Regular (and thus
Rewriting), but not for InstantGenerics (and thus GuardedRewriting). In
principle this shouldn't be too hard to implement, though---the
Template-Haskell code for Regular should provide a good starting point.
Pretty-printing rules should be possible in both libraries (though for
GuardedRewriting you cannot pretty-print the guards). As far as I know this
has not been done yet; if you would like to give it a try we can certainly
help with any doubts/questions.
Cheers,
Pedro
[1] http://www.cs.uu.nl/wiki/bin/view/GenericProgramming/Rewriting
[2] http://hackage.haskell.org/package/rewriting
[3] http://www.cs.uu.nl/wiki/bin/view/GenericProgramming/GuardedRewriting
[4] http://hackage.haskell.org/package/guarded-rewriting
On Sun, Apr 4, 2010 at 15:23, Ozgur Akgun
Hi all,
I am implementing something which needs to make use of generic rewriting. I tried implementing a rewriting system of my own, using Uniplate's transform and rewrite methods, and currently I am trying to use the guarded-rewriting package. (whose maintainer is generics@haskell.org)
I am reading the paper linked from hackage, A Lightweight Approach to Datatype-Generic Rewriting, and I must say I quite liked the approach in most places. Especially not using simple pattern matching in rewrite rules is an important step, to my understanding. However I do have some questions regarding the toolchain:
- There is another package, rewriting, which links to the same paper. What is the relationship between these two implementations? Is one of them obsolete? - In the paper, it's mentioned that the Representable instances might be generated automatically. I have quite a complex term structure (and subject to changes), so I wonder if you are planning to work towards achieving this. If not, can you give me some pointers to automate this process myself? - Is it possible to write "nice" show functions for rewrite rules, namely the Rule data type.
Thanks a lot for this work,
Best,
-- Ozgur Akgun PhD Student University of St Andrews _______________________________________________ Generics mailing list Generics@haskell.org http://www.haskell.org/mailman/listinfo/generics