2012-03-12から1日間の記事一覧
Scala by Example > 演習9.1.1の解答案です。 def isort(xs: List[Int]): List[Int] = xs match { case List() => List() case x :: xs1 => insert(x, isort(xs1)) } def insert(x: Int, xs: List[Int]): List[Int] = xs match { case List() => List(x) cas…