1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//!
//! Prelude: Core Functional Data Types
//!
//! This module re-exports Rustica's core functional data types for expressive, type-safe programming.
//! These types encode common functional programming patterns such as optionality, error handling,
//! validation, state, dependency injection, and more.
//!
//! ## Included Data Types
//!
//! - [`Maybe`]: Optional values (like Option)
//! - [`Either`]: Sum type for error handling or branching
//! - [`Validated`]: Error accumulation and validation
//! - [`Choice`]: Non-deterministic computation with multiple alternatives
//! - [`State`]: Composable stateful computations
//! - [`Reader`]: Dependency injection/context passing
//! - [`Writer`]: Output accumulation (logging, etc.)
//! - [`Id`]: Identity functor
//! - [`IO`]: Side-effectful computations
//! - [`Cont`]: Continuation-passing style
//! - [`Lens`, `Prism`, `IsoLens`, `IsoPrism`]: Optics for immutable data access
//!
//! ## Usage Example
//!
//! ```rust
//! use rustica::prelude::datatypes::*;
//! use rustica::traits::functor::Functor;
//!
//! let x = Maybe::Just(42);
//! let y = x.fmap(|n| n + 1);
//! assert_eq!(y, Maybe::Just(43));
//!
//! let e: Either<&str, i32> = Either::right(10);
//! let mapped = e.fmap(|n| n * 2);
//! assert_eq!(mapped, Either::right(20));
//!
//! let v: Validated<&str, i32> = Validated::valid(5);
//! assert!(v.is_valid());
//! ```
//!
//! See each type's documentation for more details and advanced usage.
pub use crateAsyncM;
pub use crateChoice;
pub use crateCont;
pub use crateEither;
pub use crateId;
pub use crateIO;
pub use crateIsoLens;
pub use crateIsoPrism;
pub use crateLens;
pub use crateMaybe;
pub use cratePrism;
pub use crateReader;
pub use crateState;
pub use crateValidated;
pub use crateWriter;