Module

Test.QuickCheck.Laws.Control.Applicative

Package
purescript-quickcheck-laws
Repository
purescript-contrib/purescript-quickcheck-laws

#checkApplicative Source

checkApplicative :: forall f. Applicative f => Arbitrary (f A) => Arbitrary (f (A -> B)) => Arbitrary (f (B -> C)) => Eq (f A) => Eq (f B) => Eq (f C) => Proxy f -> Effect Unit
  • Identity: (pure identity) <*> v = v
  • Composition: (pure (<<<)) <*> f <*> g <*> h = f <*> (g <*> h)
  • Homomorphism: (pure f) <*> (pure x) = pure (f x)
  • Interchange: u <*> (pure y) = (pure ($ y)) <*> u

#checkApplicativeGen Source

checkApplicativeGen :: forall f. Applicative f => Eq (f A) => Eq (f B) => Eq (f C) => Gen (f A) -> Gen (f (A -> B)) -> Gen (f (B -> C)) -> Effect Unit