@hackage hspec-quickcheck-classes0.0.0.0
Integration between Hspec and quickcheck-classes
Categories
License
BSD-3-Clause
Maintainer
mail@jonathanknowles.net
Links
Versions
- 0.0.0.0 Fri, 17 Apr 2026
Installation
Dependencies (4)
- QuickCheck >=2.16.0.0 && <2.19
- base >=4.16.4.0 && <4.23
- hspec >=2.11.17 && <2.12
- quickcheck-classes >=0.6.5.0 && <0.7 Show all…
Dependents (5)
@hackage/quickcheck-monoid-subclasses, @hackage/monoidmap-internal, @hackage/quickcheck-quid, @hackage/quickcheck-groups, @hackage/monoidmap-aeson
hspec-quickcheck-classes
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
]