BSD-3-Clause licensed and maintained by Chris Smith
This version can be pinned in stack with:explainable-predicates-0.1.2.4@sha256:69125c622d19b4e5ca44c384e354a615aef13605756a77d2fd371307ae092586,3808

Module documentation for 0.1.2.4

Used by 1 package in nightly-2024-07-18(full list with versions):

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.4 – 2023-11-28

  • Version bounds now allow GHC 9.6 and 9.8
  • Fix TypeOperators warning in Test.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.