BSD-3-Clause licensed by Andrew Martin, chessai
Maintained by [email protected]
This version can be pinned in stack with:quickcheck-classes-base-0.6.2.0@sha256:b94d7af739f90539eb63beda4e7015d87744779cf36ab56d3619f40b251a7bdc,3934

Module documentation for 0.6.2.0

This libary is a minimal variant of `quickcheck-classes` that only provides laws for typeclasses from base. The main purpose of splitting this out is so that primitive can depend on `quickcheck-classes-base` in its test suite, avoiding the circular dependency that arises if `quickcheck-classes` is used instead.

This library provides QuickCheck properties to ensure that typeclass instances adhere to the set of laws that they are supposed to. There are other libraries that do similar things, such as `genvalidity-hspec` and checkers. This library differs from other solutions by not introducing any new typeclasses that the user needs to learn.

Note: on GHC < 8.5, this library uses the higher-kinded typeclasses (Data.Functor.Classes.Show1, Data.Functor.Classes.Eq1, Data.Functor.Classes.Ord1, etc.), but on GHC >= 8.5, it uses `-XQuantifiedConstraints` to express these constraints more cleanly.

Changes

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to the Haskell Package Versioning Policy.

Note that since quickcheck-classes reexports larges parts of quickcheck-classes-base, changelog entries that deal with any of the classes from base are duplicated across the two changelogs.

[0.6.2.0] - 2021-04-12

  • Storable Set-Set Law (resolves issue 101).
  • Trim unneeded dependencies (tagged, base-orphans)
  • Trim unneeded dependencies on newer GHCs (bifunctors, contravariant)

[0.6.1.0] - 2020-09-09

Added

  • Laws for abs and signum
  • Storable Set-Set Law (resolves issue 101).
  • Add laws for quotRem and divMod.
  • Use non-commutative monoid for bifoldable tests (resolves issue 98)
  • substitutiveEqLaws, which tests for Eq substitutivity.
  • Negation law check for Eq.
  • Document that users can provide their own Laws.

[0.6.0.0] - 2019-08-08

Added

  • Initial release. This factor out a subset of laws tests from quickcheck-classes and depend on this library that have a more minimal dependency footprint.
  • Add laws for left rotate and right rotate.
  • Add law that checks that subtraction is the same thing as adding the negation of a number.