I remember someone already proposed this some time...
# announcements
g
I remember someone already proposed this some time ago as part of the language
e
That is called “type classes” :)
g
No, I mean extend each data class implicitly from interface with component1..N method and have Component1, Component2 interfaces
c
As I know the return type of componentN() for each data class is depending on the type of its corresponding property. How can we have a common interface of that?
g
interface Component1<A>
,
interface Component2<A, B> : Component<A>
etc