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

Safe HaskellNone
LanguageHaskell2010

Test.Validity.Functor

Description

Functor properties

You will need TypeApplications to use these.

Synopsis

Documentation

functorSpecOnValid :: forall (f :: * -> *). (Eq (f Int), Show (f Int), Functor f, Typeable f, GenValid (f Int)) => Spec Source #

Standard test spec for properties of Functor instances for values generated with GenValid instances

Example usage:

functorSpecOnArbitrary @[]

functorSpec :: forall (f :: * -> *). (Eq (f Int), Show (f Int), Functor f, Typeable f, GenUnchecked (f Int)) => Spec Source #

Standard test spec for properties of Functor instances for values generated with GenUnchecked instances

Example usage:

functorSpecOnArbitrary @[]

functorSpecOnArbitrary :: forall (f :: * -> *). (Eq (f Int), Show (f Int), Functor f, Typeable f, Arbitrary (f Int)) => Spec Source #

Standard test spec for properties of Functor instances for values generated with Arbitrary instances

Example usage:

functorSpecOnArbitrary @[]

functorSpecOnGens :: forall (f :: * -> *) (a :: *) (b :: *) (c :: *). (Show a, Show (f a), Show (f c), Eq (f a), Eq (f c), Functor f, Typeable f, Typeable a, Typeable b, Typeable c) => Gen a -> String -> Gen (f a) -> String -> Gen (b -> c) -> String -> Gen (a -> b) -> String -> Spec Source #

Standard test spec for properties of Functor instances for values generated by given generators (and names for those generator).

Example usage:

functorSpecOnGens
    @[]
    @Int
    (pure 4) "four"
    (genListOf $ pure 5) "list of fives"
    ((+) <$> genValid) "additions"
    ((*) <$> genValid) "multiplications"