rustica/utils/
mod.rs

1//! # Utility Functions and Helpers
2//!
3//! This module provides a collection of utility functions and types that support
4//! functional programming patterns in Rust. These utilities enhance the core traits
5//! and datatypes with practical tools for common operations.
6//!
7//! ## Module Structure
8//!
9//! The utilities are organized into three main categories:
10//!
11//! ### Error Handling Utilities (`error_utils`)
12//!
13//! Standardized error handling functions and types that work with functional
14//! programming abstractions:
15//!
16//! - Type-class `WithError` for error transformation
17//! - Conversion functions between different error handling types (`Result`, `Either`, `Validated`)
18//! - Collection operations like `sequence` and `traverse` for error handling
19//! - `AppError` for contextual error reporting
20//!
21//! ### Higher-Kinded Type Utilities (`hkt_utils`)
22//!
23//! Generic functions and transformations for working with higher-kinded types:
24//!
25//! - Composition utilities for functions and transformations
26//! - Pipeline operations for chaining computations
27//! - Collection utilities like `filter_map`, `fan_out`, and `zip_with`
28//!
29//! ### Transformation Utilities (`transform_utils`)
30//!
31//! Tools for data transformation and operation chaining:
32//!
33//! - `transform_all` for applying transformations to collections
34//! - `transform_chain` for optional transformations
35//! - `Pipeline` type for fluent transformation chaining
36
37/// Error handling utilities for working with functional programming patterns.
38///
39/// This module provides standardized error handling functions that work with
40/// the functional programming abstractions in Rustica, including:
41///
42/// - Error mapping and transformation
43/// - Conversion between error types
44/// - Collection operations for error handling
45/// - Structured error types with context
46pub mod error_utils;
47
48/// Higher-kinded type utilities for generic programming.
49///
50/// This module provides functions and utilities for working with higher-kinded
51/// types and generic operations, including:
52///
53/// - Pipeline operations for chaining computations
54/// - Lifting and mapping functions for different contexts
55/// - Collection operations that preserve context
56/// - Function composition utilities
57pub mod hkt_utils;
58
59/// Data transformation utilities for functional operations.
60///
61/// This module provides utilities for transforming data in a functional style,
62/// including:
63///
64/// - Transformation operations for functorial types
65/// - Pipeline abstractions for chaining operations
66/// - Transformation utilities for collections
67pub mod transform_utils;