An Alternative Syntax for Async Functions

async modifying the return type is definitely one of the weirdest parts of the language to me - not to say that the proposed

async fn foo() -> impl Future<Output = usize> { 1 }

is reasonable either.

Spitballing some intermediate points:

  1. fn foo() -> async(usize) { 1 }
  2. async fn foo() -> impl Future<usize> { 1 }
  3. fn foo() -> impl Future<usize> => async { 1 }
  4. async fn foo() -> k#future usize { 1 }
  5. fn foo() -> k#future usize => async { 1 }
  6. fn foo() -> k#fut usize => async { 1 }
  7. async fn foo() -> k#fut usize { 1 }
  8. fn foo() => async { 1 }: usize
2 Likes