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

Add method 'genSizedList' to class Foldy #4827

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

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Jan 9, 2025

Extends the Foldy class with a new method genSized list.
Removed many redundant constraints in Constrained.Base.hs
This allows one to solve constraints like

sum3 = constrained $ \ [var|xs|] -> [sum_ xs ==. lit 6 + lit 9 + lit 5, sizeOf_ xs ==. 5]  

Where a list that is being summed, can also have its size constrained.

Checklist

  • Commits in meaningful sequence and with useful messages
  • Tests added or updated when needed
  • CHANGELOG.md files updated for packages with externally visible changes

    New section is never added with the code changes. (See RELEASING.md)
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary

    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Code formatted (use scripts/fourmolize.sh)
  • Cabal files formatted (use scripts/cabal-format.sh)
  • hie.yaml updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@TimSheard TimSheard force-pushed the ts-genSizedList branch 8 times, most recently from 1d97b29 to b5ab5cf Compare January 14, 2025 23:31
@TimSheard TimSheard marked this pull request as ready for review January 15, 2025 00:27
@TimSheard TimSheard requested a review from a team as a code owner January 15, 2025 00:27
@TimSheard TimSheard force-pushed the ts-genSizedList branch 2 times, most recently from 6c12ffa to c11c6ae Compare January 16, 2025 18:47
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunch of tiny suggestions, but nothing critical.

libs/constrained-generators/src/Constrained/SumList.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/SumList.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/SumList.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/SumList.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/SumList.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/Base.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/Base.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/Base.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/GenT.hs Outdated Show resolved Hide resolved
libs/constrained-generators/src/Constrained/Base.hs Outdated Show resolved Hide resolved
Defined pickAll the basis of sums with fixed length.
Added getSizedList as a method of the Foldy class
getSizeList cost is metered at 1000 calls. Typical calls are less than 10.
Gave HasSpec (optional) method 'typeSpecHasError' a better default value
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.

3 participants