|
|
|
|
|
by lomnakkus
3405 days ago
|
|
> Show me an example of a type class with five functions and then how I can reuse it while overriding one of these five. Huh? As I'm sure you're aware "type classes" != "classes", so I'm not sure why you're expecting them to be 'interchangeable' in this manner. It would be better to ask for some functionality (not a mechanism, as you're asking) and then show how one could be achieved[1] in one, but not the other. Personally, I think any kind of implementation override is a code smell. If you need common functionality, just have a plain function outside your class and use that from both interface overrides. [1] "Elegantly" or "expressively", one presumes. Of course everything can be achieved in any TC language. |
|