-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Conversion.into method #11668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Conversion.into method #11668
Conversation
was |
I am also not sure what's the best name. I have the feeling that One consideration is that the name should work well with and without a type parameter. Compare: xs.into xs.as xs.inject
xs.into[C] xs.as[C] xs.inject[C] I have the impression |
how about |
|
Maybe |
@soronpo It doesn't work without the type parameter. |
library/src/scala/Conversion.scala
Outdated
object Conversion: | ||
|
||
extension [T](x: T) | ||
/** `x.into[U]` converts a value `x` of type `T` to type `U` */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change comment too
Small upgrade to make conversions easier to use explicitly.