Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/athanclark/purescript-quickcheck-combinators
Typelevel combinators for quickcheck, in purescript
https://github.com/athanclark/purescript-quickcheck-combinators
data-generation purescript quickcheck quickcheck-combinators typelevel-programming
Last synced: 5 days ago
JSON representation
Typelevel combinators for quickcheck, in purescript
- Host: GitHub
- URL: https://github.com/athanclark/purescript-quickcheck-combinators
- Owner: athanclark
- License: bsd-3-clause
- Created: 2018-12-10T15:44:35.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-29T21:36:50.000Z (over 4 years ago)
- Last Synced: 2024-12-10T09:59:03.331Z (24 days ago)
- Topics: data-generation, purescript, quickcheck, quickcheck-combinators, typelevel-programming
- Language: PureScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-quickcheck-combinators
This library is for generating `Unfoldable`s with trivial
constraints on the length of the structure generated - "at least",
"at most", and "between"; each indexed by a type-level natural number.For instance:
```purescript
arbitraryArrayWithAtLeast5Elements :: forall a. Arbitrary a => Gen (Array a)
arbitraryArrayWithAtLeast5Elements = do
AtLeast xs <- arbitrary :: Gen (AtLeast D5 Array a)
pure xs
```The only requirement is that the structure needs to be `Unfoldable` and `Traversable`,
apart from `a` needing to be `Arbitrary` as well.