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-sydtest-1.0.0.0Haskell2010

Test.Syd.Validity.Applicative

Applicative properties

You will need TypeApplications to use these.

  • 3 values
valueapplicativeSpecOnGens
  1. :: (Show a, Show (f a), Eq (f a), Show (f b), Eq (f b), Show (f c), Eq (f c), Applicative f, Typeable f, Typeable a, Typeable b, Typeable c)
  2. => Gen a
  3. -> String
  4. -> Gen (f a)
  5. -> String
  6. -> Gen (f b)
  7. -> String
  8. -> Gen (a -> b)
  9. -> String
  10. -> Gen (f (a -> b))
  11. -> String
  12. -> Gen (f (b -> c))
  13. -> String
  14. -> Spec
#

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

Unless you are building a specific regression test, you probably want to use the other applicativeSpec functions.

Example usage:

applicativeSpecOnGens
    @Maybe
    @String
    (pure "ABC")
    "ABC"
    (Just <$> pure "ABC")
    "Just an ABC"
    (pure Nothing)
    "purely Nothing"
    ((++) <$> genValid)
    "prepends"
    (pure <$> ((++) <$> genValid))
    "prepends in a Just"
    (pure <$> (flip (++) <$> genValid))
    "appends in a Just"