purescript-strongcheck-generics
Generic deriving for Arbitrary
/CoArbitrary
, and generation of GenericSpine
/GenericSignature
.
Installation
bower install purescript-strongcheck-generics
Example
module Main where
import Prelude
import Data.Generic
import Test.StrongCheck
import Test.StrongCheck.Gen
import Test.StrongCheck.Generic
data 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 = gShow
main = do
showSample (gArbitrary :: Gen (Tree Int))