https://github.com/zudov/purescript-strongcheck-generics
Generics for purescript-strongcheck
https://github.com/zudov/purescript-strongcheck-generics
Last synced: 3 months ago
JSON representation
Generics for purescript-strongcheck
- Host: GitHub
- URL: https://github.com/zudov/purescript-strongcheck-generics
- Owner: zudov
- License: bsd-3-clause
- Created: 2015-08-23T19:25:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-27T18:44:13.000Z (almost 5 years ago)
- Last Synced: 2025-03-06T09:16:08.953Z (4 months ago)
- Language: PureScript
- Homepage:
- Size: 29.3 KB
- Stars: 4
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-strongcheck-generics
[](http://pursuit.purescript.org/packages/purescript-strongcheck-generics)
[](https://github.com/zudov/purescript-strongcheck-generics/releases)
[](https://travis-ci.org/zudov/purescript-strongcheck-generics)Generic deriving for `Arbitrary`/`CoArbitrary`, and generation of `GenericSpine`/`GenericSignature`.
**Warning:** It was noticed that generating a spine for deeply recursive data structures (particularly those
that include arrays of themselves) can hang running indefinetely. See [issue 5](https://github.com/zudov/purescript-strongcheck-generics/issues/5) for details.## Installation
```shell
bower install purescript-strongcheck-generics
```## Example
```purescript
module Main whereimport Prelude
import Data.Generic
import Test.StrongCheck
import Test.StrongCheck.Gen
import Test.StrongCheck.Genericdata Tree a = Leaf | Branch { value :: a, kids :: Array (Tree a) }
derive instance genericTree :: (Generic a) => Generic (Tree a)
instance showTree :: (Show a, Generic a) => Show (Tree a) where
show = gShowmain = do
showSample (gArbitrary :: Gen (Tree Int))
```[Output](https://travis-ci.org/zudov/purescript-strongcheck-generics/builds/91160401#L733)
## Documentation
- [Test.StrongCheck.Generic](docs/Test/StrongCheck/Generic.md)