-
Notifications
You must be signed in to change notification settings - Fork 34
value definitions before generator? #2
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
Comments
The grammar of Scala defines So making it work nicely is not possible without actually modifying the syntax. Some custom syntax can be made to work, however. E.g.: for {
x <- pure(42)
y <- Option(33)
} yield x + y This is syntactically valid, and after parser becomes:
Which can be matched against and transformed into:
This will save the user from needing to specify the monadic type they are operating on, as compared to |
"matched against and transformed into" ... and also that final
|
The idea is that initial I used
Well, for |
what I mean is that if a for {
...
a <- doA
} yield a the final |
Any chance you could implement scala/bug#907 ?
The text was updated successfully, but these errors were encountered: