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

Implement property-based tests using hedgehog #24

Open
2 of 11 tasks
chshersh opened this issue Apr 28, 2019 · 0 comments
Open
2 of 11 tasks

Implement property-based tests using hedgehog #24

chshersh opened this issue Apr 28, 2019 · 0 comments
Labels
good first issue Good for newcomers Hacktoberfest https://hacktoberfest.digitalocean.com/ question Further information is requested tests

Comments

@chshersh
Copy link
Contributor

chshersh commented Apr 28, 2019

This is a meta-issue to collect all possible laws for the Treap data structure:

Semigroup/Monoid laws

  • Associativity
  • Left/Right identity

Measured

  • measure (one x) ≡ x

IsList

  • Roundtrip IsList: toList . fromList ≡ id

Modifications

  • at i . insert i x ≡ Just x
  • delete i . insert i x ≡ id
  • size (insert i x t) ≡ size t + 1

Cuts

  • uncurry merge . splitAt i ≡ id
  • size (merge l r) ≡ size l + size r
  • Monoid homomorphism: measure (merge l r) ≡ measure l <> measure r
  • splitAt i t ≡ (take i t, drop i t)
@chshersh chshersh added tests good first issue Good for newcomers question Further information is requested labels Apr 28, 2019
@chshersh chshersh added the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest https://hacktoberfest.digitalocean.com/ question Further information is requested tests
Projects
None yet
Development

No branches or pull requests

1 participant