QuickCheck
QuickCheck is a property-based testing library that generates test inputs from specifications, checks their properties, and may minimize failing counterexamples.
Learn Haskell by Example
QuickCheck is a Haskell library for property-based testing that generates test data and checks properties across many inputs.
- How it is used
- Tests formalized properties of pure Haskell functions, data types, and modules using generated random inputs.
- How deep it goes
- Explains property execution, generators, Arbitrary instances, shrinking, coverage modifiers, and Stack suites while deferring custom Testable instances.
- Examples
- Uses rot13 symmetry, alphabet rotation closedness, sorting predicates, associative maps, and multi-module Stack test suites.
- What you can do after
- Apply it via QuickCheck and Stack to generate inputs, diagnose weak properties, shrink failures, and run property suites.
Functional Programming in JavaScript
A Haskell library for property-based testing that generates random test cases from specifications.
- How it is used
- Uses pure-function specifications to test many randomized inputs and guard behavior during refactoring.
- How deep it goes
- Explains specifications, generated cases, reports, and JavaScript integration, but does not detail QuickCheck internals.
- Examples
- Demonstrates grade classification and Social Security number validation through generated inputs and pass/fail reports.
- What you can do after
- Evaluate pure functions by writing properties and reviewing randomized test reports.
Read how Functional Programming in JavaScript explains QuickCheck →
Functional Design and Architecture: Examples in Haskell
QuickCheck is a library for property-based testing that generates test inputs and checks specified properties against them.
- How it is used
- Uses generated properties to test pure algorithms and selected effectful scenarios without enumerating cases by hand.
- How deep it goes
- Explains generation, shrinking, bounded success counts, IO execution, and constrained inputs, but stops short of exhaustive verification.
- Examples
- Uses malformed square functions and labyrinth generation with bounded dimensions, exits, wormholes, and runtime interpretation.
- What you can do after
- Diagnoses logical defects through falsified properties and tests interpreted scenarios with generated or deliberately constrained inputs.
Read how Functional Design and Architecture: Examples in Haskell explains QuickCheck →
Related concepts
- property-based testinguses · Property-based testing is a software-testing technique that generates varied inputs and checks whether specified general properties of the software’s behavior hold across them.
- shrinkinguses · Shrinking is a test-case minimization technique that reduces a failing input while preserving the failure.
- preconditionuses · A precondition is a condition or requirement that must be satisfied before an operation, process, or action can proceed correctly.
- quickCheckAllused by · quickCheckAll is a QuickCheck function that discovers properties in a module by naming convention and checks them automatically.
- algebraic lawuses · An algebraic law is a general equation or behavioral property that an operation or implementation is expected to satisfy for applicable values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


