# Hedgehog

> Property-based testing for Haskell with integrated shrinking

Source: https://talira.ai/catalog/hedgehog-5qdtgdp6
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / property based](https://talira.ai/categories/developer-tools/testing/property-based), [languages / haskell](https://talira.ai/categories/languages/haskell)
- Licence: BSD-3-Clause[^2][^3]
- Pricing: Free and open source[^2]
- Pricing notes: Free and open source (BSD-3-Clause).
- Free tier: yes[^2]
- Backed by: [Hedgehog QA](https://talira.ai/orgs/hedgehogqa.md)

Hedgehog is a property-based testing library for Haskell: properties describe what must hold, and Hedgehog generates hundreds of test cases to check them. When a case fails, integrated shrinking simplifies it to a small counterexample, and shrinks obey the generators' invariants by construction. It also does abstract state machine testing, its generators may run monadic effects, Range combinators bound generated numbers and collections, and failed equality and round-trip assertions show a diff. A Template Haskell runner discovers properties and runs them concurrently.

## Links

- GitHub: https://github.com/hedgehogqa/haskell-hedgehog
- Docs: https://hackage.haskell.org/package/hedgehog/docs/Hedgehog.html

## Problems it solves

- my Haskell unit tests only cover the cases I thought of
- a property test found a bug but the failing input is huge and hard to read
- test a stateful Haskell API by generating random sequences of operations

## Features

- integrated shrinking that respects generator invariants
- abstract state machine testing
- generators with monadic effects
- Range combinators for generated numbers and collections
- diffs on failed equality and round-trip assertions
- Template Haskell runner that runs properties concurrently

## Limitations

- Finding properties automatically needs Template Haskell; without it, properties are listed by hand.[^1]

## Trust

Overall: 0.43 out of 1.
Signals: maintenance 0.49, adoption 0.57, momentum 0.25, community 0.74, backing 0.30, extensibility 0.00.

- last commit 46 days ago
- 6 commits in the last 90 days
- 702 GitHub stars
- 69 contributors
- backed by Hedgehog QA

## Alternatives

- [QuickCheck](https://talira.ai/catalog/quickcheck-ms7ypda7.md): Haskell library for property-based testing: check properties against randomly generated inputs

## Sources

[^1]: https://github.com/hedgehogqa/haskell-hedgehog/blob/master/README.md (checked 29 Nov 2026)
[^2]: https://github.com/hedgehogqa/haskell-hedgehog/blob/master/hedgehog/LICENSE (checked 29 Nov 2026)
[^3]: https://github.com/hedgehogqa/haskell-hedgehog/blob/master/hedgehog/hedgehog.cabal (checked 29 Nov 2026)
