> How come last one should be same? Aren't they different types? I'd expect 
> `Array[Int] ~~ Positional[Numeric]` to give False

They are different types, but one could logically be considered a "subtype" of 
the other (and would be in some programming languages).

E.g. in C#, a class Foo which takes a type parameter can define whether it 
wants to be, with regard to that parameter (using Perl 6 notation):

  covariant:     Foo[Dog] ~~ Foo[Animal]
  contravariant: Foo[Animal] ~~ Foo[Dog]
  invariant:     neither

(Or at least that's how I understand it, I'm just starting to learn C#.)

It appears that in Perl 6, currently only *Invariance* is supported for 
parameterized types.

Whether that is a conscious design choice ("keeping it simple"), or something 
that might be extended in the future given sufficient demand/tuits, is 
something that jnthn should be able to answer, since if I'm not mistaken he's 
done much of the Perl 6 OO work and is also a C#/Java expert.

Reply via email to