liveBook · Manning

quickCheckAll

As explained in Learn Haskell by Example

quickCheckAll is a QuickCheck function that discovers properties in a module by naming convention and checks them automatically.

quickCheckAll runs every QuickCheck property defined in a module. It finds properties by their prop_ naming convention, then applies quickCheck automatically using Template Haskell. section 9.5.3

A practical test-suite setup requires:

  • Name properties with the prop_ prefix so quickCheckAll can collect them. section 9.5.3

Collecting properties in a suite

A module can define prop_true and prop_false, then expose runTests :: IO Bool with runTests = $quickCheckAll. A separate Main module can run this suite alongside others and convert the combined result into the process exit code used by stack test.

How Learn Haskell by Example covers it

How deep it goes
Explains naming-based collection, Template Haskell generation, suite composition, and process exit handling.
Examples
Uses prop_true, prop_false, prop_addPos, and prop_multZero across two suites invoked by Main.
What it assumes
Assumes basic Haskell modules and QuickCheck properties, while demonstrating Template Haskell activation and test-suite wiring.
What you can do after
Apply it via QuickCheck and Template Haskell to run named module properties and report suite failure through Stack.
How it connects
Connects property testing with QuickCheck, Template Haskell, Stack, test suites, and process exit codes.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Haskell by Example. The section links point to the parts of the book it draws on.