• cgtjsiwy@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 years ago

    The author wanted “a more powerful type of inference that can actually infer the whole type of a function by analyzing the body of the function”, which Rust doesn’t have by design.

    • naonintendois@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 years ago

      I really prefer rust’s approach. The function signature is the contract. It makes it much easier to debug compared to overly generic pure functional code or c++ templates where everything is auto and perfect forwarded.

      The only time in rust where this isn’t true is with async functions. That’s because the compiler adds a ton of sugar to make it easier to write.