3 ms·
Rust has a large ML influence from what I've seen. Pattern matching, restricted mutation, sum and product types, and traits immediately come to mind.
by jjnoakes 10y ago
Rust has a large ML influence from what I've seen. Pattern matching, restricted mutation, sum and product types, and traits immediately come to mind.
- saghm 10y agoAre traits really an ML thing? To me, they seem more similar to Haskell's typeclasses (and by "more similar to", I mean "almost exactly the same thing as"). From my somewhat limited experience with OCaml, it seems like the closest thing it has to traits is modules/functors, which seem to work fairly differently (i.e. traits are "added" to existing types, whereas functors are used to create new types).
- drivebyops 10y agoYep traits are definitely like typeclasses. Well F# might get it when Shapes gets into C# (C# version of traits/typeclasses which is being discussed)