genvalidity-property-1.0.0.0: Standard properties for functions on `Validity` types

Safe Haskell | None
Language | Haskell2010

Test.Validity.Functions.Idempotence

Description

Standard tests involving validity

Synopsis

- idempotentOnGen :: (Show a, Eq a) => (a -> a) -> Gen a -> (a -> [a]) -> Property
- idempotent :: (Show a, Eq a, GenValid a) => (a -> a) -> Property
- idempotentOnArbitrary :: (Show a, Eq a, Arbitrary a) => (a -> a) -> Property

# Documentation

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

idempotent :: (Show a, Eq a, GenValid 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)