Module

Test.QuickCheck.Laws.Control

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

Re-exports from Test.QuickCheck.Laws.Control.Alt

#checkAltGen Source

checkAltGen :: forall f. Alt f => Eq (f A) => Eq (f B) => Gen (f A) -> Effect Unit

#checkAlt Source

checkAlt :: forall f. Alt f => Arbitrary (f A) => Eq (f A) => Eq (f B) => Proxy f -> Effect Unit
  • Associativity: (x <|> y) <|> z == x <|> (y <|> z)
  • Distributivity: f <$> (x <|> y) == (f <$> x) <|> (f <$> y)

Re-exports from Test.QuickCheck.Laws.Control.Alternative

#checkAlternativeGen Source

checkAlternativeGen :: forall f. Alternative f => Eq (f A) => Eq (f B) => Gen (f A) -> Gen (f (A -> B)) -> Proxy f -> Effect Unit

#checkAlternative Source

checkAlternative :: forall f. Alternative f => Arbitrary (f (A -> B)) => Arbitrary (f A) => Eq (f A) => Eq (f B) => Proxy f -> Effect Unit
  • Distributivity: (f <|> g) <*> x == (f <*> x) <|> (g <*> x)
  • Annihilation: empty <*> x = empty

Re-exports from Test.QuickCheck.Laws.Control.Applicative

#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

#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

Re-exports from Test.QuickCheck.Laws.Control.Apply

#checkApplyGen Source

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

#checkApply Source

checkApply :: forall f. Apply f => Arbitrary (f A) => Arbitrary (f (A -> B)) => Arbitrary (f (B -> C)) => Eq (f C) => Proxy f -> Effect Unit
  • Associative composition: (<<<) <$> f <*> g <*> h = f <*> (g <*> h)

Re-exports from Test.QuickCheck.Laws.Control.Bind

#checkBindGen Source

checkBindGen :: forall m. Bind m => Eq (m A) => Gen (m A) -> Gen (A -> m A) -> Effect Unit

#checkBind Source

checkBind :: forall m. Bind m => Arbitrary (m A) => Eq (m A) => Proxy m -> Effect Unit
  • Associativity: (x >>= f) >>= g = x >>= (\k → f k >>= g)

Re-exports from Test.QuickCheck.Laws.Control.Category

#checkCategoryGen Source

checkCategoryGen :: forall a. Category a => Arbitrary (a B C) => Eq (a B C) => Gen (a B C) -> Effect Unit

#checkCategory Source

checkCategory :: forall a. Category a => Arbitrary (a B C) => Eq (a B C) => Proxy a -> Effect Unit
  • Identity: id <<< p = p <<< id = p

Re-exports from Test.QuickCheck.Laws.Control.Comonad

#checkComonadGen Source

checkComonadGen :: forall w. Comonad w => Eq (w A) => Gen (w A) -> Gen (w A -> B) -> Effect Unit

#checkComonad Source

checkComonad :: forall w. Comonad w => Arbitrary (w A) => Coarbitrary (w A) => Eq (w A) => Proxy w -> Effect Unit
  • Left Identity: extract <<= x = x
  • Right Identity: extract (f <<= x) = f x

Re-exports from Test.QuickCheck.Laws.Control.Extend

#checkExtendGen Source

checkExtendGen :: forall w. Extend w => Arbitrary (w A) => Coarbitrary (w A) => Coarbitrary (w B) => Eq (w C) => Gen (w A) -> Gen (w B -> C) -> Gen (w A -> B) -> Effect Unit

#checkExtend Source

checkExtend :: forall w. Extend w => Arbitrary (w A) => Coarbitrary (w A) => Coarbitrary (w B) => Eq (w C) => Proxy w -> Effect Unit
  • Associativity: extend f <<< extend g = extend (f <<< extend g)

Re-exports from Test.QuickCheck.Laws.Control.Monad

#checkMonadGen Source

checkMonadGen :: forall m. Monad m => Eq (m A) => Gen (m A) -> Gen (A -> m A) -> Effect Unit

#checkMonad Source

checkMonad :: forall m. Monad m => Arbitrary (m A) => Eq (m A) => Proxy m -> Effect Unit
  • Left Identity: pure x >>= f = f x
  • Right Identity: x >>= pure = x

Re-exports from Test.QuickCheck.Laws.Control.MonadPlus

#checkMonadPlusGen Source

checkMonadPlusGen :: forall m. MonadPlus m => Eq (m B) => Gen (m A) -> Gen (A -> m B) -> Effect Unit

#checkMonadPlus Source

checkMonadPlus :: forall m. MonadPlus m => Arbitrary (m A) => Arbitrary (m B) => Eq (m B) => Proxy m -> Effect Unit
  • Distributivity: (x <|> y) >>= f == (x >>= f) <|> (y >>= f)

Re-exports from Test.QuickCheck.Laws.Control.Plus

#checkPlusGen Source

checkPlusGen :: forall f. Plus f => Eq (f A) => Eq (f B) => Gen (f A) -> Effect Unit

#checkPlus Source

checkPlus :: forall f. Plus f => Arbitrary (f A) => Eq (f A) => Eq (f B) => Proxy f -> Effect Unit
  • Left identity: empty <|> x == x
  • Right identity: x <|> empty == x
  • Annihilation: f <$> empty == empty

Re-exports from Test.QuickCheck.Laws.Control.Semigroupoid

#checkSemigroupoidGen Source

checkSemigroupoidGen :: forall a. Semigroupoid a => Eq (a B E) => Gen (a B C) -> Gen (a C D) -> Gen (a D E) -> Effect Unit

#checkSemigroupoid Source

checkSemigroupoid :: forall a. Semigroupoid a => Arbitrary (a B C) => Arbitrary (a C D) => Arbitrary (a D E) => Eq (a B E) => Proxy a -> Effect Unit
  • Associativity: p <<< (q <<< r) = (p <<< q) <<< r