@@ -65,7 +65,7 @@ public class Functions
6565 */
6666 public static <T , R > R foldLeft (R accumulator ,
6767 Cursor <? extends T > cursor ,
68- Func2 <R , T , R > func )
68+ Func2 <R , ? super T , R > func )
6969 {
7070 for (cursor = cursor .start (); cursor .hasValue (); cursor = cursor .next ()) {
7171 accumulator = func .apply (accumulator , cursor .getValue ());
@@ -87,7 +87,7 @@ public static <T, R> R foldLeft(R accumulator,
8787 */
8888 public static <T , R > R foldRight (R accumulator ,
8989 Cursor <? extends T > cursor ,
90- Func2 <R , T , R > func )
90+ Func2 <R , ? super T , R > func )
9191 {
9292 return foldLeft (accumulator , reverse (cursor ), func );
9393 }
@@ -118,7 +118,7 @@ public static <T> Cursor<T> reverse(Cursor<? extends T> cursor)
118118 @ SuppressWarnings ("unchecked" )
119119 public static <T , R , A extends Insertable <R >> A collectAll (Cursor <? extends T > cursor ,
120120 A list ,
121- Func1 <T , R > func )
121+ Func1 <? super T , R > func )
122122 {
123123 for (cursor = cursor .start (); cursor .hasValue (); cursor = cursor .next ()) {
124124 list = (A )list .insert (func .apply (cursor .getValue ()));
@@ -139,7 +139,7 @@ public static <T, R, A extends Insertable<R>> A collectAll(Cursor<? extends T> c
139139 @ SuppressWarnings ("unchecked" )
140140 public static <T , R , A extends Insertable <R >> A collectSome (Cursor <? extends T > cursor ,
141141 A list ,
142- Func1 <T , Holder <R >> func )
142+ Func1 <? super T , Holder <R >> func )
143143 {
144144 for (cursor = cursor .start (); cursor .hasValue (); cursor = cursor .next ()) {
145145 Holder <R > mappedValue = func .apply (cursor .getValue ());
@@ -161,7 +161,7 @@ public static <T, R, A extends Insertable<R>> A collectSome(Cursor<? extends T>
161161 * @return
162162 */
163163 public static <T > Holder <T > find (Cursor <? extends T > cursor ,
164- Func1 <T , Boolean > func )
164+ Func1 <? super T , Boolean > func )
165165 {
166166 for (cursor = cursor .start (); cursor .hasValue (); cursor = cursor .next ()) {
167167 if (func .apply (cursor .getValue ())) {
@@ -184,7 +184,7 @@ public static <T> Holder<T> find(Cursor<? extends T> cursor,
184184 @ SuppressWarnings ("unchecked" )
185185 public static <T , A extends Insertable <T >> A reject (Cursor <? extends T > cursor ,
186186 A list ,
187- Func1 <T , Boolean > func )
187+ Func1 <? super T , Boolean > func )
188188 {
189189 for (cursor = cursor .start (); cursor .hasValue (); cursor = cursor .next ()) {
190190 if (!func .apply (cursor .getValue ())) {
@@ -206,7 +206,7 @@ public static <T, A extends Insertable<T>> A reject(Cursor<? extends T> cursor,
206206 @ SuppressWarnings ("unchecked" )
207207 public static <T , A extends Insertable <T >> A select (Cursor <? extends T > cursor ,
208208 A list ,
209- Func1 <T , Boolean > func )
209+ Func1 <? super T , Boolean > func )
210210 {
211211 for (cursor = cursor .start (); cursor .hasValue (); cursor = cursor .next ()) {
212212 if (func .apply (cursor .getValue ())) {
0 commit comments