-
Notifications
You must be signed in to change notification settings - Fork 19
allow basic assignment as the preamble to a for comprehension #143
Comments
this is SI-907, closed as wontfix (by Paul in 2011), but only provisionally closed. |
incidentally, I don't think this issue tracker is intended for this kind of thing. (if I'm wrong about that, I guess someone from Typelevel will say so, I'm just an onlooker.) there used to be tons of open issues here for random language improvements/changes like this; they were closed en masse by Miles a while back; see https://github.com/typelevel/scala/issues?q=label%3Adefunct+is%3Aclosed |
yeah, I know about the mass closings, I also don't know how the tracker should be used... there is no other space to capture ideas that would be good for FP Scala. I'm using this ticket tracker as a way to put my thoughts down because there is only so much can be discussed in a transitive gitter room (and gitter seems to be very quiet in general these days). |
For general information, for Scala in general the avenue for discussing potential language features/enhancements is a thread on https://contributors.scala-lang.org/. |
When writing
Free
code, one expects to be able to write entire methods as for comprehensions.However, the
for
syntax is limited such that the first line defines the type for the remainder, which means that we cannot put simple assignments in there.e.g. I'd like to write
but this must be written as (note the extra layer of indentation)
or
It would be really good, and help support cleaner FP style code, if the code I expect to be able to write was rewritten using
val
s.This would need to be done in
parser
, with care taken not to break theRangePosition
s.The text was updated successfully, but these errors were encountered: