
2013/8/11 L Corbijn
[...] nor could I choose an xml library (it seems that there are too many of them out there, suggestions are welcome).
That's my impression, too: XML parsing in Haskell is somehow in a pitiful state, caused by what I consider unhealthy competition. :-/ There are tons of competing libraries and tools out there, but it is very hard to see which projects are mature/dead/usable, which handle the given use case, which have helpful up-to-date documentation/tutorials, etc. For our use case, things should be very simple: There is a Relax NG schema (registry.rnc) and we need a corresponding bunch of Haskell data types generated from that plus a validating parser. Of course one could write the former by hand and hack together the latter, but I have the feeling that there is already a solution out there. Hints are highly appreciated.
Generating (un)marshalling code is quite a bit harder, but I think doable for quite some functions. [...]
I think that generating (un)marshalling code should be a non-goal of the generator. It is exactly that point where one needs to think about sensible abstractions, data types, etc. In its current state, the XML registry is unusable even for the relatively simple task of automatic generation of data types, because the <groups> / <group> support is basically the same as it was before with the .spec files, i.e.: none. :-P Generating the enumerant values and the API entries automatically, structured in a way that follows the <feature> tags, would already be tremendously helpful.