/purescript-strongcheck-generics

Generics for purescript-strongcheck

Primary LanguagePureScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

purescript-strongcheck-generics

purescript-strongcheck-generics on Pursuit Latest release Build Status

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))

Output

Documentation