target: Generate test-suites from refinement types.

[ library, mit, program, testing ] [ Propose Tags ]

Target is a library for testing Haskell functions based on properties encoded as refinement types.

The programmer specifies the expected behavior of a function with a refinement type, and Target then checks that the function satisfies the specification by enumerating valid inputs up to some size, calling the function, and validating the output. Target excels when the space of valid inputs is a sparse subset of all possible inputs, e.g. when dealing with dataypes with complex invariants like red-black trees.

Test.Target is the main entry point and should contain everything you need to use Target with types from the Prelude. Test.Target.Targetable will also be useful if you want to test functions that use other types.

For information on how to specify interesting properties with refinement types, we have a series of blog posts as well as an evolving tutorial. Target uses the same specification language as LiquidHaskell, so the examples should carry over.

Finally, Target requires either Z3 (>=4.3) or CVC4 (>=1.4) to be present in your PATH.


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,,,
Dependencies base (>=4.6 && <5), containers (>=, directory (>=, exceptions (>=0.6), filepath (>=, ghc (>=7.8.3), ghc-paths, hint, liquid-fixpoint (>=0.4), liquidhaskell (>=0.5), mtl (>=2.1.2), pretty, process, QuickCheck (>=2.7), syb (>=0.4.2), tagged (>=0.7), target, template-haskell (>=2.8), text (>=1.0), text-format, th-lift, transformers (>=0.3), unordered-containers (>=, vector [details]
License MIT
Author Eric Seidel
Category Testing
Source repo head: git clone git://
Uploaded by EricSeidel at 2015-09-01T22:03:15Z
Reverse Dependencies 1 direct, 0 indirect [details]
Executables target
Downloads 3756 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-09-01 [all 1 reports]