Skip to main content

Module types

Module types 

Source
Expand description

Concrete data types, their corresponding implementations and type aliases.

This module provides implementations of various functional programming data structures and wrappers, including Identity, Lazy, and extensions for standard library types like Option and Result.

§Examples

use fp_library::types::Identity;

let x = Identity(5);
assert_eq!(x.0, 5);

Re-exports§

pub use cat_list::CatList;
pub use endofunction::Endofunction;
pub use endomorphism::Endomorphism;
pub use free::Free;
pub use identity::Identity;
pub use lazy::ArcLazy;
pub use lazy::ArcLazyConfig;
pub use lazy::Lazy;
pub use lazy::LazyConfig;
pub use lazy::RcLazy;
pub use lazy::RcLazyConfig;
pub use pair::Pair;
pub use send_endofunction::SendEndofunction;
pub use step::Step;
pub use thunk::Thunk;
pub use trampoline::Trampoline;
pub use try_lazy::ArcTryLazy;
pub use try_lazy::RcTryLazy;
pub use try_lazy::TryLazy;
pub use try_thunk::TryThunk;
pub use try_trampoline::TryTrampoline;

Modules§

arc_ptr
Thread-safe reference-counted pointer abstraction using Arc.
cat_list
Efficient queue-like structure with O(1) append and O(1) amortized uncons.
endofunction
Wrapper for endofunctions (functions a -> a) with Semigroup and Monoid instances based on function composition.
endomorphism
Wrapper for endomorphisms (morphisms c a a in a category) with Semigroup and Monoid instances based on categorical composition.
fn_brand
Reference-counted cloneable function wrappers with Semigroupoid and Category instances.
free
Stack-safe Free monad over a functor with O(1) bind operations.
identity
Trivial wrapper that contains a single value.
lazy
Memoized lazy evaluation with shared cache semantics.
option
Functional programming trait implementations for the standard library Option type.
pair
Two-value container with Bifunctor and dual Functor instances.
rc_ptr
Single-threaded reference-counted pointer abstraction using Rc.
result
Functional programming trait implementations for the standard library Result type.
send_endofunction
Thread-safe wrapper for endofunctions with Semigroup and Monoid instances.
step
Control type representing Loop/Done states for tail-recursive computations.
string
Semigroup and Monoid instances for the standard library String type.
thunk
Deferred, non-memoized computation with higher-kinded type support.
trampoline
Stack-safe computation type with guaranteed safety for unlimited recursion depth.
try_lazy
Memoized lazy evaluation for fallible computations.
try_thunk
Deferred, non-memoized fallible computation with higher-kinded type support.
try_trampoline
Stack-safe fallible computation type with guaranteed safety for unlimited recursion depth.
vec
Functional programming trait implementations for the standard library Vec type.