Here's a Scala 3 feature suggestion: I'd like to write for-comprehensions which know their generator type, like so: for[List] { x <- xs y <- ys } yield ... It would make it much easier to work out whether `xs` or `ys` is the wrong type.
I'm not so sure. Where does the `yield` go relative to `as`, and why introduce another keyword? Appending the type constructor immediately after the `for` is akin to explicitly specifying the type parameter to a method.
-
-
That type parameter constrains the parameters (which come after it), in the same way that the `for`'s "type parameter" would constrain the generators which come after it.
-
Indeed, forget my comment.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.