Refactoring / layout of functional Scala
问题 This one liner... Console.println(io.Source.fromFile("names.txt").getLines.mkString.split(",").map{x:String => x.slice(1, x.length -1)}.sortBy { x => x}.zipWithIndex.map{t =>{ (t._2 +1)*(t._1.map{_.toChar - "A"(0).toChar + 1}.sum)}}.sum); ... is my solution to Project Euler problem 22. It seems to work, and it's written in (my attempt at) functional style. This example is a bit extreme, but my question is a bit more general - how do you prefer to write/format/comment functional style code?