Module

Test.QuickCheck.Laws.Control

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

#checkAlt

checkAlt :: forall f. Alt f => Arbitrary (f A) => Eq (f A) => Eq (f B) => Proxy2 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

#checkAlternative

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

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

#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) => Proxy2 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

#checkApply

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

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

#checkBind

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

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

#checkCategory

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

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

#checkComonad

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

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

#checkExtend

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

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

#checkMonad

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

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

#checkMonadPlus

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

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

#checkMonadZero

checkMonadZero :: forall m. MonadZero m => Arbitrary (m A) => Arbitrary (m B) => Eq (m B) => Proxy2 m -> Effect Unit
  • Annihilation: empty >>= f = empty

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

#checkPlus

checkPlus :: forall f. Plus f => Arbitrary (f A) => Eq (f A) => Eq (f B) => Proxy2 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

#checkSemigroupoid

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

Modules