Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(NonEmpty x) in MemberSpec #4712

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

(NonEmpty x) in MemberSpec #4712

wants to merge 1 commit into from

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Oct 23, 2024

MemberSpec used to have type
MemberSpec :: [a] -> Specification fn a

This was problematic because (MemberSpec [ ]) is inconsistent and cannot be solved, Yet it carries no information about the context that held when this inconsistency arose. This lead to many baffling failures.

By changing the type of MemberSpec to
MemberSpec :: (Data.List.NonEmpty a) -> Specification fn a
We use types to enforce this baffing inconsistency never arises.
Contexts that used to compute (MemberSpec [ ]) can now instead compute (ErrorSpec (context about error)) instead

Checklist

  • [ x] Commit sequence broadly makes sense and commits have useful messages
  • [x ] New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • [ x] Self-reviewed the diff

@TimSheard TimSheard marked this pull request as ready for review October 23, 2024 17:46
@TimSheard TimSheard requested a review from a team as a code owner October 23, 2024 17:46
Property prop_univSound gets 50% more time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant