Advance notice that I'd like to make Cabal depend on parsec

Bardur Arantsson spam at
Fri Mar 15 05:19:45 CET 2013

On 03/14/2013 11:01 PM, Duncan Coutts wrote:
> On Thu, 2013-03-14 at 11:15 -0700, Jason Dagit wrote:
>> On Thu, Mar 14, 2013 at 11:01 AM, Bardur Arantsson <spam at>wrote:
>>> On 03/14/2013 03:53 PM, Duncan Coutts wrote:
>>>> Hi folks,
>>>> Why did I choose parsec? Practicality dictates that I can only use
>>>> things in the core libraries, and the nearest thing we have to that is
>>>> the parser lib that is in the HP. I tried to use happy but I could not
>>>> construct a grammar/lexer combo to handle the layout (also, happy is not
>>>> exactly known for its great error messages).
>>> Just thinking out loud here, but what about ditching the current format
>>> for something that's simpler to parse/generate? Like, say, JSON?
> Of course .cabal files are mainly written by humans, not machines, so we
> should optimise for them.

I though we were mostly talking about InstalledPackageInfo. That could
be in $EASILY_PARSEABLE_FORMAT without really breaking anything, right?

Another option if GHC really also needs to parse .cabal files:

- Introduce a format for Cabal files that's trivial to hand-code a
recursive descent parser for.
- Add a command in Cabal to generate that format from a .cabal file.
- Have "cabal sdist" automatically generate that file and put it into
the uploaded archive.


More information about the cabal-devel mailing list