3 ms·
Isn't subtyping OO the principal way to do polymorphism in F#? I ask because the last time I looked, it didn't do type classes, nor ML modules, but maybe that'
by sixbrx 12y ago
Isn't subtyping OO the principal way to do polymorphism in F#? I ask because the last time I looked, it didn't do type classes, nor ML modules, but maybe that's changed. Scala has a pretty powerful notion of type classes and this is a big part of what gives it a functional feel to me.
- bjz_ 12y agoType classes are pretty orthogonal to FP as far as I can tell. It's probably more that it gives it a "Haskelly feel".
- sixbrx 12y agoI think it's more than that - it's also that type classes allow a type of polymorphism that is not the subtyping polymorphism that mainstream OO depends so heavily on. ML attacks from a different direction with its parameterized modules, but with a similar result. That's why I feel like something's missing from F# in this regard, in comparison to other statically typed functional languages.