1. 19
  1.  

  2. 15

    All these folks out here noting that sum types existed in ML or Swift or F# or w/e. Who cares, this person found a cool thing that they like and I, for one, am happy for them. The fact that they came across them in Rust first only means that they will be extra excited to find them in Haskell later.

    Maybe just be happy for them and read a pretty good article about sum types.

    1. 4

      The fact that they came across them in Rust first only means that they will be extra excited to find them in Haskell later.

      That’s why (many) people point out the history, because we are excited to share it and spread the excitement. Of course, to a certain extent we also want to give proper attribution where it’s due, because our field really sorely lacks it sometimes.

    2. 5

      tl;dr; They are sum types just like in Swift or F#.

      1. 5

        I hope we are going to see a post about how Rust immutability is amazing soon. After that we can have articles about every single ML feature that existed for decades that Rust successfully implemented.

        1. 8

          You mean, it’s not a good thing to implement great features of a language that basically nobody is using into a new language that makes things better and more appealing?

          1. 2

            No, I mean presenting it as a novel idea when in fact it is around for 30 years is kind of funny.

            that basically nobody is using into a new language

            Factually incorrect. Please have a look at the languages in the ML family.

          2. 4

            It’s no secret that Rust was heavily inspired by ML, C, C++, etc. Rust itself has very few new language features, the borrow checker being one of them.

            But Rust appeals to the low-level systems crowd, and brings with itself a ton of nice-to-haves from ML and the like. So people who were previously stuck with C-like enums suddenly have nice options and want to talk about it.

            1. 4

              What’s so bad about highlighting the strengths of a programming language?

            2. 2

              PEP 634 is also bringing sum types to Python.