What is a good approach for collecting and using useful Scala utility features for all projects. The focus here is on really simple, stand-alone functions, such as:
def toBinary(i: Int, digits: Int = 8) = String.format("%" + digits + "s", i.toBinaryString).replace(' ', '0') def concat(ss: String*) = ss filter (_.nonEmpty) mkString ", " concat: (ss: String*)String
This question is the main one, I know ;-), but, I found out that there is always an optimal way to do something. For example, reusing code from the Scala, Idea, Eclipse interactive shell, with or without SBT, with a library running on GitHub, etc., can quickly introduce optimal and non-optimal approaches to such a simple problem.
source share