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) withSemigroupandMonoidinstances based on function composition. - endomorphism
- Wrapper for endomorphisms (morphisms
c a ain a category) withSemigroupandMonoidinstances based on categorical composition. - fn_
brand - Reference-counted cloneable function wrappers with
SemigroupoidandCategoryinstances. - free
- Stack-safe Free monad over a functor with O(1)
bindoperations. - 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
Optiontype. - pair
- Two-value container with
Bifunctorand dualFunctorinstances. - rc_ptr
- Single-threaded reference-counted pointer abstraction using
Rc. - result
- Functional programming trait implementations for the standard library
Resulttype. - send_
endofunction - Thread-safe wrapper for endofunctions with
SemigroupandMonoidinstances. - step
- Control type representing Loop/Done states for tail-recursive computations.
- string
SemigroupandMonoidinstances for the standard libraryStringtype.- 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
Vectype.