XML DTD for the package configuration file
Isaac Jones
ijones at syntaxpolice.org
Wed Oct 15 10:54:38 EDT 2003
"Daan Leijen" <daanleijen at xs4all.nl> writes:
> Hi all,
>
> Although creating package description files in XML
> sounds neat, it also sounds like over-design at this
> stage. Why don't we use Haskell *values* to describe
> the packages? If we describe packages just like ghc-pkg
> is doing, as a Haskell record, we get:
>
> - very simple code for reading and writing those
> (SNIP)
My problem with this is that sure, at first we have a one-line parser,
but if we change the data structure, then we'll have to write bits of
the parser by hand, since read won't work. (I note that ghc-pkg looks
like it might just use read, but actually has a happy parser). Also,
the user will have to provide an empty value for fields they don't
care about, right? That is a little annoying for a simple package.
Is there a tool to parse ghc's package file like a tree I can walk?
Also it is possible that non-haskell tools (like package managers)
will want to muck around with the packages file. I'm hoping to avoid
this with haskell-config (or whatever), but we might not get
everything right. Remember that a major goal of this file is a kind
of interoperablity between Haskell and an operating system's package
manager.
I don't know why XML is over-design. It's pretty easy to use and
there is HaXml. Do you have any argument against it?
> Just my 2cents,
This is the kinda thing I'm looking for when I asked, "Am I going
horribly wrong". :)
peace,
isaac
More information about the Libraries
mailing list