Re:Another Scala rant on HN
by CmonDev on Tuesday December 03, 2013 @08:31AM
(#6840083)
Agreed, Covariance / Contravariance was a fantastic feature to borrow from C#! It just should have been implemented to be friendlier to people new to language.
[ Parent
| on HN ]
Variance has been well understood in PL theory in basically forever. None of the languages had to borrow it from each other because they could all just get the inspiration from type theory.
Ehm... No. If any, C# borrowed it from Scala. C# got them in version 4.0, which was first half of 2010. Scala had them since I remember (from day 1?) - for sure they were in Scala 2.6, which was released in 2006.
Is that where he borrowed it from? I've seen mention of the language feature showing up in Eiffel, Sather, and so on. http://en.wikipedia.org/wiki/Covariance_and_contravariance_(...
And C# could only add it because the now-F# folks had originally designed it into the CLR Generics system. It's highly unlikely C# would ever go far out of the straightforward IL generation it does to implement such a feature otherwise.
Nope. The CLR has supported it back to v2, and C# delegates used the feature before language support was added in C# 4
Right, variance was part of the original MSR proposal for CLR Generics.
How did delegates use variance? I've never been terribly clear on the whole delegates concept - they're like first class functions, except nominally typed and weird.