2 ms·
Trait aliases will make some of those unwieldly declarations a bit easier on the eyes #![feature(trait_alias)] trait Map<T> = Fn(T) -> T; fn compo
by the8472 7y ago
Trait aliases will make some of those unwieldly declarations a bit easier on the eyes
#![feature(trait_alias)]
trait Map<T> = Fn(T) -> T;
fn compose <T>(f1: impl Map<T>, f2: impl Map<T>) -> impl Map<T> {
|n| f1(f2(n))
}
- The_rationalist 7y agoThis is a nice feature, do you know any other language that has something similar?