HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulegenvalidity-hspec-1.0.0.4Haskell2010

Test.Validity.Functor

Functor properties

You will need TypeApplications to use these.

  • 3 values
valuefunctorSpecOnGens
  1. :: (Show a, Show (f a), Show (f c), Eq (f a), Eq (f c), Functor f, Typeable f, Typeable a, Typeable b, Typeable c)
  2. => Gen a
  3. -> String
  4. -> Gen (f a)
  5. -> String
  6. -> Gen (b -> c)
  7. -> String
  8. -> Gen (a -> b)
  9. -> String
  10. -> Spec
#

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"