rustica/traits/
mod.rs

1//! Functional programming traits and abstractions.
2//!
3//! This module contains various traits that define core concepts and abstractions
4//! in functional programming. These traits provide a foundation for implementing
5//! functional programming patterns and techniques in Rust.
6//!
7//! ## Trait Categories
8//!
9//! The traits are organized into several conceptual categories:
10//!
11//! - **Core Abstractions**: Fundamental abstractions like Functor, Applicative, and Monad
12//! - **Composition Traits**: Traits related to function composition and transformation
13//! - **Data Structure Traits**: Traits for working with and combining data structures
14//! - **Advanced Abstractions**: More specialized abstractions for advanced functional programming
15//!
16//! ## Getting Started
17//!
18//! If you're new to functional programming, start with Functor, Applicative, and Monad
19//! which form the foundation of most functional programming patterns.
20
21// ===== Core Evaluation Concepts =====
22/// Traits for evaluating and processing data.
23pub mod evaluate;
24/// Higher-kinded type abstractions for generic programming.
25pub mod hkt;
26/// Creation of values in a computational context.
27pub mod pure;
28
29// ===== Fundamental Abstractions =====
30/// Function application within a computational context.
31pub mod applicative;
32/// Structure-preserving mapping over computational contexts.
33pub mod functor;
34/// Sequential computation with context binding.
35pub mod monad;
36/// Error handling within monadic contexts.
37pub mod monad_error;
38/// Monads with zero and plus operations.
39pub mod monad_plus;
40
41// ===== Related Abstractions =====
42/// Mapping over two-type data structures.
43pub mod bifunctor;
44/// Extracting values from comonadic contexts.
45///
46/// This module provides the Comonad trait which represents the categorical dual of a monad.
47pub mod comonad;
48
49// ===== Composition Traits =====
50/// Arrow-based computation abstractions.
51///
52/// This module provides the Arrow trait which represents arrow-based computation abstractions.
53pub mod arrow;
54/// Categorical composition abstractions.
55///
56/// This module provides the Category trait which represents a category in the sense of category theory.
57pub mod category;
58
59// ===== Data Structure Traits =====
60/// Reduction of data structures to a single value.
61///
62/// This module provides the Foldable trait which represents data structures that can be "folded" into a summary value.
63pub mod foldable;
64/// Combinable types with identity elements.
65///
66/// This module provides the Monoid trait, which extends Semigroup to add an identity element.
67/// The MonoidExt trait adds extension methods to all types implementing Monoid.
68pub mod monoid;
69/// Combinable types without identity elements.
70pub mod semigroup;
71/// Traversing data structures with effects.
72pub mod traversable;
73
74// ===== Advanced Abstractions =====
75/// Choice between alternative computations.
76pub mod alternative;
77
78/// Isomorphism between types.
79///
80/// This module provides the Iso trait which represents isomorphisms between types.
81pub mod iso;