Re: Why does for(x <- c; y = ...) yield {...} become c.map(x => (x, ...)).map((x,y) => {...})
Lex Spoon <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CALM2SnbpGrK96kxQJP-CC6XcPFzbiYOUSTDvLsE0KEKKqtfE=A@mail.gmail.com> |
Another approach to the question is to try and fuse together .map().map() into a single call to map(). Taking that approach, the desugaring of for() could remain nicely simple. It's not a trivial problem, although it simplifies the problem to only handle types that are in the standard library. On a related note, it would be really good if things like map() and foreach() got inlined when called on a type that's in the standard library. I know it feels like cheating, but it should make the most commonly written Scala code run much faster. Lex -- You received this message because you are subscribed to the Google Groups "scala-language" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.