Module

Test.QuickCheck.Laws.Control

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

#checkAltGen

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

#checkAlt

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

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

#checkAlternative

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

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

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

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

#checkApply

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

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

#checkBind

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

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

#checkCategory

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

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

#checkComonad

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

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

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

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

#checkMonad

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

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

#checkMonadPlus

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

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

#checkPlus

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

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

#checkSemigroupoid

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

Modules