http://www.artima.com/pins1ed/type-parameterization.html
第1版の19.4
「メソッド値パラメーターの位置は、メソッド外の位置を基準にした反転分類に分類されます。」
「メソッド値パラメーターの位置に加えて、現在の分類もメソッドのタイプパラメーターで反転されます。」
この場合の反転は、「正から反転」、つまり負を意味します。
ボーナスポイントについては、このモデルの物理的な解釈を示すLOLcatを生成します。
追加のQ&A:
Okay let's look at the 3rd value parameter "listener".
It has a annotation of: Cat[U^+, T^-]^-.
Why does U have +? Why does T have -? Why does the whole thing have a -?
メソッドparamは反変の位置であるため、最も外側(右端)のマイナスになります。
Catのタイプパラメータは[-T、+ U]であるため、この反転位置では[+、-]になります。(適用されている実際のパラメーター[U、T]は関係ありません。)実際のパラメーターはそれぞれ共変および逆変であるため、チェックします。
さらに質問を:
Could you kindly describe on SO why the return value type has the following annotation
for the sake of completeness...
Also could you be so kind as to give an example of the following rule?
A classification is sometimes flipped at the type argument position of a type...
この2番目の追加の質問は、前の最初の追加の質問と同じです。2つのCat[+、-]は反転を示し、結果タイプCat [-、+]は反転しないことを示します。
このスレッドは、パラメーター(渡すもの)と結果(取得するもの)の変動に対するさらなる動機付けを提供します。
https://groups.google.com/forum/#!topic/scala-user/ViwLKfvo3ec
Javaの議論と例(PECSまたはNaftalinとWadler)は、Scalaが提供するものの背景として役立つことがわかりました。