hspec-quickcheck-classes: Integration between Hspec and quickcheck-classes

[ bsd3, library, testing ] [ Propose Tags ] [ Report a vulnerability ]

Integrates Hspec with quickcheck-classes, making it convenient for Hspec test suites to include tests for the lawfulness of type class instances.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.0
Change log CHANGELOG.md
Dependencies base (>=4.16.4.0 && <4.23), hspec (>=2.11.17 && <2.12), QuickCheck (>=2.16.0.0 && <2.19), quickcheck-classes (>=0.6.5.0 && <0.7) [details]
License BSD-3-Clause
Copyright Jonathan Knowles
Author Jonathan Knowles
Maintainer mail@jonathanknowles.net
Uploaded by JonathanKnowles at 2026-04-17T01:40:47Z
Category Testing
Home page https://github.com/jonathanknowles/hspec-quickcheck-classes
Bug tracker https://github.com/jonathanknowles/hspec-quickcheck-classes/issues
Source repo head: git clone https://github.com/jonathanknowles/hspec-quickcheck-classes
Distributions
Downloads 9 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-04-17 [all 1 reports]

Readme for hspec-quickcheck-classes-0.0.0.0

[back to package description]

hspec-quickcheck-classes

Latest Release Development Branch

This package integrates Hspec with quickcheck-classes, making it convenient for Hspec test suites to include tests for the lawfulness of type class instances.

Usage

To test that a type satisfies the laws of one or more type classes:

testLaws @Bool
  [ eqLaws
  , ordLaws
  , showLaws
  ]

Kind polymorphism

The testLaws function is kind-polymorphic, supporting type parameters of any kind.

This means it can be used to test instances of type classes whose type parameters are not of kind Type.

For example, with Maybe (which has kind Type -> Type):

testLaws @Maybe
  [ applicativeLaws
  , functorLaws
  , monadLaws
  , foldableLaws
  , traversableLaws
  ]

And with Either (which has kind Type -> Type -> Type):

testLaws @Either
  [ bifoldableLaws
  , bifunctorLaws
  , bitraversableLaws
  ]