I don’t have any pointers to Julia-specific discussion, but this paper from the Kotlin project is rather enlightening on the subject: http://www.cs.cornell.edu/~ross/publications/mixedsite/ . In particular, Kotlin has come up with a rather clever solution to the co-/contra-variance mess from Java, but I’d challenge anyone who thinks the solution is “simple”.
On January 10, 2016 at 10:08:57, Mauro ([email protected]) wrote: >> > It would be interesting to learn why this is the case because I would >> think it should be. >> >> Have you read through the, I think linked, wikipedia article? You only >> need to read the Array section: >> >> https://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29#Arrays >> >> > Hi Mauro, > > Thanks for the link. That does explain it in the sense that I now know > Vector is invariant in Julia, but that begs the question, can we specify a > constructor to be covariant or contravariant in Julia? I think this has been discussed (no references though), but it would make Julia more complicated. Scala can do it, but also has a reputation of being complicated... So, I suspect that it will not be added. > One of my longer terms dreams is to be able to do category theory in > Julia similar to Haskell > <https://en.wikibooks.org/wiki/Haskell/Category_theory>. It seems this > would be important to do categories properly.
