3 ms·
It's impossible to write a compose function with the declaration fn compose<T, F: Fn(T) -> T>(f1: F, f2: F) -> F As far as I'm aware the only way to write a
by Sean1708 7y ago
It's impossible to write a compose function with the declaration
fn compose<T, F: Fn(T) -> T>(f1: F, f2: F) -> F
As far as I'm aware the only way to write a function like that is
fn compose<T, F: Fn(T) -> T>(f1: F, f2: F) -> F {
f1
}
and even then you can only call it like this
let clos = |x| 2 * x;
compose(clos, clos);