Cabal package description sytax

isaac jones ijones at
Mon Nov 29 01:49:44 EST 2004

Hi Sven,

> 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
> principle
> here.

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
> for
> some package fields (name, version, maintainer), but the former have
> double
> quotes around them, while ghc-pkg either doesn't allow them (name,
> version)
> 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
> quotes
> 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 mailing list