This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Code style advice

No replies
Olivier Pernet
Joined: 2010-03-13,
User offline. Last seen 42 years 45 weeks ago.

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.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland