Skip to main content

Module classes

Module classes 

Source
Expand description

Defines traits for common algebraic structures and functional abstractions, such as Functor, Applicative and Monad.

Traits representing higher-kinded types (e.g., Functor) are implemented by Brand types to simulate higher-kinded polymorphism, as Rust does not natively support it.

Re-exports§

pub use alt::Alt;
pub use alternative::Alternative;
pub use applicative::Applicative;
pub use apply_first::ApplyFirst;
pub use apply_second::ApplySecond;
pub use arrow::Arrow;
pub use bifoldable::Bifoldable;
pub use bifunctor::Bifunctor;
pub use bitraversable::Bitraversable;
pub use category::Category;
pub use clone_fn::CloneFn;
pub use clone_fn::LiftFn;
pub use clone_fn::RefLiftFn;
pub use commutative_ring::CommutativeRing;
pub use comonad::Comonad;
pub use compactable::Compactable;
pub use contravariant::Contravariant;
pub use deferrable::Deferrable;
pub use division_ring::DivisionRing;
pub use euclidean_ring::EuclideanRing;
pub use extend::Extend;
pub use extract::Extract;
pub use field::Field;
pub use filterable::Filterable;
pub use filterable_with_index::FilterableWithIndex;
pub use foldable::Foldable;
pub use foldable_with_index::FoldableWithIndex;
pub use functor::Functor;
pub use functor_with_index::FunctorWithIndex;
pub use heyting_algebra::HeytingAlgebra;
pub use lazy_config::LazyConfig;
pub use lift::Lift;
pub use monad::Monad;
pub use monad_plus::MonadPlus;
pub use monad_rec::MonadRec;
pub use monoid::Monoid;
pub use natural_transformation::NaturalTransformation;
pub use optics::AffineTraversalOptic;
pub use optics::FoldOptic;
pub use optics::GetterOptic;
pub use optics::GrateOptic;
pub use optics::IndexedFoldOptic;
pub use optics::IndexedGetterOptic;
pub use optics::IndexedLensOptic;
pub use optics::IndexedOpticAdapter;
pub use optics::IndexedOpticAdapterDiscardsFocus;
pub use optics::IndexedSetterOptic;
pub use optics::IndexedTraversalOptic;
pub use optics::IsoOptic;
pub use optics::LensOptic;
pub use optics::Optic;
pub use optics::PrismOptic;
pub use optics::ReviewOptic;
pub use optics::SetterOptic;
pub use optics::TraversalOptic;
pub use par_compactable::ParCompactable;
pub use par_filterable::ParFilterable;
pub use par_filterable_with_index::ParFilterableWithIndex;
pub use par_foldable::ParFoldable;
pub use par_foldable_with_index::ParFoldableWithIndex;
pub use par_functor::ParFunctor;
pub use par_functor_with_index::ParFunctorWithIndex;
pub use par_ref_filterable::ParRefFilterable;
pub use par_ref_filterable_with_index::ParRefFilterableWithIndex;
pub use par_ref_foldable::ParRefFoldable;
pub use par_ref_foldable_with_index::ParRefFoldableWithIndex;
pub use par_ref_functor::ParRefFunctor;
pub use par_ref_functor_with_index::ParRefFunctorWithIndex;
pub use pipe::Pipe;
pub use plus::Plus;
pub use pointed::Pointed;
pub use pointer::Pointer;
pub use profunctor::Profunctor;
pub use ref_alt::RefAlt;
pub use ref_applicative::RefApplicative;
pub use ref_apply_first::RefApplyFirst;
pub use ref_apply_second::RefApplySecond;
pub use ref_bifoldable::RefBifoldable;
pub use ref_bifunctor::RefBifunctor;
pub use ref_bitraversable::RefBitraversable;
pub use ref_compactable::RefCompactable;
pub use ref_counted_pointer::RefCountedPointer;
pub use ref_filterable::RefFilterable;
pub use ref_filterable_with_index::RefFilterableWithIndex;
pub use ref_foldable::RefFoldable;
pub use ref_foldable_with_index::RefFoldableWithIndex;
pub use ref_functor::RefFunctor;
pub use ref_functor_with_index::RefFunctorWithIndex;
pub use ref_lift::RefLift;
pub use ref_monad::RefMonad;
pub use ref_pointed::RefPointed;
pub use ref_semiapplicative::RefSemiapplicative;
pub use ref_semimonad::RefSemimonad;
pub use ref_traversable::RefTraversable;
pub use ref_traversable_with_index::RefTraversableWithIndex;
pub use ref_witherable::RefWitherable;
pub use ring::Ring;
pub use semiapplicative::Semiapplicative;
pub use semigroup::Semigroup;
pub use semigroupoid::Semigroupoid;
pub use semimonad::Semimonad;
pub use semiring::Semiring;
pub use send_clone_fn::SendCloneFn;
pub use send_clone_fn::SendLiftFn;
pub use send_clone_fn::SendRefLiftFn;
pub use send_deferrable::SendDeferrable;
pub use send_ref_applicative::SendRefApplicative;
pub use send_ref_apply_first::SendRefApplyFirst;
pub use send_ref_apply_second::SendRefApplySecond;
pub use send_ref_counted_pointer::SendRefCountedPointer;
pub use send_ref_foldable::SendRefFoldable;
pub use send_ref_foldable_with_index::SendRefFoldableWithIndex;
pub use send_ref_functor::SendRefFunctor;
pub use send_ref_functor_with_index::SendRefFunctorWithIndex;
pub use send_ref_lift::SendRefLift;
pub use send_ref_monad::SendRefMonad;
pub use send_ref_pointed::SendRefPointed;
pub use send_ref_semiapplicative::SendRefSemiapplicative;
pub use send_ref_semimonad::SendRefSemimonad;
pub use to_dyn_clone_fn::ToDynCloneFn;
pub use to_dyn_fn::ToDynFn;
pub use to_dyn_send_fn::ToDynSendFn;
pub use traversable::Traversable;
pub use traversable_with_index::TraversableWithIndex;
pub use with_index::WithIndex;
pub use witherable::Witherable;

