Skip to main content

Crate ordofp_laws

Crate ordofp_laws 

Source
Expand description

§OrdoFP Laws

This library contains property-based laws for testing implementations of type classes declared in OrdoFP. Laws help ensure that your implementations are mathematically correct and composable.

§Available Law Modules

§Core Algebraic Laws

§Functor Hierarchy Laws

§Async Type Class Laws (requires async feature)

  • [async_functor_laws] - Identity and composition laws for FunctorAsync
  • [async_monad_laws] - Left/right identity and associativity for MonadAsync

§Other Type Class Laws

§Usage with QuickCheck

use ordofp_laws::functor_laws;
use quickcheck::quickcheck;

quickcheck(functor_laws::identity::<Option<i32>> as fn(Option<i32>) -> bool);

Modules§

alternative_laws
Alternative Laws
applicative_laws
Applicative Laws
bifunctor_laws
Bifunctor Laws
category_laws
Category laws
comonad_laws
Comonad Laws
fixpoint_laws
Fixpoint Laws
foldable_laws
Foldable Laws
functor_laws
Functor Laws
is_eq
Equality verification for law testing
monad_laws
Monad Laws
monoid_laws
Unitas (Monoid) Laws
optics_laws
Optics Laws
semigroup_laws
Compositio (Semigroup) Laws
traversable_laws
Traversable Laws
wrapper
Wrapper Newtype