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 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 Semigroup and Monoid instances use addition from Semiring.
arc_coyoneda
Thread-safe reference-counted free functor with Clone support.
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 Semigroup and Monoid instances use conjunction from HeytingAlgebra.
const_val
The Const functor, which ignores its second type parameter.
control_flow
Helpers and type class implementations for ControlFlow in tail-recursive computations.
coyoneda
The free functor, providing a Functor instance for any type constructor with the appropriate Kind signature.
coyoneda_explicit
Coyoneda with the intermediate type made explicit, enabling zero-cost map fusion.
disjunctive
A newtype wrapper whose Semigroup and Monoid instances use disjunction from HeytingAlgebra.
dual
A newtype wrapper that reverses the order of a Semigroup’s operation.
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.
first
A newtype wrapper whose Semigroup instance always keeps the first (leftmost) value.
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.
last
A newtype wrapper whose Semigroup instance always keeps the last (rightmost) value.
lazy
Memoized lazy evaluation with shared cache semantics.
multiplicative
A newtype wrapper whose Semigroup and Monoid instances use multiplication from Semiring.
optics
Optics for composable data accessors using profunctor encoding.
option
Functional programming trait implementations for the standard library Option type.
pair
Two-value container with Bifunctor and dual Functor instances.
rc_coyoneda
Reference-counted free functor with Clone support.
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 (functions a -> a) with Semigroup and Monoid instances based on function composition.
send_thunk
Thread-safe deferred, non-memoized computation.
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_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 Bifunctor and dual Functor instances.
vec
Functional programming trait implementations for the standard library Vec type.