Does rust support partial [application for] functions?

The following works, and will soon be on stable Rust :slightly_smiling_face::

#![feature(min_type_alias_impl_trait)]

type Add2 = impl Fn(u32) -> Add1;
type Add1 = impl Fn(u32) -> u32;

fn add3 (x: u32)
  -> Add2
{
    move |y: u32| {
        move |z: u32| {
            x + y + z
        }
    }
}

fn main ()
{
    assert_eq!(6, add3 (1) (2) (3));
}
4 Likes