leancheck-0.7.7: Enumerative property-based testing

Copyright(c) 2018 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellSafe
LanguageHaskell2010

Test.LeanCheck.Generic

Description

This module is part of LeanCheck, a simple enumerative property-based testing library.

This is an experimental module for deriving Listable instances through GHC's generic.

If you rather do this through Template Haskell please see: Test.LeanCheck.Derive.

Synopsis

Documentation

genericList :: (Generic a, Listable' (Rep a)) => [a] Source #

A generic implementation of list for instances of Generic.

Use it to define your Listable instances like so:

instance Listable MyType where
  list = genericList

Consider using genericTiers instead of this (unless you know what you're doing).

genericTiers :: (Generic a, Listable' (Rep a)) => [[a]] Source #

A generic implementation of tiers for instances of Generic.

Use it to define your Listable instances like so:

instance Listable MyType where
  tiers = genericTiers