HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulegenvalidity-hspec-1.0.0.4Haskell2010

Test.Validity.GenValidity

Tests for GenValidity instances

You will need TypeApplications to use these.

  • 4 values
valuegenValidSpec :: (Typeable a, Show a, GenValid a) => Spec
#

A Spec that specifies that genValid only generates valid data.

In general it is a good idea to add this spec to your test suite if you write a custom implementation of genValid.

Example usage:

genValidSpec @Int

genValid only generates valid data

Property
genValidGeneratesValid @()
Property
genValidGeneratesValid @Bool
Property
genValidGeneratesValid @Ordering
Property
genValidGeneratesValid @Char
Property
genValidGeneratesValid @Int
Property
genValidGeneratesValid @Float
Property
genValidGeneratesValid @Double
Property
genValidGeneratesValid @Integer
Property
genValidGeneratesValid @(Maybe Int)
Property
genValidGeneratesValid @[Int]