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

Replace lists by sequences in Ortac/QCheck-STM tests #279

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

n-osborne
Copy link
Collaborator

Fixes #278

This should also help #277.

I didn't change the tests for the wrapper mode as using sequences would mean supporting models (see #224)

@jmid
Copy link
Contributor

jmid commented Dec 10, 2024

LGTM!

Will :: be a short-hand for Sequence.cons in the revised stdlib, that removes List?
Comparing tuples.add it helps readability, IMO:

- ensures h.contents = match tup with a, b -> (a, b) :: old h.contents
+ ensures h.contents = match tup with a, b -> Sequence.cons (a, b) (old h.contents)

@n-osborne
Copy link
Collaborator Author

Sadly, I'm not sure.
It is not yet decided whether we will continue to allow importing pure OCaml value in Gospel. If so, :: will be reserved for OCaml lists. Is not, an argument can be make that allowing :: for Gospel sequences can be confusing?
But I agree that the prefix cons is not ideal.

TBH, I'm also a bit sad that we lose pattern matching too.

@n-osborne n-osborne merged commit 7a0bd29 into ocaml-gospel:main Dec 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite all tests using lists as model with sequences
2 participants