haskell / haskell/cabal

Make commas optional in "build-depends"

Open
#8,479 3 comments 9 reactions 0 assignees View on GitHub
Cabal: file format type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Reasons:

1. There is no real need for the comma. People almost never use more than 1 line for specification of 1 dependency. So its role as a separator is pretty much redundant.
1. For the same reason the change will be backwards compatible for the majority of existing packages.
1. Consistency. Sections like `default-extensions` and `exposed-modules` already behave this way.
1. Clarity. Less syntactic noise.

To make it abundantly clear I suggest to make the following syntax valid:

```cabal
build-depends:
base >=4.12 && <5
bytestring >=0.10 && <0.12
```

In addition to the following already supported variations:

```cabal
build-depends:
base >=4.12 && <5,
bytestring >=0.10 && <0.12
```

```cabal
build-depends:
base >=4.12 && <5,
bytestring >=0.10 && <0.12,
```

```cabal
build-depends: base >=4.12 && <5, bytestring >=0.10 && <0.12
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.