BSD-3-Clause licensed and maintained by Chris Smith
This version can be pinned in stack with:explainable-predicates-0.1.2.3@sha256:4e0ddf4c16b98f614bcd3bb337472b3569a9f22834e2bfa4626230557b0919f7,3784

Module documentation for 0.1.2.3

explainable-predicates - Predicates that can explain themselves

CI Hackage

Explainable predicates are essentially functions from types to Bool which can additionally describe themselves and explain why an argument does or doesn’t match. They are intended to be used during unit tests to provide better error messages when tests fail. For example, if a collection is missing an element, an explainable predicate can tell you which element is missing.

FAQ

Here are a few tips for making the most of explainable-predicates.

Which GHC versions are supported?

explainable-predicates is tested with GHC versions from 8.6 through 9.4.

Changes

Revision history for explainable-predicates

0.1.2.3 – 2021-09-18

  • Version bounds now allow GHC 9.4

0.1.2.2 – 2021-12-20

  • Better error messages for HUnit integration.

0.1.2.1 – 2021-12-20

  • Builds with GHC 9.2.1

0.1.2.0 – 2021-09-25

  • HUnit and Hspec integration is now available in Test.Predicates.HUnit.

0.1.1.0 – 2021-09-25

  • Predicate now has a Contravariant instance.
  • ==~ is an infix synonym for accept.
  • Cabal regex and containers flags (default true) enable regex and container predicates, respectively.
  • Cabal dev flag (default false) turns GHC warnings into errors.
  • The inBranch and qADT combinators are now available for more convenient matching of algebraic data types and fields.
  • QuickCheck integration is now available in Test.Predicates.QuickCheck.

0.1.0.0 – 2021-09-18

  • First version. Released on an unsuspecting world.