2 ms·
So they're a bit like open classes in Ruby or implicit conversions in Scala?
by k__ 9y ago
So they're a bit like open classes in Ruby or implicit conversions in Scala?
- lmm 9y agoThey achieve the same result, but in a quite different way. I see them as decoupling the "implements X" piece of a traditional OO class in a language that has interfaces from the class itself.
- jnbiche 9y agoIf you're familiar with Scala, then type classes in Haskell are pretty close to traits in Scala (but not implicit conversions, which can make use of traits, but are an orthogonal language feature). They're also close to Rust's traits, it you're familiar with Rust.
- k__ 9y agoI see. Thanks.