You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce maybe capabilities x? to handle the case where a capture set
appears invariantly in its surrounding type.
Maybe capabilities are similar to TypeBounds types, but
restricted to capture sets. For instance,
Array[C^{x?}]
should be morally equivaelent to
Array[_ >: C^{} <: C^{x}]
but it has fewer issues with type inference.
deffill[A](n1: Int, n2: Int, n3: Int)(elem: =>A):CC[(CC[CC[A]^{elem}]^{elem})@uncheckedVariance]^{elem} =// !!! problem with checking rhs under cc
174
+
fill[CC[CC[A]^{elem}]^{elem}](n1)(fill(n2, n3)(elem))// !!! explicit type argument required under cc
175
175
176
176
/** Produces a four-dimensional $coll containing the results of some element computation a number of times.
177
177
* @paramn1 the number of elements in the 1st dimension
@@ -181,8 +181,8 @@ trait IterableFactory[+CC[_]] extends Serializable, Pure {
181
181
* @paramelem the element computation
182
182
* @return A $coll that contains the results of `n1 x n2 x n3 x n4` evaluations of `elem`.
183
183
*/
184
-
deffill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: =>A):CC[CC[CC[CC[A]]]@uncheckedVariance]^{elem} =// !!! problem with checking rhs under cc
185
-
???//fill(n1)(fill(n2, n3, n4)(elem))
184
+
deffill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: =>A):CC[(CC[CC[CC[A]^{elem}]^{elem}]^{elem})@uncheckedVariance]^{elem} =// !!! problem with checking rhs under cc
185
+
fill[CC[CC[CC[A]^{elem}]^{elem}]^{elem}](n1)(fill(n2, n3, n4)(elem))// !!! explicit type argument required under cc
186
186
187
187
/** Produces a five-dimensional $coll containing the results of some element computation a number of times.
188
188
* @paramn1 the number of elements in the 1st dimension
@@ -193,8 +193,9 @@ trait IterableFactory[+CC[_]] extends Serializable, Pure {
193
193
* @paramelem the element computation
194
194
* @return A $coll that contains the results of `n1 x n2 x n3 x n4 x n5` evaluations of `elem`.
195
195
*/
196
-
deffill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: =>A):CC[CC[CC[CC[CC[A]]]] @uncheckedVariance]^{elem} =// !!! problem with checking rhs under cc
197
-
???// fill(n1)(fill(n2, n3, n4, n5)(elem))
196
+
deffill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: =>A):CC[(CC[CC[CC[CC[A]^{elem}]^{elem}]^{elem}]^{elem}) @uncheckedVariance]^{elem} =// !!! problem with checking rhs under cc
197
+
fill[CC[CC[CC[CC[A]^{elem}]^{elem}]^{elem}]^{elem}](n1)(fill(n2, n3, n4, n5)(elem)) // !!! explicit type argument required under cc
198
+
198
199
199
200
/** Produces a $coll containing values of a given function over a range of integer values starting from 0.
0 commit comments