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

Property-based generators for types in the core module #336

merged 47 commits into from Jun 7, 2019


None yet
2 participants
Copy link

commented Jun 6, 2019


Create generators for Property-based Testing for the types in the core module so that their values are used in the tests for laws. For this purpose, SwiftCheck is used.

Implementation details

  • Some types (mostly the ones that do not have nested kinds) have been made to conform Arbitrary.
  • A new type class ArbitraryK has been introduced to be able to generate values at the kind level and abstract over this functionality.
  • A final wrapper type KindOf is introduced. Arbitrary is derived for this type if the contained F conforms to ArbitraryK.
  • All types in the core module have conformance to ArbitraryK.

Testing details

Future work will make use of these generators to test the type class laws for the instances of the corresponding types.

@truizlop truizlop requested review from juancazalla and miguelangel-dev Jun 6, 2019

@truizlop truizlop self-assigned this Jun 6, 2019

@truizlop truizlop merged commit 88cfa91 into master Jun 7, 2019

1 check passed

continuous-integration/travis-ci/push The Travis CI build passed

@truizlop truizlop deleted the tomas/pbt-generators branch Jun 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.