User loginNavigation |
archivesDifferent approaches to letting a programmer define interface implementations.I'm looking at how different statically typed languages tackle the problem of letting you define types and define interface implementations for those types. For example, to define an implementation of interface I for type T, Java uses interface methods, Haskell uses typeclasses, Scala uses implicits. The disadvantage of the Java approach when compared with Haskell/Scala:
Haskell approach vs Scala approach:
What do you think is the "right" way to do this? Given my limited knowledge right now, I think I'd go with something Scala-like and maybe make some modifications. For example, I think the "only one implementation per type" restriction of Haskell might be useful. Is there a good survey of the different approaches? |
Browse archivesActive forum topics |
Recent comments
22 weeks 3 days ago
22 weeks 3 days ago
22 weeks 3 days ago
44 weeks 5 days ago
49 weeks 1 hour ago
50 weeks 4 days ago
50 weeks 4 days ago
1 year 1 week ago
1 year 5 weeks ago
1 year 5 weeks ago