Cabal package description sytax
ijones at syntaxpolice.org
Mon Nov 29 01:49:44 EST 2004
> I'm having problems understanding the Cabal package description syntax
> (I can't find a formal spec),
There won't be a formal spec until we're closer to freezing it.
> especially the use of quotes. Some field
> values can be quoted, others can't, but I can't see any general
The principal is that if there are fields that contain multiple values
and unpredictable syntax, then you can use quotes. Maybe the only place
that this is true is for file paths. You may note that the example in
the proposal has a comma.
> My problem in particular is that I want to use the values from
> autoconf's AC_INIT (PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT)
> some package fields (name, version, maintainer), but the former have
> quotes around them, while ghc-pkg either doesn't allow them (name,
> or includes the quotes into the value (maintainer).
I'm a little unclear about what you're looking for wrt the interaction
between autoconf, cabal, and ghc-pkg.
> IMHO this should be
> more consistent and unified, and a possible solution would be that
> are handled like they are in shells, so "blah" and blah are the same.
I think I like this idea for the cabal package description, and it would
definitely be good to have consistency between the public parts of
HC-pkg and cabal's package description.
Unless anyone has objections to allowing quotes in all the fields, you
should feel free to alter cabal's parser and send me a patch (it'll
probably be a few days before I can do any serious cabal hacking). Since
it's necessary for some fields, it'll probably simplify it if quotes are
allowed everywhere. Opinions anyone?
I'm not sure what this'll do when it dumps out a ghc-pkg description
file, though, so some care should be taken (maybe that's what you're
getting at above).
More information about the Libraries