List AppendByFoldRight

object AppendByFoldRight {

  def append[T](l: List[T], z: List[T]): List[T] = FoldRight.foldRight(l, z)(_ :: _)

  def main(args: Array[String]): Unit = {

    println(append(List("1", "2", "3"), List("4", "5", "6")))

  }

}
List(1, 2, 3, 4, 5, 6)

 

posted on 2016-04-21 22:03  JonkeyGuan  阅读(213)  评论(0编辑  收藏  举报