- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: Code style advice
Fri, 2010-10-22, 16:14
On Fri, Oct 22, 2010 at 13:52, Jason Zaugg wrote:
> Typically you would prepend to the lists inside the fold, and reverse
> them afterwards.
Thanks, that is indeed nicer and more efficient.
Is it possible to write the foldLeft using a for comprehension
instead? Would it be prettier? I really don't like the type
annotations on the Nils.