You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stumbling upon Proxies/Dynamic I found this scala-users question https://users.scala-lang.org/t/how-about-a-typed-dynamic/989/8
It speaks about a trait TypedDynamic[T] extends T which I would really like to have available just now ;-). More concretely, I think that the needed interface is a abstract class TypedDynamic[T](t: T) extends T
From my intuitive understanding it seems that shapeless is just the right spot to implement such a feature.
Let me demonstrate the functionality I am particularly after:
// given some Interfaces like T and functionalities thereupon like f ...valt:T= ...
deff(t: T) = ...
// ... I would like to be able to CONVENIENTLY overwrite specific methods // of the interface T while still being able to use function f// ... "abstract class TypedDynamic[T](t:T) extends T" is supposed to give just that // and should be usable like
f(newTypedDynamic(t){
defmySpecificMethofWhichIWouldLikeToOverwrite(...) = ...
})
The crucial point is that ONLY the overwritten method needs to be provided and all (other) methods of T
have suitable default implementations referring to the provided t:T itself.
Is this possible?
Is this easily possible?
thanks a lot for reading!
EDIT: concerning naming,
I find it more intuitive to speak of this as Proxy[T] instead of TypedDynamic, however because the latter was used the scala-user question, I sticked to it for the example.
The text was updated successfully, but these errors were encountered:
Dear shapeless-team,
stumbling upon Proxies/Dynamic I found this scala-users question https://users.scala-lang.org/t/how-about-a-typed-dynamic/989/8
It speaks about a
trait TypedDynamic[T] extends T
which I would really like to have available just now ;-). More concretely, I think that the needed interface is aabstract class TypedDynamic[T](t: T) extends T
From my intuitive understanding it seems that shapeless is just the right spot to implement such a feature.
Let me demonstrate the functionality I am particularly after:
The crucial point is that ONLY the overwritten method needs to be provided and all (other) methods of
T
have suitable default implementations referring to the provided
t:T
itself.Is this possible?
Is this easily possible?
thanks a lot for reading!
EDIT: concerning naming,
I find it more intuitive to speak of this as
Proxy[T]
instead of TypedDynamic, however because the latter was used the scala-user question, I sticked to it for the example.The text was updated successfully, but these errors were encountered: