Module

Test.StrongCheck.Laws.Control

Package
purescript-strongcheck-laws
Repository
garyb/purescript-strongcheck-laws

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

#checkAlt Source

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.StrongCheck.Laws.Control.Alternative

#checkAlternative Source

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.StrongCheck.Laws.Control.Applicative

#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) => Proxy2 f -> Effect Unit
  • Identity: (pure id) <*> 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.StrongCheck.Laws.Control.Apply

#checkApply Source

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.StrongCheck.Laws.Control.Bind

#checkBind Source

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.StrongCheck.Laws.Control.Category

#checkCategory Source

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.StrongCheck.Laws.Control.Comonad

#checkComonad Source

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.StrongCheck.Laws.Control.Extend

#checkExtend Source

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.StrongCheck.Laws.Control.Monad

#checkMonad Source

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.StrongCheck.Laws.Control.MonadPlus

#checkMonadPlus Source

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.StrongCheck.Laws.Control.MonadZero

#checkMonadZero Source

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.StrongCheck.Laws.Control.Plus

#checkPlus Source

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.StrongCheck.Laws.Control.Semigroupoid

#checkSemigroupoid Source

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