Support || (or) in build-depends
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Currently build-depends don't support "or" between package constraints. All the package constraints are implicitly and-ed together. This means that users have to encode or-constraints using flags, which is verbose and can be more error prone (e.g. users might set the flag to manual).
Consider the planned split of network into network and network-uri, where the `Network.URI` module is moved out of network into network-uri. Users that want to use that module need to specify the following dependency:
```
flag network-uri
description: Get Network.URI from the network-uri package.
default: True
library
if flag(network-uri)
build-depends:
network >= 2.6 && network-uri >= 2.6
else
build-depends:
network < 2.6
```
What if we could instead write
```
library
if flag(network-uri)
build-depends:
network >= 2.6 && network-uri >= 2.6 || network < 2.6
```
(The syntax probably need to be different, as build-depends already supports `||`, with a different meaning.)
The implementation could still be in terms of flags.
Contributor guide
Assessment
This issue has not been assessed yet.