genvalidity-hspec-0.3.0.0: Standard spec's for GenValidity instances

Safe HaskellNone
LanguageHaskell2010

Test.Validity.Functions.Idempotence

Contents

Synopsis

Standard tests involving validity

idempotentOnGen :: (Show a, Eq a) => (a -> a) -> Gen a -> Property Source #

idempotentOnValid :: (Show a, Eq a, GenValid a) => (a -> a) -> Property Source #

idempotent :: (Show a, Eq a, GenUnchecked a) => (a -> a) -> Property Source #

idempotentOnArbitrary :: (Show a, Eq a, Arbitrary a) => (a -> a) -> Property Source #

id is idempotent for any type:

idempotentOnArbitrary (id :: Int -> Int)

const, given any input, is idempotent for any type as well:

\int -> idempotentOnArbitrary (const int :: Int -> Int)