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
semigroup_laws- Associativity law for Semigroupmonoid_laws- Identity laws for Monoidoptics_laws- Lens (GetPut/PutGet/PutPut) and prism laws
§Functor Hierarchy Laws
functor_laws- Identity and composition laws for GAT Functorapplicative_laws- Laws for Applicative functorsmonad_laws- Left/right identity and associativity for Monadalternative_laws- Choice/failure laws for Alternative
§Async Type Class Laws (requires async feature)
- [
async_functor_laws] - Identity and composition laws forFunctorAsync - [
async_monad_laws] - Left/right identity and associativity forMonadAsync
§Other Type Class Laws
foldable_laws- Consistency laws for Foldabletraversable_laws- Identity, naturality laws for Traversablecomonad_laws- Extract/extend laws for Comonadbifunctor_laws- Identity and composition for Bifunctorcategory_laws- Identity and associativity laws for Categoryfixpoint_laws- Laws relatingFix,cata, andana
§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