So far, the only native method of chaining functions together in Scala I know of is using andThen/compose. It gets the job done but still looks very clunky. For example, if
You can experiment with Scalaz:
import scalaz._
import Scalaz._
def addNumber(i: Int, s: String) = s + i
def doubleString(s: String) = (s + s, (s + s).length)
def trimString(i: (String, Int)) = i._1.substring(0, i._2-1)
def main(args: Array[String]) : Unit =
println(addNumber(2, "44") |> doubleString |> trimString)