HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulegenvalidity-hspec-1.0.0.4Haskell2010

Test.Validity.GenValidity

Tests for GenValidity instances

You will need TypeApplications to use these.

Synopsis
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]