HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Package0.1.0.1Testing

testing-type-modifiers

Data type modifiers for property based testing

Modules

1 module
  • Data.Modifiers8Type modifiers for writing properties that quantify over commonly used subsets of standard types.

Description

Property based testing libraries such as QuickCheck tend to include type modifiers. Most of them are used to quantify over subsets of a type. For example a property on non-empty lists:

prop_tail_length (NonEmpty xs) = length (tail xs) == length xs - 1

This library is intended to supply these modifiers to be used by testing libraries, in an effort to make properties more portable between testing frameworks.

For every modifier it also provides an access function that converts to the underlying type, which enables point-free style properties as such:

prop_tail_length2 = (> 0) . length . nonEmpty

Depends on

1 package

Used by in this set · 2