Guest User

Untitled

a guest
May 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. fn make_multiplier(x: u32) -> impl Fn(u32) -> u32 {
  2. move |y| y * x
  3. }
  4.  
  5. fn make_combinator(f: impl Fn(u32) -> u32) -> impl Fn(u32) -> u32 {
  6. move |x| f(f(f(x)))
  7. }
  8.  
  9. fn main() {
  10. println!("{}", make_combinator(make_multiplier(2))(3));
  11. }
Add Comment
Please, Sign In to add comment