Modules§

alt
Choosing between values in a context, associatively.
alternative
Alternative functors, combining Applicative and Plus.
applicative
Applicative functors, allowing for independent computations to be combined within a context.
apply_first
Sequencing of two computations while keeping the result of the first.
apply_second
Sequencing of two computations while keeping the result of the second.
arrow
Composable function wrappers with Category and Strong instances.
bifoldable
Data structures with two type arguments that can be folded into a single value.
bifunctor
Types that can be mapped over two type arguments simultaneously.
bitraversable
Data structures with two type arguments that can be traversed in an applicative context.
category
Categories, which are semigroupoids with an identity element for each object.
clone_fn
Cloneable wrappers over closures for generic handling of functions in higher-kinded contexts.
commutative_ring
Types where multiplication is commutative.
comonad
Comonads, the dual of monads, combining Extend and Extract.
compactable
Data structures that can be compacted by filtering out None or separated by splitting Result values.
contravariant
Types that can be mapped over contravariantly.
deferrable
Types that can be constructed lazily from a computation.
division_ring
Types that support multiplicative inverses.
euclidean_ring
Types that support Euclidean division with a degree function.
extend
Cooperative extension of a local context-dependent computation to a global computation.
extract
Types that hold exactly one value which can be extracted.
field
Types that form a field (commutative division ring with Euclidean structure).
filterable
Data structures that can be filtered and partitioned based on predicates or mapping functions.
filterable_with_index
A Filterable with an additional index.
foldable
Data structures that can be folded into a single value from the left or right.
foldable_with_index
A Foldable with an additional index.
functor
Types that can be mapped over, allowing functions to be applied to values within a context.
functor_with_index
A Functor with an additional index.
heyting_algebra
Types that form a Heyting algebra (bounded lattice with implication).
lazy_config
Configuration trait for infallible memoization strategy.
lift
Lifting of functions to operate on values within a context.
monad
Monads, allowing for sequencing computations where the structure depends on previous results.
monad_plus
Monads with a choice operator and identity element, combining Monad and Alternative.
monad_rec
Monads that support stack-safe tail recursion via ControlFlow.
monoid
Types that have an identity element and an associative binary operation.
natural_transformation
Natural transformations between type constructors.
optics
Traits for optics.
par_compactable
Data structures that can be compacted and separated in parallel.
par_filterable
Data structures that can be filtered and filter-mapped in parallel.
par_filterable_with_index
A ParFilterable with an additional index.
par_foldable
Data structures that can be folded in parallel.
par_foldable_with_index
A ParFoldable with an additional index.
par_functor
Data structures that can be mapped over in parallel.
par_functor_with_index
A ParFunctor with an additional index.
par_ref_filterable
Parallel by-reference filterable.
par_ref_filterable_with_index
Parallel by-reference filterable with index.
par_ref_foldable
Parallel by-reference foldable.
par_ref_foldable_with_index
Parallel by-reference foldable with index.
par_ref_functor
Parallel by-reference functor mapping.
par_ref_functor_with_index
Parallel by-reference functor mapping with index.
pipe
Left-to-right function application via method syntax.
plus
The identity element for Alt, forming a monoid on type constructors.
pointed
Contexts that can be initialized with a value via the pure operation.
pointer
Independent traits for abstracting over different types of pointers and their capabilities.
profunctor
Profunctors, which are functors contravariant in the first argument and covariant in the second.
ref_alt
Choosing between values in a context by reference, associatively.
ref_applicative
By-ref applicative functors, combining RefPointed and RefSemiapplicative.
ref_apply_first
Combining two by-ref contexts, keeping the first value, with ref_apply_first.
ref_apply_second
Combining two by-ref contexts, keeping the second value, with ref_apply_second.
ref_bifoldable
By-reference variant of Bifoldable.
ref_bifunctor
Types that can be mapped over two type arguments simultaneously by reference.
ref_bitraversable
By-reference traversal of bifunctor structures.
ref_compactable
By-reference compacting and separating of structures.
ref_counted_pointer
Reference-counted pointers with shared ownership, unwrapping, and take-cell capabilities.
ref_filterable
By-reference filtering and partitioning of structures.
ref_filterable_with_index
By-reference indexed filtering and partitioning of structures.
ref_foldable
By-reference variant of Foldable.
ref_foldable_with_index
By-reference variant of FoldableWithIndex.
ref_functor
Types that can be mapped over by receiving or returning references to their contents.
ref_functor_with_index
By-reference variant of FunctorWithIndex.
ref_lift
Lifting binary functions into contexts via references with lift2.
ref_monad
By-ref monads, combining RefApplicative and RefSemimonad.
ref_pointed
Contexts that can be initialized from a reference via the ref_pure operation.
ref_semiapplicative
Applying wrapped by-ref functions within contexts with ref_apply.
ref_semimonad
Contexts supporting by-reference monadic sequencing via bind.
ref_traversable
By-reference traversal of structures.
ref_traversable_with_index
By-reference indexed traversal of structures.
ref_witherable
By-reference withering (effectful filtering) of structures.
ring
Types that extend Semiring with subtraction.
semiapplicative
Applying functions within a context to values within a context, without an identity element.
semigroup
Types that support an associative binary operation.
semigroupoid
Semigroupoids, representing objects and composable relationships (morphisms) between them.
semimonad
Sequencing of computations where the structure depends on previous results, without an identity element.
semiring
Types that form a semiring with addition and multiplication operations.
send_clone_fn
Thread-safe cloneable wrappers over closures that carry Send + Sync bounds.
send_deferrable
Deferred lazy evaluation using thread-safe thunks.
send_ref_applicative
Thread-safe by-ref applicative functors, combining SendRefPointed and SendRefSemiapplicative.
send_ref_apply_first
Thread-safe combining of two by-ref contexts, keeping the first value, with send_ref_apply_first.
send_ref_apply_second
Thread-safe combining of two by-ref contexts, keeping the second value, with send_ref_apply_second.
send_ref_counted_pointer
Thread-safe reference-counted pointers that carry Send + Sync bounds.
send_ref_foldable
Thread-safe by-reference variant of Foldable.
send_ref_foldable_with_index
Thread-safe by-reference variant of FoldableWithIndex.
send_ref_functor
Types that can be mapped over by receiving references to their contents, with thread-safe mapping functions.
send_ref_functor_with_index
Thread-safe by-reference variant of FunctorWithIndex.
send_ref_lift
Thread-safe lifting of binary functions via references with send_ref_lift2.
send_ref_monad
Thread-safe by-ref monads, combining SendRefApplicative and SendRefSemimonad.
send_ref_pointed
Thread-safe by-ref value injection with send_ref_pure.
send_ref_semiapplicative
Thread-safe by-ref function application within contexts with send_ref_apply.
send_ref_semimonad
Thread-safe by-ref monadic sequencing with send_ref_bind.
to_dyn_clone_fn
Pointer brands that can perform unsized coercion to dyn Fn trait objects.
to_dyn_fn
Coercion of sized closures into dyn Fn trait objects behind a Pointer.
to_dyn_send_fn
Pointer brands that can perform unsized coercion to thread-safe dyn Fn trait objects.
traversable
Data structures that can be traversed, accumulating results in an applicative context.
traversable_with_index
A Traversable with an additional index.
with_index
A type class for types that have a canonical index associated with their structure.
witherable
Data structures that can be traversed and filtered simultaneously in an applicative context.