Aggelos Biboudis
Aggelos Biboudis

Reputation: 1195

Is variance of for generic type parameters in C# 4.0 a step closer for higher kind types?

We know that implementing classes are still invariant, despite the fact that their interfaces are variant. However I am inquiring, is cov/contravariance a step closer to parametric polymorphism or these are two separate concepts?

Upvotes: 4

Views: 509

Answers (1)

naasking
naasking

Reputation: 2566

Variance is related to subtyping, not really to kinds. That said, I think you might be able to use some subtyping tricks to get some of the benefits of higher kinds. I'm still stuck with C# 3 though, so I haven't experimented with this very much, but I certainly plan to.

Upvotes: 1

Related Questions