Expand description
Cloneable wrappers over closures for generic handling of functions in higher-kinded contexts.
The CloneFn trait defines the type of the wrapper, parameterized by
a ClosureMode that determines whether the
wrapped closure takes owned values (Val) or
references (Ref).
The LiftFn trait provides construction of Val-mode wrapped functions.
§Examples
use fp_library::{
brands::*,
functions::*,
};
let f = lift_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
assert_eq!(f(5), 10);Traits§
- CloneFn
- A trait for cloneable wrappers over closures, parameterized by closure mode.
- LiftFn
- A trait for constructing Val-mode cloneable function wrappers from closures.
- RefLift
Fn - A trait for constructing Ref-mode cloneable function wrappers from closures.