Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn make_multiplier(x: u32) -> impl Fn(u32) -> u32 {
- move |y| y * x
- }
- fn make_combinator(f: impl Fn(u32) -> u32) -> impl Fn(u32) -> u32 {
- move |x| f(f(f(x)))
- }
- fn main() {
- println!("{}", make_combinator(make_multiplier(2))(3));
- }
Add Comment
Please, Sign In to add comment