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 additive::Additive;pub use arc_coyoneda::ArcCoyoneda;pub use cat_list::CatList;pub use conjunctive::Conjunctive;pub use coyoneda::Coyoneda;pub use coyoneda_explicit::BoxedCoyonedaExplicit;pub use coyoneda_explicit::CoyonedaExplicit;pub use disjunctive::Disjunctive;pub use dual::Dual;pub use endofunction::Endofunction;pub use endomorphism::Endomorphism;pub use first::First;pub use free::Free;pub use free::FreeStep;pub use identity::Identity;pub use last::Last;pub use lazy::ArcLazy;pub use lazy::ArcLazyConfig;pub use lazy::Lazy;pub use lazy::RcLazy;pub use lazy::RcLazyConfig;pub use multiplicative::Multiplicative;pub use optics::Composed;pub use optics::Lens;pub use optics::LensPrime;pub use pair::Pair;pub use rc_coyoneda::RcCoyoneda;pub use send_endofunction::SendEndofunction;pub use send_thunk::SendThunk;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_send_thunk::TrySendThunk;pub use try_thunk::TryThunk;pub use try_trampoline::TryTrampoline;
Modules§
- additive
- A newtype wrapper whose
SemigroupandMonoidinstances use addition fromSemiring. - arc_
coyoneda - Thread-safe reference-counted free functor with
Clonesupport. - 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.
- conjunctive
- A newtype wrapper whose
SemigroupandMonoidinstances use conjunction fromHeytingAlgebra. - const_
val - The
Constfunctor, which ignores its second type parameter. - control_
flow - Helpers and type class implementations for
ControlFlowin tail-recursive computations. - coyoneda
- The free functor, providing a
Functorinstance for any type constructor with the appropriateKindsignature. - coyoneda_
explicit - Coyoneda with the intermediate type made explicit, enabling zero-cost map fusion.
- disjunctive
- A newtype wrapper whose
SemigroupandMonoidinstances use disjunction fromHeytingAlgebra. - dual
- A newtype wrapper that reverses the order of a
Semigroup’s operation. - 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. - first
- A newtype wrapper whose
Semigroupinstance always keeps the first (leftmost) value. - 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.
- last
- A newtype wrapper whose
Semigroupinstance always keeps the last (rightmost) value. - lazy
- Memoized lazy evaluation with shared cache semantics.
- multiplicative
- A newtype wrapper whose
SemigroupandMonoidinstances use multiplication fromSemiring. - optics
- Optics for composable data accessors using profunctor encoding.
- option
- Functional programming trait implementations for the standard library
Optiontype. - pair
- Two-value container with
Bifunctorand dualFunctorinstances. - rc_
coyoneda - Reference-counted free functor with
Clonesupport. - 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 (functions
a -> a) withSemigroupandMonoidinstances based on function composition. - send_
thunk - Thread-safe deferred, non-memoized computation.
- 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_
send_ thunk - Thread-safe deferred, non-memoized fallible computation.
- 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.
- tuple_1
- Single-value tuple with
Functor,Applicative,Monad,MonadRec,Foldable,Traversable, and parallel folding instances. - tuple_2
- Two-value tuple with
Bifunctorand dualFunctorinstances. - vec
- Functional programming trait implementations for the standard library
Vectype.