|
|
|
|
|
by pron
4596 days ago
|
|
Can you write any program with only case classes and sealed traits? Yes; Haskell does it. Can you write any program with just structural types? Yes, JS does it. Can you write any program with just inheritance types? Yes, Java, C++ and C# do it. Ergo, Scala has three type systems, and it doesn't matter whether you make them appear as one. > It's all part of the same system; whether you call it an "ADT" or a "class hierarchy" is a design pattern thing more than a rigid systemic property. Obviously it's part of the same system, which just happens to be a superset of three type systems. A type system is not how its implemented but what it does. |
|