4 ms·
F# doesn't in fact make use of {co|contra}variance: it only needed generics. (Although F# used to run on .NET 1.x using its own implementation of generics - Don
by timrobinson 16y ago
F# doesn't in fact make use of {co|contra}variance: it only needed generics. (Although F# used to run on .NET 1.x using its own implementation of generics - Don Syme designed both .NET generics and the F# language.)
For type inference, you just need a sufficiently smart compiler, although it's much more useful if your language knows about generic types.
- pmjordan 16y agoThanks for clearing that up (I've yet to try F# in anger). I suppose pre-generics F# did similar type wrangling to Scala's?
- timrobinson 16y agoI don't know about Scala, but yes, wrangling describes well what F# used to do. I never used F# before .NET 2.0, but the techniques it used on 1.x could be interesting -- I'll see if I can find some old documentation... Edit: There used to be a paper describing the technique. I can't find it now, but here's an old Don Syme announcement related to it: http://www.mail-archive.com/dotnet-rotor@discuss.develop.com/msg00424.html http://www.mail-archive.com/dotnet-rotor@discuss.develop.com...