purescript-strongcheck-generics

Generics for purescript-strongcheck


License
BSD-3-Clause
Install
bower install purescript-strongcheck-generics

Documentation

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