On Sunday, January 10, 2016 at 6:34:09 AM UTC+8, Mauro 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? 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.

Reply via email to