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.
-
-
Ha! To debug these, I tend to manually desugar until it's obvious.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This Tweet is unavailable.
-
I certainly hope not!
End of conversation
-
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
That would be helpful yes. But why not ‘for { .. } as[T]’ ? That would look neater (imho)
-
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.
- Show replies
New conversation -
-
-
Nja, not sure it is worth it as it makes the language more complicated with optional parameter. Opposite of one of the main goal of Dotty.
-
But don't you think there's plenty more complexity in an error message that tells you the opposite of what you want to be told (as I tried to show in my second tweet)?
- Show replies
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.