pub trait Composable1D<T, U>where
T: Function1D,
U: Function1D,{
fn compose(self, other: T) -> Result<U, Error>;
}
Expand description
General Information
The composition, given f
, the function on which this trait is implemented, and g
, the function inside the trait’s only function, is done like:
f(g(x))
All composable functions need to implement this trait. When a functions needs to be composed with another, the latter one needs to be specified a priori,
and the result of the composition needs to be known. This means that the trait Composable<latter, result> needs to be implemented.
Functions
compose(...)
- Returns a function from the composition of the two functions involved. Consumes functions.