HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

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]