haskell / haskell/cabal

Merge TargetSelector.Match and BuildTarget.Match

Open
#11,075 0 comments 0 reactions 0 assignees View on GitHub
needs triage
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

> BTW, I noticed that we have exactly the same thingy in `Cabal/Distribution/Simple/BuildTarget.hs`, perhaps these two can be merged?

_Originally posted by @23Skidoo in https://github.com/haskell/cabal/pull/4889#discussion_r158648407_

While debugging the `cabal repl` command target I couldn't help but notice the duplication (and drift) between modules `Cabal/src/Distribution/Simple/BuildTarget.hs` and `cabal-install/src/Distribution/Client/TargetSelector.hs`. This issue bumps the above review question.

```diff
data Match a
- = NoMatch Confidence [MatchError]
+ = NoMatch !Confidence [MatchError]
- | ExactMatch Confidence [a]
- | InexactMatch Confidence [a]
+ | Match !MatchClass !Confidence [a]
deriving (Show)
```

If it is not too late, could we use the enhanced version of `Match` and discard the other one?

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.