3 ms·
Are 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"). Fro
by saghm 10y ago
Are 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)